centralcli package
centralcli.central module
centralcli.caas module
centralcli.cache module
centralcli.cleaner module
centralcli.config module
- class centralcli.config.ClusterName(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- internal = 'internal'
- prod1 = 'prod1'
- prod2 = 'prod2'
- prod4 = 'prod4'
- class centralcli.config.Config(base_dir: Path | None = None)
Bases:
object- property cache_file
- first_run() str
Method to collect configuration from user when no config file exists.
- Returns:
- The contents of the config file (yaml.safe_dump) or None if
user chooses to bypass.
- Return type:
str|None
- get(key: str, default: Any | None = None) Any
- get_account_from_args() str
Determine account to use based on arguments & last_account file.
Method does no harm / triggers no errors. Any errors are handled in account_name_callback after cli is loaded. We need to determine the account during init to load the cache for auto completion.
- Returns:
The account to use based on –account -d flags and last_account file.
- Return type:
str
- static get_file_data(import_file: Path, text_ok: bool = False, model: Any | None = None) dict | list
Returns dict from yaml/json/csv or list of lines from file when text_ok=True.
- Parameters:
import_file (Path) – import file.
text_ok (bool, optional) – When file extension is not one of yaml/yml/json/csv/tsv… parse file as text and return list of lines. Defaults to False.
model (Any, optional) – Pydantic Model to return, dict from import is passed into model for validation.
- Raises:
UserWarning – Raises UserWarning when text_ok is False (default) and extension is not in [‘.yaml’, ‘.yml’, ‘.json’, ‘.csv’, ‘.tsv’, ‘.dbf’]
UserWarning – Raises UserWarning when a failure occurs when parsing the file, passes on the underlying exception.
- Returns:
- Normally dict, list when text_ok and file extension not in
[‘.yaml’, ‘.yml’, ‘.json’, ‘.csv’, ‘.tsv’, ‘.dbf’].
- Return type:
Union[dict, list]
- get_last_account() Tuple[str | None, float | None, bool | None]
Gathers contents of last_account returns tuple with values.
- last_account file stores: name of last account, timestamp of last command, numeric bool if big (will forget) msg has been displayed.
expiration is calculated based on the value of account_will_forget and delta between last_command timestamp and now.
- Returns:
last_account, timestamp of last cmd using this account, if initial will_forget_msg has been displayed, if account is expired
- Return type:
Tuple[None, str | None, float | bool | None, bool]
- property is_cop
- property last_command_file
- property tok_file: Path
- property token_store
- property tokens
- update_last_account_file(account: str, last_cmd_ts: int | float = 1728500150.28, msg_shown: bool = False)
- property valid
- property wh_port
- class centralcli.config.SafeLineLoader(stream)
Bases:
SafeLoaderLoader class that keeps track of line numbers.
- compose_node(parent: Node, index: int) Node
Annotate a node with the first line it was seen.
- class centralcli.config.ServiceNow(*, id: str, url: Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], port: int = None, incident_path: str, refresh_path: str = 'oauth_token.do', assignment_group: str, client_id: str, client_secret: str, token: SnowTokens = None, tok_file: Path = None)
Bases:
BaseModel- assignment_group: str
- base_url: HttpUrl
- client_id: str
- client_secret: str
- id: str
- incident_path: str
- property incident_url: URL
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'assignment_group': FieldInfo(annotation=str, required=True), 'base_url': FieldInfo(annotation=Url, required=True, alias='url', alias_priority=2, metadata=[UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'client_id': FieldInfo(annotation=str, required=True), 'client_secret': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=True), 'incident_path': FieldInfo(annotation=str, required=True), 'port': FieldInfo(annotation=int, required=False, default=None), 'refresh_path': FieldInfo(annotation=str, required=False, default='oauth_token.do'), 'tok_file': FieldInfo(annotation=Path, required=False, default=None), 'token': FieldInfo(annotation=SnowTokens, required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- port: int
- refresh_path: str
- property refresh_url: URL
- tok_file: Path
- token: SnowTokens
- class centralcli.config.SnowTokens(*, config: Token, cache: Token | None = None)
Bases:
BaseModel- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'cache': FieldInfo(annotation=Union[Token, NoneType], required=False, default=None), 'config': FieldInfo(annotation=Token, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class centralcli.config.Token(*, access_token: str, refresh_token: str)
Bases:
BaseModel- access: str
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'access': FieldInfo(annotation=str, required=True, alias='access_token', alias_priority=2), 'refresh': FieldInfo(annotation=str, required=True, alias='refresh_token', alias_priority=2)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- refresh: str
- class centralcli.config.WebHook(*, token: str | None = None, port: int | None = 9443)
Bases:
BaseModel- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'port': FieldInfo(annotation=Union[int, NoneType], required=False, default=9443), 'token': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- port: int | None
- token: str | None
- centralcli.config.abort()
- centralcli.config.ask(prompt: str = '', *, console: Console | None = None, password: bool = False, choices: List[str] | None = None, show_default: bool = True, show_choices: bool = True) str
wrapper function for rich.Prompt().ask()
Handles KeyBoardInterrupt, EoFError, and exits if user inputs “abort”
- centralcli.config.get_cluster_url(cluster: ClusterName) str
- centralcli.config.load_yaml(fname: Path) List | Dict | str
Load a YAML file.
- centralcli.config.parse_yaml(content: str | TextIO) List | Dict | str
Load a YAML file.
centralcli.constants module
- class centralcli.constants.AlertSeverity(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- critical = 'critical'
- info = 'info'
- major = 'major'
- minor = 'minor'
- warning = 'warning'
- class centralcli.constants.AlertTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- client = 'client'
- device = 'device'
- ids = 'ids'
- user = 'user'
- class centralcli.constants.AllDevTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- cx = 'cx'
- gw = 'gw'
- sw = 'sw'
- switch = 'switch'
- class centralcli.constants.ArgToWhat
Bases:
object
- class centralcli.constants.BandwidthInterval(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.BatchAddArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- devices = 'devices'
- groups = 'groups'
- labels = 'labels'
- macs = 'macs'
- mpsk = 'mpsk'
- sites = 'sites'
- class centralcli.constants.BatchApArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- rename = 'rename'
- class centralcli.constants.BatchDelArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- devices = 'devices'
- groups = 'groups'
- labels = 'labels'
- sites = 'sites'
- class centralcli.constants.BatchRenameArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- aps = 'aps'
- class centralcli.constants.BlinkArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- off = 'off'
- on = 'on'
- class centralcli.constants.BounceArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- interface = 'interface'
- poe = 'poe'
- class centralcli.constants.CacheArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- clients = 'clients'
- devices = 'devices'
- events = 'events'
- groups = 'groups'
- hook_active = 'hook_active'
- hook_config = 'hook_config'
- hook_data = 'hook_data'
- inventory = 'inventory'
- labels = 'labels'
- licenses = 'licenses'
- logs = 'logs'
- mpsk = 'mpsk'
- portals = 'portals'
- sites = 'sites'
- templates = 'templates'
- class centralcli.constants.CertFormat(value)
Bases:
str,EnumAn enumeration.
- DER = 'DER'
- PEM = 'PEM'
- PKCS12 = 'PKCS12'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.CertTypes(value)
Bases:
str,EnumAn enumeration.
- CA_CERT = 'CA_CERT'
- CRL = 'CRL'
- INTERMEDIATE_CA = 'INTERMEDIATE_CA'
- OCSP_RESPONDER_CERT = 'OCSP_RESPONDER_CERT'
- OCSP_SIGNER_CERT = 'OCSP_SIGNER_CERT'
- PUBLIC_CERT = 'PUBLIC_CERT'
- SERVER_CERT = 'SERVER_CERT'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.CloudAuthMacSortBy(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'
- class centralcli.constants.CloudAuthUploadType(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'
- mpsk = 'mpsk'
- class centralcli.constants.DeleteArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- cert = 'cert'
- certificate = 'certificate'
- site = 'site'
- class centralcli.constants.DevTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- cx = 'cx'
- gw = 'gw'
- sw = 'sw'
- class centralcli.constants.DhcpArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- clients = 'clients'
- server = 'server'
- class centralcli.constants.EnableDisableArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- auto_sub = 'auto-sub'
- class centralcli.constants.EventDevTypeArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- client = 'client'
- gw = 'gw'
- switch = 'switch'
- class centralcli.constants.FirmwareDeviceType(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- cx = 'cx'
- gw = 'gw'
- mas = 'mas'
- sw = 'sw'
- switch = 'switch'
- class centralcli.constants.GatewayRole(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- branch = 'branch'
- vpnc = 'vpnc'
- wlan = 'wlan'
- class centralcli.constants.GenericDevTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- gw = 'gw'
- switch = 'switch'
- class centralcli.constants.IdenMetaVars
Bases:
object
- class centralcli.constants.KickArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'
- mac = 'mac'
- wlan = 'wlan'
- class centralcli.constants.LLDPCapabilityTypes(value)
Bases:
EnumAn enumeration.
- Bridge = 3
- Router = 5
- Wlan_Access_Point = 4
- unknown0 = 0
- unknown1 = 1
- unknown2 = 2
- unknown6 = 6
- unknown7 = 7
- class centralcli.constants.LibToAPI
Bases:
objectConvert consistent device types used by this library to the various types used by Central API endpoints
If no method str is provided converts various strings to consistent library device types.
- property valid: list
- property valid_str: list
- class centralcli.constants.LibToGenericPlural
Bases:
object
- class centralcli.constants.LicenseTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- advance_70xx = 'advance-70xx'
- advance_72xx = 'advance-72xx'
- advance_90xx_sec = 'advance-90xx-sec'
- advanced_91xx = 'advanced-91xx'
- advanced_91xx_sec = 'advanced-91xx-sec'
- advanced_92xx_sec = 'advanced-92xx-sec'
- advanced_ap = 'advanced-ap'
- advanced_nw_third_party = 'advanced-nw-third-party'
- advanced_switch_6100 = 'advanced-switch-6100'
- advanced_switch_6200 = 'advanced-switch-6200'
- advanced_switch_6300 = 'advanced-switch-6300'
- advanced_switch_6400 = 'advanced-switch-6400'
- advanced_switch_8xxx_9xxx_10xxx = 'advanced-switch-8xxx-9xxx-10xxx'
- foundation_7005 = 'foundation-7005'
- foundation_70xx = 'foundation-70xx'
- foundation_72xx = 'foundation-72xx'
- foundation_90xx_sec = 'foundation-90xx-sec'
- foundation_91xx = 'foundation-91xx'
- foundation_91xx_sec = 'foundation-91xx-sec'
- foundation_92xx_sec = 'foundation-92xx-sec'
- foundation_ap = 'foundation-ap'
- foundation_base_90xx_sec = 'foundation-base-90xx-sec'
- foundation_nw_third_party = 'foundation-nw-third-party'
- foundation_sdflex = 'foundation-sdflex'
- foundation_switch_6100 = 'foundation-switch-6100'
- foundation_switch_6200 = 'foundation-switch-6200'
- foundation_switch_6300 = 'foundation-switch-6300'
- foundation_switch_6400 = 'foundation-switch-6400'
- foundation_switch_8400 = 'foundation-switch-8400'
- foundation_wlan_gw = 'foundation-wlan-gw'
- vgw_2g = 'vgw-2g'
- vgw_4g = 'vgw-4g'
- vgw_500m = 'vgw-500m'
- wlan_advanced_90xx_sec = 'wlan-advanced-90xx-sec'
- wlan_advanced_91xx = 'wlan-advanced-91xx'
- wlan_advanced_91xx_sec = 'wlan-advanced-91xx-sec'
- wlan_advanced_92xx_sec = 'wlan-advanced-92xx-sec'
- class centralcli.constants.LogAppArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- account_setting = 'account_setting'
- nms = 'nms'
- class centralcli.constants.LogSortBy(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- app = 'app'
- description = 'description'
- id = 'id'
- ip = 'ip'
- target = 'target'
- time = 'time'
- user = 'user'
- class centralcli.constants.NotifyToArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- email = 'email'
- phone = 'phone'
- class centralcli.constants.PoEDetectionStatus(value)
Bases:
EnumAn enumeration.
- Delivering = 3
- NA = 0
- Searching = 2
- Undefined = 1
- class centralcli.constants.RadioBandOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.RefreshWhat(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- cache = 'cache'
- token = 'token'
- tokens = 'tokens'
- class centralcli.constants.RemoveArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- site = 'site'
- class centralcli.constants.ResetArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- overlay = 'overlay'
- class centralcli.constants.SendCmdArg2(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- commands = 'commands'
- class centralcli.constants.SendCmdArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'
- device = 'device'
- file = 'file'
- group = 'group'
- site = 'site'
- class centralcli.constants.SendConfigDevIdens(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- gw = 'gw'
- class centralcli.constants.ShowArg2(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'
- ap = 'ap'
- aps = 'aps'
- certs = 'certs'
- clients = 'clients'
- device = 'device'
- devices = 'devices'
- gateway = 'gateway'
- gateways = 'gateways'
- group = 'group'
- groups = 'groups'
- sites = 'sites'
- switch = 'switch'
- switches = 'switches'
- template = 'template'
- templates = 'templates'
- variables = 'variables'
- class centralcli.constants.ShowArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'
- ap = 'ap'
- aps = 'aps'
- cache = 'cache'
- certs = 'certs'
- clients = 'clients'
- device = 'device'
- devices = 'devices'
- gateway = 'gateway'
- gateways = 'gateways'
- group = 'group'
- groups = 'groups'
- log = 'log'
- logs = 'logs'
- site = 'site'
- sites = 'sites'
- switch = 'switch'
- switches = 'switches'
- template = 'template'
- templates = 'templates'
- variables = 'variables'
- class centralcli.constants.ShowHookProxyArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- logs = 'logs'
- pid = 'pid'
- port = 'port'
- class centralcli.constants.ShowInventoryArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- all = 'all'
- ap = 'ap'
- cx = 'cx'
- gw = 'gw'
- sw = 'sw'
- switch = 'switch'
- vgw = 'vgw'
- class centralcli.constants.SiteStates(value)
Bases:
str,EnumAn enumeration.
- AK = 'Alaska'
- AL = 'Alabama'
- AR = 'Arkansas'
- AS = 'American Samoa'
- AZ = 'Arizona'
- Alabama = 'Alabama'
- Alaska = 'Alaska'
- American_Samoa = 'American Samoa'
- Arizona = 'Arizona'
- Arkansas = 'Arkansas'
- CA = 'California'
- CO = 'Colorado'
- CT = 'Connecticut'
- California = 'California'
- Colorado = 'Colorado'
- Connecticut = 'Connecticut'
- DC = 'District of Columbia'
- DE = 'Delaware'
- Delaware = 'Delaware'
- District_of_Columbia = 'District of Columbia'
- FL = 'Florida'
- Florida = 'Florida'
- GA = 'Georgia'
- GU = 'Guam'
- Georgia = 'Georgia'
- Guam = 'Guam'
- HI = 'Hawaii'
- Hawaii = 'Hawaii'
- IA = 'Iowa'
- ID = 'Idaho'
- IL = 'Illinois'
- IN = 'Indiana'
- Idaho = 'Idaho'
- Illinois = 'Illinois'
- Indiana = 'Indiana'
- Iowa = 'Iowa'
- KS = 'Kansas'
- KY = 'Kentucky'
- Kansas = 'Kansas'
- Kentucky = 'Kentucky'
- LA = 'Louisiana'
- Louisiana = 'Louisiana'
- MA = 'Massachusetts'
- MD = 'Maryland'
- ME = 'Maine'
- MI = 'Michigan'
- MN = 'Minnesota'
- MO = 'Missouri'
- MP = 'Northern Mariana Islands'
- MS = 'Mississippi'
- MT = 'Montana'
- Maine = 'Maine'
- Maryland = 'Maryland'
- Massachusetts = 'Massachusetts'
- Michigan = 'Michigan'
- Minnesota = 'Minnesota'
- Mississippi = 'Mississippi'
- Missouri = 'Missouri'
- Montana = 'Montana'
- NC = 'North Carolina'
- ND = 'North Dakota'
- NE = 'Nebraska'
- NH = 'New Hampshire'
- NJ = 'New Jersey'
- NM = 'New Mexico'
- NV = 'Nevada'
- NY = 'New York'
- Nebraska = 'Nebraska'
- Nevada = 'Nevada'
- New_Hampshire = 'New Hampshire'
- New_Jersey = 'New Jersey'
- New_Mexico = 'New Mexico'
- New_York = 'New York'
- North_Carolina = 'North Carolina'
- North_Dakota = 'North Dakota'
- Northern_Mariana_Islands = 'Northern Mariana Islands'
- OH = 'Ohio'
- OK = 'Oklahoma'
- OR = 'Oregon'
- Ohio = 'Ohio'
- Oklahoma = 'Oklahoma'
- Oregon = 'Oregon'
- PA = 'Pennsylvania'
- PR = 'Puerto Rico'
- Pennsylvania = 'Pennsylvania'
- Puerto_Rico = 'Puerto Rico'
- RI = 'Rhode Island'
- Rhode_Island = 'Rhode Island'
- SC = 'South Carolina'
- SD = 'South Dakota'
- South_Carolina = 'South Carolina'
- South_Dakota = 'South Dakota'
- TN = 'Tennessee'
- TX = 'Texas'
- Tennessee = 'Tennessee'
- Texas = 'Texas'
- UM = 'United States Minor Outlying Islands'
- US_Virgin_Islands = 'U.S. Virgin Islands'
- UT = 'Utah'
- United_States_Minor_Outlying_Islands = 'United States Minor Outlying Islands'
- Utah = 'Utah'
- VA = 'Virginia'
- VI = 'U.S. Virgin Islands'
- VT = 'Vermont'
- Vermont = 'Vermont'
- Virginia = 'Virginia'
- WA = 'Washington'
- WI = 'Wisconsin'
- WV = 'West Virginia'
- WY = 'Wyoming'
- Washington = 'Washington'
- West_Virginia = 'West Virginia'
- Wisconsin = 'Wisconsin'
- Wyoming = 'Wyoming'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.SortAlertOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- acknowledged = 'acknowledged'
- description = 'description'
- severity = 'severity'
- time = 'time'
- type = 'type'
- class centralcli.constants.SortCertOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- expiration = 'expiration'
- expired = 'expired'
- md5_checksum = 'md5_checksum'
- sha1_checksum = 'sha1_checksum'
- type = 'type'
- class centralcli.constants.SortClientOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- connected_device = 'connected_device'
- dot11 = 'dot11'
- group = 'group'
- ip = 'ip'
- last_connected = 'last_connected'
- mac = 'mac'
- network = 'network'
- role = 'role'
- site = 'site'
- vlan = 'vlan'
- class centralcli.constants.SortDevOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- ap_ip = 'ap_ip'
- ap_port = 'ap_port'
- ap_serial = 'ap_serial'
- group = 'group'
- healthy = 'healthy'
- ip = 'ip'
- labels = 'labels'
- mac = 'mac'
- model = 'model'
- serial = 'serial'
- site = 'site'
- status = 'status'
- switch = 'switch'
- switch_ip = 'switch_ip'
- switch_port = 'switch_port'
- switch_serial = 'switch_serial'
- tagged_vlans = 'tagged_vlans'
- type = 'type'
- untagged_vlan = 'untagged_vlan'
- uptime = 'uptime'
- version = 'version'
- class centralcli.constants.SortGroupOptions(value)
Bases:
str,EnumAn enumeration.
- AOSVersion = 'AOSVersion'
- AllowedDevTypes = 'AllowedDevTypes'
- ApNetworkRole = 'ApNetworkRole'
- Architecture = 'Architecture'
- GwNetworkRole = 'GwNetworkRole'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- template_group = 'template_group'
- class centralcli.constants.SortInventoryOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- mac = 'mac'
- model = 'model'
- serial = 'serial'
- services = 'services'
- sku = 'sku'
- type = 'type'
- class centralcli.constants.SortNamedMpskOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- mpsk = 'mpsk'
- role = 'role'
- status = 'status'
- class centralcli.constants.SortOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- mac_asc = '+mac'
- mac_des = '-mac'
- name_asc = '+name'
- name_des = '-name'
- serial_asc = '+serial'
- serial_des = '-serial'
- class centralcli.constants.SortOspfAreaOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'
- area_type = 'area_type'
- default_cost = 'default_cost'
- interface_count = 'interface_count'
- spf_run_count = 'spf_run_count'
- summary_enable = 'summary_enable'
- class centralcli.constants.SortOspfDatabaseOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- age = 'age'
- area = 'area'
- checksum = 'checksum'
- link_count = 'link_count'
- ls_id = 'ls_id'
- lsa_type = 'lsa_type'
- route_tag = 'route_tag'
- router_id = 'router_id'
- seq_no = 'seq_no'
- class centralcli.constants.SortOspfInterfaceOptions(value)
Bases:
str,EnumAn enumeration.
- BDR_IP = 'BDR_IP'
- BDR_rtr_id = 'BDR_rtr_id'
- DR_IP = 'DR_IP'
- DR_rtr_id = 'DR_rtr_id'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'
- auth = 'auth'
- cost = 'cost'
- dead_interval = 'dead_interval'
- hello_interval = 'hello_interval'
- ip = 'ip'
- nbrs = 'nbrs'
- oper_state = 'oper_state'
- priority = 'priority'
- rexmt_interval = 'rexmt_interval'
- state = 'state'
- type = 'type'
- class centralcli.constants.SortOspfNeighborOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- area = 'area'
- dead_timer = 'dead_timer'
- interface_name = 'interface_name'
- interface_state = 'interface_state'
- ip = 'ip'
- neighbor_state = 'neighbor_state'
- options = 'options'
- priority = 'priority'
- rexmt_timer = 'rexmt_timer'
- router_id = 'router_id'
- class centralcli.constants.SortOverlayInterfaceOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- endpoint = 'endpoint'
- routes = 'routes'
- state = 'state'
- uptime = 'uptime'
- class centralcli.constants.SortRouteOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- best = 'best'
- destination = 'destination'
- flags = 'flags'
- interface = 'interface'
- learn_time = 'learn_time'
- metric = 'metric'
- nexthop = 'nexthop'
- protocol = 'protocol'
- class centralcli.constants.SortSiteOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- address = 'address'
- associated_devices = 'associated_devices'
- city = 'city'
- country = 'country'
- id = 'id'
- state = 'state'
- zipcode = 'zipcode'
- class centralcli.constants.SortStackOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- group = 'group'
- mac = 'mac'
- split_policy = 'split_policy'
- status = 'status'
- topology = 'topology'
- class centralcli.constants.SortSubscriptionOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- end_date = 'end_date'
- key = 'key'
- network = 'network'
- sku = 'sku'
- start_date = 'start_date'
- status = 'status'
- type = 'type'
- class centralcli.constants.SortTemplateOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- device_type = 'device_type'
- group = 'group'
- model = 'model'
- template_hash = 'template_hash'
- version = 'version'
- class centralcli.constants.SortTsCmdOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- category = 'category'
- command_id = 'id'
- class centralcli.constants.SortVlanOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- igmp = 'igmp'
- jumbo = 'jumbo'
- mgmt = 'mgmt'
- oper_state_reason = 'oper_state_reason'
- pvid = 'pvid'
- status = 'status'
- tagged = 'tagged'
- untagged = 'untagged'
- voice = 'voice'
- class centralcli.constants.SortWebHookOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- retry_policy = 'retry-policy'
- token = 'token'
- token_created = 'token-created'
- updated = 'updated'
- urls = 'urls'
- wid = 'wid'
- class centralcli.constants.SortWlanOptions(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- access_type = 'access_type'
- clients = 'clients'
- enabled = 'enabled'
- group = 'group'
- mac_auth = 'mac_auth'
- rf_band = 'rf_band'
- security = 'security'
- ssid = 'ssid'
- type = 'type'
- class centralcli.constants.StartArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- hook2snow = 'hook2snow'
- hook_proxy = 'hook-proxy'
- class centralcli.constants.StatusOptions(value)
Bases:
str,EnumAn enumeration.
- DOWN = 'DOWN'
- Down = 'Down'
- UP = 'UP'
- Up = 'Up'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- down = 'down'
- up = 'up'
- class centralcli.constants.SubscriptionArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- auto = 'auto'
- details = 'details'
- names = 'names'
- stats = 'stats'
- class centralcli.constants.SwitchRoles(value)
Bases:
EnumAn enumeration.
- ERR = 0
- stack_conductor = 2
- stack_member = 4
- stack_standby = 3
- stand_alone = 1
- class centralcli.constants.SwitchRolesShort(value)
Bases:
EnumAn enumeration.
- ERR = 0
- conductor = 2
- mbr = 4
- stand_alone = 1
- stby = 3
- class centralcli.constants.TSDevTypes(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- cx = 'cx'
- gateway = 'gateway'
- gw = 'gw'
- mas = 'mas'
- sw = 'sw'
- switch = 'switch'
- class centralcli.constants.TemplateLevel1(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- add = 'add'
- delete = 'delete'
- update = 'update'
- class centralcli.constants.TimeRange(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class centralcli.constants.UpgradeArgs(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- ap = 'ap'
- gateway = 'gateway'
- switch = 'switch'
- class centralcli.constants.UplinkNames(value)
Bases:
str,EnumAn enumeration.
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- uplink101 = 'uplink101'
- uplink102 = 'uplink102'
- uplink103 = 'uplink103'
- uplink104 = 'uplink104'
- uplink105 = 'uplink105'
- class centralcli.constants.WhatToPretty
Bases:
object
- centralcli.constants.do_load_pycentral() bool
Determine if provided command requires pycentral load
Allows command to complete even if config has yet to be configured. Useful for first run commands and auto docs.
- Returns:
True or False indicating if pycentral needs to be instantiated for command to complete.
- Return type:
bool
- centralcli.constants.get_cencli_devtype(dev_type: str) str
Convert device type returned by API to consistent cencli types
- Parameters:
dev_type (str) – device type provided by API response
- Returns:
One of [“ap”, “sw”, “cx”, “gw”]
- Return type:
str
centralcli.objects module
centralcli.exceptions module
centralcli.logger module
- class centralcli.logger.MyLogger(log_file: str | Path, debug: bool = False, show: bool = False, verbose: bool = False)
Bases:
object- property DEBUG: bool
- property caption: None | str
render log messages queued for display in output caption.
- critical(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- debug(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- debugv(msgs: list | str, log: bool = True, show: bool | None = None, *args, **kwargs) None
More verbose debugging - set via debugv: True in config
- error(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- exception(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- fatal(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- follow() None
generator function that yields new lines in log file
- get_logger() Logger
Return custom log object.
- info(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None
- property level_name: str | int
- log_print(msgs, log: bool = False, show: bool = False, caption: bool = False, level: str = 'info', *args, **kwargs) None
- print_file() None
- setLevel(level)
- warning(msgs: list | str, log: bool | None = None, show: bool | None = None, caption: bool = False, *args, **kwargs) None