keypairs

package
v0.5.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package keypairs provides the ability to manage key pairs as well as create bms with a specified key pair.

Example to List Key Pairs

listkeypair := keypairs.ListOpts{Name: "c2c-keypair1"}
allkeypair, err := keypairs.List(client,listkeypair)
if err != nil {
	panic(err)
}

fmt.Println(allkeypair)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPair

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

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

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

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

func ExtractKeyPairs

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

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

func FilterKeyPairs

func FilterKeyPairs(keypairs []KeyPair, opts ListOpts) ([]KeyPair, error)

FilterKeyPairs used to filter keypairs using name

func List

func List(c *golangsdk.ServiceClient, opts ListOpts) ([]KeyPair, error)

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

type KeyPairPage

type KeyPairPage struct {
	pagination.LinkedPageBase
}

KeyPairPage stores a single page of all KeyPair results from a List call. Use the ExtractKeyPairs function to convert the results to a slice of KeyPairs.

func (KeyPairPage) IsEmpty

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

IsEmpty determines whether or not a KeyPairPage is empty.

type ListOpts

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL