def list_streams(self, compartment_id, **kwargs):
        """
        Lists the streams.
        Lists the streams.


        :param str compartment_id: (required)
            The OCID of the compartment.

        :param str id: (optional)
            A filter to return only resources that match the given ID exactly.

        :param str name: (optional)
            A filter to return only resources that match the given name exactly.

        :param int limit: (optional)
            The maximum number of items to return. The value must be between 1 and 50. The default is 10.

        :param str page: (optional)
            The page at which to start retrieving results.

        :param str sort_by: (optional)
            The field to sort by. You can provide no more than one sort order. By default, `TIMECREATED` sorts results in descending order and `NAME` sorts results in ascending order.

            Allowed values are: "NAME", "TIMECREATED"

        :param str sort_order: (optional)
            The sort order to use, either 'asc' or 'desc'.

            Allowed values are: "ASC", "DESC"

        :param str lifecycle_state: (optional)
            A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

            Allowed values are: "CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED"

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.streaming.models.StreamSummary`
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/streams"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "id", "name", "limit", "page", "sort_by",
            "sort_order", "lifecycle_state", "opc_request_id"
        ]
        extra_kwargs = [
            key for key in six.iterkeys(kwargs) if key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_streams got unknown kwargs: {!r}".format(extra_kwargs))

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["NAME", "TIMECREATED"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(
                        sort_by_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(
                    "Invalid value for `sort_order`, must be one of {0}".
                    format(sort_order_allowed_values))

        if 'lifecycle_state' in kwargs:
            lifecycle_state_allowed_values = [
                "CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED"
            ]
            if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
                raise ValueError(
                    "Invalid value for `lifecycle_state`, must be one of {0}".
                    format(lifecycle_state_allowed_values))

        query_params = {
            "compartmentId": compartment_id,
            "id": kwargs.get("id", missing),
            "name": kwargs.get("name", missing),
            "limit": kwargs.get("limit", missing),
            "page": kwargs.get("page", missing),
            "sortBy": kwargs.get("sort_by", missing),
            "sortOrder": kwargs.get("sort_order", missing),
            "lifecycleState": kwargs.get("lifecycle_state", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="list[StreamSummary]")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="list[StreamSummary]")
    def update_quota(self, quota_id, update_quota_details, **kwargs):
        """
        Updates the quota corresponding to given OCID with the details supplied.


        :param str quota_id: (required)
            The OCID of the quota.

        :param oci.limits.models.UpdateQuotaDetails update_quota_details: (required)
            Request object for updating a quota.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.limits.models.Quota`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/limits/update_quota.py.html>`__ to see an example of how to use update_quota API.
        """
        resource_path = "/20181025/quotas/{quotaId}"
        method = "PUT"

        # Don't accept unknown kwargs
        expected_kwargs = ["retry_strategy", "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(
                "update_quota got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {"quotaId": quota_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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_quota_details,
                response_type="Quota")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             body=update_quota_details,
                                             response_type="Quota")
Beispiel #3
0
    def activate_nfs_dataset(self, dataset_name, **kwargs):
        """
        Activates the NFS dataset
        Activates the NFS dataset


        :param str dataset_name: (required)

        :param Details details: (optional)

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/dataset/nfs/{datasetName}/activate"
        method = "PUT"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "details", "auth_value", "serial_id"
        ]
        extra_kwargs = [
            key for key in six.iterkeys(kwargs) if key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "activate_nfs_dataset got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"datasetName": dataset_name}

        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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "xa-auth": kwargs.get('auth_value'),
            "xa-serial-id": kwargs.get('serial_id')
        }

        retry_strategy = self.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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=kwargs.get('details'))
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             body=kwargs.get('details'))
Beispiel #4
0
    def update_subscription(self, subscription_id, update_subscription_details,
                            **kwargs):
        """
        Updates the specified subscription's configuration.


        :param str subscription_id: (required)
            The `OCID`__ of the subscription to update.

            __ https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm

        :param UpdateSubscriptionDetails update_subscription_details: (required)
            The configuration details for updating the subscription.

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            Used 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.ons.models.UpdateSubscriptionDetails`
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/subscriptions/{subscriptionId}"
        method = "PUT"

        # Don't accept unknown kwargs
        expected_kwargs = ["retry_strategy", "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(
                "update_subscription got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"subscriptionId": subscription_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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_subscription_details,
                response_type="UpdateSubscriptionDetails")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params,
                body=update_subscription_details,
                response_type="UpdateSubscriptionDetails")
Beispiel #5
0
    def get_work_request(self, work_request_id, **kwargs):
        """
        Gets the details of a work request.


        :param str work_request_id: (required)
            The `OCID`__ of the work request.

            __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.work_requests.models.WorkRequest`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/workrequests/get_work_request.py.html>`__ to see an example of how to use get_work_request API.
        """
        resource_path = "/workRequests/{workRequestId}"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "get_work_request got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"workRequestId": work_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="WorkRequest")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             response_type="WorkRequest")
    def get_commitment(self, commitment_id, **kwargs):
        """
        This API returns the commitment details corresponding to the id provided


        :param str commitment_id: (required)
            The Commitment Id

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :param str x_one_gateway_subscription_id: (optional)
            This header is meant to be used only for internal purposes and will be ignored on any public request. The purpose of this header is
            to help on Gateway to API calls identification.

        :param str x_one_origin_region: (optional)
            The OCI home region name in case home region is not us-ashburn-1 (IAD), e.g. ap-mumbai-1, us-phoenix-1 etc.

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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.osub_subscription.models.CommitmentDetail`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/osubsubscription/get_commitment.py.html>`__ to see an example of how to use get_commitment API.
        """
        resource_path = "/commitments/{commitmentId}"
        method = "GET"
        operation_name = "get_commitment"
        api_reference_link = ""

        # Don't accept unknown kwargs
        expected_kwargs = [
            "allow_control_chars", "retry_strategy", "opc_request_id",
            "x_one_gateway_subscription_id", "x_one_origin_region"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "get_commitment got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {"commitmentId": commitment_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept":
            "application/json",
            "content-type":
            "application/json",
            "opc-request-id":
            kwargs.get("opc_request_id", missing),
            "x-one-gateway-subscription-id":
            kwargs.get("x_one_gateway_subscription_id", missing),
            "x-one-origin-region":
            kwargs.get("x_one_origin_region", 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:
            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="CommitmentDetail",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params,
                response_type="CommitmentDetail",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
Beispiel #7
0
    def get_unsubscription(self, id, token, protocol, **kwargs):
        """
        Gets the unsubscription details for the specified subscription.


        :param str id: (required)
            The `OCID`__ of the subscription to unsubscribe from.

            __ https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm

        :param str token: (required)
            The subscription confirmation token.

        :param str protocol: (required)
            The subscription protocol. Valid values: EMAIL, HTTPS.

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type str
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/subscriptions/{id}/unsubscription"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "get_unsubscription got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"id": 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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        query_params = {"token": token, "protocol": protocol}
        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="str")
        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="str")
    def create_incident(self, create_incident_details, ocid, **kwargs):
        """
        Enables the customer to create an support ticket.


        :param oci.cims.models.CreateIncident create_incident_details: (required)
            Incident information

        :param str ocid: (required)
            User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :param str homeregion: (optional)
            The region of the tenancy.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.cims.models.Incident`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/cims/create_incident.py.html>`__ to see an example of how to use create_incident API.
        """
        resource_path = "/v2/incidents"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = ["retry_strategy", "opc_request_id", "homeregion"]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError("create_incident got unknown kwargs: {!r}".format(
                extra_kwargs))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "ocid": ocid,
            "homeregion": kwargs.get("homeregion", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_incident_details,
                response_type="Incident")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             header_params=header_params,
                                             body=create_incident_details,
                                             response_type="Incident")
Beispiel #9
0
    def generate_data_encryption_key(self, generate_key_details, **kwargs):
        """
        GenerateDataEncryptionKey
        Generates a key that you can use to encrypt or decrypt data.


        :param GenerateKeyDetails generate_key_details: (required)
            GenerateKeyDetails

        :param str opc_request_id: (optional)
            Unique identifier for the request. If provided, the returned request ID
            will include this value. Otherwise, a random request ID will be
            generated by the service.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.key_management.models.GeneratedKey`
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/20180608/generateDataEncryptionKey"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "generate_data_encryption_key got unknown kwargs: {!r}".format(
                    extra_kwargs))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=generate_key_details,
                response_type="GeneratedKey")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             header_params=header_params,
                                             body=generate_key_details,
                                             response_type="GeneratedKey")
    def list_incidents(self, csi, compartment_id, ocid, **kwargs):
        """
        Returns the list of support tickets raised by the tenancy.


        :param str csi: (required)
            The Customer Support Identifier associated with the support account.

        :param str compartment_id: (required)
            The OCID of the tenancy.

        :param str ocid: (required)
            User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account.

        :param int limit: (optional)
            For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str sort_by: (optional)
            The key to use to sort the returned items.

            Allowed values are: "dateUpdated", "severity"

        :param str sort_order: (optional)
            The order to sort the results in.

            Allowed values are: "ASC", "DESC"

        :param str lifecycle_state: (optional)
            The current state of the ticket.

            Allowed values are: "ACTIVE", "CLOSED"

        :param str page: (optional)
            For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. For important details about how pagination works, see `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :param str homeregion: (optional)
            The region of the tenancy.

        :param str problem_type: (optional)
            The kind of support request.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.cims.models.IncidentSummary`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/cims/list_incidents.py.html>`__ to see an example of how to use list_incidents API.
        """
        resource_path = "/v2/incidents"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "limit", "sort_by", "sort_order",
            "lifecycle_state", "page", "opc_request_id", "homeregion",
            "problem_type"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_incidents got unknown kwargs: {!r}".format(extra_kwargs))

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["dateUpdated", "severity"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(
                        sort_by_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(
                    "Invalid value for `sort_order`, must be one of {0}".
                    format(sort_order_allowed_values))

        if 'lifecycle_state' in kwargs:
            lifecycle_state_allowed_values = ["ACTIVE", "CLOSED"]
            if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
                raise ValueError(
                    "Invalid value for `lifecycle_state`, must be one of {0}".
                    format(lifecycle_state_allowed_values))

        query_params = {
            "limit": kwargs.get("limit", missing),
            "compartmentId": compartment_id,
            "sortBy": kwargs.get("sort_by", missing),
            "sortOrder": kwargs.get("sort_order", missing),
            "lifecycleState": kwargs.get("lifecycle_state", missing),
            "page": kwargs.get("page", missing),
            "problemType": kwargs.get("problem_type", 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",
            "csi": csi,
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "ocid": ocid,
            "homeregion": kwargs.get("homeregion", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="list[IncidentSummary]")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="list[IncidentSummary]")
    def update_incident(self, incident_key, csi, update_incident_details, ocid,
                        **kwargs):
        """
        Updates the specified support ticket's information.


        :param str incident_key: (required)
            Unique identifier for the support ticket.

        :param str csi: (required)
            The Customer Support Identifier associated with the support account.

        :param oci.cims.models.UpdateIncident update_incident_details: (required)
            Details about the support ticket being updated.

        :param str ocid: (required)
            User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :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 homeregion: (optional)
            The region of the tenancy.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.cims.models.Incident`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/cims/update_incident.py.html>`__ to see an example of how to use update_incident API.
        """
        resource_path = "/v2/incidents/{incidentKey}"
        method = "PUT"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "opc_request_id", "if_match", "homeregion"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError("update_incident got unknown kwargs: {!r}".format(
                extra_kwargs))

        path_params = {"incidentKey": incident_key}

        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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "csi": csi,
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "if-match": kwargs.get("if_match", missing),
            "ocid": ocid,
            "homeregion": kwargs.get("homeregion", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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_incident_details,
                response_type="Incident")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             body=update_incident_details,
                                             response_type="Incident")
    def get_status(self, source, ocid, **kwargs):
        """
        Gets the status of the service.


        :param str source: (required)
            The system that generated the support ticket, such as My Oracle Support.

        :param str ocid: (required)
            User OCID for Oracle Identity Cloud Service (IDCS) users who also have a federated Oracle Cloud Infrastructure account.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :param str homeregion: (optional)
            The region of the tenancy.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.cims.models.Status`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/cims/get_status.py.html>`__ to see an example of how to use get_status API.
        """
        resource_path = "/v2/incidents/status/{source}"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = ["retry_strategy", "opc_request_id", "homeregion"]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "get_status got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {"source": source}

        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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "ocid": ocid,
            "homeregion": kwargs.get("homeregion", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="Status")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             response_type="Status")
    def change_stream_compartment(self, stream_id,
                                  change_stream_compartment_details, **kwargs):
        """
        Moves a resource into a different compartment.
        Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource.


        :param str stream_id: (required)
            The OCID of the stream to change compatment for.

        :param ChangeStreamCompartmentDetails change_stream_compartment_details: (required)
            The stream will be moved into the compartment specified within this entity.

        :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 unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/streams/{streamId}/actions/changeCompartment"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "change_stream_compartment got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"streamId": stream_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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=change_stream_compartment_details)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params,
                body=change_stream_compartment_details)
    def update_stream(self, stream_id, update_stream_details, **kwargs):
        """
        Updates a stream.
        Updates the tags applied to the stream.


        :param str stream_id: (required)
            The OCID of the stream to update.

        :param UpdateStreamDetails update_stream_details: (required)
            The stream is updated with the tags provided.

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.streaming.models.Stream`
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/streams/{streamId}"
        method = "PUT"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "update_stream got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {"streamId": stream_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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_stream_details,
                response_type="Stream")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             body=update_stream_details,
                                             response_type="Stream")
Beispiel #15
0
    def change_sddc_compartment(self, sddc_id, change_sddc_compartment_details, **kwargs):
        """
        Moves an SDDC into a different compartment within the same tenancy. For information
        about moving resources between compartments, see
        `Moving Resources to a Different Compartment`__.

        __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes


        :param str sddc_id: (required)
            The `OCID`__ of the SDDC.

            __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

        :param oci.ocvp.models.ChangeSddcCompartmentDetails change_sddc_compartment_details: (required)
            Request to change the compartment of the specified SDDC

        :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)
            Unique identifier for the request. If you need to contact Oracle about a particular
            request, please provide the request ID.

        :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
            may be rejected).

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :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/latest/ocvp/change_sddc_compartment.py.html>`__ to see an example of how to use change_sddc_compartment API.
        """
        resource_path = "/sddcs/{sddcId}/actions/changeCompartment"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy",
            "if_match",
            "opc_request_id",
            "opc_retry_token"
        ]
        extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
        if extra_kwargs:
            raise ValueError(
                "change_sddc_compartment got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {
            "sddcId": sddc_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('Parameter {} cannot be None, whitespace or empty string'.format(k))

        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),
            "opc-retry-token": kwargs.get("opc_retry_token", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            if not isinstance(retry_strategy, retry.NoneRetryStrategy):
                self.base_client.add_opc_retry_token_if_needed(header_params)
            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=change_sddc_compartment_details)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params,
                body=change_sddc_compartment_details)
Beispiel #16
0
    def decrypt(self, decrypt_data_details, **kwargs):
        """
        Decrypts data using the given `DecryptDataDetails`__ resource.

        __ https://docs.cloud.oracle.com/api/#/en/key/latest/datatypes/DecryptDataDetails


        :param oci.key_management.models.DecryptDataDetails decrypt_data_details: (required)
            DecryptDataDetails

        :param str opc_request_id: (optional)
            Unique identifier for the request. If provided, the returned request ID
            will include this value. Otherwise, a random request ID will be
            generated by the service.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.key_management.models.DecryptedData`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/keymanagement/decrypt.py.html>`__ to see an example of how to use decrypt API.
        """
        resource_path = "/20180608/decrypt"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "decrypt got unknown kwargs: {!r}".format(extra_kwargs))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=decrypt_data_details,
                response_type="DecryptedData")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             header_params=header_params,
                                             body=decrypt_data_details,
                                             response_type="DecryptedData")
Beispiel #17
0
    def get_subscribed_service(self, subscribed_service_id, **kwargs):
        """
        This API returns the subscribed service details corresponding to the id provided


        :param str subscribed_service_id: (required)
            The Subscribed Service Id

        :param list[str] fields: (optional)
            Partial response refers to an optimization technique offered
            by the RESTful web APIs to return only the information
            (fields) required by the client. In this mechanism, the client
            sends the required field names as the query parameters for
            an API to the server, and the server trims down the default
            response content by removing the fields that are not required
            by the client. The parameter used to control what fields to
            return should be a query string parameter called \"fields\" of
            type array, and usecollectionFormat

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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.onesubscription.models.SubscribedService`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/onesubscription/get_subscribed_service.py.html>`__ to see an example of how to use get_subscribed_service API.
        """
        resource_path = "/subscribedServices/{subscribedServiceId}"
        method = "GET"
        operation_name = "get_subscribed_service"
        api_reference_link = ""

        # Don't accept unknown kwargs
        expected_kwargs = [
            "allow_control_chars", "retry_strategy", "fields", "opc_request_id"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "get_subscribed_service got unknown kwargs: {!r}".format(
                    extra_kwargs))

        path_params = {"subscribedServiceId": subscribed_service_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        query_params = {
            "fields":
            self.base_client.generate_collection_format_param(
                kwargs.get("fields", missing), 'multi')
        }
        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:
            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="SubscribedService",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        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="SubscribedService",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
    def create_operator_control_assignment(
            self, create_operator_control_assignment_details, **kwargs):
        """
        Creates an Operator Control Assignment resource. In effect, this brings the target resource under the governance of the Operator Control for specified time duration.


        :param oci.operator_access_control.models.CreateOperatorControlAssignmentDetails create_operator_control_assignment_details: (required)
            Details of the Operator Control Assignment.

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

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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.operator_access_control.models.OperatorControlAssignment`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/operatoraccesscontrol/create_operator_control_assignment.py.html>`__ to see an example of how to use create_operator_control_assignment API.
        """
        resource_path = "/operatorControlAssignments"
        method = "POST"
        operation_name = "create_operator_control_assignment"
        api_reference_link = "https://docs.oracle.com/iaas/api/#/en/operatoraccesscontrol/20200630/OperatorControlAssignment/CreateOperatorControlAssignment"

        # 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(
                "create_operator_control_assignment got unknown kwargs: {!r}".
                format(extra_kwargs))

        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:
            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_operator_control_assignment_details,
                response_type="OperatorControlAssignment",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_operator_control_assignment_details,
                response_type="OperatorControlAssignment",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
    def list_commitments(self, subscribed_service_id, compartment_id,
                         **kwargs):
        """
        This list API returns all commitments for a particular Subscribed Service


        :param str subscribed_service_id: (required)
            This param is used to get the commitments for a particular subscribed service

        :param str compartment_id: (required)
            The OCID of the compartment.

        :param int limit: (optional)
            The maximum number of items to return in a paginated \"List\" call. Default: (`50`)

            Example: `500`

        :param str page: (optional)
            The value of the `opc-next-page` response header from the previous \"List\" call.

        :param str sort_order: (optional)
            The sort order to use, either ascending (`ASC`) or descending (`DESC`).

            Allowed values are: "ASC", "DESC"

        :param str sort_by: (optional)
            The field to sort by. You can provide one sort order (`sortOrder`).

            Allowed values are: "TIMECREATED", "TIMESTART"

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

        :param str x_one_gateway_subscription_id: (optional)
            This header is meant to be used only for internal purposes and will be ignored on any public request. The purpose of this header is
            to help on Gateway to API calls identification.

        :param str x_one_origin_region: (optional)
            The OCI home region name in case home region is not us-ashburn-1 (IAD), e.g. ap-mumbai-1, us-phoenix-1 etc.

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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 list of :class:`~oci.osub_subscription.models.CommitmentSummary`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/osubsubscription/list_commitments.py.html>`__ to see an example of how to use list_commitments API.
        """
        resource_path = "/commitments"
        method = "GET"
        operation_name = "list_commitments"
        api_reference_link = ""

        # Don't accept unknown kwargs
        expected_kwargs = [
            "allow_control_chars", "retry_strategy", "limit", "page",
            "sort_order", "sort_by", "opc_request_id",
            "x_one_gateway_subscription_id", "x_one_origin_region"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_commitments got unknown kwargs: {!r}".format(
                    extra_kwargs))

        if 'sort_order' in kwargs:
            sort_order_allowed_values = ["ASC", "DESC"]
            if kwargs['sort_order'] not in sort_order_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_order`, must be one of {0}".
                    format(sort_order_allowed_values))

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["TIMECREATED", "TIMESTART"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(
                        sort_by_allowed_values))

        query_params = {
            "subscribedServiceId": subscribed_service_id,
            "compartmentId": compartment_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),
            "x-one-gateway-subscription-id":
            kwargs.get("x_one_gateway_subscription_id", missing),
            "x-one-origin-region":
            kwargs.get("x_one_origin_region", 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:
            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="list[CommitmentSummary]",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="list[CommitmentSummary]",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
    def list_operator_control_assignments(self, compartment_id, **kwargs):
        """
        Lists all Operator Control Assignments.


        :param str compartment_id: (required)
            The ID of the compartment in which to list resources.

        :param str operator_control_name: (optional)
            A filter to return OperatorControl that match the given operatorControlName.

        :param str resource_name: (optional)
            A filter to return only resources that match the given ResourceName.

        :param str resource_type: (optional)
            A filter to return only lists of resources that match the entire given service type.

        :param str lifecycle_state: (optional)
            A filter to return only resources whose lifecycleState matches the given OperatorControlAssignment lifecycleState.

            Allowed values are: "CREATED", "APPLIED", "APPLYFAILED", "UPDATING", "DELETING", "DELETED", "DELETIONFAILED"

        :param int limit: (optional)
            The maximum number of items to return.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

        :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 timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.

            Allowed values are: "timeCreated", "displayName"

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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.operator_access_control.models.OperatorControlAssignmentCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/operatoraccesscontrol/list_operator_control_assignments.py.html>`__ to see an example of how to use list_operator_control_assignments API.
        """
        resource_path = "/operatorControlAssignments"
        method = "GET"
        operation_name = "list_operator_control_assignments"
        api_reference_link = "https://docs.oracle.com/iaas/api/#/en/operatoraccesscontrol/20200630/OperatorControlAssignment/ListOperatorControlAssignments"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "allow_control_chars", "retry_strategy", "operator_control_name",
            "resource_name", "resource_type", "lifecycle_state", "limit",
            "page", "sort_order", "sort_by", "opc_request_id"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_operator_control_assignments got unknown kwargs: {!r}".
                format(extra_kwargs))

        if 'lifecycle_state' in kwargs:
            lifecycle_state_allowed_values = [
                "CREATED", "APPLIED", "APPLYFAILED", "UPDATING", "DELETING",
                "DELETED", "DELETIONFAILED"
            ]
            if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
                raise ValueError(
                    "Invalid value for `lifecycle_state`, must be one of {0}".
                    format(lifecycle_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(
                    "Invalid value for `sort_order`, must be one of {0}".
                    format(sort_order_allowed_values))

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["timeCreated", "displayName"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(
                        sort_by_allowed_values))

        query_params = {
            "operatorControlName": kwargs.get("operator_control_name",
                                              missing),
            "resourceName": kwargs.get("resource_name", missing),
            "compartmentId": compartment_id,
            "resourceType": kwargs.get("resource_type", missing),
            "lifecycleState": kwargs.get("lifecycle_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:
            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="OperatorControlAssignmentCollection",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="OperatorControlAssignmentCollection",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
Beispiel #21
0
    def publish_message(self, topic_id, message_details, **kwargs):
        """
        Publishes a message to the specified topic. For more information about publishing messages, see `Publishing Messages`__.

        __ https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Notification/Tasks/publishingmessages.htm


        :param str topic_id: (required)
            The `OCID`__ of the topic.

            __ https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm

        :param MessageDetails message_details: (required)
            The message to publish.

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str message_type: (optional)
            Type of message body in the request. Default value: JSON.

            Allowed values are: "JSON", "RAW_TEXT"

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.ons.models.PublishResult`
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/topics/{topicId}/messages"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = ["retry_strategy", "opc_request_id", "message_type"]
        extra_kwargs = [
            key for key in six.iterkeys(kwargs) if key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError("publish_message got unknown kwargs: {!r}".format(
                extra_kwargs))

        path_params = {"topicId": topic_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "messageType": kwargs.get("message_type", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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=message_details,
                response_type="PublishResult")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params,
                                             body=message_details,
                                             response_type="PublishResult")
    def update_operator_control_assignment(
            self, operator_control_assignment_id,
            update_operator_control_assignment_details, **kwargs):
        """
        Modifies the existing Operator Control assignment of the specified Operator Control assignment ID. Modifying the assignment does not change the Operator Control assignment ID.


        :param str operator_control_assignment_id: (required)
            unique OperatorControl identifier

        :param oci.operator_access_control.models.UpdateOperatorControlAssignmentDetails update_operator_control_assignment_details: (required)
            Details for the new operator control assignment.

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

        :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 will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            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.operator_access_control.models.OperatorControlAssignment`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/operatoraccesscontrol/update_operator_control_assignment.py.html>`__ to see an example of how to use update_operator_control_assignment API.
        """
        resource_path = "/operatorControlAssignments/{operatorControlAssignmentId}"
        method = "PUT"
        operation_name = "update_operator_control_assignment"
        api_reference_link = "https://docs.oracle.com/iaas/api/#/en/operatoraccesscontrol/20200630/OperatorControlAssignment/UpdateOperatorControlAssignment"

        # 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(
                "update_operator_control_assignment got unknown kwargs: {!r}".
                format(extra_kwargs))

        path_params = {
            "operatorControlAssignmentId": operator_control_assignment_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        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:
            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_operator_control_assignment_details,
                response_type="OperatorControlAssignment",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params,
                body=update_operator_control_assignment_details,
                response_type="OperatorControlAssignment",
                allow_control_chars=kwargs.get('allow_control_chars'),
                operation_name=operation_name,
                api_reference_link=api_reference_link)
Beispiel #23
0
    def list_work_requests(self, compartment_id, **kwargs):
        """
        Lists the work requests in a compartment or for a specified resource.


        :param str compartment_id: (required)
            The `OCID`__ of the compartment.

            __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm

        :param str resource_id: (optional)
            The `OCID`__ of the resource.

            __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm

        :param int limit: (optional)
            For list pagination. The maximum number of results per page, or items to return in a
            paginated \"List\" call. For important details about how pagination works, see
            `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str page: (optional)
            For list pagination. The value of the `opc-next-page` response header from the
            previous \"List\" call. For important details about how pagination works, see
            `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.work_requests.models.WorkRequestSummary`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/workrequests/list_work_requests.py.html>`__ to see an example of how to use list_work_requests API.
        """
        resource_path = "/workRequests"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "resource_id", "limit", "page", "opc_request_id"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_work_requests got unknown kwargs: {!r}".format(
                    extra_kwargs))

        query_params = {
            "compartmentId": compartment_id,
            "resourceId": kwargs.get("resource_id", missing),
            "limit": kwargs.get("limit", missing),
            "page": kwargs.get("page", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="list[WorkRequestSummary]")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="list[WorkRequestSummary]")
Beispiel #24
0
    def create_sddc(self, create_sddc_details, **kwargs):
        """
        Creates an Oracle Cloud VMware Solution software-defined data center (SDDC).

        Use the :class:`WorkRequest` operations to track the
        creation of the SDDC.

        **Important:** You must configure the SDDC's networking resources with the security rules detailed in `Security Rules for Oracle Cloud VMware Solution SDDCs`__. Otherwise, provisioning the SDDC will fail. The rules are based on the requirements set by VMware.

        __ https://docs.cloud.oracle.com/iaas/Content/VMware/Reference/ocvssecurityrules.htm


        :param oci.ocvp.models.CreateSddcDetails create_sddc_details: (required)
            Details for the SDDC.

        :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
            may be rejected).

        :param str opc_request_id: (optional)
            Unique identifier for the request. If you need to contact Oracle about a particular
            request, please provide the request ID.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :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/latest/ocvp/create_sddc.py.html>`__ to see an example of how to use create_sddc API.
        """
        resource_path = "/sddcs"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "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(
                "create_sddc got unknown kwargs: {!r}".format(extra_kwargs))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            if not isinstance(retry_strategy, retry.NoneRetryStrategy):
                self.base_client.add_opc_retry_token_if_needed(header_params)
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_sddc_details)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_sddc_details)
    def list_quotas(self, compartment_id, **kwargs):
        """
        Lists all quotas on resources from the given compartment


        :param str compartment_id: (required)
            The OCID of the parent compartment (remember that the tenancy is simply the root compartment).

        :param str page: (optional)
            The value of the `opc-next-page` response header from the previous \"List\" call.

        :param int limit: (optional)
            The maximum number of items to return in a paginated \"List\" call.

        :param str name: (optional)
            name

        :param str lifecycle_state: (optional)
            Filters returned quotas based on whether the given state.

            Allowed values are: "ACTIVE"

        :param str sort_order: (optional)
            The sort order to use, either 'asc' or 'desc'. By default it will be ascending.

            Allowed values are: "ASC", "DESC"

        :param str sort_by: (optional)
            The field to sort by. Only one sort order may be provided. Time created is default ordered as descending. Display name is default ordered as ascending.

            Allowed values are: "NAME", "TIMECREATED"

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.limits.models.QuotaSummary`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/limits/list_quotas.py.html>`__ to see an example of how to use list_quotas API.
        """
        resource_path = "/20181025/quotas"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "page", "limit", "name", "lifecycle_state",
            "sort_order", "sort_by", "opc_request_id"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "list_quotas got unknown kwargs: {!r}".format(extra_kwargs))

        if 'lifecycle_state' in kwargs:
            lifecycle_state_allowed_values = ["ACTIVE"]
            if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
                raise ValueError(
                    "Invalid value for `lifecycle_state`, must be one of {0}".
                    format(lifecycle_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(
                    "Invalid value for `sort_order`, must be one of {0}".
                    format(sort_order_allowed_values))

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["NAME", "TIMECREATED"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(
                        sort_by_allowed_values))

        query_params = {
            "compartmentId": compartment_id,
            "page": kwargs.get("page", missing),
            "limit": kwargs.get("limit", missing),
            "name": kwargs.get("name", missing),
            "lifecycleState": kwargs.get("lifecycle_state", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="list[QuotaSummary]")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="list[QuotaSummary]")
Beispiel #26
0
    def delete_sddc(self, sddc_id, **kwargs):
        """
        Deletes the specified SDDC, along with the other resources that were
        created with the SDDC. For example: the Compute instances, DNS records,
        and so on.

        Use the :class:`WorkRequest` operations to track the
        deletion of the SDDC.


        :param str sddc_id: (required)
            The `OCID`__ of the SDDC.

            __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

        :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)
            Unique identifier for the request. If you need to contact Oracle about a particular
            request, please provide the request ID.

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :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/latest/ocvp/delete_sddc.py.html>`__ to see an example of how to use delete_sddc API.
        """
        resource_path = "/sddcs/{sddcId}"
        method = "DELETE"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "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(
                "delete_sddc got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {
            "sddcId": sddc_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('Parameter {} cannot be None, whitespace or empty string'.format(k))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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)
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                path_params=path_params,
                header_params=header_params)
    def create_quota(self, create_quota_details, **kwargs):
        """
        Creates a new quota with the details supplied.


        :param oci.limits.models.CreateQuotaDetails create_quota_details: (required)
            Request object for creating a new quota.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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 (e.g., if a resource
            has been deleted and purged from the system, then a retry of the original creation request
            may be rejected).

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.limits.models.Quota`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/limits/create_quota.py.html>`__ to see an example of how to use create_quota API.
        """
        resource_path = "/20181025/quotas"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy", "opc_request_id", "opc_retry_token"
        ]
        extra_kwargs = [
            _key for _key in six.iterkeys(kwargs)
            if _key not in expected_kwargs
        ]
        if extra_kwargs:
            raise ValueError(
                "create_quota got unknown kwargs: {!r}".format(extra_kwargs))

        header_params = {
            "accept": "application/json",
            "content-type": "application/json",
            "opc-request-id": kwargs.get("opc_request_id", missing),
            "opc-retry-token": kwargs.get("opc_retry_token", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            if not isinstance(retry_strategy, retry.NoneRetryStrategy):
                self.base_client.add_opc_retry_token_if_needed(header_params)
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_quota_details,
                response_type="Quota")
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             header_params=header_params,
                                             body=create_quota_details,
                                             response_type="Quota")
Beispiel #28
0
    def list_sddcs(self, compartment_id, **kwargs):
        """
        Lists the SDDCs in the specified compartment. The list can be
        filtered by display name or availability domain.


        :param str compartment_id: (required)
            The `OCID`__ of the compartment.

            __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

        :param str compute_availability_domain: (optional)
            The name of the availability domain that the Compute instances are running in.

            Example: `Uocm:PHX-AD-1`

        :param str display_name: (optional)
            A filter to return only resources that match the given display name exactly.

        :param int limit: (optional)
            For list pagination. The maximum number of results per page, or items to return in a paginated
            \"List\" call. For important details about how pagination works, see
            `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str page: (optional)
            For list pagination. The value of the `opc-next-page` response header from the previous \"List\"
            call. For important details about how pagination works, see
            `List Pagination`__.

            __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine

        :param str sort_order: (optional)
            The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order
            is case sensitive.

            Allowed values are: "ASC", "DESC"

        :param str sort_by: (optional)
            The field to sort by. You can provide one sort order (`sortOrder`). Default order for
            TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME
            sort order is case sensitive.

            **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you
            optionally filter by availability domain if the scope of the resource type is within a
            single availability domain. If you call one of these \"List\" operations without specifying
            an availability domain, the resources are grouped by availability domain, then sorted.

            Allowed values are: "timeCreated", "displayName"

        :param str opc_request_id: (optional)
            Unique identifier for the request. If you need to contact Oracle about a particular
            request, please provide the request ID.

        :param str lifecycle_state: (optional)
            The lifecycle state of the resource.

            Allowed values are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"

        :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. 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>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.ocvp.models.SddcCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/ocvp/list_sddcs.py.html>`__ to see an example of how to use list_sddcs API.
        """
        resource_path = "/sddcs"
        method = "GET"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "retry_strategy",
            "compute_availability_domain",
            "display_name",
            "limit",
            "page",
            "sort_order",
            "sort_by",
            "opc_request_id",
            "lifecycle_state"
        ]
        extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
        if extra_kwargs:
            raise ValueError(
                "list_sddcs got unknown kwargs: {!r}".format(extra_kwargs))

        if 'sort_order' in kwargs:
            sort_order_allowed_values = ["ASC", "DESC"]
            if kwargs['sort_order'] not in sort_order_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values)
                )

        if 'sort_by' in kwargs:
            sort_by_allowed_values = ["timeCreated", "displayName"]
            if kwargs['sort_by'] not in sort_by_allowed_values:
                raise ValueError(
                    "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values)
                )

        if 'lifecycle_state' in kwargs:
            lifecycle_state_allowed_values = ["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]
            if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
                raise ValueError(
                    "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
                )

        query_params = {
            "compartmentId": compartment_id,
            "computeAvailabilityDomain": kwargs.get("compute_availability_domain", missing),
            "displayName": kwargs.get("display_name", missing),
            "limit": kwargs.get("limit", missing),
            "page": kwargs.get("page", missing),
            "sortOrder": kwargs.get("sort_order", missing),
            "sortBy": kwargs.get("sort_by", missing),
            "lifecycleState": kwargs.get("lifecycle_state", 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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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="SddcCollection")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                query_params=query_params,
                header_params=header_params,
                response_type="SddcCollection")
Beispiel #29
0
    def create_sender(self, create_sender_details, **kwargs):
        """
        Creates a sender for a tenancy in a given compartment.


        :param oci.email.models.CreateSenderDetails create_sender_details: (required)
            Create a sender.

        :param str opc_request_id: (optional)
            The request ID for tracing from the system

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.email.models.Sender`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/email/create_sender.py.html>`__ to see an example of how to use create_sender API.
        """
        resource_path = "/senders"
        method = "POST"

        # Don't accept unknown kwargs
        expected_kwargs = [
            "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(
                "create_sender got unknown kwargs: {!r}".format(extra_kwargs))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            return retry_strategy.make_retrying_call(
                self.base_client.call_api,
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_sender_details,
                response_type="Sender")
        else:
            return self.base_client.call_api(
                resource_path=resource_path,
                method=method,
                header_params=header_params,
                body=create_sender_details,
                response_type="Sender")
    def delete_stream(self, stream_id, **kwargs):
        """
        Deletes a stream.
        Deletes a stream and its content. Stream contents are deleted immediately. The service retains records of the stream itself for 90 days after deletion.
        The `lifecycleState` parameter of the `Stream` object changes to `DELETING` and the stream becomes inaccessible for read or write operations.
        To verify that a stream has been deleted, make a :func:`get_stream` request. If the call returns the stream's
        lifecycle state as `DELETED`, then the stream has been deleted. If the call returns a \"404 Not Found\" error, that means all records of the
        stream have been deleted.


        :param str stream_id: (required)
            The OCID of the stream to delete.

        :param str opc_request_id: (optional)
            The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`
        """
        resource_path = "/streams/{streamId}"
        method = "DELETE"

        # Don't accept unknown kwargs
        expected_kwargs = ["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(
                "delete_stream got unknown kwargs: {!r}".format(extra_kwargs))

        path_params = {"streamId": stream_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(
                    'Parameter {} cannot be None, whitespace or empty string'.
                    format(k))

        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.retry_strategy
        if kwargs.get('retry_strategy'):
            retry_strategy = kwargs.get('retry_strategy')

        if retry_strategy:
            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)
        else:
            return self.base_client.call_api(resource_path=resource_path,
                                             method=method,
                                             path_params=path_params,
                                             header_params=header_params)