Skip to end of metadata
Go to start of metadata

Properties

Adding, reading and removing system property using CLI

For standalone mode:

For domain mode the same commands are used, you can add/read/remove system properties for:
All hosts and server instances in domain

Host and its server instances

Just one server instance

Overview of all system properties

Overview of all system properties in WildFly including OS system properties and properties specified on command line using -D, -P or --properties arguments.

Standalone

Domain

Configuration

List Subsystems

List description of available attributes and childs

Descriptions, possible attribute type and values, permission and whether expressions ( ${ ... } ) are allowed from the underlying model are shown by the read-resource-description command.

View configuration as XML for domain model or host model

Assume you have a host that is called master

Just for the domain or standalone

Take a snapshot of what the current domain is

Take the latest snapshot of the host.xml for a particular host

Assume you have a host that is called master

How to get interface address

The attribute for interface is named "resolved-address". It's a runtime attribute so it does not show up in :read-resource by default. You have to add the "include-runtime" parameter.

It's similar for domain, just specify path to server instance:

Runtime

Get all configuration and runtime details from CLI

Scripting

Windows and "Press any key to continue ..." issue

WildFly scripts for Windows end with "Press any key to continue ...". This behavior is useful when script is executed by double clicking the script but not when you need to invoke several commands from custom script (e.g. 'bin/jboss-admin.bat --connect command=:shutdown').

To avoid "Press any key to continue ..." message you need to specify NOPAUSE variable. Call 'set NOPAUSE=true' in command line before running any WildFly 8 .bat script or include it in your custom script before invoking scripts from WildFly.

Statistics

Read statistics of active datasources

or

Deployment

Undeploying and redeploying multiple deployments

CLI offers a way to efficiently undeploy or redeploy deployments in one simple command.

  • To disable all enabled deployments: undeploy --keep-content *
  • To redeploy all disabled deployments: deploy --name=*

Incremental deployment with the CLI

It can be desirable to incrementally create and(or) update a WildFly deployment. This chapter details how this can be achieved using the WildFly CLI tool.

Steps to create an empty deployment and add an index html file.

  1. Create an empty deployment named my app:
  2. Add an index.html to my app:

    Then use completion to navigate to your index.html file.

  3. Provide a target name for index.html inside the deployment and execute the operation:
  4. Your content has been added, you can browse the content of a deployment using the browse-content operation:
  5. You can display (or save) the content of a deployed file using the attachement command:
  6. You can remove content from a deployment:
Tips
  • add-content operation allows you to add more than one file (content argument is a list of complex types). 
  • CLI offers completion for browse-content's path and remove-content's paths argument.
  • You can safely use operations that are using attached streams in batch operations. In the case of batch operations, streams are attached to the composite operation.
On Windows, path separator '\' needs to be escaped, this is a limitation of CLI handling complex types. The file path completion is automatically escaping the paths it is proposing.

Notes for server side operation Handler implementors

In order to benefit from CLI support for attached file streams and file system completion, you need to properly structure your operation arguments. Steps to create an operation that receives a list of file streams attached to the operation:

  1. Define your operation argument as a LIST of INT (The LIST value-type must be of type INT).
  2. In the description of your argument, add the 2 following boolean descriptors: filesystem-path and attached-streams

When your operation is called from the CLI, file system completion will be automatically proposed for your argument. At execution time, the file system paths will be automatically converted onto the index of the attached streams.

Downloading files with the CLI

Some management resources are exposing the content of files in the matter of streams. Streams returned by a management operation are attached to the headers of the management response. The CLI command attachment (see CLI help for a detailed description of this command) allows to display or save the content of the attached streams.

  • Displaying the content of server.log file:
  • Saving locally the server.log file:
  • Displaying the content of a deployed file:
  • By default existing files will be preserved. Use the option --overwrite to overwrite existing file.
  • attachment can be used in batch mode.
Labels:
jboss jboss Delete
wildly wildly Delete
cli cli Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.