From b0411e2d44a341fd7de6c879d6178b1f6d46386b Mon Sep 17 00:00:00 2001 From: Andrei Ozerov Date: Wed, 11 Mar 2020 09:22:09 +0300 Subject: [PATCH] Resell V2 Licenses: add port id Add PortID field into License struct. Update tests for licenses package. --- selvpcclient/resell/v2/licenses/schemas.go | 3 +++ selvpcclient/resell/v2/licenses/testing/fixtures.go | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/selvpcclient/resell/v2/licenses/schemas.go b/selvpcclient/resell/v2/licenses/schemas.go index e39cc8a..4239148 100644 --- a/selvpcclient/resell/v2/licenses/schemas.go +++ b/selvpcclient/resell/v2/licenses/schemas.go @@ -27,4 +27,7 @@ type License struct { // SubnetID represents id of the associated subnet in the Networking service. SubnetID string `json:"subnet_id"` + + // PortID represents id of the associated ports in the Networking service. + PortID string `json:"port_id"` } diff --git a/selvpcclient/resell/v2/licenses/testing/fixtures.go b/selvpcclient/resell/v2/licenses/testing/fixtures.go index fb74fa2..45248dd 100644 --- a/selvpcclient/resell/v2/licenses/testing/fixtures.go +++ b/selvpcclient/resell/v2/licenses/testing/fixtures.go @@ -14,6 +14,7 @@ const TestGetLicenseResponseRaw = ` "id": 123123, "network_id": "69dc895a-6d2a-4aa7-b2a1-dc1c827a365c", "subnet_id": "74aadf51-26ba-44b3-af26-a248a9b271e8", + "port_id": "5440825a-918b-4d07-abb7-dcf61970a9bf", "project_id": "49338ac045f448e294b25d013f890317", "region": "ru-2", "servers": [ @@ -48,6 +49,7 @@ var TestGetLicenseResponse = &licenses.License{ Status: "ACTIVE", NetworkID: "69dc895a-6d2a-4aa7-b2a1-dc1c827a365c", SubnetID: "74aadf51-26ba-44b3-af26-a248a9b271e8", + PortID: "5440825a-918b-4d07-abb7-dcf61970a9bf", Type: "license_windows_2012_standard", } @@ -59,6 +61,7 @@ const TestListLicensesResponseRaw = ` "id": 1123123, "network_id": "c89c7ff7-60ba-40b7-a687-94fa0c5a0c26", "subnet_id": "33990fd9-6972-4e20-8244-4a207e8f6036", + "port_id": "085a7b5a-b34f-4918-9382-098f5e572541", "project_id": "49338ac045f448e294b25d013f890317", "region": "ru-1", "status": "DOWN", @@ -68,6 +71,7 @@ const TestListLicensesResponseRaw = ` "id": 124123, "network_id": "01a27156-d3a8-4859-902e-48271c4dfb1b", "subnet_id": "bcb96510-60e9-4b24-a0b0-c9d0f29a687d", + "port_id": null, "project_id": "49338ac045f448e294b25d013f890317", "region": "ru-3", "status": "DOWN", @@ -77,6 +81,7 @@ const TestListLicensesResponseRaw = ` "id": 13212, "network_id": "75174ee2-4731-45ea-9c15-98ead1f0c78c", "subnet_id": "d9ccb4ca-ebc2-44f1-b838-af608e900d61", + "port_id": "0edbb4c9-290c-4fac-b3af-c7ad0e6b7057", "project_id": "49338ac045f448e294b25d013f890317", "region": "ru-2", "status": "DOWN", @@ -94,6 +99,7 @@ const TestListLicensesSingleResponseRaw = ` "id": 1123123, "network_id": "72e78fbe-131a-403a-a4a5-0d04c074d6c7", "subnet_id": "e32eb719-fdc5-4e1e-83fe-42860f0d51b1", + "port_id": null, "project_id": "49338ac045f448e294b25d013f890317", "region": "ru-1", "status": "DOWN", @@ -112,6 +118,7 @@ var TestListLicensesSingleResponse = []*licenses.License{ Status: "DOWN", NetworkID: "72e78fbe-131a-403a-a4a5-0d04c074d6c7", SubnetID: "e32eb719-fdc5-4e1e-83fe-42860f0d51b1", + PortID: "", Type: "license_windows_2012_standard", }, } @@ -148,6 +155,7 @@ const TestCreateLicenseResponseRaw = ` "type": "license_windows_2016_standard", "network_id": "f40a1c7e-cde8-4059-8f7d-49122e08229e", "subnet_id": "9263c811-9a4d-48e6-a7cb-48561f742b39", + "port_id": null, "status": "DOWN", "region": "ru-2", "project_id": "49338ac045f448e294b25d013f890317", @@ -163,6 +171,7 @@ var TestCreateLicenseResponse = []*licenses.License{ ID: 1123123, NetworkID: "f40a1c7e-cde8-4059-8f7d-49122e08229e", SubnetID: "9263c811-9a4d-48e6-a7cb-48561f742b39", + PortID: "", ProjectID: "49338ac045f448e294b25d013f890317", Region: "ru-2", Status: "DOWN",