Class: OCI::CapacityManagement::CapacityManagementClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/capacity_management/capacity_management_client.rb

Overview

A description of the OciControlCenterCp API

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

Creates a new CapacityManagementClient. 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/capacity_management/capacity_management_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 + '/20231107'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "CapacityManagementClient 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/capacity_management/capacity_management_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/capacity_management/capacity_management_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/capacity_management/capacity_management_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/capacity_management/capacity_management_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_occ_availability_catalog(create_occ_availability_catalog_details, opts = {}) ⇒ Response

Note:

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

Create availability catalog

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 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 might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 120

def create_occ_availability_catalog(create_occ_availability_catalog_details, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#create_occ_availability_catalog.' if logger

  raise "Missing the required parameter 'create_occ_availability_catalog_details' when calling create_occ_availability_catalog." if create_occ_availability_catalog_details.nil?

  path = '/occAvailabilityCatalogs'
  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(create_occ_availability_catalog_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#create_occ_availability_catalog') 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::CapacityManagement::Models::OccAvailabilityCatalog'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_occ_capacity_request(create_occ_capacity_request_details, opts = {}) ⇒ Response

Note:

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

Create Capacity Request.

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 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 might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 184

def create_occ_capacity_request(create_occ_capacity_request_details, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#create_occ_capacity_request.' if logger

  raise "Missing the required parameter 'create_occ_capacity_request_details' when calling create_occ_capacity_request." if create_occ_capacity_request_details.nil?

  path = '/occCapacityRequests'
  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(create_occ_capacity_request_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#create_occ_capacity_request') 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::CapacityManagement::Models::OccCapacityRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_occ_availability_catalog(occ_availability_catalog_id, opts = {}) ⇒ Response

Note:

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

Deletes the availability catalog resource.

Parameters:

  • occ_availability_catalog_id (String)

    The OCID of the availability catalog.

  • 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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:

  • (Response)

    A Response object with data of type nil



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 247

def delete_occ_availability_catalog(occ_availability_catalog_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#delete_occ_availability_catalog.' if logger

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_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: 'CapacityManagementClient#delete_occ_availability_catalog') 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_occ_capacity_request(occ_capacity_request_id, opts = {}) ⇒ Response

Note:

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

Deletes the capacity request resource.

Parameters:

  • occ_capacity_request_id (String)

    The OCID of the capacity request.

  • 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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:

  • (Response)

    A Response object with data of type nil



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 309

def delete_occ_capacity_request(occ_capacity_request_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#delete_occ_capacity_request.' if logger

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

  path = '/occCapacityRequests/{occCapacityRequestId}'.sub('{occCapacityRequestId}', occ_capacity_request_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: 'CapacityManagementClient#delete_occ_capacity_request') 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_occ_availability_catalog(occ_availability_catalog_id, opts = {}) ⇒ Response

Note:

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

Get details about availability catalog.

Parameters:

  • occ_availability_catalog_id (String)

    The OCID of the availability catalog.

  • 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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 365

def get_occ_availability_catalog(occ_availability_catalog_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#get_occ_availability_catalog.' if logger

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_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: 'CapacityManagementClient#get_occ_availability_catalog') 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::CapacityManagement::Models::OccAvailabilityCatalog'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_occ_availability_catalog_content(occ_availability_catalog_id, opts = {}, &block) ⇒ Response

Note:

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

Returns the binary contents of the availability catalog. Can be saved as a csv file.

Parameters:

  • occ_availability_catalog_id (String)

    The OCID of the availability catalog.

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

    the optional parameters

  • [Block] (Hash)

    a customizable set of options

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 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 might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

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

  • :response_target (String, IO)

    Streaming http body into a file (specified by file name or File object) or IO object if the block is not given

Returns:

  • (Response)

    A Response object with data of type String if response_target and block are not given, otherwise with nil data



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
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
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 436

def get_occ_availability_catalog_content(occ_availability_catalog_id, opts = {}, &block)
  logger.debug 'Calling operation CapacityManagementClient#get_occ_availability_catalog_content.' if logger

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}/content'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_id.to_s)
  operation_signing_strategy = :standard

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

  # Header Params
  header_params = {}
  header_params[:accept] = opts[:accept] if opts[:accept]
  header_params[:accept] ||= 'application/binary'
  header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
  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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#get_occ_availability_catalog_content') do
    if !block.nil?
      @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: 'Stream',
        &block
      )
    elsif opts[:response_target]
      if opts[:response_target].respond_to? :write
        @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: 'Stream',
          &proc { |chunk, _response| opts[:response_target].write(chunk) }
        )
      elsif opts[:response_target].is_a?(String)
        File.open(opts[:response_target], 'wb') do |output|
          return @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: 'Stream',
            &proc { |chunk, _response| output.write(chunk) }
          )
        end
      end
    else
      @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: 'String'
      )
    end
  end
  # rubocop:enable Metrics/BlockLength
end

#get_occ_capacity_request(occ_capacity_request_id, opts = {}) ⇒ Response

Note:

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

Get details about the capacity request.

Parameters:

  • occ_capacity_request_id (String)

    The OCID of the capacity request.

  • 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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



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
569
570
571
572
573
574
575
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 539

def get_occ_capacity_request(occ_capacity_request_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#get_occ_capacity_request.' if logger

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

  path = '/occCapacityRequests/{occCapacityRequestId}'.sub('{occCapacityRequestId}', occ_capacity_request_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: 'CapacityManagementClient#get_occ_capacity_request') 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::CapacityManagement::Models::OccCapacityRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_occ_customer_group(occ_customer_group_id, opts = {}) ⇒ Response

Note:

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

Gets information about the specified customer group.

Parameters:

  • occ_customer_group_id (String)

    The OCID of the customer group.

  • 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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



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
623
624
625
626
627
628
629
630
631
632
633
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 597

def get_occ_customer_group(occ_customer_group_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#get_occ_customer_group.' if logger

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

  path = '/occCustomerGroups/{occCustomerGroupId}'.sub('{occCustomerGroupId}', occ_customer_group_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: 'CapacityManagementClient#get_occ_customer_group') 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::CapacityManagement::Models::OccCustomerGroup'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_occ_availabilities(occ_availability_catalog_id, opts = {}) ⇒ Response

Note:

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

Lists availabilities for a particular availability catalog. Allowed values are: dateExpectedCapacityHandover, resourceName

Parameters:

  • occ_availability_catalog_id (String)

    The OCID of the availability catalog.

  • 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

  • :date_expected_capacity_handover (String)

    The capacity handover date of the capacity constraint to filter the list of capacity constraints.

  • :resource_name (String)

    The name of the resource to filter the list of capacity constraints.

  • :resource_type (String)

    Resource type using which the capacity constraints of an availability catalog can be filtered.

  • :workload_type (String)

    Workload type using the resources in an availability catalog can be filtered.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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. The default order for resource name is ascending. The default order for date of capacity handover is descending. (default to dateExpectedCapacityHandover)

Returns:



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 663

def list_occ_availabilities(occ_availability_catalog_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#list_occ_availabilities.' if logger

  raise "Missing the required parameter 'occ_availability_catalog_id' when calling list_occ_availabilities." if occ_availability_catalog_id.nil?

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

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

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

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}/occAvailabilities'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:dateExpectedCapacityHandover] = opts[:date_expected_capacity_handover] if opts[:date_expected_capacity_handover]
  query_params[:resourceName] = opts[:resource_name] if opts[:resource_name]
  query_params[:resourceType] = opts[:resource_type] if opts[:resource_type]
  query_params[:workloadType] = opts[:workload_type] if opts[:workload_type]
  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: 'CapacityManagementClient#list_occ_availabilities') 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::CapacityManagement::Models::OccAvailabilityCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists all availability catalogs. Allowed values are: displayName, timeCreated

Parameters:

  • compartment_id (String)

    The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes.

  • 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

  • :namespace (String)

    The namespace by which we would filter the list.

  • :id (String)

    The OCID of the availability catalog to filter the list of availability catalogs.

  • :display_name (String)

    A filter to return only the resources that match the entire display name. The match is not case sensitive.

  • :catalog_state (String)

    Filter the list of availability catalogs based on the catalog state.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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. The default order for displayName is ascending. The default order for timeCreated is descending. (default to timeCreated)

Returns:



753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
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
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 753

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

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

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

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

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

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

  path = '/occAvailabilityCatalogs'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:namespace] = opts[:namespace] if opts[:namespace]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:catalogState] = opts[:catalog_state] if opts[:catalog_state]
  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: 'CapacityManagementClient#list_occ_availability_catalogs') 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::CapacityManagement::Models::OccAvailabilityCatalogCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

An internal api to list availability catalogs. Allowed values are: displayName, timeCreated

Parameters:

  • compartment_id (String)

    The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes.

  • 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

  • :namespace (String)

    The namespace by which we would filter the list.

  • :id (String)

    The OCID of the availability catalog to filter the list of availability catalogs.

  • :display_name (String)

    A filter to return only the resources that match the entire display name. The match is not case sensitive.

  • :catalog_state (String)

    Filter the list of availability catalogs based on the catalog state.

  • :occ_customer_group_id (String)

    The customer group ocid by which we would filter the list.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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. The default order for displayName is ascending. The default order for timeCreated is descending. (default to timeCreated)

Returns:



844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
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
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 844

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

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

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

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

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

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

  path = '/internal/occAvailabilityCatalogs'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:namespace] = opts[:namespace] if opts[:namespace]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:catalogState] = opts[:catalog_state] if opts[:catalog_state]
  query_params[:occCustomerGroupId] = opts[:occ_customer_group_id] if opts[:occ_customer_group_id]
  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: 'CapacityManagementClient#list_occ_availability_catalogs_internal') 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::CapacityManagement::Models::OccAvailabilityCatalogCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists all capacity requests. Allowed values are: displayName, timeCreated

Parameters:

  • compartment_id (String)

    The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes.

  • 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

  • :occ_availability_catalog_id (String)

    A filter to return the list of capacity requests based on the OCID of the availability catalog against which they were created.

  • :namespace (String)

    The namespace by which we would filter the list.

  • :display_name (String)

    A filter to return only the resources that match the entire display name. The match is not case sensitive.

  • :id (String)

    A filter to return the list of capacity requests based on the OCID of the capacity request. This is done for the users who have INSPECT permission on the resource but do not have READ permission.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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. The default order for display name is ascending. The default order for time created is reverse chronological order(latest date at the top). (default to timeCreated)

Returns:



935
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
990
991
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 935

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

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

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

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

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

  path = '/occCapacityRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:occAvailabilityCatalogId] = opts[:occ_availability_catalog_id] if opts[:occ_availability_catalog_id]
  query_params[:namespace] = opts[:namespace] if opts[:namespace]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  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: 'CapacityManagementClient#list_occ_capacity_requests') 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::CapacityManagement::Models::OccCapacityRequestCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

An internal api to list all capacity requests. Allowed values are: displayName, timeCreated

Parameters:

  • compartment_id (String)

    The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes.

  • 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

  • :occ_customer_group_id (String)

    The customer group ocid by which we would filter the list.

  • :occ_availability_catalog_id (String)

    A filter to return the list of capacity requests based on the OCID of the availability catalog against which they were created.

  • :namespace (String)

    The namespace by which we would filter the list.

  • :display_name (String)

    A filter to return only the resources that match the entire display name. The match is not case sensitive.

  • :id (String)

    A filter to return the list of capacity requests based on the OCID of the capacity request. This is done for the users who have INSPECT permission on the resource but do not have READ permission.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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. The default order for display name is ascending. The default order for time created is reverse chronological order(latest date at the top). (default to timeCreated)

Returns:



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
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1022

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

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

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

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

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

  path = '/internal/occCapacityRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:occCustomerGroupId] = opts[:occ_customer_group_id] if opts[:occ_customer_group_id]
  query_params[:occAvailabilityCatalogId] = opts[:occ_availability_catalog_id] if opts[:occ_availability_catalog_id]
  query_params[:namespace] = opts[:namespace] if opts[:namespace]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  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: 'CapacityManagementClient#list_occ_capacity_requests_internal') 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::CapacityManagement::Models::OccCapacityRequestCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists all the customer groups.

Allowed values are: compartmentId, name, timeCreated

Parameters:

  • compartment_id (String)

    The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes.

  • 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

  • :status (String)

    A query filter to return the list result based on status. (default to ENABLED)

  • :display_name (String)

    A filter to return only the resources that match the entire display name. The match is not case sensitive.

  • :id (String)

    A query filter to return the list result based on the customer group OCID. This is done for users who have INSPECT permission but do not have READ permission.

  • :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 opc-next-page header field of a previous response.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

  • :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 name and compartment ID is ascending. Default order for time created is descending. (default to timeCreated)

Returns:



1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
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
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1109

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

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

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

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

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

  path = '/occCustomerGroups'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:status] = opts[:status] if opts[:status]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  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: 'CapacityManagementClient#list_occ_customer_groups') 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::CapacityManagement::Models::OccCustomerGroupCollection'
    )
  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/capacity_management/capacity_management_client.rb', line 94

def logger
  @api_client.config.logger
end

#patch_occ_capacity_request(patch_occ_capacity_request_details, occ_capacity_request_id, opts = {}) ⇒ Response

Note:

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

Updates the OccCapacityRequest by evaluating a sequence of instructions.

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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1191

def patch_occ_capacity_request(patch_occ_capacity_request_details, occ_capacity_request_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#patch_occ_capacity_request.' if logger

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

  path = '/occCapacityRequests/{occCapacityRequestId}'.sub('{occCapacityRequestId}', occ_capacity_request_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(patch_occ_capacity_request_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#patch_occ_capacity_request') do
    @api_client.call_api(
      :PATCH,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::CapacityManagement::Models::OccCapacityRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#publish_occ_availability_catalog(occ_availability_catalog_id, opts = {}) ⇒ Response

Note:

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

Publishes the version of availability catalog specified by the operator. This makes that catalog version visible to customers.

Parameters:

  • occ_availability_catalog_id (String)

    The OCID of the availability catalog.

  • 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_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 might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash.

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



1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1262

def publish_occ_availability_catalog(occ_availability_catalog_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#publish_occ_availability_catalog.' if logger

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}/actions/publish'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#publish_occ_availability_catalog') 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

#update_internal_occ_capacity_request(update_internal_occ_capacity_request_details, occ_capacity_request_id, opts = {}) ⇒ Response

Note:

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

The internal api to update the capacity request. This api will be used by operators for updating the capacity request to either completed, resubmitted or rejected.

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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1327

def update_internal_occ_capacity_request(update_internal_occ_capacity_request_details, occ_capacity_request_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#update_internal_occ_capacity_request.' if logger

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

  path = '/internal/occCapacityRequests/{occCapacityRequestId}'.sub('{occCapacityRequestId}', occ_capacity_request_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_internal_occ_capacity_request_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#update_internal_occ_capacity_request') 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::CapacityManagement::Models::OccCapacityRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_occ_availability_catalog(update_occ_availability_catalog_details, occ_availability_catalog_id, opts = {}) ⇒ Response

Note:

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

The request to update the availability catalog. Currently only freeform tags can be updated via this api.

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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1392

def update_occ_availability_catalog(update_occ_availability_catalog_details, occ_availability_catalog_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#update_occ_availability_catalog.' if logger

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

  path = '/occAvailabilityCatalogs/{occAvailabilityCatalogId}'.sub('{occAvailabilityCatalogId}', occ_availability_catalog_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_occ_availability_catalog_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#update_occ_availability_catalog') 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::CapacityManagement::Models::OccAvailabilityCatalog'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_occ_capacity_request(update_occ_capacity_request_details, occ_capacity_request_id, opts = {}) ⇒ Response

Note:

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

The request to update the capacity request. The user can perform actions like closing a partially completed request so that it doesn't go ahead for full completion.

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. The only valid characters for request IDs are letters, numbers, underscore, and dash.

Returns:



1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
# File 'lib/oci/capacity_management/capacity_management_client.rb', line 1457

def update_occ_capacity_request(update_occ_capacity_request_details, occ_capacity_request_id, opts = {})
  logger.debug 'Calling operation CapacityManagementClient#update_occ_capacity_request.' if logger

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

  path = '/occCapacityRequests/{occCapacityRequestId}'.sub('{occCapacityRequestId}', occ_capacity_request_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_occ_capacity_request_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CapacityManagementClient#update_occ_capacity_request') 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::CapacityManagement::Models::OccCapacityRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end