此内容没有您所选择的语言版本。

2. Getting the JBoss ON ID for an Object


Everything in JBoss ON — resources, configuration properties, bundle archives, templates, alerts, everything — is identified with a unique ID number. Most of these ID numbers are visible in the web UI as part of the URL which goes to that object's details page.
Not every ID is easily found, though. For example, searching for a metric template requires the resource type ID, but the resource type ID is hard to find.
In other instances, you may want to run a script against multiple resources, which means there are multiple resource IDs which may not be explicitly known at the time you write the script.
Searching for a resource (Section 1, “Searches”) retrieves the resource's details, including its ID.
rhqadmin@localhost:7080$ criteria = new ResourceCriteria();
ResourceCriteria:
        inventoryManagerRequired: false
                 persistentClass: class org.rhq.core.domain.resource.Resource

rhqadmin@localhost:7080$ criteria.addFilterResourceTypeName('Linux')

rhqadmin@localhost:7080$ ResourceManager.findResourcesByCriteria(criteria);
one row
Resource:
                         id: 10001
                       name: gs-dl585g2-01.rhts.eng.bos.redhat.com
                    version: Linux 2.6.32-220.el6.x86_64
        currentAvailability: UP
               resourceType: Linux
Copy to Clipboard Toggle word wrap
This is true for any *Criteria search. It retrieves the ID for the object is searches for, even if that ID is not explicitly displayed.
This ID can then be used in other operations.
rhqadmin@localhost:7080$ var metrics = MeasurementDataManager.findLiveData(resources.get(0).id, [mdefs.get(0).id]);
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat