CloudFront / Client / get_function

get_function#

CloudFront.Client.get_function(**kwargs)#

Gets the code of a CloudFront function. To get configuration information and metadata about a function, use DescribeFunction.

To get a function’s code, you must provide the function’s name and stage. To get these values, you can use ListFunctions.

See also: AWS API Documentation

Request Syntax

response = client.get_function(
    Name='string',
    Stage='DEVELOPMENT'|'LIVE'
)
Parameters:
  • Name (string) –

    [REQUIRED]

    The name of the function whose code you are getting.

  • Stage (string) – The function’s stage, either DEVELOPMENT or LIVE.

Return type:

dict

Returns:

Response Syntax

{
    'FunctionCode': StreamingBody(),
    'ETag': 'string',
    'ContentType': 'string'
}

Response Structure

  • (dict) –

    • FunctionCode (StreamingBody) –

      The function code of a CloudFront function.

    • ETag (string) –

      The version identifier for the current version of the CloudFront function.

    • ContentType (string) –

      The content type (media type) of the response.

Exceptions

  • CloudFront.Client.exceptions.UnsupportedOperation

  • CloudFront.Client.exceptions.NoSuchFunctionExists