List
The bacalhau node list command is designed to provide users with a comprehensive list of network nodes along with details based on specified flags.
Description
The list sub-command under the bacalhau node category enumerates information about nodes in the network. It supports various filtering, ordering, and output formatting options, allowing users to tailor the output to their needs.
Usage
bacalhau node list [flags]
Flags
-h,--help:- Show the help message for the
listcommand.
- Show the help message for the
--hide-header:- Do not display the column headers in the output.
--filter-approval string:- Only show nodes with the specified approval status. Valid values are:
approved,pending,rejected.
- Only show nodes with the specified approval status. Valid values are:
--filter-status string:- Only show nodes with the specified connection status. Valid values are:
connected,disconnected.
- Only show nodes with the specified connection status. Valid values are:
--labels string:- Filter nodes based on labels. This follows the filtering format provided by Kubernetes, as shown in their documentation about labels.
--limit uint32:- Restrict the number of results displayed.
--next-token string:- Provide the next token for pagination.
--no-style:- Output the table without any style.
--order-by string:- Sort the results based on a specific field. Valid sorting fields are:
id,type,available_cpu,available_memory,available_disk,available_gpu,status.
- Sort the results based on a specific field. Valid sorting fields are:
--order-reversed:- Display the results in reverse order.
--output format:- Choose the output format. Available options:
table,csv,json,yaml. - Default:
table.
- Choose the output format. Available options:
--pretty:- Enhance the visual appeal of the output. This is applicable only to
jsonandyamlformats.
- Enhance the visual appeal of the output. This is applicable only to
--show strings:- Determine the column groups to be displayed. Acceptable values are:
labels,version,features,capacity. - Default:
labels,capacity.
- Determine the column groups to be displayed. Acceptable values are:
--wide:- Display full values in the output table, without truncation.
Global Flags
--api-host string:- Description: The host for the client and server to communicate on (via REST). Ignored if the
BACALHAU_API_HOSTenvironment variable is set. - Default:
0.0.0.0
- Description: The host for the client and server to communicate on (via REST). Ignored if the
--api-port int:- Description: The port for the client and server to communicate on (via REST). Ignored if the
BACALHAU_API_PORTenvironment variable is set. - Default:
1234
- Description: The port for the client and server to communicate on (via REST). Ignored if the
-c,--config string:- Description: Config file(s) or dot-separated path(s) to config values, for example
-c API.Host=10.0.0.1.
- Description: Config file(s) or dot-separated path(s) to config values, for example
--data-dir string:- Description: The filesystem path where Bacalhau initializes or opens its repo.
- Default:
$HOME/.bacalhau
--profile string:- Description: Use a specific profile for this command.
Examples
-
Retrieve the list of nodes:
Execute the command to get a list of all nodes:
bacalhau node listExpected output:
ID TYPE LABELS CPU MEMORY DISK GPUQmTSJgdN Compute os_arch=amd64 os_type=linux 3.2 / 11.7 GB / 77.8 GB / 1 /git-lfs=True owner=bacalhau 3.2 11.7 GB 77.8 GB 1QmVXwmdZ Compute os_arch=amd64 os_type=linux 3.2 / 12.5 GB / 77.8 GB / 0 /git-lfs=True owner=bacalhau 3.2 12.5 GB 77.8 GB 0QmXRdLru Compute os_arch=amd64 os_type=linux 3.2 / 12.5 GB / 78.0 GB / 0 /git-lfs=True owner=bacalhau 3.2 12.5 GB 78.0 GB 0... [Additional nodes information] ... -
Filter the list of nodes by labels:
Execute the command to get a list of nodes with specific labels:
bacalhau node list --labels "os_type=linux,owner=bacalhau"Expected output:
ID TYPE LABELS CPU MEMORY DISK GPUQmTSJgdN Compute os_arch=amd64 os_type=linux 3.2 / 11.7 GB / 77.8 GB / 1 /git-lfs=True owner=bacalhau 3.2 11.7 GB 77.8 GB 1... [Additional nodes information] ... -
Order the list of nodes by available memory:
Execute the command to get the list of nodes ordered by available memory:
bacalhau node list --order-by available_memoryExpected output:
ID TYPE LABELS CPU MEMORY DISK GPUQmVXwmdZ Compute os_arch=amd64 os_type=linux 3.2 / 12.5 GB / 77.8 GB / 0 /git-lfs=True owner=bacalhau 3.2 12.5 GB 77.8 GB 0... [Additional nodes information] ... -
Limit the number of nodes displayed and output in JSON format:
Execute the command to get a limited list of nodes in JSON format:
bacalhau node list --limit 3 --output json --prettyExpected output:
[{"Info": {"NodeID": "node-1","NodeType": "Compute",... [Additional node details] ...},"Membership": "APPROVED","Connection": "CONNECTED",... [Other nodes] ...}]