I'm trying to connect to an APIC using PyATS and the rest.connector.Rest method, but no matter what, I get authentication failures. Here is my testbed file:
devices:
apic:
os: apic
type: apic
custom:
abstraction:
order: [os]
connections:
rest:
class: rest.connector.Rest
protocol: http
port: 443
ip: 10.10.10.10
verify: False
username: "apic:Tacacs\\my.user.account"
password: "my_password"
Output from pyATS shell:
>>> testbed = load('aci_tb.yml')
-------------------------------------------------------------------------------
>>> testbed.devices['apic'].connect(alias='rest', via='rest')
Connecting to 'apic' with alias 'rest'
<Response [401]>
{"totalCount":"1","imdata":[{"error":{"attributes":{"code":"401","text":"TACACS+ Server Authentication DENIED"}}}]}
Request to apic failed. Waiting 10 seconds before retrying
Traceback (most recent call last):
File "/.robotFramework/lib64/python3.11/site-packages/rest/connector/libs/apic/implementation.py", line 144, in connect
raise RequestException("Connection to '{ip}' has returned the "
requests.exceptions.RequestException: Connection to '10.10.10.10' has returned the following code '401', instead of the expected status code '200'
And here is the session log from the APIC:
General
Description
From-10.10.10.20-client-type-REST-Failure
Settings
Affected
uni/userext
cause
unknown
clientTag
-
code
generic
Created
2024-04-22T17:49:09.915+00:00
ID
8590532284
Action
special
Session ID
-
severity
info
System Id
1
Trigger
login, session
txId
0
User
remoteuser-my.user.account
I'm running:
genie==24.3
pyats==24.3
rest.connector==24.3
I've tried every combination of credentials and connections that I can think of and I'm still getting 401. The API works with ansible using the rest modules.
I'm trying to connect to an APIC using PyATS and the rest.connector.Rest method, but no matter what, I get authentication failures. Here is my testbed file:
devices: apic: os: apic type: apic custom: abstraction: order: [os] connections: rest: class: rest.connector.Rest protocol: http port: 443 ip: 10.10.10.10 verify: False username: "apic:Tacacs\\my.user.account" password: "my_password"Output from pyATS shell:
And here is the session log from the APIC:
I'm running:
I've tried every combination of credentials and connections that I can think of and I'm still getting 401. The API works with ansible using the rest modules.