blob: da97f560028c8d47c66b349999a20aed80c82b00 [file] [log] [blame]
Jamie Hannaforda7f671a2014-09-11 10:25:08 +02001package networks
2
Jamie Hannaford01e14922014-09-11 15:23:49 +02003import (
4 "github.com/racker/perigee"
5 "github.com/rackspace/gophercloud"
6)
7
Jamie Hannaforda7f671a2014-09-11 10:25:08 +02008// User-defined options sent to the API when creating or updating a network.
9type NetworkOpts struct {
10 // The administrative state of the network, which is up (true) or down (false).
11 AdminStateUp bool `json:"admin_state_up"`
12 // The network name (optional)
13 Name string `json:"name"`
14 // Indicates whether this network is shared across all tenants. By default,
15 // only administrative users can change this value.
16 Shared bool `json:"shared"`
17 // Admin-only. The UUID of the tenant that will own the network. This tenant
18 // can be different from the tenant that makes the create network request.
19 // However, only administrative users can specify a tenant ID other than their
20 // own. You cannot change this value through authorization policies.
21 TenantID string `json:"tenant_id"`
22}
Jamie Hannaford01e14922014-09-11 15:23:49 +020023
24func APIVersions(c *gophercloud.ServiceClient) (*APIVersionsList, error) {
25 url := APIVersionsURL(c)
26
27 var resp APIVersionsList
28 _, err := perigee.Request("GET", url, perigee.Options{
29 MoreHeaders: c.Provider.AuthenticatedHeaders(),
30 Results: &resp,
31 OkCodes: []int{200},
32 })
33 if err != nil {
34 return nil, err
35 }
36
37 return &resp, nil
38}