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

Chapter 11. Tips and Tricks for Using the CLI


JBoss ON CLI scripts make it possible to automate tasks, from simply importing discovered resources to running complex management operations to remedy configuration drift or schedule web app upgrades.
The JBoss ON CLI has some usability features to make it easier to use interactively for developing scripts, to integrate with system tools to help task automation, and to create custom functions for more versatile, real-life applications.

11.1. Using Tab Complete

In interactive mode, the JBoss ON CLI is aware of the implicit variables (Chapter 7, Available Implicit Variables in the JBoss ON API) in the domain API and the JBoss ON remote API, as well as the specific CLI commands and methods (Chapter 8, Methods Specific to the JBoss ON CLI). When running the CLI interactively, any of these methods can be filled in using Tab complete.
Filling in part of a class lists potential matching classes (or, if it matches, commands). For example:
[jsmith@server bin]# ./rhq-cli.sh -u rhqadmin -p rhqadmin
  RHQ Enterprise Remote CLI 3.3
  Remote server version is: 3.3 (2484565)
  Login successful
  rhqadmin@localhost:7080$ Resource

  ResourceFactoryManager   ResourceGroupManager     ResourceManager
  ResourceTypeManager

  rhqadmin@localhost:7080$ ex

  exporter   exec
Copy to Clipboard Toggle word wrap
After selecting a class, hitting Tab once lists all of the methods for that class.
rhqadmin@localhost:7080$ ResourceManager.

  availabilitySummary           disableResources
  enableResources               findChildResources
  findResourceLineage           findResourcesByCriteria
  getAvailabilitySummary        getLiveResourceAvailability
  getParentResource             getResource
  getResourcesAncestry          liveResourceAvailability
  parentResource                resource
  toString                      uninventoryResources
  updateResource
Copy to Clipboard Toggle word wrap
Hitting Tab twice prints the full method signatures:
rhqadmin@localhost:7080$
  
           List<Integer> enableResources(GenericArrayTypeImpl[int])
           Resource updateResource(Resource resource)
           List<Integer> uninventoryResources(GenericArrayTypeImpl[int] resourceIds)
	   ResourceAvailabilitySummary getAvailabilitySummary(int resourceId)
           PageList<Resource> findChildResources(int resourceId, PageControl pageControl)
           Map<Integer,String> getResourcesAncestry(GenericArrayTypeImpl[Integer] resourceIds, ResourceAncestryFormat format)
           List<Integer> disableResources(GenericArrayTypeImpl[int])
           List<Resource> findResourceLineage(int resourceId)
	   ResourceAvailability getLiveResourceAvailability(int resourceId)
           PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria)
           Resource getResource(int resourceId)
           String toString()
	   Resource getParentResource(int resourceId)
Copy to Clipboard Toggle word wrap
Autocomplete is very useful for finding what methods or objects are implicitly available, for building criteria-based searches (because it is easier to select criteria), and for developing server scripts.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat