Class: ApacheFelix::BundleApi

Inherits:
Object
  • Object
show all
Defined in:
lib/apache_felix_webconsole_client/api/bundle_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BundleApi

Returns a new instance of BundleApi.



30
31
32
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 30

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#info(bundle_id, opts = {}) ⇒ BundleList

Bundle Info Display all information about a bundle, including properties. The returned list will contain one entry, the requested bundle. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundle_id

    The symbolic name or id of the bundle.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



39
40
41
42
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 39

def info(bundle_id, opts = {})
  data, _status_code, _headers = info_with_http_info(bundle_id, opts)
  return data
end

#info_with_http_info(bundle_id, opts = {}) ⇒ Array<(BundleList, Fixnum, Hash)>

Bundle Info Display all information about a bundle, including properties. The returned list will contain one entry, the requested bundle. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundle_id

    The symbolic name or id of the bundle.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BundleList, Fixnum, Hash)>)

    BundleList data, response status code and response headers



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 49

def info_with_http_info(bundle_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BundleApi.info ..."
  end
  # verify the required parameter 'bundle_id' is set
  fail ArgumentError, "Missing the required parameter 'bundle_id' when calling BundleApi.info" if bundle_id.nil?
  # resource path
  local_var_path = "/bundles/{bundleId}.json".sub('{format}','json').sub('{' + 'bundleId' + '}', bundle_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BundleList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BundleApi#info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#install(bundlefile, action, opts = {}) ⇒ nil

Upload a bundle. Install the provided bundle. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundlefile

    The bundle to upload.

  • action

    The action to execute. Only allowed value is &#39;install&#39;, must be provided. Limitation of Swagger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :bundlestart (BOOLEAN)

    Flag to indicate whether or not bundle should be started.

  • :bundlestartlevel (Integer)

    The start level of the provided bundle.

  • :refresh_packages (BOOLEAN)

    Flag to indicate whether or not to refresh all pacakges once installed.

Returns:

  • (nil)


100
101
102
103
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 100

def install(bundlefile, action, opts = {})
  install_with_http_info(bundlefile, action, opts)
  return nil
end

#install_with_http_info(bundlefile, action, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Upload a bundle. Install the provided bundle. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundlefile

    The bundle to upload.

  • action

    The action to execute. Only allowed value is &#39;install&#39;, must be provided. Limitation of Swagger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :bundlestart (BOOLEAN)

    Flag to indicate whether or not bundle should be started.

  • :bundlestartlevel (Integer)

    The start level of the provided bundle.

  • :refresh_packages (BOOLEAN)

    Flag to indicate whether or not to refresh all pacakges once installed.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 114

def install_with_http_info(bundlefile, action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BundleApi.install ..."
  end
  # verify the required parameter 'bundlefile' is set
  fail ArgumentError, "Missing the required parameter 'bundlefile' when calling BundleApi.install" if bundlefile.nil?
  # verify the required parameter 'action' is set
  fail ArgumentError, "Missing the required parameter 'action' when calling BundleApi.install" if action.nil?
  # verify enum value
  unless ['install'].include?(action)
    fail ArgumentError, "invalid value for 'action', must be one of install"
  end
  # resource path
  local_var_path = "/bundles/install".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["bundlefile"] = bundlefile
  form_params["action"] = action
  form_params["bundlestart"] = opts[:'bundlestart'] if !opts[:'bundlestart'].nil?
  form_params["bundlestartlevel"] = opts[:'bundlestartlevel'] if !opts[:'bundlestartlevel'].nil?
  form_params["refreshPackages"] = opts[:'refresh_packages'] if !opts[:'refresh_packages'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BundleApi#install\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(opts = {}) ⇒ BundleList

List bundles List all the bundles in the Felix system. Properties for a bundle will not be populated. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



170
171
172
173
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 170

def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  return data
end

#list_with_http_info(opts = {}) ⇒ Array<(BundleList, Fixnum, Hash)>

List bundles List all the bundles in the Felix system. Properties for a bundle will not be populated. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BundleList, Fixnum, Hash)>)

    BundleList data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 179

def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BundleApi.list ..."
  end
  # resource path
  local_var_path = "/bundles.json".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BundleList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BundleApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#modify(bundle_symbolic_name, action, opts = {}) ⇒ BundleState

Modify bundles operation. Take action on a bundle; start, stop, update, refresh, uninstall. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundle_symbolic_name

    The OSGi Symbolic name of the bundle.

  • action

    The action to execute.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



225
226
227
228
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 225

def modify(bundle_symbolic_name, action, opts = {})
  data, _status_code, _headers = modify_with_http_info(bundle_symbolic_name, action, opts)
  return data
end

#modify_with_http_info(bundle_symbolic_name, action, opts = {}) ⇒ Array<(BundleState, Fixnum, Hash)>

Modify bundles operation. Take action on a bundle; start, stop, update, refresh, uninstall. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • bundle_symbolic_name

    The OSGi Symbolic name of the bundle.

  • action

    The action to execute.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BundleState, Fixnum, Hash)>)

    BundleState data, response status code and response headers



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 236

def modify_with_http_info(bundle_symbolic_name, action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BundleApi.modify ..."
  end
  # verify the required parameter 'bundle_symbolic_name' is set
  fail ArgumentError, "Missing the required parameter 'bundle_symbolic_name' when calling BundleApi.modify" if bundle_symbolic_name.nil?
  # verify the required parameter 'action' is set
  fail ArgumentError, "Missing the required parameter 'action' when calling BundleApi.modify" if action.nil?
  # verify enum value
  unless ['start', 'stop', 'update', 'refresh', 'uninstall'].include?(action)
    fail ArgumentError, "invalid value for 'action', must be one of start, stop, update, refresh, uninstall"
  end
  # resource path
  local_var_path = "/bundles/{bundleSymbolicName}".sub('{format}','json').sub('{' + 'bundleSymbolicName' + '}', bundle_symbolic_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["action"] = action

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BundleState')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BundleApi#modify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#refresh_packages(action, opts = {}) ⇒ BundleList

Modify bundles operation. Take action on all bundles - refresh packages. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • action

    The action to execute. Only allowed value is &#39;refreshPackages&#39;, must be provided. Limitation of Swagger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



290
291
292
293
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 290

def refresh_packages(action, opts = {})
  data, _status_code, _headers = refresh_packages_with_http_info(action, opts)
  return data
end

#refresh_packages_with_http_info(action, opts = {}) ⇒ Array<(BundleList, Fixnum, Hash)>

Modify bundles operation. Take action on all bundles - refresh packages. (See org.apache.felix.webconsole.internal.core.BundlesServlet.java)

Parameters:

  • action

    The action to execute. Only allowed value is &#39;refreshPackages&#39;, must be provided. Limitation of Swagger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BundleList, Fixnum, Hash)>)

    BundleList data, response status code and response headers



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/apache_felix_webconsole_client/api/bundle_api.rb', line 300

def refresh_packages_with_http_info(action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BundleApi.refresh_packages ..."
  end
  # verify the required parameter 'action' is set
  fail ArgumentError, "Missing the required parameter 'action' when calling BundleApi.refresh_packages" if action.nil?
  # verify enum value
  unless ['refreshPackages'].include?(action)
    fail ArgumentError, "invalid value for 'action', must be one of refreshPackages"
  end
  # resource path
  local_var_path = "/bundles".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["action"] = action

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BundleList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BundleApi#refresh_packages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end