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 /ncf/api/v2/packages/{packageName}

Request headers

For information about the headers common to all Cloud Functions APIs, see Cloud Functions request headers.

Request path parameters

You can use the following path parameters with your request:

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

You can use the following query parameters with your request:

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 '{
    "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 Required 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

For information about the HTTP status codes common to all Cloud Functions APIs, see Cloud Functions response status codes.

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***"
    }
}