Skip to content

get_cors_policy

get_cors_policy(
    container_name: ContainerName,
    *,
    config_overrides: Optional[MediaStoreClientConfig] = None,
) -> GetCorsPolicyOutput

Returns the cross-origin resource sharing (CORS) configuration information that is set for the container.

To use this operation, you must have permission to perform the MediaStore:GetCorsPolicy action. By default, the container owner has this permission and can grant it to others.

Parameters:

  • container_name (ContainerName) –

    The name of the container that the policy is assigned to.

Raises:

Source code in docs_src/capo_mediastore/_services/media_store.py
def get_cors_policy(
    self,
    container_name: "capo_mediastore.types.container_name.ContainerName",
    *,
    config_overrides: Optional[MediaStoreClientConfig] = None,
) -> "capo_mediastore.types.get_cors_policy_output.GetCorsPolicyOutput":
    """<p>Returns the cross-origin resource sharing (CORS) configuration information that is set for the container.</p> <p>To use this operation, you must have permission to perform the <code>MediaStore:GetCorsPolicy</code> action. By default, the container owner has this permission and can grant it to others.</p>

    Args:
        container_name: <p>The name of the container that the policy is assigned to.</p>

    Raises:
        capo_mediastore.errors.container_in_use_exception.ContainerInUseException: <p>The container that you specified in the request already exists or is being updated.</p>
        capo_mediastore.errors.container_not_found_exception.ContainerNotFoundException: <p>The container that you specified in the request does not exist.</p>
        capo_mediastore.errors.cors_policy_not_found_exception.CorsPolicyNotFoundException: <p>The CORS policy that you specified in the request does not exist.</p>
        capo_mediastore.errors.internal_server_error.InternalServerError: <p>The service is temporarily unavailable.</p>
        capo_mediastore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediastore.types.get_cors_policy_input.GetCorsPolicyInput]",
    ) -> OperationResponse[
        "capo_mediastore.types.get_cors_policy_output.GetCorsPolicyOutput"
    ]:
        import capo_mediastore._operations.media_store_20170901.get_cors_policy

        output, http_response = (
            capo_mediastore._operations.media_store_20170901.get_cors_policy.get_cors_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCorsPolicy")
    )
    input_: capo_mediastore.types.get_cors_policy_input.GetCorsPolicyInput = {
        "container_name": container_name
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output