Hi,
I try to create a catalog via the vcd api. My environment is:
Vcloud Director Version = 1.5.0.464915 (there are 2 cells within the vcd infrastructure)
vCloud php SDK version = 1.5.0-472492
Vcenter version = 5.0.0 Build 455964
I use the following source code with php :
$catalogName='mycatalog'
$description='mydescription' ;
$sdkAdmin = $service->createSDKAdminObj();
$adminOrgRefs = $sdkAdmin->getAdminOrgRefs();
$sdkAdminOrg = $service->createSDKObj($adminOrgRefs[0]);
$catalogType = createCatalogType($catalogName);
$catalogType->setDescription($description);
$sdkAdminOrg->createCatalog($catalogType);
and the result is :
PHP Fatal error: Uncaught exception 'Exception' with message 'exception 'VMware_VCloud_SDK_Exception' with message 'POST https://10.114.40.49/api/admin/org/050e2eee-8c5c-4089-b596-2fdda6931b23/catalogs failed, return code: 400, error: <?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="BAD_REQUEST" message="Bad request
- Unexpected JAXB Exception
- unexpected element {http://www.vmware.com/vcloud/v1.5}Catalog" majorErrorCode="400" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5http://10.114.40.49/api/v1.5/schema/master.xsd"></Error>
, request data:
<Catalog xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/ in /home/yconan/e2cdelta/trunk/www/models/vcloudConnector/catalogConnector.php on line 181
If I look the log events on the vcd cell. I've got the same infos with a longer java stacktrace.
the content of $catalogType ->export() is :
<Catalog xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="mycatalog">
<Description>mydescription</Description>
</Catalog>
Any Idea ?
Regards,
Yann CONAN