clientservices

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndpointNotFound    = errors.New("endpoint not found")
	ErrEndpointsNotFound   = errors.New("endpoint not found")
	ErrServiceTypeNotFound = errors.New("service type not found")
)

Functions

func NewHTTPClient

func NewHTTPClient() *http.Client

func NewServiceClient

func NewServiceClient(options *ServiceClientOptions) (*gophercloud.ServiceClient, error)

Types

type CatalogService

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

func NewCatalogService

func NewCatalogService(serviceClient *gophercloud.ServiceClient) (*CatalogService, error)

func (*CatalogService) GetCatalog

func (cs *CatalogService) GetCatalog() (*tokens.ServiceCatalog, error)

GetCatalog - returns endpoints catalog from Keystone or cache.

func (*CatalogService) GetEndpoint

func (cs *CatalogService) GetEndpoint(serviceType, regionName string) (tokens.Endpoint, error)

GetEndpoint - returns endpoint url from Keystone catalog for ServiceType in RegionName. ServiceType is type of service (for example: compute, storage, quota-manager), not their names (nova, cinder).

func (*CatalogService) GetEndpoints

func (cs *CatalogService) GetEndpoints(serviceType string) ([]tokens.Endpoint, error)

GetEndpoints - returns endpoints from Keystone catalog for ServiceType from all regions.

type RequestOptions

type RequestOptions struct {
	JSONBody interface{}
	OkCodes  []int
}

type RequestService

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

func NewRequestService

func NewRequestService(serviceClient *gophercloud.ServiceClient) *RequestService

func (*RequestService) Do

func (s *RequestService) Do(method, url string, options *RequestOptions) (*ResponseResult, error)

type ResponseResult

type ResponseResult struct {
	*http.Response

	// Err contains error that can be provided to a caller.
	Err error
}

ResponseResult represents a result of a HTTP request. It embedded standard http.Response and adds a custom error description.

func (*ResponseResult) ExtractResult

func (result *ResponseResult) ExtractResult(to interface{}) error

ExtractResult allows to provide an object into which ResponseResult body will be extracted.

type ServiceClientOptions

type ServiceClientOptions struct {
	// The name of the domain in which the token will be issued.
	DomainName string

	// Credentials to auth with.
	Username string
	Password string

	// Optional field for setting project scope.
	ProjectID string

	// Optional field. The name of the domain where the user resides (Identity v3).
	UserDomainName string

	// Field for setting Identity endpoint.
	AuthURL string

	// Field for setting location for endpoints like ResellAPI or Keystone.
	AuthRegion string

	// Optional field.
	HTTPClient *http.Client

	// Optional field.
	UserAgent string
}

Jump to

Keyboard shortcuts

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