Is there anybody out there who has successfully been able to edit resources, in particular CPU and Memory of an OrgVDC?
Unfortunately, it seems both creation and edits of VDCs are yet to be migrated from /api to /cloudapi endpoints.
The link to the required parameters can be found here: VMware Cloud Director API - VMware API Explorer
Below is the body I was sending:
<AdminVdc xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:extension_v1.5="http://www.vmware.com/vcloud/extension/v1.5" name="Test Org VDC1">
<AllocationModel>Flex</AllocationModel>
<ComputeCapacity>
<Cpu>
<Units>MHz</Units>
<Allocated>8000</Allocated>
<Limit>8000</Limit>
</Cpu>
<Memory>
<Units>MB</Units>
<Allocated>30000</Allocated>
<Limit>30000</Limit>
</Memory>
</ComputeCapacity>
<NicQuota>0</NicQuota>
<NetworkQuota>1000</NetworkQuota>
</AdminVdc>
If I remove any of the optional elements, "Allocation Model", "Compute Capacity", "NicQuota" or "Network Quota", I am greeted with a 400 Bad Request and a message in Postman that they are missing. As soon as I include them all, I end up with a 500 Server Error.
I should add that when creating the OrgVDC in the first place, even though many parameters were listed as optional, I had to supply values in order for the creation to work. Therefore, it seems that the documentation is not correct, and can only assume APIs are not included in QA tests.
I believe I have confirmed that the documentation does not match reality. With 10.5, below is what I believe is the minimum required parameters:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AdminVdc xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" name="Scripting OrgVDC01">
<AllocationModel>Flex</AllocationModel>
<ComputeCapacity>
<Cpu>
<Units>MHz</Units>
<Allocated>6000</Allocated>
<Limit>6000</Limit>
<Reserved>0</Reserved>
</Cpu>
<Memory>
<Units>MB</Units>
<Allocated>30720</Allocated>
<Limit>30720</Limit>
<Reserved>0</Reserved>
</Memory>
</ComputeCapacity>
<NicQuota>0</NicQuota>
<NetworkQuota>0</NetworkQuota>
<ResourceGuaranteedMemory>1.0</ResourceGuaranteedMemory>
<ResourceGuaranteedCpu>0.0</ResourceGuaranteedCpu>
<ProviderVdcReference href="https://vcloud.example.com/api/admin/providervdc/f72a0ee2-698a-459a-a3f5-1dac1943c466" id="urn:vcloud:providervdc:f72a0ee2-698a-459a-a3f5-1dac1943c466" type="application/vnd.vmware.admin.providervdc+xml" name="Test PVDC"/>
</AdminVdc>
I feel your pain. The API documentation is spotty and not nearly detailed enough. I have a Postman call that adds a second storage profile to an existing Org VDC, maybe that will help you.
It's a POST call to the url: /api/admin/vdc/{{ovdcsId}}/vdcStorageProfiles - where the variable is a short version of the OrgVDC ID.
The body looks like this:
@MHTX thanks for the info, but I am across the content-type header, I picked that up pretty quickly. You can also just put *+xml which will do the trick also.
Through starting with a full config and removing items one at a time, I actually have it working now. The main issue for me was: