cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
367
Views
0
Helpful
1
Replies

how delete file in dnac in config namespace via api

herophil322
Level 1
Level 1

Hello everyone,

I struggle with how to delete a file which I've uploaded to the namespace config, with the api call "POST /dna/intent/api/v1/file/{nameSpace}" in Cisco DNA Center.

Thats the file I've uploaded, to use to configure a device via an api call claim.

 

 

		{
			"nameSpace" : "config",
			"name" : "access1.cfg",
			"downloadPath" : "/file/7653c61f-1018-4b2a-81e9-2b03566fe800",
			"fileSize" : "125",
			"fileFormat" : "text/plain",
			"md5Checksum" : "e166c0500a65ae262381613554100238",
			"sha1Checksum" : "f8691ff2cddb3e7e7ad8a0c81903816b6dbcaecd",
			"sftpServerList" : [
				{
					"sftpserverid" : "5711847f-61eb-4ec4-848d-06ab2181f344",
					"downloadurl" : "/config/7653c61f-1018-4b2a-81e9-2b03566fe800/access1.cfg",
					"status" : "SUCCESS",
					"createTimeStamp" : "02/02/2023 14:45:36",
					"updateTimeStamp" : "02/02/2023 14:45:36",
					"id" : "b16807e7-885a-4383-b444-47e0809850d8"
				}
			],
			"id" : "7653c61f-1018-4b2a-81e9-2b03566fe800"
		},

 

 

Is something possible like -> "DELETE /dna/intent/api/v1/file/config/7653c61f-1018-4b2a-81e9-2b03566fe800".
I did not find anything about deleting a file.

Maybe you guys know something.
Thanks in advance.

Kinde regards
Phil

 

1 Reply 1

I was struggling with the same thing and ended up with opening a TAC case.

Turns out there is an API for this, although not documented. Instead of using "DELETE /dna/intent/api/v1/file/config/7653c61f-1018-4b2a-81e9-2b03566fe800" just remove the dna/intent portions so you end up with the following:

"DELETE /api/v1/file/config/7653c61f-1018-4b2a-81e9-2b03566fe800"

Review Cisco Networking for a $25 gift card