Important

   

Starting version 8.9.03, BMC Network Automation is renamed to TrueSight Network Automation. This space contains information about BMC Network Automation 8.9.02 and previous versions. For TrueSight Network Automation 8.9.03 and later releases, see the TrueSight Network Automation documentation.

General API classes and methods

The BMC Network Automation Web Services API provides a general set of classes which abstract the lower-level web service functionality into a set of easy to use Java classes. Each service class offers several methods for retrieving and modifying objects, and executing actions on the server.

In addition to the service classes, the API provides a set of Data Transfer Object (DTO) classes. The DTO classes are lightweight containers for passing data to and from the server. For example, to retrieve a set of devices from the server, the client constructs a DeviceFilterDTO object. This object is then passed to the DeivceService.getDevices() method. The method returns a set of DeviceDTO objects. Each DTO object is documented in the Javadoc provided in the BMC Network Automation Web Services distribution file.

Most DTO components, such as configurations, rules, or devices, have an associated key value, that is used to retrieve DTO data whenever possible. The advantage of using a key over a name is that the key remains intact while the name can be changed on the GUI.

The following sections document the key methods in each of the service classes.

Note

You can find a complete list of methods along with additional details about the method return values, exceptions, and parameters in the Javadoc provided in the BMC Network Automation Web Services distribution files (BCAN_HOME\public\bmc\bca-networks\extras\bcan-ws-clientapi-v.r.mm.zip). See Using the API reference sections in the BMC Cloud Lifecycle Management online technical documentation for information about accessing the Javadoc.

AuthenticationService class

The AuthenticationService class provides authentication services such as login and logout. This service must be used by every application for authenticating a user and establishing a user session for accessing the BMC Network Automation system.

Retrieve the WSDL for this service by using the https://<<server:port>>/bca-networks/services/AuthenticationService?wsdl URL.

MethodDescription
doLogin()

Logs on a user to the system and starts a web service session. A unique token is returned that must be used for all subsequent calls to identify the session. Authentication and authorization on each subsequent call is based on this unique token.

doLogout()Logs out a user from the system and ends the web service session.
getSessionTimeout()Returns the web service session timeout value, in minutes. This is the amount of time after which the server forcefully logs out a user out due to a period of inactivity. This is also the time configured in the wsSessionTimeOutMinutes property, which is present in the BCAN_DATA/global.properties file on the server.
getUsers()Returns the names of all users in the system.
isLoggedIn()Returns a true value if a valid user session is in progress.

Back to top

ComplianceService class

The ComplianceService class provides calls related to BMC Network Automation compliance.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/ComplianceService?wsdl URL.

MethodDescription
createCompliancePredefinedJob()

Creates a BMC Network Automation predefined job with the given span and compliance rule sets. The predefined job is created with one Compliance Status action. Once the predefined job is created, a job is prepared from it and submitted for execution at the specified run time.

executeComplianceJob()

Prepares and schedules a job for execution by preparing one from the specified predefined job.

getComplianceDetailResults()Returns the detailed results of the Compliance Status job.
getComplianceSummaryResults()

Returns the summary level results of the Compliance Status job that most recently originated from the predefined job.

Back to top

DeviceSecurityProfileService class

The DeviceSecurityProfileService class provides services to enumerate, add, modify, or delete device security profiles.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/DeviceSecurityProfileService?wsdl URL.

MethodDescription
addDeviceSecurityProfile()Adds a new device security profile to the system.
deleteDeviceSecurityProfile()Deletes a device security profile.
getDeviceSecurityProfileByName()

Returns the device security profile by name.

Values of the all password fields of the returned device security profile are dummy and are different from the real values that are hidden.

getDeviceSecurityProfiles()

Returns all the device security profiles from the server.

Values of the all password fields of the returned device security profile are dummy and are different from the real values that are hidden.

modifyDeviceSecurityProfile()Modifies a device security profile.

Back to top

DeviceService class

The DeviceService class provides a variety of services related to devices, including retrieval of device objects and device configurations.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/DeviceService?wsdl URL.

MethodDescription
addDevice()Adds a new device to the system.
deleteDevice()Deletes an existing device from the system.
deleteDeviceExtended()

(Version 8.5.01 and later) Deletes a device like the deleteDevice() method, but with the following differences:

  • Includes clearReferences, an additional parameter that requests that any component referring to or using the device that is to be deleted be cleared of the device reference, where possible
  • Returns a ReferenceDTO array, which indicates where the device is in use that prevents it from being deleted.

    Note: deleteDevice() generates an AxisFault when such a reference is found; deleteDeviceExtended() does not.
getDevice()

Returns a single device based on the provided device key. This method is typically used when the device key is available from a previous call. For example, the device key may be stored in a data file from a previous run so this method is used to retrieve the device DTO object based on the stored device key.

getDeviceCount()

Returns an integer count of the number of devices in the BMC Network Automation database. You can get the count of on-line devices only or all devices (both on-line and off-line) by passing in the appropriate value for the boolean flag, onlineOnly.

getDevices()Returns a set of devices that match the provided device filter.
getConfiguration()

Returns a single device configuration based on the provided configuration key. The configuration key can be determined from the device DTO objects returned from the getDevices() or getDevice() methods.

getServiceContextInfo()

Returns Service Context information for the business service name, further filtered by the device filter that is passed as input.

The changes to the device configuration over the time period provided as input are captured in an array of change DTO ordered by latest configuration created date first. You can specify a number of changes to retrieve to limit changes returned by the call.

modifyDevice()

Modifies an existing device in the system.

Back to top

EndpointActionService class

The EndpointActionService class provides services to run endpoint actions.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/EndpointActionService?wsdl URL.

MethodDescription
doFindEndpoint()

Finds the managing switch for a specified endpoint address.

Note: If you do not specify the spanKeys argument, this action searches the entire network for the endpoint.

doQuarantineEndpointViaBlockEndpoint()

Finds the managing switch for the specified endpoint and modifies it to block all IP traffic involving the endpoint.

doQuarantineEndpointViaDisablePort()

Finds the managing switch for the specified endpoint and modifies it to shutdown the port on which the endpoint was last seen.

doQuarantineEndpointViaRemediateEndpoint()

Finds the managing switch for the specified endpoint and modifies it to block all IP traffic involving the endpoint except for the specified remediation address.

doQuarantineEndpointViaRemediateEndpointByVLAN()

Finds the managing switch for the specified endpoint and changes the VLAN membership of the switch port associated with the endpoint to the specified remediationVlan. After the quarantine the endpoint is accessible only from the remediation VLAN network.

doUnquarantineEndpoint()

Unquarantines the specified endpoint address within the managing switch associated with the endpoint.

getEndpointActionResults()

Returns the endpoint action results for the job with given jobID.

Back to top

EventService class

The EventService class provides services to log events of various severity levels on the server.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/EventService?wsdl URL.

MethodDescription
doLogCriticalEvent()Logs a CRITICAL severity event on the server.
doLogInfoEvent()Logs an INFO severity event on the server.
doLogMajorEvent()Logs a MAJOR severity event on the server.
doLogMinorEvent()Logs a MINOR severity event on the server.
doLogWarningEvent()Logs a WARNING severity event on the server.

Back to top

ExternalScriptActionService class

The ExternalScriptActionService class provides services to execute and monitor a job containing external script actions.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/ExternalScriptActionService?wsdl URL.

MethodDescription
doExternalScriptAction()Executes the given external script action.
getExternalScriptActionResults()

Returns the results of a job that has executed external script actions.

Back to top

GroupService class

The GroupService class provides services to retrieve groups.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/GroupService?wsdl URL.

MethodDescription
addSimpleGroup()Adds a new simple group to the system.
deleteSimpleGroup()Deletes a simple group.
getCombogroup()Returns the combo group details by the key provided.
getCombogroups()Returns a set of combo groups that match the provided group filter.
getSimpleGroup()Returns the simple group details by the key provided.
getSimpleGroups()

Returns a set of simple groups (for example, Auto-Groups and Static Groups) that match the provided group filter.

modifySimpleGroup()Modifies a simple group, optionally including its member devices.

Back to top

ImportExportService class

The ImportExportService class contains methods that apply to components that use general and Virtual Data Center (VDC) API classes. This class acts an interface, which provides an API to perform the following tasks:

  • Import components in XML format to the BMC Network Automation database. 
  • Export components from the BMC Network Automation database to XML.

Note

  • In the exported XML, the component attributes are embedded in CDATA sections if the attribute value for a particular component instance is detected to contain embedded XML metacharacters (for example, < or > character).
  • Due to enhancements in the rule import and export behavior, the rule and rule set XMLs contain new schemas. As a result, you cannot import rule files that were generated prior to version 8.8.00.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/ImportExportService?wsdl URL.

MethodDescription
(Version 8.9.01 and later)
exportCombogroups()
Exports all combo groups from database to XML data.
(Version 8.9.01 and later)
exportConditions()
Exports all conditions from database to XML data.
exportContainerBlueprints()

Exports all container blueprints from database to XML data.

exportContainers()Exports all containers from database to XML data.
exportDeviceSecurityProfiles()

Exports device security profiles (DSP) from database to XML.

(Version 8.9.01 and later)
exportDynamicTypes()
Exports dynamic fields from database to XML.
(Version 8.9.01 and later)
exportKeywords()
Exports all keywords from database to XML data.
exportPodBlueprints()

Exports all pod blueprints from database to XML data.

exportPods()Exports all pods from database to XML data.
(Version 8.9.01 and later)
exportPolicies()
Exports all policies from database to XML data.
exportPredefinedJobs()

Exports predefined jobs from database to XML data.

exportRemoteFileServers()

Exports remote file servers from database to XML data.

(Version 8.9.01 and later)
exportRoles()
Exports roles from database to XML data.
exportRules()Exports rules from database to XML data.
exportRuleSets()Exports rule sets from database to XML data.

The XML schema being used for the rule set XML files includes a full representation of each rule and its attributes within the rule set. 

exportSubstitutionParameters()Exports global substitution parameters from database to XML data.
exportTemplateGroups()

Exports template groups from database to XML data.

importComponents()

Imports any of the components that can be exported using the methods listed above into the BMC Network Automation database.
Whenever a new component is added or an existing component is modified during import, an event is logged into the event log.

Back to top

JobApprovalTypeService class

The JobApprovalTypeService class provides services to retrieve job approval types.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/JobApprovalTypeService?wsdl URL.

MethodDescription
getJobApprovalTypeByName()

Returns the job approval type that matches the given job approval type name.

getJobApprovalTypes()Returns all the job approval types in the system.

Back to top

JobService class

The JobService class provides services to approve or reject jobs and retrieve job status. Some methods in this class are relocated from the SpanActionService class.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/JobService?wsdl URL.

MethodDescription
doApprovalByChangeID()

Approves or rejects all BMC Network Automation jobs with the given change ID.

doApprovalByJobID()

Approves or rejects an BMC Network Automation job with the given job ID.

doApprovalByTaskID()

Approves or rejects all BMC Network Automation jobs with the given task ID.

doExternalApproval()

Approves or rejects a BMC Network Automation job with the given job ID, change ID, and task ID.

getActionResultSummaries()

Returns all of the device results for a particular job, in an abbreviated form that does not include device interaction transcripts. Results include action and sub-action numbers, which facilitate calls to retrieve the full device result (including the transcript) through getDeviceResult() or getDeviceResultWithSubaction().

getDeviceResult()Returns the complete span action execution details (including the transcript) for one device in one action in a job.
(Version 8.9.00 and later)
getDeviceResultWithSubaction()
Returns the complete span action execution details (including the transcript) for one device in one sub-action in a remediating action in a job.
retrieveJobStatusByChangeID()

Retrieves the current status of all jobs with the given change ID.

retrieveJobStatusByJobID()

Retrieves the current status of the job with given job ID.

retrieveJobStatusByTaskID()

Retrieves the current status of all jobs with given task ID.

(Version 8.9.00 and later)
retrieveRemediateByEnforceablesJobInfo()
Retrieves parameter information for a job that performs a remediate action on selected rule sets or rules.
(Version 8.9.00 and later) retrieveRemediateByEnforceablesResults()Retrieves detailed execution status of a completed job that performed a remediate action on selected rule sets or rules.

Back to top

PredefinedJobService class

The PredefinedJobService class provides services to retrieve and run predefined jobs.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/PredefinedJobService?wsdl URL.

MethodDescription
getAllPredefinedJobNames()Returns a list of the names of all predefined jobs.
getAllSharedRuntimeParameters()

Returns a list of all shared runtime parameters for a given predefined job.

getPredefinedJobNames()

Returns a list of the names of all predefined jobs that match a provided name filter (uses wildcards).

getPredefinedJobParamTypes()

Returns all the parameter types for a given predefined job.

getPredefinedJobs()

Returns PredefinedJobParamTypesDTO with details of the predefined job retrieved based on filter match and access rights of the logged in user.

submitJob()

Prepares and submits the given predefined job using the provided set of parameters.

validatePredefinedJobParams()

Validates the parameter values for a given predefined job. This method can be called before submitJob() to verify that the runtime and other parameter values are correct.

Back to top

RealmService class

The RealmService class provides services to add, modify, delete, and enumerate realms.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/RealmService?wsdl URL.

MethodDescription
addRealm()Adds a realm.
deleteRealm()Deletes a realm.
getRealmByKey()Returns the realm details by the key provided.
getRealmByName()Returns information about a realm by the name provided.
getRealms()

Returns a list of realms that are registered with the server.

modifyRealm()Modifies the properties of a realm.

Back to top

ReportService class

The ReportService class provides services to generate, email, and retrieve report data.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/ReportService?wsdl URL.

MethodDescription
doSendJobSummaryReportEmail()

Emails the Job Summary report to a set of e-mail addresses based on the specified report parameters.

getSystemDiagnosticsReport()

(Version 8.5.01 and later) Retrieves a system diagnostics report containing all the available information for the server and every remote device agent.

Back to top

RuleService class

The RuleService class provides services to retrieve and import rules.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/RuleService?wsdl URL.

MethodDescription
(Version 8.9.00 and later) getAbbreviatedCorrectableRules()

Returns brief information about the correctable rules that match the provided filter.

getRule()

Returns a single rule based on the provided rule key. This method is typically used when the rule key is available from a previous call.

For example, the rule key may be stored in a data file from a previous run so this method is used to retrieve the rule DTO object based on the stored rule key.

getRules()Returns a set of rules that match the provided filter.
importRules()Imports a set of rules to the server based on the specified parameters. The import process works in the same manner as running a Rule Import from the GUI.

Back to top

RuleSetService class

The RuleSetService class provides services to retrieve rule sets.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/RuleSetService?wsdl URL.

MethodDescription
addRuleSet()Adds a new rule set to the system.
deleteRuleSet()Deletes an existing new rule set from the system.
getRuleSet()

Returns a single rule set based on the provided rule set key. This method is often used to get a rule set DTO object for a retrieved rule. The rule DTO object contains a reference to the rule set key.

getRuleSets()Returns a set of rule sets that match the provided filter.
modifyRuleSet()

Modifies an existing rule set in the BMC Network Automation database.

Back to top

SecurityVulnerabilityService class

The SecurityVulnerabilityService class provides services to import security vulnerabilities.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/SecurityVulnerabilityService?wsdl URL.

MethodDescription
importSecurityVulnerability()Imports a new security vulnerability into the system.
importSecurityVulnerabilitiesFromZip()Imports multiple security vulnerabilities present inside a zipped file into the system.

Note

Client programs must have Message Transmission Optimization Mechanism (MTOM) implementation to execute these services.

Back to top

SpanActionService class

The SpanActionService class provides services to run Snapshot, Commit, Custom, Make Trusted, Deploy to Active, Refresh, and Deploy to Stored span actions and also to retrieve span action results of previously run actions.

Note

The job approval methods that were previously in this class have been moved to the JobService class.

Each of the span action execution calls have a parameter called waitForCompletion to indicate whether the call should block until the span action execution has completed. When the value of this parameter is false, the call returns to the client after the server creates the span action/job with the given parameters and schedules the job. For more information about this parameter, see the Javadoc provided in the BMC Network Automation Web Services distribution file.

When you plan to set a Run At Time value (that is, a scheduled run date/time in the future), you must set the waitForCompletion parameter to false because otherwise jobs will be held up waiting for completion of the run. For example:

String jobID = spanActionService.doBackup(userToken, jobParamsDTO, false);

If you set the waitForCompletion parameter to true, the job will fail validation and will not run; the system will report this error to the client.

For a Run At Time value, you must create the Date object using a pattern in SimpleDateFormat. For example:

Calendar runAtCal = Calendar.getInstance();
/*
Example:
Pattern --- "yyyy.MM.dd G 'at' HH:mm:ss z"
Value ----- "2011.07.04 AD at 12:08:56 PDT"
*/
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mmz");
Date date = sdf.parse("2012.06.30 AD at 12:08 PDT");
runAtCal.setTime(date);

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/SpanActionService?wsdl URL.

MethodDescription
doBackup()

Executes a Snapshot action on one or more devices based on the specified parameters.

doCommit()

Executes a Commit action on one or more devices based on the specified parameters.

doCustomAction()

Executes a custom action on one or more devices based on the specified parameters. Custom actions may capture and return additional result data, which is available after calling getSpanActionResults().

doDeployOsImageByImageActiveOnDate()

Executes a Deploy OS Image job with the given OS Image source that is active on the specific date and returns the new job's jobID on one or more devices based on the specified parameters.

doDeployOsImageFromFile()

Executes a Deploy OS Image job with the given OS Image source from the file and returns the new job's jobID on one or more devices based on the specified parameters.

Note: Client programs must have Message Transmission Optimization Mechanism (MTOM) implementation to execute this service.

doDeployOsImageFromOsImageLibrary()

Executes a Deploy OS Image job with the given OS Image source from the OS Image library and returns the new job's jobID on one or more devices based on the specified parameters.

doDeployOsImageFromRemoteFileServer()

Executes a Deploy OS Image job with the given OS Image source from the remote file server and returns the new job's jobID on one or more devices based on the specified parameters.

getLoadableOsImages()

Returns the details including the image key of the loadable OS images stored in the OS Image library.

This image key is used when performing the doDeployOsImageFromOsImageLibrary action.

Note: The doDeployOsImage*() methods might take a long time to complete depending on the size and number of image files, network connectivity to the device, and the device processing time.

doMarkAsTrustedByConfigDate()

doMarkAsTrustedByConfigKey()

Executes a Mark as Trusted action on one or more devices based on the specified parameters.

doMergeByAdhocTemplate()

doMergeByConfigKey()

doMergeByConfigType()

doMergeByTemplateGroup()

(Deprecated in version 8.9.00) doMergeCompliantAllAssigned()

(Deprecated in version 8.9.00) doMergeCompliantByRule()

(Deprecated in version 8.9.00) doMergeCompliantByRuleSet()

Executes a Deploy to Active action on one or more devices based on the specified parameters.

doMergeByAdhocTemplateExtended()

doMergeByConfigKeyExtended()

doMergeByConfigTypeExtended()

doMergeByTemplateGroupExtended()

Executes a Deploy to Active action on one or more devices based on the specified parameters.

These methods are similar to the preceding set of methods, but with additional options:

  • forceTunneledTransfer
  • stopOnSyntaxError
doMergeByAdhocInjectionTemplateExtended()

Executes a Deploy to Active action on one or more devices based on the specified parameters.

This method is the same as the preceding set of methods but with the following additional option, injectionTemplate.

(Deprecated in version 8.9.00) doMergeCompliantAllAssignedExtended()

(Version 8.9.00 and later) doMergeCompliantAllAssignedExtended2()

(Deprecated in version 8.9.00) 
doMergeCompliantByRuleExtended()

(Version 8.9.00 and later) doMergeCompliantByRuleExtended2()

(Deprecated in version 8.9.00) doMergeCompliantByRuleSetExtended()

(Version 8.9.00 and later) doMergeCompliantByRuleSetExtended2()

Executes a Deploy to Active action on one or more devices based on the specified parameters.

These methods are similar to the preceding set of methods but with additional options:

  • forceTunneledTransfer
  • ignoreRuleConflicts 
  • overrideCorrectiveActionOptions
  • stopOnSyntaxError
doRefreshStatus

Executes a Deploy to Active action on one or more devices based on the provided parameters.

(Version 8.9.00 and later)
doRemediateByAllAssigned()
Executes a Remediate action on one or more devices to correct all the rules currently in violation.
(Version 8.9.00 and later) doRemediateByEnforceables()Executes a Remediate action on one or more devices to correct specified rule sets and rules.
doRestoreByTemplateGroup

Executes a Deploy to Stored action on one or more devices based on the provided parameters.

getSpanActionResults

Returns the span action results of a job that has executed with the given job ID.

Back to top

SpanService class

The SpanService class offers a service related to span. 

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/SpanService?wsdl URL.

MethodDescription
getSpans()Returns the details of spans.

Back to top

SubstitutionParameterService class

The SubstitutionParameterService class provides services to manage substitution parameters.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/SubstitutionParameterService?wsdl URL.

MethodDescription
addSubstitutionParameter()Adds a new substitution parameter to the system.
deleteSubstitutionParameter()Deletes a substitution parameter from the system.
getSubstitutionParameterByName()

Returns the details of a substitution parameter based on the given name.

getSubstitutionParameters()

Returns all substitution parameters from the system.

modifySubstitutionParameter()

Modifies an existing substitution parameter in the system.

Back to top

TemplateGroupService class

The TemplateGroupService class provides services to manage template groups.

Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/TemplateGroupService?wsdl URL.

MethodDescription
addTemplateGroup()Adds a new template group to the system.
deleteTemplateGroup()Deletes a template group from the system.
getTemplateGroupByName()

Returns the details of a template group based on the given name.

getTemplateGroups()Returns all template groups from the system.
modifyTemplateGroup()Modifies an existing template group in the system.

Back to top

UserService class

The UserService class provides services to add, modify, delete, retrieve all users, and retrieve a particular user by using the user name or user key.
 
Retrieve the WSDL for this service by using the https://<server:port>/bca-networks/services/UserService?wsdl URL.

MethodDescription
addUser()Adds a new user to the system.
deleteUser()Deletes an existing user from the system.
This method returns a ReferenceDTO array, which indicates whether the user is in use that prevents it from being deleted.
getUsers()Returns users from the database.
getUserByName()

Returns a user by matching the given name.

getUserByKey()Returns a single user based on the provided user key.
This method is typically used when the user key is available from a previous call. For example, the user key might be stored in a data file from a previous run. Therefore, this method is used to retrieve the user DTO based on the stored user key.
modifyUser()Modifies the properties of existing user in the system.

Back to top

Was this page helpful? Yes No Submitting... Thank you

Comments