PATCH "/iaas/api/storage-profiles-vsphere/<storage-profile-id>")VMware Aria Automation 8.x
First of all, ensure you are upgraded to 8.18.1-patch3
Use the PATCH /iaas/api/storage-profiles/{id}/storage-profile-associations API call to change datastores.
You do not need to provide the existing datastore IDs, only the extra one I wanted to add:
PATCH /iaas/api/storage-profiles/{id}/storage-profile-associations{ "regionId": "<UUID-after-/iaas/api/regions/>", "storageProfileAssociations": [ { "requestType": "CREATE", "associations": [ { "dataStoreId": "<new-DS-UUID>", "priority": "3" } ] } ]}
Note the regionId is not like "Datacenter:datacenter-2": this would give a 404.
Removing datastores can be achieved by changing CREATE to DELETE.