background image

VMware, Inc.

13

3

This

 

chapter

 

presents

 

an

 

example

 

of

 

using

 

the

 

vCloud

 

SDK

 

for

 

Java

 

to

 

implement

 

a

 

structured

 

workflow

 

through

 

the

 

lifecycle

 

of

 

a

 

vApp.

 

It

 

contains

 

the

 

following

 

topics.

“Running

 

the

 

HellovCloud

 

Sample”

 

on

 

page 13

“Logging

 

In

 

and

 

Getting

 

an

 

Organization

 

List”

 

on

 

page 14

“Getting

 

References

 

to

 

the

 

vDC

 

and

 

Catalog”

 

on

 

page 14

“Upload

 

an

 

OVF

 

Package

 

to

 

Create

 

a

 

vApp

 

Template”

 

on

 

page 15

“Add

 

the

 

vApp

 

Template

 

to

 

a

 

Catalog”

 

on

 

page 16

“Instantiate

 

the

 

vApp

 

Template”

 

on

 

page 16

“Operate

 

the

 

vApp”

 

on

 

page 17

Running the HellovCloud Sample

The

 

HellovCloud.java

 

sample,

 

included

 

in

 

the

 

samples

 

folder

 

of

 

vcloud-java-sdk-samples-1.0-sources.jar

,

 

demonstrates

 

a

 

number

 

of

 

the

 

operations

 

supported

 

by

 

the

 

vCloud

 

SDK

 

for

 

Java:

Logging

 

in

 

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

 

that

 

folder

 

includes

 

sample

 

input

 

and

 

output.

The

 

examples

 

shown

 

in

 

this

 

section

 

are

 

extracted

 

from

 

the

 

HellovCloud.java

 

sample.

To

 

run

 

the

 

HellovCloud.java

 

sample,

 

use

 

the

 

following

 

command

 

line.

java HellovCloud 

vCloudApiVersionsURL versionId user@vcloud-organization password orgName vdcName 

ovfFileLocation vmdkFileLocation vmdkFileName catalogName

where:

vCloudApiVersionsURL

 

is

 

the

 

base

 

API

 

URL

 

of

 

the

 

vCloud.

versionId

 

is

 

the

 

version

 

of

 

the

 

API

 

to

 

use

 

(always

 

1.0

 

for

 

this

 

release).

username

 

is

 

the

 

name

 

of

 

a

 

Cloud

 

Director

 

user,

 

in

 

the

 

form

 

user

@

vcloud

organization

,

 

who

 

has

 

rights

 

to

 

upload

 

OVF,

 

create

 

vApp

 

templates,

 

create

 

vApps,

 

and

 

operate

 

vApps.

password

 

is

 

the

 

user’s

 

password.

Hello vCloud: A Structured Java 
Workflow Example

3

Содержание VCLOUD SDK FOR JAVA 1.0 - DEVELOPER S GUIDE

Страница 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...

Страница 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...

Страница 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...

Страница 4: ...vCloud SDK for Java Developer s Guide 4 VMware Inc...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 10: ...vCloud SDK for Java Developer s Guide 10 VMware Inc...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 17: ...tVappTemplParamsType setSource vAppTemplateReference instVappTemplParamsType setInstantiationParams instantiationParamsType make the request and get an href to the vApp in return Vapp vapp vdc instant...

Страница 18: ...vCloud SDK for Java Developer s Guide 18 VMware Inc...

Страница 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...

Страница 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...

Страница 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...

Страница 22: ...vCloud SDK for Java Developer s Guide 22 VMware Inc...

Отзывы: