You can update an object extension registration by making a PUT request to its edit URL and supplying a modified an ObjectExtension in the request body.
1 | Retrieve the object extension. Use a request like this one, where ID is the ID of the extension that you want to retrieve. GET https://vcloud.example.com/api/admin/extension/object/ID If you do not know the ID of the object extension, you can retrieve a list of all registered object extensions with a request like this one: GET https://vcloud.example.com/api/admin/extension/object |
2 | Examine the response to find the object extension's edit link. <vcloud:Link rel="edit" href="https://vcloud.example.com/api/admin/extension/object/83...0d39" type="application/vnd.vmware.admin.extensibility.object+xml" /> |
3 | |
4 | Make a PUT request to the URL in the edit link, supplying the modified ObjectExtension in the request body. See Example: Update an Object Extension |
This example updates the object extension created in Example: Register an Object Extension to enable it by setting the value of Enabled to true.
PUT https://vcloud.example.com/api/admin/extension/object Content Type: application/vnd.vmware.admin.extensibility.object+xml ... <?xml version="1.0" encoding="UTF-8"?> <ObjectExtension xmlns="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud_v1.5="http://www.vmware.com/vcloud/v1.5"> <Namespace>vcdx.vmdeploy</Namespace> <Enabled>true</Enabled> <Exchange>example-exchange</Exchange> <Vendor>com.example</Vendor> <Selectors> <Selector name="urn:selector:providerVdc" /> </Selectors> </ObjectExtension>
The system updates the extension and returns an updated ObjectExtension element similar to the one shown in Example: Register an Object Extension.
200 OK Content Type: application/vnd.vmware.admin.service+xml ... <vmext:ObjectExtension xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" id="83...0d39" href="https://vcloud.example.com/api/admin/extension/object/83...0d39" > ... <vmext:Namespace>example-object</vmext:Namespace> <vmext:Enabled>true</vmext:Enabled> <vmext:Exchange>example-exchange</vmext:Exchange> <vmext:ContentType>XML</vmext:ContentType> <vmext:Vendor>com.example</vmext:Vendor> ... </vmext:ObjectExtension>