Documentation ¶
Index ¶
- Constants
- Variables
- func MakeIPNetByCidr(cidr string) *net.IPNet
- func MakeURLReqIDSuffix(reqID string) string
- func NewGUID(podID string) string
- type CreatePortReq
- type DcVnisEncap
- type IP
- type Interface
- type ManagerClient
- func (m *ManagerClient) CheckKnitterManager() error
- func (m *ManagerClient) CreateNeutronBulkPorts(reqID string, req agtmgr.AgtBulkPortsReq, tenantID string) (b []byte, e error)
- func (m *ManagerClient) CreateNeutronPort(reqID string, req CreatePortReq, tenantID string) (b []byte, e error)
- func (m *ManagerClient) Delete(deleteURL string) (b []byte, statusCode int, e error)
- func (m *ManagerClient) DeleteNeutronPort(portID string, tenantID string) (e error)
- func (m *ManagerClient) Get(postURL string) (int, []byte, error)
- func (self *ManagerClient) GetAttachURL(tenantID, portID string) string
- func (self *ManagerClient) GetCreatePortURL(tenantID string) string
- func (self *ManagerClient) GetDcVnis(tenantID, dcID string) ([]string, error)
- func (self *ManagerClient) GetDcVnisURL(tenantID, dcID string) string
- func (self *ManagerClient) GetDeletePortURL(tenantID, portID string) string
- func (self *ManagerClient) GetDetachURL(tenantID, portID string) string
- func (self *ManagerClient) GetHealthURL() string
- func (m *ManagerClient) GetManagerURLFromK8SConf(serverconf []byte) (string, error)
- func (m *ManagerClient) GetNetInfoByNetName(netName, tenantID string) (*mgragt.PaasNetwork, error)
- func (self *ManagerClient) GetNetworkURL(tenantID, netName string) string
- func (self *ManagerClient) GetNetworksURL(tenantID string) string
- func (self *ManagerClient) GetReportPodURL(tenantID string, podName string) string
- func (self *ManagerClient) GetSegmentIDURLByID(tenantID, networkID string) string
- func (self *ManagerClient) GetSegmentIDURLByName(tenantID, networkName string) string
- func (self *ManagerClient) GetSyncInGenModURL(tenantID string) string
- func (self *ManagerClient) GetTenantURL(tenantID string) string
- func (m *ManagerClient) GetVMIDFromServerConf(ServerInfo []byte) (string, error)
- func (self *ManagerClient) GetVnicInterfaceCreateURL(tenantID string) string
- func (self *ManagerClient) GetVnicInterfaceDeleteURL(tenantID, vmID, portID string) string
- func (m *ManagerClient) Init(serverconf []byte) error
- func (m *ManagerClient) InitClient(cfg *jason.Object) error
- func (m *ManagerClient) Post(postURL string, postDict map[string]string) (int, []byte, error)
- func (m *ManagerClient) PostBytes(postURL string, postData []byte) (int, []byte, error)
- type PaaSNwGUID
- type Port
- type VLanInfo
Constants ¶
View Source
const MaxRetryTimesForHTTPReq int = 6
Variables ¶
View Source
var Delete = func(url string) (resp *http.Response, err error) { client := &http.Client{Timeout: constvalue.HTTPDefaultTimeoutInSec * time.Second} req, errreq := http.NewRequest("DELETE", url, nil) if errreq != nil { klog.Errorf("##Delete2Master http.NewRequest(DELETE,url,nil) error! -%v", errreq) return nil, errreq } resp, errresp := client.Do(req) if errresp != nil { klog.Errorf("##Delete2Master http.DefaultClient.Do(req) error! -%v", errresp) return nil, errresp } klog.Infof("##temp##:HttpDelete success! errreq and errresp should nil") return resp, nil }
View Source
var DeleteNeutronPort = func(m *ManagerClient, portID string, tenantID string) error {
return m.DeleteNeutronPort(portID, tenantID)
}
View Source
var HTTPClose = func(resp *http.Response) error {
return resp.Body.Close()
}
View Source
var HTTPDelete = func(url string) (*http.Response, error) { var resp *http.Response var err error for i := 1; i < MaxRetryTimesForHTTPReq; i++ { resp, err = Delete(url) if err == nil { return resp, nil } time.Sleep(time.Second * time.Duration(i)) } return resp, err }
View Source
var HTTPGet = func(url string) (*http.Response, error) { var resp *http.Response var err error for i := 1; i < MaxRetryTimesForHTTPReq; i++ { resp, err = get(url) if err == nil { return resp, nil } time.Sleep(time.Second * time.Duration(i)) } return resp, err }
View Source
var HTTPPost = func(url string, bodyType string, body io.Reader) (*http.Response, error) { var resp *http.Response var err error for i := 1; i < MaxRetryTimesForHTTPReq; i++ { resp, err = post(url, bodyType, body) if err == nil { return resp, nil } time.Sleep(time.Second * time.Duration(i)) } return resp, err }
Functions ¶
func MakeIPNetByCidr ¶
func MakeURLReqIDSuffix ¶
Types ¶
type CreatePortReq ¶
type CreatePortReq struct {
agtmgr.AgtPortReq
}
type DcVnisEncap ¶
type DcVnisEncap struct {
Vnis []string `json:"vnis"`
}
type Interface ¶
type Interface struct { NetworkID string `json:"networkid"` SubnetID string `json:"subnetid"` PortID string `json:"portid"` Name string `json:"name"` IP string `json:"ip"` Mac string `json:"mac"` TenantID string `json:"tenantid"` Ownertype string `json:"ownertype"` Ownerid string `json:"ownerid"` Porttype string `json:"porttype"` Businfo string `json:"businfo"` NetPlane string `json:"netplane"` }
paasnw etcd store port structure
type ManagerClient ¶
func (*ManagerClient) CheckKnitterManager ¶
func (m *ManagerClient) CheckKnitterManager() error
func (*ManagerClient) CreateNeutronBulkPorts ¶
func (m *ManagerClient) CreateNeutronBulkPorts(reqID string, req agtmgr.AgtBulkPortsReq, tenantID string) (b []byte, e error)
func (*ManagerClient) CreateNeutronPort ¶
func (m *ManagerClient) CreateNeutronPort(reqID string, req CreatePortReq, tenantID string) (b []byte, e error)
func (*ManagerClient) Delete ¶
func (m *ManagerClient) Delete(deleteURL string) (b []byte, statusCode int, e error)
func (*ManagerClient) DeleteNeutronPort ¶
func (m *ManagerClient) DeleteNeutronPort(portID string, tenantID string) (e error)
func (*ManagerClient) GetAttachURL ¶
func (self *ManagerClient) GetAttachURL(tenantID, portID string) string
func (*ManagerClient) GetCreatePortURL ¶
func (self *ManagerClient) GetCreatePortURL(tenantID string) string
func (*ManagerClient) GetDcVnis ¶
func (self *ManagerClient) GetDcVnis(tenantID, dcID string) ([]string, error)
func (*ManagerClient) GetDcVnisURL ¶
func (self *ManagerClient) GetDcVnisURL(tenantID, dcID string) string
func (*ManagerClient) GetDeletePortURL ¶
func (self *ManagerClient) GetDeletePortURL(tenantID, portID string) string
func (*ManagerClient) GetDetachURL ¶
func (self *ManagerClient) GetDetachURL(tenantID, portID string) string
func (*ManagerClient) GetHealthURL ¶
func (self *ManagerClient) GetHealthURL() string
func (*ManagerClient) GetManagerURLFromK8SConf ¶
func (m *ManagerClient) GetManagerURLFromK8SConf(serverconf []byte) (string, error)
func (*ManagerClient) GetNetInfoByNetName ¶
func (m *ManagerClient) GetNetInfoByNetName(netName, tenantID string) (*mgragt.PaasNetwork, error)
func (*ManagerClient) GetNetworkURL ¶
func (self *ManagerClient) GetNetworkURL(tenantID, netName string) string
func (*ManagerClient) GetNetworksURL ¶
func (self *ManagerClient) GetNetworksURL(tenantID string) string
func (*ManagerClient) GetReportPodURL ¶
func (self *ManagerClient) GetReportPodURL(tenantID string, podName string) string
func (*ManagerClient) GetSegmentIDURLByID ¶
func (self *ManagerClient) GetSegmentIDURLByID(tenantID, networkID string) string
func (*ManagerClient) GetSegmentIDURLByName ¶
func (self *ManagerClient) GetSegmentIDURLByName(tenantID, networkName string) string
func (*ManagerClient) GetSyncInGenModURL ¶
func (self *ManagerClient) GetSyncInGenModURL(tenantID string) string
func (*ManagerClient) GetTenantURL ¶
func (self *ManagerClient) GetTenantURL(tenantID string) string
func (*ManagerClient) GetVMIDFromServerConf ¶
func (m *ManagerClient) GetVMIDFromServerConf(ServerInfo []byte) (string, error)
func (*ManagerClient) GetVnicInterfaceCreateURL ¶
func (self *ManagerClient) GetVnicInterfaceCreateURL(tenantID string) string
func (*ManagerClient) GetVnicInterfaceDeleteURL ¶
func (self *ManagerClient) GetVnicInterfaceDeleteURL(tenantID, vmID, portID string) string
func (*ManagerClient) Init ¶
func (m *ManagerClient) Init(serverconf []byte) error
func (*ManagerClient) InitClient ¶
func (m *ManagerClient) InitClient(cfg *jason.Object) error
type PaaSNwGUID ¶
type PaaSNwGUID string
type Port ¶
type Port struct { ID string `mapstructure:"id" json:"id"` NetworkID string `mapstructure:"network_id" json:"network_id"` NetworkName string `mapstructure:"network_name" json:"network_name"` Name string `mapstructure:"name" json:"name"` MACAddress string `mapstructure:"mac_address" json:"mac_address"` FixedIPs []IP `mapstructure:"fixed_ips" json:"fixed_ips"` TenantID string `mapstructure:"tenant_id" json:"tenant_id"` CIDR string `mapstructure:"cidr" json:"cidr"` GatewayIP string `mapstructure:"gateway_ip" json:"gateway_ip"` MTU string `mapstructure:"mtu" json:"mtu"` NetworkType string `json:"neutron_network_type"` IsDefaultGateway bool `json:"is_default_gateway"` OrgDriver string `json:"org_driver"` }
func (*Port) GetGatewayIP ¶
func (*Port) MakeIPNetByCidr ¶
Click to show internal directories.
Click to hide internal directories.