gophercloud

package module
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Gophercloud: an OpenStack SDK for Go

Coverage Status

Reference documentation

Gophercloud is a Go SDK for OpenStack.

Join us on kubernetes slack, on #gophercloud. Visit slack.k8s.io for an invitation.

Note This branch contains the current stable branch of Gophercloud: v2. The legacy stable version can be found in the v1 branch.

How to install

Reference a Gophercloud package in your code:

import "github.com/gophercloud/gophercloud/v2"

Then update your go.mod:

go mod tidy

Getting started

Credentials

Because you'll be hitting an API, you will need to retrieve your OpenStack credentials and either store them in a clouds.yaml file, as environment variables, or in your local Go files. The first method is recommended because it decouples credential information from source code, allowing you to push the latter to your version control system without any security risk.

You will need to retrieve the following:

  • A valid Keystone identity URL
  • Credentials. These can be a username/password combo, a set of Application Credentials, a pre-generated token, or any other supported authentication mechanism.

For users who have the OpenStack dashboard installed, there's a shortcut. If you visit the project/api_access path in Horizon and click on the "Download OpenStack RC File" button at the top right hand corner, you can download either a clouds.yaml file or an openrc bash file that exports all of your access details to environment variables. To use the clouds.yaml file, place it at ~/.config/openstack/clouds.yaml. To use the openrc file, run source openrc and you will be prompted for your password.

Gophercloud authentication

Gophercloud authentication is organized into two layered abstractions:

  • ProviderClient holds the authentication token and can be used to build a ServiceClient.
  • ServiceClient specializes against one specific OpenStack module and can directly be used to make API calls.

A provider client is a top-level client that all of your OpenStack service clients derive from. The provider contains all of the authentication details that allow your Go code to access the API - such as the base URL and token ID.

One single Provider client can be used to build as many Service clients as needed.

With clouds.yaml

package main

import (
	"context"

	"github.com/gophercloud/gophercloud/v2/openstack"
	"github.com/gophercloud/gophercloud/v2/openstack/config"
	"github.com/gophercloud/gophercloud/v2/openstack/config/clouds"
)

func main() {
	ctx := context.Background()

	// Fetch coordinates from a `cloud.yaml` in the current directory, or
	// in the well-known config directories (different for each operating
	// system).
	authOptions, endpointOptions, tlsConfig, err := clouds.Parse()
	if err != nil {
		panic(err)
	}

	// Call Keystone to get an authentication token, and use it to
	// construct a ProviderClient. All functions hitting the OpenStack API
	// accept a `context.Context` to enable tracing and cancellation.
	providerClient, err := config.NewProviderClient(ctx, authOptions, config.WithTLSConfig(tlsConfig))
	if err != nil {
		panic(err)
	}

	// Use the ProviderClient and the endpoint options fetched from
	// `clouds.yaml` to build a service client: a compute client in this
	// case. Note that the contructor does not accept a `context.Context`:
	// no further call to the OpenStack API is needed at this stage.
	computeClient, err := openstack.NewComputeV2(providerClient, endpointOptions)
	if err != nil {
		panic(err)
	}

	// use the computeClient
}

With environment variables (openrc)

Gophercloud can parse the environment variables set by running source openrc:

package main

import (
	"context"
	"os"

	"github.com/gophercloud/gophercloud/v2"
	"github.com/gophercloud/gophercloud/v2/openstack"
)

func main() {
	ctx := context.Background()

	opts, err := openstack.AuthOptionsFromEnv()
	if err != nil {
		panic(err)
	}

	providerClient, err := openstack.AuthenticatedClient(ctx, opts)
	if err != nil {
		panic(err)
	}

	computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{
		Region: os.Getenv("OS_REGION_NAME"),
	})
	if err != nil {
		panic(err)
	}

	// use the computeClient
}

Manually

You can also generate a "Provider" by passing in your credentials explicitly:

package main

import (
	"context"

	"github.com/gophercloud/gophercloud/v2"
	"github.com/gophercloud/gophercloud/v2/openstack"
)

func main() {
	ctx := context.Background()

	providerClient, err := openstack.AuthenticatedClient(ctx, gophercloud.AuthOptions{
		IdentityEndpoint: "https://openstack.example.com:5000/v2.0",
		Username:         "username",
		Password:         "password",
	})
	if err != nil {
		panic(err)
	}

	computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{
		Region: "RegionName",
	})
	if err != nil {
		panic(err)
	}

	// use the computeClient
}
Provision a server

We can use the Compute service client generated above for any Compute API operation we want. In our case, we want to provision a new server. To do this, we invoke the Create method and pass in the flavor ID (hardware specification) and image ID (operating system) we're interested in:

import "github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers"

func main() {
    // [...]

    server, err := servers.Create(context.TODO(), computeClient, servers.CreateOpts{
        Name:      "My new server!",
        FlavorRef: "flavor_id",
        ImageRef:  "image_id",
    }).Extract()

    // [...]

The above code sample creates a new server with the parameters, and returns a servers.Server.

Supported Services

Service Name Module 1.x 2.x
Baremetal Ironic openstack/baremetal
Baremetal Introspection Ironic Inspector openstack/baremetalintrospection
Block Storage Cinder openstack/blockstorage
Clustering Senlin openstack/clustering
Compute Nova openstack/compute
Container Zun openstack/container
Container Infrastructure Magnum openstack/containerinfra
Database Trove openstack/db
DNS Designate openstack/dns
Identity Keystone openstack/identity
Image Glance openstack/image
Key Management Barbican openstack/keymanager
Load Balancing Octavia openstack/loadbalancer
Messaging Zaqar openstack/messaging
Networking Neutron openstack/networking
Object Storage Swift openstack/objectstorage

Advanced Usage

Have a look at the FAQ for some tips on customizing the way Gophercloud works.

Backwards-Compatibility Guarantees

Gophercloud versioning follows semver.

Before v1.0.0, there were no guarantees. Starting with v1, there will be no breaking changes within a major release.

See the Release instructions.

Contributing

See the contributing guide.

Help and feedback

If you're struggling with something or have spotted a potential bug, feel free to submit an issue to our bug tracker.

Documentation

Overview

Package gophercloud provides a multi-vendor interface to OpenStack-compatible clouds. The library has a three-level hierarchy: providers, services, and resources.

Authenticating with Providers

Provider structs represent the cloud providers that offer and manage a collection of services. You will generally want to create one Provider client per OpenStack cloud.

It is now recommended to use the `clientconfig` package found at
https://github.com/gophercloud/utils/tree/master/openstack/clientconfig
for all authentication purposes.

The below documentation is still relevant. clientconfig simply implements
the below and presents it in an easier and more flexible way.

Use your OpenStack credentials to create a Provider client. The IdentityEndpoint is typically refered to as "auth_url" or "OS_AUTH_URL" in information provided by the cloud operator. Additionally, the cloud may refer to TenantID or TenantName as project_id and project_name. Credentials are specified like so:

opts := gophercloud.AuthOptions{
	IdentityEndpoint: "https://openstack.example.com:5000/v2.0",
	Username: "{username}",
	Password: "{password}",
	TenantID: "{tenant_id}",
}

provider, err := openstack.AuthenticatedClient(context.TODO(), opts)

You can authenticate with a token by doing:

opts := gophercloud.AuthOptions{
	IdentityEndpoint: "https://openstack.example.com:5000/v2.0",
	TokenID:  "{token_id}",
	TenantID: "{tenant_id}",
}

provider, err := openstack.AuthenticatedClient(context.TODO(), opts)

You may also use the openstack.AuthOptionsFromEnv() helper function. This function reads in standard environment variables frequently found in an OpenStack `openrc` file. Again note that Gophercloud currently uses "tenant" instead of "project".

opts, err := openstack.AuthOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(context.TODO(), opts)

Service Clients

Service structs are specific to a provider and handle all of the logic and operations for a particular OpenStack service. Examples of services include: Compute, Object Storage, Block Storage. In order to define one, you need to pass in the parent provider, like so:

opts := gophercloud.EndpointOpts{Region: "RegionOne"}

client, err := openstack.NewComputeV2(provider, opts)

Resources

Resource structs are the domain models that services make use of in order to work with and represent the state of API resources:

server, err := servers.Get(context.TODO(), client, "{serverId}").Extract()

Intermediate Result structs are returned for API operations, which allow generic access to the HTTP headers, response body, and any errors associated with the network transaction. To turn a result into a usable resource struct, you must call the Extract method which is chained to the response, or an Extract function from an applicable extension:

result := servers.Get(context.TODO(), client, "{serverId}")

// Attempt to extract the disk configuration from the OS-DCF disk config
// extension:
config, err := diskconfig.ExtractGet(result)

All requests that enumerate a collection return a Pager struct that is used to iterate through the results one page at a time. Use the EachPage method on that Pager to handle each successive Page in a closure, then use the appropriate extraction method from that request's package to interpret that Page as a slice of results:

err := servers.List(client, nil).EachPage(context.TODO(), func (_ context.Context, page pagination.Page) (bool, error) {
	s, err := servers.ExtractServers(page)
	if err != nil {
		return false, err
	}

	// Handle the []servers.Server slice.

	// Return "false" or an error to prematurely stop fetching new pages.
	return true, nil
})

If you want to obtain the entire collection of pages without doing any intermediary processing on each page, you can use the AllPages method:

allPages, err := servers.List(client, nil).AllPages(context.TODO())
allServers, err := servers.ExtractServers(allPages)

This top-level package contains utility functions and data types that are used throughout the provider and service packages. Of particular note for end users are the AuthOptions and EndpointOpts structs.

An example retry backoff function, which respects the 429 HTTP response code and a "Retry-After" header:

endpoint := "http://localhost:5000"
provider, err := openstack.NewClient(endpoint)
if err != nil {
	panic(err)
}
provider.MaxBackoffRetries = 3 // max three retries
provider.RetryBackoffFunc = func(ctx context.Context, respErr *ErrUnexpectedResponseCode, e error, retries uint) error {
	retryAfter := respErr.ResponseHeader.Get("Retry-After")
	if retryAfter == "" {
		return e
	}

	var sleep time.Duration

	// Parse delay seconds or HTTP date
	if v, err := strconv.ParseUint(retryAfter, 10, 32); err == nil {
		sleep = time.Duration(v) * time.Second
	} else if v, err := time.Parse(http.TimeFormat, retryAfter); err == nil {
		sleep = time.Until(v)
	} else {
		return e
	}

	if ctx != nil {
		select {
		case <-time.After(sleep):
		case <-ctx.Done():
			return e
		}
	} else {
		time.Sleep(sleep)
	}

	return nil
}

Index

Constants

View Source
const (
	DefaultUserAgent         = "gophercloud/v3.0.0-UNRELEASED"
	DefaultMaxBackoffRetries = 60
)

DefaultUserAgent is the default User-Agent string set in the request header.

View Source
const RFC3339Milli = "2006-01-02T15:04:05.999999Z"

RFC3339Milli describes a common time format used by some API responses.

View Source
const RFC3339MilliNoZ = "2006-01-02T15:04:05.999999"
View Source
const RFC3339NoZ = "2006-01-02T15:04:05"

RFC3339NoZ is the time format used in Heat (Orchestration).

View Source
const RFC3339ZNoT = "2006-01-02 15:04:05-07:00"

RFC3339ZNoT is the time format used in Zun (Containers Service).

View Source
const RFC3339ZNoTNoZ = "2006-01-02 15:04:05"

RFC3339ZNoTNoZ is another time format used in Zun (Containers Service).

Variables

This section is empty.

Functions

func BuildHeaders

func BuildHeaders(opts any) (map[string]string, error)

BuildHeaders is an internal function to be used by request methods in individual resource packages.

It accepts an arbitrary tagged structure and produces a string map that's suitable for use as the HTTP headers of an outgoing request. Field names are mapped to header names based in "h" tags.

type struct Something {
  Bar string `h:"x_bar"`
  Baz int    `h:"lorem_ipsum"`
}

instance := Something{
  Bar: "AAA",
  Baz: "BBB",
}

will be converted into:

map[string]string{
  "x_bar": "AAA",
  "lorem_ipsum": "BBB",
}

Untagged fields and fields left at their zero values are skipped. Integers, booleans and string values are supported.

func BuildQueryString

func BuildQueryString(opts any) (*url.URL, error)

BuildQueryString is an internal function to be used by request methods in individual resource packages.

It accepts a tagged structure and expands it into a URL struct. Field names are converted into query parameters based on a "q" tag. For example:

type struct Something {
   Bar string `q:"x_bar"`
   Baz int    `q:"lorem_ipsum"`
}

instance := Something{
   Bar: "AAA",
   Baz: "BBB",
}

will be converted into "?x_bar=AAA&lorem_ipsum=BBB".

The struct's fields may be strings, integers, slices, or boolean values. Fields left at their type's zero value will be omitted from the query.

Slice are handled in one of two ways:

type struct Something {
   Bar []string `q:"bar"` // E.g. ?bar=1&bar=2
   Baz []int    `q:"baz" format="comma-separated"` // E.g. ?baz=1,2
}

func BuildRequestBody

func BuildRequestBody(opts any, parent string) (map[string]any, error)

BuildRequestBody builds a map[string]interface from the given `struct`. If parent is not an empty string, the final map[string]interface returned will encapsulate the built one. For example:

disk := 1
createOpts := flavors.CreateOpts{
  ID:         "1",
  Name:       "m1.tiny",
  Disk:       &disk,
  RAM:        512,
  VCPUs:      1,
  RxTxFactor: 1.0,
}

body, err := gophercloud.BuildRequestBody(createOpts, "flavor")

The above example can be run as-is, however it is recommended to look at how BuildRequestBody is used within Gophercloud to more fully understand how it fits within the request process as a whole rather than use it directly as shown above.

func ExtractNextURL

func ExtractNextURL(links []Link) (string, error)

ExtractNextURL is an internal function useful for packages of collection resources that are paginated in a certain way.

It attempts to extract the "next" URL from slice of Link structs, or "" if no such URL is present.

func IDSliceToQueryString

func IDSliceToQueryString(name string, ids []int) string

IDSliceToQueryString takes a slice of elements and converts them into a query string. For example, if name=foo and slice=[]int{20, 40, 60}, then the result would be `?name=20&name=40&name=60'

func IntToPointer

func IntToPointer(i int) *int

IntToPointer is a function for converting integers into integer pointers. This is useful when passing in options to operations.

func IntWithinRange

func IntWithinRange(val, min, max int) bool

IntWithinRange returns TRUE if an integer falls within a defined range, and FALSE if not.

func MaybeInt

func MaybeInt(original int) *int

MaybeInt is an internal function to be used by request methods in individual resource packages.

Like MaybeString, it accepts an int that may or may not be a zero value, and returns either a pointer to its address or nil. It's intended to hint that the JSON serializer should omit its field.

func MaybeString

func MaybeString(original string) *string

MaybeString is an internal function to be used by request methods in individual resource packages.

It takes a string that might be a zero value and returns either a pointer to its address or nil. This is useful for allowing users to conveniently omit values from an options struct by leaving them zeroed, but still pass nil to the JSON serializer so they'll be omitted from the request body.

func NormalizePathURL

func NormalizePathURL(basePath, rawPath string) (string, error)

NormalizePathURL is used to convert rawPath to a fqdn, using basePath as a reference in the filesystem, if necessary. basePath is assumed to contain either '.' when first used, or the file:// type fqdn of the parent resource. e.g. myFavScript.yaml => file://opt/lib/myFavScript.yaml

func NormalizeURL

func NormalizeURL(url string) string

NormalizeURL is an internal function to be used by provider clients.

It ensures that each endpoint URL has a closing `/`, as expected by ServiceClient's methods.

func ParseResponse

func ParseResponse(resp *http.Response, err error) (io.ReadCloser, http.Header, error)

ParseResponse is a helper function to parse http.Response to constituents.

func RemainingKeys

func RemainingKeys(s any, m map[string]any) (extras map[string]any)

RemainingKeys will inspect a struct and compare it to a map. Any struct field that does not have a JSON tag that matches a key in the map or a matching lower-case field in the map will be returned as an extra.

This is useful for determining the extra fields returned in response bodies for resources that can contain an arbitrary or dynamic number of fields.

func ResponseCodeIs

func ResponseCodeIs(err error, status int) bool

ResponseCodeIs returns true if this error is or contains an ErrUnexpectedResponseCode reporting that the request failed with the given response code. For example, this checks if a request failed because of a 404 error:

allServers, err := servers.List(client, servers.ListOpts{})
if gophercloud.ResponseCodeIs(err, http.StatusNotFound) {
	handleNotFound()
}

It is safe to pass a nil error, in which case this function always returns false.

func WaitFor

func WaitFor(ctx context.Context, predicate func(context.Context) (bool, error)) error

WaitFor polls a predicate function, once per second, up to a context cancellation. This is useful to wait for a resource to transition to a certain state. Resource packages will wrap this in a more convenient function that's specific to a certain resource, but it can also be useful on its own.

Types

type AuthOptions

type AuthOptions struct {
	// IdentityEndpoint specifies the HTTP endpoint that is required to work with
	// the Identity API of the appropriate version. While it's ultimately needed by
	// all of the identity services, it will often be populated by a provider-level
	// function.
	//
	// The IdentityEndpoint is typically referred to as the "auth_url" or
	// "OS_AUTH_URL" in the information provided by the cloud operator.
	IdentityEndpoint string `json:"-"`

	// Username is required if using Identity V2 API. Consult with your provider's
	// control panel to discover your account's username. In Identity V3, either
	// UserID or a combination of Username and DomainID or DomainName are needed.
	Username string `json:"username,omitempty"`
	UserID   string `json:"-"`

	Password string `json:"password,omitempty"`

	// Passcode is used in TOTP authentication method
	Passcode string `json:"passcode,omitempty"`

	// At most one of DomainID and DomainName must be provided if using Username
	// with Identity V3. Otherwise, either are optional.
	DomainID   string `json:"-"`
	DomainName string `json:"name,omitempty"`

	// The TenantID and TenantName fields are optional for the Identity V2 API.
	// The same fields are known as project_id and project_name in the Identity
	// V3 API, but are collected as TenantID and TenantName here in both cases.
	// Some providers allow you to specify a TenantName instead of the TenantId.
	// Some require both. Your provider's authentication policies will determine
	// how these fields influence authentication.
	// If DomainID or DomainName are provided, they will also apply to TenantName.
	// It is not currently possible to authenticate with Username and a Domain
	// and scope to a Project in a different Domain by using TenantName. To
	// accomplish that, the ProjectID will need to be provided as the TenantID
	// option.
	TenantID   string `json:"tenantId,omitempty"`
	TenantName string `json:"tenantName,omitempty"`

	// AllowReauth should be set to true if you grant permission for Gophercloud to
	// cache your credentials in memory, and to allow Gophercloud to attempt to
	// re-authenticate automatically if/when your token expires.  If you set it to
	// false, it will not cache these settings, but re-authentication will not be
	// possible.  This setting defaults to false.
	//
	// NOTE: The reauth function will try to re-authenticate endlessly if left
	// unchecked. The way to limit the number of attempts is to provide a custom
	// HTTP client to the provider client and provide a transport that implements
	// the RoundTripper interface and stores the number of failed retries. For an
	// example of this, see here:
	// https://github.com/rackspace/rack/blob/1.0.0/auth/clients.go#L311
	AllowReauth bool `json:"-"`

	// TokenID allows users to authenticate (possibly as another user) with an
	// authentication token ID.
	TokenID string `json:"-"`

	// Scope determines the scoping of the authentication request.
	Scope *AuthScope `json:"-"`

	// Authentication through Application Credentials requires supplying name, project and secret
	// For project we can use TenantID
	ApplicationCredentialID     string `json:"-"`
	ApplicationCredentialName   string `json:"-"`
	ApplicationCredentialSecret string `json:"-"`
}

AuthOptions stores information needed to authenticate to an OpenStack Cloud. You can populate one manually, or use a provider's AuthOptionsFromEnv() function to read relevant information from the standard environment variables. Pass one to a provider's AuthenticatedClient function to authenticate and obtain a ProviderClient representing an active session on that provider.

Its fields are the union of those recognized by each identity implementation and provider.

An example of manually providing authentication information:

opts := gophercloud.AuthOptions{
  IdentityEndpoint: "https://openstack.example.com:5000/v2.0",
  Username: "{username}",
  Password: "{password}",
  TenantID: "{tenant_id}",
}

provider, err := openstack.AuthenticatedClient(context.TODO(), opts)

An example of using AuthOptionsFromEnv(), where the environment variables can be read from a file, such as a standard openrc file:

opts, err := openstack.AuthOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(context.TODO(), opts)

func (AuthOptions) CanReauth

func (opts AuthOptions) CanReauth() bool

func (AuthOptions) ToTokenV2CreateMap

func (opts AuthOptions) ToTokenV2CreateMap() (map[string]any, error)

ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder interface in the v2 tokens package

func (*AuthOptions) ToTokenV3CreateMap

func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]any) (map[string]any, error)

ToTokenV3CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder interface in the v3 tokens package

func (*AuthOptions) ToTokenV3HeadersMap

func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]any) (map[string]string, error)

ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder interface in the v3 tokens package.

func (*AuthOptions) ToTokenV3ScopeMap

func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]any, error)

ToTokenV3ScopeMap builds a scope from AuthOptions and satisfies interface in the v3 tokens package.

type AuthResult

type AuthResult interface {
	ExtractTokenID() (string, error)
}

AuthResult is the result from the request that was used to obtain a provider client's Keystone token. It is returned from ProviderClient.GetAuthResult().

The following types satisfy this interface:

github.com/gophercloud/gophercloud/openstack/identity/v2/tokens.CreateResult
github.com/gophercloud/gophercloud/openstack/identity/v3/tokens.CreateResult

Usage example:

import (
	"github.com/gophercloud/gophercloud/v2"
	tokens2 "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens"
	tokens3 "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens"
)

func GetAuthenticatedUserID(providerClient *gophercloud.ProviderClient) (string, error) {
	r := providerClient.GetAuthResult()
	if r == nil {
		//ProviderClient did not use openstack.Authenticate(), e.g. because token
		//was set manually with ProviderClient.SetToken()
		return "", errors.New("no AuthResult available")
	}
	switch r := r.(type) {
	case tokens2.CreateResult:
		u, err := r.ExtractUser()
		if err != nil {
			return "", err
		}
		return u.ID, nil
	case tokens3.CreateResult:
		u, err := r.ExtractUser()
		if err != nil {
			return "", err
		}
		return u.ID, nil
	default:
		panic(fmt.Sprintf("got unexpected AuthResult type %t", r))
	}
}

Both implementing types share a lot of methods by name, like ExtractUser() in this example. But those methods cannot be part of the AuthResult interface because the return types are different (in this case, type tokens2.User vs. type tokens3.User).

type AuthScope

type AuthScope struct {
	ProjectID   string
	ProjectName string
	DomainID    string
	DomainName  string
	System      bool
	TrustID     string
}

AuthScope allows a created token to be limited to a specific domain or project.

type Availability

type Availability string

Availability indicates to whom a specific service endpoint is accessible: the internet at large, internal networks only, or only to administrators. Different identity services use different terminology for these. Identity v2 lists them as different kinds of URLs within the service catalog ("adminURL", "internalURL", and "publicURL"), while v3 lists them as "Interfaces" in an endpoint's response.

const (
	// AvailabilityAdmin indicates that an endpoint is only available to
	// administrators.
	AvailabilityAdmin Availability = "admin"

	// AvailabilityPublic indicates that an endpoint is available to everyone on
	// the internet.
	AvailabilityPublic Availability = "public"

	// AvailabilityInternal indicates that an endpoint is only available within
	// the cluster's internal network.
	AvailabilityInternal Availability = "internal"
)

type BaseError

type BaseError struct {
	DefaultErrString string
	Info             string
}

BaseError is an error type that all other error types embed.

func (BaseError) Error

func (e BaseError) Error() string

type EnabledState

type EnabledState *bool

EnabledState is a convenience type, mostly used in Create and Update operations. Because the zero value of a bool is FALSE, we need to use a pointer instead to indicate zero-ness.

var (
	Enabled  EnabledState = &iTrue
	Disabled EnabledState = &iFalse
)

Convenience vars for EnabledState values.

type EndpointLocator

type EndpointLocator func(EndpointOpts) (string, error)

EndpointLocator is an internal function to be used by provider implementations.

It provides an implementation that locates a single endpoint from a service catalog for a specific ProviderClient based on user-provided EndpointOpts. The provider then uses it to discover related ServiceClients.

type EndpointOpts

type EndpointOpts struct {
	// Type [required] is the service type for the client (e.g., "compute",
	// "object-store"). Generally, this will be supplied by the service client
	// function, but a user-given value will be honored if provided.
	Type string

	// Name [optional] is the service name for the client (e.g., "nova") as it
	// appears in the service catalog. Services can have the same Type but a
	// different Name, which is why both Type and Name are sometimes needed.
	Name string

	// Region [required] is the geographic region in which the endpoint resides,
	// generally specifying which datacenter should house your resources.
	// Required only for services that span multiple regions.
	Region string

	// Availability [optional] is the visibility of the endpoint to be returned.
	// Valid types include the constants AvailabilityPublic, AvailabilityInternal,
	// or AvailabilityAdmin from this package.
	//
	// Availability is not required, and defaults to AvailabilityPublic. Not all
	// providers or services offer all Availability options.
	Availability Availability
}

EndpointOpts specifies search criteria used by queries against an OpenStack service catalog. The options must contain enough information to unambiguously identify one, and only one, endpoint within the catalog.

Usually, these are passed to service client factory functions in a provider package, like "openstack.NewComputeV2()".

func (*EndpointOpts) ApplyDefaults

func (eo *EndpointOpts) ApplyDefaults(t string)

ApplyDefaults is an internal method to be used by provider implementations.

It sets EndpointOpts fields if not already set, including a default type. Currently, EndpointOpts.Availability defaults to the public endpoint.

type ErrAPIKeyProvided

type ErrAPIKeyProvided struct{ BaseError }

ErrAPIKeyProvided indicates that an APIKey was provided but can't be used.

func (ErrAPIKeyProvided) Error

func (e ErrAPIKeyProvided) Error() string

type ErrAppCredMissingSecret

type ErrAppCredMissingSecret struct{ BaseError }

ErrAppCredMissingSecret indicates that no Application Credential Secret was provided with Application Credential ID or Name

func (ErrAppCredMissingSecret) Error

func (e ErrAppCredMissingSecret) Error() string

type ErrDomainIDOrDomainName

type ErrDomainIDOrDomainName struct{ BaseError }

ErrDomainIDOrDomainName indicates that a username was provided, but no domain to scope it. It may also indicate that both a DomainID and a DomainName were provided at once.

func (ErrDomainIDOrDomainName) Error

func (e ErrDomainIDOrDomainName) Error() string

type ErrDomainIDWithToken

type ErrDomainIDWithToken struct{ BaseError }

ErrDomainIDWithToken indicates that a DomainID was provided, but token authentication is being used instead.

func (ErrDomainIDWithToken) Error

func (e ErrDomainIDWithToken) Error() string

type ErrDomainIDWithUserID

type ErrDomainIDWithUserID struct{ BaseError }

ErrDomainIDWithUserID indicates that a DomainID was provided, but unnecessary because a UserID is being used.

func (ErrDomainIDWithUserID) Error

func (e ErrDomainIDWithUserID) Error() string

type ErrDomainNameWithToken

type ErrDomainNameWithToken struct{ BaseError }

ErrDomainNameWithToken indicates that a DomainName was provided, but token authentication is being used instead.s

func (ErrDomainNameWithToken) Error

func (e ErrDomainNameWithToken) Error() string

type ErrDomainNameWithUserID

type ErrDomainNameWithUserID struct{ BaseError }

ErrDomainNameWithUserID indicates that a DomainName was provided, but unnecessary because a UserID is being used.

func (ErrDomainNameWithUserID) Error

func (e ErrDomainNameWithUserID) Error() string

type ErrEndpointNotFound

type ErrEndpointNotFound struct {
	BaseError
}

ErrEndpointNotFound is returned when no available endpoints match the provided EndpointOpts. This is also generally returned by provider service factory methods, and usually indicates that a region was specified incorrectly.

func (ErrEndpointNotFound) Error

func (e ErrEndpointNotFound) Error() string

type ErrErrorAfterReauthentication

type ErrErrorAfterReauthentication struct {
	BaseError
	ErrOriginal error
}

ErrErrorAfterReauthentication is the error type returned when reauthentication succeeds, but an error occurs afterword (usually an HTTP error).

func (ErrErrorAfterReauthentication) Error

type ErrInvalidInput

type ErrInvalidInput struct {
	ErrMissingInput
	Value any
}

ErrInvalidInput is an error type used for most non-HTTP Gophercloud errors.

func (ErrInvalidInput) Error

func (e ErrInvalidInput) Error() string

type ErrMissingAnyoneOfEnvironmentVariables

type ErrMissingAnyoneOfEnvironmentVariables struct {
	BaseError
	EnvironmentVariables []string
}

ErrMissingAnyoneOfEnvironmentVariables is the error when anyone of the environment variables is required in a particular situation but not provided by the user

func (ErrMissingAnyoneOfEnvironmentVariables) Error

type ErrMissingEnvironmentVariable

type ErrMissingEnvironmentVariable struct {
	BaseError
	EnvironmentVariable string
}

ErrMissingEnvironmentVariable is the error when environment variable is required in a particular situation but not provided by the user

func (ErrMissingEnvironmentVariable) Error

type ErrMissingInput

type ErrMissingInput struct {
	BaseError
	Argument string
}

ErrMissingInput is the error when input is required in a particular situation but not provided by the user

func (ErrMissingInput) Error

func (e ErrMissingInput) Error() string

type ErrMissingPassword

type ErrMissingPassword struct{ BaseError }

ErrMissingPassword indicates that no password was provided and no token is available.

func (ErrMissingPassword) Error

func (e ErrMissingPassword) Error() string

type ErrMultipleResourcesFound

type ErrMultipleResourcesFound struct {
	BaseError
	Name         string
	Count        int
	ResourceType string
}

ErrMultipleResourcesFound is the error when trying to retrieve a resource's ID by name and multiple resources have the user-provided name.

func (ErrMultipleResourcesFound) Error

type ErrResourceNotFound

type ErrResourceNotFound struct {
	BaseError
	Name         string
	ResourceType string
}

ErrResourceNotFound is the error when trying to retrieve a resource's ID by name and the resource doesn't exist.

func (ErrResourceNotFound) Error

func (e ErrResourceNotFound) Error() string

type ErrResult

type ErrResult struct {
	Result
}

ErrResult is an internal type to be used by individual resource packages, but its methods will be available on a wide variety of user-facing embedding types.

It represents results that only contain a potential error and nothing else. Usually, if the operation executed successfully, the Err field will be nil; otherwise it will be stocked with a relevant error. Use the ExtractErr method to cleanly pull it out.

func (ErrResult) ExtractErr

func (r ErrResult) ExtractErr() error

ExtractErr is a function that extracts error information, or nil, from a result.

type ErrScopeDomainIDOrDomainName

type ErrScopeDomainIDOrDomainName struct{ BaseError }

ErrScopeDomainIDOrDomainName indicates that a domain ID or Name was required in a Scope, but not present.

func (ErrScopeDomainIDOrDomainName) Error

type ErrScopeEmpty

type ErrScopeEmpty struct{ BaseError }

ErrScopeEmpty indicates that no credentials were provided in a Scope.

func (ErrScopeEmpty) Error

func (e ErrScopeEmpty) Error() string

type ErrScopeProjectIDAlone

type ErrScopeProjectIDAlone struct{ BaseError }

ErrScopeProjectIDAlone indicates that a ProjectID was provided with other constraints in a Scope.

func (ErrScopeProjectIDAlone) Error

func (e ErrScopeProjectIDAlone) Error() string

type ErrScopeProjectIDOrProjectName

type ErrScopeProjectIDOrProjectName struct{ BaseError }

ErrScopeProjectIDOrProjectName indicates that both a ProjectID and a ProjectName were provided in a Scope.

func (ErrScopeProjectIDOrProjectName) Error

type ErrServiceNotFound

type ErrServiceNotFound struct {
	BaseError
}

ErrServiceNotFound is returned when no service in a service catalog matches the provided EndpointOpts. This is generally returned by provider service factory methods like "NewComputeV2()" and can mean that a service is not enabled for your account.

func (ErrServiceNotFound) Error

func (e ErrServiceNotFound) Error() string

type ErrTenantIDProvided

type ErrTenantIDProvided struct{ BaseError }

ErrTenantIDProvided indicates that a TenantID was provided but can't be used.

func (ErrTenantIDProvided) Error

func (e ErrTenantIDProvided) Error() string

type ErrTenantNameProvided

type ErrTenantNameProvided struct{ BaseError }

ErrTenantNameProvided indicates that a TenantName was provided but can't be used.

func (ErrTenantNameProvided) Error

func (e ErrTenantNameProvided) Error() string

type ErrTimeOut

type ErrTimeOut struct {
	BaseError
}

ErrTimeOut is the error type returned when an operations times out.

func (ErrTimeOut) Error

func (e ErrTimeOut) Error() string

type ErrUnableToReauthenticate

type ErrUnableToReauthenticate struct {
	BaseError
	ErrOriginal error
	ErrReauth   error
}

ErrUnableToReauthenticate is the error type returned when reauthentication fails.

func (ErrUnableToReauthenticate) Error

type ErrUnexpectedResponseCode

type ErrUnexpectedResponseCode struct {
	BaseError
	URL            string
	Method         string
	Expected       []int
	Actual         int
	Body           []byte
	ResponseHeader http.Header
}

ErrUnexpectedResponseCode is returned by the Request method when a response code other than those listed in OkCodes is encountered.

func (ErrUnexpectedResponseCode) Error

func (ErrUnexpectedResponseCode) GetStatusCode

func (e ErrUnexpectedResponseCode) GetStatusCode() int

GetStatusCode returns the actual status code of the error.

type ErrUnexpectedType

type ErrUnexpectedType struct {
	BaseError
	Expected string
	Actual   string
}

ErrUnexpectedType is the error when an unexpected type is encountered

func (ErrUnexpectedType) Error

func (e ErrUnexpectedType) Error() string

type ErrUserIDWithToken

type ErrUserIDWithToken struct{ BaseError }

ErrUserIDWithToken indicates that a UserID was provided, but token authentication is being used instead.

func (ErrUserIDWithToken) Error

func (e ErrUserIDWithToken) Error() string

type ErrUsernameOrUserID

type ErrUsernameOrUserID struct{ BaseError }

ErrUsernameOrUserID indicates that neither username nor userID are specified, or both are at once.

func (ErrUsernameOrUserID) Error

func (e ErrUsernameOrUserID) Error() string

type ErrUsernameWithToken

type ErrUsernameWithToken struct{ BaseError }

ErrUsernameWithToken indicates that a Username was provided, but token authentication is being used instead.

func (ErrUsernameWithToken) Error

func (e ErrUsernameWithToken) Error() string

type HeaderResult

type HeaderResult struct {
	Result
}

HeaderResult is an internal type to be used by individual resource packages, but its methods will be available on a wide variety of user-facing embedding types.

It represents a result that only contains an error (possibly nil) and an http.Header. This is used, for example, by the objectstorage packages in openstack, because most of the operations don't return response bodies, but do have relevant information in headers.

func (HeaderResult) ExtractInto

func (r HeaderResult) ExtractInto(to any) error

ExtractInto allows users to provide an object into which `Extract` will extract the http.Header headers of the result.

type IPVersion

type IPVersion int

IPVersion is a type for the possible IP address versions. Valid instances are IPv4 and IPv6

const (
	// IPv4 is used for IP version 4 addresses
	IPv4 IPVersion = 4
	// IPv6 is used for IP version 6 addresses
	IPv6 IPVersion = 6
)

type JSONRFC1123

type JSONRFC1123 time.Time

func (*JSONRFC1123) UnmarshalJSON

func (jt *JSONRFC1123) UnmarshalJSON(data []byte) error

type JSONRFC3339Milli

type JSONRFC3339Milli time.Time

func (*JSONRFC3339Milli) UnmarshalJSON

func (jt *JSONRFC3339Milli) UnmarshalJSON(data []byte) error

type JSONRFC3339MilliNoZ

type JSONRFC3339MilliNoZ time.Time

func (*JSONRFC3339MilliNoZ) UnmarshalJSON

func (jt *JSONRFC3339MilliNoZ) UnmarshalJSON(data []byte) error

type JSONRFC3339NoZ

type JSONRFC3339NoZ time.Time

func (*JSONRFC3339NoZ) UnmarshalJSON

func (jt *JSONRFC3339NoZ) UnmarshalJSON(data []byte) error

type JSONRFC3339ZNoT

type JSONRFC3339ZNoT time.Time

func (*JSONRFC3339ZNoT) UnmarshalJSON

func (jt *JSONRFC3339ZNoT) UnmarshalJSON(data []byte) error

type JSONRFC3339ZNoTNoZ

type JSONRFC3339ZNoTNoZ time.Time

func (*JSONRFC3339ZNoTNoZ) UnmarshalJSON

func (jt *JSONRFC3339ZNoTNoZ) UnmarshalJSON(data []byte) error

type JSONUnix

type JSONUnix time.Time

func (*JSONUnix) UnmarshalJSON

func (jt *JSONUnix) UnmarshalJSON(data []byte) error
type Link struct {
	Href string `json:"href"`
	Rel  string `json:"rel"`
}

Link is an internal type to be used in packages of collection resources that are paginated in a certain way.

It's a response substructure common to many paginated collection results that is used to point to related pages. Usually, the one we care about is the one with Rel field set to "next".

type ProviderClient

type ProviderClient struct {
	// IdentityBase is the base URL used for a particular provider's identity
	// service - it will be used when issuing authenticatation requests. It
	// should point to the root resource of the identity service, not a specific
	// identity version.
	IdentityBase string

	// IdentityEndpoint is the identity endpoint. This may be a specific version
	// of the identity service. If this is the case, this endpoint is used rather
	// than querying versions first.
	IdentityEndpoint string

	// TokenID is the ID of the most recently issued valid token.
	// NOTE: Aside from within a custom ReauthFunc, this field shouldn't be set by an application.
	// To safely read or write this value, call `Token` or `SetToken`, respectively
	TokenID string

	// EndpointLocator describes how this provider discovers the endpoints for
	// its constituent services.
	EndpointLocator EndpointLocator

	// HTTPClient allows users to interject arbitrary http, https, or other transit behaviors.
	HTTPClient http.Client

	// UserAgent represents the User-Agent header in the HTTP request.
	UserAgent UserAgent

	// ReauthFunc is the function used to re-authenticate the user if the request
	// fails with a 401 HTTP response code. This a needed because there may be multiple
	// authentication functions for different Identity service versions.
	ReauthFunc func(context.Context) error

	// Throwaway determines whether if this client is a throw-away client. It's a copy of user's provider client
	// with the token and reauth func zeroed. Such client can be used to perform reauthorization.
	Throwaway bool

	// Retry backoff func is called when rate limited.
	RetryBackoffFunc RetryBackoffFunc

	// MaxBackoffRetries set the maximum number of backoffs. When not set, defaults to DefaultMaxBackoffRetries
	MaxBackoffRetries uint

	// A general failed request handler method - this is always called in the end if a request failed. Leave as nil
	// to abort when an error is encountered.
	RetryFunc RetryFunc
	// contains filtered or unexported fields
}

ProviderClient stores details that are required to interact with any services within a specific provider's API.

Generally, you acquire a ProviderClient by calling the NewClient method in the appropriate provider's child package, providing whatever authentication credentials are required.

func (*ProviderClient) AuthenticatedHeaders

func (client *ProviderClient) AuthenticatedHeaders() (m map[string]string)

AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service requests. Blocks if Reauthenticate is in progress.

func (*ProviderClient) CopyTokenFrom

func (client *ProviderClient) CopyTokenFrom(other *ProviderClient)

CopyTokenFrom safely copies the token from another ProviderClient into the this one.

func (*ProviderClient) GetAuthResult

func (client *ProviderClient) GetAuthResult() AuthResult

GetAuthResult returns the result from the request that was used to obtain a provider client's Keystone token.

The result is nil when authentication has not yet taken place, when the token was set manually with SetToken(), or when a ReauthFunc was used that does not record the AuthResult.

func (*ProviderClient) IsThrowaway

func (client *ProviderClient) IsThrowaway() bool

IsThrowaway safely reads the value of the client Throwaway field.

func (*ProviderClient) Reauthenticate

func (client *ProviderClient) Reauthenticate(ctx context.Context, previousToken string) error

Reauthenticate calls client.ReauthFunc in a thread-safe way. If this is called because of a 401 response, the caller may pass the previous token. In this case, the reauthentication can be skipped if another thread has already reauthenticated in the meantime. If no previous token is known, an empty string should be passed instead to force unconditional reauthentication.

func (*ProviderClient) Request

func (client *ProviderClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error)

Request performs an HTTP request using the ProviderClient's current HTTPClient. An authentication header will automatically be provided.

func (*ProviderClient) SetThrowaway

func (client *ProviderClient) SetThrowaway(v bool)

SetThrowaway safely sets the value of the client Throwaway field.

func (*ProviderClient) SetToken

func (client *ProviderClient) SetToken(t string)

SetToken safely sets the value of the auth token in the ProviderClient. Applications may use this method in a custom ReauthFunc.

WARNING: This function is deprecated. Use SetTokenAndAuthResult() instead.

func (*ProviderClient) SetTokenAndAuthResult

func (client *ProviderClient) SetTokenAndAuthResult(r AuthResult) error

SetTokenAndAuthResult safely sets the value of the auth token in the ProviderClient and also records the AuthResult that was returned from the token creation request. Applications may call this in a custom ReauthFunc.

func (*ProviderClient) Token

func (client *ProviderClient) Token() string

Token safely reads the value of the auth token from the ProviderClient. Applications should call this method to access the token instead of the TokenID field

func (*ProviderClient) UseTokenLock

func (client *ProviderClient) UseTokenLock()

UseTokenLock creates a mutex that is used to allow safe concurrent access to the auth token. If the application's ProviderClient is not used concurrently, this doesn't need to be called.

type RequestOpts

type RequestOpts struct {
	// JSONBody, if provided, will be encoded as JSON and used as the body of the HTTP request. The
	// content type of the request will default to "application/json" unless overridden by MoreHeaders.
	// It's an error to specify both a JSONBody and a RawBody.
	JSONBody any
	// RawBody contains an io.Reader that will be consumed by the request directly. No content-type
	// will be set unless one is provided explicitly by MoreHeaders.
	RawBody io.Reader
	// JSONResponse, if provided, will be populated with the contents of the response body parsed as
	// JSON.
	JSONResponse any
	// OkCodes contains a list of numeric HTTP status codes that should be interpreted as success. If
	// the response has a different code, an error will be returned.
	OkCodes []int
	// MoreHeaders specifies additional HTTP headers to be provided on the request.
	// MoreHeaders will be overridden by OmitHeaders
	MoreHeaders map[string]string
	// OmitHeaders specifies the HTTP headers which should be omitted.
	// OmitHeaders will override MoreHeaders
	OmitHeaders []string
	// KeepResponseBody specifies whether to keep the HTTP response body. Usually used, when the HTTP
	// response body is considered for further use. Valid when JSONResponse is nil.
	KeepResponseBody bool
}

RequestOpts customizes the behavior of the provider.Request() method.

type Result

type Result struct {
	// Body is the payload of the HTTP response from the server. In most cases,
	// this will be the deserialized JSON structure.
	Body any

	// StatusCode is the HTTP status code of the original response. Will be
	// one of the OkCodes defined on the gophercloud.RequestOpts that was
	// used in the request.
	StatusCode int

	// Header contains the HTTP header structure from the original response.
	Header http.Header

	// Err is an error that occurred during the operation. It's deferred until
	// extraction to make it easier to chain the Extract call.
	Err error
}

Result is an internal type to be used by individual resource packages, but its methods will be available on a wide variety of user-facing embedding types.

It acts as a base struct that other Result types, returned from request functions, can embed for convenience. All Results capture basic information from the HTTP transaction that was performed, including the response body, HTTP headers, and any errors that happened.

Generally, each Result type will have an Extract method that can be used to further interpret the result's payload in a specific context. Extensions or providers can then provide additional extraction functions to pull out provider- or extension-specific information as well.

func (Result) ExtractInto

func (r Result) ExtractInto(to any) error

ExtractInto allows users to provide an object into which `Extract` will extract the `Result.Body`. This would be useful for OpenStack providers that have different fields in the response object than OpenStack proper.

func (Result) ExtractIntoSlicePtr

func (r Result) ExtractIntoSlicePtr(to any, label string) error

ExtractIntoSlicePtr will unmarshal the Result (r) into the provided any (to).

NOTE: For internal use only

`to` must be a pointer to an underlying slice type

If provided, `label` will be filtered out of the response body prior to `r` being unmarshalled into `to`.

func (Result) ExtractIntoStructPtr

func (r Result) ExtractIntoStructPtr(to any, label string) error

ExtractIntoStructPtr will unmarshal the Result (r) into the provided any (to).

NOTE: For internal use only

`to` must be a pointer to an underlying struct type

If provided, `label` will be filtered out of the response body prior to `r` being unmarshalled into `to`.

func (Result) PrettyPrintJSON

func (r Result) PrettyPrintJSON() string

PrettyPrintJSON creates a string containing the full response body as pretty-printed JSON. It's useful for capturing test fixtures and for debugging extraction bugs. If you include its output in an issue related to a buggy extraction function, we will all love you forever.

type RetryFunc

type RetryFunc func(context context.Context, method, url string, options *RequestOpts, err error, failCount uint) error

RetryFunc is a catch-all function for retrying failed API requests. If it returns nil, the request will be retried. If it returns an error, the request method will exit with that error. failCount is the number of times the request has failed (starting at 1).

type ServiceClient

type ServiceClient struct {
	// ProviderClient is a reference to the provider that implements this service.
	*ProviderClient

	// Endpoint is the base URL of the service's API, acquired from a service catalog.
	// It MUST end with a /.
	Endpoint string

	// ResourceBase is the base URL shared by the resources within a service's API. It should include
	// the API version and, like Endpoint, MUST end with a / if set. If not set, the Endpoint is used
	// as-is, instead.
	ResourceBase string

	// This is the service client type (e.g. compute, sharev2).
	// NOTE: FOR INTERNAL USE ONLY. DO NOT SET. GOPHERCLOUD WILL SET THIS.
	// It is only exported because it gets set in a different package.
	Type string

	// The microversion of the service to use. Set this to use a particular microversion.
	Microversion string

	// MoreHeaders allows users (or Gophercloud) to set service-wide headers on requests. Put another way,
	// values set in this field will be set on all the HTTP requests the service client sends.
	MoreHeaders map[string]string
}

ServiceClient stores details required to interact with a specific service API implemented by a provider. Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.

func (*ServiceClient) Delete

func (client *ServiceClient) Delete(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error)

Delete calls `Request` with the "DELETE" HTTP verb.

func (*ServiceClient) Get

func (client *ServiceClient) Get(ctx context.Context, url string, JSONResponse any, opts *RequestOpts) (*http.Response, error)

Get calls `Request` with the "GET" HTTP verb.

func (*ServiceClient) Head

func (client *ServiceClient) Head(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error)

Head calls `Request` with the "HEAD" HTTP verb.

func (*ServiceClient) Patch

func (client *ServiceClient) Patch(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error)

Patch calls `Request` with the "PATCH" HTTP verb.

func (*ServiceClient) Post

func (client *ServiceClient) Post(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error)

Post calls `Request` with the "POST" HTTP verb.

func (*ServiceClient) Put

func (client *ServiceClient) Put(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error)

Put calls `Request` with the "PUT" HTTP verb.

func (*ServiceClient) Request

func (client *ServiceClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error)

Request carries out the HTTP operation for the service client

func (*ServiceClient) ResourceBaseURL

func (client *ServiceClient) ResourceBaseURL() string

ResourceBaseURL returns the base URL of any resources used by this service. It MUST end with a /.

func (*ServiceClient) ServiceURL

func (client *ServiceClient) ServiceURL(parts ...string) string

ServiceURL constructs a URL for a resource belonging to this provider.

type UserAgent

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

UserAgent represents a User-Agent header.

func (*UserAgent) Join

func (ua *UserAgent) Join() string

Join concatenates all the user-defined User-Agend strings with the default Gophercloud User-Agent string.

func (*UserAgent) Prepend

func (ua *UserAgent) Prepend(s ...string)

Prepend prepends a user-defined string to the default User-Agent string. Users may pass in one or more strings to prepend.

Directories

Path Synopsis
internal
acceptance/clients
Package clients contains functions for creating OpenStack service clients for use in acceptance tests.
Package clients contains functions for creating OpenStack service clients for use in acceptance tests.
acceptance/openstack
Package openstack contains common functions that can be used across all OpenStack components for acceptance testing.
Package openstack contains common functions that can be used across all OpenStack components for acceptance testing.
acceptance/openstack/blockstorage/noauth
Package noauth contains common functions for creating block storage based resources for use in acceptance tests.
Package noauth contains common functions for creating block storage based resources for use in acceptance tests.
acceptance/openstack/blockstorage/v2
Package v2 contains common functions for creating block storage based resources for use in acceptance tests.
Package v2 contains common functions for creating block storage based resources for use in acceptance tests.
acceptance/openstack/blockstorage/v3
Package v3 contains common functions for creating block storage based resources for use in acceptance tests.
Package v3 contains common functions for creating block storage based resources for use in acceptance tests.
acceptance/openstack/compute/v2
Package v2 contains common functions for creating compute-based resources for use in acceptance tests.
Package v2 contains common functions for creating compute-based resources for use in acceptance tests.
acceptance/openstack/db/v1
Package v2 contains common functions for creating db resources for use in acceptance tests.
Package v2 contains common functions for creating db resources for use in acceptance tests.
acceptance/openstack/identity/v2
Package v2 contains common functions for creating identity-based resources for use in acceptance tests.
Package v2 contains common functions for creating identity-based resources for use in acceptance tests.
acceptance/openstack/image/v2
Package v2 contains common functions for creating image resources for use in acceptance tests.
Package v2 contains common functions for creating image resources for use in acceptance tests.
agents acceptance tests
BGP Peer acceptance tests
BGP Peer acceptance tests
BGP VPN acceptance tests
Package openstack contains resources for the individual OpenStack projects supported in Gophercloud.
Package openstack contains resources for the individual OpenStack projects supported in Gophercloud.
baremetal/apiversions
Package apiversions provides information about the versions supported by a specific Ironic API.
Package apiversions provides information about the versions supported by a specific Ironic API.
baremetal/httpbasic
Package httpbasic provides support for http_basic bare metal endpoints.
Package httpbasic provides support for http_basic bare metal endpoints.
baremetal/noauth
Package noauth provides support for noauth bare metal endpoints.
Package noauth provides support for noauth bare metal endpoints.
baremetal/v1/conductors
Package conductors provides information and interaction with the conductors API resource in the OpenStack Bare Metal service.
Package conductors provides information and interaction with the conductors API resource in the OpenStack Bare Metal service.
baremetal/v1/conductors/testing
conductors unit tests
conductors unit tests
baremetal/v1/drivers
Package drivers contains the functionality for Listing drivers, driver details, driver properties and driver logical disk properties
Package drivers contains the functionality for Listing drivers, driver details, driver properties and driver logical disk properties
baremetal/v1/drivers/testing
Package testing contains drivers unit tests
Package testing contains drivers unit tests
baremetal/v1/nodes
Package nodes provides information and interaction with the nodes API resource in the OpenStack Bare Metal service.
Package nodes provides information and interaction with the nodes API resource in the OpenStack Bare Metal service.
baremetal/v1/nodes/testing
nodes unit tests
nodes unit tests
baremetal/v1/ports/testing
ports unit tests
ports unit tests
baremetalintrospection/httpbasic
Package httpbasic provides support for http_basic bare metal introspection endpoints.
Package httpbasic provides support for http_basic bare metal introspection endpoints.
baremetalintrospection/noauth
Package noauth provides support for noauth bare metal introspection endpoints.
Package noauth provides support for noauth bare metal introspection endpoints.
baremetalintrospection/v1/introspection
Package introspection contains the functionality for Starting introspection, Get introspection status, List all introspection statuses, Abort an introspection, Get stored introspection data and reapply introspection on stored data.
Package introspection contains the functionality for Starting introspection, Get introspection status, List all introspection statuses, Abort an introspection, Get stored introspection data and reapply introspection on stored data.
blockstorage/apiversions
Package apiversions provides information and interaction with the different API versions for the OpenStack Block Storage service, code-named Cinder.
Package apiversions provides information and interaction with the different API versions for the OpenStack Block Storage service, code-named Cinder.
apiversions_v1
blockstorage/noauth
Package noauth creates a "noauth" *gophercloud.ServiceClient for use in Cinder environments configured with the noauth authentication middleware.
Package noauth creates a "noauth" *gophercloud.ServiceClient for use in Cinder environments configured with the noauth authentication middleware.
blockstorage/noauth/testing
noauth unit tests
noauth unit tests
blockstorage/v2/availabilityzones
Package availabilityzones provides the ability to get lists of available volume availability zones.
Package availabilityzones provides the ability to get lists of available volume availability zones.
blockstorage/v2/availabilityzones/testing
availabilityzones unittests
availabilityzones unittests
blockstorage/v2/backups
Package backups provides information and interaction with backups in the OpenStack Block Storage service.
Package backups provides information and interaction with backups in the OpenStack Block Storage service.
blockstorage/v2/limits
Package limits shows rate and limit information for a project you authorized for.
Package limits shows rate and limit information for a project you authorized for.
blockstorage/v2/quotasets
Package quotasets enables retrieving and managing Block Storage quotas.
Package quotasets enables retrieving and managing Block Storage quotas.
blockstorage/v2/quotasets/testing
quotasets unit tests
quotasets unit tests
blockstorage/v2/schedulerstats
Package schedulerstats returns information about block storage pool capacity and utilisation.
Package schedulerstats returns information about block storage pool capacity and utilisation.
blockstorage/v2/snapshots
Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service.
Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service.
snapshots_v2
blockstorage/v2/transfers
Package transfers provides an interaction with volume transfers in the OpenStack Block Storage service.
Package transfers provides an interaction with volume transfers in the OpenStack Block Storage service.
blockstorage/v2/volumes
Package volumes provides information and interaction with volumes in the OpenStack Block Storage service.
Package volumes provides information and interaction with volumes in the OpenStack Block Storage service.
blockstorage/v2/volumes/testing
volumes unit tests
volumes unit tests
blockstorage/v3/attachments
Package attachments provides access to OpenStack Block Storage Attachment API's.
Package attachments provides access to OpenStack Block Storage Attachment API's.
blockstorage/v3/availabilityzones
Package availabilityzones provides the ability to get lists of available volume availability zones.
Package availabilityzones provides the ability to get lists of available volume availability zones.
blockstorage/v3/availabilityzones/testing
availabilityzones unittests
availabilityzones unittests
blockstorage/v3/backups
Package backups provides information and interaction with backups in the OpenStack Block Storage service.
Package backups provides information and interaction with backups in the OpenStack Block Storage service.
blockstorage/v3/limits
Package limits shows rate and limit information for a project you authorized for.
Package limits shows rate and limit information for a project you authorized for.
blockstorage/v3/qos
Package qos provides information and interaction with the QoS specifications for the Openstack Blockstorage service.
Package qos provides information and interaction with the QoS specifications for the Openstack Blockstorage service.
blockstorage/v3/qos/testing
Package testing for qos_v3
Package testing for qos_v3
blockstorage/v3/quotasets
Package quotasets enables retrieving and managing Block Storage quotas.
Package quotasets enables retrieving and managing Block Storage quotas.
blockstorage/v3/quotasets/testing
quotasets unit tests
quotasets unit tests
blockstorage/v3/schedulerstats
Package schedulerstats returns information about block storage pool capacity and utilisation.
Package schedulerstats returns information about block storage pool capacity and utilisation.
blockstorage/v3/snapshots
Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service.
Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service.
blockstorage/v3/snapshots/testing
Package testing for snapshots_v3
Package testing for snapshots_v3
blockstorage/v3/transfers
Package transfers provides an interaction with volume transfers in the OpenStack Block Storage service.
Package transfers provides an interaction with volume transfers in the OpenStack Block Storage service.
blockstorage/v3/volumes
Package volumes provides information and interaction with volumes in the OpenStack Block Storage service.
Package volumes provides information and interaction with volumes in the OpenStack Block Storage service.
blockstorage/v3/volumes/testing
volumes unit tests
volumes unit tests
blockstorage/v3/volumetypes
Package volumetypes provides information and interaction with volume types in the OpenStack Block Storage service.
Package volumetypes provides information and interaction with volume types in the OpenStack Block Storage service.
volume_types
common/extensions
Package extensions provides information and interaction with the different extensions available for an OpenStack service.
Package extensions provides information and interaction with the different extensions available for an OpenStack service.
common/extensions/testing
common extensions unit tests
common extensions unit tests
compute/apiversions
Package apiversions provides information and interaction with the different API versions for the Compute service, code-named Nova.
Package apiversions provides information and interaction with the different API versions for the Compute service, code-named Nova.
compute/v2/aggregates
Package aggregates manages information about the host aggregates in the OpenStack cloud.
Package aggregates manages information about the host aggregates in the OpenStack cloud.
compute/v2/attachinterfaces
Package attachinterfaces provides the ability to retrieve and manage network interfaces through Nova.
Package attachinterfaces provides the ability to retrieve and manage network interfaces through Nova.
compute/v2/attachinterfaces/testing
attachinterfaces unit tests
attachinterfaces unit tests
compute/v2/availabilityzones
Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information.
Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information.
compute/v2/availabilityzones/testing
availabilityzones unittests
availabilityzones unittests
compute/v2/diagnostics
Package diagnostics returns details about a nova instance diagnostics
Package diagnostics returns details about a nova instance diagnostics
compute/v2/extensions
Package extensions provides information and interaction with the different extensions available for the OpenStack Compute service.
Package extensions provides information and interaction with the different extensions available for the OpenStack Compute service.
compute/v2/extensions/testing
extensions unit tests
extensions unit tests
compute/v2/flavors
Package flavors provides information and interaction with the flavor API in the OpenStack Compute service.
Package flavors provides information and interaction with the flavor API in the OpenStack Compute service.
compute/v2/flavors/testing
flavors unit tests
flavors unit tests
compute/v2/hypervisors
Package hypervisors returns details about list of hypervisors, shows details for a hypervisor and shows summary statistics for all hypervisors over all compute nodes in the OpenStack cloud.
Package hypervisors returns details about list of hypervisors, shows details for a hypervisor and shows summary statistics for all hypervisors over all compute nodes in the OpenStack cloud.
compute/v2/instanceactions/testing
instanceactions unit tests
instanceactions unit tests
compute/v2/keypairs
Package keypairs provides the ability to manage key pairs as well as create servers with a specified key pair.
Package keypairs provides the ability to manage key pairs as well as create servers with a specified key pair.
compute/v2/keypairs/testing
keypairs unit tests
keypairs unit tests
compute/v2/limits
Package limits shows rate and limit information for a tenant/project.
Package limits shows rate and limit information for a tenant/project.
compute/v2/quotasets
Package quotasets enables retrieving and managing Compute quotas.
Package quotasets enables retrieving and managing Compute quotas.
compute/v2/quotasets/testing
quotasets unit tests
quotasets unit tests
compute/v2/remoteconsoles
Package remoteconsoles provides the ability to create server remote consoles through the Compute API.
Package remoteconsoles provides the ability to create server remote consoles through the Compute API.
compute/v2/secgroups
Package secgroups provides the ability to manage security groups through the Nova API.
Package secgroups provides the ability to manage security groups through the Nova API.
compute/v2/secgroups/testing
secgroups unit tests
secgroups unit tests
compute/v2/servergroups
Package servergroups provides the ability to manage server groups.
Package servergroups provides the ability to manage server groups.
compute/v2/servergroups/testing
servergroups unit tests
servergroups unit tests
compute/v2/servers
Package servers provides information and interaction with the server API resource in the OpenStack Compute service.
Package servers provides information and interaction with the server API resource in the OpenStack Compute service.
compute/v2/servers/testing
servers unit tests
servers unit tests
compute/v2/tags
Package tags manages Tags on Compute V2 servers.
Package tags manages Tags on Compute V2 servers.
compute/v2/tags/testing
tags unit tests
tags unit tests
compute/v2/usage
Package usage provides information and interaction with the SimpleTenantUsage extension for the OpenStack Compute service.
Package usage provides information and interaction with the SimpleTenantUsage extension for the OpenStack Compute service.
compute/v2/usage/testing
simple tenant usage unit tests
simple tenant usage unit tests
compute/v2/volumeattach
Package volumeattach provides the ability to attach and detach volumes from servers.
Package volumeattach provides the ability to attach and detach volumes from servers.
compute/v2/volumeattach/testing
volumeattach unit tests
volumeattach unit tests
config/clouds
package clouds provides a parser for OpenStack credentials stored in a clouds.yaml file.
package clouds provides a parser for OpenStack credentials stored in a clouds.yaml file.
container/v1/capsules
Package capsules contains functionality for working with Zun capsule resources.
Package capsules contains functionality for working with Zun capsule resources.
containerinfra/apiversions
Package apiversions provides information and interaction with the different API versions for the Container Infra service, code-named Magnum.
Package apiversions provides information and interaction with the different API versions for the Container Infra service, code-named Magnum.
apiversions_v1
containerinfra/v1/certificates
Package certificates contains functionality for working with Magnum Certificate resources.
Package certificates contains functionality for working with Magnum Certificate resources.
containerinfra/v1/clusters
Package clusters contains functionality for working with Magnum Cluster resources.
Package clusters contains functionality for working with Magnum Cluster resources.
containerinfra/v1/clustertemplates
Package clustertemplates contains functionality for working with Magnum Cluster Templates resources.
Package clustertemplates contains functionality for working with Magnum Cluster Templates resources.
containerinfra/v1/nodegroups
Package nodegroups provides methods for interacting with the Magnum node group API.
Package nodegroups provides methods for interacting with the Magnum node group API.
containerinfra/v1/quotas
Package quotas contains functionality for working with Magnum Quota API.
Package quotas contains functionality for working with Magnum Quota API.
db/v1/configurations
Package configurations provides information and interaction with the configuration API resource in the Rackspace Database service.
Package configurations provides information and interaction with the configuration API resource in the Rackspace Database service.
db/v1/configurations/testing
db_configurations_v1
db_configurations_v1
db/v1/databases
Package flavors provides information and interaction with the database API resource in the OpenStack Database service.
Package flavors provides information and interaction with the database API resource in the OpenStack Database service.
db/v1/databases/testing
db_databases_v1
db_databases_v1
db/v1/datastores
Package datastores provides information and interaction with the datastore API resource in the Rackspace Database service.
Package datastores provides information and interaction with the datastore API resource in the Rackspace Database service.
db/v1/datastores/testing
db_datastores_v1
db_datastores_v1
db/v1/flavors
Package flavors provides information and interaction with the flavor API resource in the OpenStack Database service.
Package flavors provides information and interaction with the flavor API resource in the OpenStack Database service.
db/v1/flavors/testing
db_flavors_v1
db_flavors_v1
db/v1/instances
Package instances provides information and interaction with the instance API resource in the OpenStack Database service.
Package instances provides information and interaction with the instance API resource in the OpenStack Database service.
db/v1/instances/testing
db_instances_v1
db_instances_v1
db/v1/users
Package users provides information and interaction with the user API resource in the OpenStack Database service.
Package users provides information and interaction with the user API resource in the OpenStack Database service.
db/v1/users/testing
db_users_v1
db_users_v1
dns/v2/recordsets
Package recordsets provides information and interaction with the zone API resource for the OpenStack DNS service.
Package recordsets provides information and interaction with the zone API resource for the OpenStack DNS service.
dns/v2/recordsets/testing
recordsets unit tests
recordsets unit tests
dns/v2/transfer/accept
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
dns/v2/transfer/accept/testing
transfer requests unit tests
transfer requests unit tests
dns/v2/transfer/request
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
dns/v2/transfer/request/testing
transfer requests unit tests
transfer requests unit tests
dns/v2/zones
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
Package zones provides information and interaction with the zone API resource for the OpenStack DNS service.
dns/v2/zones/testing
zones unit tests
zones unit tests
identity/v2/extensions
Package extensions provides information and interaction with the different extensions available for the OpenStack Identity service.
Package extensions provides information and interaction with the different extensions available for the OpenStack Identity service.
identity/v2/extensions/testing
extensions unit tests
extensions unit tests
identity/v2/roles
Package roles provides functionality to interact with and control roles on the API.
Package roles provides functionality to interact with and control roles on the API.
identity/v2/roles/testing
roles unit tests
roles unit tests
identity/v2/tenants
Package tenants provides information and interaction with the tenants API resource for the OpenStack Identity service.
Package tenants provides information and interaction with the tenants API resource for the OpenStack Identity service.
identity/v2/tenants/testing
tenants unit tests
tenants unit tests
identity/v2/tokens
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
identity/v2/tokens/testing
tokens unit tests
tokens unit tests
identity/v2/users
Package users provides information and interaction with the users API resource for the OpenStack Identity Service.
Package users provides information and interaction with the users API resource for the OpenStack Identity Service.
identity/v2/users/testing
users unit tests
users unit tests
identity/v3/domains
Package domains manages and retrieves Domains in the OpenStack Identity Service.
Package domains manages and retrieves Domains in the OpenStack Identity Service.
identity/v3/ec2credentials
Package ec2credentials provides information and interaction with the EC2 credentials API resource for the OpenStack Identity service.
Package ec2credentials provides information and interaction with the EC2 credentials API resource for the OpenStack Identity service.
identity/v3/ec2tokens
Package tokens provides information and interaction with the EC2 token API resource for the OpenStack Identity service.
Package tokens provides information and interaction with the EC2 token API resource for the OpenStack Identity service.
identity/v3/endpoints
Package endpoints provides information and interaction with the service endpoints API resource in the OpenStack Identity service.
Package endpoints provides information and interaction with the service endpoints API resource in the OpenStack Identity service.
identity/v3/endpoints/testing
endpoints unit tests
endpoints unit tests
identity/v3/federation
Package federation provides information and interaction with OS-FEDERATION API for the Openstack Identity service.
Package federation provides information and interaction with OS-FEDERATION API for the Openstack Identity service.
identity/v3/groups
Package groups manages and retrieves Groups in the OpenStack Identity Service.
Package groups manages and retrieves Groups in the OpenStack Identity Service.
identity/v3/limits
Package limits provides information and interaction with limits for the Openstack Identity service.
Package limits provides information and interaction with limits for the Openstack Identity service.
identity/v3/oauth1
Package oauth1 enables management of OpenStack OAuth1 tokens and Authentication.
Package oauth1 enables management of OpenStack OAuth1 tokens and Authentication.
identity/v3/osinherit
Package osinherit enables projects to inherit role assignments from either their owning domain or projects that are higher in the hierarchy.
Package osinherit enables projects to inherit role assignments from either their owning domain or projects that are higher in the hierarchy.
identity/v3/osinherit/testing
osinherit unit tests
osinherit unit tests
identity/v3/policies
Package policies provides information and interaction with the policies API resource for the OpenStack Identity service.
Package policies provides information and interaction with the policies API resource for the OpenStack Identity service.
identity/v3/policies/testing
Package testing contains policies unit tests
Package testing contains policies unit tests
identity/v3/projectendpoints
Package endpoints provides information and interaction with the service OS-EP-FILTER/endpoints API resource in the OpenStack Identity service.
Package endpoints provides information and interaction with the service OS-EP-FILTER/endpoints API resource in the OpenStack Identity service.
identity/v3/projectendpoints/testing
projectendpoints unit tests
projectendpoints unit tests
identity/v3/projects
Package projects manages and retrieves Projects in the OpenStack Identity Service.
Package projects manages and retrieves Projects in the OpenStack Identity Service.
identity/v3/regions
Package regions manages and retrieves Regions in the OpenStack Identity Service.
Package regions manages and retrieves Regions in the OpenStack Identity Service.
identity/v3/registeredlimits
Package registeredlimits provides information and interaction with registered limits for the Openstack Identity service.
Package registeredlimits provides information and interaction with registered limits for the Openstack Identity service.
identity/v3/roles
Package roles provides information and interaction with the roles API resource for the OpenStack Identity service.
Package roles provides information and interaction with the roles API resource for the OpenStack Identity service.
identity/v3/roles/testing
roles unit tests
roles unit tests
identity/v3/services
Package services provides information and interaction with the services API resource for the OpenStack Identity service.
Package services provides information and interaction with the services API resource for the OpenStack Identity service.
identity/v3/services/testing
services unit tests
services unit tests
identity/v3/tokens
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
identity/v3/tokens/testing
tokens unit tests
tokens unit tests
identity/v3/trusts
Package trusts enables management of OpenStack Identity Trusts.
Package trusts enables management of OpenStack Identity Trusts.
identity/v3/trusts/testing
trusts unit tests
trusts unit tests
identity/v3/users
Package users manages and retrieves Users in the OpenStack Identity Service.
Package users manages and retrieves Users in the OpenStack Identity Service.
image/v2/imagedata
Package imagedata enables management of image data.
Package imagedata enables management of image data.
image/v2/imagedata/testing
imagedata unit tests
imagedata unit tests
image/v2/imageimport
Package imageimport enables management of images import and retrieval of the Image service Import API information.
Package imageimport enables management of images import and retrieval of the Image service Import API information.
image/v2/images
Package images enables management and retrieval of images from the OpenStack Image Service.
Package images enables management and retrieval of images from the OpenStack Image Service.
image/v2/images/testing
images unit tests
images unit tests
image/v2/members
Package members enables management and retrieval of image members.
Package members enables management and retrieval of image members.
image/v2/members/testing
members unit tests
members unit tests
image/v2/tasks
Package tasks enables management and retrieval of tasks from the OpenStack Image service.
Package tasks enables management and retrieval of tasks from the OpenStack Image service.
image/v2/tasks/testing
tasks unit tests
tasks unit tests
keymanager/v1/acls
Package acls manages acls in the OpenStack Key Manager Service.
Package acls manages acls in the OpenStack Key Manager Service.
keymanager/v1/containers
Package containers manages and retrieves containers in the OpenStack Key Manager Service.
Package containers manages and retrieves containers in the OpenStack Key Manager Service.
keymanager/v1/orders
Package orders manages and retrieves orders in the OpenStack Key Manager Service.
Package orders manages and retrieves orders in the OpenStack Key Manager Service.
keymanager/v1/secrets
Package secrets manages and retrieves secrets in the OpenStack Key Manager Service.
Package secrets manages and retrieves secrets in the OpenStack Key Manager Service.
loadbalancer/v2
Package lbaas_v2 provides information and interaction with the Load Balancer as a Service v2 extension for the OpenStack Networking service.
Package lbaas_v2 provides information and interaction with the Load Balancer as a Service v2 extension for the OpenStack Networking service.
loadbalancer/v2/amphorae
Package amphorae provides information and interaction with Amphorae of OpenStack Load-balancing service.
Package amphorae provides information and interaction with Amphorae of OpenStack Load-balancing service.
loadbalancer/v2/apiversions
Package apiversions provides information and interaction with the different API versions for the OpenStack Load Balancer service.
Package apiversions provides information and interaction with the different API versions for the OpenStack Load Balancer service.
loadbalancer/v2/apiversions/testing
apiversions unit tests
apiversions unit tests
loadbalancer/v2/flavorprofiles
Package flavorprofiles provides information and interaction with FlavorProfiles for the OpenStack Load-balancing service.
Package flavorprofiles provides information and interaction with FlavorProfiles for the OpenStack Load-balancing service.
loadbalancer/v2/flavors
Package flavors provides information and interaction with Flavors for the OpenStack Load-balancing service.
Package flavors provides information and interaction with Flavors for the OpenStack Load-balancing service.
loadbalancer/v2/l7policies
Package l7policies provides information and interaction with L7Policies and Rules of the LBaaS v2 extension for the OpenStack Networking service.
Package l7policies provides information and interaction with L7Policies and Rules of the LBaaS v2 extension for the OpenStack Networking service.
loadbalancer/v2/l7policies/testing
l7policies unit tests
l7policies unit tests
loadbalancer/v2/listeners
Package listeners provides information and interaction with Listeners of the LBaaS v2 extension for the OpenStack Networking service.
Package listeners provides information and interaction with Listeners of the LBaaS v2 extension for the OpenStack Networking service.
loadbalancer/v2/listeners/testing
listeners unit tests
listeners unit tests
loadbalancer/v2/loadbalancers
Package loadbalancers provides information and interaction with Load Balancers of the LBaaS v2 extension for the OpenStack Networking service.
Package loadbalancers provides information and interaction with Load Balancers of the LBaaS v2 extension for the OpenStack Networking service.
loadbalancer/v2/loadbalancers/testing
loadbalancers unit tests
loadbalancers unit tests
loadbalancer/v2/monitors
Package monitors provides information and interaction with Monitors of the LBaaS v2 extension for the OpenStack Networking service.
Package monitors provides information and interaction with Monitors of the LBaaS v2 extension for the OpenStack Networking service.
loadbalancer/v2/monitors/testing
monitors unit tests
monitors unit tests
loadbalancer/v2/pools
Package pools provides information and interaction with Pools and Members of the LBaaS v2 extension for the OpenStack Networking service.
Package pools provides information and interaction with Pools and Members of the LBaaS v2 extension for the OpenStack Networking service.
pools unit tests
loadbalancer/v2/providers
Package providers provides information about the supported providers at OpenStack Octavia Load Balancing service.
Package providers provides information about the supported providers at OpenStack Octavia Load Balancing service.
loadbalancer/v2/providers/testing
providers unit tests
providers unit tests
loadbalancer/v2/quotas
Package quotas provides the ability to retrieve and manage Load Balancer quotas
Package quotas provides the ability to retrieve and manage Load Balancer quotas
loadbalancer/v2/quotas/testing
quotas unit tests
quotas unit tests
messaging/v2/claims
Package claims provides information and interaction with the Zaqar API claims resource for the OpenStack Messaging service.
Package claims provides information and interaction with the Zaqar API claims resource for the OpenStack Messaging service.
messaging/v2/claims/testing
Claims unit tests
Claims unit tests
messaging/v2/messages
Package messages provides information and interaction with the messages through the OpenStack Messaging(Zaqar) service.
Package messages provides information and interaction with the messages through the OpenStack Messaging(Zaqar) service.
messaging/v2/messages/testing
messages unit tests
messages unit tests
messaging/v2/queues
Package queues provides information and interaction with the queues through the OpenStack Messaging (Zaqar) service.
Package queues provides information and interaction with the queues through the OpenStack Messaging (Zaqar) service.
messaging/v2/queues/testing
queues unit tests
queues unit tests
networking/v2/apiversions
Package apiversions provides information and interaction with the different API versions for the OpenStack Neutron service.
Package apiversions provides information and interaction with the different API versions for the OpenStack Neutron service.
networking/v2/apiversions/testing
apiversions unit tests
apiversions unit tests
agents unit tests
networking/v2/extensions/attributestags
Package attributestags manages Tags on Resources created by the OpenStack Neutron Service.
Package attributestags manages Tags on Resources created by the OpenStack Neutron Service.
networking/v2/extensions/bgp/peers/testing
Package testing fro bgp peers
Package testing fro bgp peers
networking/v2/extensions/bgp/speakers/testing
Package testing for bgp speakers
Package testing for bgp speakers
networking/v2/extensions/bgpvpns/testing
Package testing for bgpvpns
Package testing for bgpvpns
networking/v2/extensions/external
Package external provides information and interaction with the external extension for the OpenStack Networking service.
Package external provides information and interaction with the external extension for the OpenStack Networking service.
external unit tests
networking/v2/extensions/extradhcpopts
Package extradhcpopts allow to work with extra DHCP functionality of Neutron ports.
Package extradhcpopts allow to work with extra DHCP functionality of Neutron ports.
networking/v2/extensions/fwaas_v2
Package fwaas provides information and interaction with the Firewall as a Service extension for the OpenStack Networking service.
Package fwaas provides information and interaction with the Firewall as a Service extension for the OpenStack Networking service.
networking/v2/extensions/fwaas_v2/groups/testing
networking_extensions_fwaas_groups_v2
networking_extensions_fwaas_groups_v2
networking/v2/extensions/fwaas_v2/policies/testing
networking_extensions_fwaas_policies_v2
networking_extensions_fwaas_policies_v2
networking/v2/extensions/fwaas_v2/rules/testing
networking_extensions_fwaas_rules_v2
networking_extensions_fwaas_rules_v2
networking/v2/extensions/layer3
Package layer3 provides access to the Layer-3 networking extension for the OpenStack Neutron service.
Package layer3 provides access to the Layer-3 networking extension for the OpenStack Neutron service.
networking/v2/extensions/layer3/addressscopes
Package addressscopes provides the ability to retrieve and manage Address scopes through the Neutron API.
Package addressscopes provides the ability to retrieve and manage Address scopes through the Neutron API.
subnetpools unit tests
extraroutes unit tests
networking/v2/extensions/layer3/floatingips
package floatingips enables management and retrieval of Floating IPs from the OpenStack Networking service.
package floatingips enables management and retrieval of Floating IPs from the OpenStack Networking service.
floatingips unit tests
networking/v2/extensions/layer3/portforwarding
package portforwarding enables management and retrieval of port forwarding resources for Floating IPs from the OpenStack Networking service.
package portforwarding enables management and retrieval of port forwarding resources for Floating IPs from the OpenStack Networking service.
port forwarding unit tests
networking/v2/extensions/layer3/routers
Package routers enables management and retrieval of Routers from the OpenStack Networking service.
Package routers enables management and retrieval of Routers from the OpenStack Networking service.
routers unit tests
networking/v2/extensions/networkipavailabilities
Package networkipavailabilities provides the ability to retrieve and manage networkipavailabilities through the Neutron API.
Package networkipavailabilities provides the ability to retrieve and manage networkipavailabilities through the Neutron API.
networkipavailabilities unit tests
networking/v2/extensions/portsbinding
Package portsbinding provides information and interaction with the port binding extension for the OpenStack Networking service.
Package portsbinding provides information and interaction with the port binding extension for the OpenStack Networking service.
portsbindings unit tests
networking/v2/extensions/portsecurity
Package portsecurity provides information and interaction with the port security extension for the OpenStack Networking service.
Package portsecurity provides information and interaction with the port security extension for the OpenStack Networking service.
networking/v2/extensions/provider
Package provider gives access to the provider Neutron plugin, allowing network extended attributes.
Package provider gives access to the provider Neutron plugin, allowing network extended attributes.
provider unit tests
networking/v2/extensions/qos/policies
Package policies provides information and interaction with the QoS policy extension for the OpenStack Networking service.
Package policies provides information and interaction with the QoS policy extension for the OpenStack Networking service.
networking/v2/extensions/qos/rules
Package rules provides the ability to retrieve and manage QoS policy rules through the Neutron API.
Package rules provides the ability to retrieve and manage QoS policy rules through the Neutron API.
networking/v2/extensions/qos/rules/testing
QoS policy rules unit tests
QoS policy rules unit tests
networking/v2/extensions/qos/ruletypes
Package ruletypes contains functionality for working with Neutron 'quality of service' rule-type resources.
Package ruletypes contains functionality for working with Neutron 'quality of service' rule-type resources.
qos unit tests
networking/v2/extensions/quotas
Package quotas provides the ability to retrieve and manage Networking quotas through the Neutron API.
Package quotas provides the ability to retrieve and manage Networking quotas through the Neutron API.
quotas unit tests
networking/v2/extensions/rbacpolicies
Package rbacpolicies contains functionality for working with Neutron RBAC Policies.
Package rbacpolicies contains functionality for working with Neutron RBAC Policies.
networking/v2/extensions/rbacpolicies/testing
Package testing includes rbac unit tests
Package testing includes rbac unit tests
networking/v2/extensions/security
Package security contains functionality to work with security group and security group rules Neutron resources.
Package security contains functionality to work with security group and security group rules Neutron resources.
networking/v2/extensions/security/groups
Package groups provides information and interaction with Security Groups for the OpenStack Networking service.
Package groups provides information and interaction with Security Groups for the OpenStack Networking service.
groups unit tests
networking/v2/extensions/security/rules
Package rules provides information and interaction with Security Group Rules for the OpenStack Networking service.
Package rules provides information and interaction with Security Group Rules for the OpenStack Networking service.
rules unit tests
networking/v2/extensions/subnetpools
Package subnetpools provides the ability to retrieve and manage subnetpools through the Neutron API.
Package subnetpools provides the ability to retrieve and manage subnetpools through the Neutron API.
subnetpools unit tests
networking/v2/extensions/testing
extensions unit tests
extensions unit tests
networking/v2/extensions/trunk_details
Package trunk_details provides the ability to extend a ports result with additional information about any trunk and subports associated with the port.
Package trunk_details provides the ability to extend a ports result with additional information about any trunk and subports associated with the port.
networking/v2/extensions/trunks
Package trunks provides the ability to retrieve and manage trunks through the Neutron API.
Package trunks provides the ability to retrieve and manage trunks through the Neutron API.
trunks unit tests
networking/v2/extensions/vlantransparent
Package vlantransparent provides the ability to retrieve and manage networks with the vlan-transparent extension through the Neutron API.
Package vlantransparent provides the ability to retrieve and manage networks with the vlan-transparent extension through the Neutron API.
networking/v2/extensions/vlantransparent/testing
vlantransparent extension unit tests
vlantransparent extension unit tests
networking/v2/extensions/vpnaas/endpointgroups
Package endpointgroups allows management of endpoint groups in the Openstack Network Service
Package endpointgroups allows management of endpoint groups in the Openstack Network Service
networking/v2/extensions/vpnaas/ikepolicies
Package ikepolicies allows management and retrieval of IKE policies in the OpenStack Networking Service.
Package ikepolicies allows management and retrieval of IKE policies in the OpenStack Networking Service.
networking/v2/extensions/vpnaas/ipsecpolicies
Package ipsecpolicies allows management and retrieval of IPSec Policies in the OpenStack Networking Service.
Package ipsecpolicies allows management and retrieval of IPSec Policies in the OpenStack Networking Service.
networking/v2/extensions/vpnaas/services
Package services allows management and retrieval of VPN services in the OpenStack Networking Service.
Package services allows management and retrieval of VPN services in the OpenStack Networking Service.
networking/v2/extensions/vpnaas/siteconnections
Package siteconnections allows management and retrieval of IPSec site connections in the OpenStack Networking Service.
Package siteconnections allows management and retrieval of IPSec site connections in the OpenStack Networking Service.
networking/v2/networks
Package networks contains functionality for working with Neutron network resources.
Package networks contains functionality for working with Neutron network resources.
networking/v2/networks/testing
networks unit tests
networks unit tests
networking/v2/ports
Package ports contains functionality for working with Neutron port resources.
Package ports contains functionality for working with Neutron port resources.
networking/v2/ports/testing
ports unit tests
ports unit tests
networking/v2/subnets
Package subnets contains functionality for working with Neutron subnet resources.
Package subnets contains functionality for working with Neutron subnet resources.
networking/v2/subnets/testing
subnets unit tests
subnets unit tests
objectstorage/v1/accounts
Package accounts contains functionality for working with Object Storage account resources.
Package accounts contains functionality for working with Object Storage account resources.
objectstorage/v1/accounts/testing
accounts unit tests
accounts unit tests
objectstorage/v1/containers
Package containers contains functionality for working with Object Storage container resources.
Package containers contains functionality for working with Object Storage container resources.
objectstorage/v1/containers/testing
containers unit tests
containers unit tests
objectstorage/v1/objects
Package objects contains functionality for working with Object Storage object resources.
Package objects contains functionality for working with Object Storage object resources.
objects unit tests
objectstorage/v1/swauth
Package swauth implements Swift's built-in authentication.
Package swauth implements Swift's built-in authentication.
swauth unit tests
orchestration/v1/apiversions
Package apiversions provides information and interaction with the different API versions for the OpenStack Heat service.
Package apiversions provides information and interaction with the different API versions for the OpenStack Heat service.
orchestration/v1/apiversions/testing
orchestration_apiversions_v1
orchestration_apiversions_v1
orchestration/v1/buildinfo
Package buildinfo provides build information about heat deployments.
Package buildinfo provides build information about heat deployments.
orchestration/v1/buildinfo/testing
orchestration_buildinfo_v1
orchestration_buildinfo_v1
orchestration/v1/resourcetypes
Package resourcetypes provides operations for listing available resource types, obtaining their properties schema, and generating example templates that can be customised to use as provider templates.
Package resourcetypes provides operations for listing available resource types, obtaining their properties schema, and generating example templates that can be customised to use as provider templates.
orchestration/v1/stackevents
Package stackevents provides operations for finding, listing, and retrieving stack events.
Package stackevents provides operations for finding, listing, and retrieving stack events.
orchestration/v1/stackevents/testing
orchestration_stackevents_v1
orchestration_stackevents_v1
orchestration/v1/stackresources
Package stackresources provides operations for working with stack resources.
Package stackresources provides operations for working with stack resources.
orchestration/v1/stackresources/testing
orchestration_stackresources_v1
orchestration_stackresources_v1
orchestration/v1/stacks
Package stacks provides operation for working with Heat stacks.
Package stacks provides operation for working with Heat stacks.
orchestration/v1/stacks/testing
orchestration_stacks_v1
orchestration_stacks_v1
orchestration/v1/stacktemplates
Package stacktemplates provides operations for working with Heat templates.
Package stacktemplates provides operations for working with Heat templates.
orchestration/v1/stacktemplates/testing
orchestration_stacktemplates_v1
orchestration_stacktemplates_v1
placement/v1/resourceproviders
Package resourceproviders creates and lists all resource providers from the OpenStack Placement service.
Package resourceproviders creates and lists all resource providers from the OpenStack Placement service.
placement/v1/resourceproviders/testing
placement resource providers
placement resource providers
sharedfilesystems/apiversions
Package apiversions provides information and interaction with the different API versions for the Shared File System service, code-named Manila.
Package apiversions provides information and interaction with the different API versions for the Shared File System service, code-named Manila.
apiversions_v1
sharedfilesystems/v2/schedulerstats
Package schedulerstats returns information about shared file systems capacity and utilisation.
Package schedulerstats returns information about shared file systems capacity and utilisation.
sharedfilesystems/v2/shares
Package shares provides information and interaction with the different API versions for the Shared File System service, code-named Manila.
Package shares provides information and interaction with the different API versions for the Shared File System service, code-named Manila.
testing
openstack
openstack
utils
workflow/v2/crontriggers
Package crontriggers provides interaction with the cron triggers API in the OpenStack Mistral service.
Package crontriggers provides interaction with the cron triggers API in the OpenStack Mistral service.
workflow/v2/executions
Package executions provides interaction with the execution API in the OpenStack Mistral service.
Package executions provides interaction with the execution API in the OpenStack Mistral service.
workflow/v2/workflows
Package workflows provides interaction with the workflows API in the OpenStack Mistral service.
Package workflows provides interaction with the workflows API in the OpenStack Mistral service.
Package pagination contains utilities and convenience structs that implement common pagination idioms within OpenStack APIs.
Package pagination contains utilities and convenience structs that implement common pagination idioms within OpenStack APIs.
testing
pagination
pagination
Package testhelper container methods that are useful for writing unit tests.
Package testhelper container methods that are useful for writing unit tests.
gophercloud
gophercloud

Jump to

Keyboard shortcuts

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