Define network configurations with Subnets APIs

Contributors netapp-reenu netapp-manini Download PDF of this page

You can use Subnets APIs to view and create subnets for your subtenant and zone. You can use them to define your network configuration.

HTTP Verb Path Description Mandatory parameters/Request body

GET

/v2.1/tenants/{tenant_id}/
zones/{zone_name}/subnets

You can retrieve all the subnet objects for a tenant and zone. Retrieves details of the subnet, such as VLAN, subtenant, zone, routes, and tags.

tenant_id: The ID of the tenant.
zone_name: The name of the zone.
offset: The number of items to skip before starting to collect the result set.
limit: The numbers of items to return.

GET

/v2.1/tenants/{tenant_id}/
zones/{zone_name}/subnets/
{id}

You can retrieve the details of a specific subnet object created for a tenant and zone. Retrieves details of the subnet, such as VLAN, subtenant, zone, routes, and tags based on the entered ID.

tenant_id: The ID of the tenant.
zone_name: The name of the zone.
id: The ID of the subnet.

POST

/v2.1/tenants/{tenant_id}/
zones/{zone_name}/subnets

You can create a subnet object for a particular tenant and zone. Add the values in the request body to create a subtenant object with the specified parameters, such as name, VLAN, CIDR, subtenant ID, routes, and tags.

tenant_id: The ID of the tenant.
zone_name: The name of the zone.

{
"name": "string",
"vlan": "1000",
"cidr": "10.0.0.0/24",
"subtenant_id": "5d2fb0fb4f47df00015274e3",
"routes": [
{
"destination": "10.0.0.0/24",
"gateway": "10.0.0.1",
"metric": "20"
}
],
"tags": {
"key1": "Value 1",
"key2": "Value 2",
"keyN": "Value N"
}
}

POST

/v2.1/tenants/{tenant_id}/
zones/{zone_name}/subnets/
{id}/tags

You can create or replace tags for a subnet object for your tenant. Add the ID of the subnet object and the values for the tags in the "key:value pair" format in the request body.

tenant_id: The ID of the tenant.
zone_name: The name of the zone.
id: The ID of the backup object.

{
"key1": "<Tag 1>",
"key2": "<Tag 2>",
"keyN": "<Tag N>"
}