Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Resource Pools (API)

This reference demonstrates the resource group API usage with parity to the UI. For full API documentation, view the REST Platform API reference under the Apstra GUI.

To list resource group slots in a blueprint, perform an authenticated HTTP GET to https://aos-server/api/blueprints/<blueprint_id>/resource_groups

Both ASN pools and IP pools must be assigned in order for a blueprint to complete the build phase.

API - ASN Pools

Create ASN Pool

An example payload for creating an ASN Pool:

If an ID is not specified, one will be created and returned in the HTTP response.

To create an ASN pool perform an HTTP POST to https://aos-server/api/resources/asn-pools with a JSON payload.

List ASN Pools

Delete ASN Pool

To delete an ASN Pool perform an HTTP DELETE to https://aos-server/resources/asn-pools/{pool_id}

A successful DELETE returns HTTP 200 OK.

Assign ASN to Blueprint

To assign an IP pool to the blueprint perform an HTTP PUT to https://aos-server/blueprints/<blueprint_id>/resource_groups/ip/<pool_name>

For instance, to post a resource pool to spine_loopback_ips, first obtain the ID of the resource pool, and append it to a list for slot assignation. When updating the IP Pool resource group, specify all pools in the payload at the same time. We cannot add single pools, so PUT them all at once.

Payload:

A successful ASSIGNMENT returns HTTP 200 OK.

Unassign ASN from Blueprint

When removing IP pools from a blueprint, PUT an empty pool_id list to the blueprint with the payload []:

PUT to the HTTP endpoint https://aos-server/api/blueprints/<blueprint_id> /resource_groups/asn/<pool_name>

With the payload:

If the request is successful there will be no response.

List ASN assigned to Blueprint

Available ASN Pool resource groups for assignment can be shown with an HTTP GET to https://aos-server/api/blueprints/<blueprint_id>/resource_groups

API - IP Pools

Create IP Pool

JSON Payload for creating an IP Pool:

The subnets section requires a list of dictionaries with keyword network and value matching a CIDR mask. The subnets cannot overlap with each other in the same pool. That is to say, 192.168.10.0/24 and 192.168.0.0/16 cannot be configured in the same pool.

Tags are optional and are not currently used in Apstra. If ID is specified, it will be saved, otherwise an ID will be returned in the HTTP Response after creating the pool.

An HTTP POST to https://aos-server/api/resources/ip-pools with JSON payload will reply with the ID of the new IP pool.

List IP Pools

Perform an HTTP GET to https://aos-server/api/resources/ip-pools -

Delete IP pool

To delete an IP Pool perform an HTTP DELETE to https://aos-server/resources/ip-pools/{pool_id}

A successful DELETE returns HTTP 200 OK and an empty JSON response {}

Assign IP to Blueprint

To assign an IP pool to the blueprint perform an HTTP PUT to https://aos-server/blueprints/ <blueprint_id>/resource_groups/ip/<group_name>

For instance, to associate a resource pool spine_loopback_ips with a blueprint first obtain the ID of the resource pool, and append it to a list for slot assignation. When updating the IP Pool resource group, specify all pools in the payload at the same time. We cannot add single pools, so PUT them all at once. Instruct Apstra to associate IP pool with ID ‘ed7d8830-c703-4ac0-8252-77e0f272a677’to the blueprint. You may have to GET existing pool IDs prior to adding a new one to avoid deleting existing pools.

Payload:

A successful ASSIGNMENT returns an HTTP 200 OK.

Remove IP from Blueprint

To remove IP pools from the blueprint PUT an empty pool_id list to the blueprint with the payload []:

PUT to the HTTP endpoint https://aos-server/api/blueprints/<blueprint_id>/ resource_groups/ip/<allocation_group_name>

With the payload:

CURL Example

A successful REMOVAL returns an empty response: {}

List IPs Assigned to Blueprint