API Guide
Table Of Contents
- Active System Manager Release 8.2 API Reference Guide
- Overview
- Resource URI Endpoints
- Authentication Headers
- Generic Query Parameters
- HTTP Message Bodies
- Usage Examples
- Exception Handling
- Appendix A - API Reference
- /Authenticate/
- /Chassis/
- /Chassis/{refId}
- /Chassis/{refId}
- /Chassis/{refId}
- /Chassis/iom/ip/{ip}
- /Chassis/{refId}/sensorlog
- /Chassis/{refId}/sensorlog
- /Chassis/{serviceTag}/{type}
- /Chassis/{serviceTag}/{type}
- /Credential/
- /Credential/
- /Credential/{id}
- /Credential/{id}
- /Credential/{id}
- /DHCP/
- /DHCP/
- /Deployment/
- /Deployment/
- /Deployment/{id}
- /Deployment/{id}
- /Deployment/{id}
- /Deployment/export/csv
- /Deployment/defineService
- /Deployment/defineServiceDiff
- /Deployment/device/{deviceId}
- /Deployment/filter/{numOfDeployments}
- /Deployment/migrate/{serviceId}/{serverId}
- /Deployment/migrateServer/{serviceId}/{componentId}
- /Deployment/serverNetworking/{serviceId}/{serverId}
- /DeviceGroup/
- /DeviceGroup/
- /DeviceGroup/{refId}
- /DeviceGroup/{refId}
- /DeviceGroup/{refId}
- /DiscoveryRequest/
- /DiscoveryRequest/
- /DiscoveryRequest/{id}
- /DiscoveryRequest/{id}
- /DiscoveryRequest/chassislist
- /DiscoveryRequest/discoveryresult/{id}
- /FirmwareRepository/
- /FirmwareRepository/
- /FirmwareRepository/{id}
- /FirmwareRepository/{id}
- /FirmwareRepository/connection
- /FirmwareRepository/compliance
- /FirmwareRepository/compliance/{id}
- /FirmwareRepository/softwarecomponent
- /FirmwareRepository/softwarebundle/{id}
- /ManagedDevice/
- /ManagedDevice/
- /ManagedDevice/count
- /ManagedDevice/{refId}
- /ManagedDevice/{refId}
- /ManagedDevice/{refId}
- /ManagedDevice/firmware
- /ManagedDevice/export/csv
- /ManagedDevice/withcompliance
- /ManagedDevice/puppet/{certName}
- /ManagedDevice/puppet/{certName}
- /ManagedDevice/withcompliance/{refId}
- /NTP/
- /NTP/
- /NTP/
- /Network/
- /Network/
- /Network/export/csv
- /Network/{networkId}
- /Network/{networkId}
- /Network/{networkId}
- /Network/ipAddress/assign
- /Network/ipAddress/release
- /Network/{networkId}/usageids
- /Network/{networkId}/ipaddresses
- /OSRepository/
- /OSRepository/
- /OSRepository/{id}
- /OSRepository/{id}
- /OSRepository/{id}
- /OSRepository/sync/{id}
- /OSRepository/connection
- /Proxy/
- /Proxy/
- /Proxy/test
- /Server/
- /Server/count
- /Server/{refId}
- /Server/{refId}
- /Server/serviceTag/{serviceTag}
- /ServiceTemplate/
- /ServiceTemplate/
- /ServiceTemplate/{id}
- /ServiceTemplate/{id}
- /ServiceTemplate/{id}
- /ServiceTemplate/upload
- /ServiceTemplate/export
- /ServiceTemplate/{id}/copy
- /ServiceTemplate/export/csv
- /ServiceTemplate/uploadConfig
- /ServiceTemplate/updateParameters
- /ServiceTemplate/device/{deviceId}
- /ServiceTemplate/{id}/mapToPhysicalResources
- /ServiceTemplate/components/service/{serviceId}
- /ServiceTemplate/components/template/{templateId}
- /ServiceTemplate/service/{serviceId}/{componentType}
- /ServiceTemplate/template/{templateId}/{componentType}
- /Timezone/
- /Timezone/
- /Timezone/all
- /User/
- /User/
- /User/{userId}
- /User/{userId}
- /User/{userId}
- /WizardStatus/
- /WizardStatus/
- Appendix B - Model Reference
- BrownfieldStatus
- ComparatorValue
- CompliantState
- DeploymentHealthStatusType
- DeploymentStatusType
- DeviceHealth
- DeviceState
- DeviceType
- DiscoverDeviceType
- DiscoveryStatus
- DiskMediaType
- Health
- HotSpareStatus
- IOMLocationType
- IdentityType
- LogSeverity
- MediaType
- NetworkMode
- PhysicalType
- RepositoryState
- RepositoryStatus
- ServerSlotType
- ServiceTemplateComponentSubType
- ServiceTemplateComponentType
- ServiceTemplateSettingType
- UIRaidLevel
- UpdateType
- AsmDetailedMessage
- AuthenticateRequest
- AuthenticateResponse
- ChassisController
- ChassisPowerSupply
- Enclosure
- FirmwareInventory
- GroupUser
- IKVM
- IpAddress
- IpRange
- Link
- List
- MemoryInventory
- OSRepository
- ProcessorInventory
- RejectedServer
- SelectedNIC
- ServerJobStatus
- ServiceTemplateOption
- ServiceTemplateUploadRequest
- SoftwareComponent
- timeZone
- UsageIdList
- VM
- connected_switch
- dhcpSettings
- fc_interface
- logEntry
- ntpSettings
- proxySettings
- references
- testProxyResponse
- timeZone
- AsmDetailedMessageList
- DeploymentDevice
- DeviceDiscoveryRequest
- FirmwareComplianceComponents
- FirmwareUpdateRequest
- GregorianCalendar
- GroupUserList
- IOM
- LogicalNetworkIdentityInventory
- PhysicalDisk
- Server
- ServiceTemplateValid
- SoftwareBundle
- StaticNetworkConfiguration
- VirtualDiskConfiguration
- availableTimeZones
- credential
- wizardStatus
- Chassis
- ChassisLogEntry
- DeviceDiscoveryRequests
- LogicalNetworkInterface
- Network
- User
- VirtualDisk
- asmCredential
- Controller
- Partition
- RAIDConfiguration
- credentialList
- Interface
- SelectedServer
- DeploymentFilterResponse
- Fabric
- NetworkConfiguration
- ServerNetworkObjects
- ServiceTemplateSetting
- ServiceTemplateCategory
- component
- FirmwareRepository
- ServiceTemplate
- Deployment
- DiscoveredDevices
- DiscoveryResult
- FirmwareDeviceInventory
- DiscoveryRequest
- ManagedDevice
- ManagedDeviceList
- DeviceGroup
- DeviceGroupList
- Appendix C -Ruby Code Usage

response = ASM::API::sign {
RestClient.get url
}
# Set draft to false
payload = ASM::Payload.from_xml(response)
payload.set('//draft', 'false')
# Send it back as a PUT
response = ASM::API::sign {
RestClient.put url, payload.to_xml, :content_type => :xml
}
Deployment
While the ASM UI refers to a Service, the REST API resource is not Service, but rather Deployment. The
two terms are synonymous. Deployments require an instance of a ServiceTemplate with its required
parameters supplied.
Get all deployed Services
require 'ASMConfig'
response = ASM::API::sign {
url = ASM::API::URI("/Deployment")
RestClient.get url
}
doc = Nokogiri::parse(response)
doc.xpath('//Deployment').each do |deploy|
id = deploy.at_xpath('id').content
name = deploy.at_xpath('deploymentName').content
status = deploy.at_xpath('jobStatus').content
print "%s : %s : %s\n" % [id,name,status]
end
After getting all Services we print the id, name, and status of each. Services that are still in the act of being
deployed will have a status of IN_PROGRESS. So calling this method with the Deployment Id as a path
parameter can also be used to periodically poll a Deployment to find out when it has finished.
Deploy a new Service
Here, after having previously gotten an existing ServiceTemplate by name, and saved it to a file, we then
set the required parameters in the ServiceTemplate file, and finally embed the ServiceTemplate into a
prefabricated Deployment structure that is read from a file. As mentioned previously we can monitor the
status of this Deployment by performing a GET with the deployment id as a path parameter.
require 'ASMConfig'
url = ASM::API::URI('/Deployment')
template_name = 'TwoServers'
template = ASM::Payload::load_xml("%s.xml"%template_name)
deployment = ASM::Payload::load_xml('deployment_skeleton.xml')
# Set Deployment parameters
deployment.set("deploymentName", 'ManualAPIDeploymentDeux')
deployment.set("deploymentDescription", 'Manual API Deployment')
23