Documentation
¶
Index ¶
- Constants
- func NormalizeURL(url string) string
- type AuthClient
- type AuthConfig
- type Ip
- type NeutronBulkPortsResp
- type NeutronClient
- func (self *NeutronClient) AttachNetToRouter(routerId, subNetId string) (string, error)
- func (self *NeutronClient) CreateBulkPorts(req *mgriaas.MgrBulkPortsReq) ([]*Interface, error)
- func (self *NeutronClient) CreateNetwork(name string) (string, error)
- func (self *NeutronClient) CreatePort(networkId, subnetId, portName, ip, mac, vnicType string) (*Interface, error)
- func (self *NeutronClient) CreateProviderNetwork(name, nwType, phyNet, sId string) (string, error)
- func (self *NeutronClient) CreateRouter(name, extNetId string) (string, error)
- func (self *NeutronClient) CreateSubnet(id, cidr, gw string, allocationPools []subnets.AllocationPool) (string, error)
- func (self *NeutronClient) DeleteNetwork(id string) error
- func (self *NeutronClient) DeletePort(id string) error
- func (self *NeutronClient) DeleteRouter(id string) error
- func (self *NeutronClient) DeleteSubnet(id string) error
- func (self *NeutronClient) DetachNetFromRouter(routerId, subNetId string) (string, error)
- func (self *NeutronClient) GetNetwork(id string) (*Network, error)
- func (self *NeutronClient) GetNetworkExtenAttrs(id string) (*NetworkExtenAttrs, error)
- func (self *NeutronClient) GetNetworkID(networkName string) (string, error)
- func (self *NeutronClient) GetPort(id string) (*Interface, error)
- func (self *NeutronClient) GetRouter(id string) (*Router, error)
- func (self *NeutronClient) GetSubnet(id string) (*Subnet, error)
- func (self *NeutronClient) GetSubnetID(networkId string) (string, error)
- func (self *NeutronClient) ListPorts(networkID string) ([]*Interface, error)
- func (self *NeutronClient) UpdateRouter(id, name, extNetID string) error
- type NeutronPort
- type NovaClient
- type OpenStack
- type OpenStackConf
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 ¶
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 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 NovaClient ¶
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) SetOpenstackConfig ¶
Click to show internal directories.
Click to hide internal directories.