background image

VMware, Inc.

17

Chapter 3 Hello vCloud: A Structured Java Workflow Example

List<JAXBElement<? extends SectionType>> sections = instantiationParamsType

.getSection();

sections.add(new ObjectFactory()

.createNetworkConfigSection(networkConfigSectionType));

//create the request body (InstantiateVAppTemplateParams)

InstantiateVAppTemplateParamsType instVappTemplParamsType = new 

InstantiateVAppTemplateParamsType();

instVappTemplParamsType.setName("HellovCloudvAppp");
instVappTemplParamsType.setSource(vAppTemplateReference);
instVappTemplParamsType.setInstantiationParams(instantiationParamsType);

//make the request, and get an href to the vApp in return

Vapp vapp = vdc.instantiateVappTemplate(instVappTemplParamsType);
return vapp;

Operate the vApp

The

 

Vapp

 

class

 

includes

 

methods

 

that

 

perform

 

operations

 

on

 

the

 

vApp.

 

The

 

majority

 

of

 

these

 

operations

 

return

 

a

 

Task

 

object

 

that

 

tracks

 

the

 

progress

 

of

 

the

 

operation.

 

HellovCloud.java

 

uses

 

a

 

number

 

of

 

these

 

methods

 

to

 

cycle

 

the

 

vApp

 

through

 

the

 

following

 

states:

1

deploy:

 

deploy()

2

power

 

on:

 

powerOn()

3

suspend:

 

suspend()

4

power

 

off:

 

powerOff()

5

undeploy:

 

undeploy()

6

delete:

 

delete()

Summary of Contents for VCLOUD SDK FOR JAVA 1.0 - DEVELOPER S GUIDE

Page 1: ...Java 1 0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition To check for more recent editions of this docume...

Page 2: ...ts about this documentation submit your feedback to docfeedback vmware com Copyright 2010 VMware Inc All rights reserved This product is protected by U S and international copyright and intellectual p...

Page 3: ...Development 11 Prerequisites 11 Download the vCloud SDK for Java Package 11 Import the SDK Into Your Java IDE 12 About SSL Access 12 3 Hello vCloud A Structured Java Workflow Example 13 Running the H...

Page 4: ...vCloud SDK for Java Developer s Guide 4 VMware Inc...

Page 5: ...d API applications including interactive clients of VMware Cloud Director This guide assumes you are familiar with the Java programming language Representational State Transfer REST and RESTful progra...

Page 6: ...mware com support services VMware Professional Services VMware Education Services courses offer extensive hands on labs case study examples and course materials designed to be used as on the job refer...

Page 7: ...7 vCloud Object Taxonomy on page 7 vCloud SDK for Java Design The vCloud SDK for Java provides object specific methods for creating updating retrieving and deleting objects defined by the vCloud API...

Page 8: ...igured to provide services such as DHCP NAT and firewalls vCloud Virtual Datacenters A vCloud virtual datacenter vDC is an allocation mechanism for resources such as networks storage CPU and memory In...

Page 9: ...SO or floppy Virtual systems are stored as templates using an open standard format OVF 1 0 These templates can be retrieved from catalogs and transformed into virtual systems called vApps through a pr...

Page 10: ...vCloud SDK for Java Developer s Guide 10 VMware Inc...

Page 11: ...ccount with rights to run the samples The predefined role CatalogAuthor should provide all the necessary rights For more information about roles and rights see the VMware Cloud Director Administrator...

Page 12: ...mples 1 0 sources jar 3 Import the contents of the vcloud java sdk all folder into your Java IDE About SSL Access In the default configuration VMware Cloud Director requires vCloud API clients to use...

Page 13: ...to the vCloud Uploading an OVF package to create a vApp template Adding the vApp template to a catalog Instantiating the vApp template to create a vApp Operating the vApp The file HellovCloud txt in t...

Page 14: ...te to the cloud The vCloud API returns a list of the organizations to which the user has access and the login method in HellovCloud java prints this list In the typical case this list has a single mem...

Page 15: ...equests for it and examines the response for additional upload URLs When the response contains any upload URLs beyond the one returned in Step 2 template is complete 5 The client uses HTTP PUT request...

Page 16: ...AppTemplate URL of the vDC and returns a Vapp helper object that contains among other things a reference to the vApp Example 3 4 Instantiating the vApp Template public static Vapp newvAppFromTemplate...

Page 17: ...tVappTemplParamsType setSource vAppTemplateReference instVappTemplParamsType setInstantiationParams instantiationParamsType make the request and get an href to the vApp in return Vapp vapp vdc instant...

Page 18: ...vCloud SDK for Java Developer s Guide 18 VMware Inc...

Page 19: ...oud sdk Defines the classes that implement the user API Objects accessed by these classes are typically readable by all users and can be modified by users with appropriate rights com vmware vcloud sdk...

Page 20: ...anization Table 4 3 Administrative API Samples Sample Name Description CatalogCRUD java Create retrieve update or delete a catalog OrganizationCRUD java Create retrieve update or delete an organizatio...

Page 21: ...oad 13 OVF package to upload 15 P packages overview of 19 S samples HellovCloud sample 13 overview of 19 rights required to run 11 txt file output 11 T Tasks about 9 technical support resources 5 U us...

Page 22: ...vCloud SDK for Java Developer s Guide 22 VMware Inc...

Reviews: