We get ACCESS_TO_RESOURCE_IS_FORBIDDEN error when I try to instantiatevAppTemplate using Java SDK API vCloud

Hi all

I'm new to global vCloud. I'm trying to create a vApp by instantiating a model existing in vDC. I am getting error below. Could someone please tell what could be the problem? Thank you much for the help. I do not have full access to the catalog.

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: - > Post: https://rarvcloud.dfdev.jnj.com/API/v1.0/VDC/1735607793/action/instantiateVAppTemplate

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

NEWS: POST Request Body: <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >

" < = xmlns:ns1 ns2:InstantiateVAppTemplateParams ' http://schemas.DMTF.org/OVF/envelope/1 "xmlns:ns2 =" " http://www.VMware.com/vCloud/v1 "xmlns:ns3 =" http://schemas.dmtf.org/wbem/wscim/1/CIM-Schema/2/CIM_ResourceAllocationSettingData "xmlns:ns4 =" http://schemas.dmtf.org/wbem/wscim/1/CIM-Schema/2/CIM_VirtualSystemSettingData "xmlns:ns5 =" http://schemas.dmtf.org/wbem/wscim/1/Common "xmlns:ns6 =" http://www.VMware.com/vCloud/versions "xmlns:ns7 =" http://www.VMware.com/vCloud/extension/v1 "name ="BalaTestvAppp"> " "" "" "

Bala Test VAPP < ns2:Description > < / ns2:Description >

< ns2:InstantiationParams >

< ns2:NetworkConfigSection >

< ns1:Info / >

< ns2:NetworkConfig networkName = "RBA 212" >

< ns2:Configuration >

" < ns2:ParentNetwork type="application/vnd.vmware.vcloud.network+xml "name ="RBA 212"href =" https://rarvcloud.dfdev.jnj.com/API/v1.0/network/1334432680 "/>

Bridge of < ns2:FenceMode > < / ns2:FenceMode >

< / ns2:Configuration >

< / ns2:NetworkConfig >

< / ns2:NetworkConfigSection >

< / ns2:InstantiationParams >

" < ns2:Source type="application/vnd.vmware.vcloud.catalogItem+xml "name ="RBA Test 1 "href =" https://rarvcloud.dfdev.jnj.com/API/v1.0/catalogItem/39249650 "/>

< / ns2:InstantiateVAppTemplateParams >

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: POST request Content-Type: application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: POST charset request: null

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: Status Code: 403

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: Status line: HTTP/1.1 403 Forbidden

June 17, 2011 14:02:36 com.vmware.vcloud.sdk.RestUtil post

INFO: Status: banned

June 17, 2011 14:02:37 com.vmware.vcloud.sdk.RestUtil post

INFO: Response:? XML version = "1.0" encoding = "UTF-8"? >

" < error xmlns =" http://www.VMware.com/vCloud/v1 "minorErrorCode ="ACCESS_TO_RESOURCE_IS_FORBIDDEN"message =" no access to the entity & quot; com.vmware.vcloud.entity.vapptemplate:39249650 & quot;. ' majorErrorCode = '403' "xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "xsi: schemaLocation =" http://www.VMware.com/vCloud/v1 http://rarvcloud.dfdev.jnj.com/api/v1.0/schema/master.xsd"> < / error > " "

June 17, 2011 14:02:37 com.vmware.vcloud.sdk.Response Agency

NEWS: Planned the State Code: 201

June 17, 2011 14:02:37 com.vmware.vcloud.sdk.Response Agency

INFO: Actual status Code: 403

Exception in thread "main".

com.vmware.vcloud.sdk.VCloudException : no access to the entity 'com.vmware.vcloud.entity.vapptemplate:39249650'.

to com.vmware.vcloud.sdk.Response.handleUnExpectedResponse)

Response.Java:121 )

to com.vmware.vcloud.sdk.Vdc.instantiateVappTemplate)

VDC. Java:477 ( )

to com.vmware.vcloud.sdk.samples.HellovCloud.newvAppFromTemplate)

HellovCloud.java:270 )

to com.vmware.vcloud.sdk.samples.HellovCloud.main)

HellovCloud.java:375 )

===============

==

Here is the code snippet.

public

static Sub main (String args []) throws

VCloudException,

InterruptedException, HttpException, IOException,

KeyManagementException, {NoSuchAlgorithmException}

Usage example

Connection and getting the list of organization

HellovCloud. opening of session (

" https://MyOrg.com/API/versions " , "1.0" , "userid@RBA-POV" , "password"

);

Find a

VDC

VCC Vcc is HellovCloud. findVdc (

"RBA-POV" , "Org RBA vCD"

);

Catalog category = Catalog. getCatalogByReference (

vcloudClient , findCatalogRef(' RBA-POV ', 'RBA catalogue' )

));

Iterator Iterator < ReferenceType > =

null

;

iterator = catalog.getCatalogItemReferences () .iterator ();

System.

on .println ( 'List of the items in the catalogue' )

);

ReferenceType point =

null

;

While

(iterator.hasNext ()) {

Item = iterator.next ();

System.

on .println ( "name =" "')

+ item.getName ());

System.

on .println ( "href =" "')

+ item.getHref ());

}

ReferenceType vAppTemplatereference =

null

;

vAppTemplatereference = item;

Instantiation of the vAppTemplate

VAPP vapp is HellovCloud. newvAppFromTemplate (vAppTemplatereference, vdc);

waitForTaskCompletion (vapp.getTasks () .get (0));

chaning all the vms ip address mode static ip pool

configureVMsIPAddressingMode (vapp.getReference (), vdc);

String vappName = vapp.getReference () .getName ();

Deploy the VAPP Instantiated

System.

on .println (' deployment of the " " ')

(+ vappName);

System.

on .println("--------------------"

);

waitForTaskCompletion ((vapp.deploy)

fake

1000000));

Turn the VAPP

System.

on .println (' PowerOn the ' )

(+ vappName);

System.

on .println("-------------------"

);

waitForTaskCompletion (vapp.powerOn ());

Suspend the vApp

System.

on .println ("suspend the" )

(+ vappName);

System.

on .println("-------------------"

);

waitForTaskCompletion (vapp.suspend ());

Turn the VAPP

System.

on .println (' PowerOn the ' )

(+ vappName);

System.

on .println("-------------------"

);

waitForTaskCompletion (vapp.powerOn ());

Turn off the vApp

System.

on .println ("PowerOff the ' )

(+ vappName);

System.

on .println("--------------------"

);

waitForTaskCompletion (vapp.powerOff ());

Undeploy VAPP

System.

on .println (' cancel the deployment of the " " ')

(+ vappName);

System.

on .println("--------------------"

);

waitForTaskCompletion ((vapp.undeploy)

true

));

Removal of vApp

System.

on .println (' remove the " " ')

(+ vappName);

System.

on .println("------------------"

);

Hello

Get to the Organization of your preference.

Organization org = organization. getOrganizationByReference (vcloudClient, vcloudClient.getOrgRefByName ("OrgName"));

Download the catalogues of this organization.

{for (catRef ReferenceType: {org.getCatalogRefs ())}

   Cat catalog is a Catalog. getCatalogByReference (vcloudClient, catRef);

Check if the catalog is published.

If (cat.getResource () .isIsPublished ()) {}

System. out.println (cat.getReference (). GetName());

       Download the catalog items and its entities.

{for (catItemRef ReferenceType: {cat.getCatalogItemReferences ())}

           CatalogItem catItem is CatalogItem. getCatalogItemByReference (vcloudClient, catItemRef);

System. out.println ("" + catItem.getEntityReference () .getName () + "-" + catItem.getEntityReference () .getType () "");

}

}

}

Kind regards

Rajesh Kamal.

Tags: VMware

Similar Questions

Maybe you are looking for

  • The use of reminders from prior step to configuration test conditions

    I'm trying to set a reminder from the prior step to check the test conditions and correct them if they do not match the needs of the test stage.  I was going to affect the test conditions in the before expression of each test step, but unfortunately,

  • my re files is no longer visible on USB

    My USB has been infected by a virus I've cleaned upt using Norton 360. However, the files on the disc became invisible althpough that they're always there.

  • Windows media player freezes

    Windows media player freezes about five seconds after I opened the program.  If I start to play a song in the library, it stops about two seconds in the song and make a noise and freeze.  Help.

  • ADD BLUETOOTH IN THE OLD OFFICE

    How and what to download to activate the bluetooth function antique desk.

  • Windows Update won't update

    Hi all I have a computer with a new installation of Windows 7 SP1.  Unfortunately, Windows Update seems to work forever and never gives no results.  So far, I tried the following which seems to be often recommended for problems such as this one: (1)