Class: OCI::TenantManagerControlPlane::SubscriptionClient
- Inherits:
-
Object
- Object
- OCI::TenantManagerControlPlane::SubscriptionClient
- 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
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#create_subscription_mapping(create_subscription_mapping_details, opts = {}) ⇒ Response
Assign the tenancy record identified by the compartment ID to the given subscription ID.
-
#delete_subscription_mapping(subscription_mapping_id, opts = {}) ⇒ Response
Delete the subscription mapping details by subscription mapping ID.
-
#get_assigned_subscription(assigned_subscription_id, opts = {}) ⇒ Response
Get the assigned subscription details by assigned subscription ID.
-
#get_subscription(subscription_id, opts = {}) ⇒ Response
Gets the subscription details by subscription ID.
-
#get_subscription_mapping(subscription_mapping_id, opts = {}) ⇒ Response
Get the subscription mapping details by subscription mapping ID.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ SubscriptionClient
constructor
Creates a new SubscriptionClient.
-
#list_assigned_subscription_line_items(assigned_subscription_id, opts = {}) ⇒ Response
List line item summaries that a assigned subscription owns.
-
#list_assigned_subscriptions(compartment_id, opts = {}) ⇒ Response
Lists subscriptions that are consumed by the compartment.
-
#list_available_regions(subscription_id, opts = {}) ⇒ Response
List the available regions based on subscription ID.
-
#list_subscription_line_items(subscription_id, opts = {}) ⇒ Response
Lists the line items in a subscription.
-
#list_subscription_mappings(subscription_id, opts = {}) ⇒ Response
Lists the subscription mappings for all the subscriptions owned by a given compartmentId.
-
#list_subscriptions(opts = {}) ⇒ Response
List the subscriptions that a compartment owns.
-
#logger ⇒ Logger
The logger for this client.
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.
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_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
15 16 17 |
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 15 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
19 20 21 |
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 19 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
29 30 31 |
# File 'lib/oci/tenant_manager_control_plane/subscription_client.rb', line 29 def region @region end |
#retry_config ⇒ OCI::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
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.
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.(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
Click here to see an example of how to use delete_subscription_mapping API.
Delete the subscription mapping details by subscription mapping ID.
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.(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
Click here to see an example of how to use get_assigned_subscription API.
Get the assigned subscription details by assigned subscription ID.
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.(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
Click here to see an example of how to use get_subscription API.
Gets the subscription details by subscription ID.
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.(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
Click here to see an example of how to use get_subscription_mapping API.
Get the subscription mapping details by subscription mapping ID.
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.(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
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.
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.(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
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.
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.(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
Click here to see an example of how to use list_available_regions API.
List the available regions based on subscription ID.
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.(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
Click here to see an example of how to use list_subscription_line_items API.
Lists the line items in a subscription.
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.(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
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.
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.(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
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.
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.(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 |
#logger ⇒ Logger
Returns 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 |