Use the list
Option for Resources
Many resources take the list
option. This section details some of its uses.
Default List of All Fields
The default list
command displays all fields associated with the resource:
ilo resource list
List Only Specific Fields
With the --field
option, specify the fields to display:
ilo resource list --field CSV_list_of_fieldnames
For example, to display a list of labels with only the href, key, and value fields, use the --field
option with those fields as comma-separated arguments.
Example List with Selected Fields
ilo label list --fields href,key,value +---------------------+------+-----------------+ | Href | Key | Value | +---------------------+------+-----------------+ | /api/v2/2/labels/1 | role | Web | | /api/v2/2/labels/2 | role | Database | ... | /api/v2/2/labels/48 | loc | Asia | +---------------------+------+-----------------+
Nested Resource Fields and Wildcards
Some resources have hierarchical, nested fields. For example, the workload resource includes the following hierarchy for the agent field:
agent/config/log_traffic
A field named agent
That has a field named
config
That has a field named
log_traffic
To list nested fields, separate the hierarchy of the field names with a slash to the depth of the desired field.
To see all nested fields of one of a resource's fields, use the asterisk (*
) wildcard.
Examples
The following example displays all fields under the agent/config field.
Example of All Nested Fields with Wildcard (*)
ilo workload list --field agent/config/* +-------------+------------------+-------------+ | Log Traffic | Visibility Level | Mode | +-------------+------------------+-------------+ | false | flow_summary | illuminated | | false | flow_summary | idle | +-------------+------------------+-------------+
You can combine individual field names, nested field names, and the *
wildcard.
Example: Combination of Individual fields, Nested fields, and Wildcard
ilo workload list --fields href,hostname,agent/config/*,agent/status/uid,agent/status/status +----------------------------------------------------------+-----------------------------+-------------+------- | Href | Hostname | Log Traffic | Visibility Level | Mode | Uid | Status | +----------------------------------------------------------+-----------------------------+-------------+------- | /api/v2/1/workloads/527b8aca-97aa-43b9-82e1-29b17a947cdd | hrm-web.webscaleone.info | false | flow_summary | illuminated | 0ffd2290-e26a-4ec6-b241-9e2205c0b730 | active | | /api/v2/1/workloads/4a8743a4-14ee-40d0-9ed2-990fe3f0ffb1 | hrm-db.webscaleone.info | false | flow_summary | illuminated | 145a3cc8-01a8-4a52-97b8-74264ad690e4 | active | +----------------------------------------------------------+-----------------------------+-------------+---- ...
Linux: Save Fields for Reuse
On Linux, to easily reuse specific fields, create a display configuration file in YAML format and set the environment variable ILO_DISPLAY_CONFIG
to point to that file. You no longer need to specify specific fields on the list command line.
Examples
Configure the workloads list command to display only the href, hostname, all agent configuration fields, and agent version:
Example Command to Save to List Configuration File
ilo workload list --fields href,hostname,agent/config/*,agent/status/agent_version
Add the field names to a display configuration file in the following YAML format:
Example YAML Layout of Display Configuration File
workload: fields: - href - hostname agent: config: fields: - '*' status: fields: - agent_version
Set the Linux environment variable ILO_DISPLAY_CONFIG
to the path to the YAML file:
Example ILO_DISPLAY_CONFIG environment variable
$ export ILO_DISPLAY_CONFIG=~/ilo_display/display_config.yaml
List of All Workloads
To view all details for all workloads, use the following command:
ilo workload list
About the Workload UUID
To view an individual workload, you need the workload's identifier, called the UUID, or Universal Unique Identifier.
The UUID is shown in the list of all workloads described in List of All Workloads. The UUID is the last word of the value of the workload's href field, as shown in bold in the following example:
/api/v2/orgs/28/workloads/2ca0715a-b7e3-40e3-ade0-79f2c7adced0
View Individual Workload
To see the details about an individual workload, use the following command:
ilo workload read -workload-id UUID
Where:
UUID is the workload's UUID. See About the Workload UUID for information.
The details of an individual workload are grouped under major headings:
Workload > Interfaces
Workload > Labels
Workload > Services
Services > Open Service Ports
Agent > Status
Example List of Individual Workload
ilo workload read --workload-id 2ca0715a-b7e3-40e3-ade0-79f2c7adced0 +--------------------------+----------------------------------------------------------------------------------- | Attribute | Value +--------------------------+----------------------------------------------------------------------------------- | href | /orgs/1/workloads/2ca0715a-b7e3-40e3-ade0-79f2c7adced0 | deleted | false ... Workload -> Interfaces +------+------------------+------------+-------------------------+------------+------------+------------------- | Name | Address | Cidr Block | Default Gateway Address | Link State | Network Id | Network Detection Mode +------+------------------+------------+-------------------------+------------+------------+------------------- | eth0 | 10.0.0.16 | 8 | 10.0.0.1 | up | 1 | single_private_brn ... Workload -> Labels +-------------------+ | Href | +-------------------+ | /orgs/1/labels/37 | ... Workload -> Services +-----------------+---------------------------+ | Attribute | Value | +-----------------+---------------------------+ | uptime_seconds | 69016553 | ... Services -> Open Service Ports +----------+---------+------+--------------+------+---------+------------------+ | Protocol | Address | Port | Process Name | User | Package | Win Service Name | +----------+---------+------+--------------+------+---------+------------------+ | 17 | 0.0.0.0 | 123 | ntpd | root | | | ... Workload -> Agent +-----------+--------------------------------------------------------------------------------+ | Attribute | Value | +-----------+--------------------------------------------------------------------------------+ | config | {"log_traffic"=>true, "visibility_level"=>"flow_summary", "mode"=>"enforced"} | | href | /orgs/1/agents/16 | ... Agent -> Status +-----------------------------+---------------------------------------+ | Attribute | Value | +-----------------------------+---------------------------------------+ | uid | db482b06-41c6-4297-a60c-396de13576ad | | last_heartbeat_on | 2016-12-07T04:07:03.756Z | ... 200, OK