elektra icon indicating copy to clipboard operation
elektra copied to clipboard

CRUD for Interconnections

Open velp opened this issue 3 years ago • 0 comments

Based on BGPVPN we added cross-region interconnections. This is an additional Neutron plugin that allows creating interconnection objects in two regions for making connectivity between them.

What have to be done

  • creation dialog for interconnections;
  • list dialog for interconnection;
  • details dialog for one interconnection;
  • delete dialog for interconnection;

The new TAB should be placed in Networks & Routers section.

How it works

To have cross-region interconnection between two regions the next steps should be done:

  1. in both regions customer should already have a working BGPVPNs;
  2. in the first region customer creates interconnection object without remote_interconnection_id, but with local BGPVPN ID in local_resource_id and with remote BGPVPN ID in remote_resource_id and with remote_region where he set the second region name;
  3. in the second region customer creates mirror interconnection object, and remote_interconnection_id value is interconnection ID from the first region.

The requests

Creation

In the first region request should look like this:

POST /interconnection/interconnections

{
	"interconnection": {
		"name": "<NAME>",
		"type": "bgpvpn",
		"local_resource_id": "<LOCAL_BGPVPN_ID>",
		"remote_resource_id": "<REMOTE_BGPVPN_ID>",
		"remote_region": "<REGION_NAME>"
	}
}

Where:

  • <NAME> - the name of new interconnection;
  • <LOCAL_BGPVPN_ID> - uuid of exist bpgpvn in the current region (can be chosen from the list);
  • <REMOTE_BGPVPN_ID> - uuid of exist bgpvpn In the second (remote) region;
  • <REGION_NAME> - the name of second (remote) region, where customer should create the second interconnection;

In the second region request should look like this:

POST /interconnection/interconnections

{
	"interconnection": {
		"name": "<NAME>",
		"type": "bgpvpn",
		"local_resource_id": "<LOCAL_BGPVPN_ID>",
		"remote_resource_id": "<REMOTE_BGPVPN_ID>",
		"remote_region": "<REGION_NAME>",
                "remote_interconnection_id": "<REMOTE_INTERCONNECTION_ID>"
	}
}

Where:

  • <NAME> - the name of new interconnection;
  • <LOCAL_BGPVPN_ID> - uuid of exist bpgpvn in the current region (can be chosen from the list);
  • <REMOTE_BGPVPN_ID> - uuid of exist bgpvpn In the second (remote) region;
  • <REGION_NAME> - the name of second (remote) region, where customer should create the second interconnection;
  • <REMOTE_INTERCONNECTION_ID> - uuid of interconnection created on in the first region;

As result we will get an object like:

{
	"interconnection": {
		"id": "9ed4c560-68c7-4e4a-818b-1c53693376de",
		"project_id": "69522a037705457f9dc686675929617d",
		"name": "local",
		"type": "bgpvpn",
		"state": "VALIDATING",
		"local_resource_id": "d919f093-8a76-4b63-a2cf-4d7c58a9d63e",
		"remote_resource_id": "c78f68d7-bd85-4c83-9914-f78f53d90ad1",
		"remote_region": "RegionOne",
		"remote_interconnection_id": "fc87a8d3-bec6-46ad-9d98-ffb35cda64b0",
		"local_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"remote_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"tenant_id": "69522a037705457f9dc686675929617d"
	}
}

Where:

  • state - is the current status of interconnection handshake (all variations https://github.com/sapcc/networking-interconnection/blob/stable/ussuri-m3/networking_interconnection/common/constants.py#L16-L20);
  • local_parameters and remote_parameters - the bgpvpn attributes, to find source project (no need for dashboard);

List

To get the list of resources request looks like this:

GET /interconnection/interconnections

The example of result:

{
	"interconnections": [{
		"id": "9ed4c560-68c7-4e4a-818b-1c53693376de",
		"project_id": "69522a037705457f9dc686675929617d",
		"name": "first",
		"type": "bgpvpn",
		"state": "ACTIVE",
		"local_resource_id": "d919f093-8a76-4b63-a2cf-4d7c58a9d63e",
		"remote_resource_id": "c78f68d7-bd85-4c83-9914-f78f53d90ad1",
		"remote_region": "RegionOne",
		"remote_interconnection_id": "fc87a8d3-bec6-46ad-9d98-ffb35cda64b0",
		"local_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"remote_parameters": {
			"project_id": ["3cdc7456df3a45f2a6532f54a58341c6"]
		},
		"tenant_id": "69522a037705457f9dc686675929617d"
	}, {
		"id": "fc87a8d3-bec6-46ad-9d98-ffb35cda64b0",
		"project_id": "3cdc7456df3a45f2a6532f54a58341c6",
		"name": "second",
		"type": "bgpvpn",
		"state": "ACTIVE",
		"local_resource_id": "c78f68d7-bd85-4c83-9914-f78f53d90ad1",
		"remote_resource_id": "d919f093-8a76-4b63-a2cf-4d7c58a9d63e",
		"remote_region": "RegionTwo",
		"remote_interconnection_id": "9ed4c560-68c7-4e4a-818b-1c53693376de",
		"local_parameters": {
			"project_id": ["3cdc7456df3a45f2a6532f54a58341c6"]
		},
		"remote_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"tenant_id": "3cdc7456df3a45f2a6532f54a58341c6"
	}]
}

On the list TAB we have to show fields for each resource: name, local_reource_id, remote_resource_id, remote_region, remote_interconnection_id.

Get one resource

To get one resource request looks like this:

GET /interconnection/interconnections/<INTERCONNECTION_ID>

The example of result:

{
	"interconnection": {
		"id": "9ed4c560-68c7-4e4a-818b-1c53693376de",
		"project_id": "69522a037705457f9dc686675929617d",
		"name": "local",
		"type": "bgpvpn",
		"state": "ACTIVE",
		"local_resource_id": "d919f093-8a76-4b63-a2cf-4d7c58a9d63e",
		"remote_resource_id": "c78f68d7-bd85-4c83-9914-f78f53d90ad1",
		"remote_region": "RegionOne",
		"remote_interconnection_id": "fc87a8d3-bec6-46ad-9d98-ffb35cda64b0",
		"local_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"remote_parameters": {
			"project_id": ["69522a037705457f9dc686675929617d"]
		},
		"tenant_id": "69522a037705457f9dc686675929617d"
	}
}

On the detailed TAB we have to show fields for each resource: name, local_reource_id, remote_resource_id, remote_region, remote_interconnection_id, local_parameters, remote_parameters, state, type, project_id.

Delete

To delete the interconnection request looks like this:

DELETE /interconnection/interconnections/<INTERCONNECTION_ID>

velp avatar Nov 25 '21 12:11 velp