Put Package
    • PDF

    Put Package

    • PDF

    Article summary

    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:

    MethodURI
    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.

    FieldTypeRequiredDescription
    packageNameStringRequiredPackage 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.

    FieldTypeRequiredDescription
    platformStringOptionalPlatform 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.

    FieldTypeRequiredDescription
    descriptionStringOptionalPackage description (byte)
    • 0 - 3000
    parametersObjectOptionalDefault 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.

    FieldTypeDescription
    content.descriptionStringPackage description
    content.nameStringPackage name
    content.namespaceStringNamespace of the user
    content.parametersObjectDefault parameters of the package
    content.resourceIdStringPackage's resource ID

    Response status codes

    The following describes the response status codes.

    HTTP status codeCodeMessageDescription
    40080100PACKAGE_INVALID_NAMEInvalid name format
    40080102PACKAGE_PLATFORM_MISMATCHInvalid platform parameter
    40080103PACKAGE_BODY_INVALID_TYPEInvalid request body field type
    40080104PACKAGE_BODY_MISSING_FIELDMissing required fields in the request body
    40080105PACKAGE_BODY_INVALID_VALUEInvalid request body field value
    40380002SUB_ACC_NO_PERMISSIONDetailed permission error
    40980011RESOURCE_NAME_CONFLICTDuplicate resource name
    42280106PACKAGE_COUNT_EXCEEDMaximum 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***"
        }
    }
    

    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.