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 |
|
Adding Credentials Example
import java.net.URL; import org.apache.axis2.transport.http.HTTPConstants; import org.apache.axis2.transport.http.HttpTransportProperties; import com.hp.ucmdb.generated.params.discovery.*; import com.hp.ucmdb.generated.services.DiscoveryService; import com.hp.ucmdb.generated.services.DiscoveryServiceStub; import com.hp.ucmdb.generated.types.BytesProp; import com.hp.ucmdb.generated.types.BytesProps; import com.hp.ucmdb.generated.types.CIProperties; import com.hp.ucmdb.generated.types.CmdbContext; import com.hp.ucmdb.generated.types.StrList; import com.hp.ucmdb.generated.types.StrProp; import com.hp.ucmdb.generated.types.StrProps;
public class test {
static final String HOST_NAME = "hostname";
static final int PORT = 21212 ;
private static final String PROTOCOL = "http";
private static final String FILE = "/axis2/services/DiscoveryService";
private static final String PASSWORD = "admin";
private static final String USERNAME = "admin";
private static CmdbContext cmdbContext = new CmdbContext("ws tests");
public static void main(String[] args) throws Exception {
// Get the stub object
DiscoveryService discoveryService = getDiscoveryService();
// Activate Job
discoveryService.activateJob(new ActivateJobRequest("Range IPs by ICMP", cmdbContext));
// Get domain & probes info
getProbesInfo(discoveryService);
// Add credentials entry for ntcmd protocol
addNTCMDCredentialsEntry();
}
public static void addNTCMDCredentialsEntry() throws Exception {
DiscoveryService discoveryService = getDiscoveryService();
// Get domain name
StrList domains =
discoveryService.getDomainsNames(new GetDomainsNamesRequest(cmdbContext)).getDomainNames();
if (domains.sizeStrValueList() == 0) {
System.out.println("No domains were found, can't create credentials");
return;
}
String domainName = domains.getStrValue(0);
// Create propeties with one byte param
CIProperties newCredsProperties = new CIProperties();
// Add password property - this is of type bytes
newCredsProperties.setBytesProps(new BytesProps());
setPasswordProperty(newCredsProperties);
// Add user & domain properties - these are of type string
newCredsProperties.setStrProps(new StrProps());
setStringProperties("protocol_username", "test user", newCredsProperties);
setStringProperties("ntadminprotocol_ntdomain", "test doamin", newCredsProperties);
// Add new credentials entry
discoveryService.addCredentialsEntry(new AddCredentialsEntryRequest(domainName, "ntadminprotocol", newCredsProperties, cmdbContext));
System.out.println("new credentials craeted for domain: " + domainName + " in ntcmd protocol");
}
private static void setPasswordProperty(CIProperties newCredsProperties) {
BytesProp bProp = new BytesProp();
bProp.setName("protocol_password");
bProp.setValue(new byte[] {101,103,102,104});
newCredsProperties.getBytesProps().addBytesProp(bProp);
}
private static void setStringProperties(String propertyName, String value, CIProperties newCredsProperties) {
StrProp strProp = new StrProp();
strProp.setName(propertyName);
strProp.setValue(value);
newCredsProperties.getStrProps().addStrProp(strProp);
}
private static void getProbesInfo(DiscoveryService discoveryService) throws Exception {
GetDomainsNamesResponse result = discoveryService.getDomainsNames(new GetDomainsNamesRequest(cmdbContext ));
// Go over all the domains
if (result.getDomainNames().sizeStrValueList() > 0) {
String domainName = result.getDomainNames().getStrValue(0);
GetProbesNamesResponse probesResult =
discoveryService.getProbesNames(new GetProbesNamesRequest(domainName, cmdbContext));
// Go over all the probes
for (int i=0; i<probesResult.getProbesNames().sizeStrValueList(); i++) {
String probeName = probesResult.getProbesNames().getStrValue(i);
// Check if connected
IsProbeConnectedResponce connectedRequest =
discoveryService.isProbeConnected(new IsProbeConnectedRequest(domainName, probeName, cmdbContext));
Boolean isConnected = connectedRequest.getIsConnected();
// Do something ...
System.out.println("probe " + probeName + " isconnect=" + isConnected);
}
}
}
private static DiscoveryService getDiscoveryService() throws Exception {
DiscoveryService discoveryService = null;
try {
// Create service
URL url = new URL(PROTOCOL,HOST_NAME,PORT, FILE);
DiscoveryServiceStub serviceStub = new DiscoveryServiceStub(url.toString());
// Authenticate info
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername(USERNAME);
auth.setPassword(PASSWORD);
serviceStub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE,auth);
discoveryService = serviceStub;
} catch (Exception e) {
throw new Exception("cannot create a connection to service ", e);
}
return discoveryService;
}
} // End class
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 ovdoc-asm@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback:

