cisco-en-programmability / dnacentersdk

Cisco DNA Center Python SDK
https://dnacentersdk.readthedocs.io/en/latest/
MIT License
75 stars 34 forks source link

Remove ALL VLANs and SSIDs mapped to VLANs exits with a VALIDATION_ERROR. #175

Open rukapse opened 2 weeks ago

rukapse commented 2 weeks ago

Prerequisites

Describe the bug

Expected behavior

Screenshots image

Environment (please complete the following information):

Additional context Add any other context about the problem here.

JosePabloOcampo1212 commented 2 weeks ago

Hello I hope you are well.

In the documentation of Cisco, which can be found in https://developer.cisco.com/docs/dna-center/add-update-or-remove-ssid-mapping-to-a-vlan/

Here he tells us that the request body must have a specific format. As can be in the following image.

Captura de pantalla 2024-11-07 a las 5 28 10 p  m

This is why you get the error "Invalid parameters”. You need to adjust the payload. An example could be the following.

add_update_or_remove_ssid_mapping_to_a_vlan(fabric_id='b6af9074-b1d8-4b40-82f9-776d34adb0fc', payload= [{"vlanName": "string", "ssidDetails": [ ]}] )

I await your confirmation to see if this was able to resolve your problem.

rukapse commented 2 weeks ago

Hello Jose,

Thank your for clarifying this, i’lll go ahead and try it out!


From: JosePabloOcampo1212 @.> Sent: Thursday, November 7, 2024 3:58:22 PM To: cisco-en-programmability/dnacentersdk @.> Cc: Rugvedi Kapse (rukapse) @.>; Author @.> Subject: Re: [cisco-en-programmability/dnacentersdk] Remove ALL VLANs and SSIDs mapped to VLANs exits with a VALIDATION_ERROR. (Issue #175)

Hello I hope you are well.

In the documentation of Cisco, which can be found in https://developer.cisco.com/docs/dna-center/add-update-or-remove-ssid-mapping-to-a-vlan/

Here he tells us that the request body must have a specific format. As can be in the following image.

Captura.de.pantalla.2024-11-07.a.las.5.28.10.p.m.png (view on web)https://github.com/user-attachments/assets/8d5536fb-cd29-4d2f-9ada-2a1528e27a56

This is why you get the error "Invalid parameters”. You need to adjust the payload. An example could be the following.

add_update_or_remove_ssid_mapping_to_a_vlan(fabric_id='b6af9074-b1d8-4b40-82f9-776d34adb0fc', payload= [{"vlanName": "string", "ssidDetails": [ ]}] )

I await your confirmation to see if this was able to resolve your problem.

— Reply to this email directly, view it on GitHubhttps://github.com/cisco-en-programmability/dnacentersdk/issues/175#issuecomment-2463452929, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVKPKMG7QWMUS6LM3NRVQ3LZ7P5B5AVCNFSM6AAAAABRKEUUQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRTGQ2TEOJSHE. You are receiving this because you authored the thread.Message ID: @.***>

JosePabloOcampo1212 commented 1 week ago

Was your problem resolved?

rukapse commented 1 week ago

Hello Jose,

Unfortunately, not yet, tried with three different sets of Inputs, but am still encountering an Error.

Input 1: {'fabric_id': 'b6af9074-b1d8-4b40-82f9-776d34adb0fc', 'payload': [{'vlanName': '', 'ssidDetails': []}]

Error Encountered for Input 1: Error: The client made a request for a resource that does not exist, No matching VLAN found with vlanName: . {'fabric_id': 'b6af9074-b1d8-4b40-82f9-776d34adb0fc', 'payload': [{'vlanName': '', 'ssidDetails': []}]

"response": "An error occurred while executing API call to Function: 'add_update_or_remove_ssid_mapping_to_a_vlan' from Family: 'fabric_wireless'. Parameters: {'fabric_id': 'b6af9074-b1d8-4b40-82f9-776d34adb0fc', 'payload': [{'vlanName': '', 'ssidDetails': []}], 'active_validation': False}. Exception: An error occured when executing operation for the family 'fabric_wireless' having the function 'add_update_or_remove_ssid_mapping_to_a_vlan'. The error was: status_code: 404, {\"response\":{\"errorCode\":\"NCWS23002\",\"message\":\"The client made a request for a resource that does not exist\",\"detail\":\"No matching VLAN found with vlanName: .\"},\"version\":\"1.0\"}."

Input 2: '{'fabric_id': 'b6af9074-b1d8-4b40-82f9-776d34adb0fc', 'payload': [{'vlanName': ''}]}'

{'endTime': 1731583297873, 'status': 'FAILURE', 'startTime': 1731583297835, 'version': 1731583297873, 'resultLocation': '/dna/intent/api/v1/tasks/01932a68-492b-7f7e-a504-51fb01e1a2c6/detail', 'id': '01932a68-492b-7f7e-a504-51fb01e1a2c6'}

Task Details: { "errorCode": 1083, "message": "Resource not found.", "detail": "Invalid object id: 01932a68-492b-7f7e-a504-51fb01e1a2c6" }

Input 3: '{'fabric_id': 'b6af9074-b1d8-4b40-82f9-776d34adb0fc', 'payload': [{}]}' {'endTime': 1731584031053, 'status': 'FAILURE', 'startTime': 1731584031019, 'version': 1731584031053, 'resultLocation': '/dna/intent/api/v1/tasks/01932a73-792b-74a2-88da-8bb2e0c67ae6/detail', 'id': '01932a73-792b-74a2-88da-8bb2e0c67ae6'}

{ "errorCode": 1083, "message": "Resource not found.", "detail": "Invalid object id: 01932a73-792b-74a2-88da-8bb2e0c67ae6" }

Note: The delete all functionality is supported from the Catalyst Center – By simply passing an empty list [].

@. @.

From: JosePabloOcampo1212 @.> Date: Tuesday, November 12, 2024 at 3:06 PM To: cisco-en-programmability/dnacentersdk @.> Cc: Rugvedi Kapse (rukapse) @.>, Author @.> Subject: Re: [cisco-en-programmability/dnacentersdk] Remove ALL VLANs and SSIDs mapped to VLANs exits with a VALIDATION_ERROR. (Issue #175)

Was your problem resolved?

— Reply to this email directly, view it on GitHubhttps://github.com/cisco-en-programmability/dnacentersdk/issues/175#issuecomment-2471795974, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVKPKMFXOOH6FMPZK26TG632AKCWXAVCNFSM6AAAAABRKEUUQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRG44TKOJXGQ. You are receiving this because you authored the thread.Message ID: @.***>

rukapse commented 2 days ago

Hello, is there any update on this?

JosePabloOcampo1212 commented 2 days ago

I'm currently reviewing the problem.