Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configlets (API)

For full API documentation, view the Platform API reference from the web interface. This is a targeted section to demonstrate configlet API similarly to the UI. The main difference between the Web UI and REST API is that the Apstra API does not make any use of the configlets stored under api/design/configlets when working with a blueprint. Design-configlets are meant for consumption under the UI. When working with configlets on the API, work directly with the blueprint.

Configlets live in http://aos-server/api/design/configlets and are referenced by ID.

API - Create Configlet

To create a configlet, POST to https://aos-server/api/design/configlets with a valid JSON structure representing the configlet. You can assign this configlet from the Apstra GUI. This method is not required for the REST API to assign to a blueprint. See the assigning a configlet section for more details.

A POST will create a new configlet. A PUT will overwrite an existing configlet. PUT requires the URL of the configlet. https://aos-server/api/design/configlets/{id}

The response will contain the ID of the newly created configlet {"id": "995446c7-de7d-46bb-a88a-786839556064"}

API - Delete Configlet

Deleting a configlet requires an HTTP DELETE to the configlet by URL http://aos-server/api/design/configlets/{id}

A successful DELETE has an empty response {}

API - Assign Configlet

Assigning a configlet to a blueprint requires assignation of device conditions as well as embedding the configlet details. When assigning a configlet to a blueprint, the configlets available as design resources aren’t necessary. These are only used for UI purposes.

The assigned configlet lives in https://aos-server/api/blueprints/blueprint_id/configlets

JSON Syntax for putting a configlet to a blueprint. Basically, this is just an ‘items’ dictionary element containing a list of configlet schemas.

CURL Example - HTTP PUT

Response

API - Unassign Configlet

To unassign a configlet, remove it from the items list by PUT with an empty json post.

The response is an empty json set once the configlet is deleted: {"items": []}