Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Value representation
Because they run in a shell environment (the OGSH), SA CLI methods accept and return data as strings. However, the underlying API methods can accept and return other data types, such as numbers, Booleans, and objects. The sections that follow describe how the OGFS and SA CLI methods represent non-string data types.
SA objects in the OGFS
The SA data model includes objects such as servers, server groups, customers, and facilities. In the OGFS, these objects are represented as directory structures:
/opsw/Customer
/opsw/Facility
/opsw/Group
/opsw/Library
/opsw/Realm
/opsw/Server
. . .
The preceding list is not complete. To see the full list, enter ls /opsw
.
Object attributes
The attributes of an SA object are represented by text files in the attr
subdirectory. The name of each file matches the name of the attribute. The contents of a file reveals the value of the attribute.
For example, the /opsw/Server/@/buzz.example.com/attr
directory contains the following files:
agentVersion
codeset
createdBy
createdDt
customer
defaultGw
36 Chapter 2
description
discoveredDate
facility
hostName
locale
lockInfo
loopbackIP
managementIP
manufacturer
. . .
To display the management IP address of the buzz.example.com
server, enter the following commands:
cd /opsw/Server/@/buzz.example.com/attr
cat managementIP ; echo
Custom attributes
Custom attributes are name-value pairs that you can assign to SA objects such as servers. In the OGFS, custom attributes are represented as text files in the CustAttr
subdirectory. You can create custom attributes in an OGSH session by creating new text files under CustAttr
. The following example creates a custom attribute named MyGreeting
, with a value of hello there
, on the buzz.example.com
server:
cd /opsw/Server/@/buzz.example.com/CustAttr
echo -n "hello there" > MyGreeting
For more examples, see the “Managing Custom Attributes” section in the SA 10.51
The self file
The self
file resides in the directory of an SA object such as a server or customer. This file provides access to various representations of the current object, depending on the format specifier. For details, see Format specifiers.
To list the ID of the buzz.example.com
server, enter the following commands:
cd /opsw/Server/@/buzz.example.com
cat .self:i ; echo
For a server, the default format specifier is the name. The following commands display the same output:
cat self ; echo
cat .self:n ; echo
The next command lists the attributes of a server in the structure format:
cat .self:s
Primitive values
The following table indicates how primitive values are converted between the API and their string representations in SA CLI methods. Except for Dates, primitive values do not support format specifiers. Dates support ID format specifiers.
Primitive type |
Java equivalent |
Output from SA CLI method |
Input to SA CLI methods |
---|---|---|---|
String |
|
Character string, presented in the encoding of the current session. |
Character string, converted to Unicode from the current session encoding. |
Number |
|
Decimal format, not localized. Scientific notation for very large or small values. |
Examples - |
Boolean |
|
|
The string “true” and all mixed-case variants evaluate to |
Binary data |
|
Binary string. No conversion from session encoding. |
Binary string. No conversion to session encoding. |
Date |
java.util. |
Date value. By default, presented in this format: |
Same as output. |
Arrays
The representation of array objects depends on whether they are standalone (an array attribute file or a method return value) or contained in the structure of a complex object.
First, standalone array objects are presented according the underlying type, separated by new-line characters. Within an array element, a new-line character is escaped by \n and a back slash by \\.
Array values can be output or input using any representation supported by the underlying type. For example, by default, the getDeviceGroups
method lists the groups as names:
All Windows Servers
Servers in Austin
Testing Pool
If you indicate the ID format specifier, (.getDeviceGroups:i
) the method displays the IDs of the groups:
com.opsware.device.DeviceGroupRef:15960039
com.opsware.device.DeviceGroupRef:10390039
com.opsware.device.DeviceGroupRef:17380039
Second, an array contained in the structure of a complex object is represented as a set of name-value pairs, using the attribute as the name. The attribute appears multiple times, once for each element in the array. The order in which the attributes appear determine the order of the elements in the array. The following example shows a structure that contains two attributes, a string called subject
and a three-element array of numbers called ranks
:
{ subject=”my favorites” ranks=17 ranks=44 ranks=24 }
Arrays can also be represented by directories. Within an array directory, each array element has a corresponding file (for primitive types) or subdirectory (for complex types). The name of each entry is the index number of the array element, starting with zero.
For an array that is the attribute of a complex object, you should modify the array by editing its attribute file. This action completely replaces the array with the contents of the edited file.
For an array containing elements that are complex objects, you should modify the array by changing its directory representation. To change an element value, edit the element file. For example, suppose you have an array with five string elements. The ls
command lists the elements as follows:
0 1 2 3 4
The following command changes the value of the third element:
echo -n "My new value" > 2
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to hpe_sa_docs@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: