Logging In And Getting An Organization List; Getting References To The Vdc And Catalog; Upload An Ovf Package To Create A Vapp Template - VMware VCLOUD SDK 1.0 - FOR NET DEVELOPERS GUIDE Manual

Vcloud sdk for .net developer’s guide
Hide thumbs Also See for VCLOUD SDK 1.0 - FOR NET DEVELOPERS GUIDE:
Table of Contents

Advertisement

vCloud SDK for .NET Developer's Guide
password is the user's password.
orgName is the name of the organization to which the user is authenticating.
vdcName is the name of a vDC in that organization where the user can upload the OVF and deploy the 
vApp.
ovfFileLocation is the full pathname to the OVF descriptor on the local disk.
vmdkFileLocation is the full pathname to the vmdk file referenced in the OVF descriptor.
vmdkFileName is the file name of the vmdk file.
catalogName is the name of the catalog in which the vApp template will be catalogued.
For example:
.Net HellovCloud https://vcloud.example.com/api/versions 1.0 user@exampleOrg Pa55w0rd exampleOrg
exampleVdc C:\descriptor.ovf C:\disk.vmdk disk.vmdk exampleCatalog

Logging In and Getting an Organization List

Most vCloud API requests must be authenticated by a login request that supplies user credentials in the form 
required by Basic HTTP authentication (MIME Base64 encoding of a string having the form 
user@vcloud‐organization:password). The vCloudClient class implements a login method that takes the 
following parameters:
userName: supplied in the form user@vcloud‐organization
password: the user's password
The HellovCloud example uses this method to authenticate to the cloud. The vCloud API returns a list of the 
organizations to which the user has access, and the login method in HellovCloud prints this list. 

Getting References to the vDC and Catalog

To instantiate a vApp template and operate the resulting vApp, you need the object references (href values) 
for the catalog in which the vApp template will be listed and the vDC in which the vApp will be deployed. 
The Organization class implements several methods that return references to vDCs and catalogs. 
HellovCloud uses these methods as shown in Example
Example 3-1. Getting References to the vDC and Catalog
public static Vdc FindVdc(string orgName, string vdcName)
{
try
{
ReferenceType orgRef = client.GetOrgRefByName(orgName);
Organization org = Organization.GetOrganizationByReference(client, orgRef);
ReferenceType vdcRef = org.GetVdcRefByName(vdcName);
return Vdc.GetVdcByReference(client, vdcRef);
}
...
}

Upload an OVF Package to Create a vApp Template

The HellovCloud command line requires you to supply the name of an OVF descriptor file and the vmdk file 
that it references. This information is used in the createUploadvAppTemplate method to upload the OVF 
descriptor and vmdk file, create a vApp template, and return a reference to the template that can be used by 
other methods in the program.
The createUploadvAppTemplate method and the methods it calls from the vCloud SDK for .NET class 
libraries implement the following workflow to upload the OVF package and create a vApp template.
14
3‐1.
VMware, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vcloud sdk 1.0

Table of Contents