Previous Topic: Retrieve Antecedents and Dependents From CIM ObjectsNext Topic: Invoking AutoShell


Retrieve CIM Objects

Each CIM class has a static getInstances() method that returns an array of class objects.

To retrieve all systems managed by CA Virtual Assurance, use the following command:

aObjs = CA_ComputerSystem.getInstances()
? "Query returned", oObjs.length

To retrieve a subset of systems managed by CA Virtual Assurance, use one of the following filter expressions:

aObjs = CA_ComputerSystem.getInstances("ElementName=’Everest.local'")

or

aObjs = CA_ComputerSystem.getInstances("ElementName like 'Ev*'")

To retrieve system names and descriptions, use the following command:

aObjs = CA_ComputerSystem.getInstances();
for(i=0; i<aObjs.length; i++)
	? aObjs[i].getElementName(),aObjs[i].getDescription()

To retrieve CIM object properties and values, use the following command:

aObjs = CA_ComputerSystem.getInstances("ElementName='Debian1'")
show-cimObject aObjs[0]

Example: Output for show-cimObject command

CA_ComputerSystem
=================
Caption: null
Description: null
ElementName: Debian1
Facets: 44
InstallDate: null
Name: 47332da1-e782-0308-d614-c2e99de989bc
OperationalStatus: undefined
StatusDescriptions: undefined
Status: null
HealthState: 5
PropagatedHealthState: null
IsPropagated: true
PrimaryStatus: null
DetailedStatus: null
OperatingStatus: null
CommunicationStatus: null
ManagementStatus: null
EnabledState: null
OtherEnabledState: null
RequestedState: null
EnabledDefault: null
TimeOfLastStateChange: null
AvailableRequestedStates: undefined
TransitioningToState: null
CreationClassName: CA_ComputerSystem
NameFormat: null
PrimaryOwnerName: null
PrimaryOwnerContact: null
Roles: undefined
OtherIdentifyingInfo: undefined
IdentifyingDescriptions: undefined
Dedicated: undefined
OtherDedicatedDescriptions: undefined
ResetCapability: null
PowerManagementCapabilities: undefined
HostName: 192.168.1.119
IpAddress: null
SerialNumber: null
Version: null
CpuCount: 1
TotalVisibleMemorySize: 256
PatchLevel: null
BiosVersion: null
Fans: null
Chassis: null
DrCapable: null
VendorId: null
MacAddress: null
ArchTypeUID: null
Available: null
LastUpdate: null
SnapshotType: null
TotalStorageCapacity: null
Model: null
CpuSpeed: null
SystemImageId: null
HardwareClassId: null