openstack

package
v0.0.0-...-8f49458 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEndpointOpts = gophercloud.EndpointOpts{
		Region: os.Getenv("OS_REGION_NAME"),
	}
)

Functions

func GenAuthOpts

func GenAuthOpts(opts *Options) (gophercloud.AuthOptions, error)

func NewGlobalHelper

func NewGlobalHelper(opts ...Option) error

func ParseAuthFile

func ParseAuthFile(opts *Options)

Types

type Auth

type Auth struct {
	Source          string `json:"source" yaml:"source"`
	Type            string `json:"type" yaml:"type"`
	Url             string `json:"url" yaml:"url"`
	Username        string `json:"username" yaml:"username"`
	Password        string `json:"password" yaml:"password"`
	Token           string `json:"token" yaml:"token"`
	Project         `json:"project" yaml:"project"`
	EnableAutoRenew bool   `json:"enableAutoRenew" yaml:"enableAutoRenew"`
	File            string `json:"file" yaml:"file"`
}

type Domain

type Domain struct {
	ID   string `json:"id" yaml:"id"`
	Name string `json:"name" yaml:"name"`
}

type Helper

type Helper struct {
	Provider *gophercloud.ProviderClient

	Identity     *gophercloud.ServiceClient
	Compute      *gophercloud.ServiceClient
	Image        *gophercloud.ServiceClient
	Network      *gophercloud.ServiceClient
	Loadbalancer *gophercloud.ServiceClient
	Storage      *gophercloud.ServiceClient
	Share        *gophercloud.ServiceClient

	*Options
}

func GetGlobalHelper

func GetGlobalHelper() *Helper

func NewHelper

func NewHelper(opts ...Option) (*Helper, error)

func (*Helper) AddRole

func (h *Helper) AddRole(roleId string, opts roles.AssignOpts) error

func (*Helper) AttachNetworkToRouter

func (h *Helper) AttachNetworkToRouter(id string, opts routers.AddInterfaceOpts) (*routers.InterfaceInfo, error)

func (*Helper) CreateEc2Credential

func (h *Helper) CreateEc2Credential(userId, projectId, accessKey, secretKey string) (*credentials.Credential, error)

func (*Helper) CreateNetwork

func (h *Helper) CreateNetwork(opts networks.CreateOpts) (*networks.Network, error)

func (*Helper) CreateProject

func (h *Helper) CreateProject(name string) (*projects.Project, error)

func (*Helper) CreateRouter

func (h *Helper) CreateRouter(opts routers.CreateOpts) (*routers.Router, error)

func (*Helper) CreateSecurityGroup

func (h *Helper) CreateSecurityGroup(opts groups.CreateOpts) (*groups.SecGroup, error)

func (*Helper) CreateSecurityGroupRule

func (h *Helper) CreateSecurityGroupRule(opts rules.CreateOpts) (*rules.SecGroupRule, error)

func (*Helper) CreateShareNetwork

func (h *Helper) CreateShareNetwork(client *gophercloud.ServiceClient, opts sharenetworks.CreateOpts) (*sharenetworks.ShareNetwork, error)

func (*Helper) CreateSubnet

func (h *Helper) CreateSubnet(opts subnets.CreateOpts) (*subnets.Subnet, error)

func (*Helper) CreateUser

func (h *Helper) CreateUser(opts users.CreateOpts) (*users.User, error)

func (*Helper) DeleteSecurityGroupRule

func (h *Helper) DeleteSecurityGroupRule(id string) error

func (*Helper) GetHypervisorByHostname

func (h *Helper) GetHypervisorByHostname(hostname string) (*hypervisors.Hypervisor, error)

func (*Helper) GetHypervisorStatistics

func (h *Helper) GetHypervisorStatistics() (*hypervisors.Statistics, error)

func (*Helper) GetHypervisorUpTime

func (h *Helper) GetHypervisorUpTime(id string) (*hypervisors.Uptime, error)

func (*Helper) GetNetworkByName

func (h *Helper) GetNetworkByName(opts networks.ListOpts) (*networks.Network, error)

func (*Helper) GetPortByIp

func (h *Helper) GetPortByIp(ip string) (*ports.Port, error)

func (*Helper) GetProjectIdByName

func (h *Helper) GetProjectIdByName(name string) (string, error)

func (*Helper) GetRoleByName

func (h *Helper) GetRoleByName(name string) (*roles.Role, error)

func (*Helper) GetSecurityGroup

func (h *Helper) GetSecurityGroup(id string) (*groups.SecGroup, error)

func (*Helper) GetSecurityGroupByName

func (h *Helper) GetSecurityGroupByName(opts groups.ListOpts) (*groups.SecGroup, error)

func (*Helper) GetShareNetworkByName

func (h *Helper) GetShareNetworkByName(opts sharenetworks.ListOpts) (*sharenetworks.ShareNetwork, error)

func (*Helper) GetSubnetByName

func (h *Helper) GetSubnetByName(opts subnets.ListOpts) (*subnets.Subnet, error)

func (*Helper) GetUserByName

func (h *Helper) GetUserByName(name string) (*users.User, error)

func (*Helper) GetUserIdByName

func (h *Helper) GetUserIdByName(name string) (string, error)

func (*Helper) GetVolume

func (h *Helper) GetVolume(volumeId string) (*volumes.Volume, error)

func (*Helper) IsDomainExists

func (h *Helper) IsDomainExists(name string) (bool, error)

func (*Helper) IsFlavorExist

func (h *Helper) IsFlavorExist(name string) (bool, error)

func (*Helper) IsImageExist

func (h *Helper) IsImageExist(name string) (bool, error)

func (*Helper) IsProjectExists

func (h *Helper) IsProjectExists(name string) (bool, error)

func (*Helper) ListDomains

func (h *Helper) ListDomains(opts *domains.ListOpts) ([]domains.Domain, error)

func (*Helper) ListFloatingIPs

func (h *Helper) ListFloatingIPs(opts floatingips.ListOpts) ([]floatingips.FloatingIP, error)

func (*Helper) ListHypervisors

func (h *Helper) ListHypervisors(opts hypervisors.ListOpts) ([]hypervisors.Hypervisor, error)

func (*Helper) ListLoadBalancers

func (h *Helper) ListLoadBalancers(opts loadbalancers.ListOpts) ([]loadbalancers.LoadBalancer, error)

func (*Helper) ListNetworks

func (h *Helper) ListNetworks(opts networks.ListOpts) ([]networks.Network, error)

func (*Helper) ListProjects

func (h *Helper) ListProjects(opts *projects.ListOpts) ([]projects.Project, error)

func (*Helper) ListSecurityGroups

func (h *Helper) ListSecurityGroups(opts groups.ListOpts) ([]groups.SecGroup, error)

func (*Helper) ListServers

func (h *Helper) ListServers(opts servers.ListOpts) ([]servers.Server, error)

func (*Helper) ListShares

func (h *Helper) ListShares(opts shares.ListOpts) ([]shares.Share, error)

func (*Helper) ListUsers

func (h *Helper) ListUsers(opts *users.ListOpts) ([]users.User, error)

func (*Helper) ListVolumes

func (h *Helper) ListVolumes(opts volumes.ListOpts) ([]volumes.Volume, error)

func (*Helper) UpdateComputeQuotas

func (h *Helper) UpdateComputeQuotas(projectId string, opts quotasets.UpdateOpts) error

func (*Helper) UpdateNetworkQuotas

func (h *Helper) UpdateNetworkQuotas(projectId string, opts quotas.UpdateOpts) error

func (*Helper) UpdateStorageQuotas

func (h *Helper) UpdateStorageQuotas(projectId string, opts quotasets.UpdateOpts) error

func (*Helper) ValidToken

func (h *Helper) ValidToken(token string) error

type Option

type Option func(*Options)

func AuthFile

func AuthFile(authFile string) Option

func AuthSource

func AuthSource(authSource string) Option

func AuthType

func AuthType(authType string) Option

func AuthUrl

func AuthUrl(AuthUrl string) Option

func ConfFile

func ConfFile(confFile string) Option

func DomainID

func DomainID(domainID string) Option

func DomainName

func DomainName(domainName string) Option

func EnableAutoRenew

func EnableAutoRenew(enableAutoRenew bool) Option

func IdentityAPIVersion

func IdentityAPIVersion(identityAPIVersion string) Option

func ImageAPIVersion

func ImageAPIVersion(imageAPIVersion string) Option

func Passcode

func Passcode(passcode string) Option

func Password

func Password(password string) Option

func ProjectDomainName

func ProjectDomainName(projectDomainName string) Option

func ProjectName

func ProjectName(projectName string) Option

func Scope

func Scope(scope *gophercloud.AuthScope) Option

func TenantID

func TenantID(tenantID string) Option

func TenantName

func TenantName(tenantName string) Option

func UserDomainName

func UserDomainName(userDomainName string) Option

func UserID

func UserID(userID string) Option

func Username

func Username(username string) Option

type Options

type Options struct {
	ConfFile         string `json:"confFile" yaml:"confFile"`
	IdentityEndpoint string `json:"identityEndpoint" yaml:"identityEndpoint"`
	Auth             `json:"auth" yaml:"auth"`

	Domain  `json:"domain" yaml:"domain"`
	Tenant  `json:"tenant" yaml:"tenant"`
	Project `json:"project" yaml:"project"`
	User    `json:"user" yaml:"user"`

	Password string `json:"password" yaml:"password"`
	Passcode string `json:"passcode" yaml:"passcode"`

	IdentityAPIVersion string `json:"identityAPIVersion" yaml:"identityAPIVersion"`
	ImageAPIVersion    string `json:"imageAPIVersion" yaml:"imageAPIVersion"`

	Scope *gophercloud.AuthScope `json:"scope" yaml:"scope"`
}
var (
	Opts *Options
)

func NewConf

func NewConf() (*Options, error)

type Project

type Project struct {
	ID     string `json:"id" yaml:"id"`
	Name   string `json:"name" yaml:"name"`
	Domain `json:"domain" yaml:"domain"`
}

type Tenant

type Tenant struct {
	ID     string `json:"id" yaml:"id"`
	Name   string `json:"name" yaml:"name"`
	Domain `json:"domain" yaml:"domain"`
}

type User

type User struct {
	ID     string `json:"id" yaml:"id"`
	Name   string `json:"name" yaml:"name"`
	Domain `json:"domain" yaml:"domain"`
}

Jump to

Keyboard shortcuts

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