Develop > Server Automation Platform > SA CLI methods > Getting usage information on SA CLI methods

Getting usage information on SA CLI methods

In a future release, the SA CLI methods will display usage information. Until then, you can get the necessary information from the API documentation or the OGFS with the techniques described in the following sections.

Listing services

The SA API methods are organized into services. To find out what services are available for SA CLI methods, enter the following commands in an OGSH session:

cd /opsw/api/com/opsware 
find . -name "*Service"

To list the services in the API documentation, specify the following URL in your browser:

https://occ_host:1032

The occ_host is the IP address or host name of the core server running the Command Center component.

Finding a service in the API documentation

The path of the service in the OGFS maps to the Java package name in the API documentation. For example, in the OGFS, the ServerService methods appear in the following directory:

/opsw/api/com/opsware/server

In the API documentation, the following interface defines these methods:

com.opsware.server.ServerService

Listing the methods of a service

In the OGFS, you can list the contents of the method directory of a service, For example, to display the method names of the ServerService, enter the following command:

ls /opsw/api/com/opsware/server/ServerService/method

In the API documentation, perform the following steps to view the methods of ServerService:

In the upper left pane, select com.opsware.server.

In the lower left pane, select ServerService.

In the main pane, scroll down to view the methods.

Listing the parameters of a method

In the API documentation, perform the steps described in the preceding section. In the Method Detail section of the service interface page, view the parameters and return types. For more information about method parameters, see Passing arguments on the command-line.

Getting information about a value object

The API documentation shows that some service methods pass or return value objects (VOs), which contain data members (attributes). For example, the ServerService.getServerVO method returns a ServerVO object. To find out what attributes ServerVO contains, perform the following steps:

In the API documentation, select the ServerVO link. You can find the this link in several places:

  • The method signature for getServerVO
  • The list of classes (lower left pane) for com.opsware.server
  • On the Index page. A link to the Index page is at the top of the main pane of the API documentation.
  • On the ServerVO page, note the getter and setter methods. Each getter-setter pair corresponds to an attribute contained in the value object. For example, getCustomer and setCustomer indicate that ServerVO contains an attribute named customer.

Determining if an attribute can be modified

Only a few object attributes can be modified by client applications. To find out if an attribute can be modified, perform the following steps:

  1. In the API documentation, go to the value object page, as described in the preceding section.
  2. In the Method Detail section of the setter method, look for “Field can be set by clients.”

For SA objects represented in the OGFS, such as servers and customers, you can determine which attributes are modifiable by checking the access types of the files in the attr directory. The files that have read-write (rw) access types correspond to modifiable attributes. For example, to list the modifiable attributes of a server, enter the following commands:

cd /opsw/Server/@/server-name/attr 
ls -l | grep rw

Determining if an attribute can be used in a filter query

To find out if an attribute of a value object can be used in a filter query (a search), perform the following steps:

  1. In the API documentation, go to the value object page.
  2. In the Method Detail section of the getter method that corresponds to the attribute, look for the string, “Field can be used in a filter query.”

From within an OGSH session, to find out if an attribute can be searched on, follow the techniques described in Searchable attributes and valid operators.