Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

Create/modify vApp networks through vCloud REST API

$
0
0

I'm trying to create/add/modify vApp networks through the REST API and got completely stuck. Even if I try to PUT the xml exactly how it is without changing or adding anything, I still get the same error-message. A working example or any kind of help would be appreciated.

 

 

Retrieve the vApp's NetworkConfigSection...

 

HTTP/1.1 200 OK
Date: Sat, 04 May 2013 14:24:50 GMT
Content-Type: application/vnd.vmware.vcloud.networkconfigsection+xml;version=1.5
Date: Sat, 04 May 2013 14:24:51 GMT
Content-Length: 4584<?xml version="1.0" encoding="UTF-8"?><NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://vcloud.test.internal/api/vApp/vapp-e4eedb31-cf3a-4cf2-a676-0ee6e3789d33/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://vcloud.test.internal/api/v1.5/schema/master.xsd">    <ovf:Info>The configuration parameters for logical networks</ovf:Info><Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://vcloud.test.internal/api/vApp/vapp-e4eedb31-cf3a-4cf2-a676-0ee6e3789d33/networkConfigSection/"/><NetworkConfigSection>   <NetworkConfig.....
....

 

------------------ vapp_vcloud_network.xml -----------------------

<NetworkConfigSection>  <NetworkConfig networkName="DMZ">        <Description>A DMZ Network</Description>        <Configuration>            <IpScope>                <IsInherited>false</IsInherited>                <Gateway>192.168.3.1</Gateway>                <Netmask>255.255.255.0</Netmask>            </IpScope>            <FenceMode>isolated</FenceMode>            <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>            <Features>                <DhcpService>                    <IsEnabled>false</IsEnabled>                    <DefaultLeaseTime>3600</DefaultLeaseTime>                    <MaxLeaseTime>7200</MaxLeaseTime>                    <IpRange>                        <StartAddress>192.168.3.2</StartAddress>                        <EndAddress>192.168.3.254</EndAddress>                    </IpRange>                </DhcpService>            </Features>        </Configuration>        <IsDeployed>true</IsDeployed>   </NetworkConfig></NetworkConfigSection>

 

-------------------------------------------------------------------

 

#Creating vApp network
echo  "Creating vApp Networks..."
curl -i -s -S -k \     -H "Accept:application/*+xml;version=1.5" \     -H "x-vcloud-authorization: ${VCLOUD_AUTH}" \     -H "Content-type: application/vnd.vmware.vcloud.networkConfigSection+xml" \     -X PUT "https://vcloud.test.internal/api/vApp/vapp-e4eedb31-cf3a-4cf2-a676-0ee6e3789d33/networkConfigSection/" \     -d @vapp_vcloud_network.xml

 

 

Creating vApp Networks...

HTTP/1.1 500 Internal Server Error
Date: Sat, 04 May 2013 14:24:51 GMT
Content-Type: text/xml; charset=iso-8859-1
Content-Length: 285<ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat"><ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.WildcardTypeImpl cannot be cast to java.lang.Class</ns1:faultstring></ns1:XMLFault>

Viewing all articles
Browse latest Browse all 179681

Trending Articles