The updates the package index has for the host.
osapi behavior get --name updatepackages and osapi behavior method get show
the same.
Behavior
| |
|---|
| Name | updatepackages |
| Description | The updates the package index has for the host |
| Placement | node |
| Internal | no |
| API | yes |
| CLI | yes |
| Next | no |
| Platforms | debian |
| Sudo | none |
| Runs | none |
| Writes | none |
| Keeps state | no |
| Uses | none |
| Used by | none |
Methods (2)
| NAME | VERB | HTTP | ROUTE | PERMISSION | DESCRIPTION |
|---|
| list | read | GET | /api/node/{hostname}/updatepackages | updatepackages:read | List the packages the index has newer versions of |
| update | write | PUT | /api/node/{hostname}/updatepackages | updatepackages:write | Refresh the package index |
Types (2)
| NAME | INPUT | OUTPUT |
|---|
| list | ListInput | []Available { name, current_version, new_version } |
| update | UpdateInput | Result { changed } |
Settings (0)
None. Declare them with behavior.Config.
Telemetry
| |
|---|
| Span | behavior.updatepackages.<method> |
| Child spans | exec apt-get, exec apt |
| Metrics | osapi_behavior_calls_total, osapi_behavior_duration_seconds, osapi_behavior_changes_total |
| Attributes | osapi.behavior.name, osapi.behavior.method, osapi.behavior.verb, osapi.behavior.outcome, osapi.behavior.changed |
| Recorded inputs | none |
Method list
| |
|---|
| Name | list |
| Verb | read |
| Description | List the packages the index has newer versions of |
| Detail | 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. |
| HTTP | GET |
| Route | /api/node/{hostname}/updatepackages |
| Permission | updatepackages:read |
| Command | osapi client node updatepackages list |
| Input type | ListInput |
| Output type | []Available |
None. The method takes no input; its command needs only --target.
Output (3)
| FIELD | TYPE | DESCRIPTION |
|---|
| name | string | The package |
| current_version | string | The installed version |
| new_version | string | The version the index has |
Examples (1)
| EXAMPLE | INPUT | OUTPUT |
|---|
| Two updates | (none) | [current_version=8.5.0-2ubuntu10, name=curl, new_version=8.5.0-2ubuntu10.1] [current_version=3.0.13-0ubuntu3, name=openssl, new_version=3.0.13-0ubuntu3.1] |
Method update
| |
|---|
| Name | update |
| Verb | write |
| Description | Refresh the package index |
| Detail | Runs apt-get update. It reports changed: true when the Release file of a repository under /var/lib/apt/lists changed, and changed: false when each repository was unchanged. |
| HTTP | PUT |
| Route | /api/node/{hostname}/updatepackages |
| Permission | updatepackages:write |
| Command | osapi client node updatepackages update |
| Input type | UpdateInput |
| Output type | Result |
None. The method takes no input; its command needs only --target.
Output (1)
| FIELD | TYPE | DESCRIPTION |
|---|
| changed | boolean | Whether the refresh got new index data |
Examples (1)
| EXAMPLE | INPUT | OUTPUT |
|---|
| The repositories are unchanged since the last refresh | (none) | changed=false |