Removed all extension functionality from core package
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index f4fbe97..f87ea87 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -113,7 +113,7 @@
// The tenant ID that is contained in the URI is the tenant that creates the
// network. An admin user, however, has the option of specifying another tenant
// ID in the CreateOpts struct.
-func Create(c *gophercloud.ServiceClient, opts CreateOpts) (*NetworkCreateResult, error) {
+func Create(c *gophercloud.ServiceClient, opts CreateOpts) (*Network, error) {
// Define structures
type network struct {
AdminStateUp bool `json:"admin_state_up,omitempty"`
@@ -125,7 +125,7 @@
Network network `json:"network"`
}
type response struct {
- Network *NetworkCreateResult `json:"network"`
+ Network *Network `json:"network"`
}
// Populate request body
diff --git a/openstack/networking/v2/networks/requests_test.go b/openstack/networking/v2/networks/requests_test.go
index b637b50..1b309a0 100644
--- a/openstack/networking/v2/networks/requests_test.go
+++ b/openstack/networking/v2/networks/requests_test.go
@@ -41,14 +41,10 @@
"54d6f61d-db07-451c-9ab3-b9609b6b6f0b"
],
"name": "private-network",
- "provider:physical_network": null,
"admin_state_up": true,
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
- "provider:network_type": "local",
- "router:external": true,
"shared": true,
- "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
- "provider:segmentation_id": null
+ "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22"
},
{
"status": "ACTIVE",
@@ -56,14 +52,10 @@
"08eae331-0402-425a-923c-34f7cfe39c1b"
],
"name": "private",
- "provider:physical_network": null,
"admin_state_up": true,
"tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
- "provider:network_type": "local",
- "router:external": true,
"shared": true,
- "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
- "provider:segmentation_id": null
+ "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324"
}
]
}
@@ -83,30 +75,22 @@
expected := []Network{
Network{
- Status: "ACTIVE",
- Subnets: []string{"54d6f61d-db07-451c-9ab3-b9609b6b6f0b"},
- Name: "private-network",
- ProviderPhysicalNetwork: "",
- AdminStateUp: true,
- TenantID: "4fd44f30292945e481c7b8a0c8908869",
- ProviderNetworkType: "local",
- RouterExternal: true,
- Shared: true,
- ID: "d32019d3-bc6e-4319-9c1d-6722fc136a22",
- ProviderSegmentationID: 0,
+ Status: "ACTIVE",
+ Subnets: []string{"54d6f61d-db07-451c-9ab3-b9609b6b6f0b"},
+ Name: "private-network",
+ AdminStateUp: true,
+ TenantID: "4fd44f30292945e481c7b8a0c8908869",
+ Shared: true,
+ ID: "d32019d3-bc6e-4319-9c1d-6722fc136a22",
},
Network{
- Status: "ACTIVE",
- Subnets: []string{"08eae331-0402-425a-923c-34f7cfe39c1b"},
- Name: "private",
- ProviderPhysicalNetwork: "",
- AdminStateUp: true,
- TenantID: "26a7980765d0414dbc1fc1f88cdb7e6e",
- ProviderNetworkType: "local",
- RouterExternal: true,
- Shared: true,
- ID: "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
- ProviderSegmentationID: 0,
+ Status: "ACTIVE",
+ Subnets: []string{"08eae331-0402-425a-923c-34f7cfe39c1b"},
+ Name: "private",
+ AdminStateUp: true,
+ TenantID: "26a7980765d0414dbc1fc1f88cdb7e6e",
+ Shared: true,
+ ID: "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
},
}
@@ -139,14 +123,10 @@
"54d6f61d-db07-451c-9ab3-b9609b6b6f0b"
],
"name": "private-network",
- "provider:physical_network": null,
"admin_state_up": true,
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
- "provider:network_type": "local",
- "router:external": true,
"shared": true,
- "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
- "provider:segmentation_id": null
+ "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22"
}
}
`)
@@ -158,12 +138,8 @@
th.AssertEquals(t, n.Status, "ACTIVE")
th.AssertDeepEquals(t, n.Subnets, []string{"54d6f61d-db07-451c-9ab3-b9609b6b6f0b"})
th.AssertEquals(t, n.Name, "private-network")
- th.AssertEquals(t, n.ProviderPhysicalNetwork, "")
- th.AssertEquals(t, n.ProviderNetworkType, "local")
- th.AssertEquals(t, n.ProviderSegmentationID, 0)
th.AssertEquals(t, n.AdminStateUp, true)
th.AssertEquals(t, n.TenantID, "4fd44f30292945e481c7b8a0c8908869")
- th.AssertEquals(t, n.RouterExternal, true)
th.AssertEquals(t, n.Shared, true)
th.AssertEquals(t, n.ID, "d32019d3-bc6e-4319-9c1d-6722fc136a22")
}
@@ -197,20 +173,7 @@
"name": "net1",
"admin_state_up": true,
"tenant_id": "9bacb3c5d39d41a79512987f338cf177",
- "segments": [
- {
- "provider:segmentation_id": 2,
- "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453",
- "provider:network_type": "vlan"
- },
- {
- "provider:segmentation_id": null,
- "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453",
- "provider:network_type": "stt"
- }
- ],
"shared": false,
- "port_security_enabled": true,
"id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c"
}
}
@@ -226,12 +189,7 @@
th.AssertEquals(t, n.Name, "net1")
th.AssertEquals(t, n.AdminStateUp, true)
th.AssertEquals(t, n.TenantID, "9bacb3c5d39d41a79512987f338cf177")
- th.AssertDeepEquals(t, n.Segments, []NetworkProvider{
- {ProviderSegmentationID: 2, ProviderPhysicalNetwork: "8bab8453-1bc9-45af-8c70-f83aa9b50453", ProviderNetworkType: "vlan"},
- {ProviderSegmentationID: 0, ProviderPhysicalNetwork: "8bab8453-1bc9-45af-8c70-f83aa9b50453", ProviderNetworkType: "stt"},
- })
th.AssertEquals(t, n.Shared, false)
- th.AssertEquals(t, n.PortSecurityEnabled, true)
th.AssertEquals(t, n.ID, "4e8e5957-649f-477b-9e5b-f1f75b21c03c")
}
@@ -292,14 +250,10 @@
"status": "ACTIVE",
"subnets": [],
"name": "new_network_name",
- "provider:physical_network": null,
"admin_state_up": false,
"tenant_id": "4fd44f30292945e481c7b8a0c8908869",
- "provider:network_type": "local",
- "router:external": false,
"shared": true,
- "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c",
- "provider:segmentation_id": null
+ "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c"
}
}
`)
diff --git a/openstack/networking/v2/networks/results.go b/openstack/networking/v2/networks/results.go
index 7f9e51a..03cfb31 100644
--- a/openstack/networking/v2/networks/results.go
+++ b/openstack/networking/v2/networks/results.go
@@ -5,13 +5,6 @@
"github.com/rackspace/gophercloud/pagination"
)
-// NetworkProvider represents provider extension data
-type NetworkProvider struct {
- ProviderSegmentationID int `json:"provider:segmentation_id"`
- ProviderPhysicalNetwork string `json:"provider:physical_network"`
- ProviderNetworkType string `json:"provider:network_type"`
-}
-
// Network represents, well, a network.
type Network struct {
// UUID for the network
@@ -29,18 +22,6 @@
TenantID string `mapstructure:"tenant_id" json:"tenant_id"`
// Specifies whether the network resource can be accessed by any tenant or not.
Shared bool `mapstructure:"shared" json:"shared"`
-
- ProviderSegmentationID int `mapstructure:"provider:segmentation_id" json:"provider:segmentation_id"`
- ProviderPhysicalNetwork string `mapstructure:"provider:physical_network" json:"provider:physical_network"`
- ProviderNetworkType string `mapstructure:"provider:network_type" json:"provider:network_type"`
- RouterExternal bool `mapstructure:"router:external" json:"router:external"`
-}
-
-// NetworkCreateResult represents what is returned by a create operation.
-type NetworkCreateResult struct {
- Network
- Segments []NetworkProvider `json:"segments"`
- PortSecurityEnabled bool `json:"port_security_enabled"`
}
// NetworkPage is the page returned by a pager when traversing over a