CreateCustomResource
- Print
- PDF
CreateCustomResource
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Create a custom resource.
Requests
API URL
URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/custom/resource
Method: POST
Request Headers
The request headers specified in common settings are required.
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}
Request Bodies
Usage
private String resourceId;
private String resourceName;
private String resourceTypeId;
private Map<String, Object> resourceData;
Field
Parameter name | Requirement status | Type | Restrictions | Description |
---|---|---|---|---|
resourceId | No | String | When resourceId is provided, a custom resource is created with that resourceId If not, Cloud Insight generates a resourceId and returns it resourceId cannot have duplicates Returns error when attempting to create a custom resource with a duplicate resourceId | |
resourceName | Yes | String | Specify resource name | |
resourceTypeId | No | String | resourceTypeId is a value used to format validate a resourceData resourceData can be transferred in the data format defined in resourceType Currently set as DEFAULT to be used without it | |
resourceData | Yes | Map<String, Object> | Available to input data suitable for resourceType Save only matched fields |
Examples
Request examples
The example below registers a server with resourceId 123456 as a resource.
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"
}
}
Response examples
If created successfully, HTTP code 200 and the generated Custom Resource Id are returned as a result.
{"resourceId" : "f201a196-df5a-4e8b-9f4c-26479a89cb41"}
Was this article helpful?