Put Package

Prev Next

Available in Classic and VPC

Create or edit a Cloud Functions package.

Request

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

Method URI
PUT /packages/{packageName}

Request headers

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

Request path parameters

The following describes the parameters.

Field Type Required Description
packageName String Required Package name
  • 1 to 50 characters, including English letters, numbers, and special characters "-" and "_", and it can't start with "-"

Request query parameters

The following describes the parameters.

Field Type Required Description
platform String Optional Platform type
  • vpc (default) | classic

Request body

The following describes the request body. If there are no fields in the request body, it should be requested as {} empty JSON object.

Field Type Required Description
description String Optional Package description (byte)
  • 0 - 3000
parameters Object Optional Default parameters of the package
  • JSON in the form of {"key" : "value"}
  • Priority of applying parameters when running actions
    • 1st priority: runtime parameters passed at runtime
    • 2nd priority: default parameters of connected triggers
    • 3rd priority: default parameters in actions
    • 4th priority: default parameters of included packages

Request example

The following is a sample request.

curl --location --request PUT 'https://cloudfunctions.apigw.ntruss.com/ncf/api/v2/packages/package001?platform=vpc' \
--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} \
--data '<See below>'
{
    "description": "Create package",
    "parameters": {
        "name": "Cloud Funtions",
        "place": "Naver Cloud Platform"
    }
}

Response

The following describes the response format.

Response body

The following describes the response body.

Field Type Description
content.description String Package description
content.name String Package name
content.namespace String Namespace of the user
content.parameters Object Default parameters of the package
content.resourceId String Package's resource ID

Response status codes

The following describes the response status codes.

HTTP status code Code Message Description
400 80100 PACKAGE_INVALID_NAME Invalid name format
400 80102 PACKAGE_PLATFORM_MISMATCH Invalid platform parameter
400 80103 PACKAGE_BODY_INVALID_TYPE Invalid request body field type
400 80104 PACKAGE_BODY_MISSING_FIELD Missing required fields in the request body
400 80105 PACKAGE_BODY_INVALID_VALUE Invalid request body field value
403 80002 SUB_ACC_NO_PERMISSION Detailed permission error
409 80011 RESOURCE_NAME_CONFLICT Duplicate resource name
422 80106 PACKAGE_COUNT_EXCEED Maximum number of packages exceeded

Response example

The following is a sample example.

{
    "content": {
        "description": "Create package",
        "name": "package001",
        "namespace": "****YBN*****",
        "parameters": {
            "name": "Cloud Funtions",
            "place": "Naver Cloud Platform"
        },
        "resourceId": "xS***"
    }
}