Repository navigation
v2.0a26
Highlights
- Scope management moves to the v1 configuration APIs.
- Profile assignment moves from scope-maps to config-assignments.
- Local profile parameters are fixed, and the scopes and profiles modules are simpler and more robust.
- Fixes #93, fixes #94, fixes #95.
Breaking changes
get_all_device_groupsreturnsDevice_Groupobjects instead of dicts, consistent with the otherget_all_*methods. Read attributes instead of dict keys.- Scope endpoints default to
v1. Sites, site-collections, device-groups, hierarchy, global scope and site-collection add/remove-sites usev1and the v1 request shapes (theirv1alpha1endpoints are deprecated). To keep the old endpoints, passversion="v1alpha1"explicitly. SCOPE_URLS["DEVICE_GROUP"]points todevice-groups(device-collectionsis not available on v1). Update code that builds URLs from this constant.profile_namefor assignment must be"<profile-type>/<profile-instance>"(e.g.Profiles.get_resource_str()), or the bare"<profile-type>"for single-instance profiles such aspolicy-groups.- Local profiles cannot be unassigned.
unassign_profilechecks config-assignments first and, if the profile is not a library assignment at that scope, logs an error instead of sending a DELETE. Delete local profiles withProfiles(local=...). - Passing both
personaanddevice_functionraisesParameterError. Pass onlydevice_function.
Added
generate_url(identifier=...)appends a URL-encoded profile/resource identifier, e.g.generate_url("layer2-vlan", identifier=100)(#95).- Single-instance profiles such as
policy-groupscan be assigned with the bare"<profile-type>"(sent with an emptyprofile-instance). Central only allowspolicy-groupsat global and rejects unassigning it; the API's error is logged. - Each entry in
get_scope_profiles'assigned_profileshas anobject_typeofLIBRARYorLOCAL.
Changed
- Profile assignment, unassignment and
get_scope_profilesusenetwork-config/v1alpha1/config-assignments.get_scope_profilesreads library assignments from config-assignments and local profiles from scope-maps (config-assignments has no local view). - Other configuration APIs stay on
v1alpha1. An explicitversion=always wins (#93). - Site/site-collection updates, bulk deletes, remove-sites (
site-id) and hierarchy (id/type) use the v1 request shapes. The global scope ID is read fromnetwork-config/v1/global. - API version validation accepts any well-formed version (
v1,v1alpha1,v2beta1, ...) instead of a fixed list. - Local profile query parameters are sent kebab-case (
object-type,scope-id,device-function,view-type) as documented by the API. A booleanscope_idis rejected (#94). - All network-config query parameters are standardized to kebab-case.
ProfilesURL-encodes names fully and no longer double-prefixes paths that already includenetwork-config/<version>/.device_function="ALL"is passed to the API unchanged; Central may reject it depending on a feature flag.
Deprecated
personais renamed todevice_function.Profiles(local=...)now takes{"scope_id": <int>, "device_function": "<DEVICE_FUNCTION>"}, and scope assignment methods take a keyword-onlydevice_function=argument.personastill works but emits aDeprecationWarningand will be removed in the first non-alpha 2.x release.ScopeMapsemits aDeprecationWarning; use config-assignments.move_devices_between_sitesemits aDeprecationWarning(it was never implemented).
Fixed
Profiles.create/get/update/deleteraiseVerificationErrorinstead ofKeyErrorwhen the connection or path is missing.Profiles.gettreats an empty200response as not found.- Bulk-vs-single path detection works for profile names with special characters;
set_configkey validation andget_central_connwithout a connection are fixed. find_site_collectionrefreshes site collections (it refreshed sites). Lookup maps are rebuilt after every refresh so deleted scopes can no longer be found, and afind_*refresh reloadsassigned_profiles.- Site collections no longer share one
sites/assigned_profileslist across instances. Site_Collectionkey renaming no longer raisesKeyErroror mutates the caller's data.get_hierarchyby collection name,delete_siteanddelete_site_collectionno longer crash; integer site IDs associate correctly; error messages are well-formed.- Deleting a site collection that still contains sites logs a clear error instead of failing silently.
- Unknown fields in API responses no longer raise errors while loading scopes.
Docs
- Docstrings for local profile parameters corrected (#94).
- Pinned
pymdown-extensions<10.17indocs/requirements.txt: newer releases break the API reference build withmkdocstrings0.30.1, which kept the Read the Docs site from updating.
Full Changelog: v2.0a25...v2.0a26