pyaoscx.qos module

class pyaoscx.qos.Qos(session, name, **kwargs)

Bases: pyaoscx.pyaoscx_module.PyaoscxModule

Provide configuration management for QoS on AOS-CX devices.

apply()
Main method used to either create or update an existing Schedule
Profile. Checks whether the QoS configuration exists in the switch. Calls self.update() if object is being updated. Calls self.create() if a new object is being created.
Return modified:
 Boolean, True if object was created or modified.
base_uri = 'system/qos'
create()
Perform a POST request to create a new QoS configuration using the
object’s attributes as the request’s body. An exception is raised if object cannot be created.
Return modified:
 Boolean, True if entry was created.
delete()

Perform a DELETE call to delete QoS table entry.

classmethod from_response(session, response_data)

Create a Qos object given a response_data related to it.

Parameters:
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • response_data – The response must be a dictionary of the form: { “<QoS name>”: “/rest/v10.08/system/qos/<QoS name>” }
Returns:

Qos Object.

classmethod from_uri(session, uri)

Create a Qos object given a QoS URI.

Parameters:
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • uri – a String with a URI.
Return name, qos:
 

tuple with the name of a QoS configuration, and a corresponding object.

get(depth=None, selector=None)
Perform a GET call to retrieve data for a QoS table entry and fill the
object with the incoming attributes.
Parameters:
  • depth – Integer deciding how many levels into the API JSON that references will be returned.
  • selector – Alphanumeric option to select specific information to return.
Returns:

Returns True if no exception is raised.

classmethod get_all(session)

Perfom GET request to retrieve all Schedule Profiles in a switch.

Parameters:session – pyaoscx.Session object used to represent a logical.
Returns:Dictionary containing all system QoS configurations.
get_uri()

Method used to obtain the this instance’s URI.

Returns:Object’s URI.
indices = ['name']
modified

Return boolean with whether this object has been modified.

name

Method used to obtain the specific name.

Returns:returns the name of this Qos object.
resource_uri_name = 'qos'
classmethod set_global_schedule_profile(session, profile)
Sets the global schedule profile (the name of a Qos object) for the
switch.
Parameters:
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • profile – Name of a schedule profile (the name of a Qos object) to set as the global schedule profile.
classmethod set_global_trust_mode(session, trust_mode)

Sets the global trust mode for the switch.

Parameters:
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • trust_mode – A string to set the global trust mode, which can be one of the following: “cos”, “dscp”, “none”, or “default”. Use the default option to use the switch’s default trust mode.
Returns:

Returns True if configuration was modified.

update()

Perform a PUT call to apply changes to an existing Schedule Profile.

Return modified:
 True if Object was modified and a PUT request was made.
was_modified()

Getter method to check it object has been modified.

Returns:Boolean True if the object was recently modified.