Skip to content

Releases: Pack3tL0ss/central-api-cli

🔖 v7.2.8

07 Nov 22:34
Compare
Choose a tag to compare
  • 🐛 fix issue in add device
  • 💬 Add caption text when empty response in show cluster
  • 💬 Improve help text logic in cencli add guest
  • ♻️ improve logic in add_visitor

🔖v7.2.7

02 Nov 19:59
Compare
Choose a tag to compare
  • 📝 update demo gif
  • ✨ Add cencli update guest
  • 🐛 fix show firmware compliance when group is not provided (global compliance)
  • 💬 Colorize csv output on terminal
  • 💬 Fix output formatting of show audit logs #
  • 💬 Improve output in show wlans --group GRP when no legacy bands are enabled. (6Ghz only).
  • 💬 Improve title for failed archive/unarchive results
  • 💬 add radio mac to show radios output.
  • ⬆️ Update lock file
  • 💬 Improve title for show bandwidth client
  • 💬 Improve confirmation messaging in upgrade group
  • 🚚 Move cencli cancel to a subcommand... cencli cancel upgrade
  • ✨ 🚚 Expand options (add group and swarm) for relocated cencli cancel upgrade
  • 💬 Format date output in show upgrade status
  • 💬 Improve CacheClients rich formatting

v7.2.6

30 Oct 04:17
Compare
Choose a tag to compare

🐛 ⚡️ Make batch delete devices idempotent as it relates to cop inv delete. Prevent invalid serial from causing abort for remaining payload.
💬 Improve color formatting in response output.
✨ cencli archive... allow serial numbers for devices not in cache.

v7.2.4

24 Oct 20:27
Compare
Choose a tag to compare
  • ✨ Add cencli show cron
  • 🐛 fix issue where interface cleaner was stripping out speed on switches.
  • 🐛 fix bug when -R is specified cencli kick client
  • ✨ verify individual client if cache indicates client is offline. Better error msg when that occurs.
  • 🐛 resolve validation error in pydantic model with None for last_connected (failed client)
  • 🐛 fix potential double cache update when dev_type passed to get_dev_identifier
  • 💬 Improve show caption when --up / --down flag is used,.
  • ✨ Add portal comletion for show guests
  • 🐛 fix exception building caption when wlan name is provided
  • 🎨 improve colorized output
  • 🥅 catch and show error if --out directory does not exist.

v7.2.3

12 Oct 16:32
Compare
Choose a tag to compare
  • ⏪ revert part of client completion change. Needs to be here for empty incomplete, zsh doesn't like the colons.
  • ✨ help_text for portal completion
  • ✅ Change success test for batch add groups test

v7.2.2

11 Oct 20:14
Compare
Choose a tag to compare
  • 🚑 Fix exception when user enters account that doesn't exist in config.
  • 💬 Improve formatting of configuration text in confirmation for cencli update config
  • 🐛 Fix client completion
  • ✅ Add test for client completion

v7.2.1

10 Oct 19:46
Compare
Choose a tag to compare

🔖 v7.2.1

  • 🚑 hotfix to avoid exception during cache update when no devices exist in Central yet.

v7.2.0

10 Oct 00:50
Compare
Choose a tag to compare
  • ✨ Add show radios
  • ♻️ Improve delete device and batch delete devices

v7.1.1

09 Oct 18:52
Compare
Choose a tag to compare

🎉🔖 v7.1.1

🚚 Command changes
🚚 show wids neighbor is now show wids neighbors
🚚 show subscription --> show subscriptions
🚚 show tshoot --> show ts for consistency with same change to the actual action commands cencli tshoot --> cencli ts For both tshoot still works, but is marked deprecated.

🐛 Bug Fixes

👽 🐛 fix show archived not detecting paging. Apparently endpoint has a limit of 50.
🥅 catch exception if launched from dir that doesn't exist anymore.
🐛 Add missing capture_raw to config NOT_ACCOUNT_KEYS
🐛 fix update template
🐛 fix cache update after template upload/update
🐛 fix update_existing_template when template data is pasted into the terminal
⚡ 🐛 remove duplicate call when updating (refreshing) inventory DB
♻️ improve get_all_groups prevent unpack error if first call fails in _batch_request
🐛 Fix issue with get_all_devices when all calls fail
🐛 fix show ... --inv when device only exists in inventory.
🐛 🏷️ fix potential for wrong Dev model to be used in get_dev_identifier
🐛 fix issue with handling 500 response from group move for GW
🐛 fix assignment by reference issue in batch move
🐛 fix potential for error if show fails, _build_device_caption was being called, which would puke given the response was a failed response.
🩹 get_dev_identifier match of wrong dev_type no longer prevents cache update.
🐛 fix import parsing for devices
🐛 Handle dict with "" as value for batch imports (csv with ,,)
🐛 prevent ref before assignment in device move
🐛 🗃️ fix no cache inv cache update during show all --inv
🐛 🗃️ Fix cache update unexpected bahvior when data includes TinyDB.Documents
🐛 fix cache update after label add.

✨ Enhancements

⬆️ Upgrade pydantic dependency v2+, adapt models to be pydantic v2 compliant
🚩 Make delete device options consistent with batch delete devices
✨ Add cnx argument in create_group
✨ Add SD WAN support for create_group
✨ show wids without a subcommand now defaults to all
⚡ improve function handling imports from file for batch operations.
✨ add group now supports sdwan type.
🐛 fix minor issue where CombinedResponse with only a single failed response would omit output data with additional error details.
⚡ improve get_all_groups
⚡ improve cloudauth_upload
✨ Improve all and add --all option to hidden show cache
♻️ default abort str for get_multiline_input is now EXIT in all caps, and does not strip the input str. Config templates will likely have exit in the template, which would cause it to exit early.
♻️ refactor show groups
⚡ improve cache update logic after AP rename
✨ Add ability to combine inventory data when doing show command on specific device
♻️ improve template cache update methods
⚡ Improve get_dev_identifier performance. Only update cache for specific dev_type when dev_type provided.
🔧 Add cache_client_days config item. Cache will store clients that have been seen within cache_client_days days.
🍻 💬 Update batch_add_groups logic. No messages if no requests will be sent + Allow groups that exist to have configs pushed (after further verification).
🗃️ Add cache update after AP rename
🚩 Add sort completion for show portals
✨ Add delete portal
🎨 improve delete site
✨ convert USA and US to "United States" during site import (This is the format Central will populate if you do it via the UI)
✨ Auto set Country if state is provided and normalized state text is in the US/extended territories.
🎨 allow text as include file in parent import file.
♻️ create_group now defaults gw_role to None and determines based on allowed_types if not provided.
🗃️ ⚡ Add pre-validation to batch add sites/labels.

💄 Output/Display Enhancements

✨ 🎨 Add csv lexer
✨ 🎉 Add lexer for csv examples
💬 🎉 Major overhaul of batch examples
💬 Improve --example output for all batch operations.
🎨 Make output of utils.ask prettier
💬 Remove duplicate rate limit msg from caption when cleaner is for caas
💬 Improve vertical alignment of multi-line captions
🔒 mask password in firstrun wizard output
💬 Improve caption format of multi-response output
✨ simple_kv_formatter now supports "emoji_bools` argument. Will Convert bools to emoji ✅or ❌
💬 pre-clean response of show cloud-auth upload
💬 Improve help text in batch verify
💬 Avoid duplicate output when output attribute matches error attribute
💬 Improve wids output
💬 Remove duplicate warnings for same invalid license name on batch add devices.
💬 emoji False in confirmation prompts that could potentially include emoji placeholders.
🎨 colorize more response output for action responses
💬 print errors to stderr
💬 🐛 Update cache spinner text fix missing markup brackets
💬 Add more detail to batch move help text
💬 Simplify output messaging in batch_delete_groups
💬 Improve output for cache spinners, fix typo

🧑‍💻 Dev Improvements / Other

🧑‍💻 Add pad_len param to utils.colors helper
🏷️ 🧑‍💻 Convert some non CLI facing functions to use Literal TypeVar vs Enum (ide doesn't auto-complete when Enum is the type)
🏷️ 🧑‍💻 Update create_group types for better completion in ide
🔊 Add additional description to log on failed request if description is available in payload
🔊 More details for failed API request log
💬 add rich.console rich attribute to RateLimit object
🚚 Move batch_delete_groups from clibatch to clicommon
✅ Adjust test conditions to match changes in output.
🚚 delete label uses common logic in clicommon also used by batch delete labels
🧑‍💻 Add utils.summarize helper to show abbreviated list of formatted items (used in confirmation prompts)
🧑‍💻 utils.color now supports "random" color
♻️ Add expiration as a property to DateTime object. Simplify rich and str methods.
🎉 Add typedefs file for custome type deffinitions.
♻️ Improve Response objects rich, str, and table methods
🚧 WIP refactor numerous modles, update models to be pydantic v2 compliant
🚧 🏷️ Cache objects have a first order object specific to the Cache Type which subclasses existing CentralObject. Improves typing for those objects.
🧑‍💻 Give Cache object access to Config
🚚 cache update methods now broken into 2 methods i.e. update_dev_db and refresh_dev_db where refresh truncates and re-populates the cache, update... will add/remove/update cache and return a bool indicating cache update success/failure.
📄 Add docstr to get_all_devices
🚚 Update after changing library attribute name in site from zipcode to zip
🏷️ All cache items have pydantic model used to format data for cache.
🧑‍💻 Improve args in Batch Request (unpack args)
🔥 Remove get_group_names cleaner (handled in the 1 calling method)
✨ 🧑‍💻 Add cache_update_pending: bool arg to display_results. This will display a log if exit_on_fail and cache_update_pending are set... indicating a cache_update was aborted due to failures (saves from having to do that in each calling function)
🧑‍💻 Add helper function to check if timestamp/dt is older than x days/months etc.
💬 Update inventory cache. Convert expiration from ms to sec
🚚 Move batch_delete_devices to clicommon and refactor. cencli delete device and cencli batch delete devices now use the same function.
🧑‍💻 Cache Objects will all have doc_ids, when update_..._db is called with remvoe=True, data is expected to be a list of doc_ids to delete. (List[int])
✅ Update tests to match output
✅ Improve test cleanup / teardown fixture.
✅ Add batch tests for groups

v7.0.0

06 Sep 18:22
Compare
Choose a tag to compare

🎉🔖 v7.0.0 💥💥 breaking changes

Breaking Changes

  • 💥 🎉 MAJOR overhaul. Breaking Changes!!
  • 💥 re-named a number of CentralApi methods (for consistency)
  • 💥 made parameters consistent. device_type, from_time, to_time, mac, serial, serials...
  • 🧑‍💻 device_type should always accept common centralcli library device_types not the various API endpoint device_types.
  • ⚰️ Removed a number of comments, and unused or redundant methods.
  • 🧑‍💻 replaced *args, **kwargs in a few places, with full arg/kwarg typed definitions.
  • ✨ various minor improvements, additional options.
  • 🚚 get_audit_log_events renamed to get_audit_event_logs

Bug Fixes

  • 🐛 Update/fix url for get_dhcp_servers which is renamed to get_dhcp_pools
  • 🐛 fix batch add/delete labels. Needed update after switch to common import file parser.
  • 🐛 fix potential for sub expiration to be None (no sub)
  • 🐛 fix errant logic throwing cache error when one didn't occur
  • ✅ Fix potential for caption to be undefined, corner-case, pytest, or user using hidden -U option
  • 👽 refactor RateLimit.ok to accomodate accounts with per sec rate-limit disabled.
  • 🐛 Handle scenario where cleaner includes filter that results in no results. (i.e. show inventory --no-sub when all devices have a subscription). This filtering is done in the cleaner.
  • 🐛 cencli upgrade swarm | group fix issue with --at option
    • ✨ add new --in option.
  • 🐛 fix cache update after batch move when only one of site/group move is performed
  • 🐛 fix potential IndexError while cleaning event log output
  • 🐛 fix issue where cencli show acp-logs would exit with an error when -a or -n flag was used.
  • 🐛 fix issue causing cache to update each time test method is ran.
  • 🗃️ 🐛 fix potential rate-limit issue in full cache refresh
  • 🐛 accept datetime object for time params in get_audit_logs and get_audit_logs_events
  • 🐛 Various other minor bug fixes
  • 🗃️ fix potential rate-limit issue in full cache refresh
  • 🐛 refactor cache logging... now done in cache update methods
  • 🐛 Fix issue where show <dev_type | all> --inv stripped MAC address for devices only in the inventory.
  • 🐛 fix common yes options
  • 🐛 fix cli disable auto-sub
  • 🐛 Fix corner-case issue where outdated cache causes exception in client list cleaner
  • 🐛 fix minor bug in batch examples. tablib not honoring booleans in import data

Enhancements

  • ✨ Add support for APs in cencli show interfaces
  • ✨ show inventory now shows colorized subscription expiration for each device.
  • :adjust verbosity options for show inventory and show all
  • ✨ Show inventory now shows subscription expiration
  • 🎨 overhaul show alerts use common time parser.
  • ✨ 🎉 🎨 major overhaul of cencli show logs Uses consistent timerange options, supports all available filtering options, completion for level...
  • 🗃️ Update inventory cache after device add
  • ✨ allow delete label or delete labels (singular/plural)
  • 🐛 cencli upgrade device fix issue with --at option
    • 🚩 cencli upgrade device add --in option works similar to common --past option but yiedls time in future.
    • 🎨 simplify iden / iden_meta
  • 🗃️ update cache after site removal
  • ♻️ refactor show audit logs and show audit acp-logs
    🚚 rename sub-command: show audit system-logs is not show audit acp-logs
    🐛 fix bug related to default start in show audit acp-logs
  • 🎨 simplify start/end accepted format options. Remove seconds
  • 🚩 Add flags for retain config on batch move
  • ✨ 🎉 Use CLI options/arguments from common clioption.py
  • show audit logs and show audit acp-logs will accept serial for --dev without doing cache lookup.
  • ✨ Add cencli cancel (upgrade)
  • ✨ improve site completion
  • 🗃️ Use pydantic model for site cache updates
  • 💬 CombinedResponse ensure RateLimit string is from most recent API call
    🐛 If CombinedResponse partially failed due to exception it could pull the rate_limit string from the Exception Response which did not perform an API call.
  • 🗃️ Update inv cache after unassigning license from device(s)
  • 💬 Confirmation prompts and most other messages outside of the actual rendered output are now sent to stderr. (This reduces the amount of other stuff if user redirects stdout)
    • 💡 --out flag is still the preferred method for redirecting output to a file.
  • 🗃️ model for Labels in cache, improve label completion
  • 🗃️ 🎉 move and batch move now update the cache after move.
  • ✨ Filter non central licenses, improve get_x_identifier messaging when not found
  • ✨ Add support for license_type and device_type filters to get_subscriptions
  • 🗃️ Improve cache update after label add
  • 🎨 improve sort_by logic (accomodate % in key). restore full response output for failed responses.
  • 💬 Some minor improvements to assign label <devs>, use error_console for confirmation prompt.
  • cencli add labels now supports multiple labels,
  • ✨ Update cencli batch delete Allow unnecessary sub-command devices Add -k option to preserve the config for CX switches during group move.
  • ✨ Add cencli check firmware-available...

Dev Improvements

  • ♻️ Improve get_multiline_input
  • ✅ rename rate limit test so it's skipped.
    • This test has to be ran solo, or other tests running in parallel will cause it to fail.
  • ♻️ Move Empty response message to Response object str method
  • 🎨 Improve batch verify logic re subscription/license
  • 🎨 break up show_devices into multiple functions.
  • 🏷️ Improve Inventory model, it is now used as the validator/cleaner for Inventory cache updates.
  • ✨ DateTime constructor now supports format_expiration will colorize associated string representation based on remaining expiration (< 6 months = orange, < 3 months = red).
  • 🎉 Finish last remaining DateTime bits, add original attribute
  • 📝 Added docstr to a few methods that lacked them.
  • ✨ add more common arguments/options
  • 🧑‍💻 Add sep parameter to utils.color. To customize the seperator used to join a list of strings.
  • 🏷️ Add all params and typing params passed to get_*_device methods
  • 🧑‍💻 Add table attribute to Response object. Will return List[dict] where each dict only contains keys common to all other dicts.
  • ♻️ Inventory model will accept pre-cleaned keys from cache
  • 🧑‍💻 Add cache_file_ok property
  • ✅ Add test for show audit acp-logs
  • 🧑‍💻 Add len method to RateLimit object (returns length of the resulting str), may be useful in determining sizing for caption to display nicely.
  • 🚚 move verify_time_range into clicommon
  • 🎨 rename isserial to is_serial for consistency
  • ♻️ rename and adapt delta_to_start() to provide time in past or future.
  • 💬 Selective colorization for Response string, add __rich__method to Response.
  • 🚚 Move batch_move_devices and get_import_file from clibatch to clicommon. cencli batch delete and cencli delete will both use common funcs
  • ➖ remove Halo dependency
  • 💬 Allow set_width_cols to only include a min value
  • 🚚 Move cencli delete device logic to use common funcs in clicommon (also used be batch delete)
  • 🧑‍💻 helper function when updating dict with values in a list. Either adds key with value as first entry in list, or appends to existing if key already exists.
  • 💬 🎉 ✨ New common confirm method / econsole / console

Output/Display Enhancements

  • 💬 Filter additional non Central Licenses from show subscription names output.
  • 💬 show subscription names set min width on subscription name column in rich output
  • ✨ build out output options for show archived
  • 💬 Remove duplicate display when r.output is None and format is action
  • ✨ Add support for sorting when there is a mix of DateTime and NoneType
  • 💬 Numerous help text improvements.
  • 💬 🎉 Major spinner overhaul. More details, color, emoji...
  • 💬 support markup in inner_dict text.
  • 💬 Adjust format of get_multipline_input prompt
  • 💬 Add All import types to example for batch delete devices
  • 💬 sort devices by name in ambiguous device selection menu
  • 💬 flip default order so newest is on bottom of listing in show logs
  • 💬 remove potential for duplicate caption display. Make abort=True default for cli.confirm
  • 💬 for csv output swap in original value for date (epoch timestamp)
    This was the case already in most scenarios, but show firmware list sends an ISO date string. Added original attribute to DateTime object, given ts attribute is not always what was originally sent