blob: 3e53525dc7c2077d76a1b7516349b7477451be35 [file] [log] [blame]
Ash Wilson0b96c612014-10-22 17:09:48 -04001package keypairs
2
3import (
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.
10func 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.
16func 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.
21func 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.
26func Delete(client *gophercloud.ServiceClient, name string) os.DeleteResult {
27 return os.Delete(client, name)
28}
Ash Wilson7bbfed02014-10-22 17:39:31 -040029
30// ExtractKeyPairs interprets a page of results as a slice of KeyPairs.
31func ExtractKeyPairs(page pagination.Page) ([]os.KeyPair, error) {
32 return os.ExtractKeyPairs(page)
33}