background image

VMware, Inc.

19

4

The

 

vCloud

 

SDK

 

for

 

Java

 

includes

 

sample

 

application

 

code

 

and

 

complete

 

reference

 

documentation

 

on

 

all

 

packages,

 

classes,

 

and

 

methods

 

in

 

the

 

SDK.

 

This

 

chapter

 

is

 

an

 

introductory

 

tour

 

of

 

those

 

items.

Packages

The

 

SDK

 

includes

 

four

 

packages

 

that

 

support

 

the

 

JAXB

 

bindings

 

to

 

the

 

vCloud

 

API

 

XML

 

schemas

 

and

 

three

 

packages

 

that

 

implement

 

create,

 

retrieve,

 

update,

 

and

 

delete

 

(CRUD)

 

operations

 

on

 

the

 

objects

 

represented

 

by

 

those

 

schemas.

Samples

In

 

addition

 

to

 

HellovCloud.java

 

(see

 

“Hello

 

vCloud:

 

A

 

Structured

 

Java

 

Workflow

 

Example”

 

on

 

page 13),

 

the

 

SDK

 

samples

 

directory

 

(

vcloud-java-sdk-samples-1.0-sources\com\vmware\vcloud\sdk\samples

)

 

includes

 

several

 

samples

 

that

 

demonstrate

 

how

 

you

 

can

 

use

 

the

 

vCloud

 

SDK

 

for

 

Java

 

to

 

develop

 

client

 

applications.

 

Samples

 

listed

 

Table 4

2

 

can

 

be

 

run

 

by

 

any

 

user

 

with

 

rights

 

to

 

create

 

and

 

modify

 

catalog

 

items

 

and

 

vApps.

 

Samples

 

listed

 

Table 4

3

 

require

 

organization

 

administrator

 

privileges.

Overview of Packages and Samples

4

Table 4-1.  

Packages in the vCloud SDK for Java

Package Name

Description

com.vmware.vcloud.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.admin

 

Defines

 

the

 

classes

 

that

 

implement

 

the

 

administrative

 

API.

 

Objects

 

accessed

 

by

 

these

 

classes

 

are

 

typically

 

readable

 

by

 

all

 

users,

 

but

 

can

 

be

 

created

 

and

 

modified

 

only

 

by

 

a

 

system

 

administrator,

 

organization

 

administrator

 

or

 

other

 

privileged

 

user.

 

Many

 

of

 

these

 

objects

 

extend

 

types

 

that

 

are

 

defined

 

in

 

the

 

user

 

API.

 

com.vmware.vcloud.sdk.admin.extension

Defines

 

the

 

classes

 

that

 

implement

 

extensions

 

that

 

support

 

operations

 

on

 

the

 

vSphere

 

Platform.

 

All

 

vSphere

 

platform

 

operations

 

are

 

restricted

 

to

 

the

 

system

 

administrator.

 

com.vmware.vcloud.api.rest.schema,
com.vmware.vcloud.api.rest.schema.extension
com.vmware.vcloud.api.rest.schema.ovf
com.vmware.vcloud.api.rest.schema.versioning
org.w3._2001.xmlschema

 

XML

 

schemas

 

used

 

by

 

JAXB

 

binding

Table 4-2.  

User API Samples

Sample Name

Description

CatalogInventorySample.java

Lists

 

name

 

and

 

href

 

for

 

all

 

items

 

in

 

all

 

catalogs

 

in

 

the

 

organization.

CatalogItemCRUD.java

Create,

 

retrieve,

 

update,

 

or

 

delete

 

a

 

catalog

 

item.

 

DiskCRUD.java

Create,

 

retrieve,

 

update,

 

or

 

delete

 

a

 

virtual

 

hard

 

disk

 

in

 

a

 

Vm

 

object.

 

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: