Classic API¶
Legacy PyCentral reference modules for device management, monitoring, and configuration with classic Central.
Audit Logs¶
audit_logs
¶
Audit
¶
Get the audit logs and event logs with the functions in this class.
get_traillogs(conn, limit=100, offset=0, username=None, start_time=None, end_time=None, description=None, target=None, classification=None, customer_name=None, ip_address=None, app_id=None)
¶
Get audit logs, sort by time in in reverse chronological order. This API returns the first 10,000 results only. Please use filter in the API for more relevant results. MSP Customer Would see logs of MSP's and tenants as well.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param limit: Maximum number of audit events to be returned, defaults to 100
:type limit: int, optional
:param offset: Number of items to be skipped before returning the data, useful for pagination, defaults to 0
:type offset: int, optional
:param username: Filter audit logs by User Name, defaults to None
:type username: str, optional
:param start_time: Filter audit logs by Time Range. Start time of the audit logs should be provided in epoch seconds, defaults to None
:type start_time: int, optional
:param end_time: Filter audit logs by Time Range. End time of the audit logs should be provided in epoch seconds, defaults to None
:type end_time: int, optional
:param description: Filter audit logs by Description, defaults to None
:type description: str, optional
:param target: Filter audit logs by target, defaults to None
:type target: str, optional
:param classification: Filter audit logs by Classification, defaults to None
:type classification: str, optional
:param customer_name: Filter audit logs by Customer NameFilter audit logs by Customer Name, defaults to None
:type customer_name: str, optional
:param ip_address: Filter audit logs by IP Address, defaults to None
:type ip_address: str, optional
:param app_id: Filter audit logs by app_id, defaults to None
:type app_id: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/audit_logs.py
get_traillogs_detail(conn, id)
¶
Get details of an audit log
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param id: ID of audit event
:type id: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/audit_logs.py
get_eventlogs(conn, limit=100, offset=0, group_name=None, device_id=None, classification=None, start_time=None, end_time=None)
¶
Get audit events for all groups, sort by time in in reverse chronological order.This API returns the first 10,000 results only. Please use filter in the API for more relevant results.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param limit: Maximum number of audit events to be returned, defaults to 100
:type limit: int, optional
:param offset: Number of items to be skipped before returning the data, useful for pagination, defaults to 0
:type offset: int, optional
:param group_name: Filter audit events by Group Name, defaults to None
:type group_name: str, optional
:param device_id: Filter audit events by Target / Device ID. Device ID for AP is VC Name and Serial Number
for Switches, defaults to None
:type device_id: str, optional
:param classification: Filter audit events by classification, defaults to None
:type classification: str, optional
:param start_time: Filter audit logs by Time Range. Start time of the audit logs should be provided
in epoch seconds, defaults to None
:type start_time: int, optional
:param end_time: Filter audit logs by Time Range. End time of the audit logs should be provided in epoch
seconds, defaults to None
:type end_time: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/audit_logs.py
get_eventlogs_detail(conn, id)
¶
Get details of an audit event/log
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param id: ID of audit event
:type id: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/audit_logs.py
Base Utils¶
base_utils
¶
clusterBaseURL
¶
Bases: object
This class helps to fetch the API Base URL when Aruba Central cluster name is provided.
getBaseURL(cluster_name)
¶
This method returns the API Base URL of the provided Aruba Central cluster.
:param cluster_name: Name of the Aruba Central cluster whose base_url needs to be returned :type cluster_name: str :return: Base URL of provided cluster :rtype: str
Source code in pycentral/classic/base_utils.py
getAllBaseURLs()
¶
This method returns the list of base URLs of all the clusters of Aruba Central
:return: List of all valid base URLs of Aruba Central :rtype: list
parseInputArgs(central_info)
¶
This method parses user input, checks for the availability of mandatory arguments. If the user opts to provide a cluster_name instead of base_url, the method will use the cluster_name to fetch the base_url. Optional missing parameters in central_info variable is initialized as defined in C_DEFAULT_ARGS.
:param central_info: central_info dictionary as read from user's input file. :type central_info: dict :return: parsed central_info dict with missing optional params set to default values. :rtype: dict
Source code in pycentral/classic/base_utils.py
tokenLocalStoreUtil(token_store, customer_id='customer', client_id='client')
¶
Utility function for storeToken and loadToken default access token storage/cache method. This function generates unique file name for a customer and API gateway client to store and load access token in the local machine for reuse. The format of the file name is tok_
:param token_store: Placeholder to support different token storage mechanism.
* keyword type: Place holder for different token storage mechanism. Defaults to local storage.
* keyword path: path where temp folder is created to store token JSON file.
:type token_store: dict :param customer_id: Aruba Central customer id, defaults to "customer" :type customer_id: str, optional :param client_id: API Gateway client id, defaults to "client" :type client_id: str, optional :return: Filename for access token storage. :rtype: str
Source code in pycentral/classic/base_utils.py
get_url(base_url, path='', params='', query={}, fragment='')
¶
This method constructs complete URL based on multiple parts of URL.
:param base_url: base url for a HTTP request
:type base_url: str
:param path: API endpoint path, defaults to ''
:type path: str, optional
:param params: API endpoint path parameters, defaults to ''
:type params: str, optional
:param query: HTTP request url query parameters, defaults to {}
:type query: dict, optional
:param fragment: URL fragment identifier, defaults to ''
:type fragment: str, optional
:return: Parsed URL
:rtype: class:urllib.parse.ParseResult
Source code in pycentral/classic/base_utils.py
valid_url(url)
¶
This method verifies & returns the URL in a valid format. If the URL is missing the https prefix, the function will prepend the prefix after verifiying that its a valid base URL of an Aruba Central cluster.
:param base_url: base url for a HTTP request :type base_url: str :return: Valid Base URL :rtype: str
Source code in pycentral/classic/base_utils.py
console_logger(name, level='DEBUG')
¶
This method create an instance of python logging and sets the following format for log messages.
:param name: String displayed after data and time. Define it to identify from which part of the code, log message is generated.
:type name: str
:param level: Loggin level set to display messages from a certain logging level. Refer Python logging library man page, defaults to "DEBUG"
:type level: str, optional
:return: An instance of class logging
:rtype: class:`logging.Logger`
Source code in pycentral/classic/base_utils.py
Configuration¶
configuration
¶
Groups
¶
Bases: object
A python class consisting of functions to manage Aruba Central Groups via REST API
get_groups(conn, offset=0, limit=20)
¶
Get list of groups
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Pagination limit with Max 20, defaults to 20
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
get_config_mode_groups(conn, groups)
¶
For each group in the provided list, the configuration mode for Instant APs and Gateways is specified under the 'Wireless' field and for switches under the 'Wired' field. The configuration mode is specified as a boolean value indicating if the device type is managed using the template mode of configuration or not.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param groups: A list of group names with max of 20 groups.
:type groups: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
create_group(conn, group_name, group_password, wired_template=False, wireless_template=False)
¶
Create new group given a group name, group password and configuration mode(UI or template mode of configuration) to be set per device type.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group to be created.
:type group_name: str
:param group_password: Password for the group to be created
:type group_password: str
:param wired_template: Set to True to make the configuration mode for switches to template mode, defaults to False
:type wired_template: bool, optional
:param wireless_template: Set to True to make the configuration mode for IAPs and Gateways to template mode, defaults to False
:type wireless_template: bool, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
clone_create_group(conn, new_group_name, existing_group_name)
¶
Clone and create new group from a given group with the given name. The configuration of the new group will be inherited from the given group.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param new_group_name: New group name to be created.
:type new_group_name: str
:param existing_group_name: Existing group name to be cloned.
:type existing_group_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
delete_group(conn, group_name)
¶
Delete an existing group
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group to be deleted.
:type group_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
Devices
¶
Bases: object
A python class consisting of functions to manage Aruba Central Devices via REST API
get_devices_group(conn, device_serial)
¶
Get group name for a device
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of Aruba device
:type device_serial: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/configuration.py
get_devices_configuration(conn, device_serial)
¶
Get last known device configuration for a device.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of Aruba device.
:type device_serial: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_devices_config_details(conn, device_serial, details=True)
¶
Get
- central side configuration.
- Device running configuration.
- Configuration error details.
- Template error details and status of a device belonging to a template group.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of Aruba device.
:type device_serial: str
:param details: 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., defaults to True
:type details: bool, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_devices_templates(conn, device_serials)
¶
Get existing templates for list of devices
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serials: List of serial number of Aruba devices
:type device_serials: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_devices_group_templates(conn, device_type='IAP', include_groups=[], exclude_groups=[], all_groups=False, offset=0, limit=20)
¶
Get templates for devices in a group or multiple groups
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_type: Device type (i.e. IAP/ArubaSwitch/ MobilityController/CX), defaults to "IAP"
:type device_type: str, optional
:param include_groups: Fetch devices templates in list of groups, defaults to []
:type include_groups: list, optional
:param exclude_groups: Fetch devices templates not in list of groups, defaults to []
:type exclude_groups: list, optional
:param all_groups: Set to True, to fetch devices templates details for all the groups(Only allowed for user having all_groups access or admin), defaults to False
:type all_groups: bool, optional
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Pagination limit with Max 20, defaults to 20
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_device_templates_from_hash(conn, template_hash, offset=0, limit=20, exclude_hash=False, device_type='IAP')
¶
List of devices with its group name and template information is populated
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param template_hash: Template_hash of the template for which list of devices needs to be populated.
:type template_hash: str
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Pagination limit with Max 20, defaults to 20
:type limit: int, optional
:param exclude_hash: Fetch devices template details not matching with provided hash, defaults to False
:type exclude_hash: bool, optional
:param device_type: Device type (i.e. IAP/ArubaSwitch/ MobilityController/CX), defaults to "IAP"
:type device_type: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_switch_variablized_templates(conn, device_serial)
¶
Get template and variabled for Aruba device (switch)
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of Aruba device.
:type device_serial: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
set_switch_ssh_credentials(conn, device_serial, username, password)
¶
Set SSH connection information of Aruba Device (switch)
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of Aruba device.
:type device_serial: str
:param username: SSH username to set to the device
:type username: str
:param password: SSH password to set to the device
:type password: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
move_devices(conn, group_name, device_serials, preserve_config_overrides=None)
¶
Move list of devices to group and assign specified group in device management page
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of a group where devices will be moved
:type group_name: str
:param device_serials: A list of device serials to be moved to the mentioned group
:type device_serials: list
:param preserve_config_overrides: List of device types for which configuration overrides should be preserved. This is only supported for AOS-CX switches today, e.g., ["AOS_CX"]
:type preserve_config_overrides: list, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
Templates
¶
Bases: object
A python class consisting of functions to manage Aruba Central Templates via REST API
get_template_text(conn, group_name, template_name)
¶
Get CLI template in text format.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of an existing group
:type group_name: str
:param template_name: Name of an existing template within mentioned group
:type template_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_template(conn, group_name, device_type='', template_name='', version='', model='', q='', offset=0, limit=20)
¶
Get all templates in group. Query can be filtered by name, device_type, version, model or version number. Response is sorted by template name.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group for which the templates will be being queried.
:type group_name: str
:param device_type: Filter on device_type, defaults to ""
:type device_type: str, optional
:param template_name: Filter on template name, defaults to ""
:type template_name: str, optional
:param version: Filter on version property of template, defaults to ""
:type version: str, optional
:param model: Filter on model property of template. For 'ArubaSwitch' device_type, part number(J number) can be used., defaults to ""
:type model: str, optional
:param q: Search for template OR version OR model, q will be ignored if any of filter parameters are
provided, defaults to ""
:type q: str, optional
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Pagination limit with Max 20, defaults to 20
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
create_template(conn, group_name, template_name, template_filename, device_type='IAP', version='ALL', model='ALL')
¶
Upload a new template file
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group in which the template file will be created.
:type group_name: str
:param template_name: Name for the template to be created
:type template_name: str
:param template_filename: Name of the template file in local machine to be sent to central using API
:type template_filename: str
:param device_type: Type of the Aruba device, defaults to "IAP"
:type device_type: str, optional
:param version: Firmware version property of template., defaults to "ALL"
:type version: str, optional
:param model: Model property of template. For 'ArubaSwitch' device_type, part number (J number) can be
used, defaults to "ALL"
:type model: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_template(conn, group_name, template_name, template_filename, device_type='', version='', model='')
¶
[summary]
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group in which the template file exists.
:type group_name: str
:param template_name: Name of the template to be modified
:type template_name: str
:param template_filename: Name of the template file in local machine to be sent to central using API
:type template_filename: str
:param device_type: Aruba device type of the template , defaults to ""
:type device_type: str, optional
:param version: Firmware version property of template., defaults to ""
:type version: str, optional
:param model: Device model property of template. For 'ArubaSwitch' device_type, part number (J number) can be
used, defaults to ""
:type model: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
delete_template(conn, group_name, template_name)
¶
Delete an existing template
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of the group in which the template file exists.
:type group_name: str
:param template_name: Name of the template to be deleted.
:type template_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
Variables
¶
Bases: object
A python class consisting of functions to manage Aruba Central Variables via REST API
get_template_variables(conn, device_serial)
¶
Get template variables for a device
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of the device.
:type device_serial: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_all_template_variables(conn, offset=0, limit=20, format='JSON')
¶
Get template variables for all devices
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination offset. Number of items to be skipped before returning the data,
useful for pagination, defaults to 0
:type offset: int, optional
:param limit: Pagination limit. Maximum number of records to be returned, defaults to 20
:type limit: int, optional
:param format: Format in which output is desired, defaults to "JSON"
:type format: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
create_template_variables(conn, device_serial, variables)
¶
Create template variable for a device
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial Number of a device for which the variables are to be created.
:type device_serial: str
:param variables: Variables defined in template file to be applied for a device. Sample Variables -
{"_sys_serial": "AB0011111", "_sys_lan_mac": "11:12:AA:13:14:BB", "SSID_A": "Z-Employee"}
:type variables: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
create_template_variables_file(conn, variables_filename, format='JSON')
¶
Create template variables for multiple devices defined in JSON format in a file
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param variables_filename: Name of the variable file to be sent to Central via API.
:type variables_filename: str
:param format: Format of data in the file to be uploaded, defaults to "JSON"
:type format: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_template_variables(conn, device_serial, variables)
¶
Update values of existing template variables and add new variables to the existing set of variables for a device.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of a device
:type device_serial: str
:param variables: Template variables to be updated for the mentioned device
:type variables: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_template_variables_file(conn, variables_filename)
¶
Update values of existing template variables and add new variables to the existing set of variables for multiple devices defined in the specified file.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param variables_filename: Local filename of template variables to be uploaded to Central via API.
:type variables_filename: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
replace_template_variables(conn, device_serial, variables)
¶
Delete all existing template variables and create requested template variables for a device. This API can be used for deleting some variables out of all for a device.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of a device
:type device_serial: str
:param variables: Delete existing template variables for a device and replace with the new variables.
:type variables: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
replace_template_variables_file(conn, variables_filename, format='JSON')
¶
Delete all existing template variables and create requested template variables for all devices. This API can be used for deleting some variables out of all for all devices.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param variables_filename: filename of template variables to be uploaded to Central via API from local machine.
:type variables_filename: str
:param format: Data format of the specified file, defaults to "JSON"
:type format: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
delete_template_variables(conn, device_serial)
¶
Delete all existing template variables for a device
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Serial number of a device
:type device_serial: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
ApSettings
¶
Bases: object
A Python class to manage AP settings such as AP name, zonename, etc.
get_ap_settings(conn, serial_number: str)
¶
Get existing AP settings
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param serial_number: Serial number of an AP. Example: CNBRHMV3HG
:type serial_number: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_ap_settings(conn, serial_number: str, ap_settings_data: dict)
¶
Update Existing AP Settings
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param serial_number: Serial number of an AP. Example: CNBRHMV3HG
:type serial_number: str
:param ap_settings_data: Data to update ap settings.
* keyword hostname: Name string to set to the AP
* keyword ip_address: IP Address string to set to AP. Should be set to "0.0.0.0" if AP get IP from DHCP.
* keyword zonename: Zonename string to set to AP
* keyword achannel: achannel string to set to AP
* keyword atxpower: atxpower string to set to AP
* keyword gchannel: gchannel string to set to AP
* keyword gtxpower: gtxpower string to set to AP
* keyword dot11a_radio_disable: dot11a_radio_disable string to set to AP
* keyword dot11g_radio_disable: dot11g_radio_disable string to set to AP
* keyword usb_port_disable: usb_port_disable string to set to AP
:type ap_settings_data: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
ApConfiguration
¶
Bases: object
A python class to manage Aruba Central access points with API's from the AP configuration category.
get_ap_config(conn, group_name)
¶
Get whole configuration in CLI format of an UI group or AOS10 device.
:param group_name: Central group name or AOS10 AP serial number. :type group_name: str
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
replace_ap(conn, group_name, data)
¶
Replace whole configuration for a Central UI group or AOS10 device. Configuration is in CLI format.
:param group_name: Central group name or AOS10 AP serial number. :type group_name: str :param data: AP CLI configuration commands. Format for json value is a list of CLI command strings. :type data: json
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
change_wlan_status(conn, group_name, wlan_name, new_wlan_status)
¶
This function lets you enable or disable the specified WLAN in a UI group.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central group which has the WLAN
:type group_name: str
:param wlan_name: Name of WLAN whose status has to be changed
:type wlan_name: str
:param new_wlan_status: Status of WLAN - True => Enable WLAN, False => Disable WLAN
:type new_wlan_status: bool
:return: True when WLAN status was updated successfully. Otherwise, it will return False :rtype: bool
Source code in pycentral/classic/configuration.py
Wlan()
¶
Bases: object
A python class consisting of functions to manage Aruba Central WLANs via REST API. This class uses WLAN APIs that have to be allowlisted for the Aruba Central account
Source code in pycentral/classic/configuration.py
create_wlan(conn, group_name, wlan_name, wlan_data)
¶
Create new WLAN.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central group to create new WLAN
inside.
:type group_name: str
:param wlan_name: Name string for new WLAN
:type wlan_name: str
:param wlan_data: Data to create new WLAN
* keyword essid: SSID name
* keyword type: type designation for new SSID
* keyword hide_ssid: boolean to hide SSID
* keyword vlan: vlan to add new SSID to
* keyword zone: vlan zones to add SSID to
* keyword opmode: SSID security opmode
* keyword wpa_passphrase: Passphrase for SSID
* keyword wpa_passphrase_changed: Should always be set true
* keyword is_locked: Boolean
* keyword captive_profile_name: name for users using captive portal
* keyword bandwidth_limit_up: mb up
* keyword bandwidth_limit_down: mb down
* keyword bandwidth_limit_peruser_up: peruser mb up
* keyword bandwidth_limit_peruser_down: peruser mb down
* keyword access_rules: dict
:type wlan_data: dict(json)
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
create_full_wlan(conn, group_name, wlan_name, wlan_data)
¶
Create new WLAN using the full_wlan endpoint "/configuration/full_wlan/". Used for complex configurations not supported by create_wlan.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central group to create new WLAN
inside.
:type group_name: str
:param wlan_name: Name string for new WLAN
:type wlan_name: str
:param wlan_data: Data to create new WLAN
:type wlan_data: dict(json)
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
delete_wlan(conn, group_name, wlan_name)
¶
Delete an existing WLAN.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Group name of the group or guid of the swarm or
serial number of 10x AP.
:type group_name: str
:param wlan_name: Name of WLAN to delete.
:type wlan_name: str
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_wlan(conn, group_name, wlan_name, wlan_data)
¶
Update an existing WLAN.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Group name of the group or guid of the swarm or
serial number of 10x AP
:type group_name: str
:param wlan_name: Name string for new WLAN
:type wlan_name: str
:param wlan_data: Data to update existing wlan.
:type wlan_data: dict(json)
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
update_full_wlan(conn, group_name, wlan_name, wlan_data)
¶
Update an existing WLAN using the full_wlan endpoint "/configuration/full_wlan/". Used for complex configurations not supported by update_wlan.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Group name of the group or guid of the swarm or
serial number of 10x AP
:type group_name: str
:param wlan_name: Name string for new WLAN
:type wlan_name: str
:param wlan_data: Data to update existing wlan.
:type wlan_data: dict(json)
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_wlan(conn, group_name, wlan_name)
¶
Gets configuration of a WLAN in a Central group.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Group name of the group or guid of the swarm.
:type group_name: str
:param wlan_name: Name string for wlan to get.
:type wlan_name: str
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
get_all_wlans(conn, group_name)
¶
Gets a list of each wlan in a Central group.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Group name of the group or guid of the swarm.
:type group_name: str
:return: Response as provided by 'command' function in class:
pycentral.ArubaCentralBase.
:rtype: dict
Source code in pycentral/classic/configuration.py
enable_wlan(conn, group_name, wlan_name)
¶
This function will enable the WLAN for client connections.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central UI group which has the WLAN
:type group_name: str
:param wlan_name: Name of WLAN which has to be enabled
:type wlan_name: str
Source code in pycentral/classic/configuration.py
disable_wlan(conn, group_name, wlan_name)
¶
This function will disable the WLAN for client connections. Current connected clients will be disconnected from this WLAN.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an
API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central UI group which has the WLAN
:type group_name: str
:param wlan_name: Name of WLAN which has to be disabled
:type wlan_name: str
Source code in pycentral/classic/configuration.py
Constants¶
constants
¶
Device Inventory¶
device_inventory
¶
Inventory
¶
Bases: object
A python class consisting of functions to manage Aruba Central inventory from the new device inventory category via REST API.
get_inventory(conn, sku_type='all', limit=0, offset=0)
¶
Get device details from inventory.
:param conn: Instance of class:pycentral.ArubaCentralBase.
:type conn: class:pycentral.ArubaCentralBase
:param sku_type: target device sku type to pull from inventory.
Acceptable arguments: all, iap, switch, controller, gateway,
vgw, cap, boc, all_ap, all_controller, others.
:type sku_type: str
:param limit: Pagination limit. Defaults to 0, which is intrepreted as
get all. Maximum limit per request is 50.
:type limit: int, optional
:param offset: Pagination offset, defaults to 0.
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in
class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/device_inventory.py
archive_devices(conn, device_serials=[])
¶
Archive a list of devices using serial numbers
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serials: List of serial number of Aruba devices that should be archived
:type device_serials: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/device_inventory.py
unarchive_devices(conn, device_serials=[])
¶
Unarchive a list of devices using serial numbers
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serials: List of serial number of Aruba devices that should be unarchived
:type device_serials: list
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/device_inventory.py
add_devices(conn, device_details)
¶
Add device(s) using Mac & Serial Numbers
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_details: List of dictionaries with Aruba devices that should be added to the Aruba Central account. Each item in the dictionary should have the following keys - mac & serial. For Central On-Premises account, an additional key is required in the dictionary - partNumber
:type device_details: list
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/device_inventory.py
Firmware Management¶
firmware_management
¶
Firmware
¶
A Python Class to manage Aruba Central Device Firmware via REST APIs.
list_firmware_all_swarms(conn, group=None, limit=20, offset=0)
¶
Get a list of swarms with their firmware details. You can optionally specify a group, to filter devices under it
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: Name of the group, defaults to None
:type group: str, optional
:param limit: Pagination limit. Default is 20 and max is 1000, defaults to 20
:type limit: int, optional
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
get_firmware_swarm(conn, swarm_id)
¶
Get firmware details for specific swarm.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param swarm_id: Swarm ID for which the firmware detail to be queried
:type swarm_id: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
list_supported_version(conn, device_type=None, swarm_id=None, serial=None)
¶
Get list of firmware versions for device. Specify device_type "IAP"/"MAS"/"HP"/"CONTROLLER" to get firmware versions for swarms, MAS switches, aruba switches and controllers respectively or you can specify swarm_id to get list of supported version for specific swarm or you can specify serial to get list of supported version for specific device.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_type: Specify one of "IAP/MAS/HP/CONTROLLER", defaults to None
:type device_type: str, optional
:param swarm_id: Swarm ID, defaults to None
:type swarm_id: str, optional
:param serial: Serial of device, defaults to None
:type serial: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
check_firmware_support(conn, firmware_version, device_type)
¶
Check whether specific firmware version is available or not. Specify device_type "IAP"/"MAS"/"HP"/"CONTROLLER" to get firmware versions for swarms/MAS switches/aruba switches/controllers respectively.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param firmware_version: Firmware Version
:type firmware_version: str
:param device_type: Specify one of "IAP/MAS/HP/CONTROLLER"
:type device_type: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
check_firmware_status(conn, serial=None, swarm_id=None)
¶
Get firmware upgrade status of device. You can either specify swarm_id if device_type is "IAP" or serial for rest of device_type, but not both.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param serial: Serial of device, defaults to None
:type serial: str, optional
:param swarm_id: Swarm ID, defaults to None
:type swarm_id: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
upgrade_firmware(conn, firmware_version, reboot=True, device_type=None, model=None, group=None, serial=None, swarm_id=None, schedule_at=None)
¶
Upgrade firmware version for a device or for a whole group of devices under a device type, with additional filter of model. To initiate upgrade for certain type of devices of specific group, specify device_type as one of "IAP" for swarm, "MAS" for MAS switches, "HP" for aruba switches, "CONTROLLER" for controllers respectively, and group name. To upgrade a device, you can specify swarm_id to upgrade a specific swarm or serial to upgrade a specific device. To upgrade a specific model of Aruba switches at group level, please use model in request body.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param firmware_version: Specify firmware version to which you want device to upgrade. If you do not specify this field then firmware upgrade initiated with recommended firmware version
:type firmware_version: str
:param reboot: Use True for auto reboot after successful firmware download. Default value is False. Applicable only on MAS, Aruba switches and controller since IAP reboots automatically after firmware download., defaults to True
:type reboot: bool, optional
:param device_type: Specify one of "IAP/MAS/HP/CONTROLLER", defaults to None
:type device_type: str, optional
:param model: To initiate upgrade at group level for specific model family. Applicable only for Aruba switches, defaults to None
:type model: str, optional
:param group: Specify Group Name to initiate upgrade for whole group., defaults to None
:type group: str, optional
:param serial: Serial of device, defaults to None
:type serial: str, optional
:param swarm_id: Swarm ID, defaults to None
:type swarm_id: str, optional
:param schedule_at: Firmware upgrade will be scheduled at, firmware_scheduled_at - current time. firmware_scheduled_at is epoch in seconds and default value is current time, defaults to None
:type schedule_at: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
cancel_scheduled_upgrade(conn, serial=None, swarm_id=None, device_type=None, group=None)
¶
Cancel scheduled firmware upgrade for a device or for a whole group of devices. To cancel scheduled upgrade for certain type of devices of specific group, specify device_type as one of "IAP" for swarm, "MAS" for MAS switches, "HP" for aruba switches, "CONTROLLER" for controllers respectively, and the group as the group name. To cancel scheduled upgrade a device, you can specify swarm_id of the specific swarm or serial of the specific device.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param serial: Serial of device, defaults to None
:type serial: str, optional
:param swarm_id: Swarm ID, defaults to None
:type swarm_id: str, optional
:param device_type: Specify one of "IAP/MAS/HP/CONTROLLER", defaults to None
:type device_type: str, optional
:param group: Specify Group Name to initiate upgrade for whole group, defaults to None
:type group: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/firmware_management.py
Licensing¶
licensing
¶
Subscriptions
¶
Bases: object
A python class to manage subscriptions for Aruba Central
get_user_subscription_keys(conn, license_type='', offset=0, limit=100)
¶
This function is used to get license subscription keys
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param license_type: Accepts basic/special, defaults to ""
:type license_type: str, optional
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Number of subscriptions to get, defaults to 100
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_enabled_services(conn)
¶
This function is used to get the list of services which are enabled for customer.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
assign_device_subscription(conn, device_serials, services)
¶
This function is used to assign subscriptions to device by specifying its serial.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serials: List of serial number of device.
:type device_serials: list
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
unassign_device_subscription(conn, device_serials, services)
¶
This function is used to unassign subscriptions to device by specifying its serial.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serials: List of serial number of device.
:type device_serials: list
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_user_subscription_status(conn, license_type='all', service='')
¶
This function is used to return subscription stats.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param license_type: basic/special/all. special - will fetch the statistics of special central services like presence analytics(pa), ucc, clarity etc basic - will fetch the statistics of device management service licenses, all - will fetch both of these license types, defaults to "all"
:type license_type: str, optional
:param service: Service type: pa/pa,clarity etc, defaults to ""
:type service: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_services_license_config(conn, service_category='', device_type='')
¶
This function is used to return services configuration for licensing purpose.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param service_category: Service category - dm/network, defaults to ""
:type service_category: str, optional
:param device_type: Device Type - iap/switch, defaults to ""
:type device_type: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
assign_subscription_all(conn, services)
¶
This function is used to assign licenses to all devices for given services.
Note: This API is not applicable for MSP customer
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
unassign_subscription_all(conn, services)
¶
This function is used to unassign licenses to all devices for given services.
Note: This API is not applicable for MSP customer
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
assign_msp_subscription_all(conn, services, include_customers=[], exclude_customers=[])
¶
Assign licenses to all devices owned by tenant customers for given services. If include_customers and exclude_customers parameters are not provided, licenses will be assigned for all customers(MSP, tenants) devices.
Note: License assignment is not supported for the MSP owned devices. Since it is a background job, please wait for few minutes for all devices to be subscribed in case of customer having large number of devices
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:param include_customers: if provided, licenses will be assigned only for the customers present in include_customers list
(Exception: License assignment will be ignored for MSP owned devices), default=[]
:type include_customers: list, optional
:param exclude_customers: if provided, licenses will be assigned for MSP/tenant customers except the customers present in exclude_customers list, default=[]
:type exclude_customers: list, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
unassign_msp_subscription_all(conn, services, include_customers=[], exclude_customers=[])
¶
Remove service licenses to all devices the devices owned by tenant and MSP. However license assignment is not supported for the MSP owned devices but un-assignment is supported for the customers who are transitioning from Non-MSP to MSP mode to release license quantity for better utilization.
Note: If include_customers and exclude_customers parameters are not provided, licenses will be unassigned for all customers(MSP, tenants) devices.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:param include_customers: if provided, licenses will be unassigned only for the customers present in include_customers list.
(Exception: License assignment will be ignored for MSP owned devices), default=[]
:type include_customers: list, optional
:param exclude_customers: if provided, licenses will be unassigned for MSP/tenant customers except the customers present in exclude_customers list, default=[]
:type exclude_customers: list, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
AutoLicense
¶
Bases: object
A python class to manage auto-licenses for Aruba Central
disable_autolicensing_services(conn, services)
¶
This function is used to disable auto licensing. Note: This API is not applicable for MSP customer
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_autolicense_services(conn)
¶
This function is used to get services which are auto enabled.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
assign_autolicense_services(conn, services)
¶
This function is used to assign licenses to all devices for given services and enable auto licensing.
Note: This API is not applicable for MSP customer
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
disable_msp_autolicense_services(conn, services, include_customers=[], exclude_customers=[])
¶
Disable auto license settings for MSP and Tenants for the given services. This will not change the current license device mapping
Note: If include_customers and exclude_customers are not provided then auto license setting will be disabled for all customers i.e MSP and tenants.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:param include_customers: if provided, licensing will be disable only for the customers present in include_customers list, defaults to []
:type include_customers: list, optional
:param exclude_customers: if provided, licensing will be disabled for the customers except the customers present in exclude_customers list, defaults to []
:type exclude_customers: list, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_msp_autolicense_services(conn, customer_id: str)
¶
[summary]
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_id: Customer id of msp or tenant.
:type customer_id: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
assign_msp_autolicense_services(conn, services, include_customers=[], exclude_customers=[])
¶
Enable auto license settings for MSP and Tenants. Assign licenses for given services to all the devices owned by tenant customers.
Note - License assignment is not supported for the MSP owned devices. License assignment will be in paused state if the total license tokens are less than total device counts(including MSP and tenants)
Note: If include_customers and exclude_customers are not provided then license settings will be enabled for all customers i.e MSP, tenants and future tenants(Note: Newly created tenant will be inherited license settings from MSP)
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param services: List of service names. Call services/config API to get the list of valid service names.
:type services: list
:param include_customers: if provided, license settings will be enabled only for the customers present
in include_customers list., defaults to []
:type include_customers: list, optional
:param exclude_customers: if provided, license settings will be enabled for customers except the customers present in exclude_customers list, defaults to []
:type exclude_customers: list, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
get_license_status(conn, service_name: str)
¶
Get services and corresponding license token availability status. If True, license tokens are more than device count else less than device count.(Note - Autolicense is in paused state when license tokens are less than device count)
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param service_name: Specific service name(dm/pa/..). Call services/config API to get the list of valid service names.
:type service_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/licensing.py
Monitoring¶
monitoring
¶
Sites
¶
Bases: object
A python class consisting of functions to manage Aruba Central Sites via REST API
get_sites(conn, calculate_total=False, offset=0, limit=100, sort='+site_name')
¶
Get list of sites
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param calculate_total: Whether to calculate total number of sites, defaults to False
:type calculate_total: bool, optional
:param offset: Pagination offset, defaults to 0
:type offset: int, optional
:param limit: Pagination limit with Max 1000, defaults to 100
:type limit: int, optional
:param sort: Sort list of sites based on one of '+site_name', '-site_name', defaults to "+site_name"
:type sort: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
create_site(conn, site_name, site_address={}, geolocation={})
¶
Creates a new site
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_name: Name of the site be created.
:type site_name: str
:param site_address: Address of the site, defaults to {}
* keyword address: Site address string
* keyword city: City name string
* keyword state: State name string
* keyword country: Country name string
* keyword zipcode: Zipcode string
:type site_address: dict, optional :param geolocation: Mutually exclusive with site address. Provide either one option, defaults to {}
* keyword latitude: Site location latitude in the world map
* keyword longitude: Site location longitude in the world map
:type geolocation: dict, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
update_site(conn, site_id, site_name, site_address={}, geolocation={})
¶
Update/Modify an existing site
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: ID assigned by Aruba Central when the site is created. Can be obtained from find_site_id function.
:type site_id: int
:param site_name: Name of the site be created.
:type site_name: str
:param site_address: Address of the site, defaults to {}
* keyword address: Site address string
* keyword city: City name string
* keyword state: State name string
* keyword country: Country name string
* keyword zipcode: Zipcode string
:type site_address: dict, optional :param geolocation: Mutually exclusive with site address. Provide either one option, defaults to {}
* keyword latitude: Site location latitude in the world map
* keyword longitude: Site location longitude in the world map
:type geolocation: dict, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
delete_site(conn, site_id)
¶
Delete an existing site
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: ID assigned by Aruba Central when the site is created. Can be obtained from find_site_id function.
:type site_id: int
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
associate_devices(conn, site_id, device_type, device_ids)
¶
Associate multiple devices to a site
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: ID assigned by Aruba Central when the site is created. Can be obtained from find_site_id function.
:type site_id: int
:param device_type: Type of the device. One of the "IAP", "ArubaSwitch", "CX", "MobilityController".
:type device_type: str
:param device_ids: List of Aruba devices' serial number
:type device_ids: list
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
unassociate_devices(conn, site_id, device_type, device_ids)
¶
Unassociate a device from a site
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: ID assigned by Aruba Central when the site is created. Can be obtained
from find_site_id function.
:type site_id: int
:param device_type: Type of the device. One of the "IAP", "ArubaSwitch", "CX", "MobilityController".
:type device_type: str
:param device_id: Aruba device serial number
:type device_id: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
find_site_id(conn, site_name)
¶
Find site id from site name
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_name: Name of the site be created.
:type site_name: str
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/monitoring.py
MSP¶
msp
¶
MSP
¶
Bases: object
A python class consisting of functions to manage Aruba Central's MSP mode via REST API
get_customers(conn, offset=0, limit=100, customer_name=None)
¶
This function returns the list of customers based on the provided parameters
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 100
:type limit: int, optional
:param customer_name: Filter on customer name, defaults to None.
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_all_customers(conn)
¶
This function returns a list of all the customers in the MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: Returns list of dictionaries. Each dictionary has the following keys associated with a customer - account_status, account_type, ap_config_diff, application_id, application_instance_id, created_at, customer_id, customer_name, description, device_quota, hppc_config_diff, lock_msp_ssids, msp_conversion_status, msp_id, platform_customer_details, platform_customer_id, provision_status, region, switch_config_diff, updated_at, username
:rtype: list
Source code in pycentral/classic/msp.py
create_customer(conn, customer_details)
¶
This function creates a customer in the MSP account based on the provided customer details
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_details: Details of customer that has to be created. The customer details should have the following the keys - customer_name, country_name, street_address, city, state, country_name, zip_postal_code. These keys are optional - lock_msp_ssids, description, group_name
:type customer_details: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
__validate_customer_attributes__(customer_details)
¶
This function verifies the customer details to ensure that the necessary parameters for the "create customer" API are present in the customer details body. :param customer_details: Details of customer that has to be created. The customer details should have the following the keys - customer_name, country_name, street_address, city, state, country_name, zip_postal_code. These keys are optional - lock_msp_ssids, description, group_name :type customer_details: dict :return: True when the necessary parameters are available in the customer details. :rtype: bool
Source code in pycentral/classic/msp.py
__create_customer_body__(conn, customer_details)
¶
This function creates the create customer API's body
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_details: Details of customer that has to be created. The customer details should have the following the keys - customer_name, country_name, street_address, city, state, country_name, zip_postal_code. These keys are optional - lock_msp_ssids, description, group_name
:type customer_details: dict
:return: Dictionary that has the customer details structured for the customer API body
:rtype: dict
Source code in pycentral/classic/msp.py
update_customer(conn, customer_details, customer_id=None, customer_name=None)
¶
This function updates the details of an existing customer in the MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_details: Details of customer that has to be updated. The customer details should have the following the keys - customer_name, country_name, street_address, city, state, country_name, zip_postal_code. These keys are optional - lock_msp_ssids, description, group_name
:type customer_details: dict
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
delete_customer(conn, customer_id=None, customer_name=None)
¶
This function deletes the customer in the MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_customer_details(conn, customer_id=None, customer_name=None)
¶
This function fetches the details of the customer in the MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_customer_id(conn, customer_name=None)
¶
This function fetches the customer id of the customer based on the customer name.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Customer ID of the customer. It will return None if no customer is found
:rtype: string
Source code in pycentral/classic/msp.py
get_msp_id(conn)
¶
This function fetches the MSP ID of the MSP.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: MSP ID of the MSP account. It will return None if no ID is found
:rtype: string
Source code in pycentral/classic/msp.py
get_country_code(conn, country_name)
¶
This function fetches the country code of a country. This country code is needed for the Create Customer API
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param country_name: Name of country
:type country_name: str
:return: Country Code of country. It will return None if no country is found
:rtype: string
Source code in pycentral/classic/msp.py
get_country_codes_list(conn)
¶
This function fetches the dictionary of the country codes of countries. The keys of the dictionary are the country names and the values are the country codes
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_msp_users(conn, offset=0, limit=10)
¶
This function returns the list of users under the MSP account based on the provided parameters
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 10
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_customer_users(conn, offset=0, limit=10, customer_id=None, customer_name=None)
¶
This function returns the list of users under a customer in the MSP account based on the provided parameters
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 10
:type limit: int, optional
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_msp_resources(conn)
¶
This function returns the branding resources under an MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
edit_msp_resources(conn, resources_dict)
¶
This function edits the branding resources under an MSP account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param resources_dict: Details of new branding resources of the MSP. This parameter's structure should match the structure of the sample API body in the Swagger.
:type resources_dict: dict
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_customer_devices_and_subscriptions(conn, customer_id=None, customer_name=None, offset=0, limit=10, device_type=None)
¶
This function gets the devices & subscriptions under the customer account based on the provided parameters
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 10
:type limit: int, optional
:param device_type: Filter on device_type. Accepted values - iap, switch, all_controller. Defaults to None.
:type device_type: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
assign_devices_to_customers(conn, devices, group_name=None, customer_id=None, customer_name=None)
¶
This function assign devices to customer
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param devices: List of dictionaries of devices that will be assigned to the customer account. Each dictionary corresponds to a device & will have the following keys - serial, mac
:type devices: list
:param group_name: Name of the group to which the devices will be moved to within the customer.
:type group_name: str, optional
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
unassign_devices_from_customers(conn, devices, msp_id=None)
¶
This function unassign devices from the customer to the MSP's device inventory
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param devices: List of dictionaries of devices that will be assigned to the customer account. Each dictionary corresponds to a device & will have the following keys - serial, mac
:type devices: list
:param msp_id: ID of the MSP account. If no ID is provided, then the the msp_id will be fetched with the get_msp_id function
:type msp_id: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
unassign_all_customer_device(conn, customer_id=None, customer_name=None)
¶
This function unassigns all devices & subscriptions from a customer's Central Instance. It will move these devices & subsciptions to the MSP's device & subscription inventory.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_id: Customer ID of the customer, defaults to None.
:type customer_id: str, optional
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_msp_devices_and_subscriptions(conn, offset=0, limit=10, device_allocation_status=0, device_type=None, customer_name=None)
¶
This function fetches the list of devices & licenses under the MSP account based on the provided parameters.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 100
:type limit: int, optional
:param device_allocation_status: Filter on device_allocation_status. This parameter accepts the following values - 0(All), 1(Allocated),2(Available). Defaults to 0.
:type device_allocation_status: str, optional
:param device_type: Filter on device_type. Accepted values - iap, switch, all_controller. Defaults to None.
:type device_type: str, optional
:param customer_name: Name of customer, defaults to None.
:type customer_name: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/msp.py
get_msp_all_devices_and_subscriptions(conn, customer_name=None)
¶
This function fetches all the devices & subscriptions from a MSP account. If the customer_name parameter is passed, then it will return all the devices & licenses in the customer account.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param customer_name: Name of customer, defaults to None. This parameter will be ignored if customer_id parameter is passed
:type customer_name: str, optional
:return: List of device & licenses in the MSP or customer account
:rtype: list
Source code in pycentral/classic/msp.py
get_customers_per_group(conn, group_name, offset=0, limit=10)
¶
This function fetches the list of customers to MSP group based on the provided parameters.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group_name: MSP group name
:type group_name: str
:param offset: Pagination start index, defaults to 0
:type offset: int, optional
:param limit: Pagination end index, defaults to 10
:type limit: int, optional
:return: List of device & licenses in the MSP or customer account
:rtype: list
Source code in pycentral/classic/msp.py
RAPIDS¶
rapids
¶
Rogues
¶
A Python class to obtain Aruba Central's Rougue details via REST APIs.
list_rogue_aps(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, offset=0)
¶
Get rogue APs over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds.
Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
list_interfering_aps(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, offset=0)
¶
Get interfering APs over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds.
Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds.
Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
list_suspect_aps(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, offset=0)
¶
Get suspect APs over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
list_neighbor_aps(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, offset=0)
¶
Get neighbor APs over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
WIDS
¶
A Python Class to obtain Aruba Central's Wireless Intrusion Detection details based on REST APIs.
list_client_attacks(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, calculate_total=True, sort='-ts', offset=0)
¶
Get client attacks over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param calculate_total: Whether to calculate total client attacks, defaults to True
:type calculate_total: bool, optional
:param sort: Sort parameter -ts(sort based on the timestamps in descending), +ts(sort based on timestamps ascending), -macaddr (sort based on station mac descending) and +macaddr(sort based station mac ascending), defaults to "-ts"
:type sort: str, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
list_infrastructure_attacks(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, calculate_total=True, sort='-ts', offset=0)
¶
Get infrastructure attacks over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param calculate_total: Whether to calculate total client attacks, defaults to True
:type calculate_total: bool, optional
:param sort: Sort parameter -ts(sort based on the timestamps in descending), +ts(sort based on timestamps ascending), -macaddr (sort based on station mac descending) and +macaddr(sort based station mac ascending), defaults to "-ts"
:type sort: str, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
list_wids_attacks(conn, group=None, label=None, site=None, swarm_id=None, start=None, end=None, from_timestamp=None, to_timestamp=None, limit=100, sort='-ts', offset=0)
¶
Get WIDS events over a time period
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param group: List of group names, defaults to None
:type group: list, optional
:param label: List of label names, defaults to None
:type label: list, optional
:param site: List of site names, defaults to None
:type site: list, optional
:param swarm_id: Filter by Swarm ID, defaults to None
:type swarm_id: str, optional
:param start: Need information from this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp minus 3 hours, defaults to None
:type start: int, optional
:param end: Need information to this timestamp. Timestamp is epoch in milliseconds. Default is current timestamp, defaults to None
:type end: int, optional
:param from_timestamp: This parameter supercedes start parameter. Need information from this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp minus 3 hours, defaults to None
:type from_timestamp: int, optional
:param to_timestamp: This parameter supercedes end parameter. Need information to this timestamp. Timestamp is epoch in seconds. Default is current UTC timestamp, defaults to None
:type to_timestamp: int, optional
:param limit: pagination size (default = 100), defaults to 100
:type limit: int, optional
:param sort: Sort parameter -ts(sort based on the timestamps in descending), +ts(sort based on timestamps ascending), -macaddr (sort based on station mac descending) and +macaddr(sort based station mac ascending), defaults to "-ts"
:type sort: str, optional
:param offset: Pagination offset (default = 0), defaults to 0
:type offset: int, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/rapids.py
Refresh API Token¶
refresh_api_token
¶
RefreshApiToken
¶
Bases: object
Refresh the API access token in API Gateway using OAUTH API
refresh_token(conn, apigw_client_id, apigw_client_secret, old_refresh_token)
¶
This function refreshes the existing access token and replaces old token with new token. The returned token dict will contain both access and refresh token. Use refresh token provided in the return dict for next refresh.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param apigw_client_id: Client ID from API Gateway page
:type apigw_client_id: str
:param apigw_client_secret: Client Secret from API Gateway page
:type apigw_client_secret: str
:param old_refresh_token: Refresh token value from the current/expired API token.
:type old_refresh_token: str
:return: Refrehed token dict consisting of access_token and refresh_token.
:rtype: dict
Source code in pycentral/classic/refresh_api_token.py
Topology¶
topology
¶
Topology
¶
A python class to obtain Aruba Central Site's topology details via REST APIs.
get_topology(conn, site_id)
¶
Get topology details of a site. The input is the id corresponding to a label or a site.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: Site ID
:type site_id: int
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
get_device_details(conn, device_serial)
¶
Provides details of a device when serial number is passed as input.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Device Serial Number
:type device_serial: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
get_edge_details(conn, source_serial, dest_serial)
¶
Get details of an edge grouped by lagname. The serials of nodes/devices on both sides of the edge should passed as input.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param source_serial: Device serial number.
:type source_serial: str
:param dest_serial: Device serial number.
:type dest_serial: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
get_uplink_details(conn, source_serial, uplink_id)
¶
Get details of an uplink. The serials of node/device on one side of the uplink and the uplink id of the uplink should passed as input.Desired uplink id can be found in get topology details api.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param source_serial: Device serial number.xx
:type source_serial: str
:param uplink_id: Uplink id.
:type uplink_id: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
tunnel_details(conn, site_id, tunnel_map_names)
¶
Get tunnel details.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param site_id: Site ID
:type site_id: int
:param tunnel_map_names: Comma separated list of tunnel map names.
:type tunnel_map_names: list
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
ap_lldp_neighbors(conn, device_serial)
¶
Get neighbor details reported by AP via LLDP.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param device_serial: Device serial number.
:type device_serial: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/topology.py
URL Utility¶
url_utils
¶
User Management¶
user_management
¶
Users
¶
Bases: object
A Python class to manage Aruba Central Users via REST APIs.
list_users(conn, limit=20, offset=0, sort='+timestamp', email=None)
¶
(This API will be deprecated in future release). Use get_users(). Returns all users from the system associated to user's account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param limit: Maximum number of items to return, defaults to 20
:type limit: int, optional
:param offset: Zero based offset to start from, defaults to 0
:type offset: int, optional
:param sort: Sort ordering. One if +timestamp/-timestamp/+username/ -username, defaults to "+timestamp"
:type sort: str, optional
:param email: Filter users by email, defaults to None
:type email: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
get_users(conn, limit=20, offset=0, order_by='+username', app_name=None, user_type=None, status=None)
¶
Returns all users from the system associated to user's account
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param limit: Maximum number of items to return, defaults to 20
:type limit: int, optional
:param offset: Zero based offset to start from, defaults to 0
:type offset: int, optional
:param order_by: Sort ordering (ascending or descending). +username signifies ascending order of username., defaults to "+username"
:type order_by: str, optional
:param app_name: Filter users based on app_name, defaults to None
:type app_name: str, optional
:param user_type: Filter based on system or federated user, defaults to None
:type user_type: str, optional
:param status: Filter user based on status (inprogress, failed), defaults to None
:type status: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
get_user(conn, username, system_user=True)
¶
Get user account details specified by user email
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param username: User's email id is specified as the user id
:type username: str
:param system_user: false if federated user, defaults to True
:type system_user: bool, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
create_user(conn, username: str, password: str, description: str, name: dict, phone: str, address: dict, applications: dict)
¶
Create a user account. For public cloud environment, user has to re-register via invitation email. Email will be sent during processing of this request. Providing role on account setting app is mandatory in this API along with other subscribed apps. Scope must be given only for NMS app. For non-nms apps such as account setting refer the parameters in the example json payload.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param username: User's email id is specified as the user id
:type username: str
:param password: password of user account, defaults to None
:type password: str
:param description: description of user
:type description: str
:param name: 'firstname' and 'lastname' of the user.
:type name: dict
:param phone: Phone number. Format: +country_code-local_number
:type phone: str
:param address: Address of the user. Dict containing 'street', 'city', 'state', 'country' and 'zipcode'.
:type address: dict
:param applications: Define applications that needs access.
* keyword name: Name of the application. Example: 'nms', 'account_setting', etc.
* keyword info: A list of dictionaries. Each element containing 'role', 'tenant_role', and 'scope'. Where 'scope' contains 'groups' key with list of groups.
:type applications: dict
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
update_user(conn, username: str, description: str, name: dict, phone: str, address: dict, applications: dict)
¶
Update user account details specified by user id. Providing info on account setting app is mandatory in this API along with other subscribed apps.Scope must be given only for NMS app. For non-nms apps such as account setting refer the parameters in the example json payload.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param username: User's email id is specified as the user id
:type username: str
:param description: description of user
:type description: str
:param name: 'firstname' and 'lastname' of the user.
:type name: dict
:param phone: Phone number. Format: +country_code-local_number
:type phone: str
:param address: Address of the user. Dict containing 'street', 'city', 'state', 'country' and 'zipcode'.
:type address: dict
:param applications: Define applications that needs access.
* keyword name: Name of the application. Example: 'nms', 'account_setting', etc.
* keyword info: A list of dictionaries. Each element containing 'role', 'tenant_role', and 'scope'. Where 'scope' contains 'groups' key with list of groups.
:type applications: dict
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
delete_user(conn, username, system_user=True)
¶
Delete user account details specified by user id
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param username: User's email id is specified as the user id
:type username: str
:param system_user: false if federated user, defaults to True
:type system_user: bool, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
Roles
¶
Bases: object
A Python class to manage Aruba Central User Roles via REST APIs.
get_user_roles(conn, app_name=None, limit=20, offset=0, order_by='+rolename')
¶
Get list of all roles
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param app_name: Filter users based on app_name, defaults to None
:type app_name: str, optional
:param limit: Maximum number of items to return, defaults to 20
:type limit: int, optional
:param offset: Zero based offset to start from, defaults to 0
:type offset: int, optional
:param order_by: Sort ordering. +rolename means ascending order of rolename, defaults to "+rolename"
:type order_by: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
create_user_role(conn, app_name, rolename, applications, permission='modify')
¶
Create an user role in an app
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param app_name: app name where role needs to be created
:type app_name: str
:param rolename: name of the role
:type rolename: str
:param applications: List of dict. Each element containing the following structure.
* keyword appname: Name of the application. Example: 'nms', 'account_setting', etc.
* keyword modules: A list of dictionaries. Each element containing 'module_name'
and 'permission' for the modules.
* keyword permission: permission for the app
:type applications: dict
:param permission: permission of the role, defaults to "modify"
:type permission: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
delete_user_role(conn, app_name, rolename)
¶
Delete a role specified by role name
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param app_name: app name
:type app_name: str
:param rolename: User role name
:type rolename: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
get_user_role(conn, app_name, rolename)
¶
Get Role details
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param app_name: app name
:type app_name: str
:param rolename: User role name
:type rolename: str
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
update_user_role(conn, app_name, rolename, applications, permission='modify')
¶
Update a role specified by role name
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param app_name: app name
:type app_name: str
:param rolename: User role name
:type rolename: str
:param applications: List of dict. Each element containing the following structure.
* keyword appname: Name of the application. Example: 'nms', 'account_setting', etc.
* keyword modules: A list of dictionaries. Each element containing 'module_name' and 'permission' for the modules.
* keyword permission: permission for the app
:type applications: dict
:param permission: [description], defaults to "modify"
:type permission: str, optional
:return: HTTP Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/user_management.py
VisualRF¶
visualrf
¶
ClientLocation
¶
Bases: object
A python class to obtain client location based on visualRF floor map.
get_client_location(conn, macaddr: str, offset=0, limit=100, units='FEET')
¶
Get location of a client. This function provides output only when visualRF is configured in Aruba Central.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param macaddr: Provide a macaddr of a client. For example "ac:bb:cc:dd:ec:10"
:type macaddr: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_floor_clients(conn, floor_id: str, offset=0, limit=100, units='FEET')
¶
Get location of clients within a floormap in Aruba Central visualRF.
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param floor_id: Provide floor_id returned by get_building_floors() function in class:FloorPlan
:type floor_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
RougueLocation
¶
Bases: object
A python class to obtain location of rogue access points
get_rogueap_location(conn, macaddr: str, offset=0, limit=100, units='FEET')
¶
Get location of rogue a access point based on its Mac Address
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param macaddr: Provide Mac Address of an Access Point
:type macaddr: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_floor_rogueaps(conn, floor_id: str, offset=0, limit=100, units='FEET')
¶
Get rogue access points within a floor
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param floor_id: Provide floor id. Can be obtained from get_building_floors() within class:FloorPlan
:type floor_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
FloorPlan
¶
Bases: object
A Python class to obtain information of floorplan in Aruba Central visualRF.
get_campus_list(conn, offset=0, limit=100)
¶
Get list of campuses in visualRF floorplan
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_campus_buildings(conn, campus_id: str, offset=0, limit=100)
¶
Get campus info and buildings within the campus
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param campus_id: Provide campus id. Can be obtained from get_campus_list function in class:FloorPlan
:type campus_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_building_floors(conn, building_id: str, offset=0, limit=100, units='FEET')
¶
Get building info and floors within the building
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param building_id: Provide building id. Can be obtained from get_campus_buildings within class:FloorPlan
:type building_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_floor_info(conn, floor_id: str, offset=0, limit=100, units='FEET')
¶
Get floor information
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param floor_id: Provide floor id. Can be obtained from get_building_floors() within class:FloorPlan
:type floor_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_floor_image(conn, floor_id, offset=0, limit=100)
¶
Get Floor's background image in base64 format
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param floor_id: Provide floor id. Can be obtained from get_building_floors() within class:FloorPlan
:type floor_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_floor_aps(conn, floor_id, offset=0, limit=100, units='FEET')
¶
Get access points within a floor
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param floor_id: Provide floor id. Can be obtained from get_building_floors() within class:FloorPlan
:type floor_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict
Source code in pycentral/classic/visualrf.py
get_ap_location(conn, ap_id: str, offset=0, limit=100, units='FEET')
¶
Get location of an access point within a floorplan
:param conn: Instance of class:pycentral.ArubaCentralBase to make an API call.
:type conn: class:pycentral.ArubaCentralBase
:param ap_id: Provide ap_id returned by get_floor_aps() within class:FloorPlan
:type ap_id: str
:param offset: Pagination start index., defaults to 0
:type offset: int, optional
:param limit: Pagination size. Default 100 Max 100, defaults to 100
:type limit: int, optional
:param units: METERS or FEET, defaults to "FEET"
:type units: str, optional
:return: Response as provided by 'command' function in class:pycentral.ArubaCentralBase
:rtype: dict