Skip to content

delete_container

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

Deletes the specified container. Before you make a DeleteContainer request, delete any objects in the container or in any folders in the container. You can delete only empty containers.

Parameters:

  • container_name (ContainerName) –

    The name of the container to delete.

Raises:

Source code in docs_src/capo_mediastore/_services/media_store.py
def delete_container(
    self,
    container_name: "capo_mediastore.types.container_name.ContainerName",
    *,
    config_overrides: Optional[MediaStoreClientConfig] = None,
) -> "capo_mediastore.types.delete_container_output.DeleteContainerOutput":
    """<p>Deletes the specified container. Before you make a <code>DeleteContainer</code> request, delete any objects in the container or in any folders in the container. You can delete only empty containers. </p>

    Args:
        container_name: <p>The name of the container to delete. </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.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.delete_container_input.DeleteContainerInput]",
    ) -> OperationResponse[
        "capo_mediastore.types.delete_container_output.DeleteContainerOutput"
    ]:
        import capo_mediastore._operations.media_store_20170901.delete_container

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteContainer")
    )
    input_: capo_mediastore.types.delete_container_input.DeleteContainerInput = {
        "container_name": container_name
    }

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