Put Action
  • PDF

Put Action

  • PDF

개요

액션을 생성, 수정합니다.

요청

요청 URL

PUT {CLOUD_FUNCTIONS_API_URL}/packages/{packageName}/actions/{actionName}

Content-Type: application/json; charset=utf-8
x-ncp-apigw-timestamp: {Timestamp}
x-ncp-iam-access-key: {Sub Account Access Key}
x-ncp-apigw-signature-v2: {API Gateway Signature}

Path Variables

파라미터 필수 여부 타입 제약 사항 설명
packageName Yes string 영문, 숫자, 붙임표( - ), 밑줄 문자( _ )로 구성한 50자 이내의 문자열 - 패키지 이름
- package에 속하지 않은 action을 생성하는 경우 packageName에 붙임표( - )를 입력
actionName Yes string 영문, 숫자, 붙임표( - ), 밑줄 문자( _ )로 구성한 50자 이내의 문자열 액션 이름

요청 파라미터

파라미터명 필수 여부 타입 제약 사항 설명
platform No string (classic | vpc) - 플랫폼 타입
- default classic으로 처리됨

요청 바디

Basic Action

{
    "description" : "string",
    "web" : "boolean",
    "raw-http" : "boolean",
    "custom-options" : "boolean",
    "parameters": {

    },
    "limits": {
        "timeout": "number",
        "memory": "number"
    },
    "exec": {
        "kind": "string",
        "code": "string",
        "binary": "boolean",
        "main": "string"
    },
    "vpc": {
        "vpcNo" : "number",
        "subnetNo" : "number"
    }
}

항목 필수 여부 타입 제약 사항 설명
description No string 3000 bytes 이내 문자열 액션 설명
web No Boolean true/false 웹 액션 설정
raw-http No Boolean true/false - HTTP 원문 사용 여부
- web 설정이 false인 경우 false만 허용
custom-options No Boolean true/false - 헤더 옵션 설정
- web 설정이 false인 경우 false만 허용
parameters No JSON 형식. {"key" : "value"}의 형태 액션의 디폴트 파라미터 설정
* 액션 실행시 파라미터 적용 우선 순위
** 1순위: 실행 시점에 전달되는 런타임 파라미터
** 2순위: 연결된 트리거의 디폴트 파라미터
** 3순위: 액션의 디폴트 파라미터
** 4순위: 포함된 패키지의 디폴트 파라미터
limits.timeout Yes number MIN 500 MAX 300000 - 액션이 실행될 수 있는 최대 시간
이 시간을 초과하면 강제 종료됨
- ms 단위, default: 60000ms
limits.memory Yes number ( 128 | 256 | 512 ) 액션 컨테이너에 할당되는 메모리 크기 (default: 256)
exec.kind Yes string ( swift:3.1.1 | python:3.6 | python:3.7 | php:7.1 | php:7.3 | nodejs:6 | nodejs:8 | nodejs:12 | nodejs:16 | java | go:1.11 | go:1.19 | dotnet:2.2) 사용 언어
exec.binary Yes boolean - 코드를 직접 입력할 경우 false, 파일 바이너리를 입력할 경우 true로 설정
- 사용 언어가 java 혹은 dotnet인 경우 파일 바이너리만 허용
- Java는 압축된 *.jar 파일 형태로만 등록 가능, .net(dotnet)의 경우 *.zip 파일(압축 파일) 형태로만 업로드 가능
exec.code Yes string - 소스 코드
- 코드를 직접 입력할 경우 escape 처리 필요
exec.main Yes string 코드 내의 실행할 함수명 입력
vpc No - 연결할 vpc 정보 입력
- platform이 vpc일 때만 입력
vpc.vpcNo No number 연결할 vpc No 입력
vpc.subnetNo No number 연결할 subnet No 입력

Sequence Action

{
    "description" : "string",
    "web" : "boolean",
    "exec": {
        "kind": "string",
        "components": [
          "string"
        ]
    }
}
항목 필수 여부 타입 제약 사항 설명
description No string 3000 bytes 이내 문자열 액션 설명
web No Boolean true/false 웹 액션 설정
exec.kind Yes string sequence 시퀀스 액션을 생성하는 경우 sequence로 입력
exec.components Yes string array "{packageName}/{actionName}" 형태로 package에 속하지 않은 action을 연결하는 경우, packageName에 -를 입력 시퀀스 액션에 연결할 액션을 순차적으로 입력

응답

응답 바디

Basic Action

{
    "content": {
        "name": "string",
        "path": "string",
        "description": "string",
        "parameters": {},
        "resourceId": "string",
        "web": "boolean",
        "raw-http": "boolean",
        "custom-options": "boolean",
        "exec": {
            "binary": "boolean",
            "code": "string",
            "kind": "string",
            "main": "string"
        },
        "limits": {
            "memory": "number",
            "timeout": "number"
        },
        "vpc" : {
            "vpcNo": "number",
            "subnetNo": "number"
        }
    }
}
항목 타입 설명 비고
content.name string 액션 이름
content.path string 액션의 path
content.description string 액션 설명
content.parameters object 액션의 디폴트 파라미터
content.resourceId string 액션의 resourceId
content.web boolean 웹 액션 설정
content.raw-http boolean HTTP 원문 사용 여부
content.custom-options boolean 헤더 옵션 설정
content.exec.binary boolean 코드의 파일 바이너리 여부
content.exec.code string 소스 코드
content.exec.kind string 사용 언어
content.exec.main string 코드 내의 실행할 함수
content.limits.memory number 액션 컨테이너에 할당되는 메모리 크기
content.limits.timeout number 액션이 실행될 수 있는 최대 시간
content.vpc vpc 정보 platform이 vpc인 경우에만 노출됨
content.vpc.vpcNo number 연결된 vpc의 No
content.vpc.vpcNo number 연결된 subnet의 No

Sequence Action

{
    "content": {
        "name": "string",
        "path": "string",
        "description": "string",
        "resourceId": "string",
        "web": "boolean",
        "exec": {
            "kind": "string",
            "components": [
              "string"
            ]
        }
    }
}
항목 타입 설명 비고
content.name string 액션 이름
content.path string 액션의 path
content.description string 액션 설명
content.resourceId string 액션의 resourceId
content.web boolean 웹 액션 설정
content.exec.kind string 시퀀스 액션
content.exec.components string array 연결된 액션 리스트

이 문서가 도움이 되었습니까?

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.