Skip to content

Releases: Pack3tL0ss/central-api-cli

v9.3.1

14 Feb 03:13

Choose a tag to compare

🚨 Enable preview linter rules for basic formatting.

πŸ”–v9.3.0

14 Feb 02:41

Choose a tag to compare

Commands/Options Updates / New Commands/Features

  • 🚚 For non glp configs assign license is now assign subscription
  • 🚚 swarm option in reboot is not -S for consistency with option elsewhere
  • ✨ Add cencli migrage devices <to_workspace> ... Command to migrate devices from one workspace to another.
  • ✨ Add batch update devices (requires GLP config) to update devices in GLP inventory.
  • ✨ show archived now uses glp API if configured
  • ✨ archive/unarchive and batch archive/unarchive now support glp API endpoint if configured
  • ✨ cencli update config self now supported to launch editor on cencli config file.
  • ✨ Transition add device and batch add device to use glp endpoints add support for --tags in both.
  • ✨ batch delete devices now supports glp API endpoint if glp info in config.
  • 🚸 Allow -yy to bypass prompt even if warning occur. in batch add devices
  • ✨ batch delete sites now supports text with site name on each line in import file
  • ✨ batch subscribe can now re-subscribe existing devices by site / group assigning the subscription matching current tier with the most remaining time left on the sub.
    • It currently does not skip devices already assigned to that tier, but that also does no harm... GLP will just assign the subscription without error (even though it is the same subscription that was already assigned)
  • ✨ Support multiple filters for show device commands (Done after responses are fetched as API does not support multiple filters)
  • ✨ Add get_devices for cnx mrt API (Not a command yet, just the function)
  • ✨ Verify status of cache devices that show Up during batch delete
  • ✨ Add rate-limit attrs from header for cnx MRT APIs
  • ✨ Add service_managers APIs
  • ✨ Add properties for async_status_url (glp async endpoints that require secondary call to fetch actual results), along with headers property, and summary dict (used to add key details of async opp status response to original response output).
  • ✨ cencli show inventory (GLP) now supports --assigned --no-assigned to only fetch devices assigned to service (Aruba Central) or not.
  • ♻️ Improve show interfaces
  • 🚸 tweak show wlans output and verbosity options
  • 🚸 We now support and display the title for responses w/ tablefmt="action". Also improve caption display for "action" responses
  • βž• Add optional support for xlsx imports. Need to install with xlsx optional dep using uv tool install centralcli[xlsx]

Resolved Bugs

  • πŸ› Fix bug when renaming site with only geoloc information
  • πŸ› Fix bug in remove_devices (GLP) issue with chunker requesting > 25 devices on 2nd chunk and beyond
  • πŸ›πŸ—ƒοΈ Fix logic error in cache update after showing devices for a site (or group) that would truncate the dev db.
  • πŸ› Fix a bug in show all with filter (i.e. --site somesite) when the filter has no APs (empty payload)
  • πŸ› Fix bug when adding devices without GLP config
  • 🩹 Minor fix to prevent IndexError in _get_spin_text. This is now possible with some glp calls that require multiple calls to the same endpoint (that lack that pagination sfx)
  • 🩹 fix show interfaces sort for verbose output
  • 🩹 fix pager when response is a renderable (rich)
  • 🩹 re-fix csv formatting in show wlans
  • 🩹 Fix gw_role issue when group is added with --sdwan
  • 🩹 fix delete devices not displaying the result (classic API delete)
  • 🩹 Fix classic API show inventory rare scenario where call to fetch inventory passes, but call to fetch subscriptions fails.
  • 🚸 show wlans now honors ssid name when filter flags or verbose output is specified. Improved captions, and verbose output.
  • 🚸 Fix auto country for US when import has state nested under "site_address"
  • πŸ₯… Prevent potential for IndexError when only failed responses sent to get_progress_of_async_ops()

Usability / Other improvements

  • πŸ”Š Update logs / messsaging / Spinners
  • πŸ—ƒοΈ Add cache update after glp add/delete
  • πŸ—ƒοΈ Add table to cache GLP application_ids (from serrvice catalog)
  • πŸ—ƒοΈ Add cache update after assign | unassign subscription
  • 🩹 Avoid ambiguous multi-match in ts ping when pinging from stack (auto select commander)
  • 🩹 Avoid ambiguous multi-match scenario in show clients by device when device is a stack (auto select commander)
  • ⚑️ Improve cache inventory update performance (glp). Added mechanism to specify the serial numbers that need to be fetched to limit the scope of the refresh, reducing update time in large environments.
  • ⚑️ Prevent full api call when cache already updated in batch_add_devices_glp
  • ⚑️ Make LicenseTypes dynamic Enum a cached_property
  • ⚑️ When serial_numbers are sent to refresh_inv_db they are now validated to ensure they are serial numbers and ignored if they are not.

    This is useful as for some imports you can technically provide a json/yaml by any device identifier and cencli will lookup what that device is (i.e. batch archive).

  • 🚸 Improve and add more info to output of batch verify
  • 🚸 Handle empty payload in show interfaces response (caption)
  • 🚸 Add spinner during inventory data prep for cache update
  • 🚸 Send non raw messging to stderr when using --raw so raw response can be piped to file.
  • 🚸 Return proper exit code for show dhcp clients -v when call to fetch dhcp res info fails.
  • 🚸 Allow text import for batch subscribe if --sub is provided on command line.
  • 🚸 Return exit code 1 if partial failure in show firmware swarm
  • ♻️ Simplify (more reuse) batch add / update glp devices funcs.
  • ♻️ Improve import device models (validation/transormation of import data)
  • ♻️ Prevent actrion responses from being sent to cleaner if there is no output or the cleaner is simple_kv_formatter (which expects a list[dict])
  • ♻️ ensure add_devices always returns a list[Response] even when only single call is made

Dev/Testing improvements

  • 🚚 parse_var_value_list. Moved to utils and improved. Allows tags to be specified with single word tag.
  • πŸ”Š increase log size in Rotating handler, nearly 4x. pytest run would exceed single file.
  • ✨ Add dev cache-update Allows you to update the value of a cache entry from the CLI (primarily useful for testing)
  • ✨ Add new dev command to remove items from cache manually (generally for ad-hoc testing)
  • 🚸 Add support for cleaning output for "action" responses in render.display_results.
  • 🀑 Improve --capture-raw functionality
  • 🀑 converrt event ts from mock responses to int j2 from json does str as it keeps the outer "
  • 🀑 improve mock response stashing and lookup for test runs
  • βœ… reorganize test data, where dynamic test files are stored, and make all test files dynamically created temp files (even when nothing changed from the source) ... for consistency.
  • ♻️ Improve logic in already used response detection, treat per test responses as separate responses to be tracked as used.
  • ♻️ Add generic_type property to CacheInvMonDevice object
  • πŸ§‘β€πŸ’» Add --no-glp hidden dev flag for testing as if glp is not configured
  • πŸ§‘β€πŸ’» add helpers to utils:
    • format_table() ensures a list of dicts has same keys for all dicts.
    • normalize_sub_fields() ensures device import with subscription has consistent key field for "subscription". (import will allow "subscription, "license", or "services" not case sensitive)
  • πŸ§‘β€πŸ’» utils improvements color now supports "dim", summarize_list supports list of CentralObjects (anything with a summary_text attr)
  • πŸ§‘β€πŸ’» Add CLIStrings class
  • πŸ§‘β€πŸ’» Add exit_code property and argument to Response object. This is needed because many Response objects are actually combined responses. If resp.ok is not True render.display_results will treat it different / doesn't display tabular output.
  • πŸ”‡ Add JsonDecodeError to PYTEST_EXPECTED_EXCEPTIONS to squelch the traceback in the log during pytest runs.
  • ⚑️ Create faster utills.all_keys function (faster than previous list comps)
  • 🏷️ Create typed_lru_cache wrapper to preserve type hints in ide for lru_cache wrapped functions.

πŸ”–v9.2.3

07 Jan 00:09

Choose a tag to compare

  • testing updates
  • github actions to publish to pypy

πŸ”–v9.2.2

06 Jan 17:44

Choose a tag to compare

  • πŸ“ Change theme to rtd theme
  • 🩹 Resolve building of cli reference on rtd

πŸ”–v9.2.0

05 Jan 21:43

Choose a tag to compare

Commands/Options Updates / New Commands/Features

  • ✨ Add cencli generate bssids To generate bssids from AP MAC address
  • ✨ Add batch update ap-banner and --banner | --banner-file options to update config
  • ✨ Improve update variables Add batch add/update variables
  • ✨ Expose cencli enable/disable auto-sub ... previously hidden.
  • ✨ Add func/method to fetch APs from cnx monitoring API
  • ✨ Add --band filter to show radios
  • ⚑️ Add pagination detection for CNX endpoints

Resolved Bugs

  • 🩹 restore auto selection of best subscription in assign subscription
  • 🩹 Fix Response.error not getting response.reason from aiohttp.ClientResponse. Conditional ordering was always resulting in "ERROR"
  • 🩹 fix yaml output for "action" tablefmt

Usability / Other improvements

  • πŸ₯… Handle failed calls in _get_details_for_specific_devices()
  • πŸ”Š Improve Exception when error occurs in get_file_data()
  • πŸ”Š tweak logging when handling invalid/expired token for glp.cnx
  • 🚸 re-enable formatting for subscription expiration field in show subscriptions output.
  • 🚸 Convert emojis to bool for csv output.
  • 🚸 Improve highlighting on yaml output
  • 🚸 Strip NA values from csv output in show groups
  • 🚸 Improve help text for show clients, improve --location flag

πŸ”–v9.1.0

11 Dec 01:20

Choose a tag to compare

  • 🚸 Update batch import file examples
  • 🚚πŸ’₯ remove batch assign subscriptions existing batch subscribe will adapt based on glp config.
  • 🩹 Fix --example option in delete groups/sites
  • ⚑️ always calc total in get_bssids for pagination
  • ✨ Add --ssid filter to show bssids

πŸ”–v9.0.6

09 Dec 19:38

Choose a tag to compare

βœ… update tests / improve coverage
✨ Add support for ext antenna gain in update ap and batch update aps
πŸ› Fix bug where once a group move was skipped, all subsequent moves would be skipped
πŸ› Fix cache update after batch move
πŸ› Fix aos10/Instant architecture not being automatically set in update_group_properties
🩹 minor fix in dev_completion (related to auto filtering by dev type)
⚑️ batch rename aps --lldp is now more efficient / consumes fewer API calls (when lldp details are needed)
🩹 remove double prompt in batch rename aps when --lldp option is used

πŸ”–v9.0.5

05 Dec 04:15

Choose a tag to compare

πŸš‘ critical hotfix for brand new installations. Would crash after first run wizard if cache dir didn't exist, and given we were not creating it... This is as regression introduced at some point.

πŸ”–v9.0.4

04 Dec 21:02

Choose a tag to compare

πŸ“ Documentation updates

πŸ”–v9.0.2

03 Dec 23:38

Choose a tag to compare

πŸ’₯πŸ’₯πŸ’₯Breaking ChangesπŸ’₯πŸ’₯πŸ’₯

This release of centralcli is a major refactor, and introduces a number of potentially breaking changes if you are using it as a library (importing it into another script), or if you've built scripts that use the CLI (i.e. a bash script that uses cencli).

  • 🚚 Files have been moved / reorganized / broken up
  • ✨ Significant new features:
    • Add support for doing inventory/subscription calls direct to GreenLake.
    • Cache subscription info, use GLP API to update inventory and subscription cache.
  • βœ… The bulk of this update is work to add tests and get coverage to > 90% (91% currently). This effort flushed out a number of bugs also fixed in this release.

Resolved Bugs

  • 🩹 Fix minor issue with invalid flag detection in update config
  • 🩹 Exit when duplicates found in import files. Handling duplicates had bug due to use of set and set not maintaining order
  • 🩹 Fix missing cache object in CacheGuest
  • 🩹 Fix some filtering logic in kick client
  • 🩹 Fix validation for monitor_only being updated on group w/ switches already allowed.
  • 🩹 Fix detection of ap and gw together for upgrade which is valid.
  • 🩹 Fix flaw in multiple incompatible devices detection
  • 🩹 Minor fix in template matching logic in update template
  • 🩹 Fix potential for markup error when msg passed to logger includes [/...
  • 🩹 Fix bug where cols and rows flipped in TTY object
  • 🩹 Fix group logic in show firmware compliance + other code formatting
  • 🩹 Fix corner-case in get_device_firmware_details ... offline AP could have empty list for data["aps"]
  • 🩹 Fix corner-case issue... Would only apply if cert completion was attempted after a cert had been added via cencli and show certs had not been run.
  • 🩹 Fix update webhook not honoring --yes option
  • 🩹 Fix completion in remove
  • 🩹 Handle null fields in get_site_identifier querries
  • 🩹 Fix mpsk reset option in cloudauth_update_namedmpsk.
  • 🩹 Fix rate limit output when combining multiple named_mpsk calls
  • 🩹 Fix potential for IndexError during fuzz match if dev_type is specified in get_dev_identifier, and none of that type exist
  • 🩹 Minor fix for cache update after clone group
  • πŸ› Fix potential for TyperError due to services (subscription) being a list from inventory.
  • πŸ› Fix issue with cache update after cert delete
  • πŸ› Fix bug in kick client (if client is not connected per current cache)
  • πŸ› Fix bug when using show alerts with --label flag
  • πŸ› Fix batch verify subscription validation
  • πŸ› Fix --mo-cx flag in update group
  • πŸ› Fix potential for exception if all calls to get_named_mpsk fail in refresh_mpsk_db()
  • πŸ› Fix bug in show devices/aps/gateways... <device iden> --inv where invalid paramerter name was used for dev_type causing Exception.
  • πŸ› Fix errant match in get_guest_identifier when qry_str is all text... match would then match any guests that lack a phone.
  • πŸ› Fix bug in upgrade device if not version is provided (recommended version)
  • πŸ› Fix bug where kick by --ssid was not actually honoring the SSID part (was kicking all users from the AP)
  • πŸ› Fix UnboundLocalError on multi-match with conductor_only option (now swack) in get_dev_identifier
  • πŸ› Fix bug in assign subscription when anything other than the id is used to identify the dev and the dev is not in monitoring DB yet.
  • πŸ› Fix reboot request logic in batch_update_aps / _reboot_after_changes
  • πŸ› Fix missing APNetworkRole when group ap is added as allowed device type in update_group_properties()
  • πŸ› Fix update for group that currently does not have aps in allowed_types
  • πŸ› Fix bug in update_per_ap_settings
  • πŸ› Fix bug in caas.send_cmds when site keyword is used. Was looking up group identifier not site.
  • πŸ› Fix serial number by text file validation in _get_import_file()
  • πŸ› Fix upload_certificate for pkcs12 and DER cert types
  • πŸ› Fix _verify_device_type ... make @staticmethod
  • πŸ› Fix validation of device_type in move_devices_to_site()
  • πŸ› Fix -a|--all flag in show audit logs
  • πŸ› Fix honoring of enabled/disabled and role flags when no ssid is specified.
  • πŸ› Fix bug in guest completion when incomplete is empty str
  • πŸ› Fix ability to update variables for device that has not checked into central yet
  • πŸ› Fix cencli show inventory when dev_type switch is specified
  • πŸ› Fix --up | --down flags for show swarms
  • πŸ› Fix bug in interface cleaner for stacks
  • πŸ› Fix --up | --down flags for show swarms
  • πŸ› Fix setup_batch_import_file() for tests. Was not creating yaml/csv files correctly.
  • πŸ› Fix lldp neighbors for VSF stacks, which was using wrong function/API endpoint
  • πŸ› Fix bug in TTY object
  • πŸ› Fix exception was being returned not raised
  • πŸ› Fix bug where loop evaluating process pid could never give up in stop hook-proxy
  • πŸ› Fix handling of multiple groups in update cp-cert. WorkAround bug in typer.
  • πŸ›βͺ Fix regression bug related to clients with null last_connected_time
  • πŸ› Fix bug in template_completion when COMP_WORD is an empty str
  • πŸ› Fix url query string issue in batch assign subscriptions
  • πŸ› Fix response when validation fails in update_group_properties
  • πŸ› Fix markup mismatch issue in clone group (when upgrading to aos10, which doesn't work anyway)
  • πŸ› Fix upgrade when --at is used to specify upgrade at later time
  • πŸ› Fix exception when min_width=None is passed into render.display_results
  • πŸ› Fix convert template
  • πŸ› Fix batch assign when --tags option is not provided
  • πŸ› Fix imports, move custom exception import out of if TYPE_CHECKING block.
  • πŸ› Fix CacheInvMonDevice summary_text
  • πŸ› Fix --dev-type filter output (make it work) in show subscriptions
  • πŸ› Fix retry logic for clients in cache.get_client_identifier()
  • πŸ› Fix Config.wss_key was referencing the webhook token not the wss key
  • πŸ› Fix show branch health make (restore) site argument optional
  • πŸ› Fix cache file moves for mocked tests
  • πŸ› Fix bug when sending duration parmeter to send_command_to_device
  • πŸ› Fix incorrect argument name during inventory db update
  • πŸ› Fix bug if -S|--swarm option used in show wids commands
  • πŸ› Fix incorrect base_url passed into GreenLakeAPI during instantiation
  • πŸ› Fix potential for an IndexError when attempting fuzzy match (typo check), could happen if the cache being querried was empty.
  • πŸ› Fix bug in batch_delete_sites
  • πŸ› Fix ImportSite model deal with potential for NoneType as state (geo-loc)
  • πŸ‘½οΈ Fix output adjustment when API returns 404 when compliance policy is not set. API used to return reason "Not Found" now returns "ERROR" so we just key off 404

Commands/Options Updates / New Commands/Features

  • πŸ”§ configuration schema changed. ✨ Command cencli convert config available to update legacy schema
  • ✨ Add show bssids
  • ✨ Add delete variables
  • ✨ Add export redsky-bssids
  • ✨ Add ts mesh to run mesh / bridge related troubleshooting commands on APs
  • 🚸 Filter logs by device when --swarm option is used for a non-ap (show logs --dev <not ap> --swarm). --swarm is not just ignored in this scenario.
  • 🚸 return appropriate exit code when API calls fail or there is a partial failure.
  • 🚸 --sort in show guests now supports completion and has valid values in help text.
  • ✨ Add logic to ignore group field for batch_add_devices if "retain_config" is in the import and set to True.

    retain_config is valid for batch move not batch add, batch add doesn't support retain_config

  • ✨ auto detect cert format based on extension if no cert format is provided in cencli add cert
  • ✨ show config for switch in template group uses diff API endpoint.
  • ✨ Add cencli show cloud-auth authentication and cencli show cloud-auth sessions
  • ⚰️ Remove auto as valid arg in assign license. No longer needed as cencli enable/disable was added to replace.
  • 🚩 -s flag for swarm is now -S so it does not conflict with -s for start in commands supporting time range.
  • ✨ Add unassign subscription (GLP)
  • 🚸 Add missing confirmation prompt in batch archive
  • ✨ Allow filtering of inventory output by --key (subscription key)
  • ✨ Add --location flag for show clients. To see location from floor plan API
  • 🚚 ♻️ show clients --denylisted --dev ... moved to it's own command show denylisted <DEVICE>
  • ✨ show device (ap, gateways, switches, switches, all, etc.) now support filtering by version or excluding a version.
  • ✨ upgrade device now supports multiple devices.
  • ✨ Add cencli ts clear ...
  • ✨ cencli assign subscription (GLP) ... Implement query method that returns object with fields from both inv and dev cache.

centralcli API changes (Library changes)

  • ✨ Add ability for only template to be provided in utils.generate_template. Add logic to search parent dir of template_file for var_file matching same name (with yaml/json suffix)
  • ⚑️ fix auto device type based on filters in get_clients.
  • ✨ utils.summarize_list can now flatten a list of lists
  • ✨ ♻️ get_sub_identifier now supports match by sub key (moved to it's own function)
  • ✨ add validate_wss_key (websocket)

Cache / database changes

  • πŸ—ƒοΈ Ensure inventory services (subscription) field is stored as a str not a list with 1 str
  • πŸ—ƒοΈ Improve cache update after site update.
  • πŸ—ƒοΈ normalize phone numbers stored in guest cache... always remove leading +
  • πŸ—ƒοΈ Add cache update after cert add,
  • πŸ—ƒοΈ Handle lack of id in Inventory cache
    This can happen after adding devices, as we update the cache with what we know from the import, but don't do a cache update.

Other / developer improvements

  • πŸ§‘β€πŸ’» ✨ Add cencli dev commands (hidden)
  • ✨ πŸ§‘β€πŸ’» Add dev commands to flip between v1 and v2 config (for testing)
  • ✨ Add su...
Read more