Documentation
¶
Index ¶
- Constants
- Variables
- func ImageSchema() (*jsonschema.Schema, error)
- func ImageSchemaValid(image *images.Image, schema *jsonschema.Schema) bool
- func ImageSignatureValid(image *images.Image, signingKeyRaw []byte) bool
- type ApplicationCredentialProvider
- type BlockStorageClient
- type ComputeClient
- func (c *ComputeClient) CreateKeypair(ctx context.Context, name, publicKey string) error
- func (c *ComputeClient) CreateRemoteConsole(ctx context.Context, id string) (*remoteconsoles.RemoteConsole, error)
- func (c *ComputeClient) CreateServer(ctx context.Context, server *unikornv1.Server, keyName string, ...) (*servers.Server, error)
- func (c *ComputeClient) CreateServerGroup(ctx context.Context, name string) (*servergroups.ServerGroup, error)
- func (c *ComputeClient) DeleteKeypair(ctx context.Context, name string) error
- func (c *ComputeClient) DeleteServer(ctx context.Context, id string) error
- func (c *ComputeClient) DeleteServerGroup(ctx context.Context, id string) error
- func (c *ComputeClient) GetFlavors(ctx context.Context) ([]flavors.Flavor, error)
- func (c *ComputeClient) GetServer(ctx context.Context, server *unikornv1.Server) (*servers.Server, error)
- func (c *ComputeClient) RebootServer(ctx context.Context, id string, hard bool) error
- func (c *ComputeClient) ShowConsoleOutput(ctx context.Context, id string, length *int) (string, error)
- func (c *ComputeClient) StartServer(ctx context.Context, id string) error
- func (c *ComputeClient) StopServer(ctx context.Context, id string) error
- func (c *ComputeClient) UpdateQuotas(ctx context.Context, projectID string) error
- type ComputeInterface
- type ComputeQuotaInterface
- type CreateTokenOptions
- type CreateTokenOptionsScopedToken
- type CreateTokenOptionsUnscopedPassword
- type CredentialProvider
- type DomainScopedPasswordProvider
- type ExternalNetworkInterfsce
- type FlavorInterface
- type FloatingIPInterface
- type IdentityClient
- func (c *IdentityClient) CreateApplicationCredential(ctx context.Context, userID, name, description string, roles []string) (*applicationcredentials.ApplicationCredential, error)
- func (c *IdentityClient) CreateProject(ctx context.Context, domainID, name string, tags []string) (*projects.Project, error)
- func (c *IdentityClient) CreateRoleAssignment(ctx context.Context, userID, projectID, roleID string) error
- func (c *IdentityClient) CreateToken(ctx context.Context, options CreateTokenOptions) (*tokens.Token, *tokens.User, error)
- func (c *IdentityClient) CreateUser(ctx context.Context, domainID, name, password string) (*users.User, error)
- func (c *IdentityClient) DeleteApplicationCredential(ctx context.Context, userID, id string) error
- func (c *IdentityClient) DeleteProject(ctx context.Context, projectID string) error
- func (c *IdentityClient) DeleteUser(ctx context.Context, userID string) error
- func (c *IdentityClient) ListApplicationCredentials(ctx context.Context, userID string) ([]applicationcredentials.ApplicationCredential, error)
- func (c *IdentityClient) ListAvailableProjects(ctx context.Context) ([]projects.Project, error)
- func (c *IdentityClient) ListRoles(ctx context.Context) ([]roles.Role, error)
- type ImageClient
- type KeypairInterface
- type NetworkClient
- func (c *NetworkClient) AddRouterInterface(ctx context.Context, routerID, subnetID string) error
- func (c *NetworkClient) CreateFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
- func (c *NetworkClient) CreateNetwork(ctx context.Context, network *unikornv1.Network, vlanID *int) (*NetworkExt, error)
- func (c *NetworkClient) CreateRouter(ctx context.Context, network *unikornv1.Network) (*routers.Router, error)
- func (c *NetworkClient) CreateSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
- func (c *NetworkClient) CreateSecurityGroupRule(ctx context.Context, securityGroupID string, direction rules.RuleDirection, ...) (*rules.SecGroupRule, error)
- func (c *NetworkClient) CreateServerPort(ctx context.Context, server *unikornv1.Server, networkID string, ...) (*ports.Port, error)
- func (c *NetworkClient) CreateSubnet(ctx context.Context, network *unikornv1.Network, ...) (*subnets.Subnet, error)
- func (c *NetworkClient) DeleteFloatingIP(ctx context.Context, id string) error
- func (c *NetworkClient) DeleteNetwork(ctx context.Context, id string) error
- func (c *NetworkClient) DeletePort(ctx context.Context, portID string) error
- func (c *NetworkClient) DeleteRouter(ctx context.Context, id string) error
- func (c *NetworkClient) DeleteSecurityGroup(ctx context.Context, securityGroupID string) error
- func (c *NetworkClient) DeleteSecurityGroupRule(ctx context.Context, securityGroupID, ruleID string) error
- func (c *NetworkClient) DeleteSubnet(ctx context.Context, id string) error
- func (c *NetworkClient) ExternalNetworks(ctx context.Context) ([]networks.Network, error)
- func (c *NetworkClient) GetFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
- func (c *NetworkClient) GetNetwork(ctx context.Context, network *unikornv1.Network) (*NetworkExt, error)
- func (c *NetworkClient) GetRouter(ctx context.Context, network *unikornv1.Network) (*routers.Router, error)
- func (c *NetworkClient) GetSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
- func (c *NetworkClient) GetServerPort(ctx context.Context, server *unikornv1.Server) (*ports.Port, error)
- func (c *NetworkClient) GetSubnet(ctx context.Context, network *unikornv1.Network) (*subnets.Subnet, error)
- func (c *NetworkClient) ListRouterPorts(ctx context.Context, routerID string) ([]ports.Port, error)
- func (c *NetworkClient) ListSecurityGroupRules(ctx context.Context, securityGroupID string) ([]rules.SecGroupRule, error)
- func (c *NetworkClient) ListServerPorts(ctx context.Context, serverID string) ([]ports.Port, error)
- func (c *NetworkClient) RemoveRouterInterface(ctx context.Context, routerID, subnetID string) error
- func (c *NetworkClient) UpdatePort(ctx context.Context, portID string, securityGroupIDs []string, ...) (*ports.Port, error)
- type NetworkExt
- type NetworkInterface
- type NetworkingInterface
- type PasswordProvider
- type PortInterface
- type Provider
- func (p *Provider) CreateConsoleSession(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) (string, error)
- func (p *Provider) CreateIdentity(ctx context.Context, identity *unikornv1.Identity) error
- func (p *Provider) CreateNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
- func (p *Provider) CreateSecurityGroup(ctx context.Context, identity *unikornv1.Identity, ...) error
- func (p *Provider) CreateServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
- func (p *Provider) DeleteIdentity(ctx context.Context, identity *unikornv1.Identity) error
- func (p *Provider) DeleteNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
- func (p *Provider) DeleteSecurityGroup(ctx context.Context, identity *unikornv1.Identity, ...) error
- func (p *Provider) DeleteServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
- func (p *Provider) Flavors(ctx context.Context) (types.FlavorList, error)
- func (p *Provider) GetConsoleOutput(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server, ...) (string, error)
- func (p *Provider) GetImage(ctx context.Context, organizationID, imageID string) (*types.Image, error)
- func (p *Provider) GetOpenstackIdentity(ctx context.Context, identity *unikornv1.Identity) (*unikornv1.OpenstackIdentity, error)
- func (p *Provider) GetOrCreateOpenstackIdentity(ctx context.Context, identity *unikornv1.Identity) (*unikornv1.OpenstackIdentity, bool, error)
- func (p *Provider) ListExternalNetworks(ctx context.Context) (types.ExternalNetworks, error)
- func (p *Provider) ListImages(ctx context.Context, organizationID string) (types.ImageList, error)
- func (p *Provider) RebootServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server, ...) error
- func (p *Provider) Region(ctx context.Context) (*unikornv1.Region, error)
- func (p *Provider) StartServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
- func (p *Provider) StopServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
- func (p *Provider) UpdateServerState(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
- type RouterInterface
- type SecurityGroupInterface
- type ServerGroupInterface
- type ServerInterface
- type SubnetInterface
- type TokenProvider
- type UnauthenticatedProvider
Constants ¶
const ( // Projects are randomly named to avoid clashes, so we need to add some tags // in order to be able to reason about who they really belong to. It is also // useful to have these in place so we can spot orphaned resources and garbage // collect them. OrganizationTag = "organization" ProjectTag = "project" )
Variables ¶
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") // ErrResourceDependency is returned when a resource is in unexpected // state or condition. ErrResourceDependency = errors.New("resource dependency error") )
var ( // ErrPEMDecode is raised when the PEM decode failed for some reason. ErrPEMDecode = errors.New("PEM decode error") // ErrPEMType is raised when the encounter the wrong PEM type, e.g. PKCS#1. ErrPEMType = errors.New("PEM type unsupported") // ErrKeyType is raised when we encounter an unsupported key type. ErrKeyType = errors.New("key type unsupported") )
var ( ErrConflict = errors.New("resource conflict error") ErrKeyUndefined = errors.New("a required key was not defined") )
var (
ErrNotFound = goerrors.New("resource not found")
)
Functions ¶
func ImageSchema ¶ added in v0.1.53
func ImageSchema() (*jsonschema.Schema, error)
func ImageSchemaValid ¶ added in v0.1.53
func ImageSchemaValid(image *images.Image, schema *jsonschema.Schema) bool
Types ¶
type ApplicationCredentialProvider ¶
type ApplicationCredentialProvider struct {
// contains filtered or unexported fields
}
ApplicationCredentialProvider allows use of an application credential.
func NewApplicationCredentialProvider ¶
func NewApplicationCredentialProvider(endpoint, id, secret string) *ApplicationCredentialProvider
NewApplicationCredentialProvider creates a client that comsumes application credentials for authentication.
func (*ApplicationCredentialProvider) Client ¶
func (p *ApplicationCredentialProvider) Client(ctx context.Context) (*gophercloud.ProviderClient, error)
Client implements the Provider interface.
type BlockStorageClient ¶
type BlockStorageClient struct {
// contains filtered or unexported fields
}
BlockStorageClient wraps the generic client because gophercloud is unsafe.
func NewBlockStorageClient ¶
func NewBlockStorageClient(ctx context.Context, provider CredentialProvider) (*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.
func (*BlockStorageClient) UpdateQuotas ¶ added in v0.1.42
func (c *BlockStorageClient) UpdateQuotas(ctx context.Context, projectID string) error
type ComputeClient ¶
type ComputeClient struct {
// contains filtered or unexported fields
}
ComputeClient wraps the generic client because gophercloud is unsafe.
func NewComputeClient ¶
func NewComputeClient(ctx context.Context, provider CredentialProvider, options *unikornv1.RegionOpenstackComputeSpec) (*ComputeClient, error)
NewComputeClient provides a simple one-liner to start computing.
func (*ComputeClient) CreateKeypair ¶ added in v0.1.37
func (c *ComputeClient) CreateKeypair(ctx context.Context, name, publicKey string) error
CreateKeypair creates a new keypair. NOTE: while OpenStack can generate one for us, we have far more control doing it ourselves thus allowing us to impose stricter security, and it's more provider agnostic that way.
func (*ComputeClient) CreateRemoteConsole ¶ added in v1.8.0
func (c *ComputeClient) CreateRemoteConsole(ctx context.Context, id string) (*remoteconsoles.RemoteConsole, error)
func (*ComputeClient) CreateServer ¶ added in v0.1.46
func (*ComputeClient) CreateServerGroup ¶
func (c *ComputeClient) CreateServerGroup(ctx context.Context, name string) (*servergroups.ServerGroup, error)
CreateServerGroup creates the named server group with the given policy and returns the result.
func (*ComputeClient) DeleteKeypair ¶ added in v0.1.37
func (c *ComputeClient) DeleteKeypair(ctx context.Context, name string) error
func (*ComputeClient) DeleteServer ¶ added in v0.1.46
func (c *ComputeClient) DeleteServer(ctx context.Context, id string) error
func (*ComputeClient) DeleteServerGroup ¶ added in v0.1.30
func (c *ComputeClient) DeleteServerGroup(ctx context.Context, id string) error
DeleteServerGroup removes a server group, this exists because nova does do any cleanup on project deletion and just orphans the resource.
func (*ComputeClient) GetFlavors ¶ added in v1.10.0
Flavors returns a list of flavors.
func (*ComputeClient) RebootServer ¶ added in v1.7.0
func (*ComputeClient) ShowConsoleOutput ¶ added in v1.8.0
func (*ComputeClient) StartServer ¶ added in v1.7.0
func (c *ComputeClient) StartServer(ctx context.Context, id string) error
func (*ComputeClient) StopServer ¶ added in v1.7.0
func (c *ComputeClient) StopServer(ctx context.Context, id string) error
func (*ComputeClient) UpdateQuotas ¶ added in v0.1.39
func (c *ComputeClient) UpdateQuotas(ctx context.Context, projectID string) error
type ComputeInterface ¶ added in v1.10.0
type ComputeInterface interface {
KeypairInterface
FlavorInterface
ServerGroupInterface
ComputeQuotaInterface
ServerInterface
}
type ComputeQuotaInterface ¶ added in v1.10.0
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 CredentialProvider ¶
type CredentialProvider interface {
// Client returns a new provider client.
Client(ctx context.Context) (*gophercloud.ProviderClient, error)
}
CredentialProvider abstracts authentication methods.
type DomainScopedPasswordProvider ¶
type DomainScopedPasswordProvider struct {
// contains filtered or unexported fields
}
DomainScopedPasswordProvider allows use of an application credential.
func NewDomainScopedPasswordProvider ¶
func NewDomainScopedPasswordProvider(endpoint, userID, password, domainID string) *DomainScopedPasswordProvider
NewDomainScopedPasswordProvider creates a client that consumes passwords for authentication.
func (*DomainScopedPasswordProvider) Client ¶
func (p *DomainScopedPasswordProvider) Client(ctx context.Context) (*gophercloud.ProviderClient, error)
Client implements the Provider interface.
type ExternalNetworkInterfsce ¶ added in v1.10.0
type FlavorInterface ¶ added in v1.10.0
type FloatingIPInterface ¶ added in v1.10.0
type FloatingIPInterface interface {
GetFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
CreateFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
DeleteFloatingIP(ctx context.Context, id string) error
}
type IdentityClient ¶
type IdentityClient struct {
// contains filtered or unexported fields
}
IdentityClient wraps up gophercloud identity management.
func NewIdentityClient ¶
func NewIdentityClient(ctx context.Context, provider CredentialProvider) (*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) CreateProject ¶
func (c *IdentityClient) CreateProject(ctx context.Context, domainID, name string, tags []string) (*projects.Project, error)
CreateProject creates the named project.
func (*IdentityClient) CreateRoleAssignment ¶
func (c *IdentityClient) CreateRoleAssignment(ctx context.Context, userID, projectID, roleID string) error
CreateRoleAssignment creates a role between a user and a project.
func (*IdentityClient) CreateToken ¶
func (c *IdentityClient) CreateToken(ctx context.Context, options CreateTokenOptions) (*tokens.Token, *tokens.User, error)
CreateToken issues a new token.
func (*IdentityClient) CreateUser ¶
func (c *IdentityClient) CreateUser(ctx context.Context, domainID, name, password string) (*users.User, error)
CreateUser creates a new user.
func (*IdentityClient) DeleteApplicationCredential ¶
func (c *IdentityClient) DeleteApplicationCredential(ctx context.Context, userID, id string) error
DeleteApplicationCredential deletes an application credential for the user.
func (*IdentityClient) DeleteProject ¶
func (c *IdentityClient) DeleteProject(ctx context.Context, projectID string) error
func (*IdentityClient) DeleteUser ¶
func (c *IdentityClient) DeleteUser(ctx context.Context, userID string) error
DeleteUser removes an existing 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(ctx context.Context, provider CredentialProvider, options *unikornv1.RegionOpenstackImageSpec) (*ImageClient, error)
NewImageClient provides a simple one-liner to start computing.
func (*ImageClient) ListImages ¶ added in v1.7.0
ListImages returns a list of images.
type KeypairInterface ¶ added in v1.10.0
type NetworkClient ¶
type NetworkClient struct {
// contains filtered or unexported fields
}
NetworkClient wraps the generic client because gophercloud is unsafe.
func NewNetworkClient ¶
func NewNetworkClient(ctx context.Context, provider CredentialProvider, options *unikornv1.RegionOpenstackNetworkSpec) (*NetworkClient, error)
NewNetworkClient provides a simple one-liner to start networking.
func NewTestNetworkClient ¶ added in v0.1.18
func NewTestNetworkClient(options *unikornv1.RegionOpenstackNetworkSpec) *NetworkClient
func (*NetworkClient) AddRouterInterface ¶ added in v0.1.34
func (c *NetworkClient) AddRouterInterface(ctx context.Context, routerID, subnetID string) error
func (*NetworkClient) CreateFloatingIP ¶ added in v0.1.46
func (c *NetworkClient) CreateFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
CreateFloatingIP creates a floating IP.
func (*NetworkClient) CreateNetwork ¶ added in v0.1.46
func (c *NetworkClient) CreateNetwork(ctx context.Context, network *unikornv1.Network, vlanID *int) (*NetworkExt, error)
CreateNetwork creates a virtual or VLAN provider network for a project. This requires https://github.com/unikorn-cloud/python-unikorn-openstack-policy to be installed, see the README for further details on how this has to work.
func (*NetworkClient) CreateRouter ¶ added in v0.1.34
func (*NetworkClient) CreateSecurityGroup ¶ added in v0.1.45
func (c *NetworkClient) CreateSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
CreateSecurityGroup creates a new security group.
func (*NetworkClient) CreateSecurityGroupRule ¶ added in v0.1.45
func (c *NetworkClient) CreateSecurityGroupRule(ctx context.Context, securityGroupID string, direction rules.RuleDirection, protocol rules.RuleProtocol, portStart, portEnd int, prefix string) (*rules.SecGroupRule, error)
CreateSecurityGroupRule adds a security group rule to a security group.
func (*NetworkClient) CreateServerPort ¶ added in v1.10.0
func (*NetworkClient) CreateSubnet ¶ added in v0.1.34
func (*NetworkClient) DeleteFloatingIP ¶ added in v0.1.46
func (c *NetworkClient) DeleteFloatingIP(ctx context.Context, id string) error
DeleteFloatingIP deletes a floating IP.
func (*NetworkClient) DeleteNetwork ¶ added in v0.1.46
func (c *NetworkClient) DeleteNetwork(ctx context.Context, id string) error
func (*NetworkClient) DeletePort ¶ added in v0.1.50
func (c *NetworkClient) DeletePort(ctx context.Context, portID string) error
func (*NetworkClient) DeleteRouter ¶ added in v0.1.34
func (c *NetworkClient) DeleteRouter(ctx context.Context, id string) error
func (*NetworkClient) DeleteSecurityGroup ¶ added in v0.1.45
func (c *NetworkClient) DeleteSecurityGroup(ctx context.Context, securityGroupID string) error
DeleteSecurityGroup deletes a security group.
func (*NetworkClient) DeleteSecurityGroupRule ¶ added in v0.1.45
func (c *NetworkClient) DeleteSecurityGroupRule(ctx context.Context, securityGroupID, ruleID string) error
DeleteSecurityGroupRule deletes a security group rule from a security group.
func (*NetworkClient) DeleteSubnet ¶ added in v0.1.34
func (c *NetworkClient) DeleteSubnet(ctx context.Context, id string) error
func (*NetworkClient) ExternalNetworks ¶
ExternalNetworks returns a list of external networks.
func (*NetworkClient) GetFloatingIP ¶ added in v1.10.0
func (c *NetworkClient) GetFloatingIP(ctx context.Context, portID string) (*floatingips.FloatingIP, error)
func (*NetworkClient) GetNetwork ¶ added in v1.10.0
func (c *NetworkClient) GetNetwork(ctx context.Context, network *unikornv1.Network) (*NetworkExt, error)
func (*NetworkClient) GetSecurityGroup ¶ added in v1.10.0
func (c *NetworkClient) GetSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
func (*NetworkClient) GetServerPort ¶ added in v1.10.0
func (*NetworkClient) ListRouterPorts ¶ added in v1.10.0
func (*NetworkClient) ListSecurityGroupRules ¶ added in v1.8.0
func (c *NetworkClient) ListSecurityGroupRules(ctx context.Context, securityGroupID string) ([]rules.SecGroupRule, error)
ListSecurityGroupRules does exactly that.
func (*NetworkClient) ListServerPorts ¶ added in v0.1.46
ListServerPorts returns a list of ports for a server.
func (*NetworkClient) RemoveRouterInterface ¶ added in v0.1.34
func (c *NetworkClient) RemoveRouterInterface(ctx context.Context, routerID, subnetID string) error
func (*NetworkClient) UpdatePort ¶ added in v1.2.0
func (c *NetworkClient) UpdatePort(ctx context.Context, portID string, securityGroupIDs []string, allowedAddressPairs []ports.AddressPair) (*ports.Port, error)
type NetworkExt ¶ added in v1.10.0
type NetworkExt struct {
networks.Network
provider.NetworkProviderExt
}
type NetworkInterface ¶ added in v1.10.0
type NetworkingInterface ¶ added in v1.10.0
type NetworkingInterface interface {
ExternalNetworkInterfsce
NetworkInterface
SubnetInterface
RouterInterface
SecurityGroupInterface
FloatingIPInterface
PortInterface
}
type PasswordProvider ¶
type PasswordProvider struct {
// contains filtered or unexported fields
}
PasswordProvider allows use of an application credential.
func NewPasswordProvider ¶
func NewPasswordProvider(endpoint, userID, password, projectID string) *PasswordProvider
NewPasswordProvider creates a client that comsumes passwords for authentication.
func (*PasswordProvider) Client ¶
func (p *PasswordProvider) Client(ctx context.Context) (*gophercloud.ProviderClient, error)
Client implements the Provider interface.
type PortInterface ¶ added in v1.10.0
type PortInterface interface {
ListServerPorts(ctx context.Context, serverID string) ([]ports.Port, error)
ListRouterPorts(ctx context.Context, routerID string) ([]ports.Port, error)
GetServerPort(ctx context.Context, server *unikornv1.Server) (*ports.Port, error)
CreateServerPort(ctx context.Context, server *unikornv1.Server, networkID string, securityGroupIDs []string, allowedAddressPairs []ports.AddressPair) (*ports.Port, error)
UpdatePort(ctx context.Context, portID string, securityGroupIDs []string, allowedAddressPairs []ports.AddressPair) (*ports.Port, error)
DeletePort(ctx context.Context, portID string) error
}
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) CreateConsoleSession ¶ added in v1.8.0
func (*Provider) CreateIdentity ¶ added in v0.1.2
CreateIdentity creates a new identity for cloud infrastructure.
func (*Provider) CreateNetwork ¶ added in v0.1.46
func (p *Provider) CreateNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
CreateNetwork creates a physical network for an identity.
func (*Provider) CreateSecurityGroup ¶ added in v0.1.45
func (p *Provider) CreateSecurityGroup(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup) error
CreateSecurityGroup creates a new security group.
func (*Provider) CreateServer ¶ added in v0.1.46
func (p *Provider) CreateServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
CreateServer creates or updates a server.
func (*Provider) DeleteIdentity ¶ added in v0.1.4
DeleteIdentity cleans up an identity for cloud infrastructure.
func (*Provider) DeleteNetwork ¶ added in v0.1.46
func (p *Provider) DeleteNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
DeleteNetwork deletes a physical network.
func (*Provider) DeleteSecurityGroup ¶ added in v0.1.45
func (p *Provider) DeleteSecurityGroup(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup) error
DeleteSecurityGroup deletes a security group.
func (*Provider) DeleteServer ¶ added in v0.1.46
func (*Provider) GetConsoleOutput ¶ added in v1.8.0
func (*Provider) GetImage ¶ added in v1.7.0
func (p *Provider) GetImage(ctx context.Context, organizationID, imageID string) (*types.Image, error)
GetImage retrieves a specific image by its ID.
func (*Provider) GetOpenstackIdentity ¶ added in v0.1.33
func (*Provider) GetOrCreateOpenstackIdentity ¶ added in v0.1.33
func (*Provider) ListExternalNetworks ¶ added in v0.1.3
ListExternalNetworks returns a list of external networks if the platform supports such a concept.
func (*Provider) ListImages ¶ added in v1.7.0
ListImages lists all available images.
func (*Provider) RebootServer ¶ added in v1.7.0
func (*Provider) StartServer ¶ added in v1.7.0
func (*Provider) StopServer ¶ added in v1.7.0
type RouterInterface ¶ added in v1.10.0
type RouterInterface interface {
GetRouter(ctx context.Context, network *unikornv1.Network) (*routers.Router, error)
CreateRouter(ctx context.Context, network *unikornv1.Network) (*routers.Router, error)
DeleteRouter(ctx context.Context, id string) error
AddRouterInterface(ctx context.Context, routerID, subnetID string) error
RemoveRouterInterface(ctx context.Context, routerID, subnetID string) error
}
type SecurityGroupInterface ¶ added in v1.10.0
type SecurityGroupInterface interface {
GetSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
CreateSecurityGroup(ctx context.Context, securityGroup *unikornv1.SecurityGroup) (*groups.SecGroup, error)
DeleteSecurityGroup(ctx context.Context, securityGroupID string) error
ListSecurityGroupRules(ctx context.Context, securityGroupID string) ([]rules.SecGroupRule, error)
CreateSecurityGroupRule(ctx context.Context, securityGroupID string, direction rules.RuleDirection, protocol rules.RuleProtocol, portStart, portEnd int, prefix string) (*rules.SecGroupRule, error)
DeleteSecurityGroupRule(ctx context.Context, securityGroupID, ruleID string) error
}
type ServerGroupInterface ¶ added in v1.10.0
type ServerGroupInterface interface {
CreateServerGroup(ctx context.Context, name string) (*servergroups.ServerGroup, error)
DeleteServerGroup(ctx context.Context, id string) error
}
type ServerInterface ¶ added in v1.10.0
type ServerInterface interface {
GetServer(ctx context.Context, server *unikornv1.Server) (*servers.Server, error)
CreateServer(ctx context.Context, server *unikornv1.Server, keyName string, networks []servers.Network, serverGroupID *string, metadata map[string]string) (*servers.Server, error)
DeleteServer(ctx context.Context, id string) error
RebootServer(ctx context.Context, id string, hard bool) error
StartServer(ctx context.Context, id string) error
StopServer(ctx context.Context, id string) error
CreateRemoteConsole(ctx context.Context, id string) (*remoteconsoles.RemoteConsole, error)
ShowConsoleOutput(ctx context.Context, id string, length *int) (string, error)
}
type SubnetInterface ¶ added in v1.10.0
type SubnetInterface interface {
GetSubnet(ctx context.Context, network *unikornv1.Network) (*subnets.Subnet, error)
CreateSubnet(ctx context.Context, network *unikornv1.Network, networkID string, prefix, gatewayID string, dnsNameservers []string, allocationPools []subnets.AllocationPool) (*subnets.Subnet, error)
DeleteSubnet(ctx context.Context, id string) error
}
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(ctx context.Context) (*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(ctx context.Context) (*gophercloud.ProviderClient, error)
Client implements the Provider interface.