Class: OCI::TenantManagerControlPlane::SubscriptionClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/tenant_manager_control_plane/subscription_client.rb

Overview

Use the Organizations API to consolidate multiple OCI tenancies into an organization, and centrally manage your tenancies and organization resources. For more information, see Organization Management Overview.

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) ⇒ SubscriptionClient

Creates a new SubscriptionClient. 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/tenant_manager_control_plane/subscription_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 + '/20230401'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "SubscriptionClient 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/tenant_manager_control_plane/subscription_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/tenant_manager_control_plane/subscription_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/tenant_manager_control_plane/subscription_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/tenant_manager_control_plane/subscription_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_subscription_mapping(create_subscription_mapping_details, opts = {}) ⇒ Response

Note:

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

Assign the tenancy record identified by the compartment ID to the given subscription ID.

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_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 that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request will be rejected.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



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
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 123

def create_subscription_mapping(create_subscription_mapping_details, opts = {})
  logger.debug 'Calling operation SubscriptionClient#create_subscription_mapping.' if logger

  raise "Missing the required parameter 'create_subscription_mapping_details' when calling create_subscription_mapping." if create_subscription_mapping_details.nil?

  path = '/subscriptionMappings'
  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-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(create_subscription_mapping_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'SubscriptionClient#create_subscription_mapping') 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::TenantManagerControlPlane::Models::SubscriptionMapping'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_subscription_mapping(subscription_mapping_id, opts = {}) ⇒ Response

Note:

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

Delete the subscription mapping details by subscription mapping ID.

Parameters:

  • subscription_mapping_id (String)

    OCID of the subscription mapping ID.

  • 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.

  • :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.

Returns:

  • (Response)

    A Response object with data of type nil



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
218
219
220
221
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 185

def delete_subscription_mapping(subscription_mapping_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#delete_subscription_mapping.' if logger

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

  path = '/subscriptionMappings/{subscriptionMappingId}'.sub('{subscriptionMappingId}', subscription_mapping_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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'SubscriptionClient#delete_subscription_mapping') 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_assigned_subscription(assigned_subscription_id, opts = {}) ⇒ Response

Note:

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

Get the assigned subscription details by assigned subscription ID.

Parameters:

  • assigned_subscription_id (String)

    OCID of the assigned Oracle Cloud Subscription.

  • 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:



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
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 239

def get_assigned_subscription(assigned_subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#get_assigned_subscription.' if logger

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

  path = '/assignedSubscriptions/{assignedSubscriptionId}'.sub('{assignedSubscriptionId}', assigned_subscription_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: 'SubscriptionClient#get_assigned_subscription') 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::TenantManagerControlPlane::Models::AssignedSubscription'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_subscription(subscription_id, opts = {}) ⇒ Response

Note:

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

Gets the subscription details by subscription ID.

Parameters:

  • subscription_id (String)

    OCID of the subscription.

  • 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:



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
328
329
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 293

def get_subscription(subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#get_subscription.' if logger

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

  path = '/subscriptions/{subscriptionId}'.sub('{subscriptionId}', subscription_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: 'SubscriptionClient#get_subscription') 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::TenantManagerControlPlane::Models::Subscription'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_subscription_mapping(subscription_mapping_id, opts = {}) ⇒ Response

Note:

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

Get the subscription mapping details by subscription mapping ID.

Parameters:

  • subscription_mapping_id (String)

    OCID of the subscriptionMappingId.

  • 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:



347
348
349
350
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
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 347

def get_subscription_mapping(subscription_mapping_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#get_subscription_mapping.' if logger

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

  path = '/subscriptionMappings/{subscriptionMappingId}'.sub('{subscriptionMappingId}', subscription_mapping_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: 'SubscriptionClient#get_subscription_mapping') 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::TenantManagerControlPlane::Models::SubscriptionMapping'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_assigned_subscription_line_items(assigned_subscription_id, opts = {}) ⇒ Response

Note:

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

List line item summaries that a assigned subscription owns.

Parameters:

  • assigned_subscription_id (String)

    OCID of the assigned Oracle Cloud Subscription.

  • 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.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

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

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. Only one sort order can be provided. * The default order for timeCreated is descending. * The default order for displayName is ascending. * If no value is specified, timeCreated is the default. (default to timeCreated) Allowed values are: timeCreated, displayName

Returns:



410
411
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
449
450
451
452
453
454
455
456
457
458
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 410

def list_assigned_subscription_line_items(assigned_subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#list_assigned_subscription_line_items.' if logger

  raise "Missing the required parameter 'assigned_subscription_id' when calling list_assigned_subscription_line_items." if assigned_subscription_id.nil?

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

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

  path = '/assignedSubscriptions/{assignedSubscriptionId}/assignedSubscriptionLineItems'.sub('{assignedSubscriptionId}', assigned_subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'SubscriptionClient#list_assigned_subscription_line_items') 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::TenantManagerControlPlane::Models::AssignedSubscriptionLineItemCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists subscriptions that are consumed by the compartment. Only the root compartment is allowed.

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

  • :subscription_id (String)

    The ID of the subscription to which the tenancy is associated.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

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

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. Only one sort order can be provided. * The default order for timeCreated is descending. * The default order for displayName is ascending. * If no value is specified, timeCreated is the default. (default to timeCreated) Allowed values are: timeCreated, displayName

  • :entity_version (String)

    The version of the subscription entity.

Returns:



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 487

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

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

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

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

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

  path = '/assignedSubscriptions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:subscriptionId] = opts[:subscription_id] if opts[:subscription_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:entityVersion] = opts[:entity_version] if opts[:entity_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: 'SubscriptionClient#list_assigned_subscriptions') 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::TenantManagerControlPlane::Models::AssignedSubscriptionCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_available_regions(subscription_id, opts = {}) ⇒ Response

Note:

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

List the available regions based on subscription ID.

Parameters:

  • subscription_id (String)

    OCID of the subscription.

  • 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.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

Returns:



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 560

def list_available_regions(subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#list_available_regions.' if logger

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

  path = '/subscriptions/{subscriptionId}/availableRegions'.sub('{subscriptionId}', subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]

  # 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: 'SubscriptionClient#list_available_regions') 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::TenantManagerControlPlane::Models::AvailableRegionCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_subscription_line_items(subscription_id, opts = {}) ⇒ Response

Note:

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

Lists the line items in a subscription.

Parameters:

  • subscription_id (String)

    OCID of the subscription.

  • 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.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

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

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. Only one sort order can be provided. * The default order for timeCreated is descending. * The default order for displayName is ascending. * If no value is specified, timeCreated is the default. (default to timeCreated) Allowed values are: timeCreated, displayName

Returns:



624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
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
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 624

def list_subscription_line_items(subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#list_subscription_line_items.' if logger

  raise "Missing the required parameter 'subscription_id' when calling list_subscription_line_items." if subscription_id.nil?

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

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

  path = '/subscriptions/{subscriptionId}/subscriptionLineItems'.sub('{subscriptionId}', subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'SubscriptionClient#list_subscription_line_items') 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::TenantManagerControlPlane::Models::SubscriptionLineItemCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_subscription_mappings(subscription_id, opts = {}) ⇒ Response

Note:

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

Lists the subscription mappings for all the subscriptions owned by a given compartmentId. Only the root compartment is allowed.

Parameters:

  • subscription_id (String)

    OCID of the subscription.

  • 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

  • :subscription_mapping_id (String)

    A unique ID for subscription and tenancy mapping.

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :lifecycle_state (String)

    The lifecycle state of the resource.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

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

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. Only one sort order can be provided. * The default order for timeCreated is descending. * The default order for displayName is ascending. * If no value is specified, timeCreated is the default. (default to timeCreated) Allowed values are: timeCreated, displayName

Returns:



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
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 702

def list_subscription_mappings(subscription_id, opts = {})
  logger.debug 'Calling operation SubscriptionClient#list_subscription_mappings.' if logger

  raise "Missing the required parameter 'subscription_id' when calling list_subscription_mappings." if subscription_id.nil?

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

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

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

  path = '/subscriptionMappings'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:subscriptionId] = subscription_id
  query_params[:subscriptionMappingId] = opts[:subscription_mapping_id] if opts[:subscription_mapping_id]
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'SubscriptionClient#list_subscription_mappings') 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::TenantManagerControlPlane::Models::SubscriptionMappingCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_subscriptions(opts = {}) ⇒ Response

Note:

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

List the subscriptions that a compartment owns. Only the root compartment is allowed.

Parameters:

  • 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

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :subscription_id (String)

    The ID of the subscription to which the tenancy is associated.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

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

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. Only one sort order can be provided. * The default order for timeCreated is descending. * The default order for displayName is ascending. * If no value is specified, timeCreated is the default. (default to timeCreated) Allowed values are: timeCreated, displayName

  • :entity_version (String)

    The version of the subscription entity.

Returns:



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
839
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 786

def list_subscriptions(opts = {})
  logger.debug 'Calling operation SubscriptionClient#list_subscriptions.' if logger


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

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

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

  path = '/subscriptions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:subscriptionId] = opts[:subscription_id] if opts[:subscription_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:entityVersion] = opts[:entity_version] if opts[:entity_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: 'SubscriptionClient#list_subscriptions') 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::TenantManagerControlPlane::Models::SubscriptionCollection'
    )
  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/tenant_manager_control_plane/subscription_client.rb', line 94

def logger
  @api_client.config.logger
end