Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cmd/client_node_group_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ var clientNodeGroupGetCmd = &cobra.Command{

results := make([]cli.ResultRow, 0)
for _, r := range resp.Data.Results {
var errPtr *string
if r.Error != "" {
errPtr = &r.Error
}
if errPtr != nil || len(r.Groups) == 0 {
var errPtr *string
e := r.Error
errPtr = &e
results = append(results, cli.ResultRow{
Hostname: r.Hostname,
Status: r.Status,
Error: errPtr,
Fields: []string{"", "", ""},
})

continue
Expand Down
8 changes: 3 additions & 5 deletions cmd/client_node_group_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ var clientNodeGroupListCmd = &cobra.Command{

results := make([]cli.ResultRow, 0)
for _, r := range resp.Data.Results {
var errPtr *string
if r.Error != "" {
errPtr = &r.Error
}
if errPtr != nil || len(r.Groups) == 0 {
var errPtr *string
e := r.Error
errPtr = &e
results = append(results, cli.ResultRow{
Hostname: r.Hostname,
Status: r.Status,
Error: errPtr,
Fields: []string{"", "", ""},
})

continue
Expand Down
8 changes: 3 additions & 5 deletions cmd/client_node_user_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ var clientNodeUserGetCmd = &cobra.Command{

results := make([]cli.ResultRow, 0)
for _, r := range resp.Data.Results {
var errPtr *string
if r.Error != "" {
errPtr = &r.Error
}
if errPtr != nil || len(r.Users) == 0 {
var errPtr *string
e := r.Error
errPtr = &e
results = append(results, cli.ResultRow{
Hostname: r.Hostname,
Status: r.Status,
Error: errPtr,
Fields: []string{"", "", "", "", "", "", ""},
})

continue
Expand Down
8 changes: 3 additions & 5 deletions cmd/client_node_user_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ var clientNodeUserListCmd = &cobra.Command{

results := make([]cli.ResultRow, 0)
for _, r := range resp.Data.Results {
var errPtr *string
if r.Error != "" {
errPtr = &r.Error
}
if errPtr != nil || len(r.Users) == 0 {
var errPtr *string
e := r.Error
errPtr = &e
results = append(results, cli.ResultRow{
Hostname: r.Hostname,
Status: r.Status,
Error: errPtr,
Fields: []string{"", "", "", "", "", "", ""},
})

continue
Expand Down
8 changes: 3 additions & 5 deletions cmd/client_node_user_ssh_key_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ var clientNodeUserSSHKeyListCmd = &cobra.Command{

results := make([]cli.ResultRow, 0)
for _, r := range resp.Data.Results {
var errPtr *string
if r.Error != "" {
errPtr = &r.Error
}
if errPtr != nil || len(r.Keys) == 0 {
var errPtr *string
e := r.Error
errPtr = &e
results = append(results, cli.ResultRow{
Hostname: r.Hostname,
Status: r.Status,
Error: errPtr,
Fields: []string{"", "", ""},
})

continue
Expand Down
19 changes: 12 additions & 7 deletions docs/docs/sidebar/usage/cli/client/node/ntp/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@ $ osapi client node ntp get --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME SYNCHRONIZED STRATUM OFFSET SOURCE SERVERS
web-01 yes 2 +0.000123 192.0.2.1 0.pool.ntp.org, 1.pool.ntp.org
web-02 yes 2 +0.000045 192.0.2.1 0.pool.ntp.org, 1.pool.ntp.org
web-01
SYNCHRONIZED STRATUM OFFSET SOURCE SERVERS
yes 2 +0.000123 192.0.2.1 0.pool.ntp.org, 1.pool.ntp.org

web-02
SYNCHRONIZED STRATUM OFFSET SOURCE SERVERS
yes 2 +0.000045 192.0.2.1 0.pool.ntp.org, 1.pool.ntp.org
```

When some hosts are skipped, a STATUS column is shown:
When some hosts are skipped, HOSTNAME, STATUS, and ERROR columns appear
alongside data columns:

```bash
$ osapi client node ntp get --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS SYNCHRONIZED STRATUM OFFSET SOURCE SERVERS ERROR
web-01 ok yes 2 +0.000123 192.0.2.1 0.pool.ntp.org
mac-01 skipped unsupported platform
HOSTNAME STATUS ERROR SYNCHRONIZED STRATUM OFFSET SOURCE SERVERS
web-01 ok yes 2 +0.000123 192.0.2.1 0.pool.ntp.org
mac-01 skipped unsupported platform
```

## JSON Output
Expand Down
10 changes: 7 additions & 3 deletions docs/docs/sidebar/usage/cli/client/node/package/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ $ osapi client node package get --target _all --name nginx

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME VERSION STATUS SIZE
web-01 nginx 1.24.0-2 installed 1.2 MB
web-02 nginx 1.24.0-2 installed 1.2 MB
web-01
NAME VERSION STATUS SIZE
nginx 1.24.0-2 installed 1.2 MB

web-02
NAME VERSION STATUS SIZE
nginx 1.24.0-2 installed 1.2 MB
```

## JSON Output
Expand Down
20 changes: 12 additions & 8 deletions docs/docs/sidebar/usage/cli/client/node/package/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,26 @@ $ osapi client node package install --target _all --name htop

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME CHANGED
web-01 htop true
web-02 htop true
web-01
NAME CHANGED
htop true

web-02
NAME CHANGED
htop true
```

When some hosts are skipped (e.g., macOS agents), STATUS and ERROR columns are
added:
When some hosts are skipped (e.g., macOS agents), HOSTNAME, STATUS, and ERROR
columns appear alongside data columns:

```bash
$ osapi client node package install --target _all --name htop

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS NAME CHANGED ERROR
web-01 ok htop true
mac-01 skipped unsupported platform
HOSTNAME STATUS ERROR NAME CHANGED
web-01 ok htop true
mac-01 skipped unsupported platform
```

## JSON Output
Expand Down
12 changes: 8 additions & 4 deletions docs/docs/sidebar/usage/cli/client/node/package/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ $ osapi client node package list --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME VERSION STATUS SIZE
web-01 bash 5.2.21-2 installed 7.4 MB
web-01 nginx 1.24.0-2 installed 1.2 MB
web-02 bash 5.2.21-2 installed 7.4 MB
web-01
NAME VERSION STATUS SIZE
bash 5.2.21-2 installed 7.4 MB
nginx 1.24.0-2 installed 1.2 MB

web-02
NAME VERSION STATUS SIZE
bash 5.2.21-2 installed 7.4 MB
```

Target by label to list packages on a group of servers:
Expand Down
20 changes: 12 additions & 8 deletions docs/docs/sidebar/usage/cli/client/node/package/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,26 @@ $ osapi client node package remove --target _all --name nginx

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME CHANGED
web-01 nginx true
web-02 nginx true
web-01
NAME CHANGED
nginx true

web-02
NAME CHANGED
nginx true
```

When some hosts are skipped (e.g., macOS agents), STATUS and ERROR columns are
added:
When some hosts are skipped (e.g., macOS agents), HOSTNAME, STATUS, and ERROR
columns appear alongside data columns:

```bash
$ osapi client node package remove --target _all --name nginx

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS NAME CHANGED ERROR
web-01 ok nginx true
mac-01 skipped unsupported platform
HOSTNAME STATUS ERROR NAME CHANGED
web-01 ok nginx true
mac-01 skipped unsupported platform
```

## JSON Output
Expand Down
10 changes: 7 additions & 3 deletions docs/docs/sidebar/usage/cli/client/node/package/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ $ osapi client node package update --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME CHANGED
web-01 true
web-02 true
web-01
CHANGED
true

web-02
CHANGED
true
```

## JSON Output
Expand Down
12 changes: 8 additions & 4 deletions docs/docs/sidebar/usage/cli/client/node/package/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ $ osapi client node package updates --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME NAME CURRENT NEW
web-01 nginx 1.24.0-2 1.26.0-1
web-01 curl 8.5.0-2 8.7.1-1
web-02 nginx 1.24.0-2 1.26.0-1
web-01
NAME CURRENT NEW
nginx 1.24.0-2 1.26.0-1
curl 8.5.0-2 8.7.1-1

web-02
NAME CURRENT NEW
nginx 1.24.0-2 1.26.0-1
```

## JSON Output
Expand Down
19 changes: 12 additions & 7 deletions docs/docs/sidebar/usage/cli/client/node/sysctl/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@ $ osapi client node sysctl get --target _all --key vm.swappiness

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME KEY VALUE
web-01 vm.swappiness 10
web-02 vm.swappiness 10
web-01
KEY VALUE
vm.swappiness 10

web-02
KEY VALUE
vm.swappiness 10
```

When some hosts are skipped, a STATUS column is shown:
When some hosts are skipped, HOSTNAME, STATUS, and ERROR columns appear
alongside data columns:

```bash
$ osapi client node sysctl get --target _all --key vm.swappiness

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS KEY VALUE ERROR
web-01 ok vm.swappiness 10
mac-01 skipped unsupported platform
HOSTNAME STATUS ERROR KEY VALUE
web-01 ok vm.swappiness 10
mac-01 skipped unsupported platform
```

## JSON Output
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/sidebar/usage/cli/client/node/user/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Create a new user account:
$ osapi client node user create --target web-01 \
--name deploy --shell /bin/bash --groups sudo,docker

NAME CHANGED STATUS
deploy true ok
Job ID: 550e8400-e29b-41d4-a716-446655440000

NAME CHANGED
deploy true
```

## Flags
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/sidebar/usage/cli/client/node/user/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Delete a user account:
```bash
$ osapi client node user delete --target web-01 --name deploy

NAME CHANGED STATUS
deploy true ok
Job ID: 550e8400-e29b-41d4-a716-446655440000

NAME CHANGED
deploy true
```

## Flags
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/sidebar/usage/cli/client/node/user/password.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Change a user's password:
$ osapi client node user password --target web-01 \
--name deploy --password 'newpass123'

NAME CHANGED STATUS
deploy true ok
Job ID: 550e8400-e29b-41d4-a716-446655440000

NAME CHANGED
deploy true
```

The password is sent as plaintext and hashed by the agent using the system's
Expand Down
23 changes: 20 additions & 3 deletions docs/docs/sidebar/usage/cli/client/node/user/ssh-key-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,30 @@ Add an SSH authorized key for a user:
$ osapi client node user ssh-key add --target web-01 \
--name deploy --key 'ssh-ed25519 AAAA... user@laptop'

HOSTNAME CHANGED STATUS
web-01 true ok
Job ID: 550e8400-e29b-41d4-a716-446655440000

CHANGED
true
```

The key is appended to the user's `~/.ssh/authorized_keys` file. If the file or
`~/.ssh` directory does not exist, it is created with correct permissions (`700`
for the directory, `600` for the file). Duplicate keys are not added.
for the directory, `600` for the file).

Adding a key that already exists (same fingerprint) returns `changed: false`.

When targeting all hosts:

```bash
$ osapi client node user ssh-key add --target _all \
--name deploy --key 'ssh-ed25519 AAAA... user@laptop'

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME CHANGED
web-01 true
web-02 true
```

## Flags

Expand Down
Loading
Loading