Cloud API Calls

API commands to add credentials, enable cloud configuration, and view cloud configuration details are provided here. 

AWS Cloud APIs

  1. To add cloud credentials, follow this sample command in the API:
    curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[{"@class":"cloud","credentials":[{"alias":"alias-RKV","accessKey":"accesskey-ZDG","secretKey":"secretKey-OFW","regions":"region1-EAG,region2-PPR","serviceName":"serviceName-CZY"}]}]' https://10.9.0.105//api/rest/zone/collector/1/cloud?fmt=json
    Where:
    10.9.0.105 is the system name or IP address of your Command Center.
    admin:admin is the UID and PW of your Command Center

  2. To enable cloud configuration, follow this sample 1 of 2 command in the API:
    curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[{"@class": "CloudSettings","enabled": true}]' https://10.9.0.105//api/rest/zone/collector/1/cloud?fmt=json
    Where:
    10.9.0.105 is the system name or IP address of your Command Center.
    admin:admin is the UID and PW of your Command Center

  3. To enable cloud configuration, follow this sample 2 of 2 command in the API: 
    curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[[{"@class":"cloudcredential","alias":"alias-AHX","accessKey":"accesskey-CCG","secretKey":"secretKey-DFJ","regions":"region1-ICT,region2-XKX","serviceName":"serviceName-GXW"}]]' https://<IP>/api/rest/zone/collector/<COLLECTOR_ID>/cloudcredential?fmt=json

  4. To get cloud configuration details, follow this sample command in the API:
    https://10.9.0.105/api/rest/zone/collector?filter.collector.id=2&detail.Config
    Where:
    10.9.0.105 is replaced with the system name or IP address of your Command Center.

  5. To get cloud configuration details, follow this sample command in the API: 
    https://10.9.0.105/api/rest/zone/collector?filter.collector.id=2&detail.Config 
    Where:
    10.9.0.105 is replaced with the system name or IP address of your Command Center.

Azure Cloud APIs

API Examples Results

Add cloud credentails:

curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[{"@class":"cloud","credentials":[{"alias":"fauzia","subscriptionId":"47fa9418-a6de-4d52-86ab-c052e8c0f5c7","resourceGroups":"faResourceGroup","clientId":"3b2f9a45-9dda-4932-8f39-12614e47cdbd","clientSecret":"1dd69c6a-a9fe-4568-ad75-6ecf8c460303","tenantId":"891866ed-add8-46aa-9d83-c2b5aaaf50bc"}]}]' https://10.9.0.174/api/rest/zone/collector/2/cloud?fmt=json

Added the credential

Enable cloud configuration:

curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[{"@class": "CloudSettings","enabled": true}]' https://10.9.0.174//api/rest/zone/collector/2/cloud?fmt=json

Cloud is enabled

Get the added credential details:

https://10.9.0.174/api/rest/zone/collector?filter.collector.id=2&detail.Config 

Lists the collector details

Delete Credentails:

curl -k -u admin:admin -H "Content-Type: application/json" -X DELETE -d '[[{"@class":"cloudcredential","alias":"fauzia","subscriptionId":"47fa9418-a6de-4d52-86ab-c052e8c0f5c7","resourceGroups":"faResourceGroup","clientId":"3b2f9a45-9dda-4932-8f39-12614e47cdbd","clientSecret":"1dd69c6a-a9fe-4568-ad75-6ecf8c460303","tenantId":"891866ed-add8-46aa-9d83-c2b5aaaf50bc"}]]' https://10.9.0.174/api/rest/zone/collector/2/cloudcredential?fmt=json

Cloud credential is deleted

Disable cloud :

curl -k -u admin:admin -H "Content-Type: application/json" -X POST -d '[{"@class": "CloudSettings","enabled": false}]' https://10.9.0.174//api/rest/zone/collector/2/cloud?fmt=json

Cloud gets disabled