GwDependency()
GwDependency(); 规则检索对指定实体的依赖关系列表。 此数据是从 NCIM 高速缓存表 ncimCache.dependency中检索的。
语法
GwDependency(); 语句使用以下语法。
GwDependency ( entityId or entityName, [optional dependency identifier] );参数
下表列出此编排器规则的参数的属性。| 参数 | 描述 | 接受常量 | 接受变量 | 接受 eval 子句 |
|---|---|---|---|---|
entityId 或 entityName |
指示规则返回依赖于此实体的实体。 | 是 | 是 | 是 |
optional dependency identifier |
指示规则仅检索此类型的依赖关系。 | 是 | 否 | 否 |
示例
以下示例查找所有从属实体,然后打印出所有结果。
int entityId = eval( text, '&NmosEntityId' );
# Find all depencies on the given entityName...
RecordList dependentEntities = GwDependency( entityId );
# ...and iterate through the returned results
Record singleDependent;
foreach ( dependentEntities )
{
singleDependent = GetInScopeRecord();
PrintRecord( singleDependent );
}
示例
以下示例查找特定类型的所有从属实体。
# Find all dependents of a specific type
RecordList specificDependents = GwDependency( entityId , 1 );退货
此规则返回记录列表。 每条记录都包含有关单个从属实体的信息,如ncimCache.dependency 表中所包含。以下片段显示此规则返回的结果的示例。
{
DEPENDENCYTYPE=1;
ENTITYNAME='IPMRoute_UpstreamRoute_core2-cs35.core.eu6.test.lab_(0.0.0.0,239.255.255.255)';
},
{
DEPENDENCYTYPE=1;
ENTITYNAME='IPMRoute_UpstreamRoute_istanbul-asbr-cr26.tk.eu.test.lab[ Fa0/1 ]_(0.0.0.0,239.255.255.255)';
},
{
DEPENDENCYTYPE=1;
ENTITYNAME='IPMRoute_DownstreamRoute_istanbul-asbr-cr26.tk.eu.test.lab[ Fa0/0 ]_(0.0.0.0,239.255.255.255)_239.255.255.255';
}