Ash Wilson | 0b96c61 | 2014-10-22 17:09:48 -0400 | [diff] [blame] | 1 | package keypairs |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | os "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs" |
| 6 | "github.com/rackspace/gophercloud/pagination" |
| 7 | ) |
| 8 | |
| 9 | // List returns a Pager that allows you to iterate over a collection of KeyPairs. |
| 10 | func List(client *gophercloud.ServiceClient) pagination.Pager { |
| 11 | return os.List(client) |
| 12 | } |
| 13 | |
| 14 | // Create requests the creation of a new keypair on the server, or to import a pre-existing |
| 15 | // keypair. |
| 16 | func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { |
| 17 | return os.Create(client, opts) |
| 18 | } |
| 19 | |
| 20 | // Get returns public data about a previously uploaded KeyPair. |
| 21 | func Get(client *gophercloud.ServiceClient, name string) os.GetResult { |
| 22 | return os.Get(client, name) |
| 23 | } |
| 24 | |
| 25 | // Delete requests the deletion of a previous stored KeyPair from the server. |
| 26 | func Delete(client *gophercloud.ServiceClient, name string) os.DeleteResult { |
| 27 | return os.Delete(client, name) |
| 28 | } |
Ash Wilson | 7bbfed0 | 2014-10-22 17:39:31 -0400 | [diff] [blame] | 29 | |
| 30 | // ExtractKeyPairs interprets a page of results as a slice of KeyPairs. |
| 31 | func ExtractKeyPairs(page pagination.Page) ([]os.KeyPair, error) { |
| 32 | return os.ExtractKeyPairs(page) |
| 33 | } |