graphiant.naas.graphiant_local_extranet_info module – Query Graphiant Local Extranet policies, device status, and usage information

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_local_extranet_info.

New in graphiant.naas 26.7.0

Synopsis

  • This module provides query capabilities for Graphiant Local Extranet information.

  • Returns summary information about Local Extranet policies.

  • Provides per-device policy rollout status.

  • Provides LAN segment and NAT pool usage monitoring information.

  • All operations return read-only information and never modify the system.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.7

  • graphiant-sdk >= 26.10.0

  • tabulate

Parameters

Parameter

Comments

access_token

string

Bearer token for API authentication (for example, from graphiant login, which opens a browser for sign-in (SSO or non-SSO) and retrieves the token).

If not passed as a module argument, the collection reads GRAPHIANT_ACCESS_TOKEN (set after graphiant login when you source ~/.graphiant/env.sh).

When a bearer token is present (module argument or environment), it takes precedence over username and password.

If no valid token is available, the module authenticates with username and password when both are supplied.

detailed_logs

boolean

Enable detailed logging output for troubleshooting and monitoring.

When enabled, provides comprehensive logs of all query operations.

Logs are captured and included in the msg return value for display using ansible.builtin.debug module.

Choices:

  • false ← (default)

  • true

host

aliases: base_url

string / required

Graphiant portal host URL for API connectivity.

Example: “https://api.graphiant.com”

is_provider

boolean

Whether to get provider view for LAN segment usage monitoring.

Only applicable to lan_segments_usage query.

Choices:

  • false

  • true

password

string

Graphiant portal password for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

policy_name

string

Local Extranet policy name.

Required for policy_device_status and nat_usage queries.

Optional for lan_segments_usage.

query

string / required

The specific information to query.

policies_summary: Get summary of all Local Extranet policies with tabulated output.

Returns policy details including IDs, names, type, shared segment, and target segments count.

policy_device_status: Get per-device push/rollout status for a Local Extranet policy.

Requires policy_name.

lan_segments_usage: Get LAN segment usage/monitoring information.

policy_name is optional; when omitted, returns usage across all policies.

nat_usage: Get NAT pool usage/monitoring information for a Local Extranet policy.

Requires policy_name.

Choices:

  • "policies_summary"

  • "policy_device_status"

  • "lan_segments_usage"

  • "nat_usage"

username

string

Graphiant portal username for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

Attributes

Attribute

Support

Description

check_mode

Support: full

Supports check mode (always read-only).

Notes

Note

  • This is a read-only module that queries information only.

  • All operations return tabulated output for easy reading, where applicable.

See Also

See also

graphiant.naas.graphiant_local_extranet

Manage Local Extranet policies

Examples

- name: Get Local Extranet policies summary
  graphiant.naas.graphiant_local_extranet_info:
    query: policies_summary
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
  register: policies_summary

- name: Display policies summary
  ansible.builtin.debug:
    msg: "{{ policies_summary.msg }}"

- name: Get device rollout status for a policy
  graphiant.naas.graphiant_local_extranet_info:
    query: policy_device_status
    policy_name: "le-policy-1"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true
  register: device_status

- name: Display device status
  ansible.builtin.debug:
    msg: "{{ device_status.msg }}"

- name: Get LAN segment usage
  graphiant.naas.graphiant_local_extranet_info:
    query: lan_segments_usage
    policy_name: "le-policy-1"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
  register: lan_segments_usage

- name: Get NAT pool usage
  graphiant.naas.graphiant_local_extranet_info:
    query: nat_usage
    policy_name: "le-policy-1"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
  register: nat_usage

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

msg

string

Result message from the query operation, including detailed logs when detailed_logs is enabled.

Returned: always

Sample: "Local Extranet Policies Summary:\n+------+---------------+----------------+------------------+\n|   ID | Name          | Shared Segment |  Target Segments |\n+======+===============+================+==================+\n| 8568 | le-policy-1   | lan-1          |                2 |\n+------+---------------+----------------+------------------+\n"

query

string

The query that was performed.

One of policies_summary, policy_device_status, lan_segments_usage, or nat_usage.

Returned: always

Sample: "policies_summary"

result_data

dictionary

Result data from the query operation, including structured data for the requested query.

Returned: always

Sample: {"policies": [{"id": 8568, "name": "le-policy-1", "sharedSegment": "lan-1", "targetSegmentsCount": 2}]}

Authors

  • Graphiant Team (@graphiant)