01-21-2025 06:47 AM
API Endpoint
```
/dna/intent/api/v1/onboarding/pnp-device
```
PAYLOAD
{
"deviceInfo": {
"serialNumber": "FOC2724Y3SP",
"stack": "True",
"description": "string",
"pid": "C9300X-48HX",
"siteId": "fad85e73-6051-49ed-94e2-7c098c0a6721",
"sudiRequired": "False",
"hostname": "svlgold24-sw1",
"stackInfo": {
"supportsStackWorkflows": "True",
"isFullRing": "True",
"stackMemberList": [
{
"serialNumber": "FVH2814L9ZC",
"role": "Active",
"stackNumber": "1",
"priority": "13",
"pid": "C9300X-48HX"
},
{
"serialNumber": "FOC2724Y9AB",
"role": "Standby",
"stackNumber": "2",
"priority": "12",
"pid": "C9300X-48HX"
}
],
"totalMemberCount": "2"
}
}
}
'
RESPONSE
"stackInfo": {
"isFullRing": true,
"supportsStackWorkflows": true,
"totalMemberCount": 2,
"stackMemberList": [],
"validLicenseLevels": [
"Cisco DNA Essentials",
"Cisco DNA Advantage",
"IP Services",
"Lanbase"
]
stackMemberList always returns empty, please help
01-21-2025 08:24 AM
Try and update this line "stackMemberList": stack_info.get("stackMemberList", []),
01-22-2025 01:45 AM
Do you mean like this ?
```
"stackMemberList" : stack_info.get("stackMemberList", [{
"serialNumber": "FVH2814L9ZC",
"role": "Active",
"stackNumber": "1",
"priority": "13",
"pid": "C9300X-48HX"
}])
```
01-22-2025 02:31 AM
Yes, try this.
01-22-2025 02:48 AM - edited 01-22-2025 02:49 AM
Where is 'stack_info' defined ? any documentation
01-22-2025 03:19 AM
Its a Python boolean flag (True/False), stack_info is a keyword argument used within a logging function, the get which is normally associated with dictionaries, and used to retrieve the value associated with a specific key. Here is a doc link https://docs.python.org/3/library/logging.html
01-22-2025 08:32 AM - edited 01-22-2025 08:33 AM
I'm sorry i didnt get you how the stack_info here is related to stack_info in logging module, i'm not even using logging module in my code , please provide payload example
01-22-2025 09:02 AM
Sorry i see what you mean, i thought you meant something else. Try if "stack": "True" and "stackInfo.supportsStackWorkflows": "True" should be in the boolean values (true/false) instead of strings, something llike this maybe?
{
"deviceInfo": {
"stack": true,
"stackInfo": {
"supportsStackWorkflows": true,
...
}
}
}
01-22-2025 09:11 AM - edited 01-22-2025 09:20 AM
01-22-2025 09:12 AM - edited 01-22-2025 09:14 AM
Above with boolean True aint working either. devices is added successfully as stack but stackMemberlist is not getting populated
01-22-2025 09:25 AM
pnp_import_info = [
{
"deviceInfo": {
"hostname": device_name,
"serialNumber": device_serial,
"pid": device_pid,
"sudiRequired": False,
"stack": True,
"userSudiSerialNos": [],
"aaaCredentials": {
"username": "",
"password": ""
},
"stackInfo": { # Moved inside deviceInfo
"stackMemberList": [
{
"serialNumber": "FVH2814L2BB",
"role": "Active",
"stackNumber": "1",
"priority": "13",
"pid": device_pid
},
{
"serialNumber": "FOC2724Y3SP",
"role": "Standby",
"stackNumber": "2",
"priority": "12",
"pid": device_pid
}
],
"stackRingProtocol": "StackWise",
"totalMemberCount": "2"
}
}
}
]
01-22-2025 09:42 AM
Thank you, fixed that, but the stackmemberlist is still empty
'stackMemberList': []
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide