CreateCustomResource
    • PDF

    CreateCustomResource

    • PDF

    Article Summary

    개요

    Custom Resource를 생성합니다.

    요청

    API URL

    URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/custom/resource
    Method: POST
    

    요청 헤더

    공통 설정에 명시된 요청 헤더가 필요합니다.

    Content-Type: application/json
    x-ncp-apigw-signature-v2: {generated signature}
    x-ncp-apigw-timestamp: {current timestamp}
    x-ncp-iam-access-key: {your iam access key}
    

    요청 바디

    구문

    private String resourceId;
    private String resourceName;
    private String resourceTypeId;
    private Map<String, Object> resourceData;
    

    필드

    파라미터명필수 여부타입제약 사항설명
    resourceIdNoStringresourceId를 입력 시 해당 resourceId로 custom resource가 생성
    미 입력 시 Cloud Insight에서 resourceId를 생성하여 리턴
    resourceId는 중복될 수 없음
    중복된 resourceId로 custom resoure 생성 시도 시 에러 리턴
    resourceNameYesStringResource 이름 지정
    resourceTypeIdNoStringresourceTypeId는 resourceData의 format validate를 위해 사용하는 값
    resourceType에 정의된 데이터 형식으로 resourceData 전송 가능
    현재는 입력하지 않아도 사용 가능하도록 DEFAULT로 지정
    resourceDataYesMap<String, Object>resourceType에 맞는 데이터 입력 가능
    일치하는 필드만 저장

    예시

    요청 예시

    아래 예시는 resourceId가 123456 인 서버를 리소스로 등록하는 예시입니다

    POST /cw_fea/real/cw/api/custom/resource
    Host: cw.apigw.ntruss.com
    Content-Type: application/json
    x-ncp-apigw-signature-v2: {generated signature}
    x-ncp-apigw-timestamp: {current timestamp}
    x-ncp-iam-access-key: {your iam access key}
    
    Payload:
    {
      "resourceId": "123456",
      "resourceName": "insight-test001",
      "resourceData": {
        "organizationCode": "NCC",
        "projectId": "PPP",
        "serverIp": "10.0.0.1",
        "serverType": "HighCPU"
      }
    }
    

    응답 예시

    오류 없이 생성이 완료되면 HTTP code 200과 생성된 Custom Resource Id가 응답으로 리턴됩니다.

    {"resourceId" : "f201a196-df5a-4e8b-9f4c-26479a89cb41"}
    

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

    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.