Documentation ¶
Index ¶
- Variables
- type BlockStorageClient
- type CloudsProvider
- type ComputeClient
- func (c *ComputeClient) AvailabilityZones(ctx context.Context) ([]availabilityzones.AvailabilityZone, error)
- func (c *ComputeClient) CreateServerGroup(ctx context.Context, name, policy string) (*servergroups.ServerGroup, error)
- func (c *ComputeClient) FlavorGPUs(flavor *Flavor) (*GPUMeta, error)
- func (c *ComputeClient) Flavors(ctx context.Context) ([]Flavor, error)
- func (c *ComputeClient) KeyPairs(ctx context.Context) ([]keypairs.KeyPair, error)
- func (c *ComputeClient) ListServerGroups(ctx context.Context) ([]servergroups.ServerGroup, error)
- type ComputeOptions
- type CreateTokenOptions
- type CreateTokenOptionsScopedToken
- type CreateTokenOptionsUnscopedPassword
- type Flavor
- type GPUMeta
- type IdentityClient
- func (c *IdentityClient) CreateApplicationCredential(ctx context.Context, userID, name, description string, roles []string) (*applicationcredentials.ApplicationCredential, error)
- func (c *IdentityClient) CreateToken(ctx context.Context, options CreateTokenOptions) (*tokens.Token, *tokens.User, error)
- func (c *IdentityClient) DeleteApplicationCredential(ctx context.Context, userID, id string) error
- func (c *IdentityClient) GetUser(ctx context.Context, userID string) (*users.User, error)
- func (c *IdentityClient) ListApplicationCredentials(ctx context.Context, userID string) ([]applicationcredentials.ApplicationCredential, error)
- func (c *IdentityClient) ListAvailableProjects(ctx context.Context) ([]projects.Project, error)
- type ImageClient
- type NetworkClient
- type Provider
- type TokenProvider
- type UnauthenticatedProvider
Constants ¶
This section is empty.
Variables ¶
var ( // ErrParseError is for when we cannot parse Openstack data correctly. ErrParseError = errors.New("unable to parse value") // ErrFlag is raised when options parsing fails. ErrFlag = errors.New("unable to parse flag") // ErrExpression is raised at runtime when expression evaluation fails. ErrExpression = errors.New("expression must contain exactly one sub match that yields a number string") )
var ( // ErrResourceNotFound is returned when a named resource cannot // be looked up (we have to do it ourselves) and it cannot be found. ErrResourceNotFound = errors.New("requested resource not found") )
Functions ¶
This section is empty.
Types ¶
type BlockStorageClient ¶
type BlockStorageClient struct {
// contains filtered or unexported fields
}
BlockStorageClient wraps the generic client because gophercloud is unsafe.
func NewBlockStorageClient ¶
func NewBlockStorageClient(provider Provider) (*BlockStorageClient, error)
NewBlockStorageClient provides a simple one-liner to start computing.
func (*BlockStorageClient) AvailabilityZones ¶
func (c *BlockStorageClient) AvailabilityZones(ctx context.Context) ([]availabilityzones.AvailabilityZone, error)
AvailabilityZones retrieves block storage availability zones.
type CloudsProvider ¶
type CloudsProvider struct {
// contains filtered or unexported fields
}
CloudsProvider cretes a client from clouds.yaml.
func NewCloudsProvider ¶
func NewCloudsProvider(cloud string) *CloudsProvider
NewTokenProvider returns a new initialized provider.
func (*CloudsProvider) Client ¶
func (p *CloudsProvider) Client() (*gophercloud.ProviderClient, error)
Client implements the Provider interface.
type ComputeClient ¶
type ComputeClient struct {
// contains filtered or unexported fields
}
ComputeClient wraps the generic client because gophercloud is unsafe.
func NewComputeClient ¶
func NewComputeClient(options *ComputeOptions, provider Provider) (*ComputeClient, error)
NewComputeClient provides a simple one-liner to start computing.
func (*ComputeClient) AvailabilityZones ¶
func (c *ComputeClient) AvailabilityZones(ctx context.Context) ([]availabilityzones.AvailabilityZone, error)
AvailabilityZones returns a list of availability zones.
func (*ComputeClient) CreateServerGroup ¶
func (c *ComputeClient) CreateServerGroup(ctx context.Context, name, policy string) (*servergroups.ServerGroup, error)
CreateServerGroup creates the named server group with the given policy and returns the result.
func (*ComputeClient) FlavorGPUs ¶
func (c *ComputeClient) FlavorGPUs(flavor *Flavor) (*GPUMeta, error)
FlavorGPUs returns metadata about GPUs, e.g. the number of GPUs. Sadly there is absolutely no way of assiging metadata to flavors without having to add those same values to your host aggregates, so we have to have knowledge of flavors built in somewhere.
func (*ComputeClient) Flavors ¶
func (c *ComputeClient) Flavors(ctx context.Context) ([]Flavor, error)
Flavors returns a list of flavors.
func (*ComputeClient) ListServerGroups ¶
func (c *ComputeClient) ListServerGroups(ctx context.Context) ([]servergroups.ServerGroup, error)
ListServerGroups returns all server groups in the project.
type ComputeOptions ¶
type ComputeOptions struct {
// contains filtered or unexported fields
}
ComputeOptions allows things like filtering to be configured.
func (*ComputeOptions) AddFlags ¶
func (o *ComputeOptions) AddFlags(f *pflag.FlagSet)
type CreateTokenOptions ¶
type CreateTokenOptions interface { // Options returns a valid set of authentication options. Options() *tokens.AuthOptions }
CreateTokenOptions abstracts away how schizophrenic Openstack is with its million options and million ways to fuck it up.
type CreateTokenOptionsScopedToken ¶
type CreateTokenOptionsScopedToken struct {
// contains filtered or unexported fields
}
CreateTokenOptionsScopedToken is typically used to upgrade from an unscoped password passed login to a project scoped one once you have determined a valid project.
func NewCreateTokenOptionsScopedToken ¶
func NewCreateTokenOptionsScopedToken(token, projectID string) *CreateTokenOptionsScopedToken
NewCreateTokenOptionsScopedToken returns a new instance of project scoped token options.
func (*CreateTokenOptionsScopedToken) Options ¶
func (o *CreateTokenOptionsScopedToken) Options() *tokens.AuthOptions
Options implements the CreateTokenOptions interface.
type CreateTokenOptionsUnscopedPassword ¶
type CreateTokenOptionsUnscopedPassword struct {
// contains filtered or unexported fields
}
CreateTokenOptionsUnscopedPassword is typically used when logging on to a UI when you don't know anything other than username/password.
func NewCreateTokenOptionsUnscopedPassword ¶
func NewCreateTokenOptionsUnscopedPassword(domain, username, password string) *CreateTokenOptionsUnscopedPassword
NewCreateTokenOptionsUnscopedPassword returns a new instance of unscoped username/password options.
func (*CreateTokenOptionsUnscopedPassword) Options ¶
func (o *CreateTokenOptionsUnscopedPassword) Options() *tokens.AuthOptions
Options implements the CreateTokenOptions interface.
type Flavor ¶
Flavor defines an extended set of flavor information not included by default in gophercloud.
func ExtractFlavors ¶
func ExtractFlavors(r pagination.Page) ([]Flavor, error)
ExtractFlavors takes raw JSON and decodes it into our custom flavour struct.
func (*Flavor) UnmarshalJSON ¶
UnmarshalJSON is required because "flavors.Flavor" already defines this, and it will undergo method promotion.
type GPUMeta ¶
type GPUMeta struct { // GPUs is the number of GPUs, this may be the total number // or physical GPUs, or a single virtual GPU. This value // is what will be reported for Kubernetes scheduling. GPUs int }
GPUMeta describes GPUs.
type IdentityClient ¶
type IdentityClient struct {
// contains filtered or unexported fields
}
IdentityClient wraps up gophercloud identity management.
func NewIdentityClient ¶
func NewIdentityClient(provider Provider) (*IdentityClient, error)
NewIdentityClient returns a new identity client.
func (*IdentityClient) CreateApplicationCredential ¶
func (c *IdentityClient) CreateApplicationCredential(ctx context.Context, userID, name, description string, roles []string) (*applicationcredentials.ApplicationCredential, error)
CreateApplicationCredential creates an application credential for the user.
func (*IdentityClient) CreateToken ¶
func (c *IdentityClient) CreateToken(ctx context.Context, options CreateTokenOptions) (*tokens.Token, *tokens.User, error)
CreateToken issues a new token.
func (*IdentityClient) DeleteApplicationCredential ¶
func (c *IdentityClient) DeleteApplicationCredential(ctx context.Context, userID, id string) error
DeleteApplicationCredential deletes an application credential for the user.
func (*IdentityClient) ListApplicationCredentials ¶
func (c *IdentityClient) ListApplicationCredentials(ctx context.Context, userID string) ([]applicationcredentials.ApplicationCredential, error)
ListApplicationCredentials lists application credentials for the scoped user.
func (*IdentityClient) ListAvailableProjects ¶
ListAvailableProjects lists projects that an authenticated (but unscoped) user can scope to.
type ImageClient ¶
type ImageClient struct {
// contains filtered or unexported fields
}
ImageClient wraps the generic client because gophercloud is unsafe.
func NewImageClient ¶
func NewImageClient(provider Provider) (*ImageClient, error)
NewImageClient provides a simple one-liner to start computing.
type NetworkClient ¶
type NetworkClient struct {
// contains filtered or unexported fields
}
NetworkClient wraps the generic client because gophercloud is unsafe.
func NewNetworkClient ¶
func NewNetworkClient(provider Provider) (*NetworkClient, error)
NewNetworkClient provides a simple one-liner to start networking.
func (*NetworkClient) ExternalNetworks ¶
ExternalNetworks returns a list of external networks.
type Provider ¶
type Provider interface { // Client returns a new provider client. Client() (*gophercloud.ProviderClient, error) }
Provider abstracts authentication methods.
type TokenProvider ¶
type TokenProvider struct {
// contains filtered or unexported fields
}
TokenProvider creates a client from an endpoint and token.
func NewTokenProvider ¶
func NewTokenProvider(endpoint, token string) *TokenProvider
NewTokenProvider returns a new initialized provider.
func (*TokenProvider) Client ¶
func (p *TokenProvider) Client() (*gophercloud.ProviderClient, error)
Client implements the Provider interface.
type UnauthenticatedProvider ¶
type UnauthenticatedProvider struct {
// contains filtered or unexported fields
}
UnauthenticatedProvider is used for token issue.
func NewUnauthenticatedProvider ¶
func NewUnauthenticatedProvider(endpoint string) *UnauthenticatedProvider
NewTokenProvider returns a new initialized provider.
func (*UnauthenticatedProvider) Client ¶
func (p *UnauthenticatedProvider) Client() (*gophercloud.ProviderClient, error)
Client implements the Provider interface.