driver

package
v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	NetworkEndpointType = "network"
	ComputeEndpointType = "compute"
)
View Source
const LogicalPortDefaultVnicType = "normal"
View Source
const MaxReqForAttach int = 5

Variables

This section is empty.

Functions

func NormalizeURL

func NormalizeURL(url string) string

Types

type AuthClient

type AuthClient struct {
	AuthConfig
}

func AuthCheck

func AuthCheck(config *OpenStackConf) (*AuthClient, error)

type AuthConfig

type AuthConfig struct {
	// IdentityEndpoint specifies the HTTP endpoint that is required to work with
	// the Identity API of the appropriate version. While it's ultimately needed by
	// all of the identity services, it will often be populated by a provider-level
	// function.
	IdentityEndpoint string

	// Username is required if using Identity V2 API. Consult with your provider's
	// control panel to discover your account's username. In Identity V3, either
	// UserID or a combination of Username and DomainID or DomainName are needed.
	Username, UserID string

	// Exactly one of Password or APIKey is required for the Identity V2 and V3
	// APIs. Consult with your provider's control panel to discover your account's
	// preferred method of authentication.
	Password, APIKey string

	// At most one of DomainID and DomainName must be provided if using Username
	// with Identity V3. Otherwise, either are optional.
	DomainID, DomainName string

	// The TenantID and TenantName fields are optional for the Identity V2 API.
	// Some providers allow you to specify a TenantName instead of the TenantId.
	// Some require both. Your provider's authentication policies will determine
	// how these fields influence authentication.
	TenantID, TenantName string

	// AllowReauth should be set to true if you grant permission for Gophercloud to
	// cache your credentials in memory, and to allow Gophercloud to attempt to
	// re-authenticate automatically if/when your token expires.  If you set it to
	// false, it will not cache these settings, but re-authentication will not be
	// possible.  This setting defaults to false.
	AllowReauth bool

	// ReauthFunc is the function used to re-authenticate the user if the request
	// fails with a 401 HTTP response code. This a needed because there may be multiple
	// authentication functions for different Identity service versions.
	ReauthFunc func() error

	// TokenID allows users to authenticate (possibly as another user) with an
	// authentication token ID.
	TokenID string

	NetworkEndpoint string

	ComputeEndpoint string
	// contains filtered or unexported fields
}

type Ip

type Ip struct {
	SubnetId  string `json:"subnet_id"`
	IpAddress string `json:"ip_address,omitempty"`
}

type NeutronBulkPortsResp

type NeutronBulkPortsResp struct {
	Ports []*NeutronPort `json:"ports"`
}

type NeutronClient

type NeutronClient struct {
}

func (*NeutronClient) AttachNetToRouter

func (self *NeutronClient) AttachNetToRouter(routerId, subNetId string) (string, error)

func (*NeutronClient) CreateBulkPorts

func (self *NeutronClient) CreateBulkPorts(req *mgriaas.MgrBulkPortsReq) ([]*Interface, error)

func (*NeutronClient) CreateNetwork

func (self *NeutronClient) CreateNetwork(name string) (string, error)

func (*NeutronClient) CreatePort

func (self *NeutronClient) CreatePort(networkId, subnetId, portName, ip, mac, vnicType string) (*Interface, error)

func (*NeutronClient) CreateProviderNetwork

func (self *NeutronClient) CreateProviderNetwork(name, nwType, phyNet, sId string) (string, error)

func (*NeutronClient) CreateRouter

func (self *NeutronClient) CreateRouter(name, extNetId string) (string, error)

func (*NeutronClient) CreateSubnet

func (self *NeutronClient) CreateSubnet(id, cidr, gw string, allocationPools []subnets.AllocationPool) (string, error)

func (*NeutronClient) DeleteNetwork

func (self *NeutronClient) DeleteNetwork(id string) error

func (*NeutronClient) DeletePort

func (self *NeutronClient) DeletePort(id string) error

func (*NeutronClient) DeleteRouter

func (self *NeutronClient) DeleteRouter(id string) error

func (*NeutronClient) DeleteSubnet

func (self *NeutronClient) DeleteSubnet(id string) error

func (*NeutronClient) DetachNetFromRouter

func (self *NeutronClient) DetachNetFromRouter(routerId, subNetId string) (string, error)

func (*NeutronClient) GetNetwork

func (self *NeutronClient) GetNetwork(id string) (*Network, error)

func (*NeutronClient) GetNetworkExtenAttrs

func (self *NeutronClient) GetNetworkExtenAttrs(id string) (*NetworkExtenAttrs, error)

func (*NeutronClient) GetNetworkID

func (self *NeutronClient) GetNetworkID(networkName string) (string, error)

func (*NeutronClient) GetPort

func (self *NeutronClient) GetPort(id string) (*Interface, error)

func (*NeutronClient) GetRouter

func (self *NeutronClient) GetRouter(id string) (*Router, error)

func (*NeutronClient) GetSubnet

func (self *NeutronClient) GetSubnet(id string) (*Subnet, error)

func (*NeutronClient) GetSubnetID

func (self *NeutronClient) GetSubnetID(networkId string) (string, error)

func (*NeutronClient) ListPorts

func (self *NeutronClient) ListPorts(networkID string) ([]*Interface, error)

func (*NeutronClient) UpdateRouter

func (self *NeutronClient) UpdateRouter(id, name, extNetID string) error

type NeutronPort

type NeutronPort struct {
	Id         string `json:"id"`
	NetworkId  string `json:"network_id"`
	Name       string `json:"name"`
	Status     string `json:"status"`
	MacAddress string `json:"mac_address"`
	DeviceId   string `json:"device_id"`
	Ips        []*Ip  `json:"fixed_ips"`
}

type NovaClient

type NovaClient struct {
	VmLock    map[string]*sync.Mutex
	Channel   chan int
	AttachReq int
}

func (*NovaClient) AttachPortToVM

func (self *NovaClient) AttachPortToVM(vmId, portId string) (*Interface, error)

func (*NovaClient) DetachPortFromVM

func (self *NovaClient) DetachPortFromVM(vmId, portId string) error

func (*NovaClient) GetAttachReq

func (self *NovaClient) GetAttachReq() int

func (*NovaClient) SetAttachReq

func (self *NovaClient) SetAttachReq(req int)

type OpenStack

type OpenStack struct {
	NeutronClient
	NovaClient
}

func NewOpenstack

func NewOpenstack() *OpenStack

func (*OpenStack) Auth

func (self *OpenStack) Auth() error

func (*OpenStack) GetTenantUUID

func (self *OpenStack) GetTenantUUID(cfg string) (string, error)

func (*OpenStack) GetType

func (self *OpenStack) GetType() string

func (*OpenStack) SetOpenstackConfig

func (self *OpenStack) SetOpenstackConfig(cfgStr string) error

type OpenStackConf

type OpenStackConf struct {
	Username   string `json:"username"`
	Password   string `json:"password"`
	Url        string `json:"url"`
	Tenantid   string `json:"tenantid"`
	TenantName string `json:"tenantname"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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