Get action
    • PDF

    Get action

    • PDF

    Article summary

    class="platform-info type-classic/vpc">Available in Classic and VPC

    View a Cloud Functions action.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    GET/packages/{packageName}/actions/{actionName}

    Request headers

    For headers common to all Cloud Functions APIs, see Cloud Functions common headers.

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    packageNameStringRequiredPackage name
    • Enter the special character "-" for actions that are not part of a package
      • <E.g.> /packages/-/actions/myaction?platform=vpc
    actionNameStringRequiredAction name

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    platformStringOptionalPlatform type
    • vpc (default) | classic

    Request example

    The following is a sample request.

    curl --location --request GET 'https://cloudfunctions.apigw.ntruss.com/api/v2/packages/package003/actions?platform=classic' \
    --header 'Content-Type: application/json' \
    --header 'x-ncp-apigw-timestamp: {Timestamp}' \
    --header 'x-ncp-iam-access-key: {Sub Account Access Key}' \
    --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
    

    Response

    The following describes the response format.

    Response body

    The following describes the response body.

    Basic action

    The following describes the response body for basic actions.

    FieldTypeDescription
    content.custom-optionsBoolean-
    content.descriptionStringAction description
    content.exec.binaryBooleanWhether the action code file is binary or not
    content.exec.codeStringAction source code or Base64-encoded code file binary
    content.exec.kindStringLanguage used
    content.exec.mainStringFunctions to execute
    content.limits.memoryIntegerSize of memory allocated to the action container
    content.limits.timeoutIntegerMaximum time an action can run
    content.nameStringAction name
    content.parametersObjectDefault parameter of the action
    content.vpcObjectVPC information
    • It is displayed only if platform is vpc
    content.vpc.vpcNoIntegerNumber of connected VPC
    content.vpc.subnetNoIntegerNumber of connected subnet
    content.pathStringAction path
    content.raw-httpBooleanWhether to use HTTP origin
    • Only support the web action type
    content.resourceIdStringAction's resource ID
    content.webBooleanSet web action

    Sequence action

    The following describes the response body for sequence actions.

    FieldTypeDescription
    content.descriptionStringAction description
    content.exec.componentsString[]List of associated actions
    content.exec.kindStringAction type
    • sequence (fixed value)
    content.nameStringAction name
    content.pathStringAction path
    content.resourceIdStringAction's resource ID
    content.webBooleanSet web action

    Response status codes

    The following describes the response status codes.

    HTTP status codeCodeMessageDescription
    40080302ACTION_PLATFORM_MISMATCHInvalid platform parameter
    40380002SUB_ACC_NO_PERMISSIONResource viewing permission error
    40480301ACTION_NOT_FOUNDAction not found

    Response example

    The following is a sample response.

    {
        "content": {
            "custom-options": false,
            "description": "Create Action",
            "exec": {
                "binary": false,
                "code": "function main(params) { \nlet name = params.name || \"World\";\nlet place = params.place || \"Naver\"; \n  return {payload:  \"abc\"};\n}",
                "kind": "nodejs:16",
                "main": "main"
            },
            "limits": {
                "memory": 128,
                "timeout": 60000
            },
            "name": "action000",
            "parameters": {
                "name": "action000"
            },
            "path": "****YBNzcd4Z/package003",
            "raw-http": false,
            "resourceId": "Sy***",
            "web": false
        }
    }
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.