How to manage Corvina via APIs
This article explains how to manage your Corvina instance via APIs and it helps you to create organizations, licenses, users and so on.
First you need a Service Account user to call the APIs, there are two different method to use it:
- client secret to retreive automatically the key (with anoter API call).
- API keys to use directly in the APIs (you can regenerate and do a manual rotation).
Instructions
First Step: Create a sub-organization.
You can find the documentation here [SWAGGER UI]. An example of cURL:
curl -X 'POST' \
'https://app.corvina.io/svc/core/api/v1/organizations/51?addDefaultRoles=false&waitLicenseManager=false' \
-H 'accept: application/json' \
-H 'X-Api-Key: abcdefghilmnopqrstuvz' \
-H 'Content-Type: application/json' \
-d '{
"name": "aaa_fabio_test_2",
"label": "aaa_fabio_test_2",
"privateAccess": false,
"allowDisablePrivateAccess": true,
"hostname": null,
"allowHostname": false,
"licenseCode": "123-123-123-123",
"dataEnabled": true,
"vpnEnabled": true,
"vpnPairingMode": "CC2",
"vpnOtpRequired": false,
"ipAddressesWhitelist": [],
"storeEnabled": false
}'
Second Step: Give to the sub-organization the resources.
You can find the documentation here [SWAGGER UI]. An example of cURL:
curl -X 'PUT' \
'https://app.corvina.io/svc/license/api/v1/limits?orgResourceId=exor' \
-H 'accept: application/json' \
-H 'X-Api-Key: abcdefghilmnopqrstuvz' \
-H 'Content-Type: application/json' \
-d '{
"resourceType": "ORGANIZATIONS",
"quantity": 33,
"orgResourceId": "exor.aaa_fabio_test_3"
}'