Class: OCI::CloudBridge::InventoryClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/inventory_client.rb

Overview

API for Oracle Cloud Bridge service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ InventoryClient

Creates a new InventoryClient. Notes: If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 55

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20220509'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "InventoryClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


29
30
31
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 29

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



25
26
27
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#analyze_assets(compartment_id, aggregation_properties, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use analyze_assets API.

Returns an aggregation of assets. Aggregation groups are sorted by groupBy property. Default sort order is ascending, but can be overridden by the sortOrder parameter.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • aggregation_properties (Array<String>)

    An array of properties on which to aggregate.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :lifecycle_state (String)

    A filter to return only assets whose lifecycleState matches the given lifecycleState.

  • :source_key (String)

    Source key from where the assets originate.

  • :external_asset_key (String)

    External asset key.

  • :asset_type (String)

    The type of asset.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :group_by (Array<String>)

    The dimensions in which to group the aggregations.

  • :inventory_id (String)

    Unique Inventory identifier.

  • :asset_class_name (String)

    The name of the asset class.

  • :asset_class_version (String)

    The version of the asset class.

Returns:



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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 125

def analyze_assets(compartment_id, aggregation_properties, opts = {})
  logger.debug 'Calling operation InventoryClient#analyze_assets.' if logger

  raise "Missing the required parameter 'compartment_id' when calling analyze_assets." if compartment_id.nil?
  raise "Missing the required parameter 'aggregation_properties' when calling analyze_assets." if aggregation_properties.nil?

  if opts[:lifecycle_state] && !OCI::CloudBridge::Models::Asset::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::CloudBridge::Models::Asset::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:asset_type] && !OCI::CloudBridge::Models::ASSET_TYPE_ENUM.include?(opts[:asset_type])
    raise 'Invalid value for "asset_type", must be one of the values in OCI::CloudBridge::Models::ASSET_TYPE_ENUM.'
  end

  if opts[:sort_order] && !OCI::CloudBridge::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::CloudBridge::Models::SORT_ORDERS_ENUM.'
  end

  path = '/assetAnalytics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:aggregationProperties] = OCI::ApiClient.build_collection_params(aggregation_properties, :multi)
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sourceKey] = opts[:source_key] if opts[:source_key]
  query_params[:externalAssetKey] = opts[:external_asset_key] if opts[:external_asset_key]
  query_params[:assetType] = opts[:asset_type] if opts[:asset_type]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:groupBy] = OCI::ApiClient.build_collection_params(opts[:group_by], :multi) if opts[:group_by] && !opts[:group_by].empty?
  query_params[:inventoryId] = opts[:inventory_id] if opts[:inventory_id]
  query_params[:assetClassName] = opts[:asset_class_name] if opts[:asset_class_name]
  query_params[:assetClassVersion] = opts[:asset_class_version] if opts[:asset_class_version]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#analyze_assets') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::AssetAggregationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_asset_compartment(asset_id, change_asset_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_asset_compartment API.

Moves an asset resource from one compartment to another. When provided, If-Match is checked against ETag values of the resource.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing the same action again. Retry tokens expire after 24 hours, but can be invalidated before 24 hours due to conflicting operations. For example, if a resource has been deleted and purged from the system, a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 217

def change_asset_compartment(asset_id, change_asset_compartment_details, opts = {})
  logger.debug 'Calling operation InventoryClient#change_asset_compartment.' if logger

  raise "Missing the required parameter 'asset_id' when calling change_asset_compartment." if asset_id.nil?
  raise "Missing the required parameter 'change_asset_compartment_details' when calling change_asset_compartment." if change_asset_compartment_details.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}/actions/changeCompartment'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_asset_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#change_asset_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_asset_tags(asset_id, change_asset_tags_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_asset_tags API.

Change an asset's tag.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing the same action again. Retry tokens expire after 24 hours, but can be invalidated before 24 hours due to conflicting operations. For example, if a resource has been deleted and purged from the system, a retry of the original creation request might be rejected.

Returns:



287
288
289
290
291
292
293
294
295
296
297
298
299
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
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 287

def change_asset_tags(asset_id, change_asset_tags_details, opts = {})
  logger.debug 'Calling operation InventoryClient#change_asset_tags.' if logger

  raise "Missing the required parameter 'asset_id' when calling change_asset_tags." if asset_id.nil?
  raise "Missing the required parameter 'change_asset_tags_details' when calling change_asset_tags." if change_asset_tags_details.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}/actions/changeTags'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_asset_tags_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#change_asset_tags') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Asset'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_asset(create_asset_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_asset API.

Creates an asset.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing the same action again. Retry tokens expire after 24 hours, but can be invalidated before 24 hours due to conflicting operations. For example, if a resource has been deleted and purged from the system, a retry of the original creation request might be rejected.

Returns:



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 351

def create_asset(create_asset_details, opts = {})
  logger.debug 'Calling operation InventoryClient#create_asset.' if logger

  raise "Missing the required parameter 'create_asset_details' when calling create_asset." if create_asset_details.nil?

  path = '/assets'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_asset_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#create_asset') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Asset'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_inventory(create_inventory_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_inventory API.

Creates an inventory.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing the same action again. Retry tokens expire after 24 hours, but can be invalidated before 24 hours due to conflicting operations. For example, if a resource has been deleted and purged from the system, a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 412

def create_inventory(create_inventory_details, opts = {})
  logger.debug 'Calling operation InventoryClient#create_inventory.' if logger

  raise "Missing the required parameter 'create_inventory_details' when calling create_inventory." if create_inventory_details.nil?

  path = '/inventories'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_inventory_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#create_inventory') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_asset(asset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_asset API.

Deletes an asset resource by identifier.

Parameters:

  • asset_id (String)

    Unique asset identifier.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 472

def delete_asset(asset_id, opts = {})
  logger.debug 'Calling operation InventoryClient#delete_asset.' if logger

  raise "Missing the required parameter 'asset_id' when calling delete_asset." if asset_id.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#delete_asset') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_inventory(inventory_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_inventory API.

Deletes an inventory resource by identifier.

Parameters:

  • inventory_id (String)

    Inventory OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 532

def delete_inventory(inventory_id, opts = {})
  logger.debug 'Calling operation InventoryClient#delete_inventory.' if logger

  raise "Missing the required parameter 'inventory_id' when calling delete_inventory." if inventory_id.nil?
  raise "Parameter value for 'inventory_id' must not be blank" if OCI::Internal::Util.blank_string?(inventory_id)

  path = '/inventories/{inventoryId}'.sub('{inventoryId}', inventory_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#delete_inventory') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_asset(asset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_asset API.

Gets an asset by identifier.

Parameters:

  • asset_id (String)

    Unique asset identifier.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 586

def get_asset(asset_id, opts = {})
  logger.debug 'Calling operation InventoryClient#get_asset.' if logger

  raise "Missing the required parameter 'asset_id' when calling get_asset." if asset_id.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#get_asset') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Asset'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_inventory(inventory_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_inventory API.

Gets an inventory by identifier.

Parameters:

  • inventory_id (String)

    Inventory OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 640

def get_inventory(inventory_id, opts = {})
  logger.debug 'Calling operation InventoryClient#get_inventory.' if logger

  raise "Missing the required parameter 'inventory_id' when calling get_inventory." if inventory_id.nil?
  raise "Parameter value for 'inventory_id' must not be blank" if OCI::Internal::Util.blank_string?(inventory_id)

  path = '/inventories/{inventoryId}'.sub('{inventoryId}', inventory_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#get_inventory') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Inventory'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#import_inventory(import_inventory_details, inventory_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use import_inventory API.

Import resources in inventory.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing the same action again. Retry tokens expire after 24 hours, but can be invalidated before 24 hours due to conflicting operations. For example, if a resource has been deleted and purged from the system, a retry of the original creation request might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 701

def import_inventory(import_inventory_details, inventory_id, opts = {})
  logger.debug 'Calling operation InventoryClient#import_inventory.' if logger

  raise "Missing the required parameter 'import_inventory_details' when calling import_inventory." if import_inventory_details.nil?
  raise "Missing the required parameter 'inventory_id' when calling import_inventory." if inventory_id.nil?
  raise "Parameter value for 'inventory_id' must not be blank" if OCI::Internal::Util.blank_string?(inventory_id)

  path = '/inventories/{inventoryId}/actions/import'.sub('{inventoryId}', inventory_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(import_inventory_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#import_inventory') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_assets(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_assets API.

Returns a list of assets.

Allowed values are: timeCreated, timeUpdated, displayName

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :lifecycle_state (String)

    A filter to return only assets whose lifecycleState matches the given lifecycleState.

  • :source_key (String)

    Source key from where the assets originate.

  • :external_asset_key (String)

    External asset key.

  • :asset_type (String)

    The type of asset.

  • :asset_id (String)

    Unique asset identifier.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. (default to timeCreated)

  • :opc_request_id (String)

    The client request ID for tracing.

  • :inventory_id (String)

    Unique Inventory identifier.

  • :asset_class_name (String)

    The name of the asset class.

  • :asset_class_version (String)

    The version of the asset class.

Returns:



773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 773

def list_assets(compartment_id, opts = {})
  logger.debug 'Calling operation InventoryClient#list_assets.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_assets." if compartment_id.nil?

  if opts[:lifecycle_state] && !OCI::CloudBridge::Models::Asset::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::CloudBridge::Models::Asset::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:asset_type] && !OCI::CloudBridge::Models::ASSET_TYPE_ENUM.include?(opts[:asset_type])
    raise 'Invalid value for "asset_type", must be one of the values in OCI::CloudBridge::Models::ASSET_TYPE_ENUM.'
  end

  if opts[:sort_order] && !OCI::CloudBridge::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::CloudBridge::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated timeUpdated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, timeUpdated, displayName.'
  end

  path = '/assets'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sourceKey] = opts[:source_key] if opts[:source_key]
  query_params[:externalAssetKey] = opts[:external_asset_key] if opts[:external_asset_key]
  query_params[:assetType] = opts[:asset_type] if opts[:asset_type]
  query_params[:assetId] = opts[:asset_id] if opts[:asset_id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:inventoryId] = opts[:inventory_id] if opts[:inventory_id]
  query_params[:assetClassName] = opts[:asset_class_name] if opts[:asset_class_name]
  query_params[:assetClassVersion] = opts[:asset_class_version] if opts[:asset_class_version]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#list_assets') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::AssetCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_historical_metrics(asset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_historical_metrics API.

List asset historical metrics. Allowed values are: timeCreated, timeUpdated, displayName

Parameters:

  • asset_id (String)

    Unique asset identifier.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. (default to timeCreated)

Returns:



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 862

def list_historical_metrics(asset_id, opts = {})
  logger.debug 'Calling operation InventoryClient#list_historical_metrics.' if logger

  raise "Missing the required parameter 'asset_id' when calling list_historical_metrics." if asset_id.nil?

  if opts[:sort_order] && !OCI::CloudBridge::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::CloudBridge::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated timeUpdated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, timeUpdated, displayName.'
  end
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}/historicalMetrics'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#list_historical_metrics') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::HistoricalMetricCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_inventories(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_inventories API.

Returns a list of inventories.

Allowed values are: timeCreated, timeUpdated, displayName

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. (default to timeCreated)

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :lifecycle_state (String)

    A filter to return inventory if the lifecycleState matches the given lifecycleState.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 936

def list_inventories(compartment_id, opts = {})
  logger.debug 'Calling operation InventoryClient#list_inventories.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_inventories." if compartment_id.nil?

  if opts[:sort_order] && !OCI::CloudBridge::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::CloudBridge::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated timeUpdated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, timeUpdated, displayName.'
  end

  if opts[:lifecycle_state] && !OCI::CloudBridge::Models::Inventory::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::CloudBridge::Models::Inventory::LIFECYCLE_STATE_ENUM.'
  end

  path = '/inventories'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#list_inventories') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::InventoryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



94
95
96
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 94

def logger
  @api_client.config.logger
end

#submit_historical_metrics(submit_historical_metrics_details, asset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use submit_historical_metrics API.

Creates or updates all metrics related to the asset.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 1014

def submit_historical_metrics(submit_historical_metrics_details, asset_id, opts = {})
  logger.debug 'Calling operation InventoryClient#submit_historical_metrics.' if logger

  raise "Missing the required parameter 'submit_historical_metrics_details' when calling submit_historical_metrics." if submit_historical_metrics_details.nil?
  raise "Missing the required parameter 'asset_id' when calling submit_historical_metrics." if asset_id.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}/actions/submitHistoricalMetrics'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(submit_historical_metrics_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#submit_historical_metrics') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::HistoricalMetricCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_asset(asset_id, update_asset_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_asset API.

Updates the asset.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 1077

def update_asset(asset_id, update_asset_details, opts = {})
  logger.debug 'Calling operation InventoryClient#update_asset.' if logger

  raise "Missing the required parameter 'asset_id' when calling update_asset." if asset_id.nil?
  raise "Missing the required parameter 'update_asset_details' when calling update_asset." if update_asset_details.nil?
  raise "Parameter value for 'asset_id' must not be blank" if OCI::Internal::Util.blank_string?(asset_id)

  path = '/assets/{assetId}'.sub('{assetId}', asset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_asset_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#update_asset') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Asset'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_inventory(inventory_id, update_inventory_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_inventory API.

Updates an inventory.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/oci/cloud_bridge/inventory_client.rb', line 1140

def update_inventory(inventory_id, update_inventory_details, opts = {})
  logger.debug 'Calling operation InventoryClient#update_inventory.' if logger

  raise "Missing the required parameter 'inventory_id' when calling update_inventory." if inventory_id.nil?
  raise "Missing the required parameter 'update_inventory_details' when calling update_inventory." if update_inventory_details.nil?
  raise "Parameter value for 'inventory_id' must not be blank" if OCI::Internal::Util.blank_string?(inventory_id)

  path = '/inventories/{inventoryId}'.sub('{inventoryId}', inventory_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_inventory_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'InventoryClient#update_inventory') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CloudBridge::Models::Inventory'
    )
  end
  # rubocop:enable Metrics/BlockLength
end