cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
227
Views
0
Helpful
6
Replies

Unable to create a building in DNA 2.3.5.5-70026

Hi,

we have this fresh install of DNA Center 2.3.5.5-70026. I've been able to create areas using the Intent API but I can't create a building.

sitePath = "/dna/intent/api/v1/site"
headers = {'content-type': 'application/json'}
headers["X-Auth-Token"] = get_token()
headers['__runsync'] = 'true'
headers['__runsynctimeout'] = '30'

site_building = {
    "type": "building",
    "site": {
        "building": {
            "name": "TestBuilding",
            "address":"London",
            "parentName": "Global/EMEA"
        }
    }
}

response = requests.post(dnaCluster + sitePath, headers=headers, json=site_building, verify=False)
print(response.text)

Result:

{
  "executionId" : "b75e0b7b-84db-4788-bc98-57d75cdf084e",
  "statusCode" : 500,
  "errorResponse" : {
    "bapiErrorResponse" : {
      "bapiKey" : "50b5-89fd-4c7a-930a",
      "bapiName" : "Create Site",
      "bapiErrorCode" : "",
      "bapiErrorMessage" : ""
    },
    "componentErrorResponse" : [ {
      "compId" : "uuid4b784701",
      "compName" : "GET Location info",
      "compErrorCode" : "500",
      "compErrorMessage" : "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
      "componentType" : "REST_CLIENT"
    } ]
  }
}

Any idea on how to troubleshoot this any further?

Thanks,

Matteo

6 Replies 6

Gabriel Zapodeanu
Cisco Employee
Cisco Employee

@MatteoComisso50310 Please follow the API docs. There are required parameters that have not been provided. The address must be a real street address
Example of params required:
```
building_info:
name: LO
address: 5400 Meadows Rd, Lake Oswego, Oregon 97035, United States
lat: 45.41676
long: -122.73312
```
Example of working payload:
```
building_payload = {
'type': 'building',
'site': {
'building': {
'name': building_name,
'parentName': 'Global/' + area_name,
'address': building_address,
'latitude': building_lat,
'longitude': building_long
}
}
}
```

 

Hi @Gabriel Zapodeanu ,

thanks, but it didn't work.

site_building = {
    "type": "building",
    "site": {
        "building": {
            "name": "LO",
            "address":"5400 Meadows Rd, Lake Oswego, Oregon 97035, United States",
            "parentName": "Global/EMEA",
            "latitude": "45.41676",
            "longitude": "-122.73312"
        }
    }
}

Same as before:

{
  "executionId" : "e46d9b14-372d-47c8-b5ac-c7a2f7c463a2",
  "statusCode" : 500,
  "errorResponse" : {
    "bapiErrorResponse" : {
      "bapiKey" : "50b5-89fd-4c7a-930a",
      "bapiName" : "Create Site",
      "bapiErrorCode" : "",
      "bapiErrorMessage" : ""
    },
    "componentErrorResponse" : [ {
      "compId" : "uuid4b784701",
      "compName" : "GET Location info",
      "compErrorCode" : "500",
      "compErrorMessage" : "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
      "componentType" : "REST_CLIENT"
    } ]
  }
}

Can you provide a link to the documentation? This is what I've followed and doesn't provide many details: Create Site - Cisco Catalyst Center 2.3.7 - Cisco DevNet

Thanks,

Matteo

Matteo,


Here are an example of API Requests that I just ran in my cluster to demonstrate adding an:
- Area
- Building
- Floor

 

DESIGN.HIERARCHY - (Create AREA - "Area1-API") - API TOOLKIT
------------------------------------------------------------
POST
{{PROTOCOL}}://{{CATC.IP.ADDRESS}}/dna/intent/api/v1/site

BODY
{
"type": "AREA",
"site": {
"area": {
"name": "Area1-API",
"parentName": "Global"
}
}
}


DESIGN.HIERARCHY - (Create BUILDING - "Building1-API") - API TOOLKIT
--------------------------------------------------------------------
POST
{{PROTOCOL}}://{{CATC.IP.ADDRESS}}/dna/intent/api/v1/site

BODY
{
"type": "BUILDING",
"site": {
"area": {
"name": "Area1-API",
"parentName": "Global"
},
"building": {
"name": "Building1-API",
"address": "175 West Tasman Drive, San Jose, California 95134, United States",
"parentName": "Global/Area1-API",
"latitude": "37.4096",
"longitude": "-121.951577"
}
}
}


DESIGN.HIERARCHY - (Create FLOOR- "Floor1-API") - API TOOLKIT
--------------------------------------------------------------------
POST
{{PROTOCOL}}://{{CATC.IP.ADDRESS}}/dna/intent/api/v1/site

BODY
{
"type": "FLOOR",
"site": {
"area": {
"name": "Area1-API",
"parentName": "Global"
},
"building": {
"name": "Building1-API",
"address": "150 West Tasman Drive, San Jose, California 95134, United States",
"parentName": "Global/Area1-API",
"latitude": "37.40803",
"longitude": "-121.952639"
},
"floor": {
"name": "Floor1-API",
"parentName": "Building1-API",
"rfModel": "Free Space",
"width": "100",
"length": "100",
"height": "10"
}
}
}

 

Hierarchy_Greenfield.pngHierarchy_Create-Area.pngHierarchy_Create-Building.pngHierarchy_Create-Floor.png

Gabriel Zapodeanu
Cisco Employee
Cisco Employee

This will give you more details about the Site APIs: https://developer.cisco.com/docs/dna-center/sites/#site-api
Catalyst Center has the API docs under:
Menu --> Platform --> Developer Toolkit --> APIs

 

Gabriel Zapodeanu
Cisco Employee
Cisco Employee

 

API tested in my lab:

GabrielZapodeanu_0-1713993455444.png

GabrielZapodeanu_1-1713993478203.png

 

Hi,

thanks but I keep on getting the same error. I'd say it's not a payload issue, since the same payload works for you.

 

      "compName" : "GET Location info",
      "compErrorCode" : "500",
      "compErrorMessage" : "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",

 

What is this error about? It mentions "certification path" and made me think that we have an outbound transparent proxy that performs SSL decryption. I've already installed the CA certificate in the DNA following the Cisco DNA Center Administrator Guide, Release 2.3.4 - Configure System Settings [Cisco Catalyst Center] - Cisco. 

I can create buildings from GUI, so I don't think it's about the proxy, but still I tried. Any idea what that error is about?

Thanks,

Matteo