VMware {code} Community
jlavelle
Contributor
Contributor
Jump to solution

"Method Not Allowed" error on PUT to vAppTemplate /productSections

According to the documentation I should be able to do a PUT to the vAppTemplate /productSections

http://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/operations/PUT-ProductSections-vAppTempl...

Operation: Update product sections of a vApp template [NEW]
Request: PUT APIURL/vAppTemplate/vappTemplate-id/productSections
RequestBody: ProductSectionList
Response: Task

Doing this results in a "Method Not Allowed" error though. I'm doing this as a System Admin.

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Well, actually it seems that vAppTemplates are immutable.

That's why you cannot update the product section of a template.

You could try to add that section upon vAppTemplate creation.

View solution in original post

0 Kudos
5 Replies
admin
Immortal
Immortal
Jump to solution

Have you checked the media type you are using upon request? It should be application/vnd.vmware.vcloud.productSections+xml.

0 Kudos
jlavelle
Contributor
Contributor
Jump to solution

I'm setting the content type correctly, I'm able to do the PUT update on both vApps and VMs just not vAppTemplates.

0 Kudos
admin
Immortal
Immortal
Jump to solution

Well, actually it seems that vAppTemplates are immutable.

That's why you cannot update the product section of a template.

You could try to add that section upon vAppTemplate creation.

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot
Jump to solution

ProductSections for vApp templates are defined in the OVF which is used to create a vApp template. Once uploaded as a vApp template, the ProductSection cannot be changed for the template - only for the vApps and their VMs.

Below is a sample product section inside an OVF file. It could be placed under <VirtualSystemCollection> element in order to be global for the whole vApp template or inside individual <VirtualSystem> elements in order to be associated with a VM.

<ProductSection>
        <Info>Information about the installed software</Info>
        <Category>Static Properties</Category>
        <Property ovf:key="choice" ovf:type="boolean" ovf:userConfigurable="true" ovf:value="false">
          <Label>Boolean Type</Label>
          <Description>Boolean description</Description>
        </Property>
        <Property ovf:key="num_int" ovf:qualifiers="MinValue(-10), MaxValue(100)" ovf:type="int8" ovf:userConfigurable="true" ovf:value="32">
          <Label>Number Integer</Label>
        </Property>
        <Property ovf:key="num_real" ovf:qualifiers="MinValue(-20.5), MaxValue(45.6)" ovf:type="real32" ovf:userConfigurable="true" ovf:value="21.4">
          <Label>Real Type</Label>
        </Property>
        <Property ovf:key="str" ovf:qualifiers="MinLen(5), MaxLen(20)" ovf:type="string" ovf:userConfigurable="true" ovf:value="defaultStr">
          <Label>String</Label>
        </Property>
        <Property ovf:key="str_choice" ovf:qualifiers="ValueMap{&quot;A&quot;,&quot;B&quot;,&quot;C&quot;}" ovf:type="string" ovf:userConfigurable="true" ovf:value="B">
          <Label>String Choice</Label>
        </Property>
        <Property ovf:key="vmPassword" ovf:password="true" ovf:type="string" ovf:userConfigurable="true" ovf:value="pass1234">
          <Label>VM Password</Label>
        </Property>
<Property ovf:key="externalIP" ovf:type="string" ovf:userConfigurable="true" vmw:qualifiers="Ip" ovf:value="192.168.0.1">
          <Label>External IP</Label>
        </Property>       
    </ProductSection>

jlavelle
Contributor
Contributor
Jump to solution

Thats what I was expecting, the documentation is incorrect and template aren't editable.

0 Kudos