VMware {code} Community
aturli
Contributor
Contributor
Jump to solution

Problem with PUT /vApp/{id}/networkConnectionSection

Hi,

I'm having problem in using this API call:

PUT /vApp/{id}/networkConnectionSection that should modify the network connection section of a VM.

I'm getting

Unable to perform this action. Contact your cloud administrator.

Is there any pre requisites that I'm missing?

Thanks,

Andrea

0 Kudos
1 Solution

Accepted Solutions
Todor_Todorov
Hot Shot
Hot Shot
Jump to solution

It looks like <IpAddressAllocationMode> element is present in the response. So for some reason it dissappears from the subsequent request. Can you explicitly set it before sending the request?

Regards,

Todor Todorov

View solution in original post

0 Kudos
5 Replies
aturli
Contributor
Contributor
Jump to solution

The interesting part is that if I use

GET /vApp/{id}/networkConnectionSection

the retrieved NetworkConnectionSectionType is not valid if I use it to modify the networkConnectionSection

PUT /vApp/{id}/networkConnectionSection

Here's the exception

Bad request
Unexpected JAXB Exception - cvc-complex-type.2.4.b: The content of element 'ns2:NetworkConnection' is not complete. One of '{&quot;http://www.vmware.com/vcloud/v1.5":IpAddressAllocationMode}' is expected.

Thoughts?

Andrea

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot
Jump to solution

Can you paste the XML you're receiving when getting the networkConnectionSection?

0 Kudos
aturli
Contributor
Contributor
Jump to solution

Sure, here's the XML that returns GET /vApp/{id}/networkConnectionSection call:

<ovf:Info>Specifies the available VM network connections</ovf:Info>

    <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>

    <NetworkConnection network="orgNet-cloud-External-default+http" needsCustomization="true">

        <NetworkConnectionIndex>0</NetworkConnectionIndex>

        <IpAddress>192.168.2.100</IpAddress>

        <IsConnected>true</IsConnected>

        <MACAddress>00:50:56:01:07:7b</MACAddress>

        <IpAddressAllocationMode>POOL</IpAddressAllocationMode>

    </NetworkConnection>

    <Link rel="edit" type="application/vnd.vmware.vcloud.networkConnectionSection+xml" href="https://mycloud.cloud.com/api/vApp/vm-cd0d7ef7-da14-4a07-a7f9-9a6d1676fee9/networkConnectionSection/"/>

</NetworkConnectionSection>

Thanks,

Andrea

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot
Jump to solution

It looks like <IpAddressAllocationMode> element is present in the response. So for some reason it dissappears from the subsequent request. Can you explicitly set it before sending the request?

Regards,

Todor Todorov

0 Kudos
aturli
Contributor
Contributor
Jump to solution

Thanks Todor Todorov,

my mistake, I was looking up for `pool` rather than `POOL`

Thanks to help me in spotting my error.

Thanks,

Andrea

0 Kudos