A node-red module to get to your ncloud server
npm install node-red-contrib-ncloudnode-red-contrib-ncloud
========================
Node-RED
naver-ncloud-apis wrapper.
Install
-------
Run the following command in the root directory of your Node-RED install:
npm install node-red-contrib-ncloud --save
ncloud_access_key_id = xxxxxxxxxxxxx
ncloud_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
`
Usage
-----
ncloud
ncloud api request node.
$3
- ncloud, sens, cloudfunctions, ncr, nks, kms, pca, securitymonitoring,
wsc, billingapi, livestation, sitesafer, certificatemanager, cloudactivitytracer,
resourcemanager, sts, subaccount, wms, cw, naveropenapi, geolocation, apigateway,
mail, cloudloganalytics, cloudsearch, vpcelasticsearch, clouddatastreamingservice,
das, livestation, vodstation, vodtranscoder, workplaceg, workplacej, workplace, workbox,
cloudiotcore,,,, and so on..
$3
- GET, POST, PUT, DELETE
$3
- need basePath , ex) /server/v2/
$3
- need action, ex) getZoneList, getServerInstanceList ..
$3
- need actionParams
request parameter sample
`javascript
msg.apigw = 'ncloud';
msg.method = 'GET';
msg.basePath = '/server/v2/';
msg.action = 'getServerInstanceList';
msg.apigw = 'ncloud';
msg.method = 'GET';
msg.basePath = '/server/v2/';
msg.action = 'getServerProductList';
msg.actionParams = {};
msg.apigw = 'billingapi';
msg.method = 'GET';
msg.basePath = '/billing/v1/cost/';
msg.action = 'getContractSummaryList';
msg.actionParams = {"contractMonth" : "202011"};
`
sample flow
!alt text
- Ctrl+c & Ctrl+v by import function
`json
[{"id":"4938cb4e.76a934","type":"ncloud","z":"a796e9dc.51d198","basePath":"/server/v2/","action":"getZoneList","x":610,"y":80,"wires":[["b26d373c.ac7f98"]]},{"id":"a91b562d.b11578","type":"inject","z":"a796e9dc.51d198","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":80,"wires":[["13bfc7d8.7c7878"]]},{"id":"3ffd90a3.998f9","type":"debug","z":"a796e9dc.51d198","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":80,"wires":[]},{"id":"13bfc7d8.7c7878","type":"function","z":"a796e9dc.51d198","name":"","func":"msg.method = 'GET';\nmsg.basePath = '/server/v2/';\nmsg.action = 'getZoneList';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":80,"wires":[["8eda0a6b.e3b618"]]},{"id":"b26d373c.ac7f98","type":"function","z":"a796e9dc.51d198","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":80,"wires":[["3ffd90a3.998f9"]]},{"id":"8eda0a6b.e3b618","type":"delay","z":"a796e9dc.51d198","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"30","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":80,"wires":[["4938cb4e.76a934"]]}]
`
result
!alt text
`json
{
"requestId": "778a2e17-be31-488a-8bb7-038dc3b5232b",
"returnCode": "0",
"returnMessage": "success",
"zoneList": [
{
"zoneNo": "3",
"zoneName": "KR-2",
"zoneCode": "KR-2",
"zoneDescription": "평촌 zone",
"regionNo": "1"
},
{
"zoneNo": "2",
"zoneName": "KR-1",
"zoneCode": "KR-1",
"zoneDescription": "가산 zone",
"regionNo": "1"
}
]
}
``