Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add new way of authentication #26

Merged
merged 11 commits into from
Dec 1, 2022
Merged

Add new way of authentication #26

merged 11 commits into from
Dec 1, 2022

Conversation

kagrski
Copy link
Collaborator

@kagrski kagrski commented Nov 21, 2022

Example usage:

base_url = "https://sandbox-sdwan-2.cisco.com/"
username = "devnetuser"
password = "RG!_Yw919_83"

s = requests.Session()
s.auth = vManageAuth(base_url, username, password, verify=False)
s.verify = False

response = s.get("https://sandbox-sdwan-2.cisco.com/dataservice/device")
print(response.json()['data'])
>>> [{'deviceId': '10.10.1.1', 'system-ip': '10.10.1.1', 'host-name': 'vmanage', 'reachability': 'reachable', ...}]

JimOverholt
JimOverholt previously approved these changes Nov 21, 2022
tomaszwarda
tomaszwarda previously approved these changes Nov 24, 2022
vmngclient/vmanage_auth.py Show resolved Hide resolved
vmngclient/vmanage_auth.py Outdated Show resolved Hide resolved
* Port as Optional parameter (#28)

* port as option

* mypy fix

* unused import and unittest

* fix

* inherit requests.Session

* fix mypy precommit

* finish requests usage

* upgrade mypy

* remove broken flag

* change to requests

* renamed status_code

* skip mypy

Co-authored-by: Tomasz Warda <[email protected]>
@kagrski kagrski dismissed stale reviews from tomaszwarda and JimOverholt via 7569187 November 30, 2022 15:59
Copy link
Collaborator

@sbasan sbasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kagrski kagrski merged commit 9a12257 into main Dec 1, 2022
@kagrski kagrski deleted the fr/auth branch December 1, 2022 13:06
kagrski added a commit that referenced this pull request Dec 1, 2022
@kagrski kagrski mentioned this pull request Dec 7, 2022
@tomaszwarda tomaszwarda mentioned this pull request Dec 13, 2022
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants