170
Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883 Web Service API Reference Guide for Cisco Application Networking Manager 5.2.2 Version 5.2.2 November 2012 Text Part Number: OL-25355-03

Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Embed Size (px)

Citation preview

Page 1: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Web Service API Reference Guide for Cisco Application Networking Manager 5.2.2Version 5.2.2 November 2012

Americas HeadquartersCisco Systems, Inc.170 West Tasman DriveSan Jose, CA 95134-1706 USAhttp://www.cisco.comTel: 408 526-4000

800 553-NETS (6387)Fax: 408 527-0883

Text Part Number: OL-25355-03

Page 2: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

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.

API Reference Guide for Cisco Application Networking Manager 5.2.2 © 2012 Cisco Systems, Inc. All rights reserved.

Page 3: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

OL-25355-03

C O N T E N T S

Preface ix

Audience ix

Organization ix

Related Documentation x

Conventions x

Open-Source Software Included in the Cisco Application Networking Manager xi

Obtaining Documentation and Submitting a Service Request xi

C H A P T E R 1 Introduction to the Cisco ANM Web Services API 1-1

ANM Web Services Overview 1-1

Using the ANM Web Services 1-2

Required Software, Web Standards, and Supported Hardware 1-2

Enabling the Web Services Interface 1-3

Obtaining the Web Services Description Language File 1-3

Generating the Client Code to Invoke a Web Service 1-3

Calling an ANM Web Service and Posting a SOAP Request 1-4

C H A P T E R 2 ANM Web Services API 2-1

Mapping Table 2-1

OperationManager Web Service APIs 2-3

login 2-5

logout 2-7

listDeviceids 2-8

listVirtualContexts 2-10

listVirtualServers 2-12

listServerFarms 2-15

listRservers 2-17

listServerfarmRservers 2-19

listAnswers 2-22

listDnsRules 2-24

activateVirtualServer 2-26

suspendVirtualServer 2-28

addRserverToServerfarm 2-30

removeRserverFromServerfarm 2-33

iiiAPI Reference Guide for Cisco Application Networking Manager 5.2.2

Page 4: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Contents

activateServerfarmRserver 2-36

suspendServerfarmRserver 2-39

changeServerfarmRserverWeight 2-42

activateAnswer 2-45

suspendAnswer 2-47

activateDnsRule 2-49

suspendDnsRule 2-51

getVMMappingInfo 2-53

syncDevice 2-55

ApplicationTemplateManager Web Service APIs 2-56

listTemplateDefinitions 2-56

getTemplateDefinitionMetadata 2-60

createTemplateInstance 2-65

listTemplateInstances 2-70

deleteTemplateInstance 2-71

listCheckpoints 2-73

createCheckpoint 2-75

deleteCheckpoint 2-77

rollbackCheckpoint 2-79

freeFormShow 2-81

RBACManager Web Service APIs 2-83

createUsers 2-83

updateUsers 2-85

listUsers 2-86

deleteUsers 2-88

listRoles 2-89

listDomainNames 2-90

listDomains 2-91

listOrganizations 2-92

C H A P T E R 2 Web Service Objects 2-1

Answer 2-2

Checkpoints 2-2

DeviceID 2-2

DeviceType 2-3

DnsRule 2-3

MatchCondition 2-4

Rserver 2-4

ivAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 5: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Contents

Serverfarm 2-4

SessionToken 2-4

SfRserver 2-5

TemplateDefinition 2-5

TemplateInput 2-6

TemplateInstance 2-6

VMMappingInfo 2-6

Vserver 2-7

WSException 2-7

User 2-7

Role 2-8

Domain 2-10

Organization 2-11

C H A P T E R 4 Troubleshooting Problems 4-1

SOAP Message Traffic and Time Taken to Invoke an API 4-1

Custom Application Errors 4-2

Modifying the Number of Concurrent Sessions Allowed 4-3

Use Case 1: SampleWSClient A-1

Use Case 2: ActivateSuspendSfRserverClient A-5

Use Case 3: Virtual Server WS Client A-10

Use Case 4: GSSWSClient A-17

Use Case 5: ApplTemplateCreateWSClient A-23

Use Case 6: RBACManager WS Client code A-31

Use Case 7: SyncDevice WS Client code A-38

I N D E X

vAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 6: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Contents

viAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 7: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Preface

This guide describes the Cisco Application Networking Manager Web Services application program interface (API) implementation and explains how to use it to manage your network. This preface provides information about using this guide. This preface includes the following sections:

• Audience, page ix

• Organization, page ix

• Related Documentation, page x

• Conventions, page x

• Open-Source Software Included in the Cisco Application Networking Manager, page xi

• Obtaining Documentation and Submitting a Service Request, page xi

AudienceThis API guide is written for the knowledgeable application programmer who understands the basic architecture of the Cisco Application Networking Manager (ANM). This document provides detailed descriptions of Web Service APIs supported by ANM. Depending on the configuration required, readers should have specific knowledge in the following areas:

• Networking and data communications

• Network security

• Router configuration

• Datacenter products

Organization This document contains the following sections:

• Chapter 1, “Introduction to the Cisco ANM Web Services API” provides an overview of the programmable interface and the methods and schemas used to perform configuration operations using the API.

• Chapter 2, “ANM Web Services API” lists and describes the available APIs.

• Chapter 2, “Web Service Objects” lists the data types that are defined structures or objects in the ANM Web Services APIs.

ixAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 8: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Preface

• Chapter 4, “Troubleshooting Problems” lists the custom application errors.

• Appendix A, “Use Case Examples” lists the use case sample code examples.

Related DocumentationIn addition to this installation guide, the Application Networking Manager (ANM) documentation set includes the following publications. You can access the ANM documentation on www.cisco.com at: http://www.cisco.com/en/US/products/ps6904/tsd_products_support_series_home.html.

• Installation Guide for the Cisco Application Networking Manager—Includes complete installation and configuration information for the ANM software.

• Installation Guide for the Cisco Application Networking Manager Virtual Appliance—Includes complete information about ANM virtual appliance functionality, installation, configuration, and administration procedures.

• User Guide for the Cisco Application Networking Manager—Includes complete information about ANM functionality and detailed procedures for its use. Contains all of the information found in online help. Available either on cisco.com or from the ANM online help.

• Context-sensitive online help—Includes help topics for all pages in the UI (also provides access to PDFs of the user guide). Select an option from the ANM GUI, and click Help.

• Supported Devices Table for the Cisco Application Networking Manager—Includes complete supported device and firmware versions for ANM.

• Supplemental License Agreement for the Cisco Application Networking Manager—Describes licensing limitations and restrictions.

ConventionsThis document uses the following conventions:

Note Means reader take note. Notes contain helpful suggestions or references to material not covered in the publication.

Item Convention

Commands and keywords boldface font

Variables for which you supply values italic font

Displayed session and system information screen font

Information you enter boldface screen font

Variables you enter italic screen font

Menu items and button names boldface font

Choosing a menu item in paragraphs Option > Network Preferences

Choosing a menu item in tables Option > Network Preferences

xAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 9: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Preface

Caution Means reader be careful. In this situation, you might do something that could result in equipment damage or loss of data.

Open-Source Software Included in the Cisco Application Networking Manager

• The Cisco Application Networking Manager includes the following open-source software, which is covered by the Apache 2.0 license (http://www.apache.org/): Ant, Avalon Logkit, Commons, Ehcache, Jetty, Log4J, Oro, Commons_Logging, Xmlrpc.

• The Cisco Application Networking Manager includes the following open-source software, which is covered by The Legion of the Bouncy Castle (http://www.bouncycastle.org/licence.html) license: BouncyCastle.

• The Cisco Application Networking Manager includes the following open-source software, which is covered by the GNU Lesser General Public License Version 2.1 (http://www.gnu.org/licenses/lgpl.html): c3p0-0.9.0.2.jar, Enterprise DT, Jasperreports 1.2, Jcommon 1.2, Jfreechart 1.0.1.

• The Cisco Application Networking Manager includes the following open-source software, which is covered by the Mozilla Public License Version 1.1 (http://www.mozilla.org/MPL/MPL-1.1.html): Itext 1.4.

Obtaining Documentation and Submitting a Service RequestFor information on obtaining documentation, submitting a service request, and gathering additional information, see the monthly What’s New in Cisco Product Documentation, which also lists all new and revised Cisco technical documentation, at:

http://www.cisco.com/en/US/docs/general/whatsnew/whatsnew.html

Subscribe to the What’s New in Cisco Product Documentation as a Really Simple Syndication (RSS) feed and set content to be delivered directly to your desktop using a reader application. The RSS feeds are a free service and Cisco currently supports RSS version 2.0.

xiAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 10: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Preface

xiiAPI Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 11: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference GuiOL-25355-03

C H A P T E R 1

Introduction to the Cisco ANM Web Services API

This chapter describes the Cisco ANM Web Services application programming interface (API), which provides a programmable interface for system developers to integrate with customized or third-party management applications.

This chapter contains the following sections:

• ANM Web Services Overview, page 1-1

• Obtaining the Web Services Description Language File, page 1-3

• Using the ANM Web Services, page 1-2

ANM Web Services OverviewThe ANM Web Services are a Web Service implementation, which is defined by the W3C standard as a software system designed to support interoperable machine-to-machine (client and server) interaction over the network. Client and server communication follows the Simple Object Access Protocol or Service Oriented Architecture Protocol (SOAP) standard. SOAP, which exchanges XML-based messages over the network using HTTP or HTTPS, is the foundation layer of the Web Service stack. It provides a basic messaging framework that allows more abstract layers to build on. SOAP encoding wraps XML headers and tags in a SOAP envelope.

ANM is a Java application that uses Java SE 6, which is a standard with Web Services support in the form of JSR 224, Java API for XML-Based Web Services (JAX-WS) 2.0. ANM makes use of Java SE 6 Web Services support to implement its Web Services-based NBI. Java SE 6 also supports JSR 181, Web Services Metadata for the Java Platform. JSR 181 makes it possible to develop web services. Additionally, Java SE 6 makes it extremely easy to publish a Java Web Service by using javax.xml ws.Endpoint of JAX-WS.

ANM provides the following Web Services to support the operation of the devices it manages, such as the Cisco Application Control Engine:

• Operation Manager—Perform operational tasks such as:

– Log in and out of ANM.

– List objects such as virtual contexts, real servers, virtual servers, server farms, server farm real servers, VIP answers, and DNS rules.

– Activate or susupend objects.

• ApplicationTemplateManager—Perform the following tasks:

– Manage application templates used to configure ACE devices.

1-1de for Cisco Application Networking Manager 5.2.2

Page 12: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 1 Introduction to the Cisco ANM Web Services API Using the ANM Web Services

– Manage configuration checkpoints.

– Obtain specific show command output.

• RBACManager—Perform the following tasks:

– Manage user accounts

– List user accounts

– List role, domain, an organization information

For a complete list of the devices that the ANM Web Services support, see the “Required Software, Web Standards, and Supported Hardware” section on page 1-2.

Using the ANM Web Services This section describes how to use the ANM Web Services. It contains the following topics:

• Required Software, Web Standards, and Supported Hardware, page 1-2

• Enabling the Web Services Interface, page 1-3

• Obtaining the Web Services Description Language File, page 1-3

• Generating the Client Code to Invoke a Web Service, page 1-3

• Calling an ANM Web Service and Posting a SOAP Request, page 1-4

Required Software, Web Standards, and Supported HardwareANM Web Services are supported in ANM software Version 4.1 and later. The API examples in this document require the following development environment:

• Java SE 6

Note Java SE 6 is applicable only if the client code is java-based.

• WSDL Support: 1.1

• SOAP 1.1

The ANM Web Services API is supported on the following product types:

• Cisco Application Control Engine (ACE) devices as follows:

– ACE20 and ACE30 modules

– ACE 4710 appliance

• Cisco Content Services Switch (CSS)

• Cisco Content Switching Module (CSM)

• Cisco Content Switching Module with SSL (CSM-S)

• Cisco Global Site Selector (GSS)

1-2API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 13: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 1 Introduction to the Cisco ANM Web Services API Using the ANM Web Services

Enabling the Web Services InterfaceANM uses the following ports for Web Services:

• http port: 8080

• https port: 8443

After you have installed the ANM software, you can reconfigure ANM configuration properties, such as enabling HTTP(S) for Web Services. For information about enabling Web Services, see the Changing ANM Configuration Property Values section in the User Guide for the Cisco Application Networking Manager 5.2.2.

Obtaining the Web Services Description Language FileANM Web Services uses Web Services Description Language (WSDL) with SOAP and XML schemas to provide Web Services. WSDL is an XML-based service that describes the functionality offered by the Web Service and defines the actions, parameter names, input parameter data types, and return data types for the Web Service. When you connect to a Web Service through a web browser, you can read the WSDL file to determine which functions are available on the server. Any special data types that are used are embedded in the WSDL file in an XML schema. You can then call one of the functions listed in the WSDL file by sending a SOAP request message.

To obtain the WSDL file defined for a particular service in the ANM Web Services API implementation, submit a URL to the service with a ?wsdl suffix. For example, to retrieve the WSDL for the OperationManager service running on https://localhost:8443/anm/OperationManager, call the WSDL file by using the following URL: https://<host/ip>:8443/anm/OperationManager?wsdl. For more examples, see the “Generating the Client Code to Invoke a Web Service” section on page 1-3.

Generating the Client Code to Invoke a Web ServiceThis procedure shows how to generate the client source code.

Procedure

Step 1 Download the WSDL file from the server using the following WSDL URL formats:

• OperationManager WSDL:

https://<host/ip>:8443/anm/OperationManager?wsdl

or

http://<host/ip>:8080/anm/OperationManager?wsdl

• ApplicationTemplateManager WSDL:

https://<host/ip>:8443/anm/ApplicationTemplateManager?wsdl

or

http://<host/ip>:8080/anm/ApplicationTemplateManager?wsdl

• RBACManager WSDL

https://<host/ip>:8443/anm/RBACManager?wsdl

or

1-3API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 14: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 1 Introduction to the Cisco ANM Web Services API Using the ANM Web Services

http://<host/ip>:8080/anm/RBACManager?wsdl

where the host/ip value is the hostname or IP address of the ANM that has the service running.

Step 2 Save the file as either OperationManager.wsdl, ApplicationTemplateManager.wsdl, or RBACManager.wsdl, depending on which one you are downloading.

Step 3 Generate and compile the source code by using the wsimport command as follows:

wsimport -d <specify where to place generated output files> -s <specify where to place generated source files> {OperationManager.wsdl | ApplicationTemplateManager.wsdl | RBACManager.wsdl}

The above command generates the java source code from the wsdl file and then compiles it and puts the class file in the same location where the source file .wsimport file is located in the dir $JAVA_HOME/bin.

Note This step is applicable only if the client code is a java-based code.

Calling an ANM Web Service and Posting a SOAP RequestTo call a service, you connect to a particular ANM through a web browser by using a service URL that contains the IP address or hostname of the ANM and the name of the particular service (such as OperationManager). For example, https://<host/ip>:8443/anm/OperationManager?wsdl is the service URL for the OperationManager Web Service. You use the same format to call the ApplicationTemplateManager Web Service.

By default, ANM supports up to 10 concurrent sessions for Web Services (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

Next, you must post a SOAP request written in a XML format to retrieve the information. The request calls for a particular action (such as login) and the input parameter content when required. The ANM responds with a SOAP envelope that contains the answer in an XML format. The response contains the output values for this action.

Example Request The following example shows an XML-formatted SOAP request to perform the login action. There are no input parameters for this particular action.

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <login xmlns="http://anm.cisco.com"> <user xmlns="">admin</user> <password xmlns="">admin</password> </login> </SOAP-ENV:Body></SOAP-ENV:Envelope>

1-4API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 15: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 1 Introduction to the Cisco ANM Web Services API Using the ANM Web Services

Example Response The following example shows the XML response to the login request. The response contains output values such as the SessionToken.

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:loginResponse xmlns:ns2="http://anm.cisco.com"> <SessionToken xmlns=""> <sid>5546099606143734326</sid> </SessionToken> </ns2:loginResponse> </S:Body></S:Envelope>

1-5API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 16: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 1 Introduction to the Cisco ANM Web Services API Using the ANM Web Services

1-6API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 17: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference GuiOL-25355-03

C H A P T E R 2

ANM Web Services API

This chapter describes the ANM Web Services APIs, which allows you to manage the Cisco devices listed in the “Required Software, Web Standards, and Supported Hardware” section on page 1-2. ANM Web Services provide APIs to support configuration functionalities. All APIs are implemented as synchronous calls and each call is a transaction.

This chapter contains the mapping table and describes the following ANM APIs:

• Mapping Table

• OperationManager Web Service APIs

• ApplicationTemplateManager Web Service APIs

• RBACManager Web Service APIs

Mapping TableTable 2-1 displays the mapping of each API with the specified role and the domain, where

• F = Full access

• N = No access

Table 2-1 Mapping Table

API Name

Role Name

ACE-A

dmin

AN

M-A

dmin

Netw

ork-Adm

in

Netw

ork-Monitor

Org-A

dmin

Security-Adm

in

Server-Appln-M

aintenance

Server-Maintenance

SLB-A

dmin

SSL-Adm

in

SSL-Cert-Key-Adm

in

VM-M

apper

OperationManager Web Service APIs

listDeviceids N F N F F N N N N N N N

listVirtualContexts F F F F F N N N N N N N

listVirtualServers F F N F F N F F F N N N

2-1de for Cisco Application Networking Manager 5.2.2

Page 18: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API Mapping Table

listServerFarms F F N F F N F F F N N N

listRservers F F N F F N F F F N N N

listServerfarmRservers F F N F F N F F F N N N

listAnswers N F N N F N F F F N N N

listDnsRules N F N N F N F F F N N N

activateVirtualServer F F N N F N N N F N N N

suspendVirtualServer F F N N F N N N F N N N

addRserverToServerfarm F F N F F N F F F N N N

removeRserverFromServerfarm F F N N F N F N F N N N

activateServerfarmRserver F F N N F N F F F N N N

suspendServerfarmRserver F F N N F N F F F N N N

changeServerfarmRserverWeight F F N N F N F F F N N N

activateAnswer N F N N F N N F F N N N

suspendAnswer N F N N F N N F F N N N

activateDnsRule N F N N F N N F F N N N

suspendDnsRule N F N N F N N F F N N N

getVMMappingInfo N F N N F N N N N N N F

syncDevice N F F N F N N N N N N N

ApplicationTemplateManager Web Service APIs

listTemplateDefinitions F F N N F N N N N N N N

getTemplateDefinitionMetadata F F N N F N N N N N N N

createTemplateInstance F F N N F N N N N N N N

listTemplateInstances F F N N F N N N N N N N

deleteTemplateInstance F F N N F N N N N N N N

listCheckpoints F F N N F N N N N N N N

createCheckpoint F F N N F N N N N N N N

deleteCheckpoint F F N N F N N N N N N N

rollbackCheckpoint F F N N F N N N N N N N

freeFormShow F F N N F N N N N N N N

Table 2-1 Mapping Table (continued)

API Name

Role Name

ACE-A

dmin

AN

M-A

dmin

Netw

ork-Adm

in

Netw

ork-Monitor

Org-A

dmin

Security-Adm

in

Server-Appln-M

aintenance

Server-Maintenance

SLB-A

dmin

SSL-Adm

in

SSL-Cert-Key-Adm

in

VM-M

apper

2-2API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 19: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

OperationManager Web Service APIsThis section describes the APIs associated with the OperationManager Web Service, which are as follows:

• login

• logout

• listDeviceids

• listVirtualContexts

• listVirtualServers

• listServerFarms

• listRservers

• listServerfarmRservers

• listAnswers

• listDnsRules

• activateVirtualServer

• suspendVirtualServer

• addRserverToServerfarm

• removeRserverFromServerfarm

• activateServerfarmRserver

RBACManager Web Service APIs

createUsers N F N N F N N N N N N N

updateUsers N F N N F N N N N N N N

listUsers N F N N F N N N N N N N

deleteUsers N F N N F N N N N N N N

listRoles N F N N F N N N N N N N

listDomainNames N F N N F N N N N N N N

listDomains N F N N F N N N N N N N

listOrganizations N F N N F N N N N N N N

Table 2-1 Mapping Table (continued)

API Name

Role Name

ACE-A

dmin

AN

M-A

dmin

Netw

ork-Adm

in

Netw

ork-Monitor

Org-A

dmin

Security-Adm

in

Server-Appln-M

aintenance

Server-Maintenance

SLB-A

dmin

SSL-Adm

in

SSL-Cert-Key-Adm

in

VM-M

apper

2-3API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 20: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

• suspendServerfarmRserver

• changeServerfarmRserverWeight

• activateAnswer

• suspendAnswer

• activateDnsRule

• suspendDnsRule

• getVMMappingInfo

• syncDevice

2-4API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 21: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

loginThis request logs in an application user to ANM. The login API validates the credentials and returns a session token. The session times out after being idle for 30 minutes even if the logout is not called.By default, ANM allows 10 concurrent API logins, but you can modify this number (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the login action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <login xmlns="http://anm.cisco.com"> <user xmlns="">admin</user> <password xmlns="">admin</password> </login> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope

Parameter Description

Username Username of the application user.

Password Password of the application user.

Parameter Description

SessionToken Session key of the application user.

Type Exception String

String Maximum session limit configured_limit reached for WS.

Note The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Invalid username or password. Please try again.

String Session ID is in use. Please try again later.

String Username cannot be null.

String Password cannot be null.

2-5API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 22: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:loginResponse xmlns:ns2="http://anm.cisco.com"> <SessionToken xmlns=""> <sid>5546099606143734326</sid> </SessionToken> </ns2:loginResponse> </S:Body>

</S:Envelope>

2-6API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 23: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

logout This request logs out an application user from the ANM. The session times out after being idle for 30 minutes even if the logout is not called. In case of a session timeout, the following exception string is generated: Invalid Session Id.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the logout action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <logout xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-6055365969690519291</sid> </sessionToken> </logout> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:logoutResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

Parameter Description

sessionToken Session key of the application user.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

2-7API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 24: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listDeviceidsThis request lists all device IDs for a device type from the ANM inventory. If none of the devices is imported in ANM, it returns an empty list.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listDeviceids action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:listDeviceIds xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>1861222974238016825</sid> </sessionToken> <deviceType>VIRTUAL_CONTEXT</deviceType> </ns2:listDeviceIds> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains DeviceID as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><ns2:listDeviceIdsResponse xmlns:ns2="http://anm.cisco.com"> <DeviceIDs> <item> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> <item> <name>Dora</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item>

Parameter Description

sessionToken Session key of the application user.

deviceType List of device types including the device name and status. For example, CSS, CSM, CAT6K, GSS, VIRTUAL_CONTEXT, ACE4710, and ACE_BLADE.

Parameter Description

DeviceIDs List of device IDs including the device name, device type, IP address, slot, and chassis IP address attributes.

Type Exception String

String Invalid Session ID.

String Unsupported Device Type: device_type.

String Device Type should not be null.

2-8API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 25: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<item> <name>new</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> <item> <name>rajan</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> <item> <name>sab</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> <item> <name>san</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> <item> <name>test-context</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.47</ipAddr> </item> </DeviceIDs></ns2:listDeviceIdsResponse>

2-9API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 26: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listVirtualContextsThis request lists all the virtual contexts for an Application Control Engine (ACE) module or ACE appliance from the ANM inventory.

This API is supported only on ACE modules and appliances (device type: ACE_BLADE and ACE4710).

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID ACE module: Device ID includes the device type, slot, and chassis IP address attributes.

ACE appliance: Device ID includes the device type, IP address, and name attributes.

Parameter Description

DeviceIDs List of virtual context device IDs including the device type, IP address, slot, and chassis IP address attributes.

Type Exception String

String Invalid Session ID.

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as ACE_BLADE, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as ACE4710, but the mandatory field “ipAddr” is set as null or empty.

String Invalid IP Address: IPaddress.

String DeviceType is set as ACE_BLADE, but the mandatory field “slot” is set as null or empty.

2-10API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 27: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the listVirtualContexts action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listVirtualContexts xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-81548021995146358</sid> </sessionToken> <deviceIDs xmlns=""> <deviceType>ACE_BLADE</deviceType> <slot>3</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceIDs> </listVirtualContexts> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains the list of virtual context DeviceIDs as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listVirtualContextsResponse xmlns:ns2="http://anm.cisco.com"> <DeviceIDs xmlns=""> <item> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <slot>3</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </item> <item> <name>VC1</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <slot>3</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </item> </DeviceIDs> </ns2:listVirtualContextsResponse> </S:Body></S:Envelope>

2-11API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 28: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listVirtualServersThis request lists all the virtual servers configured on the specified device. The device can be a CSS, CSM, or a virtual context (VIRTUAL_CONTEXT) on an ACE module or ACE appliance.

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context DeviceID, which contains the virtual server name, device type, IP address, chassis slot, and chassis IP address attributes.

allVSs (Optional) Input parameter that instructs ANM to return a list of all virtual servers that match ANM’s virtual server definition and those that do not match this definition but that ANM can recognize as virtual servers using SNMP polling. By default, ANM returns only the virtual servers that match ANM’s virtual server definition.

Parameter Description

vservers List of all virtual servers including the virtual server name, policy-map name, and IP address attributes.

Type Exception String

String Invalid Session ID.

String Maximum session limit configured_limit reached for WS.

Note The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

2-12API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 29: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the listVirtualServers action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listVirtualServers xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>7299761084673772498</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr/> <slot>2</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceID> <allVS xmlns="">false</allVS> </listVirtualServers> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains the list of virtual servers as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listVirtualServersResponse xmlns:ns2="http://anm.cisco.com"> <listVirtualServers xmlns=""> <item> <virtualserverName>14_simple_vs</virtualserverName> <policyMapName>int2</policyMapName> <matchConditions> <ipAddress>15.5.3.2</ipAddress> <protocol>tcp</protocol> <port>2</port>

String Invalid IP Address: IPaddress.

String Given virtual context name “[VC name]” does not exist in the ACE Devices.

String DeviceType is set as CSS, but the mandatory field “ipAddr” is set as null or empty.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “chassisIPAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “slot” is set as null or empty.

2-13API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 30: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

</matchConditions> <serverfarms>14_simple_sf</serverfarms> <vlans>2</vlans> <adminState>DOWN</adminState> <operState>DOWN</operState> <lastPolledTime>Fri May 27 16:52:31 IST 2011</lastPolledTime> </item> <item> <virtualserverName>ds_simple_vs</virtualserverName> <policyMapName>int161</policyMapName> <matchConditions> <ipAddress>13.3.3.3</ipAddress> <protocol>tcp</protocol> <port>6</port> </matchConditions> <serverfarms>ds_simple_sf</serverfarms> <vlans>161</vlans> <adminState>DOWN</adminState> <operState>DOWN</operState> <lastPolledTime>Fri May 27 16:52:31 IST 2011</lastPolledTime> </item> <item> <virtualserverName>test</virtualserverName> <policyMapName>global</policyMapName> <matchConditions> <ipAddress>4.5.6.7</ipAddress> <protocol>tcp</protocol> <port>443</port> </matchConditions> <serverfarms>gh</serverfarms> <vlans/> <adminState>UP</adminState> <operState>DOWN</operState> <lastPolledTime>Fri May 27 16:52:31 IST 2011</lastPolledTime> </item> </listVirtualServers> </ns2:listVirtualServersResponse> </S:Body></S:Envelope>

2-14API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 31: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listServerFarmsThis request lists all server farms on a virtual context from the ANM inventory. This API is supported only on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listServerFarms action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

Parameter Description

Serverfarms List of server farm objects including the name and type (host or redirect) attributes.

Type Exception String

String Invalid Session ID.

String Maximum session limit [configured_limit] reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String Given virtual context name VC_name does not exist in the ACE Devices.

2-15API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 32: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listServerFarms xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>8368662778638735743</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> </listServerFarms> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains the list of Serverfarm objects as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listServerFarmsResponse xmlns:ns2="http://anm.cisco.com"> <serverfarms xmlns=""> <item> <name>SF1</name> <serverFarmType>host</serverFarmType> </item> <item> <name>SF2</name> <serverFarmType>host</serverFarmType> </item> </serverfarms> </ns2:listServerFarmsResponse> </S:Body></S:Envelope>

2-16API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 33: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listRserversThis request lists all the real servers on a virtual context from the ANM inventory. This API is supported only on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listRservers action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

Parameter Description

Rservers List of real server objects including the name, IP address, admin state, and weight attributes.

Type Exception String

String Invalid Session ID.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given ACE module is not yet imported in ANM.

String Given ACE appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String Given virtual context name VC_name does not exist in the ACE devices.

2-17API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 34: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listRservers xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>8368662778638735743</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> </listRservers> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains the list of real server objects as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listRserversResponse xmlns:ns2="http://anm.cisco.com"> <Rservers xmlns=""> <item> <name>RS1</name> <type>host</type> <state>IS</state> <weight>8</weight> </item> <item> <name>RS2</name> <type>redirect</type> <state>IS</state> </item> </Rservers> </ns2:listRserversResponse> </S:Body></S:Envelope>

2-18API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 35: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listServerfarmRserversThis request lists all the real servers present in the given server farm from the ANM inventory. If the server farm name is provided as empty or null in the input parameters, it lists all the real server objects in the given virtual context. This API is supported on CSS, CSM, and ACE devices (device type: CSS, CSM, and VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Device ID of the virtual context including the device name, device type, IP address, slot and chassis IP address attributes.

serverfarmname Name of an existing server farm. It can be empty, null, or a specific server farm configured in the device.

Parameter Description

SfRservers List of server farm real server objects including server farm name, server farm real server name, IP address, admin state, weight, and port value attributes.

Type Exception String

String Invalid session ID.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given ACE module is not yet imported in ANM.

String Given ACE appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String Given virtual context name VC_name does not exist in the ACE Devices.

2-19API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 36: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the listServerfarmRservers action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listServerfarmRservers xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-2221649013806878130</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <serverfarmname xmlns="">SF1</serverfarmname> </listServerfarmRservers> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains SfRserver as the output parameter:

<S:Envelopexmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:listServerfarmRserversResponsexmlns:ns2="http://anm.cisco.com"><SfRservers xmlns=""><item><serverfarmName>SF1</serverfarmName><realserverName>04122009sanitytesting</realserverName><adminState>IS</adminState><operationState>UP</operationState><weight>8</weight><port>0</port><lastPolledTime>Wed Jun 08 20:53:18 IST 2011</lastPolledTime></item><item><serverfarmName>1</serverfarmName><realserverName>anm-vm-118</realserverName><adminState>IS</adminState>

String DeviceType is set as CSS, but the mandatory field “ipAddr” is set as null or empty.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “chassisIPAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “slot” is set as null or empty.

2-20API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 37: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<weight>19</weight><port>0</port></item><item><serverfarmName>SF1</serverfarmName><realserverName>test</realserverName><adminState>OOS</adminState><operationState>UP</operationState><weight>8</weight><port>443</port><ipAddr>10.2.1.11</ipAddr><lastPolledTime>Wed Jun 08 20:53:18 IST 2011</lastPolledTime></item></SfRservers></ns2:listServerfarmRserversResponse></S:Body></S:Envelope>

2-21API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 38: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listAnswersThis request lists all the VIP answers configured on the specified given GSS.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listAnswers action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listAnswers xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>7299761084673772498</sid> </sessionToken> <deviceID xmlns=""> <name>GSS</name> <deviceType>GSS</deviceType> <ipAddr>172.23.244.135</ipAddr> <slot>0</slot> <chassisIPAddr/> </deviceID> </listAnswers> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains answers as the output parameter:

<?xml version="1.0" encoding="UTF-8"?>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, which contains the GSS name, device type, and IP address attributes.

Parameter Description

answers List of answer objects, including the answer name, IP address, configuration state, and type attributes. The type attribute is always “vip.”

Type Exception String

String Invalid session token.

String GSS does not exist.

String Session timeout.

String Cannot reach the GSS.

2-22API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 39: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listAnswersResponse xmlns:ns2="http://anm.cisco.com"> <Answers xmlns=""> <item> <ipAddr>10.10.9.99</ipAddr> <answerName>vip2131</answerName> <type>null</type> <configState>ACTIVATE</configState> <anserGroups>vipgrp1066</anserGroups> <location>null</location>

<device>GSS</device> <operState>ACTIVE</operState> <pGssmTime>17:50:19</pGssmTime> </item> </DeviceIDs> </ns2:listAnswersResponse> </S:Body></S:Envelope>

2-23API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 40: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

listDnsRulesThis request lists all the DNS rules configured on the specified given GSS.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listDnsRules action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listDnsRules xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>6600024266770332702</sid> </sessionToken> <deviceID xmlns=""> <name>40</name> <deviceType>GSS</deviceType> <ipAddr>10.77.241.40</ipAddr> </deviceID> </listDnsRules> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains dnsRules as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, which contains the GSS name, device type, and IP address attributes.

Parameter Description

dnsRules List of DNS rule objects, including the DNS rule name, source IP address, owner, and configuration state attributes.

Type Exception String

String Invalid session token.

String GSS does not exist.

String Session timeout.

String Cannot reach the GSS.

2-24API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 41: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<ns2:listDnsRulesResponse xmlns:ns2="http://anm.cisco.com"> <listDnsRules xmlns=""> <item> <dnsRuleName>dns1</dnsRuleName> <sourceAddress>Anywhere</sourceAddress> <domains>dom1</domains> <dnsConfigState>Active</dnsConfigState> <answerGroups>null</answerGroups> <owner>System</owner> </item> </listDnsRules> </ns2:listDnsRulesResponse> </S:Body></S:Envelope>

2-25API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 42: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

activateVirtualServerThis request activates an existing virtual server, putting it into service. This API is supported on CSS, CSM, and virtual contexts (VIRTUAL_CONTEXT) on ACE modules and appliances.

Note For CSS and CSM devices, after changing the state, SNMP polling is triggered. The API does not return until the polling is complete.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the activateVirtualServer action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <activateVirtualServer xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>2713248117084982682</sid> </sessionToken> <deviceID xmlns=""> <name>SysTestApp</name>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual server device ID, including the device name, device type, IP address, slot, and chassis IP address attributes.

vServer Virtual server object, including the virtual server name, policy-map name, and IP address attributes.

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Virtual context does not exist.

String Session timeout.

String Cannot reach the virtual context.

String Virtual server does not exist.

String Config errors from the ACE, CSS, or CSM.

2-26API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 43: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<deviceType>VIRTUAL_CONTEXT</deviceType> <slot>2</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceID> <vserver xmlns=""> <virtualserverName>12_simple_vs</virtualserverName> <policyMapName>NAT_Policy</policyMapName> </vserver> <reason xmlns="">testing</reason> </activateVirtualServer> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelopexmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:activateVirtualServerResponse xmlns:ns2="http://anm.cisco.com"/></S:Body></S:Envelope>

2-27API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 44: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

suspendVirtualServerThis request suspends an existing virtual server, putting it out of service. This API is supported on CSS, CSM, and virtual contexts (VIRTUAL_CONTEXT) on ACE modules and appliances.

Note For CSS and CSM devices, after changing the state, SNMP polling is triggered. The API does not return until the polling is complete.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the suspendVirtualServer action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <suspendVirtualServer xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>2713248117084982688</sid> </sessionToken> <deviceID xmlns=""> <name>SysTestApp</name>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual server device ID, including the device name, device type, IP address, slot, and chassis IP address attributes.

vServer Virtual server object, including the virtual server name, policy-map name, and IP address attributes.

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Virtual context does not exist.

String Session timeout.

String Cannot reach the virtual context.

String Virtual server does not exist.

String Config errors from the ACE, CSS, or CSM.

2-28API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 45: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr/> <slot>2</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceID> <vserver xmlns=""> <virtualserverName>12_simple_vs</virtualserverName> <policyMapName>NAT_Policy</policyMapName> </vserver> <reason xmlns="">test</reason> </suspendVirtualServer> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelopexmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:suspendVirtualServerResponse xmlns:ns2="http://anm.cisco.com"/></S:Body></S:Envelope>

2-29API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 46: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

addRserverToServerfarmThis request adds a real server to an existing server farm. If it does not find the real server, it creates a real server and adds it to the server farm. This API is supported on ACE devices (device type: ‘VIRTUAL_CONTEXT’).

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Device ID of the virtual context including the device name, device type, IP address, slot and chassis IP address attributes.

rserver Real server object including name, IP address, admin state, and weight attributes.

port Port of the server farm real server.

serverfarm Name of an existing server farm.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

String Given ACE module is not yet imported in ANM.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String Given virtual context name VC_name does not exist in the ACE Devices.

String Given ACE Appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in device ID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr'” are added in device ID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

2-30API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 47: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the addRserverToServerfarm action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <addRserverToServerfarm xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>5731694438459731003</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <serverfarmname xmlns="">SF1</serverfarmname>

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Server Farm name should not be null or empty.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given Name: ServerFarm_name exceeds the maximum length of 64 characters.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Invalid weight value: weight_value. Weight value should be numeric.

String Invalid weight value: weight_value. Weight value is outside the range <0-100>.

String Invalid Name: ServerFarm_name. Name should match the format [^a-zA-Z0-9._-].

String Invalid Name: RealServer_name. Name should match the format [^a-zA-Z0-9._-].

String Invalid Name: ServerFarm_name. Name should not hold any reserved keywords.

String Invalid Name: RealServer_name. Name should not hold any reserved keywords.

String IP address must be provided for the Real Server.

String Given Real Server type RealServer_type is not associated with Server Farm type Server Farm_type.

String Real Server RealServer_name/ Port_value already exist in the Server Farm ServerFarm_name.

2-31API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 48: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<rserver xmlns=""> <name>sampletest</name> <type>host</type> <ipAddr>2.3.6.53</ipAddr> <state>IS</state> <weight>34</weight> </rserver> <port xmlns="">0</port> </addRserverToServerfarm> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:addRserverToServerfarmResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-32API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 49: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

removeRserverFromServerfarmThis request removes an existing server farm real server from a server farm. It removes the real server, if there is no server farm real server reference to the real server. This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

sfRserver Server farm real server object including the server farm name, real server name, IP address, admin state, weight, and port attributes.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Device Type should be not null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be not null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String Given virtual context name VC_name does not exist in the ACE Devices.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

2-33API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 50: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the removeRserverFromServerfarm action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <removeRserverFromServerfarm xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-81548021995146358</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <rserver xmlns=""> <serverfarmName>SF1</serverfarmName> <realserverName>sampletest</realserverName> <adminState>IS</adminState> <weight>0</weight> <port>0</port> <ipAddr>2.3.6.53</ipAddr> </rserver>

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Server Farm name should not be null or empty.

String Given Name : ServerFarm_name exceeds the maximum length of 64 characters.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Invalid weight value: weight_value. Weight value should be numeric.

String Invalid weight value: weight_value. Weight value is outside the range <0-100>.

String Invalid Name: ServerFarm_name. Name should match the format [^a-zA-Z0-9._-].

String Invalid Name: RealServer_name. Name should match the format [^a-zA-Z0-9._-].

String Invalid Name: ServerFarm_name. Name should not hold any reserved keywords.

String Invalid Name: RealServer_name. Name should not hold any reserved keywords.

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Given Real Server RealServer_name/ port_number does not exist in the Server Farm ServerFarm_name.

2-34API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 51: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

</removeRserverFromServerfarm> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:removeRserverFromServerfarmResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-35API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 52: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

activateServerfarmRserverThis request activates an existing server farm real server in service. This API is supported on CSS, CSM, and ACE devices (device type: CSS, CSM and VIRTUAL_CONTEXT).

Note For CSS and CSM devices, after changing the state, SNMP polling is triggered. The API does not return until the polling is complete.

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

sfRserver Server farm real server object including the server farm name, real server name, IP address, admin state, weight and port attributes

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

String Server Farm name cannot be null.

String Maximum session limit [configured_limit] reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given Server farm Real Server name cannot be null.

String Given Real Server state cannot be null.

String Given Real server weight cannot be null.

String Server Farm Real server port value should not be null.

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String Given Cat6k does not exist in ANM.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Given CSM does not exist in the chassis: Chassis_IPaddress.

String Given CSS does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Device Type should be null.

2-36API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 53: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the activateServerfarmRserver action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <activateServerfarmRserver xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-5217915770163489503</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name>

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: “IP address.”

String DeviceType is set as CSS, but the mandatory field “ipAddr” is set as null or empty.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “chassisIPAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “slot” is set as null or empty.

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Given Name: ServerFarm_name exceeds the maximum length of 64 characters.

String Given Name:ServerFarm_name exceeds the maximum length of 15 characters.

String Given Name: ServerFarm_name exceeds the maximum length of 31 characters.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Given Real Server RealServer_name/port_number does not exist in the Server Farm ServerFarm_name.

2-37API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 54: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <rserver xmlns=""> <serverfarmName>SF1</serverfarmName> <realserverName>test</realserverName> <adminState>OOS</adminState> <weight>44</weight> <port>443</port> <ipAddr>10.2.1.11</ipAddr> </rserver> <reason xmlns="">sample Webservices testing</reason> </activateServerfarmRserver> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:activateServerfarmRserverResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-38API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 55: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

suspendServerfarmRserverThis request suspends the existing server farm real server. This API is supported on CSS, CSM, and ACE devices (device type: CSS, CSM and VIRTUAL_CONTEXT).

Note For CSS and CSM devices, after changing the state, SNMP polling is triggered. The API does not return until the polling is complete.

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

sfRserver Server farm real server object including the server farm name, real server name, IP address, admin state, weight and port attributes

state List of options supported are Graceful, Suspend, Suspend_Clear_Connections.

reason Reason for suspension.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

String Server Farm name cannot be null.

String Given Server farm Real Server name cannot be null.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given Real Server state cannot be null.

String Given Real server weight cannot be null.

String Server Farm Real server port value should not be null.

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String Given Cat6k does not exist in ANM.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Given CSM does not exist in the chassis: Chassis_IPaddress.

String Given CSS does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

2-39API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 56: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the suspendServerfarmRserver action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <suspendServerfarmRserver xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>2658073681808034239</sid> </sessionToken>

String Device Type should be null.

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: IPaddress.

String DeviceType is set as CSS, but the mandatory field “ipAddr” is set as null or empty.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “chassisIPAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “slot” is set as null or empty.

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Given Name: ServerFarm_name exceeds the maximum length of 64 characters.

String Given Name: ServerFarm_name exceeds the maximum length of 15 characters.

String Given Name: ServerFarm_name exceeds the maximum length of 31 characters.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Given Real Server RealServer_name/port_number does not exist in the Server Farm ServerFarm_name.

String Invalid suspend state: suspend_state.

2-40API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 57: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <rserver xmlns=""> <serverfarmName>SF1</serverfarmName> <realserverName>test</realserverName> <adminState>IS</adminState> <weight>44</weight> <port>443</port> <ipAddr>10.2.1.11</ipAddr> </rserver> <suspendState xmlns="">Suspend</suspendState> <reason xmlns=""/> </suspendServerfarmRserver> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:suspendServerfarmRserverResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-41API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 58: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

changeServerfarmRserverWeightThis request changes the weight of an existing server farm real server. This API is supported on CSS, CSM, and ACE devices (device type: CSS, CSM, and VIRTUAL_CONTEXT).

Note For CSS & CSM devices, after changing the weight, SNMP polling is triggered. The API does not return until the polling is complete.

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context device ID including the device name, device type, IP address, slot, and chassis IP address attributes.

sfRserver Server farm real server object including the server farm name, real server name, IP address, admin state, weight and port attributes.

reason Reason for the operation.

Parameter Description

None None.

Type Exception String

String Invalid Session ID.

String Server Farm name cannot be null.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String Given Server farm Real Server name cannot be null.

String Given Real Server state cannot be null.

String Given Real server weight cannot be null.

String Server Farm Real server port value should not be null.

String Given ACE module is not yet imported in ANM.

String Given ACE Appliance does not exist in ANM.

String Given Cat6k does not exist in ANM.

String Given ACE module does not exist in the chassis: Chassis_IPaddress.

String Given CSM does not exist in the chassis: Chassis_IPaddress.

String Given CSS does not exist in ANM.

String None of the devices are imported.

String Unsupported Device Type: device_type.

String Device Type should be null.

2-42API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 59: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the changeServerfarmRserverWeight action:

String “chassisIPAddr” and “ipAddr” are not added in deviceID. Either should be provided.

String Both “chassisIPAddr” and “ipAddr” are added in deviceID. Only one of them can be added.

String DeviceID should not be null.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “slot” is set as null or empty.

String DeviceType is set as VIRTUALCONTEXT, but the mandatory field “name” is set as null or empty.

String Invalid IP Address: “Ip address.”

String DeviceType is set as CSS, but the mandatory field “ipAddr” is set as null or empty.

String DeviceType is set as VIRTUAL_CONTEXT, but the mandatory field “ipAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “chassisIPAddr” is set as null or empty.

String Device Type is set as CSM, but the mandatory field “slot” is set as null or empty.

String Given Server Farm ServerFarm_name is not available in the given Virtual Context.

String Given Name: ServerFarm_name exceeds the maximum length of 64 characters.

String Given Name: ServerFarm_name exceeds the maximum length of 15 characters

String Given Name : ServerFarm_name exceeds the maximum length of 31 characters.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Given Real Server RealServer_name/port_number does not exist in the Server Farm ServerFarm_name.

String Invalid Port: port_number. Port number should be numeric.

String Invalid port value: port_number. Port value is outside the range <0-65535>.

String Given Real Server RealServer_name/port_number does not exist in the Server Farm ServerFarm_name.

String Invalid weight value: weight_value. Weight value is outside the range <1-100> [ace module, ace appliance].

String Invalid weight value: weight_value. Weight value is outside the range <0-100> [csm].

String Invalid weight value: weight_value. Weight value is outside the range <0-10> [css].

2-43API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 60: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <changeServerfarmRserverWeight xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-5217915770163489503</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <rserver xmlns=""> <serverfarmName>SF1</serverfarmName> <realserverName>test</realserverName> <adminState>OOS</adminState> <weight>44</weight> <port>443</port> <ipAddr>10.2.1.11</ipAddr> </rserver> <reason xmlns=""/> </changeServerfarmRserverWeight> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:changeServerfarmRserverWeightResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-44API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 61: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

activateAnswerThis request activates an existing answer on the specified GSS, putting the answer into service.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the activateAnswer action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SOAP-ENV:Body> <activateAnswer

xmlns="http://anm.cisco.com"><sessionToken

xmlns=""><sid>1861222974238016825</sid>

</sessionToken> <deviceID

xmlns=""> <name>172.23.244.135</name> <deviceType>GSS</deviceType> <ipAddr>172.23.244.135</ipAddr> </deviceID> <answer

xmlns=""><ipAddr>1.2.3.2</ipAddr><answerName>answer1</answerName><type>vip</type>

</answer>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, including the device name, device type, and IP address attributes.

answer Answer object, including the answer name, IP address, and type attributes. The type is always “vip.”

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Session timeout.

String Cannot reach the GSS.

String GSS does not exist.

String Config errors from the GSS.

2-45API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 62: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<reasonxmlns="">test</reason>

</activateAnswer> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:activateAnswerResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-46API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 63: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

suspendAnswerThis request suspends an existing answer on the specified GSS, putting the answer out of service.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the suspendAnswer action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <suspendAnswer xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>1861222974238016825</sid> </sessionToken> <deviceID xmlns=""> <name>172.23.244.135</name> <deviceType>GSS</deviceType> <ipAddr>172.23.244.135</ipAddr> </deviceID> <answer xmlns=""> <ipAddr>1.2.3.2</ipAddr> <answerName>answer1</answerName> <type>vip</type> </answer> <reason xmlns="">test</reason> </suspendAnswer> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, including the device name, device type, and IP address attributes.

answer Answer object, including the answer name, IP address, and type attributes. The type is always “vip.”

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Session timeout.

String Cannot reach the GSS.

String GSS does not exist.

String Config errors from the GSS.

2-47API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 64: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:suspendAnswerResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-48API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 65: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

activateDnsRuleThis request activates an existing DNS rule on the specified GSS, putting the DNS rule into service.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the activateDnsRule action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <activateDnsRule xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>6195441786283682375</sid> </sessionToken> <deviceID xmlns=""> <name>172.23.244.135</name> <deviceType>GSS</deviceType> <ipAddr>172.23.244.135</ipAddr> </deviceID> <dnsrule xmlns=""> <dnsRuleName>dns1</dnsRuleName> <sourceAddress>Anywhere</sourceAddress> </dnsrule> <reason xmlns="">test</reason>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, including the device name, device type, and IP address attributes.

dnsRule DNS rule object, including the DNS rule name, source IP address, owner, and configuration state attributes.

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Session timeout.

String Cannot reach the GSS.

String GSS does not exist.

String Config errors from the GSS.

2-49API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 66: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

</activateDnsRule> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:activateDnsRuleResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-50API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 67: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

suspendDnsRuleThis request suspend an existing DNS rule on the specified GSS, putting the DNS rule out of service.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the suspendDnsRule action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <suspendDnsRule xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>6195441786283682370</sid> </sessionToken> <deviceID xmlns=""> <name>172.23.244.135</name> <deviceType>GSS</deviceType> <ipAddr>172.23.244.135</ipAddr> </deviceID> <dnsrule xmlns=""> <dnsRuleName>dns1</dnsRuleName> <sourceAddress>Anywhere</sourceAddress> </dnsrule> <reason xmlns="">test</reason>

Parameter Description

sessionToken Session key of the application user.

deviceID GSS device ID, including the device name, device type, and IP address attributes.

dnsRule DNS rule object, including the DNS rule name, source IP address, owner, and configuration state attributes.

reason Reason for the activation.

Parameter Description

None None.

Type Exception String

String Invalid session token.

String Session timeout.

String Cannot reach the GSS.

String GSS does not exist.

String Config errors from the GSS.

2-51API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 68: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

</suspendDnsRule> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that has no output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:suspendDnsRuleResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-52API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 69: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

getVMMappingInfoThis request returns all the server farm real server mapping information for a given VM. This API is supported on CSS, CSM, and ACE devices (device type: CSS, CSM, and VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the getVMMappingInfo action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <getVMMappingInfo xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>1861222974238016825</sid> </sessionToken> <vmname xmlns="">/vcenter/Chennai/vm/anm-lnx-134</vmname> </getVMMappingInfo> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains the list of VMMappingInfo objects as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">

Parameter Description

sessionToken Session key of the application user.

vmname Unique name of the VM. The format is “/<Vcenter Name given in ANM>/<full path for vmname as in the Vcenter>/<VM name>”.

Parameter Description

VMMappingInfos Object attributes including the device ID, server farm name, server farm real server name, IP address, and port attributes.

Type Exception String

String Invalid session ID.

String Maximum session limit configured_limit reached for WS.

The default is 10 (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

String None of the vCenter is imported in ANM.

String Given VM VM_name does not exist.

String Unable to get DeviceId for device_id.

String Vmname should not be null.

2-53API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 70: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

<S:Body> <ns2:getVMMappingInfoResponse xmlns:ns2="http://anm.cisco.com"> <VMMappingInfos xmlns=""> <item> <deviceID> <deviceType>CSS</deviceType> <ipAddr>172.23.244.250</ipAddr> </deviceID> <sfname>myReal8</sfname> <sfrsname>myReal8</sfrsname> <port>0</port> <ipaddr>0.0.0.0</ipaddr> </item> <item> <deviceID> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <slot>4</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceID> <sfname>WEB-SF</sfname> <sfrsname>webservicesample</sfrsname> <port>0</port> <ipaddr>3.3.3.4</ipaddr> </item> <item> <deviceID> <deviceType>CSM</deviceType> <slot>4</slot> <chassisIPAddr>172.23.244.130</chassisIPAddr> </deviceID> <sfname>FOO2</sfname> <sfrsname>RS1</sfrsname> <port>0</port> <ipaddr/> </item> <item> <deviceID> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.241.46</ipAddr> </deviceID> <sfname>tst_sf_dup</sfname> <sfrsname>testing_dup</sfrsname> <port>0</port> </item> </VMMappingInfos> </ns2:getVMMappingInfoResponse> </S:Body></S:Envelope>

2-54API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 71: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API OperationManager Web Service APIs

syncDeviceThis API synchronizes the configuration of a specified device with ANM when there have been changes to the device that ANM does not track.

This API is supported on the following device types: ACE, Catalyst 6500 Series Switches, CSM, CSS, GSS, and VMware vCenter.

Note While accessing syncDevice from the soapUI tool, you must configure the socket timeout value as 900000 millisecs. By default, the socket timeout value is not configured.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the syncDevice action for an ACE:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:syncDevice xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>5414670344217132208</sid> </sessionToken> <deviceId> <deviceType>ACE4710</deviceType> <ipAddr>10.77.247.20</ipAddr> </deviceId> </ns2:syncDevice> </S:Body></S:Envelope>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

String Internal error: command parse error.

2-55API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 72: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

Example Response The following example shows the XML response:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:syncDeviceResponse xmlns:ns2="http://anm.cisco.com" /> </S:Body></S:Envelope>

ApplicationTemplateManager Web Service APIsThis section describes the APIs associated with the ApplicationTemplateManager Web Service, which are as follows:

• listTemplateDefinitions

• getTemplateDefinitionMetadata

• createTemplateInstance

• listTemplateInstances

• deleteTemplateInstance

• listCheckpoints

• createCheckpoint

• deleteCheckpoint

• rollbackCheckpoint

• freeFormShow

listTemplateDefinitionsThis API lists all the available ANM templates, including both ANM-defined templates (or system templates) and user-defined templates. Template definitions include the template name, description, application, application version, and so forth.

Input Parameters

Output Parameters

Exceptions

Parameter Description

sessionToken Session key of the application user.

Parameter Description

templateDefinitionArray List of template definitions.

Type Exception String

String Invalid session ID.

String Session timeout.

2-56API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 73: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

Example Request The following example shows an XML-formatted SOAP request to perform the listTemplateDefinitions action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:listTemplateDefinitions xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>-4754037077725100881</sid> </sessionToken> </ns2:listTemplateDefinitions> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains the list of templateDefinitions objects as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listTemplateDefinitionsResponse xmlns:ns2="http://anm.cisco.com"> <templateDefinitions> <item> <id>1</id> <name>FTP</name> <description>FTP LB</description> <application>FTP</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>10</id> <name>Java Application Server</name> <description>HTTP server, Java Servlet and JSP technologies, ie Apache Tomcat</description> <application>Java Application Server</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>11</id> <name>Basic HTTP</name> <description>Basic L4 LB for HTTP</description> <application>Basic HTTP</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>2</id> <name>Layer 3 LB</name> <description>Simple L3 all ports no mapping</description>

2-57API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 74: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<application>Layer 3 LB</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>3</id> <name>Secure Webserver</name> <description>Generic Secure Webserver with redirect</description> <application>Secure Webserver</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>4</id> <name>Microsoft Exchange 2010</name> <description>MS Exchange Template</description> <application>Microsoft Exchange 2010</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>5</id> <name>DWS with Nexus 7000 OTV</name> <description>Dynamic Workload Scaling with Nexus 7000 OTV for Basic LB with HTTP or Secure Webserver</description> <application>DWS with Nexus 7000 OTV</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>6</id> <name>RDP</name> <description>Remote Desktop Protocol</description> <application>RDP</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>7</id> <name>Microsoft SharePoint 2010</name> <description>Microsoft SharePoint Template</description> <application>Microsoft SharePoint 2010</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item>

2-58API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 75: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<id>8</id> <name>Layer 4 LB</name> <description>Simple L4 LB</description> <application>Layer 4 LB</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> <item> <id>9</id> <name>DNS</name> <description>DNS LB</description> <application>DNS</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </item> </templateDefinitions> </ns2:listTemplateDefinitionsResponse> </S:Body></S:Envelope>

2-59API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 76: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

getTemplateDefinitionMetadataThis API takes an available ANM template definition and returns an array of template input objects, which contain the template name, default value, userData, hasChild, and the childElements details. The names are the variable names defined in the template definition file.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the getTemplateDefinitionMetadata action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:getTemplateDefinitionMetadata xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>-986099040932183901</sid> </sessionToken> <templateDefinition> <id>7</id> <name>Microsoft SharePoint 2010</name> <description>Microsoft SharePoint Template</description> <application>Microsoft SharePoint 2010</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </templateDefinition> </ns2:getTemplateDefinitionMetadata> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains the list of TemplateDefinitionMetadata objects as the output parameter:

Parameter Description

sessionToken Session key of the application user.

templateDefinition Template definition, which includes the template name, description, application, application version, and so forth. To retrieve a list of available template definitions, use the listTemplateDefinitions API.

Parameter Description

templateInputArray Array of TemplateInput objects.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid template definition.

2-60API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 77: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:getTemplateDefinitionMetadataResponse xmlns:ns2="http://anm.cisco.com"> <templateDefinitionMetadata> <item> <tagName>GROUP</tagName> <name>service</name> <type>group</type> <displayString>Application Configuration</displayString> <childElements> <tagName>VARIABLE</tagName> <name>name</name> <type>name</type> <displayString>Application Config Name:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>vip</name> <type>ipaddresswithprefix</type> <displayString>VIP Address:</displayString> </childElements> <childElements> <tagName>ARRAY</tagName> <name>reals</name> <displayString>SharePoint Application Servers:</displayString> <childElements> <tagName>VARIABLE</tagName> <name>ipAddr</name> <type>ipaddress</type> <displayString /> </childElements> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>realport</name> <type>port</type> <displayString>SSL Offload Port:</displayString> <defaultValue>80</defaultValue> </childElements> <childElements> <tagName>IMG</tagName> <name>img1</name> <type>img</type> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>pkcs12</name> <type>enum</type> <displayString>Key Type:</displayString> <defaultValue>PKCS12</defaultValue> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName> <name>url</name> <type>url</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.pkcs12</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>url.name</name>

2-61API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 78: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<type>Hidden</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.pkcs12</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>username</name> <type>string</type> <displayString>Key Server Username:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>password</name> <type>password</type> <displayString>Key Server Password:</displayString> </childElements> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName> <name>der_key_url</name> <type>url</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.key</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_key_url.name</name> <type>Hidden</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.key</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_cer_url</name> <type>url</type> <displayString>SSL Cert URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.der</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_cer_url.name</name> <type>Hidden</type> <displayString>SSL Cert URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.der</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_username</name> <type>string</type> <displayString>Key Server Username:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_password</name> <type>password</type> <displayString>Key Server Password:</displayString> </childElements> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName>

2-62API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 79: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<name>key</name> <type>ssl_key</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>key.name</name> <type>Hidden</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>key.contents</name> <type>Hidden</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert</name> <type>certificate</type> <displayString>SSL Certificate:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert.name</name> <type>Hidden</type> <displayString>SSL Certificate:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert.contents</name> <type>Hidden</type> <displayString>SSL Certificate:</displayString> </childElements> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>passphrase</name> <type>password</type> <displayString>Cert/Key Passphrase:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>compress</name> <type>boolean</type> <displayString>Enable Compression:</displayString> <defaultValue>true</defaultValue> </childElements> </item> <item> <tagName>GROUP</tagName> <name>network</name> <type>group</type> <displayString>Network Configuration</displayString> <childElements> <tagName>VARIABLE</tagName> <name>device</name> <type>device</type> <displayString>Load Balancer (Device:VirtualContext):</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>vlans</name>

2-63API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 80: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<type>vlans</type> <displayString>Client VLANs:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>autoNat</name> <type>boolean</type> <displayString>Enable Source NAT:</displayString> </childElements> </item> </templateDefinitionMetadata> </ns2:getTemplateDefinitionMetadataResponse> </S:Body></S:Envelope>

2-64API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 81: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

createTemplateInstanceThis API takes a TemplateDefinition and TemplateInputArray object, generates a configuration based on the TemplateDefinition, and then deploys the configuration to the device. The TemplateInput object contains the template name and an array of name and value pairs. The names are the variable names defined in the template definition file and the values are all empty.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the createTemplateInstance action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:createTemplateInstance xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>-8257363202654966035</sid> </sessionToken> <deviceID> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <slot>3</slot> <chassisIPAddr>10.77.247.2</chassisIPAddr> </deviceID> <templateDefinition>

Parameter Description

sessionToken Session key of the application user.

deviceID Device name, deviceType, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

templateDefinition Template definition, which includes the template name, description, application, application version, and so forth. To retrieve a list of available template definitions, use the listTemplateDefinitions API.

templateInputArray Array of TemplateInput objects, which includes the template name, default value, userData, hasChild, and the childElements details. The names are the variable names defined in the template definition file and the values are the values set to the variable names.

Parameter Description

instanceId Unique integer value of the created template.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid template definition.

String Invalid template input.

2-65API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 82: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<id>7</id> <name>Microsoft SharePoint 2010</name> <description>Microsoft SharePoint Template</description> <application>Microsoft SharePoint 2010</application> <appVersion>1.1</appVersion> <createTime>2012-02-08 15:06:51</createTime> <createUser>Management Task</createUser> <updateTime>2012-02-08 15:06:51</updateTime> <updateUser>Management Task</updateUser> </templateDefinition> <templateInputs> <item> <tagName>GROUP</tagName> <name>service</name> <type>group</type> <displayString>Application Configuration</displayString> <childElements> <tagName>VARIABLE</tagName> <name>name</name> <type>name</type> <displayString>Application Config Name:</displayString> <userData>sp_vs_01</userData> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>vip</name> <type>ipaddresswithprefix</type> <displayString>VIP Address:</displayString> <userData>210.2.3.2</userData> </childElements> <childElements> <tagName>ARRAY</tagName> <name>reals</name> <displayString>SharePoint Application Servers:</displayString> <childElements> <tagName>VARIABLE</tagName> <name>ipAddr</name> <type>ipaddress</type> <displayString /> <userDatas>210.2.3.4</userDatas> <userDatas>210.2.3.5</userDatas> <userDatas>210.2.3.6</userDatas> <userDatas>210.2.3.7</userDatas> </childElements> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>realport</name> <type>port</type> <displayString>SSL Offload Port:</displayString> <defaultValue>80</defaultValue> <userData>810</userData> </childElements> <childElements> <tagName>IMG</tagName> <name>img1</name> <type>img</type> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>pkcs12</name> <type>enum</type> <displayString>Key Type:</displayString> <defaultValue>PKCS12</defaultValue>

2-66API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 83: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<userData>PKCS12</userData> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName> <name>url</name> <type>url</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.pkcs12</defaultValue> <userData>sftp://10.77.240.100/p12_rsa768.p12</userData> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>url.name</name> <type>Hidden</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.pkcs12</defaultValue> <userData>p12_rsa768.p12</userData> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>username</name> <type>string</type> <displayString>Key Server Username:</displayString> <userData>root</userData> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>password</name> <type>password</type> <displayString>Key Server Password:</displayString> <userData>roZes123</userData> </childElements> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName> <name>der_key_url</name> <type>url</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.key</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_key_url.name</name> <type>Hidden</type> <displayString>SSL Key URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.key</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_cer_url</name> <type>url</type> <displayString>SSL Cert URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.der</defaultValue> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_cer_url.name</name> <type>Hidden</type> <displayString>SSL Cert URL:</displayString> <defaultValue>sftp://1.2.3.4/dir/myfile.der</defaultValue>

2-67API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 84: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

</childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_username</name> <type>string</type> <displayString>Key Server Username:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>der_password</name> <type>password</type> <displayString>Key Server Password:</displayString> </childElements> </childElements> <childElements> <tagName>IF</tagName> <childElements> <tagName>VARIABLE</tagName> <name>key</name> <type>ssl_key</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>key.name</name> <type>Hidden</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>key.contents</name> <type>Hidden</type> <displayString>SSL Key:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert</name> <type>certificate</type> <displayString>SSL Certificate:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert.name</name> <type>Hidden</type> <displayString>SSL Certificate:</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>cert.contents</name> <type>Hidden</type> <displayString>SSL Certificate:</displayString> </childElements> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>passphrase</name> <type>password</type> <displayString>Cert/Key Passphrase:</displayString> <userData /> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>compress</name> <type>boolean</type>

2-68API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 85: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<displayString>Enable Compression:</displayString> <defaultValue>true</defaultValue> <userData>true</userData> </childElements> </item> <item> <tagName>GROUP</tagName> <name>network</name> <type>group</type> <displayString>Network Configuration</displayString> <childElements> <tagName>VARIABLE</tagName> <name>device</name> <type>device</type> <displayString>Load Balancer (Device:VirtualContext):</displayString> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>vlans</name> <type>vlans</type> <displayString>Client VLANs:</displayString> <userData>ALL_VLAN</userData> </childElements> <childElements> <tagName>VARIABLE</tagName> <name>autoNat</name> <type>boolean</type> <displayString>Enable Source NAT:</displayString> <userData>false</userData> </childElements> </item> </templateInputs> </ns2:createTemplateInstance> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains the instanceId object as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:createTemplateInstanceResponse xmlns:ns2="http://anm.cisco.com"> <instanceId>5</instanceId> </ns2:createTemplateInstanceResponse> </S:Body></S:Envelope>

2-69API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 86: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

listTemplateInstancesThis API lists all template instances, which includes the template name, description, application, application version, and so forth.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listTemplateInstances action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:listTemplateInstances xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>4918324415074336347</sid> </sessionToken> </ns2:listTemplateInstances> </S:Body></S:Envelope>

Example Response The following example shows the XML response that contains the list of templateInstances objects as the output parameter:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listTemplateInstancesResponse xmlns:ns2="http://anm.cisco.com"> <TemplateInstances> <item> <instanceId>1</instanceId> <templateName>FTP1</templateName> <applicationType>FTP</applicationType> <type>Deployed</type> <status>Complete</status> <deviceId>10.77.247.20:new</deviceId> <lastUpdatedTime>2012-02-09 00:25:58</lastUpdatedTime> </item> </TemplateInstances> </ns2:listTemplateInstancesResponse> </S:Body>

Parameter Description

sessionToken Session key of the application user.

Parameter Description

templateInstanceArray List of template instances.

Type Exception String

String Invalid session ID.

String Session timeout.

2-70API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 87: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

</S:Envelope>

deleteTemplateInstanceThis API takes an instance ID and deviceID and deletes the configuration based on the instance ID.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the deleteTemplateInstance action:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header /> <S:Body> <ns2:deleteTemplateInstance xmlns:ns2="http://anm.cisco.com"> <sessionToken> <sid>4918324415074336347</sid> </sessionToken> <deviceID> <name>new</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>10.77.247.20</ipAddr> </deviceID> <instanceId>1</instanceId> </ns2:deleteTemplateInstance> </S:Body></S:Envelope>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

instanceId Template instance ID. To retrieve a list of available template instances, use the listTemplateInstances API.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device ID.

String Invalid template input.

2-71API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 88: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

Example Response The following example shows the XML response:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:deleteTemplateInstanceResponse xmlns:ns2="http://anm.cisco.com"> <status>success</status> </ns2:deleteTemplateInstanceResponse> </S:Body></S:Envelope>

2-72API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 89: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

listCheckpointsThis API lists all the checkpoints in ANM inventory for a specified device.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listCheckpoints action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <listCheckpoints xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-8567831601320378522</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>172.16.244.214</ipAddr> </deviceID> </listCheckpoints> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response that contains the list of Checkpoints objects as the output parameter:

<?xml version="1.0"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listCheckpointsResponse xmlns:ns2="http://anm.cisco.com">

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

Parameter Description

Checkpoints List of checkpoints.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

2-73API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 90: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<Checkpoints xmlns=""> <item> <name>35Admin</name> <size>11128</size> <date>Sun May 1 15:10:04 2011</date> </item> <item> <name>allcontexts</name> <size>49294</size> <date>Sun May 1 15:10:04 2011</date> </item> <item> <name>app-tmpl-1314729175709</name> <size>3917</size> <date>Mon Sep 5 10:54:45 2011</date> </item> <item> <name>beforeupgrade</name> <size>8233</size> <date>Sun May 1 15:10:04 2011</date> </item>

</Checkpoints> </ns2:listCheckpointsResponse> </S:Body></S:Envelope>

2-74API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 91: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

createCheckpointThis API creates a checkpoint on a specified device.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the createCheckpoint action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <createCheckpoint xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-5488932206595059144</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>172.23.244.214</ipAddr> </deviceID> <checkpointName xmlns="">test-checkpoint</checkpointName> </createCheckpoint> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response:

<?xml version="1.0"?>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

checkpointName Name of the checkpoint to create.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

String Checkpoint already exists: checkpoint_name.

2-75API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 92: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:createCheckpointResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-76API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 93: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

deleteCheckpointThis API deletes a checkpoint from a specified device.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the deleteCheckpoint action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <deleteCheckpoint xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-5019678635804080238</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>172.16.244.214</ipAddr> </deviceID> <checkpointName xmlns="">test-checkpoint</checkpointName> </deleteCheckpoint> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

checkpointName Name of the checkpoint to delete. To retrieve a list of available checkpoints, use the listCheckpoints API.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

String Invalid checkpoint name.

String Checkpoint doesn't exist: checkpoint_name

2-77API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 94: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

Example Response The following example shows the XML response:

<?xml version="1.0"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:deleteCheckpointResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-78API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 95: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

rollbackCheckpointThis API rolls back a device’s running configuration to a specified checkpoint.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the rollbackCheckpoint action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <rollbackCheckpoint xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>4270884926038298576</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>172.16.244.214</ipAddr> </deviceID> <checkpointName xmlns="">test-checkpoint</checkpointName> </rollbackCheckpoint> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

checkpointName Checkpoint to which you want to roll back.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

String Invalid checkpoint name.

String Checkpoint doesn't exist: checkpoint_name

2-79API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 96: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

Example Response The following example shows the XML response:

<?xml version="1.0"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:rollbackCheckpointResponse xmlns:ns2="http://anm.cisco.com"/> </S:Body></S:Envelope>

2-80API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 97: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

freeFormShowThis API returns the output of a specified show command sent to a specified device. The API includes the xml-show command, which specifies that the show command output is either regular CLI display output or it is in XML format.

This API is supported on ACE devices (device type: VIRTUAL_CONTEXT).

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the freeFormShow action:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <freeFormShow xmlns="http://anm.cisco.com"> <sessionToken xmlns=""> <sid>-869899350867169519</sid> </sessionToken> <deviceID xmlns=""> <name>Admin</name> <deviceType>VIRTUAL_CONTEXT</deviceType> <ipAddr>172.16.244.214</ipAddr> </deviceID>

Parameter Description

sessionToken Session key of the application user.

deviceID Virtual context name, devicetype, and IP address attributes. For the ACE module only, the device ID includes the host chassis slot and chassis IP address attributes.

command Name of the show command. Specify the command without using the word show. For example, to specify the show version command output, just use the word version.

isXMLized Command output format:

• On (true)—XML format.

• Off (false)—CLI display format.

Parameter Description

None None.

Type Exception String

String Invalid session ID.

String Session timeout.

String Invalid device type.

String Invalid device ID.

String Internal error: command parse error.

2-81API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 98: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API ApplicationTemplateManager Web Service APIs

<command xmlns="">access-list ALL</command> <isXMLized xmlns="">false</isXMLized> </freeFormShow> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Example Response The following example shows the XML response:

<?xml version="1.0"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:freeFormShowResponse xmlns:ns2="http://anm.cisco.com"> <output xmlns="">access-list:ALL, elements: 3, status: ACTIVE remark : access-list ALL line 8 extended permit ip any any (hitcount=333800)access-list ALL line 18 extended permit ip any host 172.16.244.230 (hitcount=0)access-list ALL line 28 extended permit ip any host 10.10.10.1 (hitcount=0)</output> </ns2:freeFormShowResponse> </S:Body></S:Envelope>

2-82API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 99: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

RBACManager Web Service APIsThis section describes the APIs associated with the RBACManager Web Service, which are as follows:

• createUsers

• updateUsers

• listUsers

• deleteUsers

• listRoles

• listDomainNames

• listDomains

• listOrganizations

createUsersThis API creates a user account and returns the profile creation status, which includes the username and account creation status.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the createUsers action:

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the user belongs.

users Input parameter that contains the list of user elements, such as login name, password, and domains (see “User” section on page 2-7).

Parameter Description

operationStatuses List of “operation status” elements for each object that was created. The status element contains name (name of object from request), status (failure or success), and message.

Type Exception String

String Invalid session ID.

String Organization organization_name doesn't exist.

String Name is not valid.

String User name already exists.

String Role is null.

String Domains is null.

String Password is empty

2-83API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 100: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header /> <soapenv:Body> <anm:createUsers> <sessionToken> <sid>1861222974238016825</sid> </sessionToken> <organization>Default</organization> <users> <item> <loginName>I01d35951</loginName> <role>Network-Admin</role> <domains> <item>new</item> </domains> <name>Ali, Firasath</name> <password type="encrypted">4F57181DCAADE980555F2CE6755CA425F00658BE</password> <email>[email protected]</email> <telephone>312-900 1111</telephone> <allowedLoginIP /> <description /> </item> <item> <loginName>J92s36842</loginName> <role>Network-Admin</role> <domains> <item>new</item> </domains> <name>Alexander F Beckerman</name> <password type="encrypted">4F57181DCAADE980555F2CE6755CA425F00658BE</password> <email>[email protected]</email> <allowedLoginIP /> <description /> </item> </users> </anm:createUsers> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:createUsersResponse xmlns:ns2="http://anm.cisco.com"> <users> <item> <name>I0135951</name> <status>success</status> </item> <item> <name>J9236842</name> <status>success</status> </item> </users> </ns2:createUsersResponse> </S:Body></S:Envelope>

2-84API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 101: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

updateUsersThis API updates user accounts and returns the update status, which includes the username and account update status.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the updateUsers action:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header /> <soapenv:Body> <anm:updateUsers> <sessionToken> <sid>1861222974238016825</sid> </sessionToken> <organization>Default</organization> <users> <item> <loginName>J9236842</loginName> <role>Server-Appln-Maintenance</role> <domains> <item>All</item> </domains> <name>J9236842</name> <password type="encrypted">9B7C68A918B17EB053809B198D7C9ABFC142F30A</password> <email>[email protected]</email> <telephone>111111</telephone> <allowedLoginIP> <item>192.168.1.1</item> </allowedLoginIP> <description>some notes</description> </item>

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the user belongs.

users Input parameter that contains the list of user elements, such as login name, password, and domains (see the “User” section on page 2-7).

Parameter Description

operationStatuses List of “operation status” elements for each object that was updated. This status element contains name (name of object from request), status (failure or success), and message.

Type Exception String

String Invalid session ID.

String Internal error: cannot find full_name.

String Organization organization_name doesn't exist.

2-85API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 102: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

</users> </anm:updateUsers> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:updateUsersResponse xmlns:ns2="http://anm.cisco.com"> <operationStatuses> <item> <name>J9236842</name> <status>success</status> </item> </operationStatuses> </ns2:updateUsersResponse> </S:Body></S:Envelope>

listUsersThis API provides a list of requested users from the specified organization. If the organization does not contain any users, an empty list is returned.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listUsers action:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header/> <soapenv:Body>

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the user belongs.

showPassword (Optional) Input parameter that instructs ANM to include the response, the hashed user passwords. Set this parameter to true or false. By default, the parameter is set to false and ANM returns users list without their passwords.

Parameter Description

users List of users.

Type Exception String

String Invalid session ID.

String Organization organization_name doesn't exist.

String showPassword parameter must be set to true or false.

2-86API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 103: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

<anm:listUsers> <sessionToken> <sid>-5245583155697881618</sid> </sessionToken>

<organization>Default</organization><showPassword>true</showPassword>

</anm:listUsers> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listUsersResponse xmlns:ns2="http://anm.cisco.com"> <users> <item> <!-- This is “Element user” – > <loginName>I013595</loginName> <role>LOB-Operator</role> <domains> <item>TSS-Commercial-Card</item> <item>TSS-TSS2CommCard</item> </domains> <name>Ali, Firasath</name> <password type="encrypted" >4F57181DCAADE980555F2CE6755CA425F00658BE</password> <email>[email protected]</email> <telephone>312-213 5555</telephone> <allowedLoginIP/> <description/> </item> <item> <!-- This is “Element user” – > <loginName>J923684</loginName> <role>LOB-Operator</role> <domains> <item>CTO-iVault</item> </domains> <name>Alexander F Beckerman</name> <password type="encrypted" >4F57181DCAADE980555F2CE6755CA425F00658BE</password> <email>[email protected]</email> <allowedLoginIP/> <description/> </item> </users> </ns2:listUsersResponse> </S:Body></S:Envelope>

2-87API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 104: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

deleteUsersThis API removes a user account and returns a status of the account deletion.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the deleteUsers action:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header/> <soapenv:Body> <anm:deleteUsers> <sessionToken> <sid>4445530094015270603</sid> </sessionToken>

<organization>Default</organization> <users> <item>R014PNM43</item> </users> </anm:deleteUsers> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:deleteUsersResponse xmlns:ns2="http://anm.cisco.com"> <users> <item> <name>R014PNM43</name> <status>failure</status> <message>Internal error: cannot find /dcm/org/Default/user/R014PNM43</message>

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the user belongs.

users List of users login names.

Parameter Description

operationStatuses List of “operation status” elements for each object that was deleted. This status element contains name (name of object from request), status (failure or success) and message.

Type Exception String

String Invalid session ID.

String Internal error: cannot find full_name

String Organization organization_name doesn't exist.

2-88API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 105: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

</item> </users> </ns2:deleteUsersResponse> </S:Body></S:Envelope>

listRolesThis API returns a list of roles associated with the specified organization. If the organization does not contain any roles, the API returns an empty list.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listRoles action.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header/> <soapenv:Body> <anm:listRoles>

<sessionToken> <sid>-1306553123849421097</sid></sessionToken><organization>Default</organization>

</anm:listRoles> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listRolesResponse xmlns:ns2="http://anm.cisco.com"> <roles> <item><!-- This is “Element role” – > <name>ACE-Admin</name> <description/>

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the roles belong.

Parameter Description

roles List of organization roles. For more information, see the “Role” section on page 2-8.

Type Exception String

String Invalid session ID.

String Organization organization_name doesn't exist.

2-89API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 106: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

<roleTasks> <roleTask> <name>Access List</name> <value>Create</value> </roleTask> <roleTask> <name>Connection</name> <value>Create</value> </roleTask> < … > </roleTasks> </item> <item><!-- This is “Element role” – > <name>ANM-Admin</name> <description/> <roleTasks> … </roleTasks> </item> </roles> </ns2:listRolesResponse> </S:Body></S:Envelope>

listDomainNamesThis API returns a list of domain names associated with the specified organization. If the organization does not contain any domains, the API returns an empty list.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listDomainNames action:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header/> <soapenv:Body> <anm:listDomainNames> <sessionToken> <sid>7380465411107816062</sid> </sessionToken>

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the domains belong.

Parameter Description

domainNames List of organization domain names.

Type Exception String

String Invalid session ID.

String Organization organization_name doesn't exist.

2-90API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 107: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

<organization>Default</organization> </anm:listDomainNames> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listDomainNamesResponse xmlns:ns2="http://anm.cisco.com"> <domainNames> <item>All</item> <item>qwe_1</item> </domainNames> </ns2:listDomainNamesResponse> </S:Body></S:Envelope>

listDomainsThis API returns a list of domain object types for each specified organization domain. You can specify the domain object types to exclude from the response.

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listDomains action:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com">

Parameter Description

sessionToken Session key of the application user.

organization Name of the organization to which the domains belong.

domainNames List of domain types.

excludeTypes (Optional) List of domain object types to exclude from the response. For a list of available domain object types, see “Element Domain.” By default, the API returns all nested domain objects.

Parameter Description

domains List of domain names.

Type Exception String

String Invalid session ID.

String Organization organization_name doesn't exist.

String Domain(s): domain_name is not available.

String Type type_name does not exist.

2-91API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 108: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

<soapenv:Header/> <soapenv:Body> <anm:listDomains> <sessionToken> <sid>7380465411107816062</sid> </sessionToken> <organization>Default</organization> <domainNames> <item>All</item> <item>qwe_1</item> </domainNames>

<excludeTypes> <item>Certificates</item> <item>Keys</item></excludeTypes>

</anm:listDomains> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listDomainsResponse xmlns:ns2="http://anm.cisco.com"> <domains> <item><!-- This is “Element domain” – > <name>All</name> <allowAll>true</allowAll> <description/> </item> <item><!-- This is “Element domain” – > <name>qwe_1</name> <allowAll>false</allowAll> <domainObjects> <domainObject> <name>CSS2</name> <type>CSS</type> </domainObject> <domainObject> <name>CSS2:dmm-loonie/dmm-loonie/0</name> <type>Servers</type> </domainObject> <domainObject> <name>CSS2:foo/foo/0</name> <type>Servers</type> </domainObject> </domainObjects> <description/> </item> </domains> </ns2:listDomainsResponse> </S:Body></S:Envelope>

listOrganizationsThis API returns a list of available organizations.

2-92API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 109: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

Input Parameters

Output Parameters

Exceptions

Example Request The following example shows an XML-formatted SOAP request to perform the listOrganizations action.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anm="http://anm.cisco.com"> <soapenv:Header/> <soapenv:Body> <anm:listOrganizations> <sessionToken> <sid>-1306553123849421097</sid> </sessionToken> </anm:listOrganizations> </soapenv:Body></soapenv:Envelope>

Example Response The following example shows the XML response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:listOrganizationsResponse xmlns:ns2="http://anm.cisco.com"> <organizations> <item><!-- This is “Element organization” – > <name>local</name> <description>Organization for local authentication</description> <authentication>local</authentication> <remoteAuthorization>false</remoteAuthorization> <fallback>false</fallback> <tacacsAttributeName>ANM-local</tacacsAttributeName> <authenticationPort>0</authenticationPort> <secondaryAuthenticationPort>0</secondaryAuthenticationPort> </item> </organizations> </ns2:listOrganizationsResponse> </S:Body></S:Envelope>

Parameter Description

sessionToken Session key of the application user.

Parameter Description

organizations List of organizations.

Type Exception String

String Invalid session ID.

2-93API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 110: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 ANM Web Services API RBACManager Web Service APIs

2-94API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 111: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference GuiOL-25355-03

C H A P T E R 2

Web Service Objects

This chapter describes the data types that are defined structures or objects in the ANM Web Services API. Web Service objects perform the following functions:

• Parse input parameters and validate their values

• Invoke the appropriate ANM function

• Assemble the returned result and pass it to the SOAP endpoint

• Handle exceptions from the ANM by reporting the error to the client

This chapter describes the following Web Service objects:

• Answer

• Checkpoints

• DeviceID

• DeviceType

• DnsRule

• MatchCondition

• Rserver

• Serverfarm

• SessionToken

• SfRserver

• TemplateDefinition

• TemplateInput

• TemplateInstance

• VMMappingInfo

• Vserver

• WSException

• User

• Role

• Domain

• Organization

2-1de for Cisco Application Networking Manager 5.2.2

Page 112: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Answer

AnswerThis section lists and describes the Answer object attributes.

CheckpointsThis section lists and describes the Checkpoints object attributes.

DeviceIDThis section lists and describes the DeviceID object attributes.

Attribute Description

ipAddr Answer IP address.

answerName Answer name.

type Answer type.

configState Answer configuration state: Suspended or Active.

answerGroups Assocciated answer group names.

location Answer location.

device Associated device.

operState Answer operating state: OperationalSuspended, Suspended, Active, Failed, Unknown, or N/A.

pGssmTime Date and time associated with the primary GGSM.

Attribute Description

name Checkpoint file name.

size Checkpoint file size.

date Checkpoint file date.

Attribute Description

name Virtual context name.

deviceType Device type (see DeviceType).

ipAddress Device IP address.

slot Host chassis slot number.

chassisIPAddr Host chassis IP address.

2-2API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 113: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects DeviceType

DeviceTypeTable 2-1 lists the possible device types along with mandatory attributes for each type.

Note The optional attributes are indicated by the dash (—).

DnsRuleThis section lists and describes the DnsRule object attributes.

Table 2-1 Device Types and Mandatory Attributes

DeviceType name chassisIpaddr Ipadddr slot

ACE Appliance ACE4710 — — Appliance IP address

ACE Appliance Virtual Context

VIRTUAL_ CONTEXT

VC Name — Appliance IP address

ACE Module ACE_BLADE — Chassis IP address

— ACE Module slot

ACE Module Virtual Context

VIRTUAL_ CONTEXT

VC Name Chassis IP address

— ACE Module slot

CSS CSS — — CSS IP address

CSM CSM — Chassis IP address

— CSM Module slot

Chassis CAT_6_K — Chassis IP address

— —

Attribute Description

dnsRuleName DNS rule name.

sourceAddress DNS rule source IP address.

domains Domains associate with the DNS rule.

dnsConfigState DNS configuration state: Suspended or Active.

answerGroups Answer group names to which the DNS rule belongs.

owner DNS rule owner name.

2-3API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 114: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects MatchCondition

MatchConditionThis section lists and describes the MatchCondition object attributes.

RserverThis section lists and describes the Rserver object attributes.

ServerfarmThis section lists and describes the Serverfarm object attributes.

SessionTokenThis section lists and describes the SessionToken object attribute.

Attribute Description

ipAddress Server load balancing (SLB) is based on IP address.

protocol SLB is based on protocol.

port SLB is based on port number.

Attribute Description

name Real server name.

type Real server type: redirect or host.

ipAddress Real server IP address.

state Real server state: ISS, OOS, or IS.

weight Real server weight.

Attribute Description

name Server farm name.

serverFarmType Server farm type: redirect or host.

Attribute Description

sid Session ID.

2-4API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 115: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects SfRserver

SfRserverThis section lists and describes the SfRserver object attributes.

TemplateDefinitionThis section lists and describes the TemplateDefinition object attributes.

Attribute Description

serverfarmName Server farm name.

realserverName Name of real server associated with the server farm.

adminState Real server administrative state: ISS, OOS, or IS.

operationState Real server operating state: STATUSFAILED, MAXLOAD, INACTIVE, STBY, ARPFAILED, RETURNCODEFAILED, INBANDPROBEFAILED, TESTWAIT, OPERWAIT, PROBETESTING, PROBEFAILED, THROTTLEDFP, THROTTLEMAXCLIENTS, THROTTLEMAXCONNECTIONS, TESTING, READYTOTEST, FAILED, UP, DOWN, or NA.

weight Real server weight.

port Real server port.

ipAddress Real server IP address.

lastPolledTime Date and time when the real server was last polled.

Attribute Description

id Application template ID.

name Application template name.

description Application template description.

application Application template application type: User Defined or System (Cisco defined)

appVersion Application template version number.

createTime Date and time that the application template was created.

createUser Name of the user that created the application template.

updateTime Date and time that the application template was modified.

updateUser Name of the user who modified the application template.

2-5API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 116: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects TemplateInput

TemplateInputThis section lists and describes the TemplateInput object attributes.

TemplateInstanceThis section lists and describes the TemplateInstance object attributes.

VMMappingInfoThis section lists and describes the VMMappingInfo object attributes.

Attribute Description

tagName Name of the XML element: INPUT, LABEL, IMG, GROUP, VARIABLE, ARRAY, IF, ELSE, or ENUM.

name Input element name.

type Input element data type.

displayString GUI variable field description.

defaultValue Variable default setting.

userData User input data.

userDatas User input data array.

hasChild Input element contains child elements.

childElements Child element details.

Attribute Description

instanceID Application template instance name.

templateName Name of application template used to create the template instance.

applicationType Type of application.

type Template instance type: Deployed or Staged.

status Template instance status: Complete or Incomplete.

deviceID Virtual context associated with the template instance.

lastUpdatedTime Last time that ANM retrieved the status information.

Attribute Description

deviceID Device ID (see DeviceID).

sfname Associated server farm name.

sfrsname Associated server farm real server name.

2-6API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 117: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Vserver

VserverThis section lists and describes the Vserver object attribute.

WSExceptionThis section lists and describes the WSException object attribute.

UserThis section lists and describes the user object attributes.

port Server farm real server port number.

ipaddr Server farm real server IP address.

Attribute Description

virtualserverName Virtual server name.

policyMapName Policy map name.

matchConditions SLB match conditions (see MatchCondition).

serverfarms Server farms that the virtual server is associated with.

vlans VLANs associated withe the virtual server.

adminState Virtual server administrative state: Down, Up, or N/A.

operState Virtual server operating state: OUTOFMEMORY, TESTREAL, STBINOPRREAL, INOPRREAL, STANDBY, UP, DOWN, or N/A.

lastPolledTime Date and time when the virtual server was last polled.

Attribute Description

message Web Services exception.

Attribute Description

loginName User login name.

role User role.

domains List of user domains.

name (Optional) User name.

2-7API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 118: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Role

Example<item>

<loginName>I013595</loginName><role>/dcm/org/Default/role/LOB-Operator</role><domains>

<item>/dcm/org/Default/domain/TSS-Commercial-Card</item><item>/dcm/org/Default/domain/TSS-TSS2CommCard</item>

</domains><name>Ali, Firasath</name><password type="encrypted"

>4F57181DCAADE980555F2CE6755CA425F00658BE</password><email>[email protected]</email><telephone>312-213 5555</telephone><allowedLoginIP/><description/>

</item>

RoleThis section lists and describes the role object attributes.

password User password, which can be encrypted or plain type (default). You specify the password type with the type attribute of the password element. Encrypted passwords are stored in the database as is, but plain passwords are encrypted.

Note The password attribute is required when the organization uses the local authentication type or when fallback to local authentication is enabled.

email (Optional) User e-mail address.

telephone (Optional) User telephone number.

allowedLoginIP (Optional) List of IP addresses from which the user is allowed to login.

description (Optional) Descriptive note.

Attribute Description

name Role name.

description (Optional) Descriptive note.

2-8API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 119: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Role

Example<item>

<name>ACE-Admin</name><description/><roleTasks>

<roleTask><name>Access List</name><value>Create</value>

</roleTask><roleTask>

<name>Connection</name><value>Create</value>

</roleTask></roleTasks>

</item>

roleTasks List of role tasks where each item consists of a task name and value, which are the same values as in the user interface.

Available role task names are as follows:

• Access List • Real Inservice

• ANM Inventory • Real Server

• ANM System • Routing

• ANM User Access • Server Farm

• Building Block • SSL

• Certificate/Key • Sticky

• Connection • Switch

• Device Events • Syslog

• DNS Answer Inservice • Threshold

• DNS Rule Inservice • UDG

• Expert • User Access

• Fault Tolerent • VIP

• Interface • Virtual Context

• Loadbalancer • Virtual Inservice

• Operational Change Weight • VM Mapping

• Probe

Available role task values are as follows:

• Create • No Access

• Debug • View

• Modify

2-9API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 120: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Domain

DomainThis section lists and describes the domain object attributes.

Example<item>

<name>Cat</name><allowAll>false</allowAll><domainObjects>

<domainObject><name>Cat6k</name><type>Chassis</type>

</domainObject><domainObject>

<name>Cat6k:CSM:10</name><type>CSMCards</type>

</domainObject><domainObject>

<name>Cat6k:2:Admin</name><type>VirtualContexts</type>

</domainObject><domainObject>

<name>Cat6k:2:Admin:SFARM1/RS1/0</name><type>RealServers</type>

</domainObject><domainObject>

<name>Cat6k:2:Admin:testvip001</name><type>VirtualServers</type>

</domainObject></domainObjects><description/>

</item>

Attribute Description

name Domain name.

allowAll Flag that enables all objects within the specified domain.

domainObjects List of domain objects where each item consists of an object name and type, which are the same as in the user interface.

Available domain object types are as follows:

• ACE 4710s • GSS

• Answer VIPs • Keys

• Building Blocks • Real Servers

• Certificates • Resource Classes

• Chassis • Servers

• Content • VCenters

• CSM Cards • Virtual Contexts

• CSS • Virtual Severs

• DNS Rules

description (Optional) Descriptive note.

2-10API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 121: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Organization

OrganizationThis section lists and describes the organization object attributes.

Example<item>

<name>local</name><description>Organization for local authentication</description><authentication>local</authentication><remoteAuthorization>false</remoteAuthorization><fallback>false</fallback><tacacsAttributeName>ANM-local</tacacsAttributeName><authenticationPort>0</authenticationPort><secondaryAuthenticationPort>0</secondaryAuthenticationPort>

</item>

Attribute Description

name Organization name.

description (Optional) Descriptive note.

account Account number.

contact Contact name.

email Contact e-mail address

phone Contact phone number.

fax Contact alternate phone number.

address Street address.

city City.

zipcode Zip code.

country Country.

authentication Authentication type. Available values: local, ldap, radius, or tacacs.

authenticationServer Primary authentication server.

authenticationPort Authentication Port on primary server. Values are between 0 and 65535.

secondaryAuthenticationServer Secondary authentication server.

secondaryAuthenticationPort Authentication Port on secondary server. Values are between 0 and 65535.

authenticationSecret Authentication Secret in plain text.

remoteAuthorization Remote Authorization. Values are either true or false.

tacacsAttributeName ANM unique IDs used for authorization.

fallback Fallback to local. Values are either true or false.

2-11API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 122: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 2 Web Service Objects Organization

2-12API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 123: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference GuiOL-25355-03

C H A P T E R 4

Troubleshooting Problems

This chapter describes how to troubleshoot problems with Cisco Application Networking Manager (ANM) and includes the following sections:

• SOAP Message Traffic and Time Taken to Invoke an API, page 4-1

• Custom Application Errors, page 4-2

• Modifying the Number of Concurrent Sessions Allowed, page 4-3

SOAP Message Traffic and Time Taken to Invoke an APITo see the SOAP messages passed to and from the ANM, enable the debug feature for ANM Web Services and check the corresponding logs. Enabling the debug feature creates a log file named webservices.log under the /var/lib/anm/logs directory. This file contains details of both inbound and outbound SOAP messages.

Procedure

Step 1 Enable the debug feature as follows:

• ANM Server—Open the /opt/CSCOanm/etc/cs-config.properties file in a text editor and change the value of ws.debug to “true” as follows:

ws.debug=true

• ANM Virtual Appliance—Enter the following command:

anm-property set ws.debug true

To disable the debug feature at any time, set the attribute value to false.

Step 2 Restart ANM as follows:

• ANM Server—Enter the following command:

/opt/CSCOanm/bin/anm-tool restart

• ANM Virtual Appliance—Enter the following command:

anm-tool restart

4-1de for Cisco Application Networking Manager 5.2.2

Page 124: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 4 Troubleshooting Problems Custom Application Errors

Custom Application ErrorsWorkarounds for the errors you may encounter are as follows:

• DeviceType is set as deviceTypeValue, but mandatory field 'fieldName' is set as null or empty’.

Cause: The mandatory attributes are not set for the DeviceID. For each device type, a certain set of attributes are mandatory to uniquely identify the device on the ANM.

Solution: Set the mandatory fields for each device type in the DeviceID. See the “DeviceID” section on page 2-2 for the complete list of mandatory fields for each device type.

• Maximum session limit [configured_limit] reached for WS

Cause: The number of open Web Service sessions permitted on ANM has reached the configured maximum value (default = 10).

Solution1: Close the session by invoking the following API:

OperationManager: logout(sessionToken)

Note You can modify the number of concurrent sessions permitted (see the “Modifying the Number of Concurrent Sessions Allowed” section on page 4-3).

Solution2: Wait until the sessions are automatically logged out from the ANM. By default, the sessions are logged out after an idle period of 30 minutes.

• Session ID is in use and the operation has not been completed. Please try again later once the operation has completed

Cause: The session token used to invoke the API is already used to invoke some other API that is still engaged. Once a session token is used to invoke an API, the session token cannot be used unless the previously invoked API completes its operation.

Solution: Wait until the previously invoked API completes its operation.

• Invalid ‘Session ID’

Cause: The session token being used in the API has timed out or some unknown session ID is in use.

Solution: None. Use login() API to create a session ID and use the new session ID.

• Unsupported Device Type: “[Device Type]”

Cause: The API is supported only for a certain device type. This system message appears if an API is invoked with an unsupported device type.

Solution: Use the API only for the supported device type. The complete list of supported device type for each API is displayed in the Mapping Table, page 2-1.

• Given ACE module does not exist in the chassis: “Chassis Ip address”

Cause: The incorrect slot information is given in the DeviceID.

Solution: Check and correct the slot number or chassis IP address configured in the DeviceID.

• Given ACE module is not yet imported in ANM

Cause: The ACE module with the given slot is available but it is not yet imported in ANM.

Solution: Correct the slot number in the DeviceID or log in to ANM and import the ACE module.

• Given Virtual context name “[VCName]” does not exist in the ACE Devices

Cause: The incorrect or non-existent Virtual Context is given in the DeviceID.

4-2API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 125: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 4 Troubleshooting Problems Modifying the Number of Concurrent Sessions Allowed

Solution: Check that the VC given in the DeviceID exists in the ACE module or ACE appliance.

• Given ‘<device model>’ does not exist in ANM

Cause: The specified device is not yet imported into the ANM.

Solution: Check if the correct IP address is configured in the DeviceID. Or log in to ANM and import the corresponding device.

Modifying the Number of Concurrent Sessions AllowedBy default, ANM supports up to 10 concurrent sessions for web services and any session that is left idle for 30 minutes will time out. You can modify the maximum number of concurrent sessions allowed.

Note Having more than 10 sessions open at the same time can slow the performance of ANM.

Procedure

Step 1 Open the following properties file in a text editor:

/opt/CSCOanm/etc/cs-config.properties

Step 2 From the text editor, add the following line to the cs-config.properties file:

ws.max.concurrentsessions=number

where number is the maximum number of concurrent connections allowed.

Step 3 Save the modified cs-config.properties file.

Step 4 Restart the ANM services by entering the following command

/opt/CSCOanm/bin/anm-tool restart-services

4-3API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 126: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Chapter 4 Troubleshooting Problems Modifying the Number of Concurrent Sessions Allowed

4-4API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 127: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference Guide for COL-25355-03

A

P P E N D I X A Use Case Examples

This chapter lists the use case sample code examples, and includes the following sections:

• Use Case 1: SampleWSClient, page A-1

• Use Case 2: ActivateSuspendSfRserverClient, page A-5

• Use Case 3: Virtual Server WS Client, page A-10

• Use Case 4: GSSWSClient, page A-17

• Use Case 5: ApplTemplateCreateWSClient, page A-23

• Use Case 6: RBACManager WS Client code, page A-31

• Use Case 7: SyncDevice WS Client code, page A-38

Use Case 1: SampleWSClientThe following example shows a java-based sample code to list the server farm or real servers on the ANM. After you import the ACE into the ANM, you can call the ANM Web Services API to get the list of ACE DeviceIDs and for each device ID, it displays the virtual context device IDs, and then for each context it displays the server farm and server farm real servers within the server farm:

/** * Title: SampleWSClient * Description: Sample WS client code using java. It lists the devices imported in ANM, the Virtual * Contexts and the serverfarms/realservers configured in it. * Copyright: Copyright(C) 2010 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @author: kamachan, Aug 2010 * @version: 1.0 */package com.cisco.anm.client;

import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.List;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.DeviceID;

A-1isco Application Networking Manager 5.2.2

Page 128: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 1: SampleWSClient

import com.cisco.anm.DeviceIDArray;import com.cisco.anm.DeviceType;import com.cisco.anm.OperationManager;import com.cisco.anm.Serverfarm;import com.cisco.anm.ServerfarmArray;import com.cisco.anm.SessionToken;import com.cisco.anm.SfRserver;import com.cisco.anm.SfRserverArray;

/** * @author kamachan * * Sample code to print all the serverfarms/realservers configured in all imported ACE modules and appliances. * This code illustrate a basic usage of ANM WS code to get the ACE module/appliance deviceid and its virtual context * deviceid and then using the deviceid, it gets the list of serverfarms/realservers configured in the deviceid. * * Prerequiste: * To compile the file, include the stubs generated from the wsdl file. It is already packed in a jar (????) file - dcm-ws-client-<version>.jar ???? * * */public class SampleWSClient { static final String NAMESPACE = "http://anm.cisco.com"; static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; // <protocol>://<IPAddress>:<Port>/anm/<service name> static final String WS_NAME = "OperationManager"; public static BindingProvider getPort(String ws, String protocol, String host, String port ) throws IOException { String url = String.format(URL_TEMPLATE, ""+ protocol,port, host, ws); String ns = NAMESPACE; BindingProvider bp; Service svc; try { QName qname = new QName(ns, ws + "Service"); Class<Service> clazz = (Class<Service>) Class.forName("com.cisco.anm." + ws + "Service"); Constructor<Service> ctor = (Constructor<Service>) clazz.getConstructor(new Class[]{URL.class, QName.class}); svc = ctor.newInstance(new Object[]{new URL(url+"?wsdl"), qname}); Method m = svc.getClass().getMethod("get"+ws+"Port", null); bp = (BindingProvider)m.invoke(svc, null); } catch (Exception e) { throw new RuntimeException(e); } return bp; }

public static void main(String args[]){ // args[0] = protocol , http or https // args[1] = IP Address or hostname of ANM server // args[2] = username, // args[3] = password. // java SampleWSClient https 10.77.241.54 admin admin

A-2API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 129: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 1: SampleWSClient

if( args.length != 4 ) { System.out.println("Invalid arguments."); System.out.println("Usage: java com.cisco.anm.client.SampleWSClient <protocol(http|https)> <ANM host name> <username> <password>"); System.exit(0); } String proto=args[0], port="", host=args[1], user=args[2], pass=args[3] ; if( proto != null && proto.equals("https")){ port = "8443"; }else if( proto.equals("http")){ port = "8080"; }else{ System.out.println("Invalid arguments."); System.out.println("Usage: java com.cisco.anm.client.SampleWSClient <protocol(http|https)> <ANM host name> <username> <password>"); System.exit(0); } OperationManager oprMgr = null; SessionToken st = null; try{ oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host);

/* * Invoke login() API to get session token. */ st = oprMgr.login(user, pass); /* * Use the session token obtained from the previous call and get all ACE modules * imported in ANM. */ DeviceIDArray deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.ACE_BLADE); List<DeviceID> listDeviceId = deviceIdArr.getItem();

System.out.println("Device Type\t | Virtual Context Name\t | Module Slot\t | Chassis IP address\t | Serverfarm\t | Real Server\t | Port\t | Real IP Address\t | Weight\t | Admin State\t");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); for( DeviceID dev : listDeviceId ){ /* * Invoke listVirtualContext() to get all the virtual contexts for each ACE module * imported in ANM. */ DeviceIDArray vcIds = oprMgr.listVirtualContexts(st, dev); for( DeviceID vcId : vcIds.getItem() ){ /* * Invoke listServerFarms() API to get all the serverfarms configured for each VC * */ ServerfarmArray sfArr = oprMgr.listServerFarms(st, vcId); for(Serverfarm sf: sfArr.getItem() ){ /* * Invoke listServerfarmRservers() API to get all the reals configured in a serverfarm. */ SfRserverArray sfRsArr = oprMgr.listServerfarmRservers(st, vcId, sf.getName()); for( SfRserver sfRs: sfRsArr.getItem() ){

A-3API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 130: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 1: SampleWSClient

System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | " + vcId.getSlot() + "\t\t | " + vcId.getChassisIPAddr() + "\t\t | " + sfRs.getServerfarmName() + "\t | " + sfRs.getRealserverName() + "\t | " + sfRs.getPort() + "\t | " + sfRs.getIpAddr() + "\t | " + sfRs.getWeight() + "\t | " + sfRs.getAdminState() ); } if( sfRsArr.getItem().size() == 0) { System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | "

+ vcId.getSlot() + "\t\t | " + vcId.getChassisIPAddr() + "\t\t | "

+ sf.getName() + "\t\t " ); } } } }

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("\n\n\n"); /* * Use the session token obtained from the login() API call and get all ACE modules * imported in ANM. */ deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.ACE_4710); listDeviceId = deviceIdArr.getItem();

System.out.println("Device Type\t | Virtual Context Name\t | Appliance IP address\t | Serverfarm\t | Real Server\t | Port\t | Real IP Address\t | Weight\t | Admin State\t");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); for( DeviceID dev : listDeviceId ){ /* * Invoke listVirtualContext() to get all the virtual contexts for each ACE module * imported in ANM. */ DeviceIDArray vcIds = oprMgr.listVirtualContexts(st, dev); for( DeviceID vcId : vcIds.getItem() ){ /* * Invoke listServerFarms() API to get all the serverfarms configured for each VC * */ ServerfarmArray sfArr = oprMgr.listServerFarms(st, vcId); for(Serverfarm sf: sfArr.getItem() ){ /* * Invoke listServerfarmRservers() API to get all the reals configured in a serverfarm. */ SfRserverArray sfRsArr = oprMgr.listServerfarmRservers(st, vcId, sf.getName()); for( SfRserver sfRs: sfRsArr.getItem() ){

A-4API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 131: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 2: ActivateSuspendSfRserverClient

System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | " + vcId.getIpAddr() + "\t\t | " + sfRs.getServerfarmName() + "\t | " + sfRs.getRealserverName() + "\t | " + sfRs.getPort() + "\t | " + sfRs.getIpAddr() + "\t | " + sfRs.getWeight() + "\t | " + sfRs.getAdminState() ); } if( sfRsArr.getItem().size() == 0) { System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | "

+ vcId.getIpAddr() + "\t\t | " + sf.getName() + "\t\t " ); } } } }

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

}catch(Exception ex){ ex.printStackTrace(); }finally{ try{ /* * Close the ws session using logout() API. */ oprMgr.logout(st); }catch(Exception ex){ ex.printStackTrace(); } }

}}

Use Case 2: ActivateSuspendSfRserverClientThe following example shows a sample code to activate or suspend a real server in the server farm:

/** * Title: ActivateSuspendSfRserverClient * Description: Sample WS client code using java to activate or suspend a serverfarm real configured in ACE/CSS/CSM device * * Copyright: Copyright(C) 2010 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @version: 1.0 */

package com.cisco.anm.client;

import java.io.IOException;

A-5API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 132: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 2: ActivateSuspendSfRserverClient

import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.List;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.DeviceID;import com.cisco.anm.DeviceIDArray;import com.cisco.anm.DeviceType;import com.cisco.anm.OperationManager;import com.cisco.anm.Serverfarm;import com.cisco.anm.ServerfarmArray;import com.cisco.anm.SessionToken;import com.cisco.anm.SfRserver;import com.cisco.anm.SfRserverArray;import com.cisco.anm.SuspendState;

/** * * * Sample WS client code using java to activate or suspend a serverfarm real configured in ACE/CSS/CSM device. * * Prerequiste: * To compile the file, include the stubs generated from the wsdl file. It is already packed in a jar file - dcm-ws-client-<version>.jar * * */public class ActivateSuspendSfRserverClient { static final String NAMESPACE = "http://anm.cisco.com"; static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; // <protocol>://<IPAddress>:<Port>/anm/<service name> static final String WS_NAME = "OperationManager"; public static BindingProvider getPort(String ws, String protocol, String host, String port ) throws IOException { String url = String.format(URL_TEMPLATE, ""+ protocol,port, host, ws); String ns = NAMESPACE; BindingProvider bp; Service svc; try { QName qname = new QName(ns, ws + "Service"); Class<Service> clazz = (Class<Service>) Class.forName("com.cisco.anm." + ws + "Service"); Constructor<Service> ctor = (Constructor<Service>) clazz.getConstructor(new Class[]{URL.class, QName.class}); svc = ctor.newInstance(new Object[]{new URL(url+"?wsdl"), qname}); Method m = svc.getClass().getMethod("get"+ws+"Port", null); bp = (BindingProvider)m.invoke(svc, null); } catch (Exception e) { throw new RuntimeException(e); } return bp; }

public static void main(String args[]){

A-6API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 133: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 2: ActivateSuspendSfRserverClient

// args[0] = protocol , http or https // args[1] = IP Address or hostname of ANM server // args[2] = username, // args[3] = password. // args[4] = (activate|suspend) // args[5] = sfName/rsName/rsPort/weight/rsIP // args[6] = (css|csm|vc) // args[7] = <vc name> if args[6] is VC // args[8] = <device IP Address> // args[9] = <chassis IP address> // args[10] = <slot> String usage = "For appliance vc, \n" +

"Usage: java com.cisco.anm.client.ActivateSuspendSfRserverClient (http|https) <ANM host name> <anm username> <anm password> (activate|suspend|graceful|suspend_clear_conn) <sfName/rsName/rsPort> vc <vc name> <appliance ip address>\n" +

"Example: java com.cisco.anm.client.ActivateSuspendSfRserverClient http 10.77.241.54 admin admin activate sjSF/sjRS/8080 vc Admin 10.77.241.46\n\n" +

"For module vc,\n" + "Usage: java com.cisco.anm.client.ActivateSuspendSfRserverClient

(http|https) <ANM host name> <anm username> <anm password> (activate|suspend|graceful|suspend_clear_conn) <sfName/rsName/rsPort> vc <vc name> <chassis ip address> <module slot>\n" +

"Example: java com.cisco.anm.client.ActivateSuspendSfRserverClient http 10.77.241.54 admin admin suspend sjSF/sjRS/8080 vc Admin 10.77.241.2 5\n\n" +

"For css,\n" + "Usage: java com.cisco.anm.client.ActivateSuspendSfRserverClient

(http|https) <ANM host name> <anm username> <anm password> (activate|suspend|graceful|suspend_clear_conn) <sfName/rsName/rsPort/weight> css <css ip address>\n" +

"Example: java com.cisco.anm.client.ActivateSuspendSfRserverClient https 10.77.241.54 admin admin suspend sjSF/sjRS/8080/5 css 10.77.241.100\n\n" +

"For csm,\n" + "Usage: java com.cisco.anm.client.ActivateSuspendSfRserverClient

(http|https) <ANM host name> <anm username> <anm password> (activate|suspend|graceful|suspend_clear_conn) <sfName/rsName/rsPort/rsIP> csm <chassis ip address> <module slot>\n" +

"Example: java com.cisco.anm.client.ActivateSuspendSfRserverClient https 10.77.241.54 admin admin activate sjSF/1.1.1.10/8080/1.1.1.10 csm 10.77.241.2 4\n"

;if( args.length > 10 || args.length < 8 ) {

System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0); } String proto=args[0], port="", host=args[1], user=args[2], pass=args[3] ; String activatSuspend = args[4] , sfRsName = args[5], deviceType = args[6]; if( proto != null && proto.equals("https")){ port = "8443"; }else if( proto.equals("http")){ port = "8080"; }else{ System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0); } String ipAddr="", chassisIP="", slot="", vcName="" ;

A-7API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 134: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 2: ActivateSuspendSfRserverClient

DeviceID devId = new DeviceID(); if( deviceType != null && deviceType.equals("css") ){ //css devId.setDeviceType(DeviceType.CSS); devId.setIpAddr(args[7]); }else if( deviceType.equals("csm")){ // csm devId.setDeviceType(DeviceType.CSM); devId.setChassisIPAddr(args[7]); devId.setSlot(args[8]); }else if( deviceType.equals("vc")) { if( args.length == 9 ){ //appliance devId.setDeviceType(DeviceType.VIRTUAL_CONTEXT); devId.setIpAddr(args[8]); devId.setName(args[7]); }else if (args.length == 10) { //module devId.setDeviceType(DeviceType.VIRTUAL_CONTEXT); devId.setName(args[7]); devId.setChassisIPAddr(args[8]); devId.setSlot(args[9]); }else{ System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0); } }

/* * Create SfRserver from the user's input. */ SfRserver sfRs = new SfRserver(); String[] rs = sfRsName.split("/"); if( rs.length == 3 ){ sfRs.setServerfarmName(rs[0]); sfRs.setRealserverName(rs[1]); sfRs.setPort(Integer.parseInt(rs[2])); }else if( rs.length == 4 ){ sfRs.setServerfarmName(rs[0]); sfRs.setRealserverName(rs[1]); sfRs.setPort(Integer.parseInt(rs[2])); sfRs.setWeight(Integer.parseInt(rs[3])); }else if( rs.length == 5 ){ sfRs.setServerfarmName(rs[0]); sfRs.setRealserverName(rs[1]); sfRs.setPort(Integer.parseInt(rs[2])); sfRs.setWeight(Integer.parseInt(rs[3])); sfRs.setIpAddr(rs[4]); }else{ System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0); } OperationManager oprMgr = null; SessionToken st = null; try{ oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host); /* * Invoke login() API to get session token. */ st = oprMgr.login(user, pass); if(activatSuspend.equals("activate")){ System.out.println("Start: Activate realserver");

A-8API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 135: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 2: ActivateSuspendSfRserverClient

/* * Invoke the activate api to activate the rserver in the given deviceId. */ oprMgr.activateServerfarmRserver(st, devId, sfRs, "Activate Rserver from Java WS Client."); System.out.println("Completed: Activate realserver"); }else if(activatSuspend.equals("suspend")){ System.out.println("Start: Suspend realserver"); /* * Invoke the activate api to activate the rserver in the given deviceId. */ oprMgr.suspendServerfarmRserver(st, devId, sfRs, SuspendState.SUSPEND, "Suspend Rserver from JAVA WS Client."); System.out.println("Completed: Suspend realserver"); }else if (activatSuspend.equals("graceful")){ System.out.println("Start: Graceful suspend realserver"); /* * Invoke the activate api to activate the rserver in the given deviceId. */ oprMgr.suspendServerfarmRserver(st, devId, sfRs, SuspendState.GRACEFUL, "Graceful Suspend Rserver from JAVA WS Client."); System.out.println("Completed: Graceful suspend realserver"); }else if (activatSuspend.equals("suspend_clear_conn")){ System.out.println("Start: Suspend with clear connection realserver"); /* * Invoke the activate api to activate the rserver in the given deviceId. */ oprMgr.suspendServerfarmRserver(st, devId, sfRs, SuspendState.SUSPEND_CLEAR_CONNECTIONS, "Suspend with Clear Connection Rserver from JAVA WS Client."); System.out.println("Completed: Suspend with clear connection realserver"); }else{ System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0); } }catch(Exception ex){ ex.printStackTrace(); }finally{ try{ /* * Close the ws session using logout() API. */ oprMgr.logout(st); }catch(Exception ex){ ex.printStackTrace(); } }

}}

Note As a prerequisite to compile the sample client code, you should have the client java file generated from the ANM WSDL files in the classpath. The ANM_web_services_API_client.jar file is located at the following location: http://developer.cisco.com/web/anm/docs.

A-9API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 136: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

Use Case 3: Virtual Server WS ClientThe following example shows a sample code that works with the ANM APIs that are related to virtual servers:

/** * Title: Virtual Server WS Client code * Description: Sample WS client code using java to work with Virtual server related APIs in ANM * * Copyright: Copyright(C) 2011 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @version: 1.0 */

package com.cisco.anm.client;

import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.List;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.DeviceID;import com.cisco.anm.DeviceIDArray;import com.cisco.anm.DeviceType;import com.cisco.anm.OperationManager;import com.cisco.anm.Serverfarm;import com.cisco.anm.ServerfarmArray;import com.cisco.anm.SessionToken;import com.cisco.anm.SfRserver;import com.cisco.anm.SfRserverArray;import com.cisco.anm.SuspendState;import com.cisco.anm.Vserver;import com.cisco.anm.VserverArray;

/** * * * Sample WS client code using java to work with Virtual server related APIs in ANM * * Prerequiste: * To compile the file, include the stubs generated from the wsdl file. It is already packed in a jar file - dcm-ws-client-<version>.jar * * */public class VserverWSClient { static final String NAMESPACE = "http://anm.cisco.com"; static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; // <protocol>://<IPAddress>:<Port>/anm/<service name> static final String WS_NAME = "OperationManager"; public static BindingProvider getPort(String ws, String protocol, String host, String port ) throws IOException { String url = String.format(URL_TEMPLATE, ""+ protocol,port, host, ws); String ns = NAMESPACE;

A-10API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 137: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

BindingProvider bp; Service svc; try { QName qname = new QName(ns, ws + "Service"); Class<Service> clazz = (Class<Service>) Class.forName("com.cisco.anm." + ws + "Service"); Constructor<Service> ctor = (Constructor<Service>) clazz.getConstructor(new Class[]{URL.class, QName.class}); svc = ctor.newInstance(new Object[]{new URL(url+"?wsdl"), qname}); Method m = svc.getClass().getMethod("get"+ws+"Port", null); bp = (BindingProvider)m.invoke(svc, null); } catch (Exception e) { throw new RuntimeException(e); } return bp; }

public static void main(String args[]){ // args[0] = protocol , http or https // args[1] = IP Address or hostname of ANM server // args[2] = username, // args[3] = password. // args[4] = (activate|suspend|listAllVirtualServer) // args[5] = virtualServerName/(policymap) // args[6] = (css|csm|vc) // args[7] = <vc name> if args[6] is VC // args[8] = <device IP Address> // args[9] = <chassis IP address> // args[10] = <slot> String usage = "For ACE4710 Appliance Virtual Context, \n" +

"Usage: java com.cisco.anm.client.VserverWSClient (http|https) <ANM host name> <anm username> <anm password> (activate|suspend) <(virtualServerName/policymap) | virtualServerName> vc <vc name> <appliance ip address>\n" +

"Example: java com.cisco.anm.client.VserverWSClient http 10.77.241.54 admin admin activate sjVS/global vc Admin 10.77.241.46\n\n" +

"For ACE Module Virtual Context,\n" + "Usage: java com.cisco.anm.client.VserverWSClient (http|https) <ANM

host name> <anm username> <anm password> (activate|suspend) <(virtualServerName/policymap) | virtualServerName> vc <vc name> <chassis ip address> <module slot>\n" +

"Example: java com.cisco.anm.client.VserverWSClient http 10.77.241.54 admin admin suspend sjVS/global vc Admin 10.77.241.2 5\n\n" +

"For CSS,\n" + "Usage: java com.cisco.anm.client.VserverWSClient (http|https) <ANM

host name> <anm username> <anm password> (activate|suspend) <(virtualServerName/policymap) | virtualServerName> css <css ip address>\n" +

"Example: java com.cisco.anm.client.VserverWSClient https 10.77.241.54 admin admin suspend sjVS/global css 10.77.241.100\n\n" +

"For CSM,\n" + "Usage: java com.cisco.anm.client.VserverWSClient (http|https) <ANM

host name> <anm username> <anm password> (activate|suspend) <(virtualServerName/policymap) | virtualServerName> csm <chassis ip address> <module slot>\n" +

"Example: java com.cisco.anm.client.VserverWSClient https 10.77.241.54 admin admin activate sjVS/global csm 10.77.241.2 4\n\n" +

"To list all Virtualservers in ANM ,\n" + "Usage: java com.cisco.anm.client.VserverWSClient (http|https) <ANM

host name> <anm username> <anm password> listAllVirtualServer\n" +

A-11API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 138: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

"Example: java com.cisco.anm.client.VserverWSClient https 10.77.241.54 admin admin listAllVirtualServer\n\n";

if( args.length > 10 || args.length < 8 ) {if( args.length != 5 ) {

System.out.println("Invalid arguments."); System.out.println(usage); System.exit(0);

} }

if( args.length != 5 ) {String proto=args[0], port="", host=args[1], user=args[2], pass=args[3] ;String activatSuspend = args[4] , vsName = args[5], deviceType = args[6];

if( proto != null && proto.equals("https")){port = "8443";

}else if( proto.equals("http")){port = "8080";

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}DeviceID devId = new DeviceID();if( deviceType != null && deviceType.equals("css") ){ //css

devId.setDeviceType(DeviceType.CSS);devId.setIpAddr(args[7]);

}else if( deviceType.equals("csm")){ // csmdevId.setDeviceType(DeviceType.CSM);devId.setChassisIPAddr(args[7]);devId.setSlot(args[8]);

}else if( deviceType.equals("vc")) {if( args.length == 9 ){

//appliancedevId.setDeviceType(DeviceType.VIRTUAL_CONTEXT);devId.setIpAddr(args[8]);devId.setName(args[7]);

}else if (args.length == 10) {//moduledevId.setDeviceType(DeviceType.VIRTUAL_CONTEXT);devId.setName(args[7]);devId.setChassisIPAddr(args[8]);devId.setSlot(args[9]);

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}}

/* * Create Vserver from the user's input. */Vserver virtualServer = new Vserver();String[] vs = vsName.split("/");if( vs.length == 1 ){

virtualServer.setVirtualserverName(vs[0]);}else if( vs.length == 2 ){

virtualServer.setVirtualserverName(vs[0]);virtualServer.setPolicyMapName(vs[1]);

}else{System.out.println("Invalid arguments.");System.out.println(usage);

A-12API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 139: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

System.exit(0);}OperationManager oprMgr = null;SessionToken st = null;try{

oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host);

/* * Invoke login() API to get session token. */st = oprMgr.login(user, pass);

if(activatSuspend.equals("activate")){System.out.println("Start: Activate Virtualserver");/* * Invoke the activate api to activate the vserver in the given

deviceId. */oprMgr.activateVirtualServer(st, devId, virtualServer, "Activate

Vserver from Java WS Client.");System.out.println("Completed: Activate Virtualserver");

}else if(activatSuspend.equals("suspend")){

System.out.println("Start: Suspend Virtualserver");/* * Invoke the suspend api to suspend the vserver in the given deviceId. */oprMgr.suspendVirtualServer(st, devId, virtualServer, "Suspend Vserver

from JAVA WS Client.");System.out.println("Completed: Suspend Virtualserver");

}

else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}oprMgr.listVirtualServers(st, devId, true);

}catch(Exception ex){ex.printStackTrace();

}finally{try{

/* * Close the ws session using logout() API. */oprMgr.logout(st);

}catch(Exception ex){ex.printStackTrace();

}}

}else if(args.length == 5){

String proto=args[0], port="", host=args[1], user=args[2], pass=args[3];OperationManager oprMgr = null;SessionToken st = null;if( proto != null && proto.equals("https")){

port = "8443";}else if( proto.equals("http")){

port = "8080";}else{

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

A-13API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 140: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

}try{

oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host);

/* * Invoke login() API to get session token. */st = oprMgr.login(user, pass);

DeviceID devId = new DeviceID();DeviceIDArray deviceIdArr = oprMgr.listDeviceIds(st,

DeviceType.ACE_BLADE);List<DeviceID> listDeviceId = deviceIdArr.getItem();System.out.println("ACE Module");System.out.println("Device Type\t | Virtual Context Name\t | Module Slot\t

| Chassis IP address\t | Virtualserver Name\t");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for( DeviceID dev : listDeviceId ){ /* * Invoke listVirtualContext() to get all the virtual contexts for each ACE

module * imported in ANM. */ DeviceIDArray vcIds = oprMgr.listVirtualContexts(st,dev);

for( DeviceID vcId : vcIds.getItem() ){/*

* Invoke listVirtualservers() API to get all the Virtual Servers (recognized by ANM) configured for each VC

* */

VserverArray vsArr = oprMgr.listVirtualServers(st, vcId, false);for(Vserver vs: vsArr.getItem() ){

System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | "

+ vcId.getSlot() + "\t\t | " + vcId.getChassisIPAddr() + "\t\t | "

+ vs.getVirtualserverName());}

}}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("\n\n\n"); /* * Use the session token obtained from the login() API call and get all

ACE4710 Appliances * imported in ANM. */

deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.ACE_4710);listDeviceId = deviceIdArr.getItem();System.out.println("ACE4710 Appliance");System.out.println("Device Type\t | Virtual Context Name\t | Appliance IP

address\t | Virtualserver Name\t ");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

A-14API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 141: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

for( DeviceID dev : listDeviceId ){/*

* Invoke listVirtualContext() to get all the virtual contexts for each ACE module

* imported in ANM. */

DeviceIDArray vcIds = oprMgr.listVirtualContexts(st,dev);for( DeviceID vcId : vcIds.getItem() ){

/* * Invoke listVirtualServers() API to get all the Virtual Servers

(recognized by ANM) configured for each VC * */

VserverArray vsArr = oprMgr.listVirtualServers(st, vcId, false);for(Vserver vs: vsArr.getItem() ){

System.out.println(vcId.getDeviceType() + "\t | " + vcId.getName() + "\t\t | "

+ vcId.getIpAddr() + "\t\t | " + vs.getVirtualserverName() + "\t | "

);}

}}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("\n\n\n"); /* * Use the session token obtained from the login() API call and get all CSM

modules * imported in ANM. */

deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.CSM);listDeviceId = deviceIdArr.getItem();System.out.println("CSM");System.out.println("Device Type\t | Module Slot\t | Chassis IP address\t |

Virtualserver Name\t ");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for( DeviceID dev : listDeviceId ){/*

* Invoke listVirtualServers() API to get all the Virtual Servers(recognized by ANM) configured for each CSM * */

VserverArray vsArr = oprMgr.listVirtualServers(st, dev, false);for(Vserver vs: vsArr.getItem() ){

System.out.println(dev.getDeviceType() + "\t | " + dev.getSlot() + "\t\t | " + dev.getChassisIPAddr() + "\t\t | "

+ vs.getVirtualserverName() + "\t | " );

}

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("\n\n\n");

A-15API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 142: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 3: Virtual Server WS Client

/* * Use the session token obtained from the login() API call and get all CSS

devices. * imported in ANM. */

deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.CSS);listDeviceId = deviceIdArr.getItem();System.out.println("CSS");System.out.println("Device Type\t | Device IP address\t | Virtualserver

Name\t ");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for( DeviceID dev : listDeviceId ){/*

* Invoke listVirtualServers() API to get all the Virtual Servers configured for each CSS device. * */

VserverArray vsArr = oprMgr.listVirtualServers(st, dev, false);for(Vserver vs: vsArr.getItem() ){

System.out.println(dev.getDeviceType() + "\t | " + dev.getIpAddr() + "\t\t | " +

vs.getVirtualserverName() + "\t | " );

}

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("\n\n\n"); }

catch(Exception ex){ex.printStackTrace();

}finally{try{

/* * Close the ws session using logout() API. */oprMgr.logout(st);

}catch(Exception ex){ex.printStackTrace();

}}

}else {

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

} }}

A-16API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 143: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

Use Case 4: GSSWSClientThe following example shows a sample code to activate, suspend, and list the answers and DNS rules configured on a GSS:

/** * Title: GSSWSClient * Description: Sample WS client code using java to activate/suspend/list the answer/dnsrule configured in GSS device * * Copyright: Copyright(C) 2011 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @version: 1.0 */

package com.cisco.anm.client;

import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.List;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.AnswerArray;import com.cisco.anm.DeviceID;import com.cisco.anm.DeviceIDArray;import com.cisco.anm.DeviceType;import com.cisco.anm.DnsRuleArray;import com.cisco.anm.OperationManager;import com.cisco.anm.Serverfarm;import com.cisco.anm.ServerfarmArray;import com.cisco.anm.SessionToken;import com.cisco.anm.SfRserver;import com.cisco.anm.Answer;import com.cisco.anm.DnsRule;import com.cisco.anm.SfRserverArray;import com.cisco.anm.SuspendState;

/** * * * Sample WS client code using java to activate/suspend/list the answer/dnsrule configured in GSS device * * Prerequiste: * To compile the file, include the stubs generated from the wsdl file. It is already packed in a jar file - dcm-ws-client-<version>.jar * * */public class GSSWSClient {

static final String NAMESPACE = "http://anm.cisco.com"; static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; //

<protocol>://<IPAddress>:<Port>/anm/<service name>static final String WS_NAME = "OperationManager";

public static BindingProvider getPort(String ws, String protocol, String host, String port ) throws IOException {

A-17API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 144: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

String url = String.format(URL_TEMPLATE, ""+ protocol,port, host, ws);String ns = NAMESPACE;

BindingProvider bp;

Service svc;try {

QName qname = new QName(ns, ws + "Service");Class<Service> clazz = (Class<Service>) Class.forName("com.cisco.anm." + ws +

"Service");Constructor<Service> ctor = (Constructor<Service>) clazz.getConstructor(new

Class[]{URL.class, QName.class});svc = ctor.newInstance(new Object[]{new URL(url+"?wsdl"), qname});Method m = svc.getClass().getMethod("get"+ws+"Port", null);bp = (BindingProvider)m.invoke(svc, null);

} catch (Exception e) {throw new RuntimeException(e);

}return bp;

}

public static void main(String args[]){

// args[0] = protocol , http or https// args[1] = IP Address or hostname of ANM server// args[2] = username,// args[3] = password.// args[4] = (activate|suspend|list)// args[5] = (answer|dns)// args[6] = <device IP Address>// args[7] = <answerName/ansIpAdress> | <ruleName/sourceAddress>

String usage = "For Answer activate/suspend operation , \n" + "Usage: java com.cisco.anm.client.GSSWSClient (http|https) <ANM host name> <anm

username> <anm password> (activate|suspend) (answer) <GSS ip address> <answerName/ansIpAdress> \n" +

"Example: java com.cisco.anm.client.GSSWSClient http 10.77.241.54 admin admin activate answer 10.77.241.46 VIP-CSCO-9-99/11.0.9.99 \n\n" +

"To list all Answers, \n" + "Usage: java com.cisco.anm.client.GSSWSClient (http|https) <ANM host name> <anm

username> <anm password> (list) (answer) \n" +"Example: java com.cisco.anm.client.GSSWSClient http 10.77.241.54 admin admin list

answer \n\n" +

"For DNS rule activate/suspend operation , \n" + "Usage: java com.cisco.anm.client.GSSWSClient (http|https) <ANM host name> <anm

username> <anm password> (activate|suspend) (dns) <GSS ip address> <ruleName> \n" +"Example: java com.cisco.anm.client.GSSWSClient http 10.77.241.54 admin admin

activate dns 10.77.241.46 RULE-CSCO-9-96 \n\n" +

"To list all DNS rules, \n" + "Usage: java com.cisco.anm.client.GSSWSClient (http|https) <ANM host name> <anm

username> <anm password> (list) <dns> <GSS name> \n" +"Example: java com.cisco.anm.client.GSSWSClient http 10.77.241.54 admin admin list

dns \n\n";if(args.length < 8 ) {

if( args.length != 6 ){System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

A-18API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 145: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

}

String proto=args[0], port="", host=args[1], user=args[2], pass=args[3] ;String opeartion = args[4] , type = args[5];

if( proto != null && proto.equals("https")){port = "8443";

}else if( proto.equals("http")){port = "8080";

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

OperationManager oprMgr = null;SessionToken st = null;String operData = null;String[] data = null;DeviceID GSS = null;if(args.length==8){

GSS = new DeviceID();GSS.setDeviceType(DeviceType.GSS);GSS.setSlot("0");GSS.setIpAddr(args[6]);operData = args[7];data = operData.split("/");

}

if(type.equalsIgnoreCase("Answer")){

Answer answer = new Answer();if(!opeartion.equalsIgnoreCase("list")){

if( data.length == 2 ){answer.setAnswerName(data[0]);answer.setIpAddr(data[1]);answer.setType("vip");

}else{

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}}try{

oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host);

/* * Invoke login() API to get session token. */st = oprMgr.login(user, pass);

if(opeartion.equalsIgnoreCase("activate")){System.out.println("Start: Activate Answer");/* * Invoke the activate api to activate the answer in the given

deviceId. */oprMgr.activateAnswer(st, GSS, answer, "Activate Answer from Java WS

Client.");

System.out.println("Completed: Activate answer");}else if(opeartion.equalsIgnoreCase("suspend")){

A-19API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 146: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

System.out.println("Start: Suspend answer");/* * Invoke the activate api to suspend the answer in the given deviceId. */oprMgr.suspendAnswer(st, GSS, answer, "Suspend Answer from Java WS

Client.");

System.out.println("Completed: Suspend answer");}else if (opeartion.equalsIgnoreCase("list")){

System.out.println("Start: List Answers");DeviceIDArray deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.GSS);List listDeviceId = deviceIdArr.getItem();for( DeviceID gss: deviceIdArr.getItem() ){

/* * Invoke the list api to get the list of answers in the given

deviceId. */AnswerArray answerArray = oprMgr.listAnswers(st, gss);int list_size = 0;if (answerArray.getItem()!= null &&

!answerArray.getItem().isEmpty())list_size = answerArray.getItem().size();

System.out.println("GSS Name\t | Answer Name\t | Answer IP Address\t | Config State \t | PGSSM Oper State \t | Answer Group \t | Location \t");

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for( Answer ans: answerArray.getItem() ){ System.out.println(gss.getName() + "\t | " +

ans.getAnswerName() + "\t | " + ans.getIpAddr() + "\t\t | " + ans.getConfigState() + "\t\t | " + ans.getOperState()

+ "\t\t | " + ans.getAnswerGroups() + "\t\t | "+ ans.getLocation() + "\t\t ");

}if( answerArray.getItem().size() == 0) {

System.out.println("No answers is configured in the given GSS device" );

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

}if( deviceIdArr.getItem().size() == 0) {

System.out.println("No GSS device is imported in this ANM server" );

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Completed: List Answers");}

} catch(Exception ex){

ex.printStackTrace();}finally{

try{/* * Close the ws session using logout() API.

A-20API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 147: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

*/oprMgr.logout(st);

}catch(Exception ex){ex.printStackTrace();

}}

}else if(type.equalsIgnoreCase("dns")){

DnsRule dnsRule = new DnsRule();if(!opeartion.equalsIgnoreCase("list")){

if( data.length == 1 ){dnsRule.setDnsRuleName(data[0]);//dnsRule.setSourceAddress(data[1]);

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}}try{

oprMgr = (OperationManager) getPort(WS_NAME, proto, port, host);

/* * Invoke login() API to get session token. */st = oprMgr.login(user, pass);

if(opeartion.equalsIgnoreCase("activate")){System.out.println("Start: Activate dns rule");/* * Invoke the activate api to activate the dns rule in the given

deviceId. */oprMgr.activateDnsRule(st, GSS, dnsRule, "Activate DNS rule from Java

WS Client.");

System.out.println("Completed: Activate dns rule");}else if(opeartion.equalsIgnoreCase("suspend")){

System.out.println("Start: Suspend dns rule");/* * Invoke the activate api to suspend the dns rule in the given

deviceId. */oprMgr.suspendDnsRule(st, GSS, dnsRule, "Suspend DNS rule from Java WS

Client.");

System.out.println("Completed: Suspend dns rule");}else if (opeartion.equalsIgnoreCase("list")){

DeviceIDArray deviceIdArr = oprMgr.listDeviceIds(st, DeviceType.GSS);List listDeviceId = deviceIdArr.getItem();System.out.println("Start: List DNS rules");for( DeviceID gss: deviceIdArr.getItem() ){

/* * Invoke the list api to get the list of dns rule from the given

deviceId. */DnsRuleArray dnsruleArray = oprMgr.listDnsRules(st, gss);int list_size = 0;if (dnsruleArray.getItem()!= null &&

!dnsruleArray.getItem().isEmpty())System.out.println("GSS name\t | DNS name\t | Source Address \t

| Domains \t | Config state \t | Answer Group \t | Owner \t");

A-21API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 148: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 4: GSSWSClient

System.out.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for( DnsRule dns: dnsruleArray.getItem() ){ System.out.println(gss.getName() + "\t | " +

dns.getDnsRuleName() + "\t | " + dns.getSourceAddress() + "\t\t | " + dns.getDomains() + "\t\t | " + dns.getDnsConfigState()

+ "\t\t | "+ dns.getAnswerGroups() + "\t\t | " + dns.getOwner() +

"\t\t ");}if( dnsruleArray.getItem().size() == 0) {

System.out.println("No dns rule is configured in the given GSS device" );

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

}if( deviceIdArr.getItem().size() == 0) {

System.out.println("No GSS device is imported in this ANM server" );

}

System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Completed: List DNS rule");}

}catch(Exception ex){

ex.printStackTrace();}finally{

try{/* * Close the ws session using logout() API. */oprMgr.logout(st);

}catch(Exception ex){ex.printStackTrace();

}}

}else{

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

}}

A-22API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 149: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

Use Case 5: ApplTemplateCreateWSClientThe following example code shows how to obtain application template instances and definitions lists, and how to create and delete a template instance.

/** * Title: ApplTemplateCreateWSClient * Description: Sample WS client code using java. It lists the Application Template Instances, List of template definition * Create and delete template options * * Copyright: Copyright(C) 2011 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @author: kamachan, Sep 2011 * @version: 1.0 */package com.cisco.anm.client;

import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Set;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.ApplicationTemplateManager;import com.cisco.anm.DeviceID;import com.cisco.anm.DeviceIDArray;import com.cisco.anm.DeviceType;import com.cisco.anm.OperationManager;import com.cisco.anm.Session;import com.cisco.anm.SessionToken;import com.cisco.anm.TagName;import com.cisco.anm.TemplateDefinition;import com.cisco.anm.TemplateDefinitionArray;import com.cisco.anm.TemplateInput;import com.cisco.anm.TemplateInputArray;import com.cisco.anm.TemplateInstance;import com.cisco.anm.TemplateInstanceArray;import com.cisco.anm.Vserver;

/** * @author kamachan * * Description: Sample WS client code using java. It lists the * Application Template Instances, List of template definition Create * and delete template options * Prerequisite: To compile the file, * include the stubs generated from the wsdl file. It is already packed * in a jar (????) file - dcm-ws-client-<version>.jar ???? * * */public class ApplTemplateWSClient {

static final String NAMESPACE = "http://anm.cisco.com";

A-23API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 150: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; // <protocol>://<IPAddress>:<Port>/anm/<service

// name>static final String WS_NAME = "OperationManager";

public static void main(String args[]) {

// validate the args// args[0] = protocol , http or https// args[1] = IP Address or hostname of ANM server// args[2] = username,// args[3] = password.

String usage = "Usage: java com.cisco.anm.client.ApplTemplateCreateWSClient (http|https) <ANM host name> <anm username> <anm password> \n"

+ "Example: java com.cisco.anm.client.ApplTemplateCreateWSClient http 10.77.241.134 admin admin \n\n";

if (args.length != 4) {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

ApplicationTemplateManager applMgr = null;SessionToken st = null;OperationManager oprMgr = null;Session session = null;int len = args.length;

/* * ***********USER INPUTS NEEDS TO BE GIVEN HERE******************* * Inputs should be given based on the xml variable elements */

// Input for the Layer 3 LB template instance creationString templateName = "Layer 3 LB";// Template NameString name = "layer3lb-5";// Virtual server ip address. IPv4/IPv6 address supported Ip Address// with prefix length can be given.String vip = "142.12.3.3/128";// Real server ip address. Can be given as comma seperated. IPv4/IPv6// address supportedString ipAddr = "144.12.3.3,144.12.3.144,44.12.3.4";// Sticky can be enable by providing this value.String sticky = "false";// all vlan can be given or the configured vlan can be givenString vlans = "ALL_VLAN";// Enable soure natString autoNat = "false";

// User need to give the contex name hereString contextName = "";// Need to give the ip address for the Appliance or chassis ip address// for the ACE moduleString ipAddress = "";// Slot should be "0" for the Appliance and the corresponding slot// number should be given for the ACE moduleString slot = "";

/* * To Delete the device instance need to provide the instance id */

A-24API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 151: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

int instanceId = -1;

// ********* USER INPUT ends here*************************

String proto = args[0], port = "", host = args[1], user = args[2], pass = args[3];

if (proto != null && proto.equals("https")) {port = "8443";

} else if (proto.equals("http")) {port = "8080";

} else {System.out

.println("Invalid arguments. Please provide the http/https protocol in the argument");

System.out.println(usage);System.exit(0);

}

DeviceID devId = new DeviceID();

try {

/* * Formulate the mapping based on the input need to given for the * specific application template input. Need to check the App * Template xml before putting the key value for other App * Templates. */

// This map contains the Application as the key. Example// "Layer 3 LB" is key here.Map<String, Map<String, String>> inputData = new HashMap<String, Map<String,

String>>();// Based on the variable name user need to formulate the map for// other App templates.Map<String, String> userInput = new HashMap<String, String>();userInput.put("name", name);userInput.put("vip", vip);userInput.put("ipAddr", ipAddr);userInput.put("sticky", sticky);userInput.put("vlans", vlans);userInput.put("autoNat", autoNat);inputData.put(templateName, userInput);

session = (Session) getPort("Session", proto, port, host);oprMgr = (OperationManager) getPort("OperationManager", proto,

port, host);applMgr = (ApplicationTemplateManager) getPort(

"ApplicationTemplateManager", proto, port, host);

// Invoke login() API to get session token.st = session.login(user, pass);

/* * Use the session token obtained from the previous call and get all * ACE modules imported in ANM. */DeviceIDArray deviceIdArr = oprMgr.listDeviceIds(st,

DeviceType.VIRTUAL_CONTEXT);List<DeviceID> listDeviceId = deviceIdArr.getItem();

if (listDeviceId == null || listDeviceId.size() == 0) {System.out

A-25API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 152: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

.println(" ACE module or Ace appliance needs to be imported to porvision the template instance ");

} else {if (contextName.equals("") && ipAddress.equals("")) {

devId = listDeviceId.get(0);} else {

devId.setDeviceType(DeviceType.VIRTUAL_CONTEXT);devId.setName(contextName);if (slot.equalsIgnoreCase("") || slot.equalsIgnoreCase("0"))

devId.setIpAddr(ipAddress);else {

devId.setChassisIPAddr(ipAddress);devId.setSlot(slot);

}}

TemplateInstanceArray templateInstanceArray = applMgr.listTemplateInstances(st);

// applMgr.List<TemplateInstance> instanceList = templateInstanceArray

.getItem();Map<Integer, TemplateInstance> instanceMap = new HashMap<Integer,

TemplateInstance>();

for (TemplateInstance tempInstance : templateInstanceArray.getItem()) {

instanceMap.put(tempInstance.getInstanceId(), tempInstance);}Set keySet = (Set) instanceMap.keySet();List<Integer> list = new ArrayList<Integer>(keySet);Collections.sort(list);System.out.println("List of created Template Instances");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("InstanceID | Template name\t | Status\t | Type\t |

Template type\t\t |Device\t\t | Last Updated Time\t");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for (Integer keynum : list) {

TemplateInstance tempInstance = instanceMap.get(keynum);System.out.println(tempInstance.getInstanceId() + " | "

+ tempInstance.getTemplateName() + "\t\t | "+ tempInstance.getStatus() + "\t\t | "+ tempInstance.getType() + "\t\t | "+ tempInstance.getApplicationType() + "\t | "+ tempInstance.getDeviceId() + "\t\t | "+ tempInstance.getLastUpdatedTime() + "\t\t ");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

TemplateDefinitionArray definationArray = applMgr

A-26API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 153: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

.listTemplateDefinitions(st);List<TemplateDefinition> definationList = definationArray

.getItem();Map<Integer, TemplateDefinition> definationMap = new HashMap<Integer,

TemplateDefinition>();for (TemplateDefinition defination : definationArray.getItem()) {

definationMap.put(new Integer(defination.getId()),defination);

}

keySet = (Set) definationMap.keySet();list = new ArrayList<Integer>(keySet);Collections.sort(list);

System.out.println("List of Available Template Definations");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("TemplateID | Template\t\t | Template version | Template

Name\t | Template Description\t ");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for (Integer id : list) {TemplateDefinition tempDefn = definationMap.get(id);System.out.println(tempDefn.getId() + "|"

+ tempDefn.getApplication() + "\t\t | "+ tempDefn.getAppVersion() + "| "+ tempDefn.getName() + "\t | "+ tempDefn.getDescription() + "\t ");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Template Definations metadata for the App Template :"

+ templateName);System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Tag Name\t |Input Name\t | InputType\t | Child Element

size\t ");for (int j = 0; j < definationList.size(); j++) {

TemplateInputArray tia = applMgr.getTemplateDefinitionMetadata(st, definationList

.get(j));if (definationList.get(j).getApplication()

.equalsIgnoreCase(templateName)) {

System.out.println(definationList.get(j).getApplication()+ "\t\t | ");

for (TemplateInput tempInput : tia.getItem()) {

A-27API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 154: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

System.out.println(tempInput.getTagName() + "\t | "+ tempInput.getName() + "\t | "+ tempInput.getType() + "\t | "+ tempInput.getChildElements().size()+ "\t ");

if (tempInput.getChildElements().size() >= 1) {for (TemplateInput temp : tempInput

.getChildElements()) {System.out.println(temp.getTagName()

+ "\t | " + temp.getName()+ "\t | " + temp.getType()+ "\t | "+ temp.getChildElements().size()+ "\t ");

if (temp.getChildElements().size() >= 1) {for (TemplateInput input : temp

.getChildElements()) {System.out.println(input

.getTagName()+ "\t | "+ input.getName()+ "\t | "+ input.getType()+ "\t | "+ input.getChildElements()

.size() + "\t ");}

}}

}}

if (setData(tia, definationList.get(j), inputData)) {System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Start creating instance for the templateName:

"+ templateName);

int instId = applMgr.createTemplateInstance(st,devId, definationList.get(j), tia);

System.out.println("Template instance created successfully."

+ templateName+ " instance Id is :" + instId);

}

}}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

if (devId != null && instanceId != -1) {System.out

.println("Start deleting the configuration related to the template instance id :"

+ instanceId);applMgr.deleteTemplateInstance(st, devId, instanceId);

A-28API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 155: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

System.out.println("Deleted the configuration related to the instance id

:"+ instanceId);

}}

} catch (Exception ex) {ex.printStackTrace();

} finally {try {

// Close the ws session using logout() API.oprMgr.logout(st);

} catch (Exception ex) {ex.printStackTrace();

}}

}

private static boolean setData(TemplateInputArray tia,TemplateDefinition td, Map<String, Map<String, String>> data) {

Map<String, String> dt = data.get(td.getApplication());boolean retval = true;if (dt == null) {

retval = false;return retval;

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

System.out.println("Application Template: " + td.getApplication()+ "\n");

for (Map.Entry<String, String> entry : dt.entrySet()) {System.out.println("TemplateInput element = " + entry.getKey()

+ ", Value = " + entry.getValue());}

for (TemplateInput ti : tia.getItem()) {setValue(ti, dt);

}

return retval;}

private static void setValue(TemplateInput ti, Map<String, String> dt) {

if (ti.getTagName().equals(TagName.VARIABLE)) {ti.setUserData(dt.get(ti.getName()));if (ti.getChildElements().size() > 0) {

for (int i = 0; i < ti.getChildElements().size(); i++) {TemplateInput inp = (TemplateInput) ti.getChildElements()

.get(i);setValue(inp, dt);

}}

} else if (ti.getTagName().equals(TagName.VARIABLE)) {ti.setUserData(dt.get(ti.getName()));

} else if (ti.getTagName().equals(TagName.ARRAY)) {for (TemplateInput e : ti.getChildElements()) {

String[] val = dt.get(e.getName()).split(",");for (String v : val) {

A-29API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 156: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 5: ApplTemplateCreateWSClient

e.getUserDatas().add(v);}

}} else if (ti.getChildElements().size() > 0) {

for (int i = 0; i < ti.getChildElements().size(); i++) {TemplateInput inp = (TemplateInput) ti.getChildElements()

.get(i);setValue(inp, dt);

}}

}

public static BindingProvider getPort(String ws, String protocol,String host, String port) throws IOException {

String url = String.format(URL_TEMPLATE, "" + protocol, port, host, ws);String ns = NAMESPACE;BindingProvider bp;Service svc;try {

QName qname = new QName(ns, ws + "Service");Class<Service> clazz = (Class<Service>) Class

.forName("com.cisco.anm." + ws + "Service");Constructor<Service> ctor = (Constructor<Service>) clazz

.getConstructor(new Class[] { URL.class, QName.class });svc = ctor

.newInstance(new Object[] { new URL(url + "?wsdl"), qname });Method m = svc.getClass().getMethod("get" + ws + "Port", null);bp = (BindingProvider) m.invoke(svc, null);

} catch (Exception e) {throw new RuntimeException(e);

}return bp;

}}

A-30API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 157: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

Use Case 6: RBACManager WS Client codeThe following example shows a java-based sample code that works with the ANM APIs that are related to RBACManager:

/** * Title: RBACManager WS Client code * Description: Sample WS client code using java to work with RBACManager related APIs in ANM * * Copyright: Copyright(C) 2012 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @version: 1.0 */

package com.cisco.anm.client;

import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import java.util.List;

import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import net.java.dev.jaxb.array.StringArray;

import com.cisco.anm.Domain;import com.cisco.anm.DomainArray;import com.cisco.anm.OperationManager;import com.cisco.anm.OperationStatus;import com.cisco.anm.OperationStatusArray;import com.cisco.anm.Organization;import com.cisco.anm.OrganizationArray;import com.cisco.anm.RBACManager;import com.cisco.anm.Role;import com.cisco.anm.RoleArray;import com.cisco.anm.SessionToken;import com.cisco.anm.User;import com.cisco.anm.UserArray;import com.cisco.anm.UserPassword;import com.cisco.anm.XmlArray;

/** * * Sample WS client code using java to work with RBAC related APIs in ANM * Prerequiste: To compile the file, include the stubs generated from the wsdl * file. It is already packed in a jar file - dcm-ws-client-<version>.jar * */public class RBACWSClient {

static final String NAMESPACE = "http://anm.cisco.com";static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; //

<protocol>://<IPAddress>:<Port>/anm/<service name>static final String WS_NAME = "OperationManager";

public static BindingProvider getPort(String ws, String protocol,String host, String port) throws IOException {

String url = String.format(URL_TEMPLATE, "" + protocol, port, host, ws);String ns = NAMESPACE;

A-31API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 158: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

BindingProvider bp;

Service svc;try {

QName qname = new QName(ns, ws + "Service");Class<Service> clazz = (Class<Service>) Class

.forName("com.cisco.anm." + ws + "Service");Constructor<Service> ctor = (Constructor<Service>) clazz

.getConstructor(new Class[] { URL.class, QName.class });svc = ctor

.newInstance(new Object[] { new URL(url + "?wsdl"), qname });Method m = svc.getClass().getMethod("get" + ws + "Port", null);bp = (BindingProvider) m.invoke(svc, null);

} catch (Exception e) {throw new RuntimeException(e);

}return bp;

}

public static void main(String args[]) {

// args[0] = protocol , http or https// args[1] = IP Address or hostname of ANM server// args[2] = username,// args[3] = password.// args[4] = (list|create|update|delete)

String usage = "For list Operations, \n"+ "Usage: java com.cisco.anm.client.RBACWSClient (http|https) <ANM host

name> <anm username> <anm password> <list> <org> \n"+ "Example: java com.cisco.anm.client.RBACWSClient http 10.77.241.54 admin

admin list org \n\n"

+ "Usage: java com.cisco.anm.client.RBACWSClient (http|https) <ANM host name> <anm username> <anm password> <list> (roles|domains) <org name>\n"

+ "Example: java com.cisco.anm.client.RBACWSClient http 10.77.241.54 admin admin list domains Default\n\n"

+ "Usage: java com.cisco.anm.client.RBACWSClient (http|https) <ANM host name> <anm username> <anm password> <list> <users> <org name> <true|false>\n"

+ "Example: java com.cisco.anm.client.RBACWSClient http 10.77.241.54 admin admin list users Default true \n\n"

+ "For delete Operation, \n"+ "Usage: java com.cisco.anm.client.RBACWSClient (http|https) <ANM host

name> <anm username> <anm password> <delete> <org name> <username1> <username2>...<name-n>\n"

+ "Example: java com.cisco.anm.client.RBACWSClient http 10.77.241.54 admin admin delete Default user1 \n\n"

+ "For Create/update Operations, \n"+ "Usage: java com.cisco.anm.client.RBACWSClient (http|https) <ANM host

name> <anm username> <anm password> <create|update> <org name> <username> <name> <password> <pword> <role> <role1> <domain> <domain1> \n"

+ "Example: java com.cisco.anm.client.RBACWSClient http 10.77.241.54 admin admin create Default username alex password alex123 role ACE-Admin domain custom-domain1 \n\n";

if (args.length > 14 || args.length < 6) {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

A-32API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 159: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

if (args.length != 5) {String proto = args[0], port = "", host = args[1], user = args[2], pass =

args[3];String operation = args[4];

if (proto != null && proto.equals("https")) {port = "8443";

} else if (proto != null && proto.equals("http")) {port = "8080";

} else {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

OperationManager oprMgr = null;RBACManager rbacMgr = null;SessionToken st = null;try {

oprMgr = (OperationManager) getPort("OperationManager", proto,port, host);

rbacMgr = (RBACManager) getPort("RBACManager", proto, port,host);

/* * Invoke login() API to get session token. */st = oprMgr.login(user, pass);

User userOne = null;String organization = null;organization = null;String showPassword = null;OperationStatusArray OperStatArray = null;UserArray userArray = null;StringArray userNameArray = new StringArray();StringArray domainNamesArray = null;StringArray excludeTypes = new StringArray();

if (operation != null && operation.equalsIgnoreCase("list"))

{String type = args[5];if (type != null && "org".equalsIgnoreCase(type)) {

// Retrieves the list of organization configured in ANMOrganizationArray orgArray = rbacMgr

.listOrganizations(st);

List<Organization> listOrganization = orgArray.getItem();

System.out.println("Name\t\t | Contact\t | Phone\t | Email\t |

Authentication\t | RemoteAuthorization\t | Fallback\n ");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for (Organization org : listOrganization) {System.out.println(org.getName() + "\t\t | "

+ org.getContact() + "\t |"+ org.getPhone() + "\t | " + org.getEmail()+ "\t |" + org.getAuthentication() + "\t |"

A-33API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 160: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

+ org.getRemoteAuthorization() + "\t |"+ org.getFallback() + "\t ");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

} else if (type != null && "roles".equalsIgnoreCase(type)) {if (args.length != 7) {

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}organization = args[6];// Retrieves the list of roles configured in the ANM for// the given organizationRoleArray roleArray = rbacMgr.listRoles(st,

organization);

List<Role> roleList = roleArray.getItem();System.out

.println("Name\t\t\t\t | Description\t | roleTasks\t \n ");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for (Role role : roleList) {

System.out.println(role.getName() + "\t\t\t\t | "+ role.getDescription() + "\t |"+ role.getRoleTasks() + "\t ");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

} else if (type != null && "domains".equalsIgnoreCase(type)) {

if (args.length != 7) {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}organization = args[6];// Retrieves the list of domain names configured in ANM// for the given organizationdomainNamesArray = rbacMgr.listDomainNames(st,

organization);// Retrieves the list of domains and its details// configured in the ANM for the given organizationDomainArray domainArray = rbacMgr.listDomains(st,

organization, domainNamesArray, excludeTypes);

List<Domain> domainList = domainArray.getItem();System.out.println("Name\t\t " + "AllowAll" + "\t"

+ "DomainObjects" + "\t");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

A-34API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 161: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

for (Domain domain : domainList) {System.out.println(domain.getName() + "\t\t"

+ domain.isAllowAll() + "\t"+ domain.getDomainObjects() + "\t\t");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

}

else if (type != null && "users".equalsIgnoreCase(type)) {if (args.length != 8) {

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}organization = args[6];showPassword = args[7];// Retrieves the list of users configured in the ANM for// the given organisationuserArray = rbacMgr.listUsers(st, organization,

showPassword);

List<User> userList = userArray.getItem();System.out.println("UserName\t\t " + "LoginName"

+ "\t" + "Password" + "\t" + "Role" + "\t");System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

for (User usr : userList) {String domain = "All";

if (usr.getDomains().getItem().size() != 0)domain = usr.getDomains().getItem().get(0);

System.out.println(usr.getName() + "\t\t"+ usr.getLoginName() + "\t"+ usr.getPassword().getValue() + "\t"+ usr.getRole() + "\t\t" + domain + "\t");

}System.out

.println("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");

} else {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

} else if (operation != null&& "delete".equalsIgnoreCase(operation)) {

organization = args[5];int length = args.length;for (int i = 6; i < length; i++) {

userNameArray.getItem().add(args[i]);}// Deletes the usernames provided in the array.

A-35API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 162: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

OperStatArray = rbacMgr.deleteUsers(st, organization,userNameArray);

List<OperationStatus> OperStatList = OperStatArray.getItem();

for (OperationStatus opStat : OperStatList) {StringBuffer output = new StringBuffer();output.append("Deletion of user name --> "

+ opStat.getName());output.append(" is " + opStat.getStatus());if (opStat.getStatus().equals("failure"))

output.append(" and the reason is "+ opStat.getMessage() + "\n");

System.out.println(output);}

} else if (operation != null&& ("create".equalsIgnoreCase(operation) || ("update"

.equalsIgnoreCase(operation)))) {if (args.length != 14) {

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}organization = args[5];UserPassword userPW = null;XmlArray xmlarray = new XmlArray();

userOne = new User();if ("username".equalsIgnoreCase(args[6])) {

userOne.setLoginName(args[7]);userOne.setName(args[7]);

}if ("password".equalsIgnoreCase(args[8])) {

userPW = new UserPassword();userPW.setValue(args[9]);userPW.setType("plain");userOne.setPassword(userPW);

}if ("role".equalsIgnoreCase(args[10])) {

userOne.setRole(args[11]);}if ("domain".equalsIgnoreCase(args[12])) {

xmlarray.getItem().add(args[13]);userOne.setDomains(xmlarray);

}userArray = new UserArray();userArray.getItem().add(userOne);

if ("create".equalsIgnoreCase(operation)) {// Creates the user under the organization with the// given user attributesOperStatArray = rbacMgr.createUsers(st, organization,

userArray);} else if ("update".equalsIgnoreCase(operation)) {

// Updates the given user under the organization with// the given user attributesOperStatArray = rbacMgr.updateUsers(st, organization,

userArray);}OperationStatus opStat = OperStatArray.getItem().get(0);StringBuffer output = new StringBuffer();output.append(operation + " operation of the user --> "

+ opStat.getName());output.append(" is " + opStat.getStatus());if (opStat.getStatus().equals("failure"))

A-36API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 163: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 6: RBACManager WS Client code

output.append(" and the reason is "+ opStat.getMessage() + "\n");

System.out.println(output);} else {

System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}

} catch (Exception ex) {ex.printStackTrace();

} finally {try {

/* * Close the ws session using logout() API. */oprMgr.logout(st);

} catch (Exception ex) {ex.printStackTrace();

}}

} else {System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}}

}

A-37API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 164: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 7: SyncDevice WS Client code

Use Case 7: SyncDevice WS Client codeThe following example shows a sample code to test the syncDevice API. After you import the device into ANM, you can call this syncDevice API to syncronize the configuration.

/** * Title: SyncDevice WS Client code * Description: This class is used to test syncDevice API. * Device that got imported in ANM can be synced using this class. * * Copyright: Copyright(C) 2012 Cisco Systems. All Rights Reserved. * Company: Cisco Systems * @version: 1.0 */

package com.cisco.anm.client;

import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.Method;import java.net.URL;import javax.xml.namespace.QName;import javax.xml.ws.BindingProvider;import javax.xml.ws.Service;

import com.cisco.anm.DeviceID;import com.cisco.anm.DeviceType;import com.cisco.anm.OperationManager;import com.cisco.anm.SessionToken;

/* * This class is used to test syncDevice API. * Device that got imported in ANM can be synced using this class. */public class SyncDevice {

static final String NAMESPACE = "http://anm.cisco.com";static String URL_TEMPLATE = "%s://%s:%s/anm/%s"; //

<protocol>://<IPAddress>:<Port>/anm/<service name>static final String WS_NAME = "OperationManager";

public static BindingProvider getPort(String ws, String protocol, String host, String port ) throws IOException {

String url = String.format(URL_TEMPLATE, ""+ protocol,port,host,ws);String ns = NAMESPACE;BindingProvider bp;Service svc;try {

QName qname = new QName(ns, ws + "Service");Class<Service> clazz = (Class<Service>) Class.forName("com.cisco.anm." + ws

+"Service");Constructor<Service> ctor = (Constructor<Service>) clazz.getConstructor(new

Class[]{URL.class, QName.class});svc = ctor.newInstance(new Object[]{new URL(url+"?wsdl"), qname});Method m = svc.getClass().getMethod("get"+ws+"Port", null);bp = (BindingProvider)m.invoke(svc, null);

} catch (Exception e) {throw new RuntimeException(e);

}return bp;

}

public static void main(String args[]){

A-38API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 165: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 7: SyncDevice WS Client code

String usage = "For CSS/VCENTER/Cat6k/GSS/ACE4710 Appliance, \n" + "Usage: java com.cisco.anm.client.SyncDevice (http|https) <ANM host name> <anm

username> <anm password> <devicetype> (css|vcenter|ace4710|cat6k|gss) " +"<Device Ip address>\n" + "Example: java com.cisco.anm.client.SyncDevice http

10.77.241.54 admin admin css 10.77.241.47 \n"+

"\nFor ACE Module/CSM, \n" + "Usage: java com.cisco.anm.client.SyncDevice (http|https) <ANM host name> <anm

username> <anm password> <devicetype> (acemodule|csm) " +"<cat6k Ip address> <Slot No>\n" + "Example: java com.cisco.anm.client.SyncDevice

http 10.77.241.54 admin admin csm 10.77.241.47 1 \n"+

"\nFor ACE Appliance VC, \n" + "Usage: java com.cisco.anm.client.SyncDevice (http|https) <ANM host name> <anm

username> <anm password> <devicetype> (ace4710vc) " +"<Device Ip address> <Context Name> \n" + "Example: java

com.cisco.anm.client.SyncDevice http 10.77.241.54 admin admin ace4710vc 10.77.241.47 Admin \n"+

"\nFor ACE Module VC, \n" + "Usage: java com.cisco.anm.client.SyncDevice (http|https) <ANM host name> <anm

username> <anm password> <devicetype> (acemodulevc)" +"<cat6k Ip address> <Context Name> <Slot No>\n" + "Example: java

com.cisco.anm.client.SyncDevice http 10.77.241.54 admin admin acemodulevc 10.77.241.47 Admin 1 \n";

String port="",protocol="",anmIPAddress="",anmUserName="",anmPwd="",deviceType="",deviceOrChassisIP="",ctxName="",slot="";

if( args.length == 6 || args.length == 7 || args.length == 8 ) {port = "";protocol = args[0]; // protocol , http or httpsanmIPAddress = args[1]; // anm IP Address or hostname of ANM serveranmUserName = args[2];// anm username,anmPwd = args[3]; // anm password.deviceType = args[4]; // device type

(cat6k/css/csm/gss/vcenter/ace4710/aceblade/vc)deviceOrChassisIP = args[5]; // <device IP Address/chassis IP address>if(args.length == 7){

if(deviceType.equalsIgnoreCase("csm") || deviceType.equalsIgnoreCase("acemodule")){

slot = args[6];}else if(deviceType.equalsIgnoreCase("ace4710vc")){

ctxName = args[6]; }

}if(args.length == 8){

if(deviceType.equalsIgnoreCase("acemodulevc")){ctxName = args[6];slot = args[7];

}}

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}if(deviceType == null){

System.out.println("Please provide value for Device Type it cannot be empty");System.out.println(usage);System.exit(0);

}

A-39API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 166: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 7: SyncDevice WS Client code

if( protocol != null && protocol.equals("https")){port = "8443";

}else if( protocol.equals("http")){port = "8080";

}else{System.out.println("Invalid arguments.");System.out.println(usage);System.exit(0);

}DeviceID deviceId = new DeviceID();OperationManager oprMgr = null;SessionToken st = null;try{

oprMgr = (OperationManager) getPort(WS_NAME, protocol, port, anmIPAddress);/** Invoke login() API to get session token.*/st = oprMgr.login(anmUserName, anmPwd);if(deviceType.equalsIgnoreCase("css")){

deviceId.setDeviceType(DeviceType.CSS);deviceId.setIpAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId); //Calling syncDevice API

}else if(deviceType.equalsIgnoreCase("vcenter")){deviceId.setDeviceType(DeviceType.VCENTER);deviceId.setIpAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("ace4710")){deviceId.setDeviceType(DeviceType.ACE_4710);deviceId.setIpAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("cat6k")){deviceId.setDeviceType(DeviceType.CAT_6_K);deviceId.setSlot("0");deviceId.setChassisIPAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("gss")){deviceId.setDeviceType(DeviceType.GSS);deviceId.setIpAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("csm")){deviceId.setDeviceType(DeviceType.CSM);deviceId.setChassisIPAddr(deviceOrChassisIP);deviceId.setSlot(slot);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("acemodule")){deviceId.setDeviceType(DeviceType.ACE_BLADE);deviceId.setSlot(slot);deviceId.setChassisIPAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("ace4710vc")){deviceId.setDeviceType(DeviceType.VIRTUAL_CONTEXT);deviceId.setName(ctxName);deviceId.setIpAddr(deviceOrChassisIP);oprMgr.syncDevice(st, deviceId);

}else if(deviceType.equalsIgnoreCase("acemodulevc")){deviceId.setDeviceType(DeviceType.VIRTUAL_CONTEXT);deviceId.setName(ctxName);deviceId.setChassisIPAddr(deviceOrChassisIP);deviceId.setSlot(slot);oprMgr.syncDevice(st, deviceId);

}System.exit(0);

}catch(Exception ex){ex.printStackTrace();

A-40API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 167: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 7: SyncDevice WS Client code

}finally{try{

/** Close the ws session using logout() API.*/oprMgr.logout(st);

}catch(Exception ex){ex.printStackTrace();

}}

}}

A-41API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 168: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Appendix A Use Case Examples Use Case 7: SyncDevice WS Client code

A-42API Reference Guide for Cisco Application Networking Manager 5.2.2

OL-25355-03

Page 169: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

API Reference GuiOL-27568-02

I N D E X

A

activateAnswer (GSS) 2-45

activateServerfarmRserver 2-36

activateVirtualServer 2-26

addRserverToServerfarm 2-30

Answer 2-2

C

changeServerfarmRserverWeight 2-42

Checkpoints 2-2

createCheckpoint 2-75

createTemplateInstance 2-65

Custom Application Errors 4-2

D

deleteCheckpoint 2-77

deleteTemplateInstance 2-71

Device Configuration service 2-1

DeviceID 2-2

DeviceType 2-3

DnsRule 2-3

Domain 2-10

F

freeFormShow 2-81

G

getTemplateDefinitionMetadata 2-60

getVMMappingInfo 2-53

L

listAnswers (GSS) 2-22

listCheckpoints 2-73

listDeviceids 2-8

listDNSRules (GSS) 2-24

listRservers 2-17

listServerfarmRservers 2-19

listServerFarms 2-15

listServerfarms 2-15

listTemplateDefinitions 2-56

listVirtualContexts 2-10

listVirtualServers 2-12

login 2-5

logout 2-7

M

MatchCondition 2-4

O

Organization 2-11

R

removeRserverFromServerfarm 2-33

Role 2-8

rollbackCheckpoint 2-79

Rserver 2-4

IN-1de for Cisco Application Networking Manager 5.2.2

Page 170: Web Service API Reference Guide for Cisco … · TemplateInstance 2-6 VMMappingInfo 2-6 Vserver ... † User Guide for the Cisco Application Networking Manager —Includes complete

Index

S

Serverfarm 2-4

SessionToken 2-4

SfRserver 2-5

SOAP Message Traffic 4-1

SOAP Message Traffic and Time Taken to Invoke an API 4-1

suspendAnswer (GSS) 2-47

suspendServerfarmRserver 2-39

suspendVirtualServer 2-28

syncDevice 2-55

T

TemplateDefinition 2-5

TemplateInput 2-6

TemplateInstance 2-6

U

User 2-7

V

VMMappingInfo 2-6

Vserver 2-7

W

webservices.log 4-1

Web Services Description Language 1-3

WSException 2-7

IN-2API Reference Guide for Cisco Application Networking Manager 5

.2.2

OL-27568-02