Skip to content

describe_function async

describe_function(
    name: FunctionName,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    stage: Optional[FunctionStage] = None,
) -> DescribeFunctionResult

Gets configuration information and metadata about a CloudFront function, but not the function's code. To get a function's code, use GetFunction.

To get configuration information and metadata about a function, you must provide the function's name and stage. To get these values, you can use ListFunctions.

Parameters:

  • name (FunctionName) –

    The name of the function that you are getting information about.

  • stage (Optional[FunctionStage], default: None ) –

    The function's stage, either DEVELOPMENT or LIVE.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def describe_function(
    self,
    name: "capo_cloudfront.types.function_name.FunctionName",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    stage: Optional["capo_cloudfront.types.function_stage.FunctionStage"] = None,
) -> "capo_cloudfront.types.describe_function_result.DescribeFunctionResult":
    """<p>Gets configuration information and metadata about a CloudFront function, but not the function's code. To get a function's code, use <code>GetFunction</code>.</p> <p>To get configuration information and metadata about a function, you must provide the function's name and stage. To get these values, you can use <code>ListFunctions</code>.</p>

    Args:
        name: <p>The name of the function that you are getting information about.</p>
        stage: <p>The function's stage, either <code>DEVELOPMENT</code> or <code>LIVE</code>.</p>

    Raises:
        capo_cloudfront.errors.no_such_function_exists.NoSuchFunctionExists: <p>The function does not exist.</p>
        capo_cloudfront.errors.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.describe_function_request.DescribeFunctionRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.describe_function_result.DescribeFunctionResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.describe_function

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.describe_function.async_describe_function(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeFunction")
    )
    input_: capo_cloudfront.types.describe_function_request.DescribeFunctionRequest = {
        "name": name
    }
    if stage is not None:
        input_["stage"] = stage

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