blob: 946ddd8f8481a3d21f7ae08656f554c3f1198b6d [file] [log] [blame]
ehdou10f1f852016-10-14 20:58:23 +03001package sharenetworks
2
3import "github.com/gophercloud/gophercloud"
4
5// ShareNetwork contains all the information associated with an OpenStack
6// ShareNetwork.
7type ShareNetwork struct {
8 // The Share Network ID
9 ID string `json:"id"`
10 // The UUID of the project where the share network was created
11 ProjectID string `json:"project_id"`
12 // The neutron network ID
13 NeutronNetID string `json:"neutron_net_id"`
14 // The neutron subnet ID
15 NeutronSubnetID string `json:"neutron_subnet_id"`
16 // The nova network ID
17 NovaNetID string `json:"nova_net_id"`
18 // The network type. A valid value is VLAN, VXLAN, GRE or flat
19 NetworkType string `json:"network_type"`
20 // The segmentation ID
21 SegmentationID int `json:"segmentation_id"`
22 // The IP block from which to allocate the network, in CIDR notation
23 CIDR string `json:"cidr"`
24 // The IP version of the network. A valid value is 4 or 6
25 IPVersion int `json:"ip_version"`
26 // The Share Network name
27 Name string `json:"name"`
28 // The Share Network description
29 Description string `json:"description"`
30 // The date and time stamp when the Share Network was created
31 CreatedAt string `json:"created_at"`
32 // The date and time stamp when the Share Network was updated
33 UpdatedAt string `json:"updated_at"`
34}
35
36type commonResult struct {
37 gophercloud.Result
38}
39
40// Extract will get the ShareNetwork object out of the commonResult object.
41func (r commonResult) Extract() (*ShareNetwork, error) {
42 var s struct {
43 ShareNetwork *ShareNetwork `json:"share_network"`
44 }
45 err := r.ExtractInto(&s)
46 return s.ShareNetwork, err
47}
48
49// CreateResult contains the response body and error from a Create request.
50type CreateResult struct {
51 commonResult
52}
ehdou53687252016-10-14 22:10:13 +030053
54// DeleteResult contains the response body and error from a Delete request.
55type DeleteResult struct {
56 gophercloud.ErrResult
57}