centralcli package¶
centralcli.central module¶
- class centralcli.central.CentralApi(account_name: str = 'central_info')¶
Bases:
Session- async add_devices(mac: str | None = None, serial: str | None = None, group: str | None = None, part_num: str | None = None, license: str | List[str] | None = None, device_list: List[Dict[str, str]] | None = None) Response | List[Response]¶
Add device(s) using Mac and Serial number (part_num also required for CoP) Will also pre-assign device to group if provided
Either mac and serial or device_list (which should contain a dict with mac serial) are required.
- Parameters:
mac (str, optional) – MAC address of device to be added
serial (str, optional) – Serial number of device to be added
group (str, optional) – Add device to pre-provisioned group (additional API call is made)
site (int, optional) – – Not implemented – Site ID
part_num (str, optional) – Part Number is required for Central On Prem.
license (str|List(str), optional) – The subscription license(s) to assign.
device_list (List[Dict[str, str]], optional) – List of dicts with mac, serial for each device and optionally group, part_num, license,
- Returns:
CentralAPI Response object
- Return type:
- async add_template(name: str, group: str, template: Path | str | bytes, device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] = 'ap', version: str = 'ALL', model: str = 'ALL') Response¶
Create new template.
- Parameters:
name (str) – Name of template.
group (str) – Name of the group for which the template is to be created.
template (Path | str | bytes) – Template File or encoded template content. For sw (AOS-Switch) device_type, the template text should include the following commands to maintain connection with central. 1. aruba-central enable. 2. aruba-central url https://<URL | IP>/ws.
device_type (str) – Device type of the template. Valid Values: ap, sw, cx, gw Defaults to ap.
version (str) – Firmware version property of template. Example: ALL, 6.5.4 etc.
model (str) – Model property of template. For sw (AOS-Switch) device_type, part number (J number) can be used for the model parameter. Example: 2920, J9727A, etc.
- Returns:
CentralAPI Response object
- Return type:
- async add_visitor(portal_id: str, name: str, password: str | None = None, *, company_name: str | None = None, phone: str | None = None, email: str | None = None, valid_forever: bool = False, valid_days: int = 3, valid_hours: int = 0, valid_minutes: int = 0, notify: bool | None = None, notify_to: NotifyToArgs | None = None, is_enabled: bool = True) Response¶
Create a new guest visitor of a portal.
- Parameters:
portal_id (str) – Portal ID of the splash page
name (str) – Visitor account name
password (str) – Password
company_name (str) – Company name of the visitor
phone (str) – Phone number of the visitor; Format [+CountryCode][PhoneNumber]
email (str) – Email address of the visitor
valid_forever (bool) – Visitor account will not expire when this is set to true
valid_days (int) – Account validity in days
valid_hours (int) – Account validity in hours
valid_minutes (int) – Account validity in minutes
notify (bool) – Flag to notify the password via email or number
notify_to (str) – Notify to email or phone. Defualt is phone when it is provided otherwise email. Valid Values: email, phone
is_enabled (bool) – Enable or disable the visitor account
id (#) – NA for visitor post/put method. ID of the visitor
status (#) – This field provides status of the account. Returns true when enabled and
fields. (# not expired. NA for visitor post/put method. This is optional)
created_at (#) – This field indicates the created date timestamp value. It is generated
field. (# while creating visitor. NA for visitor post/put method. This is optional)
expire_at (#) – This field indicates expiry time timestamp value. It is generated based
is (# on the valid_till value and created_at time. NA for visitor post/put method. This)
field (# optional)
- Returns:
CentralAPI Response object
- Return type:
- async add_webhook(name: str, urls: List[str]) Response¶
Add / update Webhook.
- Parameters:
name (str) – name of the webhook
urls (List[str]) – List of webhook urls
- Returns:
CentralAPI Response object
- Return type:
- async archive_devices(serials: List[str]) Response¶
Archive devices using Serial list.
- Parameters:
serials (List[str]) – serials
- Returns:
CentralAPI Response object
- Return type:
- async assign_label_to_devices(label_id: int, serials: str | List[str], device_type: Literal['ap', 'gw', 'switch', 'sdwan']) Response¶
Associate Label to a list of devices.
- Parameters:
label_id (int) – Label ID
serials (str | List[str]) – List of device serial numbers of the devices to which the label has to be un/associated with. A maximum of 5000 device serials are allowed at once.
device_type (str) – Device type. Valid Values: ap, gw, switch
- Returns:
CentralAPI Response object
- Return type:
- async assign_licenses(serials: str | List[str], services: str | List[str]) Response¶
Assign subscription to a device.
// Used indirectly by add device when –license <license> is provided and batch add devices with license //
- Parameters:
serials (str | List[str]) – List of serial number of device.
services (str | List[str]) – List of service names. Call services/config API to get the list of valid service names.
- Returns:
CentralAPI Response object
- Return type:
- async cancel_upgrade(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] | None = None, serial: str | None = None, swarm_id: str | None = None, group: str | None = None) Response¶
Cancel scheduled firmware upgrade.
You can only specify one of device_type, swarm_id or serial parameters
- Parameters:
device_type (Literal['ap', 'gw', 'cx', 'sw'], optional) – Specify one of “cx|sw|ap|gw (sw = aos-sw)”
serial (str, optional) – Serial of device
swarm_id (str) – Swarm ID
group (str) – Specify Group Name to cancel upgrade for devices in that group
- Returns:
CentralAPI Response object
- Return type:
- async central_acknowledge_notifications(NoName: List[str] | None = None) Response¶
Acknowledge Notifications by ID List / All.
- Parameters:
NoName (List[str], optional) – Acknowledge notifications
- Returns:
CentralAPI Response object
- Return type:
- async central_get_notification_config(search: str | None = None, sort: str = '-created_ts', offset: int = 0, limit: int = 500) Response¶
List Configuration/Settings for alerts that result in notification.
- Parameters:
search (str, optional) – term used to search in name, category of the alert
sort (str, optional) – Sort parameter may be one of +created_ts, -created_ts, Default is ‘-created_ts’ Valid Values: -created_ts, +created_ts
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async check_firmware_available(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'], firmware_version: str) Response¶
Firmware Version.
- Parameters:
device_type (str) – Specify one of “cx”, “sw”, “ap”, “gw”
firmware_version (str) – firmware version
- Returns:
CentralAPI Response object
- Return type:
- async clear_ts_session(serial: str, session_id: int) Response¶
Clear Troubleshooting Session and output for device.
- Parameters:
serial (str) – Serial of device
session_id (int) – Unique ID for each troubleshooting session
- Returns:
CentralAPI Response object
- Return type:
- async clone_group(clone_group: str, new_group: str, upgrade_aos10: bool = False) Response¶
Clone and create new group.
- Parameters:
clone_group (str) – Group to be cloned.
new_group (str) – Name of group to be created based on clone.
upgrade_aos10 (bool) – Set True to Update the new cloned group to AOS10.
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_download_mpsk_csv(ssid: str, filename: str | None = None, name: str | None = None, role: str | None = None, status: str | None = None, sort: str | None = None) Response¶
Fetch all Named MPSK as a CSV file.
- Parameters:
ssid (str) – Configured MPSK SSID for which Named MPSKs are to be downloaded.
filename (str, optional) – Suggest a file name for the downloading file via content disposition header.
name (str, optional) – Filter by name of the named MPSK. Does a ‘contains’ match.
role (str, optional) – Filter by role of the named MPSK. Does an ‘equals’ match.
status (str, optional) – Filter by status of the named MPSK. Does an ‘equals’ match. Valid Values: enabled, disabled
sort (str, optional) – Sort order Valid Values: +name, -name, +role, -role, +status, -status
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_get_mpsk_networks() Response¶
Read all configured MPSK networks.
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_get_namedmpsk(mpsk_id: str, name: str | None = None, role: str | None = None, status: str | None = None, cursor: str | None = None, sort: str | None = None, limit: int = 100) Response¶
Read all named MPSK.
- Parameters:
mpsk_id (str) – The MPSK configuration ID
name (str, optional) – Filter by name of the named MPSK. Does a ‘contains’ match.
role (str, optional) – Filter by role of the named MPSK. Does an ‘equals’ match.
status (str, optional) – Filter by status of the named MPSK. Does an ‘equals’ match. Valid Values: enabled, disabled
cursor (str, optional) – For cursor based pagination.
sort (str, optional) – Sort order Valid Values: +name, -name, +role, -role, +status, -status
limit (int, optional) – Number of items to be fetched Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_get_registered_macs(search: str | None = None, sort: str | None = None, filename: str | None = None) Response¶
Fetch all Mac Registrations as a CSV file.
- Parameters:
search (str, optional) – Filter the Mac Registrations by Mac Address and Client Name. Does a ‘contains’ match.
sort (str, optional) – Sort order Valid Values: +name, -name, +display_name, -display_name
filename (str, optional) – Suggest a file name for the downloading file via content disposition header.
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_upload(upload_type: Literal['mpsk', 'mac'], file: Path | str, ssid: str | None = None) Response¶
Upload file.
- Parameters:
upload_type (CloudAuthUploadType) – Type of file upload Valid Values: mpsk, mac
file (Path | str) – The csv file to upload
ssid (str, optional) – MPSK network SSID, required if {upload_type} = ‘mpsk’
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_upload_fixme(upload_type: Literal['mpsk', 'mac'], file: Path | str, ssid: str | None = None) Response¶
Upload file.
This doesn’t work still sorting the format of FormData
- Parameters:
upload_type (CloudAuthUploadType) – Type of file upload Valid Values: mpsk, mac
file (Path | str) – The csv file to upload
ssid (str, optional) – MPSK network SSID, required if {upload_type} = ‘mpsk’
- Returns:
CentralAPI Response object
- Return type:
- async cloudauth_upload_status(upload_type: Literal['mpsk', 'mac'], ssid: str | None = None) Response¶
Read upload status of last file upload.
- Parameters:
upload_type (CloudAuthUploadType) – Type of file upload Valid Values: mpsk, mac
ssid (str, optional) – MPSK network SSID, required if {upload_type} = ‘mpsk’
- Returns:
CentralAPI Response object
- Return type:
- async cop_delete_device_from_inventory(devices: List[str] | None = None) Response¶
Delete devices using Serial number. Only applies to CoP deployments.
Device can not be archived in CoP inventory.
- Parameters:
devices (list, optional) – List of devices to be deleted from GreenLake inventory. Only applies to CoP
- Returns:
CentralAPI Response object
- Return type:
- async create_group(group: str, allowed_types: Literal['ap', 'cx', 'sw', 'switch', 'gw', 'sdwan'] | List[Literal['ap', 'cx', 'sw', 'switch', 'gw', 'sdwan']] = ['ap', 'gw', 'cx', 'sw'], wired_tg: bool = False, wlan_tg: bool = False, aos10: bool = False, microbranch: bool = False, gw_role: Literal['branch', 'vpnc', 'wlan'] | None = None, monitor_only_sw: bool = False, monitor_only_cx: bool = False, cnx: bool = False) Response¶
Create new group with specified properties. v3
- Parameters:
group (str) – Group Name
allowed_types (str, List[str]) – Allowed Device Types in the group. Tabs for devices not allowed won’t display in UI. valid values “ap”, “gw”, “cx”, “sw”, “switch”, “sdwan” (“switch” is generic, will enable both cx and sw) When sdwan (EdgeConnect SD-WAN) is allowed, it has to be the only type allowed.
wired_tg (bool, optional) – Set to true if wired(Switch) configuration in a group is managed using templates.
wlan_tg (bool, optional) – Set to true if wireless(IAP, Gateways) configuration in a group is managed using templates.
aos10 – (bool): if True use AOS10 architecture for the access points and gateways in the group. default False (Instant)
microbranch (bool) – True to enable Microbranch network role for APs is applicable only for AOS10 architecture.
gw_role (GatewayRole) – Gateway role valid values “branch”, “vpnc”, “wlan” (“wlan” only valid on AOS10 group) Defaults to None. Results in “branch” unless “sdwan” is in allowed_types otherwise “vpnc”.
monitor_only_sw – Monitor only ArubaOS-SW switches, applies to UI group only
monitor_only_cx – Monitor only ArubaOS-CX switches, applies to UI group only
cnx (bool, optional) – Make group compatible with cnx (New Central)
- Returns:
CentralAPI Response object
- Return type:
- async create_label(label_name: str, category_id: int = 1) Response¶
Create Label.
- Parameters:
label_name (str) – Label name
category_id (int, optional) – Label category ID defaults to 1 1 = default label category, 2 = site
- Returns:
CentralAPI Response object
- Return type:
- async create_site(site_name: str | None = None, address: str | None = None, city: str | None = None, state: str | None = None, country: str | None = None, zipcode: int | str | None = None, latitude: float | None = None, longitude: float | None = None, site_list: List[Dict[str, str | dict]] | None = None) Response¶
Create Site
Either address information or GeoLocation information is required. For Geolocation attributes all attributes are required. Or a List[dict] with multiple sites to be added containing either ‘site_address’ or ‘geolocation’ attributes for each site.
- Parameters:
site_name (str, optional) – Site Name. Defaults to None.
address (str, optional) – Address. Defaults to None.
city (str, optional) – City. Defaults to None.
state (str, optional) – State. Defaults to None.
country (str, optional) – Country Name. Defaults to None.
zipcode (int | str, optional) – Zipcode. Defaults to None.
latitude (float, optional) – Latitude (in the range of -90 and 90). Defaults to None.
longitude (float, optional) – Longitude (in the range of -100 and 180). Defaults to None.
site_list (List[Dict[str, str | dict]], optional) – A list of sites to be created. Defaults to None.
- Returns:
CentralAPI Response object
- Return type:
- async create_wlan(group: str, wlan_name: str, wpa_passphrase: str, vlan: str = '', type: WlanType = 'employee', essid: str | None = None, zone: str = '', captive_profile_name: str = '', bandwidth_limit_up: str = '', bandwidth_limit_down: str = '', bandwidth_limit_peruser_up: str = '', bandwidth_limit_peruser_down: str = '', access_rules: list = [{'action': 'allow', 'eport': 'any', 'ipaddr': 'any', 'match': 'match', 'netmask': 'any', 'protocol': 'any', 'service_name': '', 'service_type': 'network', 'sport': 'any', 'throttle_downstream': '', 'throttle_upstream': ''}], is_locked: bool = False, hide_ssid: bool = False) Response¶
Create a new WLAN (SSID).
- Parameters:
group (str) – Aruba Central Group name or swarm guid
wlan_name (str) – Name of the WLAN/Network
wpa_passphrase (str) – WPA passphrase
vlan (str) – Client VLAN name or id. Defaults to “” (Native AP VLAN).
type (WlanType, optional) – Valid: [‘employee’, ‘guest’]. Defaults to “employee”.
essid (str, optional) – SSID. Defaults to None (essid = wlan_name).
zone (str, optional) – AP Zone SSID will broadcast on. Defaults to “” (Broadcast on all APs).
captive_profile_name (str, optional) – Captive Portal Profile. Defaults to “” (No CP Profile).
bandwidth_limit_up (str, optional) – [description]. Defaults to “” (No BW Limit Up).
bandwidth_limit_down (str, optional) – [description]. Defaults to “” (No BW Limit Down).
bandwidth_limit_peruser_up (str, optional) – [description]. Defaults to “” (No per user BW Limit Up).
bandwidth_limit_peruser_down (str, optional) – [description]. Defaults to “” (No per user BW Limit Down).
access_rules (list, optional) – [description]. Default: unrestricted.
is_locked (bool, optional) – [description]. Defaults to False.
hide_ssid (bool, optional) – [description]. Defaults to False.
wpa_passphrase_changed (bool, optional) – indicates passphrase has changed. Defaults to True.
- Returns:
[description]
- Return type:
- async delete_ap(serial: str) Response¶
Delete AP.
- Parameters:
serial (str) – Serial Number of AP to be deleted
- Returns:
CentralAPI Response object
- Return type:
- async delete_certificate(certificate: str) Response¶
Delete existing certificate.
- Parameters:
certificate (str) – Name of the certificate to delete.
- Returns:
CentralAPI Response object
- Return type:
- async delete_firmware_compliance(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'], group: str | None = None) Response¶
Clear Firmware Compliance Version.
// Used by delete firmware compliance [ap|gw|sw|cx] [group] //
- Parameters:
device_type (str) – Specify one of “ap|gw|sw|cx”
group (str, optional) – Group name. Defaults to None (Global Compliance)
- Returns:
CentralAPI Response object
- Return type:
- async delete_gateway(serial: str) Response¶
Delete Gateway.
- Parameters:
serial (str) – Serial Number of Gateway to be deleted
- Returns:
CentralAPI Response object
- Return type:
- async delete_group(group: str) Response¶
Delete existing group.
- Parameters:
group (str) – Name of the group that needs to be deleted.
- Returns:
CentralAPI Response object
- Return type:
- async delete_label(label_id: int) Response¶
Delete Label.
- Parameters:
label_id (int) – Label ID
- Returns:
CentralAPI Response object
- Return type:
- async delete_portal_profile(portal_id: str) Response¶
Delete guest portal profile.
- Parameters:
portal_id (str) – Portal ID of the splash page
- Returns:
CentralAPI Response object
- Return type:
- async delete_site(site_id: int | List[int]) Response | List[Response]¶
Delete Site.
- Parameters:
site_id (int|List[int]) – Either the site_id or a list of site_ids to be deleted.
- Returns:
CentralAPI Response object
- Return type:
- async delete_stack(stack_id: str) Response¶
Delete Switch Stack.
- Parameters:
stack_id (str) – Filter by Switch stack_id
- Returns:
CentralAPI Response object
- Return type:
- async delete_switch(serial: str) Response¶
Delete Switch.
- Parameters:
serial (str) – Serial number of switch to be deleted
- Returns:
CentralAPI Response object
- Return type:
- async delete_template(group: str, template: str) Response¶
Delete existing template.
- Parameters:
group (str) – Name of the group for which the template is to be deleted.
template (str) – Name of the template to be deleted.
- Returns:
CentralAPI Response object
- Return type:
- async delete_webhook(wid: str) Response¶
Delete Webhooks.
- Parameters:
wid (str) – id of the webhook
- Returns:
CentralAPI Response object
- Return type:
- async delete_wlan(group: str, wlan_name: str) Response¶
Delete an existing WLAN.
- Parameters:
group (str) – Group name of the group or guid of the swarm. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
wlan_name (str) – Name of WLAN to be deleted. Example:wlan_1.
- Returns:
CentralAPI Response object
- Return type:
- async disable_auto_subscribe(services: List[str] | str) Response¶
Standalone Customer API: Disable auto licensing for given services.
- Parameters:
services (List[str]) – list of services e.g. [‘pa’, ‘ucc’, foundation_ap, advanced_switch_6200, foundation_70XX etc …]. Check /platform/licensing/v1/services/config API response to know the list of supported services.
- Returns:
CentralAPI Response object
- Return type:
- async do_multi_group_snapshot(backup_name: str, include_groups: List[str] | None = None, exclude_groups: List[str] | None = None, do_not_delete: bool = False) Response¶
Create new configuration backup for multiple groups.
Either include_groups or exclude_groups should be provided, but not both.
- Parameters:
backup_name (str) – Name of Backup
include_groups (List[str], optional) – Groups to include in Backup. Defaults to None.
exclude_groups (List[str], optional) – Groups to Exclude in Backup. Defaults to None.
do_not_delete (bool, optional) – Flag to represent if the snapshot can be deleted automatically by system when creating new snapshot or not. Defaults to False.
- Returns:
Response Object
- Return type:
- async enable_auto_subscribe(services: List[str] | str) Response¶
Standalone Customer API: Assign licenses to all devices and enable auto subscribe for given services.
- Parameters:
services (List[str]) – list of services e.g. [‘pa’, ‘ucc’, foundation_ap, advanced_switch_6200, foundation_70XX etc …]. Check /platform/licensing/v1/services/config API response to know the list of supported services.
- Returns:
CentralAPI Response object
- Return type:
- async get_alerts(customer_id: str | None = None, group: str | None = None, label: str | None = None, serial: str | None = None, site: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, severity: str | None = None, type: str | None = None, search: str | None = None, ack: bool | None = None, fields: str | None = None, offset: int = 0, limit: int = 1000) Response¶
[central] List Notifications/Alerts. Returns 1 day by default.
- Parameters:
customer_id (str, optional) – MSP user can filter notifications based on customer id
group (str, optional) – Used to filter the notification types based on group name
label (str, optional) – Used to filter the notification types based on Label name
serial (str, optional) – Used to filter the result based on serial number of the device
site (str, optional) – Used to filter the notification types based on Site name
from_time (int | float | datetime, optional) – start of duration within which alerts are raised Default now - 1 day (max 90) (API endpoint default is 30 days)
to_time (int | float | datetime, optional) – end of duration within which alerts are raised Default now.
severity (str, optional) – Used to filter the notification types based on severity
type (str, optional) – Used to filter the notification types based on notification type name
search (str, optional) – term used to search in name, category of the alert
calculate_total (bool, optional) – Whether to count total items in the response
ack (bool, optional) – Filter acknowledged or unacknowledged notifications. When query parameter is not specified, both acknowledged and unacknowledged notifications are included
fields (str, optional) – Comma separated list of fields to be returned
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 500.
- Returns:
CentralAPI Response object
- Return type:
- async get_all_clients(group: str | None = None, swarm_id: str | None = None, label: str | None = None, network: str | None = None, site: str | None = None, serial: str | None = None, os_type: str | None = None, stack_id: str | None = None, cluster_id: str | None = None, band: str | None = None, client_status: Literal['FAILED_TO_CONNECT', 'CONNECTED'] = 'CONNECTED', past: str = '3H', offset: int = 0, limit: int = 1000) Response¶
Get All clients
- Parameters:
group (str, optional) – Return clients connected to devices in a given group. Defaults to None.
swarm_id (str, optional) – Return clients connected to swarm by swarm_id. Defaults to None.
label (str, optional) – Return clients connected to device with provided label. Defaults to None.
network (str, optional) – Return clients for given network (SSID). Defaults to None.
site (str, optional) – Return clients in a particular site. Defaults to None.
serial (str, optional) – Return clients connected to the device with given serial. Defaults to None.
os_type (str, optional) – Return clients with provided os_type. Defaults to None.
stack_id (str, optional) – Return clients connected to stack with provided id. Defaults to None.
cluster_id (str, optional) – Return clients connected to cluster with provided id. Defaults to None.
band (str, optional) – Return (WLAN) clients connected to provided band. Defaults to None.
client_status (Literal["FAILED_TO_CONNECT", "CONNECTED"], optional) – Return clients that are connected, or clients that have failed to connect. Defaults to CONNECTED.
past – (str, optional): Time-range to show client details for where 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Defaults to 3H
offset (int, optional) – API offset. Defaults to 0.
limit (int, optional) – API record limit. Defaults to 1000, Max 1000.
- Returns:
CentralCli.Response object
- Return type:
- async get_all_devices(cache: bool = False, dev_types: Literal['ap', 'gw', 'switch', 'sdwan'] | List[Literal['ap', 'gw', 'switch', 'sdwan']] | None = None, group: str | None = None, site: str | None = None, label: str | None = None, serial: str | None = None, mac: str | None = None, model: str | None = None, stack_id: str | None = None, swarm_id: str | None = None, cluster_id: str | None = None, public_ip_address: str | None = None, status: Literal['up', 'down'] | None = None, show_resource_details: bool = True, calculate_client_count: bool = True, calculate_ssid_count: bool = False, fields: list | None = None, offset: int = 0, limit: int = 1000) CombinedResponse | List[Response]¶
Get all devices from Aruba Central.
- Parameters:
dev_type (Literal['ap', 'gw', 'cx', 'sw', 'sdwan', 'switch'], optional) – Device Types to Update. Defaults to None.
group (str, optional) – Filter by devices in a Group. Defaults to None.
site (str, optional) – Filter by devices in a Site. Defaults to None.
label (str, optional) – Filter by devices with a label assigned. Defaults to None.
serial (str, optional) – Filter by Serial. Defaults to None.
mac (str, optional) – Filter by mac. Defaults to None.
model (str, optional) – Filter by model. Defaults to None.
stack_id (str, optional) – Filter by stack id (switches). Defaults to None.
swarm_id (str, optional) – Filter by swarm id (APs). Defaults to None.
cluster_id (str, optional) – Filter by cluster id. Defaults to None.
public_ip_address (str, optional) – Filter by public ip. Defaults to None.
status (constants.DeviceStatus, optional) – Filter by status. Defaults to None.
show_resource_details (bool, optional) – Show device resource utilization details. Defaults to True.
calculate_client_count (bool, optional) – Calculate client count. Defaults to True.
calculate_ssid_count (bool, optional) – Calculate SSID count. Defaults to False.
fields (list, optional) – fields to return. Defaults to None.
offset (int, optional) – pagination offset. Defaults to 0.
limit (int, optional) – pagination limit max 1000. Defaults to 1000.
- Returns:
CombinedResponse object.
- Return type:
- async get_all_groups() Response¶
Get properties and template info for all groups
This method will first call configuration/v2/groups to get a list of group names.
It then combines the responses from /configuration/v2/groups/template_info and /configuration/v1/groups/properties to get the template details (template_group or not) and properties for each group.
The template_info and properties endpoints both allow 20 groups per request. Multiple requests will be performed async if there are more than 20 groups.
- Raises:
CentralCliException – Raised when validation of combined responses fails.
- Returns:
centralcli Response Object
- Return type:
- async get_all_sites(calculate_total: bool = False, sort: str | None = None, offset: int = 0, limit: int = 100) Response¶
List Sites.
- Parameters:
calculate_total (bool, optional) – Whether to calculate total Site Labels
sort (str, optional) – Sort parameter may be one of +site_name, -site_name. Default is +site_name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Max is 1000 Defaults to 1000 (max).
- Returns:
CentralAPI Response object
- Return type:
- async get_all_swarms_firmware_details(group: str | None = None, offset: int = 0, limit: int = 100) Response¶
List Firmware Details of all Swarms.
- Parameters:
group (str, optional) – Group name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 20 and max is 1000 Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_all_templates(groups: List[dict] | List[str] | None = None, template: str | None = None, device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] | None = None, version: str | None = None, model: str | None = None, query: str | None = None) Response¶
Get data for all defined templates from Aruba Central
- Parameters:
groups (List[dict] | List[str], optional) – List of groups. If provided additional API calls to get group names for all template groups are not performed). If a list of str (group names) is provided all are queried for templates If a list of dicts is provided: It should look like: [{“name”: “group_name”, “wired_tg”: True, “wlan_tg”: False}] Defaults to None.
template (str, optional) – Filter on provided name as template.
device_type (Literal['ap', 'gw', 'cx', 'sw'], optional) – Filter on device_type. Valid Values: ap|gw|cx|sw.
version (str, optional) – Filter on version property of template. Example: ALL, 6.5.4 etc.
model (str, optional) – Filter on model property of template. For ‘ArubaSwitch’ device_type, part number (J number) can be used for the model parameter. Example: ALL, 2920, J9727A etc.
query (str, optional) – Search for template OR version OR model, query will be ignored if any of filter parameters are provided.
- Returns:
centralcli Response Object
- Return type:
- async get_all_templates_in_group(group: str, name: str | None = None, device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] | None = None, version: str | None = None, model: str | None = None, query: str | None = None, offset: int = 0, limit: int = 20) Response¶
Get all templates in group.
- Parameters:
group (str) – Name of the group for which the templates are being queried.
template (str, optional) – Filter on provided name as template.
device_type (Literal['ap', 'gw', 'cx', 'sw'], optional) – Filter on device_type. Valid Values: ap|gw|cx|sw.
version (str, optional) – Filter on version property of template. Example: ALL, 6.5.4 etc.
model (str, optional) – Filter on model property of template. For ‘ArubaSwitch’ device_type, part number (J number) can be used for the model parameter. Example: ALL, 2920, J9727A etc.
query (str, optional) – Search for template OR version OR model, query will be ignored if any of filter parameters are provided.
offset (int, optional) – Number of items to be skipped before returning the data, useful for pagination. Defaults to 0.
limit (int, optional) – Maximum number of template records to be returned. Max 20. Defaults to 20.
- Returns:
CentralAPI Response object
- Return type:
- async get_all_webhooks() Response¶
List all defined webhooks.
- Returns:
CentralAPI Response object
- Return type:
- async get_ap_config(group_swarmid: str, version: str | None = None) Response¶
Get AP Group Level configuration for UI group.
// Used by show config <AP MAC for AOS10 AP> //
- Parameters:
group_swarmid (str) – Group name of the group or guid of the swarm. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
version (str, optional) – Version of AP.
- Returns:
CentralAPI Response object
- Return type:
- async get_ap_lldp_neighbor(serial: str) Response¶
Get neighbor details reported by AP via LLDP.
- Parameters:
serial (str) – Device serial number.
- Returns:
CentralAPI Response object
- Return type:
- async get_ap_settings(serial: str) Response¶
Get an existing ap settings.
- Parameters:
serial (str) – AP serial number.
- Returns:
CentralAPI Response object
- Return type:
- async get_aps_bandwidth_usage(serial: str | None = None, group: str | None = None, site: str | None = None, label: str | None = None, swarm_id: str | None = None, cluster_id: str | None = None, band: str | None = None, radio_number: int | None = None, network: str | None = None, ethernet_interface_index: int | None = None, interval: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None) Response¶
AP Bandwidth Usage.
- Parameters:
serial (str, optional) – Filter by AP serial
group (str, optional) – Filter by group name
site (str, optional) – Filter by Site name
label (str, optional) – Filter by Label name
swarm_id (str, optional) – Filter by Swarm ID. Field supported for AP clients only
cluster_id (str, optional) – Filter by Mobility Controller serial number
band (str, optional) – Filter by band (2.4, 5 or 6). Valid only when serial parameter is specified.
radio_number (int, optional) – Filter by radio_number (0, 1 or 2). Valid only when serial parameter is specified.
network (str, optional) – Filter by network name. Valid only when serial parameter is specified.
ethernet_interface_index (int, optional) – Filter by ethernet interface index. Valid only when serial parameter is specified. Valid range is 0-3.
interval (str, optional) – Filter by interval (5minutes or 1hour or 1day or 1week). API endpoint defaults to 5minutes when no value is provided.
from_time (int | float | datetime, optional) – Need information from this timestamp. Timestamp is epoch in seconds. Default is current timestamp minus 3 hours
to_time (int | float | datetime, optional) – Need information to this timestamp. Timestamp is epoch in seconds. Default is current timestamp
- Returns:
CentralAPI Response object
- Return type:
- async get_archived_devices(offset: int = 0, limit: int = 50) Response¶
Get Archived devices from device inventory.
- Parameters:
offset (int, optional) – offset or page number Defaults to 0.
limit (int, optional) – Number of devices to get Defaults to 50 (which is also the max).
- Returns:
CentralAPI Response object
- Return type:
- async get_audit_event_logs(log_id: str | None = None, group_name: str | None = None, device_id: str | None = None, classification: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100, count: int | None = None) Response¶
Get all audit events for all groups.
This API returns the first 10,000 results only.
- Parameters:
log_id (str, optional) – The id of the audit event log to return details for. Defaults to None.
group_name (str, optional) – Filter audit events by Group Name
device_id (str, optional) – Filter audit events by Target / Device ID. Device ID for AP is VC Name and Serial Number for Switches
classification (str, optional) – Filter audit events by classification
from_time (int | float | datetime, optional) – Start of Time Range to filter audit logs by.
to_time (int | float | datetime, optional) – End of Time Range to filter audit logs by. Defaults to now.
offset (int, optional) – Number of items to be skipped before returning the data, useful for pagination Defaults to 0.
limit (int, optional) – Maximum number of audit events to be returned Defaults to 100. Max 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_audit_logs(log_id: str | None = None, username: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, description: str | None = None, target: str | None = None, classification: str | None = None, customer_name: str | None = None, ip_address: str | None = None, app_id: str | None = None, offset: int = 0, limit: int = 100, count: int | None = None) Response¶
Get all audit logs.
This API returns the first 10,000 results only.
- Parameters:
log_id (str, optional) – The id of the log to return details for. Defaults to None.
username (str, optional) – Filter audit logs by User Name
from_time (int | float | datetime, optional) – Start time of the audit logs to retrieve.
to_time (int | float | datetime, optional) – End time of the audit logs to retrieve.
description (str, optional) – Filter audit logs by Description
target (str, optional) – Filter audit logs by target (serial number).
classification (str, optional) – Filter audit logs by Classification
customer_name (str, optional) – Filter audit logs by Customer Name
ip_address (str, optional) – Filter audit logs by IP Address
app_id (str, optional) – Filter audit logs by app_id
offset (int, optional) – Number of items to be skipped before returning the data. Default to 0.
limit (int, optional) – Maximum number of audit events to be returned max: 100 Defaults to 100.
count – Only return <count> results.
- Returns:
CentralAPI Response object
- Return type:
- async get_auto_subscribe() Response¶
Get the services which have auto subscribe enabled.
- Returns:
CentralAPI Response object
- Return type:
- async get_brach_health(name: str | None = None, column: int | None = None, reverse: bool = False, filters: dict = {}, offset: int = 0, limit: int = 100) Response¶
Get data for all sites.
- Parameters:
name (str, optional) – site / label name or part of its name
column (int, optional) – Column to sort on
reverse (bool, optional) – Sort in reverse order: Valid Values: asc, desc * asc - Ascending, from A to Z. * desc - Descending, from Z to A.
filters (str, optional) – Site thresholds Valid Values: gt (Greater than), lt (Less than), gte (Greater than or equal to), lte (Less than or equal to) * All properties of a site can be used as filter parameters with a threshold * The range filters can be combined with the column names with “__” # noqa * For eg. /site?device_down__gt=0 - Lists all sites that have more than 1 device in down state # noqa * For eg. /site?wan_uplinks_down__lt=1 - Lists all sites that have less than 1 wan in down state # noqa * For eg. /site?device_up__gt=1&device_up__lt=10 - Lists all sites that have 1-10 devices up # noqa
offset (int, optional) – pagination start index Defaults to 0.
limit (int, optional) – pagination size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_bssids(group: str | None = None, swarm_id: str | None = None, label: str | None = None, site: str | None = None, serial: str | None = None, mac: str | None = None, cluster_id: str | None = None, calculate_total: bool | None = None, sort: str | None = None, offset: int = 0, limit: int = 1000) Response¶
List BSSIDs.
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID
label (str, optional) – Filter by Label name
site (str, optional) – Filter by Site name
serial (str, optional) – Filter by AP serial number
mac (str, optional) – Filter by AP MAC address
cluster_id (str, optional) – Filter by Mobility Controller serial number
calculate_total (bool, optional) – Whether to calculate total APs
sort (str, optional) – Sort parameter may be one of +serial, -serial, +macaddr,-macaddr, +swarm_id, -swarm_id.Default is ‘+serial’
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_certificates(q: str | None = None, offset: int = 0, limit: int = 20, callback: callable | None = None, callback_kwargs: dict | None = None) Response¶
Get Certificates details.
- Parameters:
q (str, optional) – Search for a particular certificate by its name, md5 hash or sha1_hash
offset (int, optional) – Number of items to be skipped before returning the data, useful for pagination. Defaults to 0.
limit (int, optional) – Maximum number of records to be returned. Defaults to 20, Max 20.
- Returns:
CentralAPI Response object
- Return type:
- async get_client_roaming_history(mac: str, calculate_total: bool | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
Wireless Client Mobility Trail.
- Parameters:
mac (str) – MAC address of the Wireless Client to be queried
calculate_total (bool, optional) – Whether to calculate total transitions
from_time (int | float | datetime, optional) – Collect roaming history from this starting point. Default is now minus 3 hours.
to_time (int | float | datetime, optional) – End of time-range to collect roaming history for. Default is now.
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 1000, max is 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_clients(client_type: Literal['wired', 'wireless', 'all'] | None = None, group: str | None = None, swarm_id: str | None = None, label: str | None = None, network: str | None = None, site: str | None = None, serial: str | None = None, os_type: str | None = None, stack_id: str | None = None, cluster_id: str | None = None, band: str | None = None, mac: str | None = None, client_status: Literal['FAILED_TO_CONNECT', 'CONNECTED'] = 'CONNECTED', past: str = '3H', offset: int = 0, limit: int = 1000) Response¶
Get Clients details.
- Parameters:
client_type (Literal['wired', 'wireless', 'all'], optional) – Client type to retrieve. Defaults to None. if not provided all client types will be returned, unless a filter specific to a client type is specified. i.e. providing band will result in WLAN clients.
group (str, optional) – Filter by Group. Defaults to None.
swarm_id (str, optional) – Filter by swarm. Defaults to None.
label (str, optional) – Filter by label. Defaults to None.
network (str, optional) – Filter by WLAN SSID. Defaults to None.
site (str, optional) – Filter by site. Defaults to None.
serial (str, optional) – Filter by connected device serial. Defaults to None.
os_type (str, optional) – Filter by client OS type. Defaults to None.
stack_id (str, optional) – Filter by Stack ID. Defaults to None.
cluster_id (str, optional) – Filter by Cluster ID. Defaults to None.
band (str, optional) – Filter by band. Defaults to None.
mac (str, optional) – Filter by client MAC. Defaults to None.
client_status (Literal["FAILED_TO_CONNECT", "CONNECTED"], optional) – Return clients that are connected, or clients that have failed to connect. Defaults to CONNECTED.
past – (str, optional): Time-range to show client details for. Format: 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Defaults to 3H
offset (int, optional) – API Paging offset. Defaults to 0.
limit (int, optional) – API record limit per request. Defaults to 1000 Max 1000.
- Returns:
CentralAPI Response Object
- Return type:
- async get_clients_bandwidth_usage(group: str | None = None, swarm_id: str | None = None, label: str | None = None, cluster_id: str | None = None, stack_id: str | None = None, serial: str | None = None, mac: str | None = None, from_time: int | None = None, to_time: int | None = None) Response¶
Client Bandwidth Usage.
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID. Field supported for AP clients only
label (str, optional) – Filter by Label name
cluster_id (str, optional) – Filter by Mobility Controller serial number
stack_id (str, optional) – Filter by Switch stack_id
serial (str, optional) – Filter by switch serial
mac (str, optional) – Filter by Client mac
from_timestamp (int, optional) – Need information from this timestamp. Timestamp is epoch in seconds. Default is current timestamp minus 3 hours
to_timestamp (int, optional) – Need information to this timestamp. Timestamp is epoch in seconds. Default is current timestamp
- Returns:
CentralAPI Response object
- Return type:
- async get_cx_switch_neighbors(serial: str) Response¶
Get lldp device neighbor info for CX switch.
If used on AOS-SW will only return neighbors that are CX switches For a stack this will return neighbors for the individual member use get_cx_switch_stack_neighbors to get neighbors for entire stack
- Parameters:
serial (str) – id of the switch
- Returns:
CentralAPI Response object
- Return type:
- async get_cx_switch_stack_neighbors(stack_id: str) Response¶
Get lldp device neighbor info for CX switch stack.
- Parameters:
stack_id (str) – Filter by stack_id
- Returns:
CentralAPI Response object
- Return type:
- async get_default_group() Response¶
Get default group.
- Returns:
CentralAPI Response object
- Return type:
- async get_denylist_clients(serial: str) Response¶
Get all denylist client mac address in device.
- Parameters:
serial (str) – Device id of virtual controller (AOS8 IAP) or serial of AOS10 ap. Example:14b3743c01f8080bfa07ca053ef1e895df9c0680fe5a17bfd5
- Returns:
CentralAPI Response object
- Return type:
- async get_dev_details(device_type: Literal['ap', 'gw', 'switch', 'sdwan'], serial: str) Response¶
Return Details for a given device
- Parameters:
device_type (Literal["ap", "gw", "switch") – Type of devices to get
serial (str) – Serial number of Device
- Returns:
CentralAPI Response object
- Return type:
- async get_device_configuration(serial: str) Response¶
Get last known running configuration for a device.
// Used by show run <DEVICE-IDEN> //
- Parameters:
device_serial (str) – Serial number of the device.
- Returns:
CentralAPI Response object
- Return type:
- async get_device_firmware_details(serial: str) Response¶
Firmware Details of Device.
- Parameters:
serial (str) – Serial of the device for which the firmware detail to be queried
- Returns:
CentralAPI Response object
- Return type:
- async get_device_firmware_details_by_type(device_type: Literal['mas', 'cx', 'sw', 'gw'], group: str | None = None, offset: int = 0, limit: int = 500) Response¶
List Firmware Details by type for switches or gateways (Not valid for APs).
- Parameters:
device_type (str) – Specify one of “mas|sw|cx|gw”
group (str, optional) – Group name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. max 1000, Defaults to 500.
- Returns:
CentralAPI Response object
- Return type:
- Raises:
ValueError – if device_type is not valid/supported by API endpoint.
- async get_device_inventory(device_type: Literal['ap', 'gw', 'switch', 'all'] | None = None, offset: int = 0, limit: int = 1000) Response¶
Get devices from device inventory.
- Parameters:
device_type (Literal['ap', 'gw', 'switch', 'all'], optional) – Device Type. Defaults to None = ‘all’ device types.
offset (int, optional) – offset or page number Defaults to 0.
limit (int, optional) – Number of devices to get Defaults to 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_device_ip_routes(serial: str, api: str = 'V1', marker: str | None = None, limit: int = 100) Response¶
Get routes for a device.
- Parameters:
serial (str) – Device serial number
api (str, optional) – API version (V0|V1), Defaults to V1.
marker (str, optional) – Pagination offset.
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_devices(device_type: Literal['ap', 'gw', 'switch', 'sdwan'], *, group: str | None = None, label: str | None = None, stack_id: str | None = None, swarm_id: str | None = None, serial: str | None = None, status: Literal['up', 'down'] | None = None, fields: list | None = None, show_resource_details: bool = False, cluster_id: str | None = None, model: str | None = None, calculate_client_count: bool = True, calculate_ssid_count: bool = False, mac: str | None = None, public_ip_address: str | None = None, site: str | None = None, limit: int = 1000, offset: int = 0) Response¶
Get Devices from Aruba Central API Gateway
- Parameters:
device_type (Literal["ap", "gw", "switch") – Type of devices to get.
group (str, optional) – Filter on specific group. Defaults to None.
label (str, optional) – Filter by label. Defaults to None.
stack_id (str, optional) – Return switch with specific stack_id. Defaults to None.
swarm_id (str, optional) – Return APs with a specific swarm_id. Defaults to None.
serial (str, optional) – Return the device with serial number. Defaults to None.
status (str, optional) – Filter by status. Defaults to None.
fields (list, optional) – Return specific fields for device. Defaults to None.
show_resource_details (bool, optional) – Show resource utilization. Defaults to False.
cluster_id (str, optional) – Return gateways with a specific cluster_id. Defaults to None.
model (str, optional) – Filter by device model. Defaults to None.
calculate_client_count (bool, optional) – Calculate client count for each device. Defaults to False.
calculate_ssid_count (bool, optional) – Calculate SSID count for each AP. Defaults to False.
mac (str, optional) – Return device with specific MAC (fuzzy match). Defaults to None.
public_ip_address (str, optional) – Filter devices by Public IP. Defaults to None.
site (str, optional) – Filter by site. Defaults to None.
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Max is 1000 Defaults to 500.
- Returns:
CentralAPI Response object
- Return type:
- Raises:
ValueError – Raised if dev_type is not valid.
- async get_dhcp_clients(serial: str, reservation: bool = True, offset: int = 0, limit: int = 100) Response¶
Get DHCP Client information from Gateway.
- Parameters:
serial (str) – Serial number of mobility controller to be queried
reservation (bool, optional) – Flag to turn on/off listing DHCP reservations(if any). Defaults to True
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. max 1000 Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_dhcp_pools(serial: str) Response¶
Gateway DHCP Pools details.
- Parameters:
serial (str) – Serial number of mobility controller to be queried
- Returns:
CentralAPI Response object
- Return type:
- async get_dirty_diff(group: str, offset: int = 0, limit: int = 20) Response¶
Get AP dirty diff (config items not pushed) by group.
- Parameters:
group (str) – Group name of the group or guid of the swarm. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
offset (int, optional) – Number of items to be skipped before returning the data, useful for pagination. Defaults to 0.
limit (int, optional) – Maximum number of group config_mode records to be returned. Max: 20, Defaults to 20.
- Returns:
CentralAPI Response object
- Return type:
- async get_events(group: str | None = None, swarm_id: str | None = None, label: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, client_mac: str | None = None, bssid: str | None = None, device_mac: str | None = None, hostname: str | None = None, device_type: Literal['ap', 'gw', 'switch', 'client'] | None = None, sort: str | None = None, site: str | None = None, serial: str | None = None, level: str | None = None, event_description: str | None = None, event_type: str | None = None, fields: str | None = None, calculate_total: bool = True, offset: int = 0, limit: int = 1000, count: int | None = None) Response¶
Get device events
Endpoint allows a max of 10,000 records to be retrieved. The sum of offset + limit can not exceed 10,000
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID
label (str, optional) – Filter by Label name
from_time – (int | float | datetime, optional): Start time of the event logs to retrieve. Default is current timestamp minus 3 hours.
to_time (int | float | datetime, optional) – End time of the event logs to retrieve. seconds. Default is current timestamp.
client_mac (str, optional) – Filter by client MAC address
bssid (str, optional) – Filter by bssid
device_mac (str, optional) – Filter by device_mac
hostname (str, optional) – Filter by hostname
device_type (str, optional) – Filter by device type. Valid Values: ap, gw, switch, client
sort (str, optional) – Sort by desc/asc using -timestamp/+timestamp. Default is ‘-timestamp’ Valid Values: -timestamp, +timestamp
site (str, optional) – Filter by site name
serial (str, optional) – Filter by switch serial number
level (str, optional) – Filter by event level
event_description (str, optional) – Filter by event description
event_type (str, optional) – Filter by event type
fields (str, optional) – Comma separated list of fields to be returned. Valid fields are number, level
calculate_total (bool, optional) – Whether to calculate total events. Defaults to True.
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 1000.
count – Only return <count> results.
- Returns:
CentralAPI Response object
- Return type:
- async get_firmware_compliance(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'], group: str | None = None) Response¶
Get Firmware Compliance Version.
// Used by show firmware compliance [ap|gw|sw|cx] [group-name] //
- Parameters:
device_type (str) – Specify one of “ap|gw|sw|sx”
group (str, optional) – Group name
- Returns:
CentralAPI Response object
- Return type:
- async get_firmware_version_list(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] | None = None, swarm_id: str | None = None, serial: str | None = None) Response¶
List Firmware Version.
Provide one and only one of the following.
- Parameters:
device_type (str, optional) – Specify one of ap, gw, sw, cx
swarm_id (str, optional) – Swarm ID
serial (str, optional) – Serial of device
- Returns:
CentralAPI Response object
- Return type:
- async get_full_wlan_list(scope: str) Response¶
Get WLAN list/details by (UI) group.
- Parameters:
scope (str) – Provide one of group name, swarm id, or serial number. Example: Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f or CNF7JSS9L1.
- Returns:
CentralAPI Response object
- Return type:
- async get_gateway_ports(serial: str) Response¶
Gateway Ports Details.
- Parameters:
serial (str) – Serial number of Gateway to be queried
- Returns:
CentralAPI Response object
- Return type:
- async get_gateway_vlans(serial: str) Response¶
Get gateway VLAN details.
- Parameters:
serial (str) – Serial number of gateway to be queried
- Returns:
CentralAPI Response object
- Return type:
- async get_group_names() Response¶
Get a listing of all group names defined in Aruba Central
- Returns:
- CentralAPI Respose object
output attribute will be List[str]
- Return type:
- async get_groups_properties(groups: str | List[str] | None = None) Response¶
Get properties set for groups.
// Used by show groups when -v flag is provided //
- Parameters:
groups (List[str], optional) – Group list to fetch properties. Will fetch all if no groups provided. Maximum 20 comma separated group names allowed.
- Returns:
CentralAPI Response object
- Return type:
- async get_groups_template_status(groups: str | List[str] | None = None) Response¶
Get template group status for provided groups or all if none are provided. (if it is a template group or not)
Will return response from /configuration/v2/groups/template_info endpoint. If no groups are provided /configuration/v2/groups is first called to get a list of all group names.
- Parameters:
groups (List[str] | str, optional) – A single group or list of groups. Defaults to None (all groups).
- Returns:
centralcli Response Object
- Return type:
- async get_guest_summary(ssids: List[str] | str, days: int = 28) Response¶
Get summary statistics.
- Parameters:
ssid (str) – A comma separated list of SSIDs for which session data is required
days (optional, int) – Num of days for which session data is required Valid Values: 1, 7, 28 Default: 28
- Raises:
ValueError – If days is not valid (1, 7, 28).
- Returns:
CentralAPI Response object
- Return type:
- async get_gw_tunnels(serial: str, timerange: TimeRange = '1m', limit: int = 250, offset: int = 0) Response¶
Get gateway Uplink tunnel details.
Used by wh_proxy, currently not used by a command will be in show gateway tunnels
- Parameters:
serial (str) – Serial number of mobility controller to be queried
timerange (str) – Time range for tunnel stats information. 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months.
limit (int, optional) – Pagination limit. Max: 1000 Defaults to 250.
offset (int, optional) – Pagination offset Defaults to 0.
- Returns:
CentralAPI Response object
- Return type:
- async get_gw_uplinks_bandwidth_usage(serial: str, uplink_id: str | None = None, interval: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None) Response¶
Gateway Uplink Bandwidth Usage.
- Parameters:
serial (str) – Gateway serial
uplink_id (str, optional) – Filter by uplink ID.
interval (str, optional) – Filter by interval (5minutes or 1hour or 1day or 1week).
from_time (int | float | datetime, optional) – Need information from this timestamp. Timestamp is epoch in seconds. Default is current timestamp minus 3 hours
to_time (int | float | datetime, optional) – Need information to this timestamp. Timestamp is epoch in seconds. Default is current timestamp
- Returns:
CentralAPI Response object
- Return type:
- async get_gw_uplinks_details(serial: str, timerange: TimeRange = '1m') Response¶
Gateway Uplink Details.
- Parameters:
serial (str) – Serial number of gateway to be queried
timerange (str) – Time range for Uplink stats information. 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Valid Values: 3H, 1D, 1W, 1M, 3M
- Returns:
CentralAPI Response object
- Return type:
- async get_labels(calculate_total: bool | None = None, reverse: bool = False, offset: int = 0, limit: int = 100) Response¶
List Labels.
- Parameters:
calculate_total (bool, optional) – Whether to calculate total Labels
reverse (bool, optional) – List labels in reverse alphabetical order. Defaults to False
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Max is 1000. Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_networks_bandwidth_usage(network: str, group: str | None = None, swarm_id: str | None = None, label: str | None = None, site: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None) Response¶
WLAN Network Bandwidth usage.
Use get_wlans to fetch list of networks.
- Parameters:
network (str) – Network name (ssid) to return usage for
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID. Field supported for AP clients only
label (str, optional) – Filter by Label name
site (str, optional) – Filter by Site name
from_time (int | float | datetime, optional) – Need information from this timestamp. Timestamp is epoch in seconds. Default is current timestamp minus 3 hours
to_time (int | float | datetime, optional) – Need information to this timestamp. Timestamp is epoch in seconds. Default is current timestamp
- Returns:
CentralAPI Response object
- Return type:
- async get_ospf_area(device: str, marker: str | None = None, limit: int = 100) Response¶
List OSPF Area Information.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_ospf_database(device: str, marker: str | None = None, limit: int = 100) Response¶
List OSPF Link State Database Information.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_ospf_interface(device: str, marker: str | None = None, limit: int = 100) Response¶
List OSPF Interface Information.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_ospf_neighbor(device: str, marker: str | None = None, limit: int = 100) Response¶
List OSPF neighbor Information.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_overlay_connection(device: str, marker: str | None = None, limit: int = 100) Response¶
Get information about overlay control connection.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_overlay_interfaces(device: str, marker: str | None = None, limit: int = 100) Response¶
List of overlay interfaces (tunnels).
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_overlay_routes_advertised(device: str, marker: str | None = None, limit: int = 100) Response¶
List of advertised routes to overlay.
- Parameters:
device (str) – Device serial number
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_overlay_routes_learned(device: str, *, best: bool = False, marker: str | None = None, limit: int = 100) Response¶
List of learned routes from overlay.
- Parameters:
device (str) – Device serial number
best (bool) – Return only best / preferred routes
marker (str, optional) – Opaque handle to fetch next page
limit (int, optional) – page size Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_per_ap_config(serial: str) Response¶
Get per AP setting.
- Parameters:
serial (str) – Serial Number of AP
- Returns:
CentralAPI Response object
- Return type:
- async get_portal_profile(portal_id: str) Response¶
Get guest portal profile.
- Parameters:
portal_id (str) – Portal ID of the splash page
- Returns:
CentralAPI Response object
- Return type:
- async get_portals(sort: str | None = None, offset: int = 0, limit: int = 100) Response¶
Get all portals with limited data.
- Parameters:
sort (str, optional) – + is for ascending and - for descending order, Valid Values: name prepended with + or - i.e. +name. Defaults to None. Which results in use of API default +name.
offset (int, optional) – Starting index of element for a paginated query Defaults to 0.
limit (int, optional) – Number of items required per query Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_site_details(site_id: int) Response¶
Site details.
- Parameters:
site_id (int) – Site ID
- Returns:
CentralAPI Response object
- Return type:
- async get_site_vlans(site_id: int, search: str | None = None, offset: int = 0, limit: int = 100) Response¶
Get vlan list of a site.
- Parameters:
site_id (int) – Site ID.
search (str, optional) – search.
offset (int, optional) – offset. Defaults to 0.
limit (int, optional) – limit Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_snapshots_by_group(group: str)¶
- async get_subscription_stats(license_type: str = 'all', service: str | None = None, app_only_stats: bool | None = None) Response¶
Get subscription stats.
- Parameters:
license_type (str, optional) –
Supports basic/special/all. special - will fetch the statistics of special central services like pa, ucc, clarity etc. basic - will fetch the statistics of device management service licenses. all - will fetch both of these license types.
Also supports multi tier license types such foundation_ap, advanced_switch_6300, foundation_70XX etc.
service (str, optional) – Service type: pa/pa,clarity,foundation_ap, advanced_switch_6300, foundation_70XX etc.
app_only_stats (bool, optional) – If value is True, stats only for the current application returned rather than global stats
- Returns:
CentralAPI Response object
- Return type:
- async get_subscriptions(license_type: str | None = None, device_type: Literal['ap', 'gw', 'switch', 'sdwan'] | None = None, offset: int = 0, limit: int = 1000) Response¶
Get user subscription keys.
- Parameters:
license_type (str, optional) – Supports Basic, Service Token and Multi Tier licensing types as well
device_type (str, optional) – Filter by device type (‘ap’, ‘gw’, or ‘switch’)
offset (int, optional) – offset or page number Defaults to 0.
limit (int, optional) – Number of subscriptions to get Defaults to 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_swarm_details(swarm_id: str) Response¶
Swarm Details.
- Parameters:
swarm_id (str) – Swarm ID
- Returns:
CentralAPI Response object
- Return type:
- async get_swarm_firmware_details(swarm_id: str) Response¶
Firmware Details of Swarm or AOS10 AP.
- Parameters:
swarm_id (str) – Swarm ID for which the firmware detail to be queried AOS10 APs provide serial as swarm_id
- Returns:
CentralAPI Response object
- Return type:
- async get_swarms(group: str | None = None, status: str | None = None, public_ip_address: str | None = None, fields: str | None = None, calculate_total: bool | None = None, sort: str | None = None, swarm_name: str | None = None, offset: int = 0, limit: int = 100) Response¶
List Swarms.
- Parameters:
group (str, optional) – Filter by group name
status (str, optional) – Filter by Swarm status
public_ip_address (str, optional) – Filter by public ip address
fields (str, optional) – Comma separated list of fields to be returned Valid fields are: status, ip_address, public_ip_address, firmware_version
calculate_total (bool, optional) – Whether to calculate total Swarms
sort (str, optional) – Sort parameter may be one of +swarm_id, -swarm_id
swarm_name (str, optional) – Filter by swarm name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_poe_details(serial: str, port: str | None = None, aos_sw: bool = False) Response¶
Get switch poe info.
- Parameters:
serial (str) – Switch serial
port (str, optional) – Filter by switch port
aos_sw (bool, optional) – Device is ArubaOS-Switch. Defaults to False (CX Switch)
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_ports(iden: str, slot: str | None = None, stack: bool = False, aos_sw: bool = False) Response¶
Switch Ports Details.
- Parameters:
iden (str) – Serial number of switch to be queried or the stack_id if it’s a stack
slot (str, optional) – Slot name of the ports to be queried {For chassis type switches only}.
stack – (bool, optional) : Get details for stack vs individual switch (iden needs to be the stack_id) Defaults to False.
aos_sw (bool, optional) – Device is ArubaOS-Switch. Defaults to False (indicating CX switch)
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_ports_bandwidth_usage(serial: str, switch_type: Literal['cx', 'sw'] = 'cx', from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, port: str | None = None, show_uplink: bool | None = None) Response¶
Ports Bandwidth Usage for Switch.
- Parameters:
serial (str) – Serial number of switch to be queried
switch_type – (Literal[“cx”, “sw”], optional) = switch type. Valid ‘cx’, ‘sw’. Defaults to ‘cx’
from (int | float | datetime, optional) – Need information from this timestamp. Timestamp is epoch in seconds. Default is current timestamp minus 3 hours
to (int | float | datetime, optional) – Need information to this timestamp. Timestamp is epoch in seconds. Default is current timestamp
port (str, optional) – Filter by Port
show_uplink (bool, optional) – Show usage for Uplink ports alone
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_stack_details(stack_id: str) Response¶
Switch Stack Details.
- Parameters:
stack_id (str) – Filter by Switch stack_id
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_stacks(hostname: str | None = None, group: str | None = None, offset: int = 0, limit: int = 1000) Response¶
List Switch Stacks.
- Parameters:
hostname (str, optional) – Filter by stack hostname
group (str, optional) – Filter by group name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 1000 and max is 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_vlans(iden: str, stack: bool = False, name: str | None = None, pvid: int | None = None, tagged_port: str | None = None, untagged_port: str | None = None, is_jumbo_enabled: bool | None = None, is_voice_enabled: bool | None = None, is_igmp_enabled: bool | None = None, type: str | None = None, primary_vlan_id: int | None = None, status: str | None = None, sort: str | None = None, calculate_total: bool = True, aos_sw: bool = False, offset: int = 0, limit: int = 500) Response¶
Get vlan info for switch (CX and SW).
- Parameters:
iden (str) – Serial Number or Stack ID, Identifies the dev to return VLANs from.
stack (bool, optional) – Set to True for stack. Default: False
name (str, optional) – Filter by vlan name
id (int, optional) – Filter by vlan id
tagged_port (str, optional) – Filter by tagged port name
untagged_port (str, optional) – Filter by untagged port name
is_jumbo_enabled (bool, optional) – Filter by jumbo enabled
is_voice_enabled (bool, optional) – Filter by voice enabled
is_igmp_enabled (bool, optional) – Filter by igmp enabled
type (str, optional) – Type of the vlan to be queried
primary_vlan_id (int, optional) – Primary Vlan Id of the vlan to be queried”
status (str, optional) – Filter by status of VLAN. Status can be Up/Down
sort (str, optional) – Sort parameter may be one of +name, -name
calculate_total (bool, optional) – Whether to calculate total vlans
aos_sw (bool, optional) – Device is ArubaOS-Switch. Defaults to False
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 100 and max is 1000 Defaults to 500.
- Returns:
CentralAPI Response object
- Return type:
- async get_switch_vsx_detail(serial: str) Response¶
Get switch vsx info for CX switch.
- Parameters:
serial (str) – Filter by switch serial
- Returns:
CentralAPI Response object
- Return type:
- async get_task_status(task_id: str) Response¶
Status.
- Parameters:
task_id (str) – Unique task id to get response of command
- Returns:
CentralAPI Response object
- Return type:
- async get_template(group: str, template: str) Response¶
Get template text for a template in group.
- Parameters:
group (str) – Name of the group for which the templates are being queried.
template (str) – Name of template.
- Returns:
CentralAPI Response object
- Return type:
- async get_template_details_for_device(serial: str, details: bool = False) Response¶
Get configuration details for a device (only for template groups).
- Parameters:
serial (str) – Serial number of the device.
details (bool, optional) – Usually pass false to get only the summary of a device’s configuration status. Pass true only if detailed response of a device’s configuration status is required. Passing true might result in slower API response and performance effect comparatively.
- Returns:
CentralAPI Response object
- Return type:
- async get_topo_for_site(site_id: int) Response¶
Get topology details of a site.
- Parameters:
site_id (int) – Site ID.
- Returns:
CentralAPI Response object
- Return type:
- async get_ts_commands(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan']) Response¶
List Troubleshooting Commands.
- Parameters:
device_type (Literal['ap', 'cx', 'sw', 'gw']) – Device Type.
- Returns:
CentralAPI Response object
- Return type:
- async get_ts_output(serial: str, session_id: int) Response¶
Get Troubleshooting Output.
- Parameters:
serial (str) – Serial of device
session_id (int) – Unique ID for troubleshooting session
- Returns:
CentralAPI Response object
- Return type:
- async get_ts_session_id(serial: str) Response¶
Get Troubleshooting Session ID for a device.
- Parameters:
serial (str) – Serial of device
- Returns:
CentralAPI Response object
- Return type:
- async get_upgrade_status(swarm_id: str | None = None, serial: str | None = None) Response¶
Get firmware upgrade status.
// Used by show upgrade [device-iden] //
- Parameters:
swarm_id (str, optional) – Swarm ID
serial (str, optional) – Serial of device
- Returns:
CentralAPI Response object
- Return type:
- async get_user_accounts(app_name: str | None = None, type: str | None = None, status: str | None = None, order_by: str | None = None, offset: int = 0, limit: int = 100) Response¶
List user accounts.
- Parameters:
app_name (str, optional) – Appname nms to filter Aruba Central users, and account_setting to filter HPE GreenLake Edge to Cloud Platform (CCS) application users Valid Values: nms, account_setting
type (str, optional) – Filter based on system or federated user Valid Values: system, federated
status (str, optional) – Filter user based on status (inprogress, failed) Valid Values: inprogress, failed
order_by (str, optional) – Sort ordering (ascending or descending). +username signifies ascending order of username. Valid Values: +username, -username
offset (int, optional) – Zero based offset to start from Defaults to 0.
limit (int, optional) – Maximum number of items to return Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_valid_subscription_names(service_category: str | None = None, device_type: Literal['ap', 'gw', 'switch', 'sdwan'] | None = None) Response¶
Get Valid subscription names from Central.
- Parameters:
service_category (str, optional) – Service category - dm/network
device_type (Literal['ap', 'gw', 'switch'], optional) – Device Type one of ap, gw, switch
- Returns:
CentralAPI Response object
- Return type:
- async get_variables(serial: str | None = None, offset: int = 0, limit: int = 20) Response¶
Get template variables for a device or all devices
- Parameters:
serial (str) – Serial number of the device, If None provided all templates for all devices will be fetched. Defaults to None.
offset (int, optional) – Number of items to be skipped before returning the data, useful for pagination. Defaults to 0.
limit (int, optional) – Maximum number of records to be returned. Defaults to 20.
offset and limit are ignored if serial is provided.
- Returns:
CentralAPI Response object
- Return type:
- async get_variablised_template(serial: str) Response¶
Get variablised template for an Aruba Switch.
- Parameters:
serial (str) – Serial number of the device.
- Returns:
CentralAPI Response object
- Return type:
- async get_vc_firmware(swarm_id: str | None = None, group: str | None = None, offset: int = 0, limit: int = 100) Response¶
List Firmware Details of Swarms.
- Parameters:
swarm_id – (str, optional): Providing swarm_id results in details for that swarm.
group (str, optional) – Group name
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Max is 1000 Defaults to 100.
filter (Providing swarm_id is effectively a)
detail. (it provides no additional)
- Returns:
CentralAPI Response object
- Return type:
- async get_visitors(portal_id: str, sort: str = '+name', filter_by: str | None = None, filter_value: str | None = None, offset: int = 0, limit: int = 100) Response¶
Get all visitors created against a portal.
- Parameters:
portal_id (str) – Portal ID of the splash page
sort (str, optional) –
is for ascending and - for descending order, Valid Values: ‘+name’, ‘-name’. Defaults to +name.
filter_by (str, optional) – filter by email or name Valid Values: name, email
filter_value (str, optional) – filter value
offset (int, optional) – Starting index of element for a paginated query Defaults to 0.
limit (int, optional) – Number of items required per query Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async get_wired_clients(group: str | None = None, swarm_id: str | None = None, label: str | None = None, site: str | None = None, serial: str | None = None, cluster_id: str | None = None, stack_id: str | None = None, fields: str | None = None, calculate_total: bool = True, client_status: Literal['FAILED_TO_CONNECT', 'CONNECTED'] = 'CONNECTED', past: str = '3H', offset: int = 0, limit: int = 1000) Response¶
List Wired Clients.
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID
label (str, optional) – Filter by Label name
site (str, optional) – Filter by Site name
serial (str, optional) – Filter by Switch or AP serial number
cluster_id (str, optional) – Filter by Mobility Controller serial number
stack_id (str, optional) – Filter by Switch stack_id
fields (str, optional) – Comma separated list of fields to be returned. Valid fields are name, ip_address, username, associated_device, group_name, interface_mac, vlan
calculate_total (bool, optional) – Whether to calculate total wired Clients
client_status (Literal["FAILED_TO_CONNECT", "CONNECTED"], optional) – Return clients that are connected, or clients that have failed to connect. Defaults to CONNECTED.
past – (str, optional): Time-range to show client details for where 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Defaults to 3H
sort (FIXME) – Field to sort on. Defaults to mac
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default 1000, max 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_wireless_clients(group: str | None = None, swarm_id: str | None = None, label: str | None = None, site: str | None = None, network: str | None = None, serial: str | None = None, os_type: str | None = None, cluster_id: str | None = None, band: str | None = None, fields: str | None = None, calculate_total: bool = True, client_status: Literal['FAILED_TO_CONNECT', 'CONNECTED'] = 'CONNECTED', past: str = '3H', offset: int = 0, limit: int = 1000) Response¶
List Wireless Clients.
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID
label (str, optional) – Filter by Label name
site (str, optional) – Filter by Site name
network (str, optional) – Filter by network name
serial (str, optional) – Filter by AP serial number
os_type (str, optional) – Filter by client os type
cluster_id (str, optional) – Filter by Mobility Controller serial number
band (str, optional) – Filter by band. Value can be either “2.4” or “5”
fields (str, optional) – Comma separated list of fields to be returned. Valid fields are name, ip_address, username, os_type, connection, associated_device, group_name, swarm_id, network, radio_mac, manufacturer, vlan, encryption_method, radio_number, speed, usage, health, labels, site, signal_strength, signal_db, snr
calculate_total (bool, optional) – Whether to calculate total wireless Clients
client_status (Literal["FAILED_TO_CONNECT", "CONNECTED"], optional) – Return clients that are connected, or clients that have failed to connect. Defaults to CONNECTED.
past – (str, optional): Time-range to show client details for where 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Defaults to 3H
offset (int, optional) – Pagination offset Defaults to 0.
limit (int, optional) – Pagination limit. Default is 1000, max 1000.
- Returns:
CentralAPI Response object
- Return type:
- async get_wlan(group: str, wlan_name: str) Response¶
Get the information of an existing WLAN.
- Parameters:
group (str) – Group name of the group or guid of the swarm. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
wlan_name (str) – Name of WLAN selected. Example:wlan_1.
- Returns:
CentralAPI Response object
- Return type:
- async get_wlan_cluster_by_group(group_name: str, ssid: str) Response¶
Retrieve Cluster mapping for given group/SSID.
- Parameters:
group_name (str) – The name of the group.
ssid (str) – Wlan ssid name
- Returns:
CentralAPI Response object
- Return type:
- async get_wlans(name: str | None = None, group: str | None = None, swarm_id: str | None = None, label: str | None = None, site: str | None = None, calculate_client_count: bool | None = None, sort_by: str | None = None) Response¶
List all WLANs (SSIDs).
- Parameters:
group (str, optional) – Filter by group name
swarm_id (str, optional) – Filter by Swarm ID
label (str, optional) – Filter by Label name
site (str, optional) – Filter by Site name
calculate_client_count (bool, optional) – Whether to calculate client count per SSID
sort_by (str, optional) – Sort parameter may be one of +essid, -essid. Default is ‘+essid’
- Returns:
CentralAPI Response object
- Return type:
- async kick_users(serial: str | None = None, *, kick_all: bool = False, mac: str | None = None, ssid: str | None = None) Response¶
- async move_devices_to_group(group: str, serials: str | List[str], *, cx_retain_config: bool = True) Response¶
Move devices to a group.
- Parameters:
group (str) – Group Name to move device to.
serials (str | List[str]) – Serial numbers of devices to be added to group.
- Returns:
CentralAPI Response object
- Return type:
- async move_devices_to_site(site_id: int, serials: str | List[str], device_type: Literal['ap', 'gw', 'switch', 'sdwan']) Response¶
Associate list of devices to a site.
- Parameters:
site_id (int) – Site ID
device_type (str) – Device type. Valid Values: ap, gw switch
serials (str | List[str]) – List of device serial numbers of the devices to which the site has to be un/associated with. A maximum of 5000 device serials are allowed at once.
- Returns:
CentralAPI Response object
- Return type:
- async preprovision_device_to_group(group: str, serials: str | List[str], tenant_id: str | None = None) Response¶
Pre Provision devices to group.
- Parameters:
group (str) – Group name
serials (str | List[str]) – serial numbers
tenant_id (str) – Tenant id, (only applicable with MSP mode)
- Returns:
CentralAPI Response object
- Return type:
- async refresh_webhook_token(wid: str) Response¶
Refresh the webhook token.
- Parameters:
wid (str) – id of the webhook
- Returns:
CentralAPI Response object
- Return type:
- async remove_devices_from_site(site_id: int, serials: List[str], device_type: Literal['ap', 'gw', 'switch', 'sdwan']) Response¶
Remove a list of devices from a site.
- Parameters:
site_id (int) – Site ID
serials (str | List[str]) – List of device serial numbers of the devices to which the site has to be un/associated with. A maximum of 5000 device serials are allowed at once.
device_type (Literal['ap', 'gw', 'switch']) – Device type. Valid Values: ap, gw, switch.
- Returns:
CentralAPI Response object
- Return type:
- async remove_label_from_devices(label_id: int, serials: str | List[str], device_type: Literal['ap', 'gw', 'switch', 'sdwan']) Response¶
unassign a label from a list of devices.
- Parameters:
label_id (int) – Label ID
serials (str | List[str]) – List of device serial numbers of the devices to which the label has to be un/associated with. A maximum of 5000 device serials are allowed at once.
device_type (Literal['ap', 'gw', 'switch']) – Device type. Valid Values: ap, gw, switch.
- Returns:
CentralAPI Response object
- Return type:
- async replace_ap_config(group_name_or_guid: str, clis: List[str]) Response¶
Replace AP Group Level configuration for UI group.
Send AP configuration in CLI format as a list of strings where each item in the list is a line from the config. Requires all lines of the config, not a partial update.
- Parameters:
group_name_or_guid (str) – Group name of the group or guid of the swarm. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
clis (List[str]) – Whole configuration List in CLI format.
- Returns:
CentralAPI Response object
- Return type:
- async replace_per_ap_config(serial: str, clis: List[str]) Response¶
Replace per AP setting.
- Parameters:
serial (str) – Serial Number of AP
clis (List[str]) – All per AP setting List in CLI format Must provide all per AP settings, not partial
- Returns:
CentralAPI Response object
- Return type:
- async reset_overlay_connection(device: str) Response¶
Reset overlay control connection.
- Parameters:
device (str) – Device serial number
- Returns:
CentralAPI Response object
- Return type:
- async run_speedtest(serial: str, host: str = 'ndt-iupui-mlab1-den04.mlab-oti.measurement-lab.org', options: str | None = None) Response¶
Run speedtest from device (gateway only)
- Parameters:
serial (str) – Serial of device
host (str, Optional) – Speed-Test server IP address, Defaults to server in Central Indiana.
options (str) – Formatted string of optional arguments
- Returns:
CentralAPI Response object
- Return type:
- async send_bounce_command_to_device(serial: str, command: str, port: str) Response¶
Bounce interface or POE (power-over-ethernet) on switch port. Valid only for Aruba Switches.
- Parameters:
serial (str) – Serial of device
command (str) – Command mentioned in the description that is to be executed
port (str) – Specify interface port in the format of port number for devices of type HPPC Switch or slot/chassis/port for CX Switch
- Returns:
CentralAPI Response object
- Return type:
- async send_command_to_device(serial: str, command: Literal['reboot', 'blink_led_on', 'blink_led_off', 'blink_led', 'erase_configuration', 'save_configuration', 'halt', 'config_sync'], duration: int | None = None) Response¶
Generic commands for device.
- Supported Commands (str):
reboot: supported by AP/gateways/MAS Switches/Aruba Switches
blink_led_on: Use this command to enable the LED display, supported by IAP/Aruba Switches
blink_led_off: Use this command to enable the LED display, supported by IAP/Aruba Switches
blink_led: Use this command to blink LED display, Supported on Aruba Switches
erase_configuration : Factory default the switch. Supported on Aruba Switches
save_configuration: Saves the running config. supported by IAP/Aruba Switches
halt : This command performs a shutdown of the device, supported by Controllers alone.
config_sync : This commands performs full refresh of the device config, supported by Controllers alone
- Parameters:
serial (str) – Serial of device
command (str) – Command to be executed
duration (int, Optional) – Number of seconds to blink_led only applies to blink_led and blink_led_on
- Returns:
CentralAPI Response object
- Return type:
- async send_command_to_swarm(swarm_id: str, command: Literal['reboot', 'erase_configuration']) Response¶
Generic commands for swarm.
- Parameters:
swarm_id (str) – Swarm ID of device
command (str) – Command mentioned in the description that is to be executed valid: ‘reboot’, ‘erase_configuration’
- Returns:
CentralAPI Response object
- Return type:
- async set_firmware_compliance(device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'], group: str, version: str, compliance_scheduled_at: int, reboot: bool = True, allow_unsupported_version: bool = False) Response¶
Set Firmware Compliance version (for group/device-type).
- Parameters:
device_type (str) – Specify one of “ap|sw|cx|gw”
group (str) – Group name
firmware_compliance_version (str) – Firmware compliance version for specific device_type.
compliance_scheduled_at (int) – Firmware compliance will be schedule at, compliance_scheduled_at - current time. compliance_scheduled_at is epoch in seconds and default value is current time.
reboot (bool) – Use True for auto reboot after successful firmware download. Default value is False. Applicable only on MAS, aruba switches, CX switches, and controller since IAP reboots automatically after firmware download.
allow_unsupported_version (bool) – Use True to set unsupported version as firmware compliance version for specific device_type. Default is False.
- Returns:
CentralAPI Response object
- Return type:
- async start_ts_session(serial: str, device_type: constants.DeviceTypes, commands: int | List[int, dict] | dict) Response¶
Start Troubleshooting Session.
- Parameters:
serial (str) – Serial of device
device_type (Literal['ap', 'cx', 'sw', 'gw']) – Device Type.
commands (int | List[int, dict] | dict) – a single command_id, or a List of command_ids (For commands with no arguments) OR a dict {command_id: {argument1_name: argument1_value, argument2_name: argument2_value}}
- Returns:
CentralAPI Response object
- Return type:
- static strip_none(_dict: dict | None) dict | None¶
strip all keys from a dict where value is NoneType
- async test_webhook(wid: str) Response¶
Test for webhook notification.
- Parameters:
wid (str) – id of the webhook
- Returns:
CentralAPI Response object
- Return type:
- async unarchive_devices(serials: List[str]) Response¶
Unarchive devices using Serial list.
- Parameters:
serials (List[str]) – serials
- Returns:
CentralAPI Response object
- Return type:
- async unassign_licenses(serials: str | List[str], services: str | List[str]) Response¶
Unassign subscription(s) from device(s).
- Parameters:
serials (str | List[str]) – List of serial number of device.
services (str | List[str]) – List of service names. Call services/config API to get the list of valid service names.
- Returns:
CentralAPI Response object
- Return type:
- async update_ap_settings(serial: str, hostname: str | None = None, ip_address: str | None = None, zonename: str | None = None, achannel: str | None = None, atxpower: str | None = None, gchannel: str | None = None, gtxpower: str | None = None, dot11a_radio_disable: bool | None = None, dot11g_radio_disable: bool | None = None, usb_port_disable: bool | None = None) Response¶
Update an existing ap settings.
- Parameters:
serial (str) – AP Serial Number
hostname (str, optional) – hostname
ip_address (str, optional) – ip_address Default (DHCP)
zonename (str, optional) – zonename. Default “” (No Zone)
achannel (str, optional) – achannel
atxpower (str, optional) – atxpower
gchannel (str, optional) – gchannel
gtxpower (str, optional) – gtxpower
dot11a_radio_disable (bool, optional) – dot11a_radio_disable
dot11g_radio_disable (bool, optional) – dot11g_radio_disable
usb_port_disable (bool, optional) – usb_port_disable
- Returns:
CentralAPI Response object
- Return type:
- async update_ap_system_config(scope: str, dns_server: str | None = None, ntp_server: List[str] | None = None, username: str | None = None, password: str | None = None) Response¶
Update system config.
All params are required by Aruba Central
- Parameters:
scope (str) – Group name of the group or swarm_id. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f.
dns_server (str) – DNS server IPs or domain name
ntp_server (List[str]) – List of ntp server, Example: [“192.168.1.1”, “127.0.0.0”, “xxx.com”]. IPs or domain name.
username (str) – username
password (str) – password
- Returns:
CentralAPI Response object
- Return type:
- async update_cx_properties(*, serial: str | None = None, group: str | None = None, name: str | None = None, contact: str | None = None, location: str | None = None, timezone: Literal['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/North', 'Australia/NSW', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'CET', 'Chile/Continental', 'Chile/EasterIsland', 'CST6CDT', 'Cuba', 'EET', 'Egypt', 'Eire', 'EST', 'EST5EDT', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/Universal', 'Etc/UTC', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'Factory', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'Hongkong', 'HST', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'MST', 'MST7MDT', 'Navajo', 'NZ', 'NZ-CHAT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'PRC', 'PST8PDT', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'Universal', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'W-SU', 'WET', 'Zulu'] | None = None, mgmt_vrf: bool | None = None, dns_servers: List[str] = [], ntp_servers: List[str] = [], admin_user: str | None = None, admin_pass: str | None = None) Response¶
Update Properties (ArubaOS-CX).
- Parameters:
serial (str, optional) – Device serial number. Mandatory for device level configuration. 1 and only 1 of serial or group are required
group (str, optional) – Group name. Mandatory for group level configuration. 1 and only 1 of serial or group are required
name (str) – Only configurable at device-level.
contact (str) – Pattern: “^[^”?]*$”
location (str) – Pattern: “^[^”?]*$”
timezone (str) – timezone Valid Values: use tz database format like “America/Chicago”
mgmt_vrf (bool) – Use mgmt VRF, indicates VRF for dns_servers and ntp_servers, if False or not provided default VRF is used.
dns_servers (List[str]) – ipv4/ipv6 address
ntp_servers (List[str]) – ipv4/ipv6 address
admin_user (str) – local admin user
admin_pass (str) – local admin password
- Returns:
CentralAPI Response object
- Return type:
- async update_device_template_variables(serial: str, mac: str, var_dict: dict) Response¶
Update template variables for a device.
- Parameters:
serial (str) – Serial number of the device.
mac (str) – MAC address of the device.
var_dict (dict) – dict with variables to be updated
- Returns:
CentralAPI Response object
- Return type:
- async update_existing_template(group: str, name: str, payload: str | None = None, template: Path | str | bytes | None = None, device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] = 'ap', version: str = 'ALL', model: str = 'ALL') Response¶
Update existing template.
- Parameters:
group (str) – Name of the group for which the template is to be updated.
name (str) – Name of template.
device_type (str, optional) – Device type of the template. Valid Values: ap, sw (ArubaOS-SW), cx (ArubaOS-CX), gw (controllers/gateways)
version (str, optional) – Firmware version property of template. Example: ALL, 6.5.4 etc. Defaults to “ALL”.
model (str, optional) – Model property of template. For ‘ArubaSwitch’ device_type, part number (J number) can be used for the model. Example: 2920, J9727A etc. Defaults to “ALL”.
template (Path | str | bytes, optional) – Template text. For ‘ArubaSwitch’ device_type, the template text should include the following commands to maintain connection with central. 1. aruba-central enable. 2. aruba-central url https://<URL | IP>/ws.
payload (str, optional) – template data passed as str. One of template or payload is required.
- Returns:
CentralAPI Response object
- Return type:
- async update_group_name(group: str, new_group: str) Response¶
Update group name for the given group.
- Parameters:
group (str) – Group for which name need to be updated.
new_group (str) – The new name of the group.
- Returns:
CentralAPI Response object
- Return type:
- async update_group_properties(group: str, allowed_types: AllDevTypes | List[AllDevTypes] | None = None, wired_tg: bool | None = None, wlan_tg: bool | None = None, aos10: bool | None = None, microbranch: bool | None = None, gw_role: GatewayRole | None = None, monitor_only_sw: bool | None = None, monitor_only_cx: bool | None = None) Response¶
Update properties for the given group.
// Used by update group //
The update of persona and configuration mode set for existing device types is not permitted.
Can update from standard AP to MicroBranch, but can’t go back
Can update to AOS10, but can’t go back
Can Add Allowed Device Types, but can’t remove.
Can Add Allowed Switch Types, but can’t remove.
Can only change mon_only_sw and wired_tg when adding switches (cx, sw) to allowed_device_types
- Parameters:
group (str) – Group Name
allowed_types (str, List[str]) – Allowed Device Types in the group. Tabs for devices not allowed won’t display in UI. valid values “ap”, “gw”, “cx”, “sw”, “switch” (“switch” is generic, will enable both cx and sw)
wired_tg (bool, optional) – Set to true if wired(Switch) configuration in a group is managed using templates.
wlan_tg (bool, optional) – Set to true if wireless(IAP, Gateways) configuration in a group is managed using templates.
aos10 – (bool): if True use AOS10 architecture for the access points and gateways in the group. default False (Instant)
microbranch (bool) – True to enable Microbranch network role for APs is applicable only for AOS10 architecture.
gw_role (GatewayRole) – Gateway role valid values “branch”, “vpnc”, “wlan” (“wlan” only valid on AOS10 group)
monitor_only_sw – Monitor only ArubaOS-SW switches, applies to UI group only
monitor_only_cx – Monitor only ArubaOS-CX switches, applies to UI group only
- Returns:
CentralAPI Response object
- Return type:
- async update_site(site_id: int, site_name: str, address: str | None = None, city: str | None = None, state: str | None = None, zipcode: str | None = None, country: str | None = None, latitude: str | None = None, longitude: str | None = None) Response¶
Update Site.
Provide geo-loc or address details, not both. Can provide both in subsequent calls, but apigw does not allow both in same call.
- Parameters:
site_id (int) – Site ID
site_name (str) – Site Name
address (str) – Address
city (str) – City Name
state (str) – State Name
zipcode (str) – Zipcode
country (str) – Country Name
latitude (str) – Latitude (in the range of -90 and 90)
longitude (str) – Longitude (in the range of -180 and 180)
- Returns:
CentralAPI Response object
- Return type:
- async update_visitor(portal_id: str, visitor_id: str, name: str, company_name: str | None = None, phone: str | None = None, email: str | None = None, is_enabled: bool | None = None, valid_till_no_limit: bool | None = None, valid_till_days: int | None = None, valid_till_hours: int | None = None, valid_till_minutes: int | None = None, notify: bool | None = None, notify_to: Literal['email', 'phone'] | None = None, password: str | None = None) Response¶
Update guest visitor account.
- Parameters:
portal_id (str) – Portal ID of the splash page
visitor_id (str) – Visitor ID of the portal
name (str) – Visitor account name
company_name (str) – Company name of the visitor
phone (str) – Phone number of the visitor; Format [+CountryCode][PhoneNumber]
email (str) – Email address of the visitor
is_enabled (bool) – Enable or disable the visitor account
valid_till_no_limit (bool) – Visitor account will not expire when this is set to true
valid_till_days (int) – Account validity in days
valid_till_hours (int) – Account validity in hours
valid_till_minutes (int) – Account validity in minutes
notify (bool) – Flag to notify the password via email or number
notify_to (str) – Notify to email or phone. Defualt is phone when it is provided otherwise email. Valid Values: email, phone
password (str) – Password
- Returns:
CentralAPI Response object
- Return type:
- async update_webhook(wid: str, name: str, urls: List[str]) Response¶
Update webhook settings.
- Parameters:
wid (str) – id of the webhook
name (str) – name of the webhook
urls (List[str]) – List of webhook urls
- Returns:
CentralAPI Response object
- Return type:
- async update_wlan(scope: str, wlan_name: str, essid: str | None = None, type: str | None = None, hide_ssid: bool | None = None, vlan: str | None = None, zone: str | None = None, wpa_passphrase: str | None = None, is_locked: bool | None = None, captive_profile_name: str | None = None, bandwidth_limit_up: str | None = None, bandwidth_limit_down: str | None = None, bandwidth_limit_peruser_up: str | None = None, bandwidth_limit_peruser_down: str | None = None, access_rules: list | None = None) Response¶
Update an existing WLAN and clean up unsupported fields.
- Parameters:
scope (str) – Group name of the group or guid of the swarm or serial number of 10x AP. Example:Group_1 or 6a5d123b01f9441806244ea6e023fab5841b77c828a085f04f or CNF7JSS9L1.
wlan_name (str) – Name of WLAN selected. Example:wlan_1.
essid (str) – essid
type (str) – type Valid Values: employee, guest
hide_ssid (bool) – hide_ssid
vlan (str) – vlan
zone (str) – zone
wpa_passphrase (str) – wpa_passphrase
wpa_passphrase_changed (bool) – wpa_passphrase_changed
is_locked (bool) – is_locked
captive_profile_name (str) – captive_profile_name
bandwidth_limit_up (str) – bandwidth_limit_up
bandwidth_limit_down (str) – bandwidth_limit_down
bandwidth_limit_peruser_up (str) – bandwidth_limit_peruser_up
bandwidth_limit_peruser_down (str) – bandwidth_limit_peruser_down
access_rules (list) – access_rules
- Returns:
CentralAPI Response object
- Return type:
- async upgrade_firmware(scheduled_at: int | None = None, swarm_id: str | None = None, serial: str | None = None, group: str | None = None, device_type: Literal['ap', 'cx', 'sw', 'gw', 'sdwan'] | None = None, firmware_version: str | None = None, model: str | None = None, reboot: bool = False) Response¶
Initiate firmware upgrade on device(s).
You can only specify one of device_type, swarm_id or serial parameters
// Used by upgrade [device|group|swarm] //
- Parameters:
scheduled_at (int, optional) – When to schedule upgrade (epoch seconds). Defaults to None (Now).
swarm_id (str, optional) – Upgrade a specific swarm by id. Defaults to None.
serial (str, optional) – Upgrade a specific device by serial. Defaults to None.
group (str, optional) – Upgrade devices belonging to group. Defaults to None.
device_type (Literal["ap", "gw", "cx", "sw"]) – Type of device to upgrade. Defaults to None.
firmware_version (str, optional) – Version to upgrade to. Defaults to None(recommended version).
model (str, optional) – To initiate upgrade at group level for specific model family. Applicable only for Aruba switches. Defaults to None.
reboot (bool, optional) – Automatically reboot device after firmware download. Defaults to False.
- Returns:
CentralAPI Response object
- Return type:
- async upload_certificate(passphrase: str = '', cert_file: str | Path | None = None, cert_name: str | None = None, cert_format: Literal['PEM', 'DER', 'PKCS12'] | None = None, cert_data: str | None = None, server_cert: bool = False, ca_cert: bool = False, crl: bool = False, int_ca_cert: bool = False, ocsp_resp_cert: bool = False, ocsp_signer_cert: bool = False, ssh_pub_key: bool = False) Response¶
Upload a certificate.
- Parameters:
passphrase (str) – passphrase
cert_file (Path|str, optional) – Cert file to upload, if file is provided cert_name and cert_format will be derived from file name / extension, unless those params are also provided.
cert_name (str, optional) – The name of the certificate.
cert_format (Literal["PEM", "DER", "PKCS12"], optional) – cert_format Valid Values: PEM, DER, PKCS12
cert_data (str, optional) – Certificate content encoded in base64 for all format certificates.
server_cert (bool, optional) – Set to True if cert is a server certificate. Defaults to False.
ca_cert (bool, optional) – Set to True if cert is a CA Certificate. Defaults to False.
crl (bool, optional) – Set to True if data is a certificate revocation list. Defaults to False.
int_ca_cert (bool, optional) – Set to True if certificate is an intermediate CA cert. Defaults to False.
ocsp_resp_cert (bool, optional) – Set to True if certificate is an OCSP responder cert. Defaults to False.
ocsp_signer_cert (bool, optional) – Set to True if certificate is an OCSP signer cert. Defaults to False.
ssh_pub_key (bool, optional) – Set to True if certificate is an SSH Pub key. Defaults to False. ssh_pub_key needs to be in PEM format, ssh-rsa is not supported.
- Raises:
ValueError – Raised if invalid combination of arguments is provided.
- Returns:
CentralAPI Response object
- Return type:
- async verify_device_addition(serial: str | None = None, mac: str | None = None, device_list: List[Dict[Literal['serial', 'mac'], str]] = []) Response¶
Verify Device Addition
- Parameters:
serial (str, optional) – Serial Number of device to verify. Defaults to None.
mac (str, optional) – Mac Address of device to verify. Defaults to None.
device_list (List[Dict[Literal[, optional) – device_list list of dicts with “serial” and “mac” for each device to verify. Defaults to None.
Must provide serial and mac for each device either via keyword argument or list.
- Returns:
CentralAPI Response object
- Return type:
- async wids_get_all(group: List[str] | None = None, label: List[str] | None = None, site: List[str] | None = None, swarm_id: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
List all wids classifications.
- Parameters:
group (List[str], optional) – List of group names
label (List[str], optional) – List of label names
site (List[str], optional) – List of site names
swarm_id (str, optional) – Filter by Swarm ID
from_time (int | float | datetime, optional) – Start of timerange to collect data for. Default is now minus 3 hours
to_time (int | float | datetime, optional) – End of timerange to collect data for. Default is current time.
offset (int, optional) – Pagination offset (default = 0) Defaults to 0.
limit (int, optional) – pagination size (default = 100) Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async wids_get_interfering_aps(group: List[str] | None = None, label: List[str] | None = None, site: List[str] | None = None, swarm_id: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
List Interfering APs.
- Parameters:
group (List[str], optional) – List of group names
label (List[str], optional) – List of label names
site (List[str], optional) – List of site names
swarm_id (str, optional) – Filter by Swarm ID
from_time (int | float | datetime, optional) – Start of timerange to collect data for. Default is now minus 3 hours
to_time (int | float | datetime, optional) – End of timerange to collect data for. Default is current time.
offset (int, optional) – Pagination offset (default = 0) Defaults to 0.
limit (int, optional) – pagination size (default = 100) Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async wids_get_neighbor_aps(group: List[str] | None = None, label: List[str] | None = None, site: List[str] | None = None, swarm_id: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
List neighbor APs.
- Parameters:
group (List[str], optional) – List of group names
label (List[str], optional) – List of label names
site (List[str], optional) – List of site names
swarm_id (str, optional) – Filter by Swarm ID
from_time (int | float | datetime, optional) – Start of timerange to collect data for. Default is now minus 3 hours
to_time (int | float | datetime, optional) – End of timerange to collect data for. Default is current time.
offset (int, optional) – Pagination offset (default = 0) Defaults to 0.
limit (int, optional) – pagination size (default = 100) Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async wids_get_rogue_aps(group: List[str] | None = None, label: List[str] | None = None, site: List[str] | None = None, swarm_id: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
List Rogue APs.
- Parameters:
group (List[str], optional) – List of group names
label (List[str], optional) – List of label names
site (List[str], optional) – List of site names
swarm_id (str, optional) – Filter by Swarm ID
from_time (int | float | datetime, optional) – Start of timerange to collect data for. Default is now minus 3 hours
to_time (int | float | datetime, optional) – End of timerange to collect data for. Default is current time.
offset (int, optional) – Pagination offset (default = 0) Defaults to 0.
limit (int, optional) – pagination size (default = 100) Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- async wids_get_suspect_aps(group: List[str] | None = None, label: List[str] | None = None, site: List[str] | None = None, swarm_id: str | None = None, from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None, offset: int = 0, limit: int = 100) Response¶
List suspect APs.
- Parameters:
group (List[str], optional) – List of group names
label (List[str], optional) – List of label names
site (List[str], optional) – List of site names
swarm_id (str, optional) – Filter by Swarm ID
from_time (int | float | datetime, optional) – Start of timerange to collect data for. Default is now minus 3 hours
to_time (int | float | datetime, optional) – End of timerange to collect data for. Default is current time.
offset (int, optional) – Pagination offset (default = 0) Defaults to 0.
limit (int, optional) – pagination size (default = 100) Defaults to 100.
- Returns:
CentralAPI Response object
- Return type:
- centralcli.central.get_conn_from_file(account_name, logger: ~centralcli.logger.MyLogger = <centralcli.logger.MyLogger object>) ArubaCentralBase¶
Creates an instance of class`pycentral.ArubaCentralBase` based on config file.
- provided in the YAML/JSON config file:
keyword central_info: A dict containing arguments as accepted by class`pycentral.ArubaCentralBase`
keyword ssl_verify: A boolean when set to True, the python client validates Aruba Central’s SSL certs.
keyword token_store: Optional. Defaults to None.
- Parameters:
account_name (str) – Account name defined in the config file.
logger (MyLogger, optional) – log method. Defaults to log.
- Returns:
- An instance of class:pycentral.ArubaCentralBase,
Used to manage Auth and Tokens.
- Return type:
[pycentral.ArubaCentralBase]
- centralcli.central.silence_event_loop_closed(func)¶
centralcli.caas module¶
- class centralcli.caas.BuildCLI(central=None, data: dict | None = None)¶
Bases:
objectBuild equivalent cli commands for caas API from bulk-edit.csv import file
- build_cmds(data: dict | None = None, file: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/central-api-cli/checkouts/v7.2.7/config/bulkedit.csv')) list¶
- static get_bulkedit_data(filename: Path)¶
- class centralcli.caas.CaasAPI(central=None, data: dict | None = None, file: Path | None = None)¶
Bases:
BuildCLI- async send_commands(group_dev: str, cli_cmds: list | None = None)¶
- centralcli.caas.eval_caas_response(resp) None¶
centralcli.cache module¶
- class centralcli.cache.Cache(central: CentralApi | None = None, data: List[dict] | dict | None = None, refresh: bool = False)¶
Bases:
object- property LicenseTypes: LicenseTypes¶
- static account_completion(ctx: Context, args: List[str], incomplete: str)¶
- property all_tables: Generator[Table, None, None]¶
- audit_log_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for audit event logs.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Value and help_text for the event, or
Returns None if config is invalid
- property cache_clients_by_mac: Dict[str:Document]¶
All Clients by MAC connected within the last 90 days
This property is used by the cache to filter clients older than 90 days
- Returns:
Client Dict keyed by MAC with any clients last connected > 90 days ago filtered out.
- Return type:
Dict[str,Document]
- check_fresh(refresh: bool = False, site_db: bool = False, dev_db: bool = False, inv_db: bool = False, template_db: bool = False, group_db: bool = False, label_db: bool = False, license_db: bool = False, dev_type: Literal['ap', 'gw', 'switch', 'sdwan'] | None = None) List[Response]¶
- client_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for clients.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the client, or
Returns None if config is invalid
- property clients: list¶
- property clients_by_mac: Dict[str:Document]¶
- dev_ap_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for argument where only APs are valid.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_ap_gw_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Device completion that returns only ap and gw.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Yields Tuple with completion and help text, or
Returns None if config is invalid
- dev_ap_gw_sw_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Device completion for returning matches that are ap, gw, or AOS-SW
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_client_completion(ctx: Context, incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Completion for client output.
Returns only devices that apply based on filter provided in command, defaults to clients on both APs and switches (wires/wireless), but returns applicable devices if “wireless” or “wired” filter is used.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Tuple with completion and help text, or
Returns None if config is invalid
- dev_completion(incomplete: str, args: List[str] | None = None)¶
- dev_cx_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
- dev_gw_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for device idens where only gateways are valid.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_gw_switch_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
- dev_gw_switch_site_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
- dev_kwarg_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for commands that allow a list of devices followed by group/site.
i.e. cencli move dev1 dev2 dev3 site site_name group group_name
- Parameters:
ctx (typer.Context) – Provided automatically by typer
incomplete (str) – The incomplete word for autocompletion
args (List[str], optional) – The prev args passed into the command.
- Yields:
Generator[Tuple[str, str], None, None] –
- Matching completion string, help text, or
Returns None if config is invalid
- dev_site_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
- dev_sw_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
- dev_switch_ap_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Device completion for returning matches that are either switch or AP
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI.
- Yields:
Generator[Tuple[str, str], None, None] –
- Yields Tuple with completion and help text, or
Returns None if config is invalid
- dev_switch_by_type_completion(incomplete: str, args: List[str] = [], dev_type: Literal['cx', 'sw'] = 'cx') Generator[Tuple[str, str], None, None] | None¶
Device completion for returning matches that are of specific switch type (cx by default)
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_switch_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Device completion for returning matches that are switches (AOS-SW or CX)
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_switch_gw_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Device completion that returns only switches and gateways.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- dev_template_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
- property device_types: Set[str]¶
- property devices: list¶
- property devices_by_serial: Dict[str, Document]¶
- property event_ids: list¶
- event_log_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for events.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Value and help_text for the event, or
Returns None if config is invalid
- property events: list¶
- get_audit_log_identifier(query: str) str¶
- get_client_identifier(query_str: str, retry: bool = True, completion: bool = False, exit_on_fail: bool = False, silent: bool = False) CacheClient | List[CacheClient]¶
Search for Client in DB matching on name, ip or mac
Allows partial and case insensitive match
- get_dev_identifier(query_str: str | Iterable[str], dev_type: Literal['ap', 'cx', 'sw', 'switch', 'gw', 'sdwan'] | List[Literal['ap', 'cx', 'sw', 'switch', 'gw', 'sdwan']] | None = None, swack: bool = False, conductor_only: bool = False, retry: bool = True, completion: bool = False, silent: bool = False, include_inventory: bool = False, exit_on_fail: bool = True) CacheDevice | CacheInvDevice | List[CacheDevice | CacheInvDevice | None] | None¶
Get Devices from local cache, starting with most exact match, and progressively getting less exact.
If multiple matches are found user is promted to select device.
- Parameters:
query_str (str | Iterable[str]) – The query string or list of strings to attempt to match.
dev_type (Literal["ap", "cx", "sw", "switch", "gw"] | List[Literal["ap", "cx", "sw", "switch", "gw"]], optional) – Limit matches to specific device type. Defaults to None (all device types).
swack (bool, optional) – For switches only return the conductor switch that matches. For APs only return the VC of the swarm the match belongs to. Defaults to False. If swack=True devices that lack a swack_id (swarm_id | stack_id) are filtered (even if they match).
conductor_only (bool, optional) – Similar to swack, but only filters member switches of stacks, but will also return any standalone switches that match. Does not filter non stacks, the way swack option does. Defaults to False.
retry (bool, optional) – If failure to match should result in a cache update and retry. Defaults to True.
completion (bool, optional) – If this is being called for tab completion (Allows multiple matches, implies retry=False, silent=True, exit_on_fail=False). Defaults to False.
silent (bool, optional) – Do not display errors / output, simply returns match if match is found. Defaults to False.
include_inventory (bool, optional) – Whether match attempt should also include Inventory DB (devices in GLCP that have yet to connect to Central). Defaults to False.
exit_on_fail (bool, optional) – Whether a failure to match exits the program. Defaults to True.
- Raises:
typer.Exit – Exit CLI / command, occurs if there is no match unless exit_on_fail is set to False.
- Returns:
List of matching CentralObjects (devices, sites, groups …) that match query_str
- Return type:
CentralObject | List[CentralObject] | None
- get_devices_with_inventory(no_refresh: bool = False, inv_db: bool | None = None, dev_db: bool | None = None, dev_type: Literal['ap', 'gw', 'switch', 'sdwan'] | None = None, status: Literal['up', 'down'] | None = None) List[Response] | Response¶
Returns List of Response objects with data from Inventory and Monitoring
- Parameters:
no_refresh (bool, optional) – Used currently cached data, skip refresh of cache. Refresh will only occur if cache was not updated during this session. Setting no_refresh to True means it will not occur regardless. Defaults to False.
inv_db (bool, optional) – Update inventory cache. Defaults to None.
dev_db (bool, optional) – Update device (monitoring) cache. Defaults to None.
dev_type (Literal['ap', 'gw', 'switch'], optional) – Filter devices by type: Valid Types: ‘ap’, ‘gw’, ‘switch’. ‘cx’ and ‘sw’ also accepted, both will result in ‘switch’ which includes both types. Defalts to None (no Filter/All device types).
status (Literal 'up', 'down', optional) – Filter results by status. Inventory only devices (have never checked in, so lack status) are retained. Defaults to None.
- Returns:
- Response objects where output is list of dicts with
data from Inventory and Monitoring.
- Return type:
List[Response]
- get_event_log_identifier(query: str) dict¶
Get event log details based on identifier.
- Parameters:
query (str) – The short event log id, generated anytime show logs is ran for any events that have details.
- Raises:
typer.Exit – If unable to find id, or the id is not a valid type
- Returns:
Dictionary containing event log details.
- Return type:
dict
- get_group_identifier(query_str: str, retry: bool = True, completion: bool = False, silent: bool = False, exit_on_fail: bool = True) CacheGroup | List[CacheGroup]¶
Allows Case insensitive group match
- async get_hooks_by_serial(serial)¶
- get_identifier(qry_str: str, qry_funcs: Sequence[str], device_type: str | List[str] | None = None, swack: bool = False, conductor_only: bool = False, group: str | List[str] | None = None, all: bool = False, completion: bool = False) CentralObject | List[CentralObject]¶
Get Identifier when iden type could be one of multiple types. i.e. device or group
- Parameters:
qry_str (str) – The query string provided by user.
qry_funcs (Sequence[str]) – Sequence of strings “dev”, “group”, “site”, “template”
device_type (Union[str, List[str]], optional) – Restrict matches to specific dev type(s). Defaults to None.
swack (bool, optional) – Restrict matches to only the stack commanders matching query (filter member switches). Defaults to False.
conductor_only (bool, optional) – Similar to swack, but only filters member switches of stacks, but will also return any standalone switches that match. Does not filter non stacks, the way swack option does. Defaults to False.
group (str, List[str], optional) – applies to get_template_identifier, Only match if template is in provided group(s). Defaults to None.
all (bool, optional) – For use in completion, adds keyword “all” to valid completion.
completion (bool, optional) – If function is being called for AutoCompletion purposes. Defaults to False. When called for completion it will fail silently and will return multiple when multiple matches are found.
- Raises:
typer.Exit – If not ran for completion, and there is no match, exit with code 1.
- Returns:
CentralObject or list[CentralObject, …]
- get_label_identifier(query_str: str, retry: bool = True, completion: bool = False, silent: bool = False, exit_on_fail: bool = True) CacheLabel | List[CacheLabel] | None¶
Allows Case insensitive label match
- get_mpsk_identifier(query_str: str, retry: bool = True, completion: bool = False, silent: bool = False) CacheMpskNetwork | List[CacheMpskNetwork]¶
Allows Case insensitive ssid match
- get_name_id_identifier(cache_name: Literal['dev', 'site', 'template', 'group', 'label', 'mpsk', 'portal'], query_str: str, retry: bool = True, completion: bool = False, silent: bool = False) CachePortal | List[CachePortal] | CacheLabel | List[CacheLabel]¶
- get_site_identifier(query_str: str | List[str] | tuple, retry: bool = True, completion: bool = False, silent: bool = False, exit_on_fail: bool = True) CacheSite | List[CacheSite]¶
- get_template_identifier(query_str: str, group: str | List[str] | None = None, retry: bool = True, completion: bool = False, silent: bool = False) CacheTemplate | List[CacheTemplate]¶
Allows case insensitive template match by template name
- group_completion(incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Completion for groups (by name).
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the group, or
Returns None if config is invalid
- group_dev_ap_gw_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for argument that can be either group or device.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- group_dev_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for argument that can be either group or device.
- Parameters:
ctx (typer.Context) – The click/typer Context.
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] | None –
- Name and help_text for the device, or
Returns None if config is invalid
- group_dev_gw_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for argument that can be either group or a gateway.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- property group_names: list¶
- property groups: list¶
- property groups_by_name: Dict[str:CacheGroup]¶
- handle_multi_match(match: List[CentralObject] | List[Client], query_str: str | None = None, query_type: str = 'device') List[Dict[str, Any]]¶
- property hook_active: list¶
- property hook_config: list¶
- property hook_data: list¶
- property inventory: list¶
- property inventory_by_serial: Dict[str, Document]¶
- is_central_license(license: str) bool¶
- property key_tables: Generator[Table, None, None]¶
- label_completion(ctx: Context, incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Completion for labels.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the label, or
Returns None if config is invalid
- property label_names: list¶
- property labels: list¶
- property labels_by_name: Dict[str:CacheLabel]¶
- property license_names: list¶
- property licenses: List[str]¶
- property logs: list¶
- method_test_completion(incomplete: str, args: List[str] = [])¶
- property mpsk: list¶
- mpsk_completion(ctx: Context, incomplete: str, args: List[str] | None = None)¶
- null_completion(incomplete: str, args: List[str] | None = None)¶
- portal_completion(ctx: Context, incomplete: str, args: List[str] | None = None)¶
- property portals: list¶
- property portals_by_id: Dict[str, Dict[str, str | bool]]¶
- async refresh_client_db(client_type: Literal['wired', 'wireless', 'all'] | None = None, group: str | None = None, swarm_id: str | None = None, label: str | None = None, network: str | None = None, site: str | None = None, serial: str | None = None, os_type: str | None = None, stack_id: str | None = None, cluster_id: str | None = None, band: str | None = None, mac: str | None = None, client_status: Literal['FAILED_TO_CONNECT', 'CONNECTED'] = 'CONNECTED', past: str = '3H') Response¶
refresh client DB
all args are passed to central.get_clients, Local Cache is updated with any results. Local Cache retains clients connected within last 90 days.
It returns the raw data from the API with whatever filters were provided by the user then updates the db with the data returned
- Parameters:
client_type (Literal['wired', 'wireless', 'all'], optional) – Client type to retrieve. Defaults to None. if not provided all client types will be returned, unless a filter specific to a client type is specified. i.e. providing band will result in WLAN clients.
group (str, optional) – Filter by Group. Defaults to None.
swarm_id (str, optional) – Filter by swarm. Defaults to None.
label (str, optional) – Filter by label. Defaults to None.
network (str, optional) – Filter by WLAN SSID. Defaults to None.
site (str, optional) – Filter by site. Defaults to None.
serial (str, optional) – Filter by connected device serial. Defaults to None.
os_type (str, optional) – Filter by client OS type. Defaults to None.
stack_id (str, optional) – Filter by Stack ID. Defaults to None.
cluster_id (str, optional) – Filter by Cluster ID. Defaults to None.
band (str, optional) – Filter by band. Defaults to None.
mac (str, optional) – Filter by client MAC. Defaults to None.
client_status (Literal["FAILED_TO_CONNECT", "CONNECTED"], optional) – Return clients that are connected, or clients that have failed to connect. Defaults to CONNECTED.
past – (str, optional): Time-range to show client details for. Format: 3H = 3 Hours, 1D = 1 Day, 1W = 1 Week, 1M = 1Month, 3M = 3Months. Defaults to 3H
Past users are always retained, unless truncate=True
- async refresh_dev_db(dev_type: Literal['ap', 'gw', 'switch', 'sdwan'] | List[Literal['ap', 'gw', 'switch', 'sdwan']] | None = None, group: str | None = None, site: str | None = None, label: str | None = None, serial: str | None = None, mac: str | None = None, model: str | None = None, stack_id: str | None = None, swarm_id: str | None = None, cluster_id: str | None = None, public_ip_address: str | None = None, status: Literal['up', 'down'] | None = None, show_resource_details: bool = True, calculate_client_count: bool = True, calculate_ssid_count: bool = False, fields: list | None = None, offset: int = 0, limit: int = 1000) CombinedResponse¶
Get all devices from Aruba Central, and refresh local cache.
- Parameters:
dev_type (Literal['ap', 'gw', 'cx', 'sw', 'sdwan', 'switch'], optional) – Device Types to Update. Defaults to None.
group (str, optional) – Filter by devices in a Group. Defaults to None.
site (str, optional) – Filter by devices in a Site. Defaults to None.
label (str, optional) – Filter by devices with a label assigned. Defaults to None.
serial (str, optional) – Filter by Serial. Defaults to None.
mac (str, optional) – Filter by mac. Defaults to None.
model (str, optional) – Filter by model. Defaults to None.
stack_id (str, optional) – Filter by stack id (switches). Defaults to None.
swarm_id (str, optional) – Filter by swarm id (APs). Defaults to None.
cluster_id (str, optional) – Filter by cluster id. Defaults to None.
public_ip_address (str, optional) – Filter by public ip. Defaults to None.
status (constants.DeviceStatus, optional) – Filter by status. Defaults to None.
show_resource_details (bool, optional) – Show device resource utilization details. Defaults to True.
calculate_client_count (bool, optional) – Calculate client count. Defaults to True.
calculate_ssid_count (bool, optional) – Calculate SSID count. Defaults to False.
fields (list, optional) – fields to return. Defaults to None.
offset (int, optional) – pagination offset. Defaults to 0.
limit (int, optional) – pagination limit max 1000. Defaults to 1000.
- Returns:
CombinedResponse object.
- Return type:
- async refresh_inv_db(device_type: Literal['ap', 'gw', 'switch', 'all'] | None = None) Response¶
Get devices from device inventory, and Update device Cache with results.
- This combines the results from 2 API calls:
central.get_device_inventory: /platform/device_inventory/v1/devices
central.get_subscriptions: /platform/licensing/v1/subscriptions
- Parameters:
device_type (Literal['ap', 'gw', 'switch', 'all'], optional) – Device Type. Defaults to None = ‘all’ device types.
- Returns:
CentralAPI Response object
- Return type:
- async refresh_label_db() bool¶
- async refresh_license_db() Response¶
Update License DB
License DB stores the valid license names accepted by GreenLake/Central
- Returns:
CentralAPI Response Object
- Return type:
- remove_completion(incomplete: str, args: List[str]) Generator[Tuple[str, str], None, None] | None¶
- send_cmds_completion(ctx: Context, incomplete: str, args: List[str] = []) Generator[Tuple[str, str], None, None] | None¶
Completion for argument that can be either group, site, or a gateway or keyword “commands”.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to [].
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the device, or
Returns None if config is invalid
- site_completion(ctx: Context, incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
Completion for sites.
- Parameters:
incomplete (str) – The last partial or full command before completion invoked.
args (List[str], optional) – The previous arguments/commands on CLI. Defaults to None.
- Yields:
Generator[Tuple[str, str], None, None] –
- Name and help_text for the site, or
Returns None if config is invalid
- property sites: list¶
- property sites_by_id: list¶
- property size: str¶
- smg_kw_completion(ctx: Context, incomplete: str, args: List[str] = [])¶
- template_completion(incomplete: str, args: List[str] | None = None) Generator[Tuple[str, str], None, None] | None¶
- property templates: list¶
- property templates_by_name_group: list¶
- async update_db(db: Table, data: List[Dict[str, Any]] | Dict[str, Any] = None, doc_ids: List[int] | int = None, truncate: bool = True) bool¶
Update Local Cache DB
- Parameters:
db (Table) – TinyDB Table object to be updated.
data (List[Dict[str, Any]] | Dict[str, Any], optional) – Data to be added to database. Defaults to None.
truncate (bool, optional) – Existing DB data will be discarded, and all data in DB will be replaced with provided. Defaults to True.
doc_ids (List[int] | int, optional) – doc_ids to be deleted from the DB. Defaults to None.
- Returns:
_description_
- Return type:
bool
- async update_dev_db(data: List[Dict[str, Any]] | Dict[str, Any] | List[int] | int, *, remove: bool = False) bool¶
Update Device Database (local cache).
If data is provided it’s asumed to be a partial update. No devices will be removed from the cache unless remove=True.
- Parameters:
data (List[Dict[str, Any]] | Dict[str, Any] | List[int] | int) – Device data to update cache with. Existing devices are retained and updated with any changes from the new data provided.
remove (bool, optional) – Set True to remove devices from cache, data should be a list of doc_ids (int).
- Returns:
Returns bool indicating cache update success.
- Return type:
bool
- update_event_db(log_data: List[Dict[str, Any]]) bool¶
- async update_group_db(data: list | dict, remove: bool = False) bool¶
- update_hook_config_db(data: List[Dict[str, Any]], remove: bool = False) bool¶
- async update_hook_data_db(data: List[Dict[str, Any]]) bool¶
- async update_inv_db(data: List[Dict[str, Any]] | Dict[str, Any] | List[int] | int, *, remove: bool = False) bool¶
Update Inventory Database (local cache).
- Parameters:
data (List[Dict[str, Any]] | Dict[str, Any] | List[int] | int,) – Data to be updated in Inventory, Existing inventory data is retained, new data is added, any changes in existing device is updated.
remove (bool, optional) – Determines if update is to remove from cache. Defaults to False. data should be a list of doc_ids when removing from cache.
- Returns:
Returns bool indicating cache update success.
- Return type:
bool
- async update_label_db(data: List[Dict[str, Any]] | Dict[str, Any] | List[int], remove: bool = False) Response¶
- update_log_db(log_data: List[Dict[str, Any]]) bool¶
- async update_mpsk_db(data: List[Dict[str, Any]], remove: bool = False) bool¶
- async update_portal_db(data: List[Dict[str, Any]] | List[int], remove: bool = True) bool¶
- async update_site_db(data: List[Dict[str, str | int | float]] | Dict[str, str | int | float] | None = None, remove: bool = False) bool | None¶
- async update_template_db(data: Dict[str, str] | List[Dict[str, str]] | None = None, doc_ids: int | List[int] | None = None, add: bool = False)¶
- static verify_db_action(db: Table, *, expected: int, response: List[int | List[int]], remove: bool = False, elapsed: int | float = None) bool¶
Evaluate TinyDB Cache results (search/add/update/delete).
Verifies response from TinyDB lookup/update, logs and returns a bool indicating success/failure.
- Parameters:
db (CacheTable) – The TinyDB Table/Cache the update/lookup was peformed on.
expected (int) – The number of records that were expected.
response (List[int | List[int]]) – The update/lookup response from TinyDB
remove (bool, optional) – If the operation was a delete/remove
elapsed (int | float, optional) – Amount of time it took to update the cache.
- Returns:
Bool indicating if update was succesful.
- Return type:
bool
- class centralcli.cache.CacheAttributes(name: Literal['dev', 'site', 'template', 'group', 'label', 'mpsk', 'portal'], db: Table, already_updated_func: Callable, cache_update_func: Callable)¶
Bases:
object
- class centralcli.cache.CacheClient(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- get_group() CacheGroup¶
- property help_text: str¶
- class centralcli.cache.CacheDetails(cache=<class 'centralcli.cache.Cache'>)¶
Bases:
object
- class centralcli.cache.CacheDevice(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheGroup(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheInvDevice(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheLabel(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int | None¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheMpskNetwork(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- class centralcli.cache.CachePortal(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int | None¶
- static get_auth_types(auth_types: str) PortalAuthTypes¶
- property help_text¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheResponses(dev: CombinedResponse | None = None, inv: Response | None = None, site: Response | None = None, template: Response | None = None, group: Response | None = None, label: Response | None = None, mpsk: Response | None = None, portal: Response | None = None, license: Response | None = None, client: Response | None = None)¶
Bases:
object- property dev: CombinedResponse | None¶
- update_rl(resp: Response | CombinedResponse | None) Response | CombinedResponse | None¶
Returns provided Response object with the RateLimit info from the most recent API call.
- class centralcli.cache.CacheSite(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CacheTemplate(data: Document | Dict[str, Any])¶
Bases:
CentralObject- db: Table | None = None¶
- property doc_id: int | None¶
- classmethod set_db(db: Table)¶
- class centralcli.cache.CentralObject(db: Literal['dev', 'site', 'template', 'group', 'label', 'mpsk', 'portal'], data: Document | Dict[str, Any] | List[Document | Dict[str, Any]])¶
Bases:
object- property generic_type¶
- property help_text¶
- property is_aos10: bool¶
- property rich_help_text¶
- property summary_text¶
centralcli.cleaner module¶
Collection of functions used to clean output from Aruba Central API into a consistent structure.
- centralcli.cleaner.cloudauth_get_namedmpsk(data: List[Dict[str, Any]], verbosity: int = 0) List[Dict[str, Any]]¶
- centralcli.cleaner.cloudauth_upload_status(data: List[Dict[str, Any]] | Dict[str, Any]) Dict[str, Any]¶
- centralcli.cleaner.epoch_convert(func)¶
- centralcli.cleaner.get_alerts(data: List[dict]) List[dict]¶
- centralcli.cleaner.get_all_webhooks(data: List[dict]) List[dict]¶
- centralcli.cleaner.get_archived_devices(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_audit_logs(data: List[dict], cache_update_func: callable | None = None) List[dict]¶
- centralcli.cleaner.get_branch_health(data: list, down: bool = False, wan_down: bool = False) list¶
- centralcli.cleaner.get_certificates(data: Dict[str, Any]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_client_roaming_history(data: List[dict]) List[dict]¶
- centralcli.cleaner.get_clients(data: List[dict], verbosity: int = 0, cache: callable | None = None, filters: List[str] | None = None, format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] | None = None, **kwargs) list¶
- centralcli.cleaner.get_device_firmware_details(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_device_inventory(data: List[dict], sub: bool | None = None) List[dict]¶
- centralcli.cleaner.get_devices(data: List[dict] | dict, *, verbosity: int = 0, output_format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] | None = None) List[dict] | dict¶
Clean device output from Central API (Monitoring)
- Parameters:
data (Union[List[dict], dict]) – Response data from Central API
verbose (bool, optional) – Not Used yet. Defaults to True.
- Returns:
The cleaned data with consistent field heading, and human readable values.
- Return type:
Union[List[dict], dict]
- centralcli.cleaner.get_dhcp(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_event_logs(data: List[dict], cache_update_func: callable | None = None) List[dict]¶
- centralcli.cleaner.get_full_wlan_list(data: List[dict] | str | Dict, verbosity: int = 0, format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] = 'rich') List[dict]¶
- centralcli.cleaner.get_fw_version_list(data: List[dict], format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] = 'rich') List[dict]¶
- centralcli.cleaner.get_gw_tunnels(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_gw_uplinks_bandwidth(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_labels(data: List[dict] | Dict) list¶
- centralcli.cleaner.get_lldp_neighbor(data: List[Dict[str, str]]) Dict[str:Dict[str, str]]¶
- centralcli.cleaner.get_ospf_interface(data: List[dict] | dict) List[dict] | dict¶
- centralcli.cleaner.get_ospf_neighbor(data: List[dict] | dict) List[dict] | dict¶
- centralcli.cleaner.get_overlay_interfaces(data: List[dict] | dict) List[dict] | dict¶
- centralcli.cleaner.get_overlay_routes(data: List[dict] | dict, format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] = 'rich', simplify: bool = True) List[dict] | dict¶
- centralcli.cleaner.get_portal_profile(data: List[Dict[str, Any]]) Dict[str, Any]¶
- centralcli.cleaner.get_portals(data: List[dict]) List[dict]¶
- centralcli.cleaner.get_subscriptions(data: List[dict]) List[dict]¶
- centralcli.cleaner.get_swarm_firmware_details(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_switch_poe_details(data: List[Dict[str, Any]], verbosity: int = 0, powered: bool = False, aos_sw: bool = False) List[Dict[str, Any]]¶
- centralcli.cleaner.get_switch_stacks(data: List[Dict[str, str]], status: StatusOptions | None = None, stack_ids: List[str] | None = None)¶
- centralcli.cleaner.get_template_details_for_device(data: str) dict¶
Convert form-data response to dict
- Parameters:
data (str) – string data with summary and optionally running config
- Returns:
dict with summary(dict), running config(str) and central side config(str).
- Return type:
dict
- centralcli.cleaner.get_vlans(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.get_wlans(data: List[dict]) List[dict]¶
- centralcli.cleaner.parse_caas_response(data: dict | List[dict]) List[str]¶
Parses Response Object from caas API updates output attribute
- centralcli.cleaner.pre_clean(data: dict) dict¶
- centralcli.cleaner.routes(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
- centralcli.cleaner.short_key(key: str) str¶
- centralcli.cleaner.short_value(key: str, value: Any)¶
- centralcli.cleaner.show_all_ap_lldp_neighbors_for_site(data)¶
- centralcli.cleaner.show_all_ap_lldp_neighbors_for_sitev2(data, filter: Literal['up', 'down'] | None = None)¶
- centralcli.cleaner.show_groups(data: List[dict], cleaner_format: Literal['json', 'yaml', 'csv', 'rich', 'tabulate'] = 'rich') List[dict]¶
- centralcli.cleaner.show_interfaces(data: List[dict] | dict, verbosity: int = 0, dev_type: DevTypes = 'cx') List[dict] | dict¶
- centralcli.cleaner.show_radios(data: List[Dict[str, str | int]]) List[Dict[str, str | int]]¶
- centralcli.cleaner.show_ts_commands(data: List[dict] | dict) List[dict] | dict¶
- centralcli.cleaner.simple_kv_formatter(data: List[Dict[str, Any]], key_order: List[str] | None = None, strip_keys: List[str] | None = None, strip_null: bool = False, emoji_bools: bool = False) List[Dict[str, Any]]¶
Default simple formatter
- Parameters:
data (List[Dict[str, Any]]) – Data to be formatted, data is returned unchanged is data is not a list.
key_order (List[str], optional) – List of keys in the order desired. If defined only key_order key/value pairs are returned. Defaults to None.
strip_keys (List[str], optional) – List of keys to be stripped from output.
strip_null (bool, optional) – Set True to strip keys that have no value for any items. Defaults to False.
emoji_bools (bool, optional) – Replace boolean values with emoji ✅ for True ❌ for False. Defaults to False.
- Returns:
Formatted data
- Return type:
List[Dict[str, Any]]
- centralcli.cleaner.sites(data: List[dict] | dict) List[dict] | dict¶
- centralcli.cleaner.sort_interfaces(interfaces: List[Dict[str, Any]], interface_key: str = 'port_number') List[Dict[str, Any]]¶
- centralcli.cleaner.sort_result_keys(data: List[dict], order: List[str] | None = None) List[dict]¶
- centralcli.cleaner.strip_no_value(data: List[dict] | Dict[dict], aggressive: bool = False) List[dict] | Dict[dict]¶
strip out any columns that have no value in any row
Accepts either List of dicts, or a Dict where the value for each key is a dict
- Parameters:
data (List[dict] | Dict[dict]) – data to process
aggressive (bool, optional) – If True will strip any key with no value, Default is to only strip if all instances of a given key have no value.
- Returns:
processed data
- Return type:
List[dict] | Dict[dict]
- centralcli.cleaner.strip_outer_keys(data: dict) list | dict¶
strip unnecessary wrapping key from API response payload
- Parameters:
data (dict) – The response payload (aiohttp.Response.json())
- Returns:
typically list of dicts
- Return type:
Union[list, dict]
- centralcli.cleaner.wids(data: List[Dict[str, Any]]) List[Dict[str, Any]]¶
centralcli.config module¶
- class centralcli.config.AccountModel(*, base_url: Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], client_id: str, client_secret: str, customer_id: str, username: str | None = None, password: str | None = None, token: Token | None = None)¶
Bases:
BaseModel- base_url: HttpUrl¶
- client_id: str¶
- client_secret: str¶
- customer_id: str¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'base_url': FieldInfo(annotation=Url, required=True, alias=AliasChoices(choices=['base_url', 'url']), alias_priority=2, metadata=[UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'client_id': FieldInfo(annotation=str, required=True), 'client_secret': FieldInfo(annotation=str, required=True), 'customer_id': FieldInfo(annotation=str, required=True), 'password': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'token': FieldInfo(annotation=Union[Token, NoneType], required=False, default=None), 'username': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- password: str | None¶
- username: str | None¶
- class centralcli.config.ClusterName(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- internal = 'internal'¶
- prod1 = 'prod1'¶
- prod2 = 'prod2'¶
- prod4 = 'prod4'¶
- class centralcli.config.Config(base_dir: Path | None = None)¶
Bases:
object- property cache_file¶
- property cache_file_ok¶
- first_run() str¶
Method to collect configuration from user when no config file exists.
- Returns:
- The contents of the config file (yaml.safe_dump) or None if
user chooses to bypass.
- Return type:
str|None
- get(key: str, default: Any | None = None) Any¶
- get_account_from_args() str¶
Determine account to use based on arguments & last_account file.
Method does no harm / triggers no errors. Any errors are handled in account_name_callback after cli is loaded. We need to determine the account during init to load the cache for auto completion.
- Returns:
The account to use based on –account -d flags and last_account file.
- Return type:
str
- static get_file_data(import_file: Path, text_ok: bool = False, model: Any | None = None) dict | list¶
Returns dict from yaml/json/csv or list of lines from file when text_ok=True.
- Parameters:
import_file (Path) – import file.
text_ok (bool, optional) – When file extension is not one of yaml/yml/json/csv/tsv… parse file as text and return list of lines. Defaults to False.
model (Any, optional) – Pydantic Model to return, dict from import is passed into model for validation.
- Raises:
UserWarning – Raises UserWarning when text_ok is False (default) and extension is not in [‘.yaml’, ‘.yml’, ‘.json’, ‘.csv’, ‘.tsv’, ‘.dbf’]
UserWarning – Raises UserWarning when a failure occurs when parsing the file, passes on the underlying exception.
- Returns:
- Normally dict, list when text_ok and file extension not in
[‘.yaml’, ‘.yml’, ‘.json’, ‘.csv’, ‘.tsv’, ‘.dbf’].
- Return type:
Union[dict, list]
- get_last_account() Tuple[str | None, float | None, bool | None]¶
Gathers contents of last_account returns tuple with values.
- last_account file stores: name of last account, timestamp of last command, numeric bool if big (will forget) msg has been displayed.
expiration is calculated based on the value of account_will_forget and delta between last_command timestamp and now.
- Returns:
last_account, timestamp of last cmd using this account, if initial will_forget_msg has been displayed, if account is expired
- Return type:
Tuple[None, str | None, float | bool | None, bool]
- property is_cop¶
- property last_command_file¶
- property tok_file: Path¶
- property token_store¶
- property tokens¶
- update_last_account_file(account: str, last_cmd_ts: int | float = 1730577734.44, msg_shown: bool = False)¶
- property valid¶
- property wh_port¶
- class centralcli.config.SafeLineLoader(stream)¶
Bases:
SafeLoaderLoader class that keeps track of line numbers.
- compose_node(parent: Node, index: int) Node¶
Annotate a node with the first line it was seen.
- class centralcli.config.ServiceNow(*, id: str, base_url: Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], port: int = None, incident_path: str, refresh_path: str = 'oauth_token.do', assignment_group: str, client_id: str, client_secret: str, token: SnowTokens = None, tok_file: Path = None)¶
Bases:
BaseModel- assignment_group: str¶
- base_url: HttpUrl¶
- client_id: str¶
- client_secret: str¶
- id: str¶
- incident_path: str¶
- property incident_url: URL¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'assignment_group': FieldInfo(annotation=str, required=True), 'base_url': FieldInfo(annotation=Url, required=True, alias=AliasChoices(choices=['base_url', 'url']), alias_priority=2, metadata=[UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'client_id': FieldInfo(annotation=str, required=True), 'client_secret': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=True), 'incident_path': FieldInfo(annotation=str, required=True), 'port': FieldInfo(annotation=int, required=False, default=None), 'refresh_path': FieldInfo(annotation=str, required=False, default='oauth_token.do'), 'tok_file': FieldInfo(annotation=Path, required=False, default=None), 'token': FieldInfo(annotation=SnowTokens, required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- port: int¶
- refresh_path: str¶
- property refresh_url: URL¶
- tok_file: Path¶
- token: SnowTokens¶
- class centralcli.config.SnowTokens(*, config: Token, cache: Token | None = None)¶
Bases:
BaseModel- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'cache': FieldInfo(annotation=Union[Token, NoneType], required=False, default=None), 'config': FieldInfo(annotation=Token, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class centralcli.config.Token(*, access_token: str, refresh_token: str)¶
Bases:
BaseModel- access: str¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'access': FieldInfo(annotation=str, required=True, alias='access_token', alias_priority=2), 'refresh': FieldInfo(annotation=str, required=True, alias='refresh_token', alias_priority=2)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- refresh: str¶
- class centralcli.config.WebHook(*, token: str | None = None, port: int | None = 9443)¶
Bases:
BaseModel- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'port': FieldInfo(annotation=Union[int, NoneType], required=False, default=9443), 'token': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- port: int | None¶
- token: str | None¶
- centralcli.config.abort()¶
- centralcli.config.ask(prompt: str = '', *, console: Console | None = None, password: bool = False, choices: List[str] | None = None, show_default: bool = True, show_choices: bool = True) str¶
wrapper function for rich.Prompt().ask()
Handles KeyBoardInterrupt, EoFError, and exits if user inputs “abort”
- centralcli.config.get_cluster_url(cluster: ClusterName) str¶
- centralcli.config.load_yaml(fname: Path) List | Dict | str¶
Load a YAML file.
- centralcli.config.parse_yaml(content: str | TextIO) List | Dict | str¶
Load a YAML file.
centralcli.constants module¶
- class centralcli.constants.AlertSeverity(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- critical = 'critical'¶
- info = 'info'¶
- major = 'major'¶
- minor = 'minor'¶
- warning = 'warning'¶
- class centralcli.constants.AlertTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- client = 'client'¶
- device = 'device'¶
- ids = 'ids'¶
- user = 'user'¶
- class centralcli.constants.AllDevTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- cx = 'cx'¶
- gw = 'gw'¶
- sdwan = 'sdwan'¶
- sw = 'sw'¶
- switch = 'switch'¶
- class centralcli.constants.ArgToWhat¶
Bases:
object
- class centralcli.constants.BandwidthInterval(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.BatchAddArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- devices = 'devices'¶
- groups = 'groups'¶
- labels = 'labels'¶
- macs = 'macs'¶
- mpsk = 'mpsk'¶
- sites = 'sites'¶
- class centralcli.constants.BatchApArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- rename = 'rename'¶
- class centralcli.constants.BatchDelArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- devices = 'devices'¶
- groups = 'groups'¶
- labels = 'labels'¶
- sites = 'sites'¶
- class centralcli.constants.BatchRenameArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- aps = 'aps'¶
- class centralcli.constants.BlinkArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- off = 'off'¶
- on = 'on'¶
- class centralcli.constants.BounceArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- interface = 'interface'¶
- poe = 'poe'¶
- class centralcli.constants.CacheArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- clients = 'clients'¶
- devices = 'devices'¶
- events = 'events'¶
- groups = 'groups'¶
- hook_active = 'hook_active'¶
- hook_config = 'hook_config'¶
- hook_data = 'hook_data'¶
- inventory = 'inventory'¶
- labels = 'labels'¶
- licenses = 'licenses'¶
- logs = 'logs'¶
- mpsk = 'mpsk'¶
- portals = 'portals'¶
- sites = 'sites'¶
- tables = 'tables'¶
- templates = 'templates'¶
- class centralcli.constants.CancelWhat(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- device = 'device'¶
- group = 'group'¶
- swarm = 'swarm'¶
- class centralcli.constants.CertFormat(value)¶
Bases:
str,EnumAn enumeration.
- DER = 'DER'¶
- PEM = 'PEM'¶
- PKCS12 = 'PKCS12'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.CertTypes(value)¶
Bases:
str,EnumAn enumeration.
- CA_CERT = 'CA_CERT'¶
- CRL = 'CRL'¶
- INTERMEDIATE_CA = 'INTERMEDIATE_CA'¶
- OCSP_RESPONDER_CERT = 'OCSP_RESPONDER_CERT'¶
- OCSP_SIGNER_CERT = 'OCSP_SIGNER_CERT'¶
- PUBLIC_CERT = 'PUBLIC_CERT'¶
- SERVER_CERT = 'SERVER_CERT'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.CloudAuthMacSortBy(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'¶
- class centralcli.constants.CloudAuthUploadType(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'¶
- mpsk = 'mpsk'¶
- class centralcli.constants.DeleteArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- cert = 'cert'¶
- certificate = 'certificate'¶
- site = 'site'¶
- class centralcli.constants.DevTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- cx = 'cx'¶
- gw = 'gw'¶
- sdwan = 'sdwan'¶
- sw = 'sw'¶
- class centralcli.constants.DhcpArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- clients = 'clients'¶
- pools = 'pools'¶
- class centralcli.constants.EnableDisableArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- auto_sub = 'auto-sub'¶
- class centralcli.constants.EventDevTypeArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- client = 'client'¶
- gw = 'gw'¶
- switch = 'switch'¶
- class centralcli.constants.FirmwareDeviceType(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- cx = 'cx'¶
- gw = 'gw'¶
- mas = 'mas'¶
- sw = 'sw'¶
- switch = 'switch'¶
- class centralcli.constants.GatewayRole(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- branch = 'branch'¶
- vpnc = 'vpnc'¶
- wlan = 'wlan'¶
- class centralcli.constants.GenericDevTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- gw = 'gw'¶
- sdwan = 'sdwan'¶
- switch = 'switch'¶
- class centralcli.constants.IdenMetaVars¶
Bases:
object
- class centralcli.constants.KickArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- mac = 'mac'¶
- wlan = 'wlan'¶
- class centralcli.constants.LLDPCapabilityTypes(value)¶
Bases:
EnumAn enumeration.
- Bridge = 3¶
- Router = 5¶
- Wlan_Access_Point = 4¶
- unknown0 = 0¶
- unknown1 = 1¶
- unknown2 = 2¶
- unknown6 = 6¶
- unknown7 = 7¶
- class centralcli.constants.LibToAPI¶
Bases:
objectConvert consistent device types used by this library to the various types used by Central API endpoints
If no method str is provided converts various strings to consistent library device types.
- property valid: list¶
- property valid_generic_str: list¶
- property valid_str: list¶
- class centralcli.constants.LibToGenericPlural¶
Bases:
object
- class centralcli.constants.LicenseTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- advance_70xx = 'advance-70xx'¶
- advance_72xx = 'advance-72xx'¶
- advance_90xx_sec = 'advance-90xx-sec'¶
- advanced_91xx = 'advanced-91xx'¶
- advanced_91xx_sec = 'advanced-91xx-sec'¶
- advanced_92xx_sec = 'advanced-92xx-sec'¶
- advanced_ap = 'advanced-ap'¶
- advanced_nw_third_party = 'advanced-nw-third-party'¶
- advanced_switch_6100 = 'advanced-switch-6100'¶
- advanced_switch_6200 = 'advanced-switch-6200'¶
- advanced_switch_6300 = 'advanced-switch-6300'¶
- advanced_switch_6400 = 'advanced-switch-6400'¶
- advanced_switch_8xxx_9xxx_10xxx = 'advanced-switch-8xxx-9xxx-10xxx'¶
- foundation_7005 = 'foundation-7005'¶
- foundation_70xx = 'foundation-70xx'¶
- foundation_72xx = 'foundation-72xx'¶
- foundation_90xx_sec = 'foundation-90xx-sec'¶
- foundation_91xx = 'foundation-91xx'¶
- foundation_91xx_sec = 'foundation-91xx-sec'¶
- foundation_92xx_sec = 'foundation-92xx-sec'¶
- foundation_ap = 'foundation-ap'¶
- foundation_base_90xx_sec = 'foundation-base-90xx-sec'¶
- foundation_nw_third_party = 'foundation-nw-third-party'¶
- foundation_sdflex = 'foundation-sdflex'¶
- foundation_switch_6100 = 'foundation-switch-6100'¶
- foundation_switch_6200 = 'foundation-switch-6200'¶
- foundation_switch_6300 = 'foundation-switch-6300'¶
- foundation_switch_6400 = 'foundation-switch-6400'¶
- foundation_switch_8400 = 'foundation-switch-8400'¶
- foundation_wlan_gw = 'foundation-wlan-gw'¶
- vgw_2g = 'vgw-2g'¶
- vgw_4g = 'vgw-4g'¶
- vgw_500m = 'vgw-500m'¶
- wlan_advanced_90xx_sec = 'wlan-advanced-90xx-sec'¶
- wlan_advanced_91xx = 'wlan-advanced-91xx'¶
- wlan_advanced_91xx_sec = 'wlan-advanced-91xx-sec'¶
- wlan_advanced_92xx_sec = 'wlan-advanced-92xx-sec'¶
- class centralcli.constants.LogAppArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- account_setting = 'account_setting'¶
- nms = 'nms'¶
- class centralcli.constants.LogLevel(value)¶
Bases:
str,EnumAn enumeration.
- LOG_ERR = 'error'¶
- LOG_INFO = 'info'¶
- LOG_WARN = 'warning'¶
- Minor = 'minor'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- clear = 'clear'¶
- negative = 'negative'¶
- neutral = 'neutral'¶
- normal = 'normal'¶
- positive = 'positive'¶
- class centralcli.constants.LogSortBy(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- app = 'app'¶
- description = 'description'¶
- id = 'id'¶
- ip = 'ip'¶
- target = 'target'¶
- time = 'time'¶
- user = 'user'¶
- class centralcli.constants.NotifyToArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- email = 'email'¶
- phone = 'phone'¶
- class centralcli.constants.PoEDetectionStatus(value)¶
Bases:
EnumAn enumeration.
- Delivering = 3¶
- NA = 0¶
- Searching = 2¶
- Undefined = 1¶
- class centralcli.constants.RadioBandOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.RefreshWhat(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- cache = 'cache'¶
- token = 'token'¶
- tokens = 'tokens'¶
- class centralcli.constants.RemoveArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- site = 'site'¶
- class centralcli.constants.ResetArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- overlay = 'overlay'¶
- class centralcli.constants.SendCmdArg2(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- commands = 'commands'¶
- class centralcli.constants.SendCmdArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- device = 'device'¶
- file = 'file'¶
- group = 'group'¶
- site = 'site'¶
- class centralcli.constants.ShowArg2(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- ap = 'ap'¶
- aps = 'aps'¶
- certs = 'certs'¶
- clients = 'clients'¶
- device = 'device'¶
- devices = 'devices'¶
- gateway = 'gateway'¶
- gateways = 'gateways'¶
- group = 'group'¶
- groups = 'groups'¶
- sites = 'sites'¶
- switch = 'switch'¶
- switches = 'switches'¶
- template = 'template'¶
- templates = 'templates'¶
- variables = 'variables'¶
- class centralcli.constants.ShowArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- ap = 'ap'¶
- aps = 'aps'¶
- cache = 'cache'¶
- certs = 'certs'¶
- clients = 'clients'¶
- device = 'device'¶
- devices = 'devices'¶
- gateway = 'gateway'¶
- gateways = 'gateways'¶
- group = 'group'¶
- groups = 'groups'¶
- log = 'log'¶
- logs = 'logs'¶
- site = 'site'¶
- sites = 'sites'¶
- switch = 'switch'¶
- switches = 'switches'¶
- template = 'template'¶
- templates = 'templates'¶
- variables = 'variables'¶
- class centralcli.constants.ShowHookProxyArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- logs = 'logs'¶
- pid = 'pid'¶
- port = 'port'¶
- class centralcli.constants.ShowInventoryArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'¶
- ap = 'ap'¶
- gw = 'gw'¶
- switch = 'switch'¶
- vgw = 'vgw'¶
- class centralcli.constants.SiteStates(value)¶
Bases:
str,EnumAn enumeration.
- AK = 'Alaska'¶
- AL = 'Alabama'¶
- AR = 'Arkansas'¶
- AS = 'American Samoa'¶
- AZ = 'Arizona'¶
- Alabama = 'Alabama'¶
- Alaska = 'Alaska'¶
- American_Samoa = 'American Samoa'¶
- Arizona = 'Arizona'¶
- Arkansas = 'Arkansas'¶
- CA = 'California'¶
- CO = 'Colorado'¶
- CT = 'Connecticut'¶
- California = 'California'¶
- Colorado = 'Colorado'¶
- Connecticut = 'Connecticut'¶
- DC = 'District of Columbia'¶
- DE = 'Delaware'¶
- Delaware = 'Delaware'¶
- District_of_Columbia = 'District of Columbia'¶
- FL = 'Florida'¶
- Florida = 'Florida'¶
- GA = 'Georgia'¶
- GU = 'Guam'¶
- Georgia = 'Georgia'¶
- Guam = 'Guam'¶
- HI = 'Hawaii'¶
- Hawaii = 'Hawaii'¶
- IA = 'Iowa'¶
- ID = 'Idaho'¶
- IL = 'Illinois'¶
- IN = 'Indiana'¶
- Idaho = 'Idaho'¶
- Illinois = 'Illinois'¶
- Indiana = 'Indiana'¶
- Iowa = 'Iowa'¶
- KS = 'Kansas'¶
- KY = 'Kentucky'¶
- Kansas = 'Kansas'¶
- Kentucky = 'Kentucky'¶
- LA = 'Louisiana'¶
- Louisiana = 'Louisiana'¶
- MA = 'Massachusetts'¶
- MD = 'Maryland'¶
- ME = 'Maine'¶
- MI = 'Michigan'¶
- MN = 'Minnesota'¶
- MO = 'Missouri'¶
- MP = 'Northern Mariana Islands'¶
- MS = 'Mississippi'¶
- MT = 'Montana'¶
- Maine = 'Maine'¶
- Maryland = 'Maryland'¶
- Massachusetts = 'Massachusetts'¶
- Michigan = 'Michigan'¶
- Minnesota = 'Minnesota'¶
- Mississippi = 'Mississippi'¶
- Missouri = 'Missouri'¶
- Montana = 'Montana'¶
- NC = 'North Carolina'¶
- ND = 'North Dakota'¶
- NE = 'Nebraska'¶
- NH = 'New Hampshire'¶
- NJ = 'New Jersey'¶
- NM = 'New Mexico'¶
- NV = 'Nevada'¶
- NY = 'New York'¶
- Nebraska = 'Nebraska'¶
- Nevada = 'Nevada'¶
- New_Hampshire = 'New Hampshire'¶
- New_Jersey = 'New Jersey'¶
- New_Mexico = 'New Mexico'¶
- New_York = 'New York'¶
- North_Carolina = 'North Carolina'¶
- North_Dakota = 'North Dakota'¶
- Northern_Mariana_Islands = 'Northern Mariana Islands'¶
- OH = 'Ohio'¶
- OK = 'Oklahoma'¶
- OR = 'Oregon'¶
- Ohio = 'Ohio'¶
- Oklahoma = 'Oklahoma'¶
- Oregon = 'Oregon'¶
- PA = 'Pennsylvania'¶
- PR = 'Puerto Rico'¶
- Pennsylvania = 'Pennsylvania'¶
- Puerto_Rico = 'Puerto Rico'¶
- RI = 'Rhode Island'¶
- Rhode_Island = 'Rhode Island'¶
- SC = 'South Carolina'¶
- SD = 'South Dakota'¶
- South_Carolina = 'South Carolina'¶
- South_Dakota = 'South Dakota'¶
- TN = 'Tennessee'¶
- TX = 'Texas'¶
- Tennessee = 'Tennessee'¶
- Texas = 'Texas'¶
- UM = 'United States Minor Outlying Islands'¶
- US_Virgin_Islands = 'U.S. Virgin Islands'¶
- UT = 'Utah'¶
- United_States_Minor_Outlying_Islands = 'United States Minor Outlying Islands'¶
- Utah = 'Utah'¶
- VA = 'Virginia'¶
- VI = 'U.S. Virgin Islands'¶
- VT = 'Vermont'¶
- Vermont = 'Vermont'¶
- Virginia = 'Virginia'¶
- WA = 'Washington'¶
- WI = 'Wisconsin'¶
- WV = 'West Virginia'¶
- WY = 'Wyoming'¶
- Washington = 'Washington'¶
- West_Virginia = 'West Virginia'¶
- Wisconsin = 'Wisconsin'¶
- Wyoming = 'Wyoming'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.SortAlertOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- acknowledged = 'acknowledged'¶
- description = 'description'¶
- severity = 'severity'¶
- time = 'time'¶
- type = 'type'¶
- class centralcli.constants.SortArchivedOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'¶
- model = 'model'¶
- resource_id = 'resource-id'¶
- serial = 'serial'¶
- sku = 'sku'¶
- type = 'type'¶
- class centralcli.constants.SortCertOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- expiration = 'expiration'¶
- expired = 'expired'¶
- md5_checksum = 'md5-checksum'¶
- sha1_checksum = 'sha1-checksum'¶
- type = 'type'¶
- class centralcli.constants.SortClientOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- connected_device = 'connected-device'¶
- dot11 = 'dot11'¶
- group = 'group'¶
- ip = 'ip'¶
- last_connected = 'last-connected'¶
- mac = 'mac'¶
- network = 'network'¶
- role = 'role'¶
- site = 'site'¶
- vlan = 'vlan'¶
- class centralcli.constants.SortDevOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- ap_ip = 'ap-ip'¶
- ap_port = 'ap-port'¶
- ap_serial = 'ap-serial'¶
- group = 'group'¶
- healthy = 'healthy'¶
- ip = 'ip'¶
- labels = 'labels'¶
- mac = 'mac'¶
- model = 'model'¶
- serial = 'serial'¶
- site = 'site'¶
- status = 'status'¶
- switch = 'switch'¶
- switch_ip = 'switch-ip'¶
- switch_port = 'switch-port'¶
- switch_serial = 'switch-serial'¶
- tagged_vlans = 'tagged-vlans'¶
- type = 'type'¶
- untagged_vlan = 'untagged-vlan'¶
- uptime = 'uptime'¶
- version = 'version'¶
- class centralcli.constants.SortDhcpOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- client_name = 'client-name'¶
- client_type = 'client-type'¶
- free_ip = 'free-ip'¶
- ip = 'ip'¶
- lease_end = 'lease-end'¶
- lease_remaining = 'lease-remaining'¶
- lease_start = 'lease-start'¶
- lease_time = 'lease-time'¶
- mac = 'mac'¶
- pool_name = 'pool-name'¶
- pool_size = 'pool-size'¶
- pvid = 'pvid'¶
- subnet = 'subnet'¶
- class centralcli.constants.SortGroupOptions(value)¶
Bases:
str,EnumAn enumeration.
- AOSVersion = 'AOSVersion'¶
- AllowedDevTypes = 'AllowedDevTypes'¶
- ApNetworkRole = 'ApNetworkRole'¶
- Architecture = 'Architecture'¶
- GwNetworkRole = 'GwNetworkRole'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- template_group = 'template-group'¶
- class centralcli.constants.SortInventoryOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- expires_in = 'expires-in'¶
- mac = 'mac'¶
- model = 'model'¶
- serial = 'serial'¶
- services = 'services'¶
- sku = 'sku'¶
- subscription_key = 'subscription-key'¶
- type = 'type'¶
- class centralcli.constants.SortLabelOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- devices = 'devices'¶
- id_ = 'id'¶
- class centralcli.constants.SortNamedMpskOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- mpsk = 'mpsk'¶
- role = 'role'¶
- status = 'status'¶
- class centralcli.constants.SortOspfAreaOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'¶
- area_type = 'area-type'¶
- default_cost = 'default-cost'¶
- interface_count = 'interface-count'¶
- spf_run_count = 'spf-run-count'¶
- summary_enable = 'summary-enable'¶
- class centralcli.constants.SortOspfDatabaseOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- age = 'age'¶
- area = 'area'¶
- checksum = 'checksum'¶
- link_count = 'link-count'¶
- ls_id = 'ls-id'¶
- lsa_type = 'lsa-type'¶
- route_tag = 'route-tag'¶
- router_id = 'router-id'¶
- seq_no = 'seq-no'¶
- class centralcli.constants.SortOspfInterfaceOptions(value)¶
Bases:
str,EnumAn enumeration.
- BDR_IP = 'BDR-IP'¶
- BDR_rtr_id = 'BDR-rtr-id'¶
- DR_IP = 'DR-IP'¶
- DR_rtr_id = 'DR-rtr-id'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'¶
- auth = 'auth'¶
- cost = 'cost'¶
- dead_interval = 'dead-interval'¶
- hello_interval = 'hello-interval'¶
- ip = 'ip'¶
- nbrs = 'nbrs'¶
- oper_state = 'oper-state'¶
- priority = 'priority'¶
- rexmt_interval = 'rexmt-interval'¶
- state = 'state'¶
- type = 'type'¶
- class centralcli.constants.SortOspfNeighborOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'¶
- dead_timer = 'dead-timer'¶
- interface_name = 'interface-name'¶
- interface_state = 'interface-state'¶
- ip = 'ip'¶
- neighbor_state = 'neighbor-state'¶
- options = 'options'¶
- priority = 'priority'¶
- rexmt_timer = 'rexmt-timer'¶
- router_id = 'router-id'¶
- class centralcli.constants.SortOverlayInterfaceOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- endpoint = 'endpoint'¶
- routes = 'routes'¶
- state = 'state'¶
- uptime = 'uptime'¶
- class centralcli.constants.SortPortalOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- auth = 'auth'¶
- id = 'id'¶
- reg_by_email = 'reg-by-email'¶
- reg_by_phone = 'reg-by-phone'¶
- url = 'url'¶
- class centralcli.constants.SortRouteOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- best = 'best'¶
- destination = 'destination'¶
- flags = 'flags'¶
- interface = 'interface'¶
- learn_time = 'learn-time'¶
- metric = 'metric'¶
- nexthop = 'nexthop'¶
- protocol = 'protocol'¶
- class centralcli.constants.SortSiteOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- address = 'address'¶
- associated_devices = 'associated-devices'¶
- city = 'city'¶
- country = 'country'¶
- id = 'id'¶
- state = 'state'¶
- zipcode = 'zipcode'¶
- class centralcli.constants.SortStackOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- group = 'group'¶
- mac = 'mac'¶
- split_policy = 'split-policy'¶
- status = 'status'¶
- topology = 'topology'¶
- class centralcli.constants.SortSubscriptionOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- end_date = 'end-date'¶
- key = 'key'¶
- network = 'network'¶
- sku = 'sku'¶
- start_date = 'start-date'¶
- status = 'status'¶
- type = 'type'¶
- class centralcli.constants.SortTemplateOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- device_type = 'device-type'¶
- group = 'group'¶
- model = 'model'¶
- template_hash = 'template-hash'¶
- version = 'version'¶
- class centralcli.constants.SortTsCmdOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- category = 'category'¶
- command_id = 'id'¶
- class centralcli.constants.SortVlanOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- igmp = 'igmp'¶
- jumbo = 'jumbo'¶
- mgmt = 'mgmt'¶
- oper_state_reason = 'oper-state-reason'¶
- pvid = 'pvid'¶
- status = 'status'¶
- tagged = 'tagged'¶
- untagged = 'untagged'¶
- voice = 'voice'¶
- class centralcli.constants.SortWebHookOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- retry_policy = 'retry-policy'¶
- token = 'token'¶
- token_created = 'token-created'¶
- updated = 'updated'¶
- urls = 'urls'¶
- wid = 'wid'¶
- class centralcli.constants.SortWlanOptions(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- access_type = 'access-type'¶
- clients = 'clients'¶
- enabled = 'enabled'¶
- group = 'group'¶
- mac_auth = 'mac-auth'¶
- rf_band = 'rf-band'¶
- security = 'security'¶
- ssid = 'ssid'¶
- type = 'type'¶
- class centralcli.constants.StartArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- hook2snow = 'hook2snow'¶
- hook_proxy = 'hook-proxy'¶
- class centralcli.constants.StatusOptions(value)¶
Bases:
str,EnumAn enumeration.
- DOWN = 'DOWN'¶
- Down = 'Down'¶
- UP = 'UP'¶
- Up = 'Up'¶
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- down = 'down'¶
- up = 'up'¶
- class centralcli.constants.SubscriptionArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- auto = 'auto'¶
- details = 'details'¶
- names = 'names'¶
- stats = 'stats'¶
- class centralcli.constants.SwitchRoles(value)¶
Bases:
EnumAn enumeration.
- ERR = 0¶
- stack_conductor = 2¶
- stack_member = 4¶
- stack_standby = 3¶
- stand_alone = 1¶
- class centralcli.constants.SwitchRolesShort(value)¶
Bases:
EnumAn enumeration.
- ERR = 0¶
- conductor = 2¶
- mbr = 4¶
- stand_alone = 1¶
- stby = 3¶
- class centralcli.constants.TSDevTypes(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- cx = 'cx'¶
- gateway = 'gateway'¶
- gw = 'gw'¶
- mas = 'mas'¶
- sw = 'sw'¶
- switch = 'switch'¶
- class centralcli.constants.TemplateLevel1(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- add = 'add'¶
- delete = 'delete'¶
- update = 'update'¶
- class centralcli.constants.TimeRange(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.UpgradeArgs(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'¶
- gateway = 'gateway'¶
- switch = 'switch'¶
- class centralcli.constants.UplinkNames(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- uplink101 = 'uplink101'¶
- uplink102 = 'uplink102'¶
- uplink103 = 'uplink103'¶
- uplink104 = 'uplink104'¶
- uplink105 = 'uplink105'¶
- class centralcli.constants.WhatToPretty¶
Bases:
object
- class centralcli.constants.WlanType(value)¶
Bases:
str,EnumAn enumeration.
- __format__(format_spec)¶
Returns format using actual value type unless __str__ has been overridden.
- employee = 'employee'¶
- guest = 'guest'¶
- centralcli.constants.do_load_pycentral() bool¶
Determine if provided command requires pycentral load
Allows command to complete even if config has yet to be configured. Useful for first run commands and auto docs.
- Returns:
True or False indicating if pycentral needs to be instantiated for command to complete.
- Return type:
bool
- centralcli.constants.get_cencli_devtype(dev_type: str) str¶
Convert device type returned by API to consistent cencli types
- Parameters:
dev_type (str) – device type provided by API response
- Returns:
One of [“ap”, “sw”, “cx”, “gw”]
- Return type:
str
centralcli.objects module¶
object Classes
- class centralcli.objects.DateTime(timestamp: int | float | str, format: Literal['day-datetime', 'durwords', 'durwords-short', 'timediff', 'timediff-past', 'mdyt', 'log', 'date-string'] = 'day-datetime', tz: str = 'local', pad_hour: bool = False, round_to_minute: bool = False, format_expiration: bool = False)¶
Bases:
objectDateTime object with a number of timestamp to string converters for various representations used by the CLI.
- property date_string: str¶
Render date as human string like ‘Dec 10, 2019’.
- Returns:
Date as string in format: ‘Dec 10, 2019’
- Return type:
str
- property day_datetime: str¶
Render date in day_datetime format
- Returns:
Date as string in format: ‘Thu, May 7, 2020 3:49 AM’
- Return type:
str
- property durwords: str¶
Render elapsed time in seconds as duration string.
- Returns:
Duration as string in format: ‘2 weeks 1 day 1 hour 21 minutes 2 seconds’
- Return type:
str
- property durwords_short: str¶
Render timestamp as duration in short format.
Strips off seconds and rounds to minute if Class instantiated with round_to_minutes=True
- Returns:
Duration as string in format: ‘2w 1d 1h 21m 2s’ (without seconds if round_to_minute = True)
- Return type:
str
- property expiration: str¶
Render date/time in format provided during instantiation colorized to indicate how near expiration the date is.
- return is colorized:
orange: if expiration within 6 months
red: if expiration within 3 months
- Returns:
Potentially colorized date str.
- Return type:
str
- property log: str¶
Render date as human string in log format.
Hour is zero-padded if Class is instantiated with pad_hour=True
- Returns:
Date as string in format: ‘Jan 08 7:59:00 PM’ or ‘Jan 08 07:59:00 PM’ if pad_hour=True
- Return type:
str
- property mdyt: str¶
Render date as human string like Mon day, year time AM/PM.
Hour is zero-padded if Class is instantiated with pad_hour=True
- Returns:
Date as string in format: ‘May 7, 2020 3:49:24 AM’ or ‘May 7, 2020 03:49:24 AM’ if pad_hour=True
- Return type:
str
- normalize_epoch(timestamp: int | float | str) int | float¶
Normalize timestamp/epoch or iso date str to seconds.
- Parameters:
timestamp (int | float | str) – timestamp/epoch is seconds or milliseconds or iso date string
- Returns:
timestamp/epoch in seconds
- Return type:
int | float
- property timediff: str¶
Render duration words representing the difference between self.ts and now.
- Returns:
The difference between now and the timestamp in the format: ‘47 minutes ago’.
- Return type:
str
- property timediff_past: str¶
Render past words representing the difference between self.ts and now.
- Returns:
The difference between now and the timestamp in the format: ‘past 47 minutes’.
- Return type:
str
- class centralcli.objects.Encoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)¶
Bases:
JSONEncoderA Custom JSON Encoder to handle custom DateTime object (and Path) during JSON serialization.
- default(obj)¶
Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
centralcli.exceptions module¶
- exception centralcli.exceptions.ArubaCentralException¶
Bases:
Exception
- exception centralcli.exceptions.CentralCliException¶
Bases:
Exception
- exception centralcli.exceptions.DevException¶
Bases:
ArubaCentralException
- exception centralcli.exceptions.ImportException¶
Bases:
CentralCliException
- exception centralcli.exceptions.IncidentException¶
Bases:
ServiceNowException
- exception centralcli.exceptions.MissingFieldException¶
Bases:
CentralCliException
- exception centralcli.exceptions.RefreshFailedException¶
Bases:
ServiceNowException
- exception centralcli.exceptions.ServiceNowException¶
Bases:
Exception
- exception centralcli.exceptions.TimeoutException¶
Bases:
ArubaCentralException
centralcli.logger module¶
- class centralcli.logger.MyLogger(log_file: str | Path, debug: bool = False, show: bool = False, verbose: bool = False)¶
Bases:
object- property DEBUG: bool¶
- property caption: None | str¶
render log messages queued for display in output caption.
- critical(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- debug(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- debugv(msgs: list | str, log: bool = True, show: bool | None = None, *args, **kwargs) None¶
More verbose debugging - set via debugv: True in config
- error(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- exception(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- fatal(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- follow() None¶
generator function that yields new lines in log file
- get_logger() Logger¶
Return custom log object.
- info(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
- property level_name: str | int¶
- log_print(msgs, log: bool = False, show: bool = False, caption: bool = False, level: str = 'info', *args, **kwargs) None¶
- print_file() None¶
- setLevel(level)¶
- warning(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None¶
centralcli.response module¶
- class centralcli.response.BatchRequest(func: callable, *args, **kwargs)¶
Bases:
object
- class centralcli.response.CombinedResponse(responses: ~typing.List[~centralcli.response.Response], combiner_func: callable = <function CombinedResponse.flatten_resp>)¶
Bases:
Response- property all_ok¶
- property failed¶
- property ok¶
- property passed¶
- property urls: List[URL]¶
- class centralcli.response.LoggedRequests(url: str, method: str = 'GET')¶
Bases:
object- update(response: ClientResponse)¶
- class centralcli.response.RateLimit(resp: ClientResponse | None = None)¶
Bases:
object- property near_day: bool¶
- property near_sec: bool¶
- property ok: bool¶
- property text: str¶
- class centralcli.response.Response(response: ClientResponse | None = None, url: URL | str = '', ok: bool | None = None, error: str | None = None, output: Any = {}, raw: Any = {}, status_code: int | None = None, elapsed: int | float = 0, rl_str: str | None = None, data_key: str | None = None)¶
Bases:
objectwrapper ClientResponse object
Assigns commonly evaluated attributes regardless of API execution result
- The following attributes will always be available:
ok (bool): indicates success/failure of aiohttp.ClientSession.request()
output (Any): The content returned from the response (outer keys removed)
raw (Any): The original un-cleaned response from the API request
error (str): Error message indicating the nature of a failed response
status (int): http status code returned from response
rl (RateLimit): Rate Limit info extracted from aiohttp.ClientResponse headers.
- Create instance by providing at minimum one of the following parameters:
response (ClientResponse) and output(typically List[dict]): all other parameters ignored if providing response
- error (str): ok, output, status set to logical default if not provided
OK / __bool__ is False if error is provided and ok is not.
- output (Any): ok, error, status set to logical default if not provided
OK / __bool__ is True if output provided with no error or ok arg.
- get(key: int | str, default: Any | None = None)¶
- keys() list¶
- property ok¶
- property status_code: int¶
Make attributes used for status code for both aiohttp and requests valid.
- property table: List[Dict[str, Any]]¶
Returns output with only the keys that are common across all items.
- Returns:
resp.output with only keys common across all items.
- Return type:
List[Dict[str, Any]]
- class centralcli.response.Session(auth: ArubaCentralBase | None = None, aio_session: ClientSession | None = None, silent: bool = True)¶
Bases:
object- property aio_session¶
- async api_call(url: str, data: dict | None = None, json_data: dict | list | None = None, method: str = 'GET', headers: dict = {}, params: dict = {}, callback: callable | None = None, callback_kwargs: Any = {}, count: int | None = None, **kwargs: Any) Response¶
Perform API calls and handle paging
- Parameters:
url (str) – The API Endpoint URL
data (dict, optional) – Data passed to aiohttp.ClientSession. Defaults to None.
json_data (Union[dict, list], optional) – passed to aiohttp.ClientSession. Defaults to None.
method (str, optional) – Request Method (POST, GET, PUT,…). Defaults to “GET”.
headers (dict, optional) – headers dict passed to aiohttp.ClientSession. Defaults to {}.
params (dict, optional) – url parameters passed to aiohttp.ClientSession. Defaults to {}.
callback (callable, optional) – DEPRECATED callback to be performed on result prior to return. Defaults to None.
callback_kwargs (Any, optional) – DEPRECATED kwargs to pass to the callback. Defaults to {}.
count (int, optional) – upper limit on # of records to return (used to return last ‘count’ audit logs). Defaults to None.
- Returns:
CentralAPI Response object
- Return type:
- batch_request(api_calls: List[BatchRequest], continue_on_fail: bool = False, retry_failed: bool = False) List[Response]¶
non async to async wrapper for multiple parallel API calls
First entry is ran alone, if successful the remaining calls are made in parallel.
- Parameters:
api_calls (List[BatchRequest]) – List of BatchRequest objects.
continue_on_fail (bool, optional) – Continue with subsequent requests if first request fails. defaults to False. Only the first request is validated for success.
retry_failed (bool, optional) – Retry failed requests some return codes result in retry regardless. Defaults to False
- Returns:
List of centralcli.response.Response objects.
- Return type:
List[Response]
- async delete(url, params: dict = {}, payload: dict | None = None, json_data: dict | list | None = None, headers: dict | None = None, **kwargs) Response¶
- async exec_api_call(url: str, data: dict | None = None, json_data: dict | list | None = None, method: str = 'GET', headers: dict = {}, params: dict = {}, **kwargs) Response¶
- async get(url, params: dict = {}, headers: dict | None = None, count: int | None = None, **kwargs) Response¶
- get_token_from_user() dict¶
Handle invalid or expired tokens
For prod cluster it leverages ArubaCentralBase.handleTokenExpiry() For internal cluster it extends functionality to support user input copy paste of Download Token dict from Aruba Central GUI.
- Returns:
access and refresh tokens extracted from user provided json
- Return type:
dict
- async handle_pagination(res: Response, paged_raw: Dict | List | None = None, paged_output: Dict | List | None = None) Tuple¶
- async patch(url, params: dict = {}, payload: dict | None = None, json_data: dict | list | None = None, headers: dict | None = None, **kwargs) Response¶
- async post(url, params: dict = {}, payload: dict | None = None, json_data: dict | list | None = None, headers: dict | None = None, **kwargs) Response¶
- async put(url, params: dict = {}, payload: dict | None = None, json_data: dict | list | None = None, headers: dict | None = None, **kwargs) Response¶
- refresh_token(token_data: dict | None = None, silent: bool = False) None¶
Refresh Aruba Central API tokens. Get new set of access/refresh token.
This method calls into _refresh_token which performs the API call.
- Parameters:
token_data (Union[dict, List[dict]], optional) – Dict or list of dicts, where each dict is a pair of tokens (“access_token”, “refresh_token”). If list, a refresh is attempted with each pair in order. Stops once a refresh is successful. If no token_data is provided it is collected from cache or config.
silent (bool, optional) – Setting to True disables spinner. Defaults to False.
- Returns:
Bool indicating success/failure.
- Return type:
bool
- request(func: callable, *args, **kwargs) Response¶
non async to async wrapper for all API calls
- Parameters:
func (callable) – One of the CentralApi methods
- Returns:
centralcli.response.Response object
- async vlog_api_req(method: Literal['GET', 'POST', 'PUT', 'DELETE'], url: str | URL, params: Dict[str, Any] | None = None, data: Any | None = None, json_data: Dict[str, Any] | None = None, kwargs: Dict[str, Any] | None = None) None¶
- class centralcli.response.Spinner(*args, **kwargs)¶
Bases:
StatusA Spinner Object that adds methods to rich.status.Status object
- fail(text: RenderableType = None) None¶
- start(text: RenderableType = None, *, spinner: str = None, spinner_style: StyleType = None, speed: float = None) None¶
Start the status animation.
- succeed(text: RenderableType = None) None¶
centralcli.utils module¶
- class centralcli.utils.Convert(mac, fuzzy: bool = False)¶
Bases:
object
- class centralcli.utils.ToBool(value: Any)¶
Bases:
object- property ok: bool¶
- str_to_bool(value: str | None) bool | None¶
- class centralcli.utils.Utils¶
Bases:
object- static ask(prompt: str = '', *, console: Console | None = None, password: bool = False, choices: List[str] | None = None, show_default: bool = True, show_choices: bool = True, default: Any = Ellipsis) str¶
wrapper function for rich.Prompt().ask()
Handles KeyBoardInterrupt, EoFError, and exits if user inputs “abort”.
- static chunker(seq, size)¶
- static color(text: str | bool | List[str], color_str: str = 'bright_green', pad_len: int = 0, italic: bool | None = None, bold: bool | None = None, blink: bool | None = None, sep: str = ', ') str¶
Helper method to wrap text in rich formatting tags
Applies standard default formatting.
- Parameters:
text (str|bool|list) – The text to be formmated. If a bool is provided it is converted to string and italics applied. If list of strings is provided it is converted to str and formatted.
color_str (str, optional) – Text is formatted with this color. ‘random’ will pick a random color. If text is a list, it will pick a random color for each item in the list. Default: bright_green
pad_len (int, optional) – Number of spaces to pad each entry with. Defaults to 0.
italic (bool, optional) – Wheather to apply italic to text. Default False if str is provided for text True if bool is provided.
bold (bool, optional) – Wheather to apply bold to text. Default None/False
blink (bool, optional) – Wheather to blink the text. Default None/False
sep (str, optional) – Seperator used when list of str converted to str. Defaults to ‘, ‘
- static convert_bytes_to_human(size: int | float | Dict[str, int | float] | None, precision: int = 2, throughput: bool = False, speed: bool = False, return_size: Literal['B', 'KB', 'MB', 'GB', 'TB', 'PB'] | None = None) str | None¶
- static do_pretty(key: str, value: str) str¶
Apply coloring to tty output
Applies color to certain columns/values prior to formatting
- static generate_template(template_file: Path | str, var_file: Path | str | None) str¶
Generate configuration files based on j2 templates and provided variables
- get_interfaces_from_range(interfaces: str | List[str]) List[str]¶
- static get_multiline_input(prompt: str | None = None, return_type: Literal['str', 'dict', 'list'] = 'str', abort_str: str = 'EXIT', **kwargs) List[str] | dict | str¶
- static is_reachable(host: str, port: str | list, timeout: int = 3, silent: bool = False)¶
- static is_serial(serial: str | List[str]) bool¶
Validate the provided str or list of strings appears to be a serial number.
Serial validation checks that the first 2 characters of the serial are letters, all charachters are alpha-numeric, and that there are 9 or more characters.
- Parameters:
serial (Union[str, List[str]]) – single serial number of list of serial numbers
- Returns:
True if all provided strings appear to be serial numbers False if not.
- Return type:
bool
- json_print(obj)¶
- listify(var)¶
- static older_than(ts: int | float | datetime, time_frame: int, unit: Literal['days', 'hours', 'minutes', 'seconds', 'weeks', 'months'] = 'days', tz: str = 'UTC') bool¶
- output(outdata: List[str] | Dict[str, Any], tablefmt: str = 'rich', title: str | None = None, caption: str | None = None, account: str | None = None, config=None, set_width_cols: dict | None = None, full_cols: List[str] | str = [], fold_cols: List[str] | str = [], ok_status: int | List[int] | Tuple[int, str] | List[Tuple[int, str]] | None = None) str¶
- static parse_time_options(from_time: int | float | datetime | None = None, to_time: int | float | datetime | None = None) Tuple[int | None, int | None]¶
parse time options (from_time, to_time) from user if any provided and return int timestamp for each.
- Parameters:
from_time (int | float | datetime, optional) – from time. Defaults to None.
to_time (int | float | datetime, optional) – to time. Defaults to None.
- Returns:
returns Tuple with int timestamps for from_time and to_time or None (user didn’t use the option).
- Return type:
Tuple(int | None, int | None)
- static strip_none(data: dict | list | None, strip_empty_obj: bool = False) Any¶
strip all keys from a list or dict where value is NoneType
- Parameters:
data (Union[dict, list, None]) – The iterable object to have all items/keys where value is None
strip_empty_obj (bool) – If True will strip keys that have empty objects as well as NoneType for value.
- Returns:
(Any) Return same type that is provided to method as first argument. If dict is provided it returns modified dict.
- static summarize_list(items: List[str], max: int = 6, pad: int = 4, sep: str = '\n', color: str | None = 'cyan', italic: bool = False, bold: bool = False)¶
- tty = <centralcli.utils.Utils.TTY object>¶
- static unique(_list: list, sort: bool = False) list¶
- static unlistify(data: Any)¶
Remove unnecessary outer lists.
- Returns:
[] = ‘’ [‘single_item’] = ‘single item’ [[item1], [item2], …] = [item1, item2, …]
- static update_dict(dict_to_update: Dict[str, List[Any]], key: str, value: Any) Dict[str, List[Any]]¶
Add key to dict or append to existing key if it already exists
TODO probably an itertools or other builtin that does this.
- Parameters:
dict_to_update (Dict[str, list]) – The dict to update
key (str) – The key, will ensure value is in dict under that key, or append if already there
value (Any) – value to be added to list
- Returns:
Orinal dict is returned updated with provided value
- Return type:
Dict[str, list]
- user_input_bool(question)¶
Ask User Y/N Question require Y/N answer
Error and re-prompt if user’s response is not valid Appends ‘? (y/n): ‘ to question/prompt provided
- Params:
question (str): The Question to ask
- Returns:
Users Response yes=True
- Return type:
answer (bool)
- valid_file(filepath)¶
- static validate_config(data: str) List[str]¶
Validator for resulting config after j2 conversion
- Parameters:
data (str) – str representing the final configuration.
- Raises:
typer.Exit – If masked creds found
- Returns:
Original list of str with each line rstrip.