Ash Wilson | 0a997f8 | 2014-09-03 15:50:52 -0400 | [diff] [blame] | 1 | package endpoints |
Ash Wilson | bdfc330 | 2014-09-04 10:16:28 -0400 | [diff] [blame^] | 2 | |
| 3 | import ( |
| 4 | "errors" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
| 8 | |
| 9 | // Interface describes the availability of a specific service endpoint. |
| 10 | type Interface string |
| 11 | |
| 12 | const ( |
| 13 | // InterfaceAdmin makes an endpoint only available to administrators. |
| 14 | InterfaceAdmin Interface = "admin" |
| 15 | |
| 16 | // InterfacePublic makes an endpoint available to everyone. |
| 17 | InterfacePublic Interface = "public" |
| 18 | |
| 19 | // InterfaceInternal makes an endpoint only available within the cluster. |
| 20 | InterfaceInternal Interface = "internal" |
| 21 | ) |
| 22 | |
| 23 | // EndpointOpts contains the subset of Endpoint attributes that should be used to create or update an Endpoint. |
| 24 | type EndpointOpts struct { |
| 25 | Interface Interface |
| 26 | Name string |
| 27 | Region string |
| 28 | URL string |
| 29 | ServiceID string |
| 30 | } |
| 31 | |
| 32 | // Create inserts a new Endpoint into the service catalog. |
| 33 | func Create(client *gophercloud.ServiceClient, opts EndpointOpts) (*Endpoint, error) { |
| 34 | return nil, errors.New("Not implemented") |
| 35 | } |
| 36 | |
| 37 | // ListOpts allows finer control over the the endpoints returned by a List call. |
| 38 | // All fields are optional. |
| 39 | type ListOpts struct { |
| 40 | Interface Interface |
| 41 | ServiceID string |
| 42 | Page int |
| 43 | PerPage int |
| 44 | } |
| 45 | |
| 46 | // List enumerates endpoints in a paginated collection, optionally filtered by ListOpts criteria. |
| 47 | func List(client *gophercloud.ServiceClient, opts ListOpts) (*EndpointList, error) { |
| 48 | return nil, errors.New("Not implemented") |
| 49 | } |
| 50 | |
| 51 | // Update changes an existing endpoint with new data. |
| 52 | func Update(client *gophercloud.ServiceClient, endpointID string, opts EndpointOpts) (*Endpoint, error) { |
| 53 | return nil, errors.New("Not implemented") |
| 54 | } |
| 55 | |
| 56 | // Delete removes an endpoint from the service catalog. |
| 57 | func Delete(client *gophercloud.ServiceClient, endpointID string) error { |
| 58 | return errors.New("Not implemented") |
| 59 | } |