cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1081
Views
27
Helpful
2
Replies

DNAC Site Profile API documentation

pinglis
Level 7
Level 7

I found the following Device onboarding example on DevNet:

Device Onboarding - Cisco DNA Center Platform - Document - Cisco DevNet

It uses the Site Profile API to create a Site(Network) Profile and with an onboarding template.

I want to do something similar but using DayN templates. Unlike other APIs this one doesn't appear to be documented within DNA Center and I can't find any documentation about it elsewhere.

 

I would like to understand the structure of the Json object I need to pass to the API to create the site profile.

Also if there any other calls I can make, e.g. to update a profile or get details of an existing profile,

 

We are running version 2.2.3.4

2 Replies 2

raphcpv
Level 1
Level 1

Hello,

I know this response is late compared to the original post.

But i ran into the same issue while working on Version 2.3.3.6.

After some time I found this undocumented API Call to find the complete informations about a specific Site(Network) Profile :

 

https://{{dnac}}/api/v1/siteprofile/{{siteProfileId}}?populated=true

 

This will produce a payload like this :

 

{
    "response": {
        "siteProfileUuid": "{{siteProfileId}}",
        "version": 41,
        "name": "{{siteProfileName}}",
        "namespace": "switching",
        "status": "final",
        "lastUpdatedBy": "raphcpv",
        "lastUpdatedDatetime": 1679393420330,
        "profileAttributes": [
            {
               "key": "site.settings",
                "attribs": [
                .....
                 ]
            },
            {
                "key": "day0.templates",
                "attribs": [
                    {
                        "key": "device.family",
                        "value": "Switches and Hubs",
                        "attribs": [
                            {
                                "key": "device.series",
                                "attribs": [
                                    {
                                        "key": "device.type",
                                        "attribs": [
                                            {
                                                "key": "template.id",
                                                "value": "{{templateId}}",
                                                "attribs": [
                                                    {
                                                        "key": "template.name",
                                                        "value": "{{templateName}}"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "key": "cli.templates",
                "attribs": [
                    {
                        "key": "device.family",
                        "value": "Switches and Hubs",
                        "attribs": [
                            {
                                "key": "device.series",
                                "attribs": [
                                    {
                                        "key": "device.type",
                                        "attribs": [
                                            {
                                                "key": "template.id",
                                                "value": "{{templateId}}",
                                                "attribs": [
                                                    {
                                                        "key": "template.name",
                                                        "value": "{{templateName}}"
                                                    },
                                                    {
                                                        "key": "template.version",
                                                        "value": "1"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "siteCount": 1
    },
    "version": "1.0"
}

 



As you can see you have a profile attributes called cli.templates, you can use it to configure you Day-N template, using my payload as an example.

Hey there,

 

Can you help me with understand what I would need to put this together in a python script? I want to create a script for a site, and create a network profile for that site, then assign the DAY-N template to that site, programmatically, so its ready to deploy when I need it. Can you help please? I'm kinda new to this aspect, and I am getting to grips with a lot of it, but creating new ones is a bit of a mystery at this point.

Thanks