您可以使用 getAntecedents() 和 getDependents() 方法来检索 CIM 对象祖先项和子项。
要检索 CIM 对象祖先项,请调用 getAntecedents() 方法:
// 检索所有计算机系统
arr=CA_ComputerSystem.getInstances()
// 继续使用返回的第一个计算机系统
cs=arr[0]
// 检索祖先项
arrAnt = cs.getAntecedents()
for(i=0; i<arrAnt.length; i++)
{
show-cimObject arrAnt[i]
}
要检索某个 CIM 类的祖先项实例,请调用 getAntecedents() 方法:
os = cs.getAntecedents("CIM_OperatingSystem");
show-cimObject os
要检索 CIM 对象子项,请调用 getDependents() 方法:
// 检索所有计算机系统,
arr=CA_ComputerSystem.getInstances()
// 继续使用返回的第一个计算机系统
cs=arr[0]
// 检索子项
arrAnt = cs. getDependents()
for(i=0; i<arrAnt.length; i++)
{
show-cimObject arrAnt[i]
}
要检索某个 CIM 类的子项实例,请调用 getDependents() 方法:
fs = cs. getDependents("CIM_FileSystem");
show-cimObject fs
| 版权所有 © 2013 CA。 保留所有权利。 |
|