graphiant.naas.graphiant_device_lifecycle_info module – Query device lifecycle state and software upgrade status
Note
This module is part of the graphiant.naas collection (version 26.10.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install graphiant.naas.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: graphiant.naas.graphiant_device_lifecycle_info.
New in graphiant.naas 26.10.0
Synopsis
Read-only query of
GET /v1/edges-summary(withupgradeSummary=true); matches the portal’s Maintain > Device Lifecycle page. Returns per-devicestatus,portalStatus, andupgradeSummaryfields (running/last-running/ready-for-activation version, schedule state), pluslifecycle_state(a friendly label forstatus:activated,staging,maintenance, ordeactivated).With neither
config_filenordeviceset, all devices matchingroleare returned, and the task cannot fail on a missing device (there is no fixed target list to compare against). Whendeviceorconfig_file‘sdevice_lifecyclelist names specific devices, the task fails if any of them are not found (returned infailed_devices), the same way a named graphiant.naas.graphiant_device_lifecyclechange_statetarget that does not exist fails rather than being silently skipped.Supply
config_filefor adevice_lifecyclelist (only the device names, i.e. the list keys, are used — other per-device fields in that file are ignored here), and/ordeviceto query a single device.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.7
graphiant-sdk >= 26.10.0
tabulate (optional; logs a tabulated device table with
detailed_logs=truewhen installed)
Parameters
Parameter |
Comments |
|---|---|
Bearer token for API authentication (for example, from If not passed as a module argument, the collection reads When a bearer token is present (module argument or environment), it takes precedence over If no valid token is available, the module authenticates with |
|
Path to YAML with a top-level Relative paths resolve using the collection config path (see The file may also set a top-level |
|
Enable detailed logging in the task result message. When Choices:
|
|
Portal device name to query. With Omit along with |
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
Graphiant portal password for authentication. Required for password-based login when no valid bearer token is available from |
|
Client-side device role filter (e.g. If not set here, taken from a top-level |
|
Graphiant portal username for authentication. Required for password-based login when no valid bearer token is available from |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Always read-only; check mode has no side effects. |
See Also
See also
- graphiant.naas.graphiant_device_lifecycle
Change device lifecycle state, schedule/roll back software upgrades.
Examples
- name: Get upgrade/lifecycle status for all cpe devices
graphiant.naas.graphiant_device_lifecycle_info:
role: "cpe"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
register: status_result
- name: Show status
ansible.builtin.debug:
var: status_result.devices
- name: Get status for a single device
graphiant.naas.graphiant_device_lifecycle_info:
device: "edge-1-sdktest"
detailed_logs: true
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Get status for the devices listed in a config file
graphiant.naas.graphiant_device_lifecycle_info:
config_file: "sample_device_lifecycle.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Always Returned: always |
|
Raw manager result payload. Returned: always |
|
Per-device status, keyed by device name. Returned: always |
|
Regions the device has tunnel-terminator connections to. Returned: success |
|
Portal device ID. Returned: success |
|
Returned: success |
|
Friendly label for Returned: success |
|
Discovered location (city/state/country) as a single string. Returned: success |
|
Portal sync status (e.g. Returned: success |
|
Returned: success |
|
Returned: success |
|
Returned: success |
|
Returned: success |
|
Portal site name. Returned: success |
|
Raw portal status (e.g. Returned: success |
|
Software release name (e.g. Returned: success |
|
Software build version string. Returned: success |
|
Returned: success |
|
Devices that could not be found. Only possible when specific devices were requested via Returned: always |
|
The device name that could not be found. Returned: success |
|
Error detail explaining the lookup failure. Returned: success |
|
Result message, including detailed logs when Returned: always |