Skip to main content

List

List the packages the index has newer versions of.

Runs apt list --upgradable: each package with its installed version and the version the index has. Refresh the index first for what the repositories have now.

osapi client node package updates list [flags]

Examples​

# Two updates
osapi client node package updates list --target web-01

Result​

Two updates, on one host:

$ osapi client node package updates list --target web-01
Results:
  HOSTNAME  STATUS  NAME     CURRENT VERSION  NEW VERSION
  web-01    ok      curl     8.5.0-2ubuntu10  8.5.0-2ubuntu10.1
  web-01    ok      openssl  3.0.13-0ubuntu3  3.0.13-0ubuntu3.1

  1 host: 1 ok   job 550e8400-e29b-41d4-a716-446655440000   trace 26e448c9dbe1c4a8d216a98c675079c9

On each host, where one cannot run it:

$ osapi client node package updates list --target _all
Results:
  HOSTNAME  STATUS  NAME     CURRENT VERSION  NEW VERSION
  web-01    ok      curl     8.5.0-2ubuntu10  8.5.0-2ubuntu10.1
  web-01    ok      openssl  3.0.13-0ubuntu3  3.0.13-0ubuntu3.1
  web-02    ok      curl     8.5.0-2ubuntu10  8.5.0-2ubuntu10.1
  web-02    ok      openssl  3.0.13-0ubuntu3  3.0.13-0ubuntu3.1

  3 hosts: 2 ok, 1 skipped   job 550e8400-e29b-41d4-a716-446655440000   trace 26e448c9dbe1c4a8d216a98c675079c9

Details:
  mac-01  skipped  operation not supported on this OS family

With --json, the API's response:

{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{
"current_version": "8.5.0-2ubuntu10",
"hostname": "web-01",
"name": "curl",
"new_version": "8.5.0-2ubuntu10.1",
"status": "ok"
},
{
"current_version": "3.0.13-0ubuntu3",
"hostname": "web-01",
"name": "openssl",
"new_version": "3.0.13-0ubuntu3.1",
"status": "ok"
}
]
}

Permission​

It needs the package:read permission. osapi controller role get --name <role> shows what a role grants.

Flags​

FlagDescriptionDefault
-T, --targetTarget: _all, _any, hostname, or label (group:web.dev)_all

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml
--urlBase URL the CLI client connects to (controller.client.url)https://localhost:8080

Output tells how the result is printed, and what --json gives.