Cisco UCS Director REST API Cookbook

Similar documents
Prime Service Catalog: UCS Director Integration Best Practices Importing Advanced Catalogs

Examples. Managing Groups. Creating a Group. This chapter contains the following sections:

Flow Sensor and Load Balancer Integration Guide. (for Stealthwatch System v6.9.2)

SAML SSO Okta Identity Provider 2

Cisco FindIT Plugin for Kaseya Quick Start Guide

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 3.1

Cisco TelePresence FindMe Cisco TMSPE version 1.2

Application Launcher User Guide

Cisco TelePresence Management Suite Extension for Microsoft Exchange 5.6

Cisco Prime Home Device Driver Mapping Tool July 2013

Cisco UCS Director API Integration and Customization Guide, Release 5.4

Recovery Guide for Cisco Digital Media Suite 5.4 Appliances

TechNote on Handling TLS Support with UCCX

Cisco Meeting App. What's new in Cisco Meeting App Version December 17

Cisco TelePresence Management Suite Extension for Microsoft Exchange 5.5

Cisco Unified Communications Self Care Portal User Guide, Release

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 5.7. User Guide July 2018

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 5.0

Cisco UCS Director F5 BIG-IP Management Guide, Release 5.0

Cisco Unified Communications Self Care Portal User Guide, Release 11.5(1)

Cisco TelePresence Management Suite Extension for Microsoft Exchange 5.2

CPS UDC MoP for Session Migration, Release

Validating Service Provisioning

Cisco UCS Performance Manager Release Notes

Migration and Upgrade: Frequently Asked Questions

Cisco UCS C-Series IMC Emulator Quick Start Guide. Cisco IMC Emulator 2 Overview 2 Setting up Cisco IMC Emulator 3 Using Cisco IMC Emulator 9

Cisco UCS Director REST API Cookbook, Release 5.4

Cisco Meeting App. Release Notes. WebRTC. Version number September 27, Cisco Systems, Inc.

Cisco Jabber IM for iphone Frequently Asked Questions

Cisco Proximity Desktop

Cisco Meeting App. Cisco Meeting App (OS X) Release Notes. July 21, 2017

Cisco Meeting App. Cisco Meeting App (Windows) Release Notes. March 08, Cisco Systems, Inc.

Cisco CSPC 2.7x. Configure CSPC Appliance via CLI. Feb 2018

Videoscape Distribution Suite Software Installation Guide

External Lookup (for Stealthwatch System v6.10.0)

Cisco UCS Performance Manager Release Notes

Downloading and Licensing. (for Stealthwatch System v6.9.1)

VCS BSS/OSS Adaptor (BOA) 17.2 Release Notes

Cisco Meeting Management

Managing Device Software Images

Release Notes for Cisco Unified Intelligence Center, Release 10.0(1)

Cisco Jabber for Android 10.5 Quick Start Guide

Cisco Meeting App. Cisco Meeting App (ios) Release Notes. October 06, 2017

Cisco Connected Grid Design Suite (CGDS) - Substation Workbench Designer User Guide

Cisco Unified Communications Manager Device Package 8.6(2)( ) Release Notes

Cisco TEO Adapter Guide for SAP Java

Quantum Policy Suite Subscriber Services Portal 2.9 Interface Guide for Managers

Cisco UCS Performance Manager Release Notes

Cisco Meeting Management

Wireless Clients and Users Monitoring Overview

This document was written and prepared by Dale Ritchie in Cisco s Collaboration Infrastructure Business Unit (CIBU), Oslo, Norway.

Cisco TEO Adapter Guide for

Method of Procedure for HNB Gateway Configuration on Redundant Serving Nodes

Cisco StadiumVision Management Dashboard Monitored Services Guide

Tetration Cluster Cloud Deployment Guide

Cisco TEO Adapter Guide for Microsoft Windows

Cisco Meeting Management

Wired Network Summary Data Overview

Cisco TEO Adapter Guide for Microsoft System Center Operations Manager 2007

Cisco has more than 200 offices worldwide. Addresses, phone numbers, and fax numbers are listed on the Cisco website at

Cisco UC Integration for Microsoft Lync 9.7(4) User Guide

Media Suite Version Release Notes

Cisco Unified Communications Manager Device Package 10.5(1)( ) Release Notes

Cisco Jabber Video for ipad Frequently Asked Questions

Media Services Proxy Command Reference

Cisco IOS Shell Command Reference

Host Upgrade Utility User Guide for Cisco UCS E-Series Servers and the Cisco UCS E-Series Network Compute Engine

Cisco CIMC Firmware Update Utility User Guide

Cisco UCS Performance Manager Release Notes

Cisco UCS Virtual Interface Card Drivers for Windows Installation Guide

Addendum to Cisco Physical Security Operations Manager Documentation, Release 6.1

Cisco Meeting App. User Guide. Version December Cisco Systems, Inc.

Cisco TelePresence Management Suite 15.4

Cisco TelePresence TelePresence Server MSE 8710

Media Suite Version Release Notes

Creating and Installing SSL Certificates (for Stealthwatch System v6.10)

Cisco Connected Mobile Experiences REST API Getting Started Guide, Release 10.2

Cisco Report Server Readme

Cisco Expressway Authenticating Accounts Using LDAP

IP Routing: ODR Configuration Guide, Cisco IOS Release 15M&T

Cisco TelePresence MCU MSE 8510

Cisco TelePresence Management Suite 15.5

Cisco Meeting App. Cisco Meeting App (Windows) Release Notes. March 08, Cisco Systems, Inc.

Enterprise Chat and Supervisor s Guide, Release 11.5(1)

Cisco Evolved Programmable Network System Test Topology Reference Guide, Release 5.0

Cisco Meeting Server. Cisco Meeting Server Release 2.0+ Multi-tenancy considerations. December 20, Cisco Systems, Inc.

NNMi Integration User Guide for CiscoWorks Network Compliance Manager 1.6

Cisco Meeting App. Cisco Meeting App (OS X) Release Notes. October 24, Cisco Systems, Inc.

Cisco Nexus 1000V for KVM Interface Configuration Guide, Release 5.x

Cisco TelePresence Management Suite

Deploying Devices. Cisco Prime Infrastructure 3.1. Job Aid

Cisco CSPC 2.7.x. Quick Start Guide. Feb CSPC Quick Start Guide

CC Software version 1.5.0

Cisco TelePresence Authenticating Cisco VCS Accounts Using LDAP

Cisco Prime Network Registrar IPAM 8.3 Quick Start Guide

Cisco Unified Workforce Optimization

Deploying IWAN Routers

Quick Start Guide for Cisco Prime Network Registrar IPAM 8.0

Access Switch Device Manager Template Configuration

Cisco TelePresence Supervisor MSE 8050

Transcription:

Cisco UCS Director REST API Cookbook Release 1.0 Published: April, 2015 Cisco Systems, Inc. www.cisco.com Cisco has more than 200 offices worldwide. Addresses, phone numbers, and fax numbers are listed on the Cisco website at: www.cisco.com/go/offices.

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS. THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY. The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB s public domain version of the UNIX operating system. All rights reserved. Copyright 1981, Regents of the University of California. NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED AS IS WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING,WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R) Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental. 2015 Cisco Systems, Inc. All rights reserved.

Table of Contents 1 Getting Started... 4 2 REST Tools... 4 2.1 REST API Browser... 4 2.1.1 Usage Example 1: Retrieving the VM Summary... 5 2.1.2 Usage Example 2: Creating a Group... 6 2.1.3 Sample Java Code... 7 3 API Usage Examples... 9 3.1 Administration... 9 3.1.1 Creating a Group... 9 3.1.2 Listing the Groups... 11 3.1.3 Modifying a Group... 11 3.1.4 Deleting a Group... 11 3.2 Workflow Orchestration... 12 3.2.1 Submitting a Service Request... 12 3.2.2 Submitting a VApp Service Request... 12 3.3 VM Management... 12 3.3.1 Powering On a VM... 12 3.3.2 Powering Off a VM... 13 3.3.3 Rebooting a VM... 13 3.3.4 Creating and resizing a VM Disk... 13 3.3.5 Setting up a VMware VM Guest and Executing VIX Script 14 3.3.6 Deleting a VMware Snapshot... 14 3.4 Managing Physical Accounts... 15 3.4.1 Creating a Physical Account... 15 3.4.2 Deleting a Physical Account... 15 3.4.3 Listing the Accounts... 15 3.5 Managing Catalogs... 16 3.5.1 Creating a Catalog Item... 16 3.5.2 Retrieving the Catalog Details... 16 3.5.3 Deleting a Catalog Item... 17 3.6 Managing VDCs... 17 3.6.1 Listing the VDCs... 17 3.6.2 Creating a VDC... 17 3.6.3 Exporting a VDC... 18 3.6.4 Importing a VDC... 18 3.6.5 Deleting a VDC... 18 3.7 Managing Containers... 19 3.7.1 Retrieving a Service Container... 19 3.7.2 Retrieving a Service Container with Catalog... 19 3.7.3 Deleting a Service Container... 19 3

1 Getting Started The cookbook provides a gist of the REST services offered by Cisco UCS Director. The cookbook is expected to aid a Developer with, but not restricted to, the following: Demonstrate the REST-related tools available with Cisco UCS Director. Automate the orchestration of tasks through the REST APIs. 2 REST Tools By default, Cisco UCS Director is enabled to respond to REST API requests from the appropriate REST clients. Cisco UCS Director provides the following entities to aid in REST development: REST API Browser REST API SDK Bundle For more information on the REST API SDK bundle, see the Cisco UCS Director REST API Developer Guide. 2.1 REST API Browser The REST API browser available with Cisco UCS Director aids the Developers and QA Engineers to validate the REST APIs added to the framework. An administrator or group administration user can launch the REST API Browser. To launch the REST API Browser, choose Policies > Orchestration > REST API Browser. 4

The REST API browser groups the APIs based on the tasks needed to manage the respective infrastructure components of the datacenter. To view an API, expand a task folder and double-click the report for the respective API. The browser provides the following tabs for the selected API: 1) API Examples Displays the inputs for user-selection. A Developer can provide his inputs for the respective API as required and generate a sample URL. 2) Details Defines the syntax and the semantics for the API. 3) Sample Java Code A Java code snippet that demonstrates the use of the API. 2.1.1 Usage Example 1: Retrieving the VM Summary Click the Details tab, to view the definition of the userapigetvmsummary API. The userapigetvmsummary API takes the vmid as its input. 5

In the API Examples tab, click Generate URL to get the URL for the REST operation. The vmid must be passed as the param0, as shown in the following dialog box. From the UCSD Server drop-down list, choose Cisco UCS Director on which the API is targeted at and click Execute REST API for a response. 2.1.2 Usage Example 2: Creating a Group The following UI is presented to create a group. Fill in the fields and click Generate XML to generate the sample XML file for group creation. 6

From the UCSD Server drop-down list, choose Cisco UCS Director on which the API is targeted at and click Execute REST API for a response. 2.1.3 Sample Java Code The Sample Java Code tab provides the code snippet that can be used to automate the management services through code. 7

The code snippet can be used to execute the respective API. To execute the code in the Eclipse and obtain the output, you must import the SDK bundle as a Java Project into the Eclipse IDE. To import the SDK bundle, do the following: 1. In the Eclipse IDE, choose File > New > Java Project. The Create a Java Project dialog box appears. 2. In the Project Name field, enter a name for the project. 3. Right click the project, and select Import. 4. In the Import dialog box, select Existing projects into Workspace and click Next. 5. Click Browse and navigate to the folder where you extracted the SDK Bundle. 8

6. Click Finish. The Eclipse IDE displays the SDK Bundle project on the Project Explorer tab. 3 API Usage Examples This section captures code examples on the API usage. For detailed explanation on the respective APIs, refer to the Cisco UCS Director REST API Developer Guide. 3.1 Administration 3.1.1 Creating a Group There are a couple of APIs to create a group, demonstrated as follows: 9

public class userapicreategroup { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); APIGroup apigroup = new APIGroup(); apigroup.setgroupid(1); apigroup.setgroupname("testgrp"); apigroup.setdescription("testing sample"); apigroup.setparentgroupid(0); apigroup.setparentgroupname("abc"); apigroup.setemailaddress("sdk@example.com"); apigroup.setlastname("l"); apigroup.setfirstname("f"); apigroup.setphonenumber("12345"); apigroup.setaddress("xyz"); apigroup.setgrouptype(0); int obj = instance.userapicreategroup( apigroup ); System.out.println(obj); The following approach and usage of another API is equivalent to executing the workflow task that creates a group. public class userapigroupcreate { "1A8DE698E2BF4C0B989476A369 F0FC64", "https", 443); AddGroupConfig instance = new AddGroupConfig(server); instance.setgroupname("testgroup"); instance.setgroupdescription("testing"); instance.setparentgroup("testparentgroup"); instance.setgroupcode("1256"); instance.setgroupcontact("email@example.com"); instance.setfirstname("abcd"); instance.setlastname("dabc"); instance.setphone("1234"); instance.setaddress("test"); instance.setgroupsharepolicyid("abcd123"); instance.setallowprivateusers(false); AddGroupConfigResponse obj = instance.execute(); Cisco UCS Director provides API wrappers for execution of individual workflow tasks. There are cases where more than one APIs that does the same job are 10

available with the SDK bundle, as seen in this section. Thus, a Developer shall use either of those APIs as explained above. 3.1.2 Listing the Groups public class userapigetgroups { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); APIGroup grp = new APIGroup(); System.out.println("Group Id :" +grp.getgroupid()); System.out.println("Group Name :" +grp.getgroupname()); System.out.println("Description :" +grp.getdescription()); System.out.println("Parent Group ID :" +grp.getparentgroupid()); System.out.println("Parent Group Name :" +grp.getparentgroupname()); System.out.println("Email Address :" +grp.getemailaddress()); System.out.println("Last Name :" +grp.getlastname()); System.out.println("First Name :" +grp.getfirstname()); System.out.println("Phone number :" +grp.getphonenumber()); System.out.println("Address :" + grp.getaddress()); System.out.println("Group Type : " + grp.getgrouptype()); List<APIGroup> obj = instance.userapigetgroups(); System.out.println(grp); 3.1.3 Modifying a Group public class userapiupdategroup { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); APIGroup apigroup = new APIGroup(); apigroup.setgroupname("g1"); apigroup.setemailaddress("123@example.com"); apigroup.setdescription("update test"); boolean obj = instance.userapiupdategroup(apigroup); System.out.println(obj); 3.1.4 Deleting a Group public class userapideletegroup { 11

"1A8DE698E2BF4C0B989476A369 F0FC64", "https", 443); boolean obj = instance.userapideletegroup( 10 ); System.out.println(obj); 3.2 Workflow Orchestration 3.2.1 Submitting a Service Request public class userapisubmitservicerequest{ "1A8DE698E2BF4C0B989476A369 F0FC64", "https", 443); int obj = instance.userapisubmitservicerequest( "vmware1", "vmware", 1, 1, 1, "test"); System.out.println(obj); 3.2.2 Submitting a VApp Service Request 3.3 VM Management 3.3.1 Powering On a VM public class userapisubmitvappservicerequest { "1A8DE698E2BF4C0B989476A369F0F C64", "https", 443); APINameValueList list = new APINameValueList(); APINameValue nv = new APINameValue(); nv.setname("name"); nv.setvalue("value"); list.addnamevalue(nv ); int obj = instance.userapisubmitvappservicerequest( "CatAD", list ); public class userapiexecutevmaction { "1A8DE698E2BF4C0B989476A369F 0FC64", "https", 443); 12

String obj = instance.userapiexecutevmaction( 1, "poweron", "Testing" ); 3.3.2 Powering Off a VM public class userapiexecutevmaction { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); String obj = instance.userapiexecutevmaction( 1, "poweroff", "Testing" ); 3.3.3 Rebooting a VM public class userapiexecutevmaction { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); String obj = instance.userapiexecutevmaction( 1, "Reboot", "Testing" ); 3.3.4 Creating and resizing a VM Disk public class VMDiskcreateandresize{ "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); CreateVMDisk instance = new CreateVMDisk(server); instance.setvmid(120); instance.setdisksize("20"); instance.setfromstoragepolicy(false); instance.setdisktype("database"); instance.setdatastorename("test123"); instance.setthinprovision(false); instance.execute(); System.out.println(""+instance.getDiskSize()); System.out.println(""+instance.getVmId()); System.out.println(""+instance.getDiskType()); 13

ResizeVMDisk instanceres = new ResizeVMDisk(server); instanceres.setvmid(instance.getvmid()); instanceres.setvmdisk("tempappvm1"); instanceres.setprovisioneddisk(instance.getdisktype()); instanceres.setsize("40"); instanceres.execute(); 3.3.5 Setting up a VMware VM Guest and Executing VIX Script public class vmwareguestandvix{ "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); GuestSetup instance = new GuestSetup(server); instance.setvmid(120); instance.setcredentialsoptions("do not Share"); instance.setuserid("admin"); instance.setpassword("admin"); GuestSetupResponse obj = instance.execute(); System.out.println(""+instance.getUserId()); System.out.println(""+instance.getVmId()); System.out.println(""+instance.getPassword()); ExecuteVIXScript instancevix = new ExecuteVIXScript(server); instancevix.setaccountname("cloud123"); instancevix.setvmid(instance.getvmid()); instancevix.setcredentialtype("login"); instancevix.setlogin(instance.getuserid()); instancevix.setpassword(instance.getpassword()); instancevix.setscript("/bin/date"); instancevix.setundoscript(""); instancevix.setundoscripttask(false); instancevix.setoutputdisplay(false); ExecuteVIXScriptResponse obj = instancevix.execute(); 3.3.6 Deleting a VMware Snapshot public class DeleteVMsnap{ "1A8DE698E2BF4C0B989476A369 F0FC64", "https", 443); DeleteVMSnapshot instance = new DeleteVMSnapshot(server); instance.setvmid(168); instance.setsnapshotname("test"); instance.setdeletechild(false); DeleteVMSnapshotResponse obj = instance.execute(); 14

3.4 Managing Physical Accounts 3.4.1 Creating a Physical Account public class userapicreateinfraaccount { CuicServer.getAPI("192.0.2.187","6C6416AD90704DF495A6B4D0A75A0BB1 ", "https", 443); UserAPIAccounts instance = new UserAPIAccounts(server); //Example of UCSM Account InfraAccountDetails infraaccountdetails = new InfraAccountDetails(); infraaccountdetails.setaccountname("accname"); infraaccountdetails.setpodname("podname"); infraaccountdetails.setaccountcategory(1); infraaccountdetails.setaccounttype("11"); infraaccountdetails.setprotocol("http"); infraaccountdetails.setport(80); infraaccountdetails.setdestinationipaddress("1.2.3.4"); infraaccountdetails.setlogin("abc"); infraaccountdetails.setpassword("pswd"); boolean obj = instance.userapicreateinfraaccount(infraaccountdetails ); System.out.println(obj); 3.4.2 Deleting a Physical Account public class userapideleteinfraaccount { "1A8DE698E2BF4C0B989476A369F0 FC64", "https", 443); UserAPIAccounts instance = new UserAPIAccounts(server); boolean obj = instance.userapideleteinfraaccount( "AccountName" ); System.out.println("Is the Account deleted? :" +obj); 3.4.3 Listing the Accounts public class userapigetallaccounts { 15

UserAPIAccounts instance = new UserAPIAccounts(server); List<String> obj = instance.userapigetallaccounts(); String[] strarray = new String[obj.size()]; obj.toarray(strarray); String[] tmp = new String[strarray.length]; for (int i = 0; i < tmp.length; ++i) { tmp[i] = (String) strarray[i]; System.out.println(tmp[i]); 3.5 Managing Catalogs 3.5.1 Creating a Catalog Item public class CreateCatalogItem { APICatalogItem item = new APICatalogItem(); item.setcatalogitemid(20); item.setcatalogitemname("sample"); item.setcatalogitemdescription("test"); item.setcloudname("sample"); item.setimageid("sample"); item.setgroups("sample"); item.setappliedtoallgroups(true); item.setsupportemail("sample"); item.setvdccategoryid(1000); int[] applist = null ; applist[0]=1; applist[1]=1; item.setapplist(applist); item.setotherapps("sample"); item.setotheros("sample"); boolean b = userapicreatecatalogitem(item); 3.5.2 Retrieving the Catalog Details public class userapigetcatalogdetails { 16

APIProvisionParams obj = instance.userapigetcatalogdetails( "sample" ); 3.5.3 Deleting a Catalog Item public class userapideletecatalogitem { boolean obj = instance.userapideletecatalogitem("sample"); 3.6 Managing VDCs 3.6.1 Listing the VDCs public class userapigetallvdcs { APITabularReport obj = instance.userapigetallvdcs(); 3.6.2 Creating a VDC public class CreateVDC { APIVDCDetails vdcdetails = new APIVDCDetails() ; vdcdetails.setvdcname("sample"); vdcdetails.setvdcdescription("sample"); vdcdetails.setcloudname("sample"); vdcdetails.setgroupname(1000); vdcdetails.setapprover1("sample"); vdcdetails.setapprover2("sample"); vdcdetails.setvdcsupportemail("sample"); vdcdetails.setvdccustomernoticationemail("sample"); vdcdetails.setsystempolicy("sample"); 17

vdcdetails.setslapolicy("sample"); vdcdetails.setcomputingpolicy("sample"); vdcdetails.setnetworkpolicy("sample"); vdcdetails.setstoragepolicy("sample"); vdcdetails.setcostmodel("sample"); vdcdetails.setlocked(true); vdcdetails.setdeletable(true); vdcdetails.setinactivityperiodfordeletion(1000); boolean obj = instance.userapicreatevdc( vdcdetails ); 3.6.3 Exporting a VDC public class ExportVDC { String obj = instance.userapiexportvdc("sample" ); 3.6.4 Importing a VDC public class importvdc { VDC obj = instance.userapiimportvdc("sample" ); 3.6.5 Deleting a VDC public class DeleteVMsnap{ CreateVdc instance = new CreateVdc(server); instance.setnetdevice("test"); instance.setvdcname("test123"); instance.setmoduletype("example"); instance.sethapolicy(false); instance.sethapolicytype("hadefaultpolicy"); instance.sethapolicyaction("test1234"); instance.setvdcnumber("123"); instance.setpassword("sample"); instance.setvdctemplatename("vnic template"); instance.setvdctype("vmware"); 18

instance.setnetqospolicy("qospolicy"); instance.setcopyruntostartconfig(false); CreateVdcResponse obj = instance.execute(); 3.7 Managing Containers 3.7.1 Retrieving a Service Container public class GetServiceContainerData { UserAPIFencedContainer instance = new UserAPIFencedContainer(server); ContainerDataObjects obj = instance.userapigetservicecontainerdata(1000); 3.7.2 Retrieving a Service Container with Catalog public class CreateServiceContainer { UserAPIAPICContainer instance = new UserAPIAPICContainer(server); int obj = instance.userapicreateservicecontainerwithoutcatalog( "sample", 1000, "sample" ); 3.7.3 Deleting a Service Container public class DeleteServiceContainerData { UserAPIFencedContainer instance = new UserAPIFencedContainer(server); int obj = instance.userapideleteservicecontainer( 1000 ); 19