gophercloud: github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs Index | Files

package keypairs

import "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs"

Package keypairs provides information and interaction with the Keypairs extension for the OpenStack Compute service.

Index

Package Files

doc.go requests.go results.go urls.go

func ExtractKeyPairs Uses

func ExtractKeyPairs(page pagination.Page) ([]KeyPair, error)

ExtractKeyPairs interprets a page of results as a slice of KeyPairs.

func List Uses

func List(client *gophercloud.ServiceClient) pagination.Pager

List returns a Pager that allows you to iterate over a collection of KeyPairs.

type CreateOpts Uses

type CreateOpts struct {
    // Name [required] is a friendly name to refer to this KeyPair in other services.
    Name string

    // PublicKey [optional] is a pregenerated OpenSSH-formatted public key. If provided, this key
    // will be imported and no new key will be created.
    PublicKey string
}

CreateOpts specifies keypair creation or import parameters.

func (CreateOpts) ToKeyPairCreateMap Uses

func (opts CreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)

ToKeyPairCreateMap constructs a request body from CreateOpts.

type CreateOptsBuilder Uses

type CreateOptsBuilder interface {
    ToKeyPairCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder describes struct types that can be accepted by the Create call. Notable, the CreateOpts struct in this package does.

type CreateOptsExt Uses

type CreateOptsExt struct {
    servers.CreateOptsBuilder
    KeyName string `json:"key_name,omitempty"`
}

CreateOptsExt adds a KeyPair option to the base CreateOpts.

func (CreateOptsExt) ToServerCreateMap Uses

func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error)

ToServerCreateMap adds the key_name and, optionally, key_data options to the base server creation options.

type CreateResult Uses

type CreateResult struct {
    // contains filtered or unexported fields
}

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a KeyPair.

func Create Uses

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult

Create requests the creation of a new keypair on the server, or to import a pre-existing keypair.

func (CreateResult) Extract Uses

func (r CreateResult) Extract() (*KeyPair, error)

Extract is a method that attempts to interpret any KeyPair resource response as a KeyPair struct.

type DeleteResult Uses

type DeleteResult struct {
    gophercloud.ErrResult
}

DeleteResult is the response from a Delete operation. Call its Extract method to determine if the call succeeded or failed.

func Delete Uses

func Delete(client *gophercloud.ServiceClient, name string) DeleteResult

Delete requests the deletion of a previous stored KeyPair from the server.

type GetResult Uses

type GetResult struct {
    // contains filtered or unexported fields
}

GetResult is the response from a Get operation. Call its Extract method to interpret it as a KeyPair.

func Get Uses

func Get(client *gophercloud.ServiceClient, name string) GetResult

Get returns public data about a previously uploaded KeyPair.

func (GetResult) Extract Uses

func (r GetResult) Extract() (*KeyPair, error)

Extract is a method that attempts to interpret any KeyPair resource response as a KeyPair struct.

type KeyPair Uses

type KeyPair struct {
    // Name is used to refer to this keypair from other services within this region.
    Name string `mapstructure:"name"`

    // Fingerprint is a short sequence of bytes that can be used to authenticate or validate a longer
    // public key.
    Fingerprint string `mapstructure:"fingerprint"`

    // PublicKey is the public key from this pair, in OpenSSH format. "ssh-rsa AAAAB3Nz..."
    PublicKey string `mapstructure:"public_key"`

    // PrivateKey is the private key from this pair, in PEM format.
    // "-----BEGIN RSA PRIVATE KEY-----\nMIICXA..." It is only present if this keypair was just
    // returned from a Create call
    PrivateKey string `mapstructure:"private_key"`

    // UserID is the user who owns this keypair.
    UserID string `mapstructure:"user_id"`
}

KeyPair is an SSH key known to the OpenStack cluster that is available to be injected into servers.

type KeyPairPage Uses

type KeyPairPage struct {
    pagination.SinglePageBase
}

KeyPairPage stores a single, only page of KeyPair results from a List call.

func (KeyPairPage) IsEmpty Uses

func (page KeyPairPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a KeyPairPage is empty.

Package keypairs imports 5 packages (graph) and is imported by 99 packages. Updated 2016-07-15. Refresh now. Tools for package owners.