Skip to content

get_namespace async

get_namespace(
    namespace_name: NamespaceName,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
) -> GetNamespaceResponse

Returns information about a namespace in Amazon Redshift Serverless.

Parameters:

  • namespace_name (NamespaceName) –

    The name of the namespace to retrieve information for.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def get_namespace(
    self,
    namespace_name: "capo_redshift_serverless.types.namespace_name.NamespaceName",
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
) -> "capo_redshift_serverless.types.get_namespace_response.GetNamespaceResponse":
    """<p>Returns information about a namespace in Amazon Redshift Serverless.</p>

    Args:
        namespace_name: <p>The name of the namespace to retrieve information for.</p>

    Raises:
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift_serverless.types.get_namespace_request.GetNamespaceRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.get_namespace_response.GetNamespaceResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.get_namespace

        (
            output,
            http_response,
        ) = await capo_redshift_serverless._operations.redshift_serverless.get_namespace.async_get_namespace(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_redshift_serverless.types.get_namespace_response.GetNamespaceResponse",
    ) -> dict[str, Any]:
        import capo_redshift_serverless.types.get_namespace_response

        return (
            capo_redshift_serverless.types.get_namespace_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetNamespace", redact_output=_redact_output),
    )
    input_: capo_redshift_serverless.types.get_namespace_request.GetNamespaceRequest = {
        "namespace_name": namespace_name
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output