Server IP : 103.119.228.120 / Your IP : 3.142.250.52 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/mysqlsh/lib/python3.9/site-packages/oci/capacity_management/ |
Upload File : |
# coding: utf-8 # Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. # NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231107 from __future__ import absolute_import from oci._vendor import requests # noqa: F401 from oci._vendor import six from oci import retry, circuit_breaker # noqa: F401 from oci.base_client import BaseClient from oci.config import get_config_value_or_default, validate_config from oci.signer import Signer from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME from oci.exceptions import InvalidAlloyConfig from oci.alloy import OCI_SDK_ENABLED_SERVICES_SET from .models import capacity_management_type_mapping missing = Sentinel("Missing") class CapacityManagementClient(object): """ OCI Control Center (OCC) Capacity Management enables you to manage capacity requests in realms where OCI Control Center Capacity Management is available. For more information, see [OCI Control Center](/iaas/Content/control-center/home.htm). """ def __init__(self, config, **kwargs): """ Creates a new service client :param dict config: Configuration keys and values as per `SDK and Tool Configuration <https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm>`__. The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config the dict using :py:meth:`~oci.config.validate_config` :param str service_endpoint: (optional) The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint. :param timeout: (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. :type timeout: float or tuple(float, float) :param signer: (optional) The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values provided in the config parameter. One use case for this parameter is for `Instance Principals authentication <https://docs.cloud.oracle.com/Content/Identity/Tasks/callingservicesfrominstances.htm>`__ by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument :type signer: :py:class:`~oci.signer.AbstractBaseSigner` :param obj retry_strategy: (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` is also available. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. :param obj circuit_breaker_strategy: (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses :py:data:`~oci.circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY` as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/circuit_breakers.html>`__. :param function circuit_breaker_callback: (optional) Callback function to receive any exceptions triggerred by the circuit breaker. :param bool client_level_realm_specific_endpoint_template_enabled: (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None. :param allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object. """ if not OCI_SDK_ENABLED_SERVICES_SET.is_service_enabled("capacity_management"): raise InvalidAlloyConfig("The Alloy configuration has disabled this service, this behavior is controlled by OCI_SDK_ENABLED_SERVICES_SET variable. Please check if your local alloy-config file configured the service you're targeting or contact the cloud provider on the availability of this service") validate_config(config, signer=kwargs.get('signer')) if 'signer' in kwargs: signer = kwargs['signer'] elif AUTHENTICATION_TYPE_FIELD_NAME in config: signer = get_signer_from_authentication_type(config) else: signer = Signer( tenancy=config["tenancy"], user=config["user"], fingerprint=config["fingerprint"], private_key_file_location=config.get("key_file"), pass_phrase=get_config_value_or_default(config, "pass_phrase"), private_key_content=config.get("key_content") ) base_client_init_kwargs = { 'regional_client': True, 'service_endpoint': kwargs.get('service_endpoint'), 'base_path': '/20231107', 'service_endpoint_template': 'https://control-center-cp.{region}.oci.{secondLevelDomain}', 'endpoint_service_name': 'control-center-cp', 'service_endpoint_template_per_realm': { }, # noqa: E201 E202 'skip_deserialization': kwargs.get('skip_deserialization', False), 'circuit_breaker_strategy': kwargs.get('circuit_breaker_strategy', circuit_breaker.GLOBAL_CIRCUIT_BREAKER_STRATEGY), 'client_level_realm_specific_endpoint_template_enabled': kwargs.get('client_level_realm_specific_endpoint_template_enabled') } if 'timeout' in kwargs: base_client_init_kwargs['timeout'] = kwargs.get('timeout') if base_client_init_kwargs.get('circuit_breaker_strategy') is None: base_client_init_kwargs['circuit_breaker_strategy'] = circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY if 'allow_control_chars' in kwargs: base_client_init_kwargs['allow_control_chars'] = kwargs.get('allow_control_chars') self.base_client = BaseClient("capacity_management", config, signer, capacity_management_type_mapping, **base_client_init_kwargs) self.retry_strategy = kwargs.get('retry_strategy') self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback') def create_occ_availability_catalog(self, create_occ_availability_catalog_details, **kwargs): """ Create availability catalog :param oci.capacity_management.models.CreateOccAvailabilityCatalogDetails create_occ_availability_catalog_details: (required) The request details for creating an availability catalog. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCatalog` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/create_occ_availability_catalog.py.html>`__ to see an example of how to use create_occ_availability_catalog API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/occAvailabilityCatalogs" method = "POST" operation_name = "create_occ_availability_catalog" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/CreateOccAvailabilityCatalog" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_occ_availability_catalog got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_occ_availability_catalog_details, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_occ_availability_catalog_details, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_occ_capacity_request(self, create_occ_capacity_request_details, **kwargs): """ Create Capacity Request. :param oci.capacity_management.models.CreateOccCapacityRequestDetails create_occ_capacity_request_details: (required) The request details for creating a capacity request. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/create_occ_capacity_request.py.html>`__ to see an example of how to use create_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/occCapacityRequests" method = "POST" operation_name = "create_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/CreateOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_occ_customer(self, create_occ_customer_details, occ_customer_group_id, **kwargs): """ Create customer. :param oci.capacity_management.models.CreateOccCustomerDetails create_occ_customer_details: (required) The request details for creating a customer. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomer` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/create_occ_customer.py.html>`__ to see an example of how to use create_occ_customer API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}/occCustomers" method = "POST" operation_name = "create_occ_customer" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomer/CreateOccCustomer" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_occ_customer got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=create_occ_customer_details, response_type="OccCustomer", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=create_occ_customer_details, response_type="OccCustomer", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_occ_customer_group(self, create_occ_customer_group_details, **kwargs): """ Create customer group. :param oci.capacity_management.models.CreateOccCustomerGroupDetails create_occ_customer_group_details: (required) The request details for creating a customer group. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomerGroup` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/create_occ_customer_group.py.html>`__ to see an example of how to use create_occ_customer_group API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/occCustomerGroups" method = "POST" operation_name = "create_occ_customer_group" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomerGroup/CreateOccCustomerGroup" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_occ_customer_group got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_occ_customer_group_details, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_occ_customer_group_details, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_occ_availability_catalog(self, occ_availability_catalog_id, **kwargs): """ Deletes the availability catalog resource. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/delete_occ_availability_catalog.py.html>`__ to see an example of how to use delete_occ_availability_catalog API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}" method = "DELETE" operation_name = "delete_occ_availability_catalog" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/DeleteOccAvailabilityCatalog" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_occ_availability_catalog got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_occ_capacity_request(self, occ_capacity_request_id, **kwargs): """ Deletes the capacity request resource. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/delete_occ_capacity_request.py.html>`__ to see an example of how to use delete_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/occCapacityRequests/{occCapacityRequestId}" method = "DELETE" operation_name = "delete_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/DeleteOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_occ_customer(self, occ_customer_group_id, occ_customer_id, **kwargs): """ Deletes the customer resource. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str occ_customer_id: (required) The tenancy id of the customer. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/delete_occ_customer.py.html>`__ to see an example of how to use delete_occ_customer API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId', 'occCustomerId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}/occCustomers/{occCustomerId}" method = "DELETE" operation_name = "delete_occ_customer" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomer/DeleteOccCustomer" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_occ_customer got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id, "occCustomerId": occ_customer_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_occ_customer_group(self, occ_customer_group_id, **kwargs): """ Deletes the customer group resource. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/delete_occ_customer_group.py.html>`__ to see an example of how to use delete_occ_customer_group API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}" method = "DELETE" operation_name = "delete_occ_customer_group" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomerGroup/DeleteOccCustomerGroup" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_occ_customer_group got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_occ_availability_catalog(self, occ_availability_catalog_id, **kwargs): """ Get details about availability catalog. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCatalog` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/get_occ_availability_catalog.py.html>`__ to see an example of how to use get_occ_availability_catalog API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}" method = "GET" operation_name = "get_occ_availability_catalog" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/GetOccAvailabilityCatalog" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_occ_availability_catalog got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_occ_availability_catalog_content(self, occ_availability_catalog_id, **kwargs): """ Returns the binary contents of the availability catalog. Can be saved as a csv file. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type stream :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/get_occ_availability_catalog_content.py.html>`__ to see an example of how to use get_occ_availability_catalog_content API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}/content" method = "GET" operation_name = "get_occ_availability_catalog_content" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/GetOccAvailabilityCatalogContent" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_occ_availability_catalog_content got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/binary", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="stream", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="stream", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_occ_capacity_request(self, occ_capacity_request_id, **kwargs): """ Get details about the capacity request. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/get_occ_capacity_request.py.html>`__ to see an example of how to use get_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/occCapacityRequests/{occCapacityRequestId}" method = "GET" operation_name = "get_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/GetOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_occ_customer_group(self, occ_customer_group_id, **kwargs): """ Gets information about the specified customer group. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomerGroup` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/get_occ_customer_group.py.html>`__ to see an example of how to use get_occ_customer_group API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}" method = "GET" operation_name = "get_occ_customer_group" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomerGroup/GetOccCustomerGroup" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_occ_customer_group got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_internal_namespace_occ_overviews(self, namespace, compartment_id, occ_customer_group_id, **kwargs): """ Lists an overview of all resources in that namespace in a given time interval. :param str namespace: (required) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str occ_customer_group_id: (required) The customer group ocid by which we would filter the list. :param str workload_type: (optional) Workload type using the resources in an availability catalog can be filtered. :param datetime _from: (optional) The month corresponding to this date would be considered as the starting point of the time period against which we would like to perform an aggregation. :param datetime to: (optional) The month corresponding to this date would be considered as the ending point of the time period against which we would like to perform an aggregation. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for periodValue is chronological order(latest month item at the end). Allowed values are: "periodValue" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccOverviewCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_internal_namespace_occ_overviews.py.html>`__ to see an example of how to use list_internal_namespace_occ_overviews API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['namespace', 'compartmentId', 'occCustomerGroupId'] resource_path = "/internal/namespace/{namespace}/occOverview" method = "GET" operation_name = "list_internal_namespace_occ_overviews" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccOverviewCollection/ListInternalNamespaceOccOverviews" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "workload_type", "_from", "to", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_internal_namespace_occ_overviews got unknown kwargs: {extra_kwargs!r}") path_params = { "namespace": namespace } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["periodValue"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "occCustomerGroupId": occ_customer_group_id, "workloadType": kwargs.get("workload_type", missing), "from": kwargs.get("_from", missing), "to": kwargs.get("to", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccOverviewCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccOverviewCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_internal_occ_handover_resource_block_details(self, occ_handover_resource_block_id, **kwargs): """ List details about a given occHandoverResourceBlock. :param str occ_handover_resource_block_id: (required) The OCID of the OccHandoverResource which is a required query parameter for listing OccHandoverResourceDetails. :param str host_id: (optional) This fiter is applicable only for COMPUTE namespace. It helps in fetching of all resource block details for which the hostId is equal to the one provided in this query param. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for handoverDate is chronological order(latest date item at the end). Allowed values are: "handoverDate" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccHandoverResourceBlockDetailCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_internal_occ_handover_resource_block_details.py.html>`__ to see an example of how to use list_internal_occ_handover_resource_block_details API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occHandoverResourceBlockId'] resource_path = "/internal/occHandoverResourceBlockDetails" method = "GET" operation_name = "list_internal_occ_handover_resource_block_details" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccHandoverResourceBlockDetailCollection/ListInternalOccHandoverResourceBlockDetails" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "host_id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_internal_occ_handover_resource_block_details got unknown kwargs: {extra_kwargs!r}") if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["handoverDate"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "occHandoverResourceBlockId": occ_handover_resource_block_id, "hostId": kwargs.get("host_id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockDetailCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockDetailCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_internal_occ_handover_resource_blocks(self, namespace, compartment_id, occ_customer_group_id, **kwargs): """ List Occ Handover Resource blocks. :param str namespace: (required) The namespace enum value that needs to be passed as a required query parameter. Allowed values are: "COMPUTE" :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str occ_customer_group_id: (required) The customer group ocid by which we would filter the list. :param str handover_resource_name: (optional) A filter to return only the list of resources that match the name provided in this filter. :param datetime handover_date_greater_than_or_equal_to: (optional) This filter helps in fetching all handed over resources for which the recordDate is greater than or equal to the startDate. :param datetime handover_date_less_than_or_equal_to: (optional) This filter helps in fetching all handed over resources for which the recordDate is less than or equal to the endDate. :param str occ_handover_resource_block_id: (optional) This filter helps in fetching the handed over resource for which the occHandoverResourceId is equal to the one provided here. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for handoverDate is chronological order(latest date item at the end). Allowed values are: "handoverDate" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccHandoverResourceBlockCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_internal_occ_handover_resource_blocks.py.html>`__ to see an example of how to use list_internal_occ_handover_resource_blocks API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['namespace', 'compartmentId', 'occCustomerGroupId'] resource_path = "/internal/occHandoverResourceBlocks" method = "GET" operation_name = "list_internal_occ_handover_resource_blocks" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccHandoverResourceBlockCollection/ListInternalOccHandoverResourceBlocks" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "handover_resource_name", "handover_date_greater_than_or_equal_to", "handover_date_less_than_or_equal_to", "occ_handover_resource_block_id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_internal_occ_handover_resource_blocks got unknown kwargs: {extra_kwargs!r}") namespace_allowed_values = ["COMPUTE"] if namespace not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["handoverDate"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "namespace": namespace, "compartmentId": compartment_id, "occCustomerGroupId": occ_customer_group_id, "handoverResourceName": kwargs.get("handover_resource_name", missing), "handoverDateGreaterThanOrEqualTo": kwargs.get("handover_date_greater_than_or_equal_to", missing), "handoverDateLessThanOrEqualTo": kwargs.get("handover_date_less_than_or_equal_to", missing), "occHandoverResourceBlockId": kwargs.get("occ_handover_resource_block_id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_availabilities(self, occ_availability_catalog_id, **kwargs): """ Lists availabilities for a particular availability catalog. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str date_expected_capacity_handover: (optional) The capacity handover date of the capacity constraint to filter the list of capacity constraints. :param str resource_name: (optional) The name of the resource to filter the list of capacity constraints. :param str resource_type: (optional) Resource type using which the capacity constraints of an availability catalog can be filtered. :param str workload_type: (optional) Workload type using the resources in an availability catalog can be filtered. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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. Allowed values are: "dateExpectedCapacityHandover", "resourceName" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_availabilities.py.html>`__ to see an example of how to use list_occ_availabilities API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}/occAvailabilities" method = "GET" operation_name = "list_occ_availabilities" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCollection/ListOccAvailabilities" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "date_expected_capacity_handover", "resource_name", "resource_type", "workload_type", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_availabilities got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["dateExpectedCapacityHandover", "resourceName"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "dateExpectedCapacityHandover": kwargs.get("date_expected_capacity_handover", missing), "resourceName": kwargs.get("resource_name", missing), "resourceType": kwargs.get("resource_type", missing), "workloadType": kwargs.get("workload_type", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_availability_catalogs(self, compartment_id, **kwargs): """ Lists all availability catalogs. :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str namespace: (optional) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str id: (optional) The OCID of the availability catalog to filter the list of availability catalogs. :param str display_name: (optional) A filter to return only the resources that match the entire display name. The match is not case sensitive. :param str catalog_state: (optional) Filter the list of availability catalogs based on the catalog state. Allowed values are: "NOT_UPLOADED", "UPLOAD_FAILED", "STAGED", "PUBLISHED", "OUTDATED", "DELETED" :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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. Allowed values are: "displayName", "timeCreated" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCatalogCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_availability_catalogs.py.html>`__ to see an example of how to use list_occ_availability_catalogs API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/occAvailabilityCatalogs" method = "GET" operation_name = "list_occ_availability_catalogs" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalogCollection/ListOccAvailabilityCatalogs" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "namespace", "id", "display_name", "catalog_state", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_availability_catalogs got unknown kwargs: {extra_kwargs!r}") if 'namespace' in kwargs: namespace_allowed_values = ["COMPUTE"] if kwargs['namespace'] not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'catalog_state' in kwargs: catalog_state_allowed_values = ["NOT_UPLOADED", "UPLOAD_FAILED", "STAGED", "PUBLISHED", "OUTDATED", "DELETED"] if kwargs['catalog_state'] not in catalog_state_allowed_values: raise ValueError( f"Invalid value for `catalog_state`, must be one of { catalog_state_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["displayName", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "namespace": kwargs.get("namespace", missing), "id": kwargs.get("id", missing), "displayName": kwargs.get("display_name", missing), "catalogState": kwargs.get("catalog_state", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCatalogCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCatalogCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_availability_catalogs_internal(self, compartment_id, occ_customer_group_id, **kwargs): """ An internal api to list availability catalogs. :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str occ_customer_group_id: (required) The customer group ocid by which we would filter the list. :param str namespace: (optional) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str id: (optional) The OCID of the availability catalog to filter the list of availability catalogs. :param str display_name: (optional) A filter to return only the resources that match the entire display name. The match is not case sensitive. :param str catalog_state: (optional) Filter the list of availability catalogs based on the catalog state. Allowed values are: "NOT_UPLOADED", "UPLOAD_FAILED", "STAGED", "PUBLISHED", "OUTDATED", "DELETED" :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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. Allowed values are: "displayName", "timeCreated" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCatalogCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_availability_catalogs_internal.py.html>`__ to see an example of how to use list_occ_availability_catalogs_internal API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId', 'occCustomerGroupId'] resource_path = "/internal/occAvailabilityCatalogs" method = "GET" operation_name = "list_occ_availability_catalogs_internal" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalogCollection/ListOccAvailabilityCatalogsInternal" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "namespace", "id", "display_name", "catalog_state", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_availability_catalogs_internal got unknown kwargs: {extra_kwargs!r}") if 'namespace' in kwargs: namespace_allowed_values = ["COMPUTE"] if kwargs['namespace'] not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'catalog_state' in kwargs: catalog_state_allowed_values = ["NOT_UPLOADED", "UPLOAD_FAILED", "STAGED", "PUBLISHED", "OUTDATED", "DELETED"] if kwargs['catalog_state'] not in catalog_state_allowed_values: raise ValueError( f"Invalid value for `catalog_state`, must be one of { catalog_state_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["displayName", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "namespace": kwargs.get("namespace", missing), "id": kwargs.get("id", missing), "displayName": kwargs.get("display_name", missing), "catalogState": kwargs.get("catalog_state", missing), "occCustomerGroupId": occ_customer_group_id, "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCatalogCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccAvailabilityCatalogCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_capacity_requests(self, compartment_id, **kwargs): """ Lists all capacity requests. :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str occ_availability_catalog_id: (optional) A filter to return the list of capacity requests based on the OCID of the availability catalog against which they were created. :param str namespace: (optional) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str request_type: (optional) A filter to return only the resources that match the request type. The match is not case sensitive. Allowed values are: "NEW", "TRANSFER" :param str display_name: (optional) A filter to return only the resources that match the entire display name. The match is not case sensitive. :param str id: (optional) 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. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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). Allowed values are: "displayName", "timeCreated" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequestCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_capacity_requests.py.html>`__ to see an example of how to use list_occ_capacity_requests API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/occCapacityRequests" method = "GET" operation_name = "list_occ_capacity_requests" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequestCollection/ListOccCapacityRequests" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "occ_availability_catalog_id", "namespace", "request_type", "display_name", "id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_capacity_requests got unknown kwargs: {extra_kwargs!r}") if 'namespace' in kwargs: namespace_allowed_values = ["COMPUTE"] if kwargs['namespace'] not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'request_type' in kwargs: request_type_allowed_values = ["NEW", "TRANSFER"] if kwargs['request_type'] not in request_type_allowed_values: raise ValueError( f"Invalid value for `request_type`, must be one of { request_type_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["displayName", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "occAvailabilityCatalogId": kwargs.get("occ_availability_catalog_id", missing), "namespace": kwargs.get("namespace", missing), "requestType": kwargs.get("request_type", missing), "displayName": kwargs.get("display_name", missing), "id": kwargs.get("id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCapacityRequestCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCapacityRequestCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_capacity_requests_internal(self, compartment_id, occ_customer_group_id, **kwargs): """ An internal api to list all capacity requests. :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str occ_customer_group_id: (required) The customer group ocid by which we would filter the list. :param str occ_availability_catalog_id: (optional) A filter to return the list of capacity requests based on the OCID of the availability catalog against which they were created. :param str namespace: (optional) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str display_name: (optional) A filter to return only the resources that match the entire display name. The match is not case sensitive. :param str request_type: (optional) A filter to return only the resources that match the request type. The match is not case sensitive. Allowed values are: "NEW", "TRANSFER" :param str id: (optional) 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. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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). Allowed values are: "displayName", "timeCreated" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequestCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_capacity_requests_internal.py.html>`__ to see an example of how to use list_occ_capacity_requests_internal API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId', 'occCustomerGroupId'] resource_path = "/internal/occCapacityRequests" method = "GET" operation_name = "list_occ_capacity_requests_internal" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequestCollection/ListOccCapacityRequestsInternal" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "occ_availability_catalog_id", "namespace", "display_name", "request_type", "id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_capacity_requests_internal got unknown kwargs: {extra_kwargs!r}") if 'namespace' in kwargs: namespace_allowed_values = ["COMPUTE"] if kwargs['namespace'] not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'request_type' in kwargs: request_type_allowed_values = ["NEW", "TRANSFER"] if kwargs['request_type'] not in request_type_allowed_values: raise ValueError( f"Invalid value for `request_type`, must be one of { request_type_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["displayName", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "occCustomerGroupId": occ_customer_group_id, "occAvailabilityCatalogId": kwargs.get("occ_availability_catalog_id", missing), "namespace": kwargs.get("namespace", missing), "displayName": kwargs.get("display_name", missing), "requestType": kwargs.get("request_type", missing), "id": kwargs.get("id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCapacityRequestCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCapacityRequestCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_customer_groups(self, compartment_id, **kwargs): """ Lists all the customer groups. :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param str status: (optional) A query filter to return the list result based on status. Allowed values are: "ENABLED", "DISABLED" :param str display_name: (optional) A filter to return only the resources that match the entire display name. The match is not case sensitive. :param str id: (optional) 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. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) 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. Allowed values are: "compartmentId", "name", "timeCreated" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomerGroupCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_customer_groups.py.html>`__ to see an example of how to use list_occ_customer_groups API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/occCustomerGroups" method = "GET" operation_name = "list_occ_customer_groups" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomerGroupCollection/ListOccCustomerGroups" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "status", "display_name", "id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_customer_groups got unknown kwargs: {extra_kwargs!r}") if 'status' in kwargs: status_allowed_values = ["ENABLED", "DISABLED"] if kwargs['status'] not in status_allowed_values: raise ValueError( f"Invalid value for `status`, must be one of { status_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["compartmentId", "name", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "status": kwargs.get("status", missing), "displayName": kwargs.get("display_name", missing), "id": kwargs.get("id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCustomerGroupCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccCustomerGroupCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_handover_resource_block_details(self, occ_handover_resource_block_id, **kwargs): """ List details about a given occHandoverResourceBlock. :param str occ_handover_resource_block_id: (required) The OCID of the OccHandoverResource which is a required query parameter for listing OccHandoverResourceDetails. :param str host_id: (optional) This fiter is applicable only for COMPUTE namespace. It helps in fetching of all resource block details for which the hostId is equal to the one provided in this query param. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for handoverDate is chronological order(latest date item at the end). Allowed values are: "handoverDate" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccHandoverResourceBlockDetailCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_handover_resource_block_details.py.html>`__ to see an example of how to use list_occ_handover_resource_block_details API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occHandoverResourceBlockId'] resource_path = "/occHandoverResourceBlockDetails" method = "GET" operation_name = "list_occ_handover_resource_block_details" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccHandoverResourceBlockDetailCollection/ListOccHandoverResourceBlockDetails" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "host_id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_handover_resource_block_details got unknown kwargs: {extra_kwargs!r}") if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["handoverDate"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "occHandoverResourceBlockId": occ_handover_resource_block_id, "hostId": kwargs.get("host_id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockDetailCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockDetailCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_handover_resource_blocks(self, **kwargs): """ List Occ Handover Resource blocks. :param str namespace: (optional) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str compartment_id: (optional) The OCID of the compartment or tenancy in which resources are to be listed. :param str handover_resource_name: (optional) A filter to return only the list of resources that match the name provided in this filter. :param datetime handover_date_greater_than_or_equal_to: (optional) This filter helps in fetching all handed over resources for which the recordDate is greater than or equal to the startDate. :param datetime handover_date_less_than_or_equal_to: (optional) This filter helps in fetching all handed over resources for which the recordDate is less than or equal to the endDate. :param str occ_handover_resource_block_id: (optional) This filter helps in fetching the handed over resource for which the occHandoverResourceId is equal to the one provided here. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for handoverDate is chronological order(latest date item at the end). Allowed values are: "handoverDate" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccHandoverResourceBlockCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_handover_resource_blocks.py.html>`__ to see an example of how to use list_occ_handover_resource_blocks API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/occHandoverResourceBlocks" method = "GET" operation_name = "list_occ_handover_resource_blocks" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccHandoverResourceBlockCollection/ListOccHandoverResourceBlocks" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "namespace", "compartment_id", "handover_resource_name", "handover_date_greater_than_or_equal_to", "handover_date_less_than_or_equal_to", "occ_handover_resource_block_id", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_handover_resource_blocks got unknown kwargs: {extra_kwargs!r}") if 'namespace' in kwargs: namespace_allowed_values = ["COMPUTE"] if kwargs['namespace'] not in namespace_allowed_values: raise ValueError( f"Invalid value for `namespace`, must be one of { namespace_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["handoverDate"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "namespace": kwargs.get("namespace", missing), "compartmentId": kwargs.get("compartment_id", missing), "handoverResourceName": kwargs.get("handover_resource_name", missing), "handoverDateGreaterThanOrEqualTo": kwargs.get("handover_date_greater_than_or_equal_to", missing), "handoverDateLessThanOrEqualTo": kwargs.get("handover_date_less_than_or_equal_to", missing), "occHandoverResourceBlockId": kwargs.get("occ_handover_resource_block_id", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="OccHandoverResourceBlockCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_occ_overviews(self, namespace, compartment_id, **kwargs): """ Lists an overview of all resources in that namespace in a given time interval. :param str namespace: (required) The namespace by which we would filter the list. Allowed values are: "COMPUTE" :param str compartment_id: (required) The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. :param datetime _from: (optional) The month corresponding to this date would be considered as the starting point of the time period against which we would like to perform an aggregation. :param datetime to: (optional) The month corresponding to this date would be considered as the ending point of the time period against which we would like to perform an aggregation. :param str workload_type: (optional) Workload type using the resources in an availability catalog can be filtered. :param int limit: (optional) The maximum number of items to return. :param str page: (optional) A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str sort_order: (optional) The sort order to use, either 'ASC' or 'DESC'. Allowed values are: "ASC", "DESC" :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. The default order for periodValue is chronological order(latest month item at the end). Allowed values are: "periodValue" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccOverviewCollection` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/list_occ_overviews.py.html>`__ to see an example of how to use list_occ_overviews API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['namespace', 'compartmentId'] resource_path = "/namespace/{namespace}/occOverview" method = "GET" operation_name = "list_occ_overviews" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccOverviewCollection/ListOccOverviews" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "_from", "to", "workload_type", "limit", "page", "opc_request_id", "sort_order", "sort_by" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_occ_overviews got unknown kwargs: {extra_kwargs!r}") path_params = { "namespace": namespace } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'sort_by' in kwargs: sort_by_allowed_values = ["periodValue"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) query_params = { "compartmentId": compartment_id, "from": kwargs.get("_from", missing), "to": kwargs.get("to", missing), "workloadType": kwargs.get("workload_type", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortOrder": kwargs.get("sort_order", missing), "sortBy": kwargs.get("sort_by", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccOverviewCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="OccOverviewCollection", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def patch_internal_occ_capacity_request(self, patch_occ_capacity_request_details, occ_capacity_request_id, **kwargs): """ Updates the OccCapacityRequest by evaluating a sequence of instructions. :param oci.capacity_management.models.PatchOccCapacityRequestDetails patch_occ_capacity_request_details: (required) Request to update the details of the capacity request. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/patch_internal_occ_capacity_request.py.html>`__ to see an example of how to use patch_internal_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/internal/occCapacityRequests/{occCapacityRequestId}" method = "PATCH" operation_name = "patch_internal_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/PatchInternalOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"patch_internal_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=patch_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=patch_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def patch_occ_capacity_request(self, patch_occ_capacity_request_details, occ_capacity_request_id, **kwargs): """ Updates the OccCapacityRequest by evaluating a sequence of instructions. :param oci.capacity_management.models.PatchOccCapacityRequestDetails patch_occ_capacity_request_details: (required) Request to update the details of the capacity request. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/patch_occ_capacity_request.py.html>`__ to see an example of how to use patch_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/occCapacityRequests/{occCapacityRequestId}" method = "PATCH" operation_name = "patch_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/PatchOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"patch_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=patch_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=patch_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def publish_occ_availability_catalog(self, occ_availability_catalog_id, **kwargs): """ Publishes the version of availability catalog specified by the operator. This makes that catalog version visible to customers. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str opc_retry_token: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/publish_occ_availability_catalog.py.html>`__ to see an example of how to use publish_occ_availability_catalog API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}/actions/publish" method = "POST" operation_name = "publish_occ_availability_catalog" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/PublishOccAvailabilityCatalog" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_retry_token", "opc_request_id", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"publish_occ_availability_catalog got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-retry-token": kwargs.get("opc_retry_token", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_internal_occ_capacity_request(self, update_internal_occ_capacity_request_details, occ_capacity_request_id, **kwargs): """ 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. :param oci.capacity_management.models.UpdateInternalOccCapacityRequestDetails update_internal_occ_capacity_request_details: (required) Request to update the properties of the capacity request. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/update_internal_occ_capacity_request.py.html>`__ to see an example of how to use update_internal_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/internal/occCapacityRequests/{occCapacityRequestId}" method = "PUT" operation_name = "update_internal_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/UpdateInternalOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_internal_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_internal_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_internal_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_occ_availability_catalog(self, update_occ_availability_catalog_details, occ_availability_catalog_id, **kwargs): """ The request to update the availability catalog. Currently only freeform tags can be updated via this api. :param oci.capacity_management.models.UpdateOccAvailabilityCatalogDetails update_occ_availability_catalog_details: (required) Request to update the properties of the availability catalog. :param str occ_availability_catalog_id: (required) The OCID of the availability catalog. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccAvailabilityCatalog` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/update_occ_availability_catalog.py.html>`__ to see an example of how to use update_occ_availability_catalog API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occAvailabilityCatalogId'] resource_path = "/occAvailabilityCatalogs/{occAvailabilityCatalogId}" method = "PUT" operation_name = "update_occ_availability_catalog" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccAvailabilityCatalog/UpdateOccAvailabilityCatalog" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_occ_availability_catalog got unknown kwargs: {extra_kwargs!r}") path_params = { "occAvailabilityCatalogId": occ_availability_catalog_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_availability_catalog_details, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_availability_catalog_details, response_type="OccAvailabilityCatalog", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_occ_capacity_request(self, update_occ_capacity_request_details, occ_capacity_request_id, **kwargs): """ 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. :param oci.capacity_management.models.UpdateOccCapacityRequestDetails update_occ_capacity_request_details: (required) Request to update the properties of the capacity request. :param str occ_capacity_request_id: (required) The OCID of the capacity request. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCapacityRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/update_occ_capacity_request.py.html>`__ to see an example of how to use update_occ_capacity_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCapacityRequestId'] resource_path = "/occCapacityRequests/{occCapacityRequestId}" method = "PUT" operation_name = "update_occ_capacity_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCapacityRequest/UpdateOccCapacityRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_occ_capacity_request got unknown kwargs: {extra_kwargs!r}") path_params = { "occCapacityRequestId": occ_capacity_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_capacity_request_details, response_type="OccCapacityRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_occ_customer(self, update_occ_customer_details, occ_customer_group_id, occ_customer_id, **kwargs): """ The request to update the customer. :param oci.capacity_management.models.UpdateOccCustomerDetails update_occ_customer_details: (required) Request to update the properties of the customer group. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str occ_customer_id: (required) The tenancy id of the customer. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomer` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/update_occ_customer.py.html>`__ to see an example of how to use update_occ_customer API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId', 'occCustomerId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}/occCustomers/{occCustomerId}" method = "PUT" operation_name = "update_occ_customer" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomer/UpdateOccCustomer" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_occ_customer got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id, "occCustomerId": occ_customer_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_customer_details, response_type="OccCustomer", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_customer_details, response_type="OccCustomer", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_occ_customer_group(self, update_occ_customer_group_details, occ_customer_group_id, **kwargs): """ The request to update the customer group. :param oci.capacity_management.models.UpdateOccCustomerGroupDetails update_occ_customer_group_details: (required) Request to update the properties of the customer group. :param str occ_customer_group_id: (required) The OCID of the customer group. :param str if_match: (optional) 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. :param str opc_request_id: (optional) The client request ID for tracing. The only valid characters for request IDs are letters, numbers, underscore, and dash. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.capacity_management.models.OccCustomerGroup` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.138.1/capacitymanagement/update_occ_customer_group.py.html>`__ to see an example of how to use update_occ_customer_group API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['occCustomerGroupId'] resource_path = "/occCustomerGroups/{occCustomerGroupId}" method = "PUT" operation_name = "update_occ_customer_group" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/occcm/20231107/OccCustomerGroup/UpdateOccCustomerGroup" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_occ_customer_group got unknown kwargs: {extra_kwargs!r}") path_params = { "occCustomerGroupId": occ_customer_group_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_customer_group_details, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_occ_customer_group_details, response_type="OccCustomerGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments)