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.
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 := token.TokenOptions{ IdentityEndpoint: "https://openstack.example.com:5000/v2.0", Username: "{username}", Password: "{password}", TenantID: "{tenant_id}", } provider, err := openstack.AuthenticatedClient(opts)
You can also use AK/SK authentication to construct provider:
akSkOptions := aksk.AkSkOptions{ IdentityEndpoint: "https://openstack.example.com:5000/v2.0", ProjectId: "{projectId}", AccessKey: "{accKey}", SecretKey: "{secretKey}", Domain: "yyy.com", } provider, err := openstack.AuthenticatedClient(akSkOptions)
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(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 := 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(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(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(func (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() 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.
Index ¶
- Constants
- Variables
- func BuildHeaders(opts interface{}) (map[string]string, error)
- func BuildQueryString(opts interface{}) (*url.URL, error)
- func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, error)
- func ExtractNextURL(links []Link) (string, error)
- func IDSliceToQueryString(name string, ids []int) string
- func InitStructWithDefaultTag(bean interface{})
- func IntToPointer(i int) *int
- func IntWithinRange(val, min, max int) bool
- func IsInStrSlice(sliceStr []string, s string) bool
- func MatchErrorCode(httpStatus int, message string) string
- func MaybeInt(original int) *int
- func MaybeString(original string) *string
- func NewSystemCommonError(code, message string) error
- func NewSystemServerError(httpStatus int, responseContent string) error
- func NormalizePathURL(basePath, rawPath string) (string, error)
- func NormalizeURL(url string) string
- func ParseSeverError(httpStatus int, responseContent string) error
- func WaitFor(timeout int, predicate func() (bool, error)) error
- type Availability
- type Config
- type EnabledState
- type EndpointLocator
- type EndpointOpts
- type ErrResult
- type HeaderResult
- type IPVersion
- type JSONRFC1123
- type JSONRFC3339Milli
- type JSONRFC3339MilliNoZ
- type JSONRFC3339NoZ
- type JSONUnix
- type Link
- type Logger
- type OneLevelError
- type ProviderClient
- func (client *ProviderClient) AuthenticatedHeaders() (m map[string]string)
- func (client *ProviderClient) GetProjectID() string
- func (client *ProviderClient) Reauthenticate(previousToken string) (err error)
- func (client *ProviderClient) Request(method, url string, options *RequestOpts) (*http.Response, error)
- func (client *ProviderClient) SetToken(t string)
- func (client *ProviderClient) Token() string
- func (client *ProviderClient) UseTokenLock()
- type RequestOpts
- type Result
- type ServiceClient
- func (client *ServiceClient) Delete(url string, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Get(url string, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Head(url string, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Patch(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Post(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Put(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) Request(method, url string, options *RequestOpts) (*http.Response, error)
- func (client *ServiceClient) ResourceBaseURL() string
- func (client *ServiceClient) ServiceURL(parts ...string) string
- func (client *ServiceClient) SetMicroversion(microversion string)
- func (client *ServiceClient) UnsetMicroversion()
- type UnifiedError
- type UserAgent
Constants ¶
const ( //ECS EcsAuthRequired = "Authentication required" EcsPoilcyNotAllow = "Policy doesn't allow .*. to be performed" EcsTokenRoleEmpty = "token role is empty, forbidden to perform this action" EcsTokenRoleForbidden = "token role * is forbidden to perform this action" EcsErrorRoleToPerform = "do not have the required roles, forbbiden to perform this action" EcsQuotaExceeded = "Quota exceeded for instances" EcsPortNumberExceed = "Maximum number of ports exceeded" EcsVolumeNumberOver = "Volume number is over limit" EcsBlockImageNotFound = "Block Device Mapping is Invalid: failed to get image.*." EcsImageNotFound = "Image * could not be found." EcsFlavorNotFound = "Flavor .*. could not be found" EcsNetworkNotFound = "Network.*.could not be found" EcsBlockDevInvalid = "Block Device Mapping is Invalid" EcsSecurityGroupNotFound = "Security group .*. not found" EcsKeyPairNotFound = "Keypair .*. not found for user *" EcsInstanceGroupNotFound = "Instance group .*. could not be found" EcsInvalidMetadata = "Invalid metadata.*" EcsUserDataBase64 = "User data needs to be valid base 64" EcsUserDataTooLarge = "User data too large. User data must be no larger than .*" EcsInstanceDiskExceed = "The created instance's disk would be too small" EcsFlavorMemoryNotEnough = "Flavor's memory is too small for requested image" EcsInstanceNotFound = "Instance .*. could not be found" EcsInstanceIsLocked = "Instance .*. is locked" EcsInstCantBeOperated = "Cannot .*. instance .*. while it is in .*" EcsUnexpectedApiERROR = "Unexpected API Error" EcsServerCantComply = "The server could not comply with the request since it is either malformed.*." EcsInvalidFlavorRef = "Invalid flavorRef provided" EcsInvalidKeyName = "Invalid key_name provided" EcsInvalidInputField = "Invalid input for field/attribute" EcsResourceSoldOut = "Instance resource is temporarily sold out." //IMS Ims0027NoImageFoundWithId = "No image found with ID" Ims0144FailedFindImage = "Failed to find image" //ELB ELB2001AdminStateUpFalse = "Admin_state_up is not allowed with False" ELB2002IpNotValid = "IP address .*. is not a valid IP for the specified subnet." ELB2003PoolNotFound = "pool .*. could not be found" ELB2004MemberNotSupportPort = "Member not support protocol port *" ELB2005SubnetMismatch = "Router of member's subnet .*. and router of loadbalancer's subnet .*. mismatch" ELB2006IpPortAlreadyPresent = "Member with address .*. and protocol_port .*. already present in pool .*." ELB2007MemberNotFound = "member .*. could not be found" ELB6101QuotaExceeded = "Quota exceeded for resources: \\['listener'\\]" ELB2541QuotaExceeded = "Quota exceeded for resources: \\['pool'\\]" ELBb015QuotaExceeded = "Quota exceeded for resources: \\['l7policy'\\]" ELB1071QuotaExceeded = "Quota exceeded for resources: \\['loadbalancer'\\]" )
Define Service error information.
const ( //Com1000 CE_MissingInputCode = "Com.1000" //client error CE_MissingInputMessage = "Missing input for argument [%s]" //Com1001 CE_StreamControlApiCode = "Com.1001" //server error CE_StreamControlApiMessage = "The maximum request receiving rate is exceeded" //Com1002 CE_InvalidInputCode = "Com.1002" //client error CE_InvalidInputMessage = "Invalid input provided for argument [%s]" CE_OptionTypeNotStructCode = "Com.1002" //client error CE_OptionTypeNotStructMessage = "Options type is not a struct" //Com1003 CE_ResourceNotFoundCode = "Com.1003" //client error CE_ResourceNotFoundMessage = "Unable to find %s with name %s" CE_MultipleResourcesFoundCode = "Com.1003" //client error CE_MultipleResourcesFoundMessage = "Found %d %ss matching %s" CE_ErrUnexpectedTypeCode = "Com.1003" //client error CE_ErrUnexpectedTypeMessage = "Expected %s but got %s" //Com1004 CE_NoClientProvidedCode = "Com.1004" //client error CE_NoClientProvidedMessage = "A service client must be provided to find a resource ID by name" CE_NoEndPointInCatalogCode = "Com.1004" //client error CE_NoEndPointInCatalogMessage = "No suitable endpoint could be found in the service catalog." //Com1005 CE_ApiNotFoundCode = "Com.1005" //server error CE_ApiNotFoundMessage = "API not found" //1006 CE_TimeoutErrorCode = "Com.1006" //client error CE_TimeoutErrorMessage = "The request timed out %s times(%s for retry), perhaps we should have the threshold raised a little?" CE_ReauthExceedCode = "Com.1006" //client error CE_ReauthExceedMessage = "Tried to re-authenticate 3 times with no success." CE_ReauthFuncErrorCode = "Com.1006" //client error CE_ReauthFuncErrorMessage = "Get reauth function error [%s]" )
Common Error.
const DefaultUserAgent = "huawei-cloud-sdk-go/1.0.21"
DefaultUserAgent is the default User-Agent string set in the request header.
const RFC3339Milli = "2006-01-02T15:04:05.999999Z"
RFC3339Milli describes a common time format used by some API responses.
const RFC3339MilliNoZ = "2006-01-02T15:04:05.999999"
const RFC3339NoZ = "2006-01-02T15:04:05"
RFC3339NoZ is the time format used in Heat (Orchestration).
Variables ¶
var EnableDebug bool
EnableDebug, SDK log switch defaults value is false.
Functions ¶
func BuildHeaders ¶
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 ¶
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, or boolean values. Fields left at their type's zero value will be omitted from the query.
func BuildRequestBody ¶
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 ¶
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 ¶
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 InitStructWithDefaultTag ¶
func InitStructWithDefaultTag(bean interface{})
InitStructWithDefaultTag,Initialize the structure instance using the structure tag.
func IntToPointer ¶
IntToPointer is a function for converting integers into integer pointers. This is useful when passing in options to operations.
func IntWithinRange ¶
IntWithinRange returns TRUE if an integer falls within a defined range, and FALSE if not.
func IsInStrSlice ¶
IsInStrSlice, Determine if the string is in the array.
func MatchErrorCode ¶
MatchErrorCode,Match the error code according to the error message
func MaybeInt ¶
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 ¶
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 NewSystemCommonError ¶
Initialize SDK client error.
func NewSystemServerError ¶
NewSystemServerError,Handle background API error codes.
func NormalizePathURL ¶
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 ¶
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 ParseSeverError ¶
ParseSeverError,This function uses json serialization to parse background API error codes.
func WaitFor ¶
WaitFor polls a predicate function, once per second, up to a timeout limit. This is useful to wait for a resource to transition to a certain state. To handle situations when the predicate might hang indefinitely, the predicate will be prematurely cancelled after the timeout. 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 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 Config ¶
type Config struct { // Timeout specifies a time limit for requests made by this // Client. The timeout includes connection time, any // redirects, and reading the response body. The timer remains // running after Get, Head, Post, or Do return and will // interrupt reading of the Response.Body. // // A Timeout of zero means no timeout. Timeout time.Duration `default:"10000000000"` // Transport specifies the mechanism by which individual // HTTP requests are made. // If nil, DefaultTransport is used. HttpTransport *http.Transport `default:""` }
Config define the configs parameter of the provider client .
func NewConfig ¶
func NewConfig() (config *Config)
NewConfig return Config instance with its default tag.
func (*Config) WithHttpTransport ¶
WithHttpTransport customizes the http transport.
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 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 ¶
ExtractErr is a function that extracts error information, or nil, from a result.
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 interface{}) 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
type JSONRFC1123 ¶
func (*JSONRFC1123) UnmarshalJSON ¶
func (jt *JSONRFC1123) UnmarshalJSON(data []byte) error
type JSONRFC3339Milli ¶
func (*JSONRFC3339Milli) UnmarshalJSON ¶
func (jt *JSONRFC3339Milli) UnmarshalJSON(data []byte) error
type JSONRFC3339MilliNoZ ¶
func (*JSONRFC3339MilliNoZ) UnmarshalJSON ¶
func (jt *JSONRFC3339MilliNoZ) UnmarshalJSON(data []byte) error
type JSONRFC3339NoZ ¶
func (*JSONRFC3339NoZ) UnmarshalJSON ¶
func (jt *JSONRFC3339NoZ) UnmarshalJSON(data []byte) error
type JSONUnix ¶
func (*JSONUnix) UnmarshalJSON ¶
type Link ¶
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 Logger ¶
type Logger struct {
DebugEnable bool `default:"false"`
}
Logger, define the logger struct.
type OneLevelError ¶
type OneLevelError struct { Message string Request_id string ErrCode string `json:"error_code"` ErrMsg string `json:"error_msg"` Code string `json:"code"` }
OneLevelError,Define the error code structure and match the error code of one layer of json structure
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() error // DomainID DomainID string // ProjectID ProjectID string // Conf define the configs parameter of the provider client Conf *Config // AKSKAuthOptions provides the value for AK/SK authentication, it should be nil if you use token authentication, // Otherwise, it must have a value AKSKOptions aksk.AKSKOptions // 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.
func (*ProviderClient) GetProjectID ¶
func (client *ProviderClient) GetProjectID() string
GetProjectID,Implement the GetProjectID() interface, return client projectID.
func (*ProviderClient) Reauthenticate ¶
func (client *ProviderClient) Reauthenticate(previousToken string) (err 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(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) 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
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 interface{} // 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 interface{} // 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 provide on the request. If a header is // provided with a blank value (""), that header will be *omitted* instead: use this to suppress // the default Accept header or an inferred Content-Type, for example. MoreHeaders map[string]string // ErrorContext specifies the resource error type to return if an error is encountered. // This lets resources override default error messages based on the response status code. ErrorContext error HandleError func(httpStatus int, responseContent string) error }
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 interface{} // 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 ¶
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 ¶
ExtractIntoSlicePtr will unmarshal the Result (r) into the provided interface{} (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 ¶
ExtractIntoStructPtr will unmarshal the Result (r) into the provided interface{} (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 ¶
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 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 HandleError func(httpStatus int, responseContent string) error // contains filtered or unexported fields }
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(url string, opts *RequestOpts) (*http.Response, error)
Delete calls `Request` with the "DELETE" HTTP verb.
func (*ServiceClient) Get ¶
func (client *ServiceClient) Get(url string, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
Get calls `Request` with the "GET" HTTP verb.
func (*ServiceClient) Head ¶
func (client *ServiceClient) Head(url string, opts *RequestOpts) (*http.Response, error)
Head calls `Request` with the "HEAD" HTTP verb.
func (*ServiceClient) Patch ¶
func (client *ServiceClient) Patch(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
Patch calls `Request` with the "PATCH" HTTP verb.
func (*ServiceClient) Post ¶
func (client *ServiceClient) Post(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
Post calls `Request` with the "POST" HTTP verb.
func (*ServiceClient) Put ¶
func (client *ServiceClient) Put(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error)
Put calls `Request` with the "PUT" HTTP verb.
func (*ServiceClient) Request ¶
func (client *ServiceClient) Request(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.
func (*ServiceClient) SetMicroversion ¶
func (client *ServiceClient) SetMicroversion(microversion string)
SetMicroversion,Set the service micro version field.
func (*ServiceClient) UnsetMicroversion ¶
func (client *ServiceClient) UnsetMicroversion()
UnsetMicroversion,Unset the service micro version field.
type UnifiedError ¶
type UnifiedError struct { ErrCode interface{} `json:"code"` ErrMessage string `json:"message"` }
UnifiedError, Unified definition of backend errors.
func (UnifiedError) Error ¶
func (e UnifiedError) Error() string
Error,Implement the Error() interface.
func (UnifiedError) ErrorCode ¶
func (e UnifiedError) ErrorCode() string
ErrorCode,Error code converted to string type.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
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. |
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. |
openstack/blockstorage/extensions
Package extensions contains common functions for creating block storage resources that are extensions of the block storage API.
|
Package extensions contains common functions for creating block storage resources that are extensions of the block storage API. |
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. |
openstack/blockstorage/v1
Package v1 contains common functions for creating block storage based resources for use in acceptance tests.
|
Package v1 contains common functions for creating block storage based resources for use in acceptance tests. |
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. |
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. |
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. |
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. |
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. |
openstack/imageservice/v2
Package v2 contains common functions for creating imageservice resources for use in acceptance tests.
|
Package v2 contains common functions for creating imageservice resources for use in acceptance tests. |
aksk
Package signer providers functions for sign http request before request cloud.
|
Package signer providers functions for sign http request before request cloud. |
token
Package token providers functions for initial http request body before request cloud.
|
Package token providers functions for initial http request body before request cloud. |
examples
|
|
functiontest
|
|
Package openstack contains resources for the individual OpenStack projects supported in Gophercloud.
|
Package openstack contains resources for the individual OpenStack projects supported in Gophercloud. |
blockstorage/extensions/schedulerstats
Package schedulerstats returns information about block storage pool capacity and utilisation.
|
Package schedulerstats returns information about block storage pool capacity and utilisation. |
blockstorage/extensions/volumeactions
Package volumeactions provides information and interaction with volumes in the OpenStack Block Storage service.
|
Package volumeactions provides information and interaction with volumes in the OpenStack Block Storage service. |
blockstorage/extensions/volumeactions/testing
volumeactions unit tests
|
volumeactions unit tests |
blockstorage/extensions/volumetenants
Package volumetenants provides the ability to extend a volume result with tenant/project information.
|
Package volumetenants provides the ability to extend a volume result with tenant/project information. |
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/v1/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. |
blockstorage/v1/apiversions/testing
apiversions_v1
|
apiversions_v1 |
blockstorage/v1/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/v1/snapshots/testing
snapshots_v1
|
snapshots_v1 |
blockstorage/v1/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/v1/volumes/testing
volumes_v1
|
volumes_v1 |
blockstorage/v1/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. |
blockstorage/v1/volumetypes/testing
volumetypes_v1
|
volumetypes_v1 |
blockstorage/v2/extensions/apiversions/testing
apiversions_v1
|
apiversions_v1 |
blockstorage/v2/extensions/availabilityzones/testing
availabilityzones unittests
|
availabilityzones unittests |
blockstorage/v2/extensions/extensions/testing
common extensions unit tests
|
common extensions unit tests |
blockstorage/v2/extensions/volumetypes/testing
volume_types
|
volume_types |
blockstorage/v2/snapshots/testing
snapshots_v2
|
snapshots_v2 |
blockstorage/v2/volumes/testing
volumes_v2
|
volumes_v2 |
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
snapshots_v3
|
snapshots_v3 |
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_v3
|
volumes_v3 |
blockstorage/v3/volumetypes/testing
volume_types
|
volume_types |
cdn/v1/base
Package base provides information and interaction with the base API resource in the OpenStack CDN service.
|
Package base provides information and interaction with the base API resource in the OpenStack CDN service. |
cdn/v1/base/testing
cdn_base_v1
|
cdn_base_v1 |
cdn/v1/flavors
Package flavors provides information and interaction with the flavors API resource in the OpenStack CDN service.
|
Package flavors provides information and interaction with the flavors API resource in the OpenStack CDN service. |
cdn/v1/flavors/testing
cdn_flavors_v1
|
cdn_flavors_v1 |
cdn/v1/serviceassets
Package serviceassets provides information and interaction with the serviceassets API resource in the OpenStack CDN service.
|
Package serviceassets provides information and interaction with the serviceassets API resource in the OpenStack CDN service. |
cdn/v1/serviceassets/testing
cdn_serviceassets_v1
|
cdn_serviceassets_v1 |
cdn/v1/services
Package services provides information and interaction with the services API resource in the OpenStack CDN service.
|
Package services provides information and interaction with the services API resource in the OpenStack CDN service. |
cdn/v1/services/testing
cdn_services_v1
|
cdn_services_v1 |
ces/v1/metricdata/testing
metricdata unit tests
|
metricdata unit tests |
ces/v1/metrics/testing
metrics unit tests
|
metrics unit tests |
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/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/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/extensions/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/extensions/attachinterfaces/testing
attachinterfaces unit tests
|
attachinterfaces unit tests |
compute/v2/extensions/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/extensions/availabilityzones/testing
availabilityzones unittests
|
availabilityzones unittests |
compute/v2/extensions/bootfromvolume
Package bootfromvolume extends a server create request with the ability to specify block device options.
|
Package bootfromvolume extends a server create request with the ability to specify block device options. |
compute/v2/extensions/bootfromvolume/testing
bootfromvolume unit tests
|
bootfromvolume unit tests |
compute/v2/extensions/defsecrules
Package defsecrules enables management of default security group rules.
|
Package defsecrules enables management of default security group rules. |
compute/v2/extensions/defsecrules/testing
defsecrules unit tests
|
defsecrules unit tests |
compute/v2/extensions/diskconfig
Package diskconfig provides information and interaction with the Disk Config extension that works with the OpenStack Compute service.
|
Package diskconfig provides information and interaction with the Disk Config extension that works with the OpenStack Compute service. |
compute/v2/extensions/diskconfig/testing
diskconfig unit tests
|
diskconfig unit tests |
compute/v2/extensions/evacuate
Package evacuate provides functionality to evacuates servers that have been provisioned by the OpenStack Compute service from a failed host to a new host.
|
Package evacuate provides functionality to evacuates servers that have been provisioned by the OpenStack Compute service from a failed host to a new host. |
compute/v2/extensions/evacuate/testing
compute_extensions_evacuate_v2
|
compute_extensions_evacuate_v2 |
compute/v2/extensions/extendedstatus
Package extendedstatus provides the ability to extend a server result with the extended status information.
|
Package extendedstatus provides the ability to extend a server result with the extended status information. |
compute/v2/extensions/floatingips
Package floatingips provides the ability to manage floating ips through the Nova API.
|
Package floatingips provides the ability to manage floating ips through the Nova API. |
compute/v2/extensions/floatingips/testing
floatingips unit tests
|
floatingips unit tests |
compute/v2/extensions/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/extensions/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/extensions/keypairs/testing
keypairs unit tests
|
keypairs unit tests |
compute/v2/extensions/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/extensions/lockunlock
Package lockunlock provides functionality to lock and unlock servers that have been provisioned by the OpenStack Compute service.
|
Package lockunlock provides functionality to lock and unlock servers that have been provisioned by the OpenStack Compute service. |
compute/v2/extensions/lockunlock/testing
unlocklock unit tests
|
unlocklock unit tests |
compute/v2/extensions/migrate
Package migrate provides functionality to migrate servers that have been provisioned by the OpenStack Compute service.
|
Package migrate provides functionality to migrate servers that have been provisioned by the OpenStack Compute service. |
compute/v2/extensions/migrate/testing
compute_extensions_startstop_v2
|
compute_extensions_startstop_v2 |
compute/v2/extensions/networks
Package networks provides the ability to create and manage networks in cloud environments using nova-network.
|
Package networks provides the ability to create and manage networks in cloud environments using nova-network. |
compute/v2/extensions/networks/testing
networks unit tests
|
networks unit tests |
compute/v2/extensions/pauseunpause
Package pauseunpause provides functionality to pause and unpause servers that have been provisioned by the OpenStack Compute service.
|
Package pauseunpause provides functionality to pause and unpause servers that have been provisioned by the OpenStack Compute service. |
compute/v2/extensions/pauseunpause/testing
pauseunpause unit tests
|
pauseunpause unit tests |
compute/v2/extensions/quotasets
Package quotasets enables retrieving and managing Compute quotas.
|
Package quotasets enables retrieving and managing Compute quotas. |
compute/v2/extensions/quotasets/testing
quotasets unit tests
|
quotasets unit tests |
compute/v2/extensions/resetstate
Package resetstate provides functionality to reset the state of a server that has been provisioned by the OpenStack Compute service.
|
Package resetstate provides functionality to reset the state of a server that has been provisioned by the OpenStack Compute service. |
compute/v2/extensions/schedulerhints
Package schedulerhints extends the server create request with the ability to specify additional parameters which determine where the server will be created in the OpenStack cloud.
|
Package schedulerhints extends the server create request with the ability to specify additional parameters which determine where the server will be created in the OpenStack cloud. |
compute/v2/extensions/schedulerhints/testing
schedulerhints unit tests
|
schedulerhints unit tests |
compute/v2/extensions/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/extensions/secgroups/testing
secgroups unit tests
|
secgroups unit tests |
compute/v2/extensions/servergroups
Package servergroups provides the ability to manage server groups.
|
Package servergroups provides the ability to manage server groups. |
compute/v2/extensions/servergroups/testing
servergroups unit tests
|
servergroups unit tests |
compute/v2/extensions/startstop
Package startstop provides functionality to start and stop servers that have been provisioned by the OpenStack Compute service.
|
Package startstop provides functionality to start and stop servers that have been provisioned by the OpenStack Compute service. |
compute/v2/extensions/startstop/testing
startstop unit tests
|
startstop unit tests |
compute/v2/extensions/suspendresume
Package suspendresume provides functionality to suspend and resume servers that have been provisioned by the OpenStack Compute service.
|
Package suspendresume provides functionality to suspend and resume servers that have been provisioned by the OpenStack Compute service. |
compute/v2/extensions/suspendresume/testing
suspendresume unit tests
|
suspendresume unit tests |
compute/v2/extensions/tenantnetworks
Package tenantnetworks provides the ability for tenants to see information about the networks they have access to.
|
Package tenantnetworks provides the ability for tenants to see information about the networks they have access to. |
compute/v2/extensions/tenantnetworks/testing
tenantnetworks unit tests
|
tenantnetworks unit tests |
compute/v2/extensions/testing
extensions unit tests
|
extensions unit tests |
compute/v2/extensions/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/extensions/usage/testing
simple tenant usage unit tests
|
simple tenant usage unit tests |
compute/v2/extensions/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/extensions/volumeattach/testing
volumeattach unit tests
|
volumeattach 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/images
Package images provides information and interaction with the images through the OpenStack Compute service.
|
Package images provides information and interaction with the images through the OpenStack Compute service. |
compute/v2/images/testing
images unit tests
|
images 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 |
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/zones
When users need to access a server on the Internet, an IP address is required.
|
When users need to access a server on the Internet, an IP address is required. |
dns/v2/zones/testing
zones unit tests package testing import ( "fmt" "net/http" "testing" "time" "github.com/Huawei/gophercloud" "github.com/Huawei/gophercloud/openstack/dns/v2/zones" th "github.com/Huawei/gophercloud/testhelper" "github.com/Huawei/gophercloud/testhelper/client" ) // List Output is a sample response to a List call.
|
zones unit tests package testing import ( "fmt" "net/http" "testing" "time" "github.com/Huawei/gophercloud" "github.com/Huawei/gophercloud/openstack/dns/v2/zones" th "github.com/Huawei/gophercloud/testhelper" "github.com/Huawei/gophercloud/testhelper/client" ) // List Output is a sample response to a List call. |
ecs/v1/flavor/testing
flavor unit tests
|
flavor unit tests |
ecs/v1/job/testing
job unit tests
|
job unit tests |
ecs/v1/nics/testing
nics unit tests
|
nics 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/admin/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/extensions/admin/roles/testing
roles unit tests
|
roles unit tests |
identity/v2/extensions/testing
extensions unit tests
|
extensions 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/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/extensions/trusts
Package trusts enables management of OpenStack Identity Trusts.
|
Package trusts enables management of OpenStack Identity Trusts. |
identity/v3/extensions/trusts/testing
trusts unit tests
|
trusts unit tests |
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/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/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/users
Package users manages and retrieves Users in the OpenStack Identity Service.
|
Package users manages and retrieves Users in the OpenStack Identity Service. |
imageservice/v2/imagedata
Package imagedata enables management of image data.
|
Package imagedata enables management of image data. |
imageservice/v2/imagedata/testing
imagedata unit tests
|
imagedata unit tests |
imageservice/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. |
imageservice/v2/images/testing
images unit tests
|
images unit tests |
imageservice/v2/members
Package members enables management and retrieval of image members.
|
Package members enables management and retrieval of image members. |
imageservice/v2/members/testing
members unit tests
|
members 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 |
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. |
networking/v2/extensions/external/testing
external unit tests
|
external unit tests |
networking/v2/extensions/fwaas
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/firewalls
Package firewalls allows management and retrieval of firewalls from the OpenStack Networking Service.
|
Package firewalls allows management and retrieval of firewalls from the OpenStack Networking Service. |
networking/v2/extensions/fwaas/firewalls/testing
firewalls unit tests
|
firewalls unit tests |
networking/v2/extensions/fwaas/policies
Package policies allows management and retrieval of Firewall Policies in the OpenStack Networking Service.
|
Package policies allows management and retrieval of Firewall Policies in the OpenStack Networking Service. |
networking/v2/extensions/fwaas/policies/testing
policies unit tests
|
policies unit tests |
networking/v2/extensions/fwaas/routerinsertion
Package routerinsertion implements the fwaasrouterinsertion Firewall extension.
|
Package routerinsertion implements the fwaasrouterinsertion Firewall extension. |
networking/v2/extensions/fwaas/routerinsertion/testing
routerinsertion unit tests
|
routerinsertion unit tests |
networking/v2/extensions/fwaas/rules
Package rules enables management and retrieval of Firewall Rules in the OpenStack Networking Service.
|
Package rules enables management and retrieval of Firewall Rules in the OpenStack Networking Service. |
networking/v2/extensions/fwaas/rules/testing
rules unit tests
|
rules unit tests |
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/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. |
networking/v2/extensions/layer3/floatingips/testing
floatingips unit tests
|
floatingips 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. |
networking/v2/extensions/layer3/routers/testing
routers unit tests
|
routers unit tests |
networking/v2/extensions/lbaas
Package lbaas provides information and interaction with the Load Balancer as a Service extension for the OpenStack Networking service.
|
Package lbaas provides information and interaction with the Load Balancer as a Service extension for the OpenStack Networking service. |
networking/v2/extensions/lbaas/members
Package members provides information and interaction with Members of the Load Balancer as a Service extension for the OpenStack Networking service.
|
Package members provides information and interaction with Members of the Load Balancer as a Service extension for the OpenStack Networking service. |
networking/v2/extensions/lbaas/members/testing
members unit tests
|
members unit tests |
networking/v2/extensions/lbaas/monitors
Package monitors provides information and interaction with the Monitors of the Load Balancer as a Service extension for the OpenStack Networking Service.
|
Package monitors provides information and interaction with the Monitors of the Load Balancer as a Service extension for the OpenStack Networking Service. |
networking/v2/extensions/lbaas/monitors/testing
monitors unit tests
|
monitors unit tests |
networking/v2/extensions/lbaas/pools
Package pools provides information and interaction with the Pools of the Load Balancing as a Service extension for the OpenStack Networking service.
|
Package pools provides information and interaction with the Pools of the Load Balancing as a Service extension for the OpenStack Networking service. |
networking/v2/extensions/lbaas/pools/testing
pools unit tests
|
pools unit tests |
networking/v2/extensions/lbaas/vips
Package vips provides information and interaction with the Virtual IPs of the Load Balancing as a Service extension for the OpenStack Networking service.
|
Package vips provides information and interaction with the Virtual IPs of the Load Balancing as a Service extension for the OpenStack Networking service. |
networking/v2/extensions/lbaas/vips/testing
vips unit tests
|
vips unit tests |
networking/v2/extensions/lbaas_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. |
networking/v2/extensions/lbaas_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. |
networking/v2/extensions/lbaas_v2/listeners/testing
listeners unit tests
|
listeners unit tests |
networking/v2/extensions/lbaas_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. |
networking/v2/extensions/lbaas_v2/loadbalancers/testing
loadbalancers unit tests
|
loadbalancers unit tests |
networking/v2/extensions/lbaas_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. |
networking/v2/extensions/lbaas_v2/monitors/testing
monitors unit tests
|
monitors unit tests |
networking/v2/extensions/lbaas_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. |
networking/v2/extensions/lbaas_v2/pools/testing
pools unit tests
|
pools 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. |
networking/v2/extensions/portsbinding/testing
portsbindings unit tests
|
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. |
networking/v2/extensions/provider/testing
provider unit tests
|
provider 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. |
networking/v2/extensions/security/groups/testing
groups unit tests
|
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. |
networking/v2/extensions/security/rules/testing
rules unit tests
|
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. |
networking/v2/extensions/subnetpools/testing
subnetpools unit tests
|
subnetpools unit tests |
networking/v2/extensions/testing
extensions unit tests
|
extensions unit tests |
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. |
objectstorage/v1/objects/testing
objects unit tests
|
objects unit tests |
objectstorage/v1/swauth
Package swauth implements Swift's built-in authentication.
|
Package swauth implements Swift's built-in authentication. |
objectstorage/v1/swauth/testing
swauth unit tests
|
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/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 |
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. |
sharedfilesystems/apiversions/testing
apiversions_v1
|
apiversions_v1 |
testing
openstack
|
openstack |
utils/testing
utils
|
utils |
vpc/v1/bandwidths
You can allocate bandwidth when assigning an EIP so that the ECS bound with the EIP can use the bandwidth to access the Internet.
|
You can allocate bandwidth when assigning an EIP so that the ECS bound with the EIP can use the bandwidth to access the Internet. |
vpc/v1/ports
Sample Code, This interface is used to create a port.
|
Sample Code, This interface is used to create a port. |
vpc/v1/privateips
A public IP address is an IP address that can be directly accessed over the Internet.
|
A public IP address is an IP address that can be directly accessed over the Internet. |
vpc/v1/quotas
This interface is used to query network resource quotas for the VPC service of a tenant.
|
This interface is used to query network resource quotas for the VPC service of a tenant. |
vpc/v1/securitygrouprules
This interface is used to query network resource quotas for the VPC service of a tenant.
|
This interface is used to query network resource quotas for the VPC service of a tenant. |
vpc/v1/securitygroups
This interface is used to query network resource quotas for the VPC service of a tenant.
|
This interface is used to query network resource quotas for the VPC service of a tenant. |
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 |