How To Modify Cluster Properties Using API Calls.
Problem
At times there will be requirements to edit clusters properties which are supported [listed below] via API calls:
customAmi, numSpotWorkers, numMaxSpotWorkers, numWorkers, numMinWorkers, numMaxWorkers, spotPrice, spotWorkerFlavor, tags, etcdBackup, enableProfileAgent, enableCatapultMonitoring.
Environment
- Platform9 Managed Kubernetes - v5.5 and Higher.
Procedure
Syntax: The syntax for the API call to update the cluster property is shown below:
curl --request PUT --url https://<FQDN>/qbert/v4/<PROJECT_UUID>/clusters/<CLUSTER_UUID> --header "X-Auth-Token: $TOKEN" --header "content-type: application/json" --data '{"<CLUSTER_PROPERTY>":"<VALUE>"}'
Example: Here the API call will modify the numMinWorkers
value to 5 for the cluster UUID 664afad3-ff7c-4184-bbaa-452622fe1f3b
in tenant/project UUID d6af700ab0c848dbae1108309a7871ee
is shown below:
curl --request PUT --url https://test.platform9.horse/qbert/v4/d6af700ab0c848dbae1108309a7871ee/clusters/664afad3-ff7c-4184-bbaa-452622fe1f3b --header "X-Auth-Token: $TOKEN" --header "content-type: application/json" --data '{"numMinWorkers": 5 }'
OK#
Additional Information
It is very important to note that the type of value passed for each cluster property is crucial, the numSpotWorkers, numMaxSpotWorkers, numWorkers, numMinWorkers, numMaxWorkers are expected to have integer value [without double quotes" "], for other properties, the values has to be mentioned as strings [within double quotes " "].