client

package
v1.0.0-...-3228e4f Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2017 License: LGPL-3.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (

	// The HTTP request methods.
	GET    = "GET"
	POST   = "POST"
	PUT    = "PUT"
	DELETE = "DELETE"
	HEAD   = "HEAD"
	COPY   = "COPY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticatingClient

type AuthenticatingClient interface {
	Client

	// SetVersionDiscoveryEnabled enables or disables API version
	// discovery. Discovery is enabled by default. If enabled,
	// the client will attempt to list all versions available
	// for a service and use the best match. Otherwise, any API
	// version specified in an SendRequest or MakeServiceURL
	// call will be ignored, and the service catalogue endpoint
	// URL will be used directly.
	SetVersionDiscoveryEnabled(bool) bool

	// SetRequiredServiceTypes sets the service types that the
	// openstack must provide.
	SetRequiredServiceTypes(requiredServiceTypes []string)

	// Authenticate authenticates the client with the OpenStack
	// identity service.
	Authenticate() error

	// IsAuthenticated reports whether the client is
	// authenticated.
	IsAuthenticated() bool

	// Token returns the authentication token. If the client
	// is not yet authenticated, this will return an empty
	// string.
	Token() string

	// UserId returns the user ID for authentication.
	UserId() string

	// TenantId returns the tenant ID for authentication.
	TenantId() string

	// EndpointsForRegion returns the service catalog URLs
	// for the specified region.
	EndpointsForRegion(region string) identity.ServiceURLs

	// IdentityAuthOptions returns a list of valid auth options
	// for the given openstack or error if fetching fails.
	IdentityAuthOptions() (identity.AuthOptions, error)
}

AuthenticatingClient sends service requests to an OpenStack deployment after first validating a user's credentials.

func NewClient

func NewClient(creds *identity.Credentials, auth_method identity.AuthMode, logger logging.CompatLogger) AuthenticatingClient

func NewNonValidatingClient

func NewNonValidatingClient(creds *identity.Credentials, auth_method identity.AuthMode, logger logging.CompatLogger) AuthenticatingClient

type Client

type Client interface {
	SendRequest(method, svcType, svcVersion, apiCall string, requestData *goosehttp.RequestData) (err error)
	// MakeServiceURL prepares a full URL to a service endpoint, with optional
	// URL parts.
	MakeServiceURL(serviceType, apiVersion string, parts []string) (string, error)
}

Client implementations sends service requests to an OpenStack deployment.

func NewNonValidatingPublicClient

func NewNonValidatingPublicClient(baseURL string, logger logging.CompatLogger) Client

func NewPublicClient

func NewPublicClient(baseURL string, logger logging.CompatLogger) Client

Jump to

Keyboard shortcuts

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