Raritan Computer CC-WSAPI-0B-v5.1.0-E User Manual

CommandCenter Secure Gateway
WS-API Programming Guide
Release 5.1
Copyright © 2011 Raritan, Inc. CC-WSAPI-0B-v5.1.0-E February 2011 255-80-0004-00
This document contains proprietary information that is protected by copyright. All rights reserved. No part of this document may be photocopied, reproduced, or translated into another language without express prior written consent of Raritan, Inc.
© Copyright 2011 Raritan, Inc. All third-party software and hardware mentioned in this document are registered trademarks or trademarks of and are the property of their respective holders.
FCC Information
This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a commercial installation. This equipment generates, uses, and can radiate radio frequency energy and if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. Operation of this equipment in a residential environment may cause harmful interference.
VCCI Information (Japan)
Raritan is not responsible for damage to this product resulting from accident, disaster, misuse, abuse, non-Raritan modification of the product, or other events outside of Raritan's reasonable control or not arising under normal operating conditions.
iii
Contents
Chapter 1 Introduction 1
Connecting to CC-SG .................................................................................................................... 1
Add Web Services API Client Configuration on CC-SG ...................................................... 2
Access Information ........................................................................................................................ 4
WSDL URLs ........................................................................................................................ 4
Certificates ........................................................................................................................... 4
Remotely Authorized Users ................................................................................................. 4
Chapter 2 API Definitions 6
Conventions ................................................................................................................................... 6
Common Data Types ..................................................................................................................... 6
System Management ..................................................................................................................... 7
Data Types .......................................................................................................................... 7
Services ............................................................................................................................... 8
Authentication and Authorization Services .................................................................................... 8
Data Types .......................................................................................................................... 8
Unsupported Authentication and Authorization Services .................................................... 9
Node Management Services ......................................................................................................... 9
Data Types .......................................................................................................................... 9
Services ............................................................................................................................. 13
User Management ....................................................................................................................... 18
Data Types ........................................................................................................................ 18
Services ............................................................................................................................. 19
Logging Management .................................................................................................................. 21
Data Types ........................................................................................................................ 21
Services ............................................................................................................................. 23
Category Management ................................................................................................................ 25
Data Types ........................................................................................................................ 25
Services ............................................................................................................................. 25
Contents
iv
Appendix A Certificate Management 28
Java keytool ................................................................................................................................. 28
OpenSSL ..................................................................................................................................... 28
Saving the CCSG's Server Certificate from a Web Browser (IE6) .............................................. 28
Installing the Client Certificate into a Key Store (Microsoft Windows XP) ................................... 29
Using Microsoft Management Console to Manage Certificates................................................... 29
Appendix B Web Services Development in Java 30
Choose a WS Library ................................................................................................................... 30
Certificates information for Java users ........................................................................................ 30
Setting the CCSG Address .......................................................................................................... 31
Calling a Web Service.................................................................................................................. 32
Sample Application for Java ........................................................................................................ 32
Appendix C Web Services Development in C# 39
Using a CC-SG Web Service in a Project .................................................................................... 39
Sample Application for C# ........................................................................................................... 40
Index 47
1
Web Services API uses standardized Web Services technologies to
In This Chapter
Connecting to CC-SG ................................................................................ 1
Access Information .................................................................................... 4
Chapter 1

Introduction

allow a client machine to perform node, power, user, and logging management services.
This client is independent of the CC-SG, but aims to provide the same capabilities that the CC-SG's HTML-based Access Client provides, through use of the API and a TCP/IP network.
This SDK allows Independent Software Vendors (ISVs) and Raritan customers to build an application using a development environment compatible with SOAP, such as .NET and Java.

Connecting to CC-SG

To connect to CC-SG:
1. Establish client configuration on CC-SG Admin Client. See Add Web
2. Download client and server/CC-SG certificates to the client machine
Services API Client Configuration on CC-SG (on page 2)
for use by the client. To connect to the CC-SG using SOAP over port 9443, the client must first manually install the x.509 digital client certificate that is generated using the CC-SG Admin Client. CC-SG contains a server certificate that will be retrieved using SSL/TLS APIs implemented in the client application to establish a trust relationship. See Add Web Services API Client Configuration on
CC-SG (on page 2) for instructions on creating the client certificate.
See Certificates (on page 4).
Details:
Open the PKCS #12 file using the password and store the client
certificate public and private keys in the keystore that is accessible to the WS-API client application.
Connect on TCP Port 9443 to the CC-SG's IP address and
exchange certificates using the SSL/TLS protocol.
Note: CC-SG verifies that the client IP address matches the address set within the client configuration on the CC-SG.
Accept the self signed server certificate from CC-SG. This may
require special handling on Java. See Certificates information
for Java users (on page 30)
Chapter 1: Introduction
2
3. Download WSDL files from the CC-SG. You can use a web browser or a simple client like wget to access the WSDL URLs. See WSDL
URLs (on page 4)
4. Choose a WS client library for your target language.
5. Use the tools provided with your chosen WS client library to generate stubs in your target language. Each stub should be a complete web service operation such that all that you must do is call the web service as a method/function with the appropriate parameters.
6. Begin writing the client. Call the signOn() service found in AuthenticationAndAuthorizationService. If successful, the signOn() returns a session ID that you must provide for some services. Access the other services as needed. Call signOff() to end your session when your application finishes.
Note: The signOn() service is only required for services that take the session ID as a parameter. signOff() is only needed if signOn() is called.

Add Web Services API Client Configuration on CC-SG

You must accept the End User Agreement before adding a Web Services API client to CC-SG. You can add up to five WS-API clients. See the CC-SG Web Services API Guide for details on using the API.
To add a Web Services API:
1. Select Access > Add Web Services API. This option is available only for users with the CC Setup and Control Privilege.
2. Read the End User Agreement. You can copy and paste the text to save it, or choose Secure
Gateway > Print.
After you complete configuration, this agreement will also be
available in the Access menu.
3. Click Accept. The New Web Services API Configuration window opens.
4. Type in the data requested about your web services client.
Web Services Client Name: Maximum 64 characters. License Key: Your license key from Raritan. Each CC-SG unit
must have a unique license key.
IP Address/Hostname: Maximum 64 characters. HTTPS Web Services Port: Read-only field. CC-SG uses port
9443 when trust establishment is generated.
Licensed Vendor Name: Maximum 64 characters.
5. Generate a self-signed certificate.
Chapter 1: Introduction
3
a. Encryption Mode: If Require AES Encryption between Client and
Server is selected in the Administration > Security > Encryption screen, AES-128 is the default. If AES is not required, DES 3 is
the default. b. Private Key Length: 1024 is the default. c. Validity Period (days): Maximum 4 numeric characters. d. Country Code: CSR tag is Country Name. e. State or Province: Maximum 64 characters. Type in the whole
state or province name. Do not abbreviate. f. City/Locality: CSR tag is Locality Name. Maximum 64
characters. g. Registered Company Name: CSR tag is Organization Name.
Maximum 64 characters. h. Division/Department Name: CSR tag is Organization Unit Name.
Maximum 64 characters. i. Fully Qualified Domain Name: CSR tag is Common Name. j. Administrator Email Address: Type in the email address of the
administrator who is responsible for the certificate request. k. Challenge Password: Maximum 64 characters.
Note: The Challenge Password is used internally by CC-SG to generate the certificate. You do not need to remember it.
l. Password: Enter a keystore password. Use this password to
open the .P12 file that you will save in step 7. If you copy the
generated certificate and import into your own keystore instead,
you do not need to remember this keystore password.
6. Click Generate Certificate. The text appears in the Certificate box.
7. Click Save to File to save the certificate to a .P12 file. Or, copy the generated certificate and import it into your own keystore.
8. Click Add to save your changes.
Chapter 1: Introduction
4

Access Information

WSDL URLs

http://CC_IP_ADDRESS:8080/CommandCenterWebServices/Au
thenticationAndAuthorizationServicePort?wsdl
http://CC_IP_ADDRESS:8080/CommandCenterWebServices/No
deManagementServicePort?wsdl
http(s)://CC_IP_ADDRESS:8080/CommandCenterWebServices
/UserManagementServicePort?wsdl
https://CC_IP_ADDRESS:8080/CommandCenterWebServices/L
oggingManagementServicePort?wsdl

Certificates

The CC-SG's Web Services require mutual certificates such that both the CC-SG and the WS client present a certificate. Once one configures a client on the CC-SG, the CC-SG will know about both certificates. The client also needs to know about both certificates.
The CC-SG's server certificate on port 9443 is generated by the CC-SG itself. The client must accept this certificate, however, a typical WS client would not be designed to present a certificate acceptance dialog to the user. One can simply use a trust store to contain the CC-SG's server certificate thereby telling the client certificate library to trust the CC-SG.
Obtain the CC-SG's certificate then create a new trust store or add it to an existing one. The WS client must be able to access the trust store to be able to communicate with the CC-SG.
If you don't want to manually add the certificate to a trust store, you can make provisions in the client source to always trust the CC-SG or to save the CC-SG's certificate into the trust store automatically.

Remotely Authorized Users

Users authorized via remote servers require some special handling in CC-SGs Web Services. Only AD users can be remotely authorized.
1. The signOn() service takes the plain user name just as the remote user would enter it on the CC-SG's login page.
2. Whenever a WS client accesses a service that takes a user name as a parameter (including signOff()) and the targeted user is a remotely authorized user, the user name needs to have the remote server's module name appended as follows: USER@MODULE
Chapter 1: Introduction
5
USER is the plain user name and MODULE is the name that the administrator gave the remote module configuration in CC-SG.
6
In This Chapter
Conventions ............................................................................................... 6
Common Data Types ................................................................................. 6
System Management ................................................................................. 7
Authentication and Authorization Services ................................................ 8
Node Management Services ..................................................................... 9
User Management ................................................................................... 18
Logging Management .............................................................................. 21
Category Management ............................................................................ 25
Chapter 2

API Definitions

Conventions

The following conventions are used within this document.
String sessionID - The authentication token that was originally
String interfaceID – CC-SG generated unique identifier of an
String username - The name of a CC-SG user account.

Common Data Types

1. Exceptions
assigned to the user via the SignOn method. Whenever you see a parameter named sessionID, it refers to this definition.
Note: The session ID will be invalidated if no session activity is detected for 5 minutes.
interface.
Each CC-SG WS-API service returns an exception upon error. If the error is specific to the service, the exception will be defined as follows:
Elements
String code – Simple definition of the error. String message – Specific error message.
2. xsd:dateTime
Standard XML type used in Web services and based on ISO 8601. Your WS system will map it to a type appropriate for your target programming language.
Chapter 2: API Definitions
7

System Management

This set of services is for general CC-SG settings and information. http(s)://CC_IP_ADDRESS:8080/CommandCenterWebServices/System
ManagementServicePort?wsdl

Data Types

SystemManagementException
Exception returned for all errors specific to system management.
Elements
SystemInfo
General information about the CC-SG.
Elements
String code – Simple definition of the error. String message – Specific error message.
String firmwareVersion – The version of the software running on
the CC-SG.
String WSAPIVersion – The version of the WS API on the CC
formatted as follows:
Major.Minor.Point Major increments with big, new feature sets or changes to
existing services. The client should be rebuilt based on the current WSDL.
Minor increments with small functionality additions. A client
rebuild may not be necessary.
Point increments for patches and bug fixes. No client
rebuilding needed.
String serial – The serial number identifying the unit. String platform – Hardware identification. xsd:dateTime date – The current date.
Chapter 2: API Definitions
8

Services

getSystemInfo
Retrieve information about the CC-SG.
parameters
String sessionID
return value
SystemInfo

Authentication and Authorization Services

This set of services is for logging into and out of CC-SG.
http://CC_IP_ADDRESS:8080/CommandCenterWebServices/Au
thenticationAndAuthorizationServicePort?wsdl

Data Types

AuthenticationAndAuthorizationException
Exception returned for all errors specific to authentication and authorization.
signOn()
This operation is used to login to CC-SG and authenticate with the CC­SG user database or an external database. This is the first method which should be used once a SSL/TLS session has been established. This operation achieves a SSO (Single Sign On) effect. The WS-API can continue to make requests without signing in again. The signon is used to authenticate any user credentials that is using the WS-API client as a proxy.
parameters
String username - user name logging into the WS-API client  String password - associated password of the username being
used by the WS-API client.
return value
String sessionID
Chapter 2: API Definitions
9
signoff()
This operations signs off (log out) a particular user from CC-SG. The application can have multiple users logged in.
String username - user name that is logging out via the WS-API
client
String sessionID
return value void

Unsupported Authentication and Authorization Services

The following Authentication and Authorization services are not supported and should not be used.
authenticate() getAllUserGroups() getAllUserGroupsCount()

Node Management Services

This set of services is for modifying nodes in CC-SG.
http://CC_IP_ADDRESS:8080/CommandCenterWebServices/No
deManagementServicePort?wsdl

Data Types

AccessMethod
Description of a means of accessing a node.
Elements
String methodName - the name of the application used for
access. Some examples of the application name are "SSH Client
(SSH)", “MPC”, "RemoteDesktop Viewer (RemoteDesktop)" and
"iLO RemoteConsole".
String methodType - “inband” or “outband” - Inband refers to any
interface that uses only the TCP/IP network to directly connect to the node. Outband is based on reaching a Raritan device product via TCP/IP and from the device connecting to the KVM or serial port of the node.
String InterfaceID - CC-SG generated string which uniquely
identifies the interface within CC-SG
String InterfaceName - CC-SG generated string which identifies
the interface within CC-SG
Chapter 2: API Definitions
10
String applicationId - CC-SG generated string which uniquely
identifies the access application type within CC-SG for out-of­band access designated for use within CC-SG. String is null if not applicable to the interface.
boolean userAuthorizedForMethod - value of the authorization for
the user to access this interface with this application. If the user
AssociationData
has permission, the value is TRUE.
Represents a category based label placed on the node.
Elements
String category - The unique name identifying the category. String element - The value from the category that labels this
InterfaceAvailabilityAndStatus
node.
Describes the current state of the interface.
Elements
String interfaceID String availability – Text description of the availability field. For
example, if an operation is still in progress, availability will indicate "Processing." Availability may be Idle, Busy, or Processing.
String status – Text description of the status field. For example,
InterfaceData
Up or Down.
Description of the node's attachment to the end point.
Elements
String ip - host IP address for the interface. This field is filled in
for in-band interfaces only; otherwise, it is the empty string.
String hostname - hostname for the interface (for in-band
interfaces only ) based on query using the supplied host IP address.
String portName i.e the name for the port for out-of-band
interfaces only; otherwise it is the empty string.
String portID - the Raritan port ID for out-of-band interfaces. This
is a unique generated value that occurs as part of configuration of a Raritan devices' ports. This field is empty for in-band interfaces.
Chapter 2: API Definitions
11
String deviceName i.e the name of the Raritan device. This field
is filled in only for out-of-band interfaces; otherwise, it the empty string.
String name - String id - Unique identifier referenced by AccessMethod String description - User description of the interface String type - Function of the interface
NodeData
Description of a node's configuration.
Elements
String name InterfaceData[] interfacesData – The interfaces attached to this
node
AssociationData[] associations - Category values with which the
NodePowerStatus
node is associated
Describes the power status of a node through its interfaces.
Elements
PowerInterfaceStatus [] powerInterfaceStatus – Contains an
PowerInterfaceStatus
entry for each of the node's power interfaces.
Describes the interface and power operation statuses of a power interface.
Elements
InterfaceAvailabilityAndStatus availabilityAndStatus – The
general interface status.
String operation – The most recent power operation. boolean inProgress – true if the operation is still running. boolean successful – true if the operation has finished
successfully. If both successful and inProgress are false, then the operation failed.
String failureReason – If the operation failed, then this field will
typically contain a description of the failure.
xsd:dateTime timeStamp – The time that the CC-SG updated the
power operation status.
Chapter 2: API Definitions
12
URLObject
Components to form a URL to access the CC-SG.
Elements
String protocol - the protocol used - either http or https String port - the TCP port to be used for connecting to the
interface: port 80 or port 443.
String path - the path to the actual webservice servlet String tokenKey - the name of the property to be used for the
token. The value is always “sessionID”
String tokenValue - the actual property value corresponding to
Constructing a URL from URLObject
the tokenKey from above
Combine the string elements of the returned URLObject (italicized) in the following order with other data (plain):
protocol + :// + CCSG Address + : + port + path + ? + tokenKey + = + tokenValue
Given the following URLObject data:
protocol - http  port - 80  path - /CommandCenterWeb/index_frames.jsp  tokenKey - sessionID  tokenValue - 03AC4A3B1EE2CB665564BEB1ACAA8401
The constructed URL should look similar to this one: http://10.0.0.101:80/CommandCenterWeb/index_frames.jsp?sessionID=
03AC4A3B1EE2CB665564BEB1ACAA8401
Note: A single question mark (?) delimits parameters from the document path. Parameters themselves are separated from one another using an ampersand (&). The path from getInterfaceURL() will already contain parameters, so you must append the sessionID using an ampersand delimiter in that case.
NodeManagementException
Exception returned for all errors specific to node management.
Chapter 2: API Definitions
13

Services

getCCSGAppletURL
This operation retrieves the full URL to the CC-SG Admin Client applet in order to launch the main CC-SG client. When this URL is opened in a browser it will display the main CC-SG client, if the sessionID is valid, or the login screen, if the sessionID is invalid.
parameters
String sessionID
return value URLObject
getCCSGHTMLClientURL
This operation retrieves the full URL for the CC-SG Access Client HTML pages to launch the main access CC-SG page. When this URL is opened in a browser it will display the main access CC-SG page if the sessionID is valid, or the login page if the sessionID is invalid.
parameters
String sessionID - authentication token granted for use by CCSG
in SignOn()
return value URLObject
getInterfaceURL
This operation retrieves the URL required to connect to an interface, using access method (application), provided by CC-SG. This URL can be used as the path for a web browser or any HTML aware application to initiate the connection via the chosen application and destination. The signOn method must have previously been called for this user.
Parameters
String sessionID String interfaceID CC-SG generated string which uniquely
identifies the interface within CC-SG
String accessApplicationId - CC-SG generated string which
uniquely identifies the application type within CC-SG
return value:
URLObject
Loading...
+ 37 hidden pages