id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8,100 | contiv/netplugin | contivmodel/client/contivModelClient.go | AciGwInspect | func (c *ContivClient) AciGwInspect(name string) (*AciGwInspect, error) {
// build key and URL
keyStr := name
url := c.baseURL + "/api/v1/inspect/aciGws/" + keyStr + "/"
// http get the object
var obj AciGwInspect
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting aciGw %+v. Err: %v", keySt... | go | func (c *ContivClient) AciGwInspect(name string) (*AciGwInspect, error) {
// build key and URL
keyStr := name
url := c.baseURL + "/api/v1/inspect/aciGws/" + keyStr + "/"
// http get the object
var obj AciGwInspect
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting aciGw %+v. Err: %v", keySt... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"AciGwInspect",
"(",
"name",
"string",
")",
"(",
"*",
"AciGwInspect",
",",
"error",
")",
"{",
"// build key and URL",
"keyStr",
":=",
"name",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"key... | // AciGwInspect gets the aciGwInspect object | [
"AciGwInspect",
"gets",
"the",
"aciGwInspect",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L952-L966 |
8,101 | contiv/netplugin | contivmodel/client/contivModelClient.go | AppProfilePost | func (c *ContivClient) AppProfilePost(obj *AppProfile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.AppProfileName
url := c.baseURL + "/api/v1/appProfiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating appProfile %+v. Err: %v... | go | func (c *ContivClient) AppProfilePost(obj *AppProfile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.AppProfileName
url := c.baseURL + "/api/v1/appProfiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating appProfile %+v. Err: %v... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"AppProfilePost",
"(",
"obj",
"*",
"AppProfile",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"AppProfileName",
"\n",
"url",
":=",
"c",
... | // AppProfilePost posts the appProfile object | [
"AppProfilePost",
"posts",
"the",
"appProfile",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L969-L982 |
8,102 | contiv/netplugin | contivmodel/client/contivModelClient.go | AppProfileList | func (c *ContivClient) AppProfileList() (*[]*AppProfile, error) {
// build key and URL
url := c.baseURL + "/api/v1/appProfiles/"
// http get the object
var objList []*AppProfile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting appProfiles. Err: %v", err)
return nil, err
}
return &... | go | func (c *ContivClient) AppProfileList() (*[]*AppProfile, error) {
// build key and URL
url := c.baseURL + "/api/v1/appProfiles/"
// http get the object
var objList []*AppProfile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting appProfiles. Err: %v", err)
return nil, err
}
return &... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"AppProfileList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"AppProfile",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"ob... | // AppProfileList lists all appProfile objects | [
"AppProfileList",
"lists",
"all",
"appProfile",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L985-L998 |
8,103 | contiv/netplugin | contivmodel/client/contivModelClient.go | BgpPost | func (c *ContivClient) BgpPost(obj *Bgp) error {
// build key and URL
keyStr := obj.Hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating Bgp %+v. Err: %v", obj, err)
return err
}
return nil
} | go | func (c *ContivClient) BgpPost(obj *Bgp) error {
// build key and URL
keyStr := obj.Hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating Bgp %+v. Err: %v", obj, err)
return err
}
return nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"BgpPost",
"(",
"obj",
"*",
"Bgp",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"Hostname",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"keyStr",
"+",
"\"",
"\"",... | // BgpPost posts the Bgp object | [
"BgpPost",
"posts",
"the",
"Bgp",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1051-L1064 |
8,104 | contiv/netplugin | contivmodel/client/contivModelClient.go | BgpList | func (c *ContivClient) BgpList() (*[]*Bgp, error) {
// build key and URL
url := c.baseURL + "/api/v1/Bgps/"
// http get the object
var objList []*Bgp
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting Bgps. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) BgpList() (*[]*Bgp, error) {
// build key and URL
url := c.baseURL + "/api/v1/Bgps/"
// http get the object
var objList []*Bgp
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting Bgps. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"BgpList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Bgp",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
"[",... | // BgpList lists all Bgp objects | [
"BgpList",
"lists",
"all",
"Bgp",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1067-L1080 |
8,105 | contiv/netplugin | contivmodel/client/contivModelClient.go | BgpGet | func (c *ContivClient) BgpGet(hostname string) (*Bgp, error) {
// build key and URL
keyStr := hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http get the object
var obj Bgp
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting Bgp %+v. Err: %v", keyStr, err)
return nil, err
}... | go | func (c *ContivClient) BgpGet(hostname string) (*Bgp, error) {
// build key and URL
keyStr := hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http get the object
var obj Bgp
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting Bgp %+v. Err: %v", keyStr, err)
return nil, err
}... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"BgpGet",
"(",
"hostname",
"string",
")",
"(",
"*",
"Bgp",
",",
"error",
")",
"{",
"// build key and URL",
"keyStr",
":=",
"hostname",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"keyStr",
... | // BgpGet gets the Bgp object | [
"BgpGet",
"gets",
"the",
"Bgp",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1083-L1097 |
8,106 | contiv/netplugin | contivmodel/client/contivModelClient.go | BgpDelete | func (c *ContivClient) BgpDelete(hostname string) error {
// build key and URL
keyStr := hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http get the object
err := c.httpDelete(url)
if err != nil {
log.Debugf("Error deleting Bgp %s. Err: %v", keyStr, err)
return err
}
return nil
} | go | func (c *ContivClient) BgpDelete(hostname string) error {
// build key and URL
keyStr := hostname
url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"
// http get the object
err := c.httpDelete(url)
if err != nil {
log.Debugf("Error deleting Bgp %s. Err: %v", keyStr, err)
return err
}
return nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"BgpDelete",
"(",
"hostname",
"string",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"hostname",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"keyStr",
"+",
"\"",
"\"",
"\n\n",
... | // BgpDelete deletes the Bgp object | [
"BgpDelete",
"deletes",
"the",
"Bgp",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1100-L1113 |
8,107 | contiv/netplugin | contivmodel/client/contivModelClient.go | EndpointInspect | func (c *ContivClient) EndpointInspect(endpointID string) (*EndpointInspect, error) {
// build key and URL
keyStr := endpointID
url := c.baseURL + "/api/v1/inspect/endpoints/" + keyStr + "/"
// http get the object
var obj EndpointInspect
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting en... | go | func (c *ContivClient) EndpointInspect(endpointID string) (*EndpointInspect, error) {
// build key and URL
keyStr := endpointID
url := c.baseURL + "/api/v1/inspect/endpoints/" + keyStr + "/"
// http get the object
var obj EndpointInspect
err := c.httpGet(url, &obj)
if err != nil {
log.Debugf("Error getting en... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"EndpointInspect",
"(",
"endpointID",
"string",
")",
"(",
"*",
"EndpointInspect",
",",
"error",
")",
"{",
"// build key and URL",
"keyStr",
":=",
"endpointID",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"... | // EndpointInspect gets the endpointInspect object | [
"EndpointInspect",
"gets",
"the",
"endpointInspect",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1133-L1147 |
8,108 | contiv/netplugin | contivmodel/client/contivModelClient.go | EndpointGroupPost | func (c *ContivClient) EndpointGroupPost(obj *EndpointGroup) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.GroupName
url := c.baseURL + "/api/v1/endpointGroups/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating endpointGroup %+v. ... | go | func (c *ContivClient) EndpointGroupPost(obj *EndpointGroup) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.GroupName
url := c.baseURL + "/api/v1/endpointGroups/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating endpointGroup %+v. ... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"EndpointGroupPost",
"(",
"obj",
"*",
"EndpointGroup",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"GroupName",
"\n",
"url",
":=",
"c",
... | // EndpointGroupPost posts the endpointGroup object | [
"EndpointGroupPost",
"posts",
"the",
"endpointGroup",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1150-L1163 |
8,109 | contiv/netplugin | contivmodel/client/contivModelClient.go | EndpointGroupList | func (c *ContivClient) EndpointGroupList() (*[]*EndpointGroup, error) {
// build key and URL
url := c.baseURL + "/api/v1/endpointGroups/"
// http get the object
var objList []*EndpointGroup
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting endpointGroups. Err: %v", err)
return nil, er... | go | func (c *ContivClient) EndpointGroupList() (*[]*EndpointGroup, error) {
// build key and URL
url := c.baseURL + "/api/v1/endpointGroups/"
// http get the object
var objList []*EndpointGroup
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting endpointGroups. Err: %v", err)
return nil, er... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"EndpointGroupList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"EndpointGroup",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",... | // EndpointGroupList lists all endpointGroup objects | [
"EndpointGroupList",
"lists",
"all",
"endpointGroup",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1166-L1179 |
8,110 | contiv/netplugin | contivmodel/client/contivModelClient.go | ExtContractsGroupPost | func (c *ContivClient) ExtContractsGroupPost(obj *ExtContractsGroup) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ContractsGroupName
url := c.baseURL + "/api/v1/extContractsGroups/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creatin... | go | func (c *ContivClient) ExtContractsGroupPost(obj *ExtContractsGroup) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ContractsGroupName
url := c.baseURL + "/api/v1/extContractsGroups/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creatin... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"ExtContractsGroupPost",
"(",
"obj",
"*",
"ExtContractsGroup",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"ContractsGroupName",
"\n",
"url",... | // ExtContractsGroupPost posts the extContractsGroup object | [
"ExtContractsGroupPost",
"posts",
"the",
"extContractsGroup",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1232-L1245 |
8,111 | contiv/netplugin | contivmodel/client/contivModelClient.go | ExtContractsGroupList | func (c *ContivClient) ExtContractsGroupList() (*[]*ExtContractsGroup, error) {
// build key and URL
url := c.baseURL + "/api/v1/extContractsGroups/"
// http get the object
var objList []*ExtContractsGroup
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting extContractsGroups. Err: %v", e... | go | func (c *ContivClient) ExtContractsGroupList() (*[]*ExtContractsGroup, error) {
// build key and URL
url := c.baseURL + "/api/v1/extContractsGroups/"
// http get the object
var objList []*ExtContractsGroup
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting extContractsGroups. Err: %v", e... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"ExtContractsGroupList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"ExtContractsGroup",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
... | // ExtContractsGroupList lists all extContractsGroup objects | [
"ExtContractsGroupList",
"lists",
"all",
"extContractsGroup",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1248-L1261 |
8,112 | contiv/netplugin | contivmodel/client/contivModelClient.go | GlobalPost | func (c *ContivClient) GlobalPost(obj *Global) error {
// build key and URL
keyStr := obj.Name
url := c.baseURL + "/api/v1/globals/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating global %+v. Err: %v", obj, err)
return err
}
return nil
} | go | func (c *ContivClient) GlobalPost(obj *Global) error {
// build key and URL
keyStr := obj.Name
url := c.baseURL + "/api/v1/globals/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating global %+v. Err: %v", obj, err)
return err
}
return nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"GlobalPost",
"(",
"obj",
"*",
"Global",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"Name",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"keyStr",
"+",
"\"",
"\"... | // GlobalPost posts the global object | [
"GlobalPost",
"posts",
"the",
"global",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1314-L1327 |
8,113 | contiv/netplugin | contivmodel/client/contivModelClient.go | GlobalList | func (c *ContivClient) GlobalList() (*[]*Global, error) {
// build key and URL
url := c.baseURL + "/api/v1/globals/"
// http get the object
var objList []*Global
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting globals. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) GlobalList() (*[]*Global, error) {
// build key and URL
url := c.baseURL + "/api/v1/globals/"
// http get the object
var objList []*Global
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting globals. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"GlobalList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Global",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
... | // GlobalList lists all global objects | [
"GlobalList",
"lists",
"all",
"global",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1330-L1343 |
8,114 | contiv/netplugin | contivmodel/client/contivModelClient.go | NetprofilePost | func (c *ContivClient) NetprofilePost(obj *Netprofile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ProfileName
url := c.baseURL + "/api/v1/netprofiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating netprofile %+v. Err: %v", ... | go | func (c *ContivClient) NetprofilePost(obj *Netprofile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ProfileName
url := c.baseURL + "/api/v1/netprofiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating netprofile %+v. Err: %v", ... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"NetprofilePost",
"(",
"obj",
"*",
"Netprofile",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"ProfileName",
"\n",
"url",
":=",
"c",
"."... | // NetprofilePost posts the netprofile object | [
"NetprofilePost",
"posts",
"the",
"netprofile",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1396-L1409 |
8,115 | contiv/netplugin | contivmodel/client/contivModelClient.go | NetprofileList | func (c *ContivClient) NetprofileList() (*[]*Netprofile, error) {
// build key and URL
url := c.baseURL + "/api/v1/netprofiles/"
// http get the object
var objList []*Netprofile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting netprofiles. Err: %v", err)
return nil, err
}
return &... | go | func (c *ContivClient) NetprofileList() (*[]*Netprofile, error) {
// build key and URL
url := c.baseURL + "/api/v1/netprofiles/"
// http get the object
var objList []*Netprofile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting netprofiles. Err: %v", err)
return nil, err
}
return &... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"NetprofileList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Netprofile",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"ob... | // NetprofileList lists all netprofile objects | [
"NetprofileList",
"lists",
"all",
"netprofile",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1412-L1425 |
8,116 | contiv/netplugin | contivmodel/client/contivModelClient.go | NetworkPost | func (c *ContivClient) NetworkPost(obj *Network) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.NetworkName
url := c.baseURL + "/api/v1/networks/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating network %+v. Err: %v", obj, err)
... | go | func (c *ContivClient) NetworkPost(obj *Network) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.NetworkName
url := c.baseURL + "/api/v1/networks/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating network %+v. Err: %v", obj, err)
... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"NetworkPost",
"(",
"obj",
"*",
"Network",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"NetworkName",
"\n",
"url",
":=",
"c",
".",
"b... | // NetworkPost posts the network object | [
"NetworkPost",
"posts",
"the",
"network",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1478-L1491 |
8,117 | contiv/netplugin | contivmodel/client/contivModelClient.go | NetworkList | func (c *ContivClient) NetworkList() (*[]*Network, error) {
// build key and URL
url := c.baseURL + "/api/v1/networks/"
// http get the object
var objList []*Network
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting networks. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) NetworkList() (*[]*Network, error) {
// build key and URL
url := c.baseURL + "/api/v1/networks/"
// http get the object
var objList []*Network
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting networks. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"NetworkList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Network",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList"... | // NetworkList lists all network objects | [
"NetworkList",
"lists",
"all",
"network",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1494-L1507 |
8,118 | contiv/netplugin | contivmodel/client/contivModelClient.go | PolicyPost | func (c *ContivClient) PolicyPost(obj *Policy) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.PolicyName
url := c.baseURL + "/api/v1/policys/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating policy %+v. Err: %v", obj, err)
retur... | go | func (c *ContivClient) PolicyPost(obj *Policy) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.PolicyName
url := c.baseURL + "/api/v1/policys/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating policy %+v. Err: %v", obj, err)
retur... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"PolicyPost",
"(",
"obj",
"*",
"Policy",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"PolicyName",
"\n",
"url",
":=",
"c",
".",
"base... | // PolicyPost posts the policy object | [
"PolicyPost",
"posts",
"the",
"policy",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1560-L1573 |
8,119 | contiv/netplugin | contivmodel/client/contivModelClient.go | PolicyList | func (c *ContivClient) PolicyList() (*[]*Policy, error) {
// build key and URL
url := c.baseURL + "/api/v1/policys/"
// http get the object
var objList []*Policy
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting policys. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) PolicyList() (*[]*Policy, error) {
// build key and URL
url := c.baseURL + "/api/v1/policys/"
// http get the object
var objList []*Policy
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting policys. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"PolicyList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Policy",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
... | // PolicyList lists all policy objects | [
"PolicyList",
"lists",
"all",
"policy",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1576-L1589 |
8,120 | contiv/netplugin | contivmodel/client/contivModelClient.go | RulePost | func (c *ContivClient) RulePost(obj *Rule) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.PolicyName + ":" + obj.RuleID
url := c.baseURL + "/api/v1/rules/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating rule %+v. Err: %v", obj, e... | go | func (c *ContivClient) RulePost(obj *Rule) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.PolicyName + ":" + obj.RuleID
url := c.baseURL + "/api/v1/rules/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating rule %+v. Err: %v", obj, e... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"RulePost",
"(",
"obj",
"*",
"Rule",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"PolicyName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"R... | // RulePost posts the rule object | [
"RulePost",
"posts",
"the",
"rule",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1642-L1655 |
8,121 | contiv/netplugin | contivmodel/client/contivModelClient.go | RuleList | func (c *ContivClient) RuleList() (*[]*Rule, error) {
// build key and URL
url := c.baseURL + "/api/v1/rules/"
// http get the object
var objList []*Rule
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting rules. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) RuleList() (*[]*Rule, error) {
// build key and URL
url := c.baseURL + "/api/v1/rules/"
// http get the object
var objList []*Rule
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting rules. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"RuleList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Rule",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
"[... | // RuleList lists all rule objects | [
"RuleList",
"lists",
"all",
"rule",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1658-L1671 |
8,122 | contiv/netplugin | contivmodel/client/contivModelClient.go | ServiceLBPost | func (c *ContivClient) ServiceLBPost(obj *ServiceLB) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ServiceName
url := c.baseURL + "/api/v1/serviceLBs/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating serviceLB %+v. Err: %v", obj,... | go | func (c *ContivClient) ServiceLBPost(obj *ServiceLB) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.ServiceName
url := c.baseURL + "/api/v1/serviceLBs/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating serviceLB %+v. Err: %v", obj,... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"ServiceLBPost",
"(",
"obj",
"*",
"ServiceLB",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"ServiceName",
"\n",
"url",
":=",
"c",
".",
... | // ServiceLBPost posts the serviceLB object | [
"ServiceLBPost",
"posts",
"the",
"serviceLB",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1724-L1737 |
8,123 | contiv/netplugin | contivmodel/client/contivModelClient.go | ServiceLBList | func (c *ContivClient) ServiceLBList() (*[]*ServiceLB, error) {
// build key and URL
url := c.baseURL + "/api/v1/serviceLBs/"
// http get the object
var objList []*ServiceLB
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting serviceLBs. Err: %v", err)
return nil, err
}
return &objLi... | go | func (c *ContivClient) ServiceLBList() (*[]*ServiceLB, error) {
// build key and URL
url := c.baseURL + "/api/v1/serviceLBs/"
// http get the object
var objList []*ServiceLB
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting serviceLBs. Err: %v", err)
return nil, err
}
return &objLi... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"ServiceLBList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"ServiceLB",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objL... | // ServiceLBList lists all serviceLB objects | [
"ServiceLBList",
"lists",
"all",
"serviceLB",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1740-L1753 |
8,124 | contiv/netplugin | contivmodel/client/contivModelClient.go | TenantPost | func (c *ContivClient) TenantPost(obj *Tenant) error {
// build key and URL
keyStr := obj.TenantName
url := c.baseURL + "/api/v1/tenants/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating tenant %+v. Err: %v", obj, err)
return err
}
return nil
} | go | func (c *ContivClient) TenantPost(obj *Tenant) error {
// build key and URL
keyStr := obj.TenantName
url := c.baseURL + "/api/v1/tenants/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating tenant %+v. Err: %v", obj, err)
return err
}
return nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"TenantPost",
"(",
"obj",
"*",
"Tenant",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"\n",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"+",
"keyStr",
"+",
"\"",... | // TenantPost posts the tenant object | [
"TenantPost",
"posts",
"the",
"tenant",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1806-L1819 |
8,125 | contiv/netplugin | contivmodel/client/contivModelClient.go | TenantList | func (c *ContivClient) TenantList() (*[]*Tenant, error) {
// build key and URL
url := c.baseURL + "/api/v1/tenants/"
// http get the object
var objList []*Tenant
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting tenants. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) TenantList() (*[]*Tenant, error) {
// build key and URL
url := c.baseURL + "/api/v1/tenants/"
// http get the object
var objList []*Tenant
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting tenants. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"TenantList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Tenant",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
... | // TenantList lists all tenant objects | [
"TenantList",
"lists",
"all",
"tenant",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1822-L1835 |
8,126 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumePost | func (c *ContivClient) VolumePost(obj *Volume) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.VolumeName
url := c.baseURL + "/api/v1/volumes/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating volume %+v. Err: %v", obj, err)
retur... | go | func (c *ContivClient) VolumePost(obj *Volume) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.VolumeName
url := c.baseURL + "/api/v1/volumes/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating volume %+v. Err: %v", obj, err)
retur... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumePost",
"(",
"obj",
"*",
"Volume",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"VolumeName",
"\n",
"url",
":=",
"c",
".",
"base... | // VolumePost posts the volume object | [
"VolumePost",
"posts",
"the",
"volume",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1888-L1901 |
8,127 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumeList | func (c *ContivClient) VolumeList() (*[]*Volume, error) {
// build key and URL
url := c.baseURL + "/api/v1/volumes/"
// http get the object
var objList []*Volume
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting volumes. Err: %v", err)
return nil, err
}
return &objList, nil
} | go | func (c *ContivClient) VolumeList() (*[]*Volume, error) {
// build key and URL
url := c.baseURL + "/api/v1/volumes/"
// http get the object
var objList []*Volume
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting volumes. Err: %v", err)
return nil, err
}
return &objList, nil
} | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumeList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"Volume",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",
"objList",
... | // VolumeList lists all volume objects | [
"VolumeList",
"lists",
"all",
"volume",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1904-L1917 |
8,128 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumeProfilePost | func (c *ContivClient) VolumeProfilePost(obj *VolumeProfile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.VolumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating volumeProfi... | go | func (c *ContivClient) VolumeProfilePost(obj *VolumeProfile) error {
// build key and URL
keyStr := obj.TenantName + ":" + obj.VolumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http post the object
err := c.httpPost(url, obj)
if err != nil {
log.Debugf("Error creating volumeProfi... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumeProfilePost",
"(",
"obj",
"*",
"VolumeProfile",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"obj",
".",
"TenantName",
"+",
"\"",
"\"",
"+",
"obj",
".",
"VolumeProfileName",
"\n",
"url",
":=",
... | // VolumeProfilePost posts the volumeProfile object | [
"VolumeProfilePost",
"posts",
"the",
"volumeProfile",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1970-L1983 |
8,129 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumeProfileList | func (c *ContivClient) VolumeProfileList() (*[]*VolumeProfile, error) {
// build key and URL
url := c.baseURL + "/api/v1/volumeProfiles/"
// http get the object
var objList []*VolumeProfile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting volumeProfiles. Err: %v", err)
return nil, er... | go | func (c *ContivClient) VolumeProfileList() (*[]*VolumeProfile, error) {
// build key and URL
url := c.baseURL + "/api/v1/volumeProfiles/"
// http get the object
var objList []*VolumeProfile
err := c.httpGet(url, &objList)
if err != nil {
log.Debugf("Error getting volumeProfiles. Err: %v", err)
return nil, er... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumeProfileList",
"(",
")",
"(",
"*",
"[",
"]",
"*",
"VolumeProfile",
",",
"error",
")",
"{",
"// build key and URL",
"url",
":=",
"c",
".",
"baseURL",
"+",
"\"",
"\"",
"\n\n",
"// http get the object",
"var",... | // VolumeProfileList lists all volumeProfile objects | [
"VolumeProfileList",
"lists",
"all",
"volumeProfile",
"objects"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L1986-L1999 |
8,130 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumeProfileGet | func (c *ContivClient) VolumeProfileGet(tenantName string, volumeProfileName string) (*VolumeProfile, error) {
// build key and URL
keyStr := tenantName + ":" + volumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http get the object
var obj VolumeProfile
err := c.httpGet(url, &obj)
... | go | func (c *ContivClient) VolumeProfileGet(tenantName string, volumeProfileName string) (*VolumeProfile, error) {
// build key and URL
keyStr := tenantName + ":" + volumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http get the object
var obj VolumeProfile
err := c.httpGet(url, &obj)
... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumeProfileGet",
"(",
"tenantName",
"string",
",",
"volumeProfileName",
"string",
")",
"(",
"*",
"VolumeProfile",
",",
"error",
")",
"{",
"// build key and URL",
"keyStr",
":=",
"tenantName",
"+",
"\"",
"\"",
"+",... | // VolumeProfileGet gets the volumeProfile object | [
"VolumeProfileGet",
"gets",
"the",
"volumeProfile",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L2002-L2016 |
8,131 | contiv/netplugin | contivmodel/client/contivModelClient.go | VolumeProfileDelete | func (c *ContivClient) VolumeProfileDelete(tenantName string, volumeProfileName string) error {
// build key and URL
keyStr := tenantName + ":" + volumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http get the object
err := c.httpDelete(url)
if err != nil {
log.Debugf("Error delet... | go | func (c *ContivClient) VolumeProfileDelete(tenantName string, volumeProfileName string) error {
// build key and URL
keyStr := tenantName + ":" + volumeProfileName
url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"
// http get the object
err := c.httpDelete(url)
if err != nil {
log.Debugf("Error delet... | [
"func",
"(",
"c",
"*",
"ContivClient",
")",
"VolumeProfileDelete",
"(",
"tenantName",
"string",
",",
"volumeProfileName",
"string",
")",
"error",
"{",
"// build key and URL",
"keyStr",
":=",
"tenantName",
"+",
"\"",
"\"",
"+",
"volumeProfileName",
"\n",
"url",
"... | // VolumeProfileDelete deletes the volumeProfile object | [
"VolumeProfileDelete",
"deletes",
"the",
"volumeProfile",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/contivmodel/client/contivModelClient.go#L2019-L2032 |
8,132 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | NewStateResourceManager | func NewStateResourceManager(sd core.StateDriver) (*StateResourceManager, error) {
if gStateResourceManager != nil {
return nil, core.Errorf("state-based resource manager instance already exists.")
}
gStateResourceManager = &StateResourceManager{stateDriver: sd}
err := gStateResourceManager.Init()
if err != nil... | go | func NewStateResourceManager(sd core.StateDriver) (*StateResourceManager, error) {
if gStateResourceManager != nil {
return nil, core.Errorf("state-based resource manager instance already exists.")
}
gStateResourceManager = &StateResourceManager{stateDriver: sd}
err := gStateResourceManager.Init()
if err != nil... | [
"func",
"NewStateResourceManager",
"(",
"sd",
"core",
".",
"StateDriver",
")",
"(",
"*",
"StateResourceManager",
",",
"error",
")",
"{",
"if",
"gStateResourceManager",
"!=",
"nil",
"{",
"return",
"nil",
",",
"core",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n... | // NewStateResourceManager instantiates a state based resource manager | [
"NewStateResourceManager",
"instantiates",
"a",
"state",
"based",
"resource",
"manager"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L40-L52 |
8,133 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | GetStateResourceManager | func GetStateResourceManager() (*StateResourceManager, error) {
if gStateResourceManager == nil {
return nil, core.Errorf("state-based resource manager has not been not created.")
}
return gStateResourceManager, nil
} | go | func GetStateResourceManager() (*StateResourceManager, error) {
if gStateResourceManager == nil {
return nil, core.Errorf("state-based resource manager has not been not created.")
}
return gStateResourceManager, nil
} | [
"func",
"GetStateResourceManager",
"(",
")",
"(",
"*",
"StateResourceManager",
",",
"error",
")",
"{",
"if",
"gStateResourceManager",
"==",
"nil",
"{",
"return",
"nil",
",",
"core",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"gStateR... | // GetStateResourceManager returns the singleton instance of the state based
// resource manager | [
"GetStateResourceManager",
"returns",
"the",
"singleton",
"instance",
"of",
"the",
"state",
"based",
"resource",
"manager"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L56-L62 |
8,134 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | DefineResource | func (rm *StateResourceManager) DefineResource(id, desc string,
rsrcCfg interface{}) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if alreadyExists {
return core.Errorf("Resource with id: %q already e... | go | func (rm *StateResourceManager) DefineResource(id, desc string,
rsrcCfg interface{}) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if alreadyExists {
return core.Errorf("Resource with id: %q already e... | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"DefineResource",
"(",
"id",
",",
"desc",
"string",
",",
"rsrcCfg",
"interface",
"{",
"}",
")",
"error",
"{",
"// XXX: need to take care of distibuted updates, locks etc here",
"rsrc",
",",
"alreadyExists",
",",
"... | // DefineResource initializes a new resource. | [
"DefineResource",
"initializes",
"a",
"new",
"resource",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L118-L131 |
8,135 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | UndefineResource | func (rm *StateResourceManager) UndefineResource(id, desc string) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for description: %q and id: %q"... | go | func (rm *StateResourceManager) UndefineResource(id, desc string) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for description: %q and id: %q"... | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"UndefineResource",
"(",
"id",
",",
"desc",
"string",
")",
"error",
"{",
"// XXX: need to take care of distibuted updates, locks etc here",
"rsrc",
",",
"alreadyExists",
",",
"err",
":=",
"rm",
".",
"findResource",
... | // UndefineResource deinitializes a resource. | [
"UndefineResource",
"deinitializes",
"a",
"resource",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L134-L149 |
8,136 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | RedefineResource | func (rm *StateResourceManager) RedefineResource(id, desc string, rsrcCfg interface{}) error {
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for description: %q and id: %q",
desc, id)
}
rsrc.Reinit(rsrcCfg)
r... | go | func (rm *StateResourceManager) RedefineResource(id, desc string, rsrcCfg interface{}) error {
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for description: %q and id: %q",
desc, id)
}
rsrc.Reinit(rsrcCfg)
r... | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"RedefineResource",
"(",
"id",
",",
"desc",
"string",
",",
"rsrcCfg",
"interface",
"{",
"}",
")",
"error",
"{",
"rsrc",
",",
"alreadyExists",
",",
"err",
":=",
"rm",
".",
"findResource",
"(",
"id",
","... | // RedefineResource deinitializes a resource. | [
"RedefineResource",
"deinitializes",
"a",
"resource",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L152-L167 |
8,137 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | GetResourceList | func (rm *StateResourceManager) GetResourceList(id, desc string) (uint, string) {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, _, err := rm.findResource(id, desc)
if err != nil {
log.Errorf("unable to find resource %s desc %s", id, desc)
return 0, ""
}
return rsrc.GetList()
} | go | func (rm *StateResourceManager) GetResourceList(id, desc string) (uint, string) {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, _, err := rm.findResource(id, desc)
if err != nil {
log.Errorf("unable to find resource %s desc %s", id, desc)
return 0, ""
}
return rsrc.GetList()
} | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"GetResourceList",
"(",
"id",
",",
"desc",
"string",
")",
"(",
"uint",
",",
"string",
")",
"{",
"// XXX: need to take care of distibuted updates, locks etc here",
"rsrc",
",",
"_",
",",
"err",
":=",
"rm",
".",... | // GetResourceList get the list of allocated as string for inspection | [
"GetResourceList",
"get",
"the",
"list",
"of",
"allocated",
"as",
"string",
"for",
"inspection"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L170-L179 |
8,138 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | AllocateResourceVal | func (rm *StateResourceManager) AllocateResourceVal(id, desc string, reqValue interface{}) (interface{},
error) {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return nil, err
}
if !alreadyExists {
return nil, core.Errorf... | go | func (rm *StateResourceManager) AllocateResourceVal(id, desc string, reqValue interface{}) (interface{},
error) {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return nil, err
}
if !alreadyExists {
return nil, core.Errorf... | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"AllocateResourceVal",
"(",
"id",
",",
"desc",
"string",
",",
"reqValue",
"interface",
"{",
"}",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"// XXX: need to take care of distibuted updates, locks e... | // AllocateResourceVal yields the core.Resource for the id and description. | [
"AllocateResourceVal",
"yields",
"the",
"core",
".",
"Resource",
"for",
"the",
"id",
"and",
"description",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L182-L196 |
8,139 | contiv/netplugin | netmaster/resources/stateresourcemanager.go | DeallocateResourceVal | func (rm *StateResourceManager) DeallocateResourceVal(id, desc string,
value interface{}) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for de... | go | func (rm *StateResourceManager) DeallocateResourceVal(id, desc string,
value interface{}) error {
// XXX: need to take care of distibuted updates, locks etc here
rsrc, alreadyExists, err := rm.findResource(id, desc)
if err != nil {
return err
}
if !alreadyExists {
return core.Errorf("No resource found for de... | [
"func",
"(",
"rm",
"*",
"StateResourceManager",
")",
"DeallocateResourceVal",
"(",
"id",
",",
"desc",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"// XXX: need to take care of distibuted updates, locks etc here",
"rsrc",
",",
"alreadyExists",
","... | // DeallocateResourceVal removes a value from the resource. | [
"DeallocateResourceVal",
"removes",
"a",
"value",
"from",
"the",
"resource",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/resources/stateresourcemanager.go#L199-L213 |
8,140 | contiv/netplugin | netmaster/mastercfg/globalState.go | ReadAll | func (s *GlobConfig) ReadAll() ([]core.State, error) {
return s.StateDriver.ReadAllState(globalConfigPathPrefix, s, json.Unmarshal)
} | go | func (s *GlobConfig) ReadAll() ([]core.State, error) {
return s.StateDriver.ReadAllState(globalConfigPathPrefix, s, json.Unmarshal)
} | [
"func",
"(",
"s",
"*",
"GlobConfig",
")",
"ReadAll",
"(",
")",
"(",
"[",
"]",
"core",
".",
"State",
",",
"error",
")",
"{",
"return",
"s",
".",
"StateDriver",
".",
"ReadAllState",
"(",
"globalConfigPathPrefix",
",",
"s",
",",
"json",
".",
"Unmarshal",
... | // ReadAll reads all the state for master global configurations and returns it. | [
"ReadAll",
"reads",
"all",
"the",
"state",
"for",
"master",
"global",
"configurations",
"and",
"returns",
"it",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/mastercfg/globalState.go#L63-L65 |
8,141 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | getPvtIP | func (sw *OvsSwitch) getPvtIP(portName string) net.IP {
if strings.Contains(portName, "vport") {
port := strings.Replace(portName, "vvport", "", 1)
portNum, err := strconv.Atoi(port)
if err == nil {
ipStr, _ := netutils.PortToHostIPMAC(portNum, sw.hostPvtNW)
log.Infof("PvtIP: %s", ipStr)
ips := strings.... | go | func (sw *OvsSwitch) getPvtIP(portName string) net.IP {
if strings.Contains(portName, "vport") {
port := strings.Replace(portName, "vvport", "", 1)
portNum, err := strconv.Atoi(port)
if err == nil {
ipStr, _ := netutils.PortToHostIPMAC(portNum, sw.hostPvtNW)
log.Infof("PvtIP: %s", ipStr)
ips := strings.... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"getPvtIP",
"(",
"portName",
"string",
")",
"net",
".",
"IP",
"{",
"if",
"strings",
".",
"Contains",
"(",
"portName",
",",
"\"",
"\"",
")",
"{",
"port",
":=",
"strings",
".",
"Replace",
"(",
"portName",
",",
... | // getPvtIP returns a private IP for the port | [
"getPvtIP",
"returns",
"a",
"private",
"IP",
"for",
"the",
"port"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L63-L81 |
8,142 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | GetUplinkInterfaces | func (sw *OvsSwitch) GetUplinkInterfaces(uplinkID string) []string {
uplink, _ := sw.uplinkDb.Get(uplinkID)
if uplink == nil {
return nil
}
return uplink.([]string)
} | go | func (sw *OvsSwitch) GetUplinkInterfaces(uplinkID string) []string {
uplink, _ := sw.uplinkDb.Get(uplinkID)
if uplink == nil {
return nil
}
return uplink.([]string)
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"GetUplinkInterfaces",
"(",
"uplinkID",
"string",
")",
"[",
"]",
"string",
"{",
"uplink",
",",
"_",
":=",
"sw",
".",
"uplinkDb",
".",
"Get",
"(",
"uplinkID",
")",
"\n",
"if",
"uplink",
"==",
"nil",
"{",
"retu... | // GetUplinkInterfaces returns the list of interface associated with the uplink port | [
"GetUplinkInterfaces",
"returns",
"the",
"list",
"of",
"interface",
"associated",
"with",
"the",
"uplink",
"port"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L84-L90 |
8,143 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | NewOvsSwitch | func NewOvsSwitch(bridgeName, netType, localIP, fwdMode string,
vlanIntf []string, hostPvtNW int, vxlanUDPPort int) (*OvsSwitch, error) {
var err error
var datapath string
var ofnetPort, ctrlrPort uint16
log.Infof("Received request to create new ovs switch bridge:%s, localIP:%s, fwdMode:%s", bridgeName, localIP, f... | go | func NewOvsSwitch(bridgeName, netType, localIP, fwdMode string,
vlanIntf []string, hostPvtNW int, vxlanUDPPort int) (*OvsSwitch, error) {
var err error
var datapath string
var ofnetPort, ctrlrPort uint16
log.Infof("Received request to create new ovs switch bridge:%s, localIP:%s, fwdMode:%s", bridgeName, localIP, f... | [
"func",
"NewOvsSwitch",
"(",
"bridgeName",
",",
"netType",
",",
"localIP",
",",
"fwdMode",
"string",
",",
"vlanIntf",
"[",
"]",
"string",
",",
"hostPvtNW",
"int",
",",
"vxlanUDPPort",
"int",
")",
"(",
"*",
"OvsSwitch",
",",
"error",
")",
"{",
"var",
"err... | // NewOvsSwitch Creates a new OVS switch instance | [
"NewOvsSwitch",
"Creates",
"a",
"new",
"OVS",
"switch",
"instance"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L93-L185 |
8,144 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | Delete | func (sw *OvsSwitch) Delete() {
if sw.ofnetAgent != nil {
sw.ofnetAgent.Delete()
}
if sw.ovsdbDriver != nil {
sw.ovsdbDriver.Delete()
// Wait a little for OVS switch to be deleted
time.Sleep(300 * time.Millisecond)
}
} | go | func (sw *OvsSwitch) Delete() {
if sw.ofnetAgent != nil {
sw.ofnetAgent.Delete()
}
if sw.ovsdbDriver != nil {
sw.ovsdbDriver.Delete()
// Wait a little for OVS switch to be deleted
time.Sleep(300 * time.Millisecond)
}
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"Delete",
"(",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"!=",
"nil",
"{",
"sw",
".",
"ofnetAgent",
".",
"Delete",
"(",
")",
"\n",
"}",
"\n",
"if",
"sw",
".",
"ovsdbDriver",
"!=",
"nil",
"{",
"sw",
".",
... | // Delete performs cleanup prior to destruction of the OvsDriver | [
"Delete",
"performs",
"cleanup",
"prior",
"to",
"destruction",
"of",
"the",
"OvsDriver"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L188-L198 |
8,145 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | createVethPair | func createVethPair(name1, name2 string) error {
log.Infof("Creating Veth pairs with name: %s, %s", name1, name2)
// Veth pair params
veth := &netlink.Veth{
LinkAttrs: netlink.LinkAttrs{
Name: name1,
TxQLen: 0,
},
PeerName: name2,
}
// Create the veth pair
if err := netlink.LinkAdd(veth); err != n... | go | func createVethPair(name1, name2 string) error {
log.Infof("Creating Veth pairs with name: %s, %s", name1, name2)
// Veth pair params
veth := &netlink.Veth{
LinkAttrs: netlink.LinkAttrs{
Name: name1,
TxQLen: 0,
},
PeerName: name2,
}
// Create the veth pair
if err := netlink.LinkAdd(veth); err != n... | [
"func",
"createVethPair",
"(",
"name1",
",",
"name2",
"string",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"name1",
",",
"name2",
")",
"\n\n",
"// Veth pair params",
"veth",
":=",
"&",
"netlink",
".",
"Veth",
"{",
"LinkAttrs",
":",
"... | // createVethPair creates veth interface pairs with specified name | [
"createVethPair",
"creates",
"veth",
"interface",
"pairs",
"with",
"specified",
"name"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L227-L246 |
8,146 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | setLinkMtu | func setLinkMtu(name string, mtu int) error {
iface, err := netlink.LinkByName(name)
if err != nil {
return err
}
return netlink.LinkSetMTU(iface, mtu)
} | go | func setLinkMtu(name string, mtu int) error {
iface, err := netlink.LinkByName(name)
if err != nil {
return err
}
return netlink.LinkSetMTU(iface, mtu)
} | [
"func",
"setLinkMtu",
"(",
"name",
"string",
",",
"mtu",
"int",
")",
"error",
"{",
"iface",
",",
"err",
":=",
"netlink",
".",
"LinkByName",
"(",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"netlink",
... | // Set the link mtu | [
"Set",
"the",
"link",
"mtu"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L280-L286 |
8,147 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | getOvsPortName | func getOvsPortName(intfName string, skipVethPair bool) string {
var ovsPortName string
if useVethPair && !skipVethPair {
ovsPortName = strings.Replace(intfName, "port", "vport", 1)
} else {
ovsPortName = intfName
}
return ovsPortName
} | go | func getOvsPortName(intfName string, skipVethPair bool) string {
var ovsPortName string
if useVethPair && !skipVethPair {
ovsPortName = strings.Replace(intfName, "port", "vport", 1)
} else {
ovsPortName = intfName
}
return ovsPortName
} | [
"func",
"getOvsPortName",
"(",
"intfName",
"string",
",",
"skipVethPair",
"bool",
")",
"string",
"{",
"var",
"ovsPortName",
"string",
"\n\n",
"if",
"useVethPair",
"&&",
"!",
"skipVethPair",
"{",
"ovsPortName",
"=",
"strings",
".",
"Replace",
"(",
"intfName",
"... | // getOvsPortName returns OVS port name depending on if we use Veth pairs
// For infra nw, dont use Veth pair | [
"getOvsPortName",
"returns",
"OVS",
"port",
"name",
"depending",
"on",
"if",
"we",
"use",
"Veth",
"pairs",
"For",
"infra",
"nw",
"dont",
"use",
"Veth",
"pair"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L290-L300 |
8,148 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | UpdateEndpoint | func (sw *OvsSwitch) UpdateEndpoint(ovsPortName string, burst, dscp int, epgBandwidth int64) error {
// update bandwidth
err := sw.ovsdbDriver.UpdatePolicingRate(ovsPortName, burst, epgBandwidth)
if err != nil {
return err
}
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOf... | go | func (sw *OvsSwitch) UpdateEndpoint(ovsPortName string, burst, dscp int, epgBandwidth int64) error {
// update bandwidth
err := sw.ovsdbDriver.UpdatePolicingRate(ovsPortName, burst, epgBandwidth)
if err != nil {
return err
}
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOf... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"UpdateEndpoint",
"(",
"ovsPortName",
"string",
",",
"burst",
",",
"dscp",
"int",
",",
"epgBandwidth",
"int64",
")",
"error",
"{",
"// update bandwidth",
"err",
":=",
"sw",
".",
"ovsdbDriver",
".",
"UpdatePolicingRate"... | // UpdateEndpoint updates endpoint state | [
"UpdateEndpoint",
"updates",
"endpoint",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L424-L452 |
8,149 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | UpdatePort | func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, dscp int, skipVethPair bool) error {
// Get OVS port name
ovsPortName := getOvsPortName(intfName, skipVethPair)
// Add the endpoint to ofnet
// Get the openflow port number for the interface
ofpPort, err := sw.o... | go | func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, dscp int, skipVethPair bool) error {
// Get OVS port name
ovsPortName := getOvsPortName(intfName, skipVethPair)
// Add the endpoint to ofnet
// Get the openflow port number for the interface
ofpPort, err := sw.o... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"UpdatePort",
"(",
"intfName",
"string",
",",
"cfgEp",
"*",
"mastercfg",
".",
"CfgEndpointState",
",",
"pktTag",
",",
"nwPktTag",
",",
"dscp",
"int",
",",
"skipVethPair",
"bool",
")",
"error",
"{",
"// Get OVS port n... | // UpdatePort updates an OVS port without creating it | [
"UpdatePort",
"updates",
"an",
"OVS",
"port",
"without",
"creating",
"it"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L455-L493 |
8,150 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DeletePort | func (sw *OvsSwitch) DeletePort(epOper *drivers.OperEndpointState, skipVethPair bool) error {
if epOper.VtepIP != "" {
return nil
}
// Get the OVS port name
ovsPortName := getOvsPortName(epOper.PortName, skipVethPair)
// Get the openflow port number for the interface and remove from ofnet
ofpPort, err := sw.... | go | func (sw *OvsSwitch) DeletePort(epOper *drivers.OperEndpointState, skipVethPair bool) error {
if epOper.VtepIP != "" {
return nil
}
// Get the OVS port name
ovsPortName := getOvsPortName(epOper.PortName, skipVethPair)
// Get the openflow port number for the interface and remove from ofnet
ofpPort, err := sw.... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DeletePort",
"(",
"epOper",
"*",
"drivers",
".",
"OperEndpointState",
",",
"skipVethPair",
"bool",
")",
"error",
"{",
"if",
"epOper",
".",
"VtepIP",
"!=",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"... | // DeletePort removes a port from OVS | [
"DeletePort",
"removes",
"a",
"port",
"from",
"OVS"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L496-L547 |
8,151 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | vxlanIfName | func vxlanIfName(vtepIP string) string {
return fmt.Sprintf(vxlanIfNameFmt, strings.Replace(vtepIP, ".", "", -1))
} | go | func vxlanIfName(vtepIP string) string {
return fmt.Sprintf(vxlanIfNameFmt, strings.Replace(vtepIP, ".", "", -1))
} | [
"func",
"vxlanIfName",
"(",
"vtepIP",
"string",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"vxlanIfNameFmt",
",",
"strings",
".",
"Replace",
"(",
"vtepIP",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
")",
"\n",
"}"
] | // vxlanIfName returns formatted vxlan interface name | [
"vxlanIfName",
"returns",
"formatted",
"vxlan",
"interface",
"name"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L550-L552 |
8,152 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | CreateVtep | func (sw *OvsSwitch) CreateVtep(vtepIP string) error {
// Create interface name for VTEP
intfName := vxlanIfName(vtepIP)
log.Infof("Creating VTEP intf %s for IP %s", intfName, vtepIP)
// Check if it already exists
isPresent, vsifName := sw.ovsdbDriver.IsVtepPresent(vtepIP)
if !isPresent || (vsifName != intfName... | go | func (sw *OvsSwitch) CreateVtep(vtepIP string) error {
// Create interface name for VTEP
intfName := vxlanIfName(vtepIP)
log.Infof("Creating VTEP intf %s for IP %s", intfName, vtepIP)
// Check if it already exists
isPresent, vsifName := sw.ovsdbDriver.IsVtepPresent(vtepIP)
if !isPresent || (vsifName != intfName... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"CreateVtep",
"(",
"vtepIP",
"string",
")",
"error",
"{",
"// Create interface name for VTEP",
"intfName",
":=",
"vxlanIfName",
"(",
"vtepIP",
")",
"\n\n",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"intfName",
",",
... | // CreateVtep creates a VTEP interface | [
"CreateVtep",
"creates",
"a",
"VTEP",
"interface"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L555-L591 |
8,153 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DeleteVtep | func (sw *OvsSwitch) DeleteVtep(vtepIP string) error {
// Build vtep interface name
intfName := vxlanIfName(vtepIP)
log.Infof("Deleting VTEP intf %s for IP %s", intfName, vtepIP)
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(intfName)
if err != nil {
log.Errorf(... | go | func (sw *OvsSwitch) DeleteVtep(vtepIP string) error {
// Build vtep interface name
intfName := vxlanIfName(vtepIP)
log.Infof("Deleting VTEP intf %s for IP %s", intfName, vtepIP)
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(intfName)
if err != nil {
log.Errorf(... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DeleteVtep",
"(",
"vtepIP",
"string",
")",
"error",
"{",
"// Build vtep interface name",
"intfName",
":=",
"vxlanIfName",
"(",
"vtepIP",
")",
"\n\n",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"intfName",
",",
"vt... | // DeleteVtep deletes a VTEP | [
"DeleteVtep",
"deletes",
"a",
"VTEP"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L594-L618 |
8,154 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | HandleLinkUpdates | func (sw *OvsSwitch) HandleLinkUpdates(linkUpd ofnet.LinkUpdateInfo) {
for intfListObj := range sw.uplinkDb.IterBuffered() {
intfList := intfListObj.Val.([]string)
for _, intf := range intfList {
if intf == linkUpd.LinkName {
portName := intfListObj.Key
portUpds := ofnet.PortUpdates{
PortName: port... | go | func (sw *OvsSwitch) HandleLinkUpdates(linkUpd ofnet.LinkUpdateInfo) {
for intfListObj := range sw.uplinkDb.IterBuffered() {
intfList := intfListObj.Val.([]string)
for _, intf := range intfList {
if intf == linkUpd.LinkName {
portName := intfListObj.Key
portUpds := ofnet.PortUpdates{
PortName: port... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"HandleLinkUpdates",
"(",
"linkUpd",
"ofnet",
".",
"LinkUpdateInfo",
")",
"{",
"for",
"intfListObj",
":=",
"range",
"sw",
".",
"uplinkDb",
".",
"IterBuffered",
"(",
")",
"{",
"intfList",
":=",
"intfListObj",
".",
"... | // HandleLinkUpdates handle link updates and update the datapath | [
"HandleLinkUpdates",
"handle",
"link",
"updates",
"and",
"update",
"the",
"datapath"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L761-L784 |
8,155 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | RemoveUplinks | func (sw *OvsSwitch) RemoveUplinks() error {
var err error
// some error checking
if sw.netType != "vlan" {
log.Fatalf("Can not remove uplink from OVS type %s.", sw.netType)
}
for intfListObj := range sw.uplinkDb.IterBuffered() {
intfList := intfListObj.Val.([]string)
portName := intfListObj.Key
// Rem... | go | func (sw *OvsSwitch) RemoveUplinks() error {
var err error
// some error checking
if sw.netType != "vlan" {
log.Fatalf("Can not remove uplink from OVS type %s.", sw.netType)
}
for intfListObj := range sw.uplinkDb.IterBuffered() {
intfList := intfListObj.Val.([]string)
portName := intfListObj.Key
// Rem... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"RemoveUplinks",
"(",
")",
"error",
"{",
"var",
"err",
"error",
"\n\n",
"// some error checking",
"if",
"sw",
".",
"netType",
"!=",
"\"",
"\"",
"{",
"log",
".",
"Fatalf",
"(",
"\"",
"\"",
",",
"sw",
".",
"net... | // RemoveUplinks removes uplink ports from the OVS | [
"RemoveUplinks",
"removes",
"uplink",
"ports",
"from",
"the",
"OVS"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L787-L830 |
8,156 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | AddHostPort | func (sw *OvsSwitch) AddHostPort(intfName string, intfNum, network int, isHostNS bool) (string, error) {
var err error
// some error checking
if sw.netType != "vxlan" {
log.Fatalf("Can not add host port to OVS type %s.", sw.netType)
}
ovsPortType := ""
ovsPortName := getOvsPortName(intfName, isHostNS)
if isH... | go | func (sw *OvsSwitch) AddHostPort(intfName string, intfNum, network int, isHostNS bool) (string, error) {
var err error
// some error checking
if sw.netType != "vxlan" {
log.Fatalf("Can not add host port to OVS type %s.", sw.netType)
}
ovsPortType := ""
ovsPortName := getOvsPortName(intfName, isHostNS)
if isH... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"AddHostPort",
"(",
"intfName",
"string",
",",
"intfNum",
",",
"network",
"int",
",",
"isHostNS",
"bool",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n\n",
"// some error checking",
"if",
... | // AddHostPort adds a host port to the OVS | [
"AddHostPort",
"adds",
"a",
"host",
"port",
"to",
"the",
"OVS"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L833-L909 |
8,157 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DelHostPort | func (sw *OvsSwitch) DelHostPort(intfName string, isHostNS bool) error {
var err error
ovsPortName := getOvsPortName(intfName, isHostNS)
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(ovsPortName)
if err != nil {
log.Errorf("Could not find the OVS port %s. Err: %v"... | go | func (sw *OvsSwitch) DelHostPort(intfName string, isHostNS bool) error {
var err error
ovsPortName := getOvsPortName(intfName, isHostNS)
// Get the openflow port number for the interface
ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(ovsPortName)
if err != nil {
log.Errorf("Could not find the OVS port %s. Err: %v"... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DelHostPort",
"(",
"intfName",
"string",
",",
"isHostNS",
"bool",
")",
"error",
"{",
"var",
"err",
"error",
"\n\n",
"ovsPortName",
":=",
"getOvsPortName",
"(",
"intfName",
",",
"isHostNS",
")",
"\n",
"// Get the ope... | // DelHostPort removes a host port from the OVS | [
"DelHostPort",
"removes",
"a",
"host",
"port",
"from",
"the",
"OVS"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L912-L941 |
8,158 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DeleteMaster | func (sw *OvsSwitch) DeleteMaster(node core.ServiceInfo) error {
// Build master info
masterInfo := ofnet.OfnetNode{
HostAddr: node.HostAddr,
HostPort: uint16(node.Port),
}
// remove the master
if sw.ofnetAgent != nil {
err := sw.ofnetAgent.RemoveMaster(&masterInfo)
if err != nil {
log.Errorf("Error de... | go | func (sw *OvsSwitch) DeleteMaster(node core.ServiceInfo) error {
// Build master info
masterInfo := ofnet.OfnetNode{
HostAddr: node.HostAddr,
HostPort: uint16(node.Port),
}
// remove the master
if sw.ofnetAgent != nil {
err := sw.ofnetAgent.RemoveMaster(&masterInfo)
if err != nil {
log.Errorf("Error de... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DeleteMaster",
"(",
"node",
"core",
".",
"ServiceInfo",
")",
"error",
"{",
"// Build master info",
"masterInfo",
":=",
"ofnet",
".",
"OfnetNode",
"{",
"HostAddr",
":",
"node",
".",
"HostAddr",
",",
"HostPort",
":",
... | // DeleteMaster deletes master node | [
"DeleteMaster",
"deletes",
"master",
"node"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L966-L983 |
8,159 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | AddBgp | func (sw *OvsSwitch) AddBgp(hostname string, routerIP string,
As string, neighborAs, neighbor string) error {
if sw.netType == "vlan" && sw.ofnetAgent != nil {
err := sw.ofnetAgent.AddBgp(routerIP, As, neighborAs, neighbor)
if err != nil {
log.Errorf("Error adding BGP server")
return err
}
}
return nil... | go | func (sw *OvsSwitch) AddBgp(hostname string, routerIP string,
As string, neighborAs, neighbor string) error {
if sw.netType == "vlan" && sw.ofnetAgent != nil {
err := sw.ofnetAgent.AddBgp(routerIP, As, neighborAs, neighbor)
if err != nil {
log.Errorf("Error adding BGP server")
return err
}
}
return nil... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"AddBgp",
"(",
"hostname",
"string",
",",
"routerIP",
"string",
",",
"As",
"string",
",",
"neighborAs",
",",
"neighbor",
"string",
")",
"error",
"{",
"if",
"sw",
".",
"netType",
"==",
"\"",
"\"",
"&&",
"sw",
... | // AddBgp adds a bgp config to host | [
"AddBgp",
"adds",
"a",
"bgp",
"config",
"to",
"host"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L986-L997 |
8,160 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DeleteBgp | func (sw *OvsSwitch) DeleteBgp() error {
if sw.netType == "vlan" && sw.ofnetAgent != nil {
// Delete vlan/vni mapping
err := sw.ofnetAgent.DeleteBgp()
if err != nil {
log.Errorf("Error removing bgp server Err: %v", err)
return err
}
}
return nil
} | go | func (sw *OvsSwitch) DeleteBgp() error {
if sw.netType == "vlan" && sw.ofnetAgent != nil {
// Delete vlan/vni mapping
err := sw.ofnetAgent.DeleteBgp()
if err != nil {
log.Errorf("Error removing bgp server Err: %v", err)
return err
}
}
return nil
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DeleteBgp",
"(",
")",
"error",
"{",
"if",
"sw",
".",
"netType",
"==",
"\"",
"\"",
"&&",
"sw",
".",
"ofnetAgent",
"!=",
"nil",
"{",
"// Delete vlan/vni mapping",
"err",
":=",
"sw",
".",
"ofnetAgent",
".",
"Dele... | // DeleteBgp deletes bgp config from host | [
"DeleteBgp",
"deletes",
"bgp",
"config",
"from",
"host"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1000-L1011 |
8,161 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | AddSvcSpec | func (sw *OvsSwitch) AddSvcSpec(svcName string, spec *ofnet.ServiceSpec) error {
log.Infof("OvsSwitch AddSvcSpec %s", svcName)
if sw.ofnetAgent != nil {
return sw.ofnetAgent.AddSvcSpec(svcName, spec)
}
return nil
} | go | func (sw *OvsSwitch) AddSvcSpec(svcName string, spec *ofnet.ServiceSpec) error {
log.Infof("OvsSwitch AddSvcSpec %s", svcName)
if sw.ofnetAgent != nil {
return sw.ofnetAgent.AddSvcSpec(svcName, spec)
}
return nil
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"AddSvcSpec",
"(",
"svcName",
"string",
",",
"spec",
"*",
"ofnet",
".",
"ServiceSpec",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"svcName",
")",
"\n",
"if",
"sw",
".",
"ofnetAgent",
"!=",
... | // AddSvcSpec invokes ofnetAgent api | [
"AddSvcSpec",
"invokes",
"ofnetAgent",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1014-L1021 |
8,162 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | DelSvcSpec | func (sw *OvsSwitch) DelSvcSpec(svcName string, spec *ofnet.ServiceSpec) error {
if sw.ofnetAgent != nil {
return sw.ofnetAgent.DelSvcSpec(svcName, spec)
}
return nil
} | go | func (sw *OvsSwitch) DelSvcSpec(svcName string, spec *ofnet.ServiceSpec) error {
if sw.ofnetAgent != nil {
return sw.ofnetAgent.DelSvcSpec(svcName, spec)
}
return nil
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"DelSvcSpec",
"(",
"svcName",
"string",
",",
"spec",
"*",
"ofnet",
".",
"ServiceSpec",
")",
"error",
"{",
"if",
"sw",
".",
"ofnetAgent",
"!=",
"nil",
"{",
"return",
"sw",
".",
"ofnetAgent",
".",
"DelSvcSpec",
"... | // DelSvcSpec invokes ofnetAgent api | [
"DelSvcSpec",
"invokes",
"ofnetAgent",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1024-L1030 |
8,163 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | SvcProviderUpdate | func (sw *OvsSwitch) SvcProviderUpdate(svcName string, providers []string) {
if sw.ofnetAgent != nil {
sw.ofnetAgent.SvcProviderUpdate(svcName, providers)
}
} | go | func (sw *OvsSwitch) SvcProviderUpdate(svcName string, providers []string) {
if sw.ofnetAgent != nil {
sw.ofnetAgent.SvcProviderUpdate(svcName, providers)
}
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"SvcProviderUpdate",
"(",
"svcName",
"string",
",",
"providers",
"[",
"]",
"string",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"!=",
"nil",
"{",
"sw",
".",
"ofnetAgent",
".",
"SvcProviderUpdate",
"(",
"svcName",
"... | // SvcProviderUpdate invokes ofnetAgent api | [
"SvcProviderUpdate",
"invokes",
"ofnetAgent",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1033-L1037 |
8,164 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | GetEndpointStats | func (sw *OvsSwitch) GetEndpointStats() (map[string]*ofnet.OfnetEndpointStats, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
stats, err := sw.ofnetAgent.GetEndpointStats()
if err != nil {
log.Errorf("Error: %v", err)
return nil, err
}
log.Debugf("stats: %+v", stats)
retur... | go | func (sw *OvsSwitch) GetEndpointStats() (map[string]*ofnet.OfnetEndpointStats, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
stats, err := sw.ofnetAgent.GetEndpointStats()
if err != nil {
log.Errorf("Error: %v", err)
return nil, err
}
log.Debugf("stats: %+v", stats)
retur... | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"GetEndpointStats",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"ofnet",
".",
"OfnetEndpointStats",
",",
"error",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
... | // GetEndpointStats invokes ofnetAgent api | [
"GetEndpointStats",
"invokes",
"ofnetAgent",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1040-L1054 |
8,165 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | InspectState | func (sw *OvsSwitch) InspectState() (interface{}, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
return sw.ofnetAgent.InspectState()
} | go | func (sw *OvsSwitch) InspectState() (interface{}, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
return sw.ofnetAgent.InspectState()
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"InspectState",
"(",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
... | // InspectState ireturns ofnet state in json form | [
"InspectState",
"ireturns",
"ofnet",
"state",
"in",
"json",
"form"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1057-L1062 |
8,166 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | InspectBgp | func (sw *OvsSwitch) InspectBgp() (interface{}, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
return sw.ofnetAgent.InspectBgp()
} | go | func (sw *OvsSwitch) InspectBgp() (interface{}, error) {
if sw.ofnetAgent == nil {
return nil, errors.New("no ofnet agent")
}
return sw.ofnetAgent.InspectBgp()
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"InspectBgp",
"(",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
... | // InspectBgp returns ofnet state in json form | [
"InspectBgp",
"returns",
"ofnet",
"state",
"in",
"json",
"form"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1065-L1070 |
8,167 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | GlobalConfigUpdate | func (sw *OvsSwitch) GlobalConfigUpdate(cfg ofnet.OfnetGlobalConfig) error {
if sw.ofnetAgent == nil {
return errors.New("no ofnet agent")
}
return sw.ofnetAgent.GlobalConfigUpdate(cfg)
} | go | func (sw *OvsSwitch) GlobalConfigUpdate(cfg ofnet.OfnetGlobalConfig) error {
if sw.ofnetAgent == nil {
return errors.New("no ofnet agent")
}
return sw.ofnetAgent.GlobalConfigUpdate(cfg)
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"GlobalConfigUpdate",
"(",
"cfg",
"ofnet",
".",
"OfnetGlobalConfig",
")",
"error",
"{",
"if",
"sw",
".",
"ofnetAgent",
"==",
"nil",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
... | // GlobalConfigUpdate updates the global configs like arp-mode | [
"GlobalConfigUpdate",
"updates",
"the",
"global",
"configs",
"like",
"arp",
"-",
"mode"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1073-L1078 |
8,168 | contiv/netplugin | drivers/ovsd/ovsSwitch.go | AddNameServer | func (sw *OvsSwitch) AddNameServer(ns ofnet.NameServer) {
if sw.ofnetAgent != nil {
sw.ofnetAgent.AddNameServer(ns)
}
} | go | func (sw *OvsSwitch) AddNameServer(ns ofnet.NameServer) {
if sw.ofnetAgent != nil {
sw.ofnetAgent.AddNameServer(ns)
}
} | [
"func",
"(",
"sw",
"*",
"OvsSwitch",
")",
"AddNameServer",
"(",
"ns",
"ofnet",
".",
"NameServer",
")",
"{",
"if",
"sw",
".",
"ofnetAgent",
"!=",
"nil",
"{",
"sw",
".",
"ofnetAgent",
".",
"AddNameServer",
"(",
"ns",
")",
"\n",
"}",
"\n",
"}"
] | // AddNameServer returns ofnet state in json form | [
"AddNameServer",
"returns",
"ofnet",
"state",
"in",
"json",
"form"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/drivers/ovsd/ovsSwitch.go#L1081-L1085 |
8,169 | contiv/netplugin | mgmtfn/k8splugin/kubeClient.go | NewAPIClient | func NewAPIClient(serverURL, caFile, keyFile, certFile, authToken string) *APIClient {
useClientCerts := true
c := APIClient{}
c.apiServerPort = 6443 // default
port := strings.Split(serverURL, ":")
if len(port) > 0 {
if v, err := strconv.ParseUint(port[len(port)-1], 10, 16); err == nil {
c.apiServerPort = u... | go | func NewAPIClient(serverURL, caFile, keyFile, certFile, authToken string) *APIClient {
useClientCerts := true
c := APIClient{}
c.apiServerPort = 6443 // default
port := strings.Split(serverURL, ":")
if len(port) > 0 {
if v, err := strconv.ParseUint(port[len(port)-1], 10, 16); err == nil {
c.apiServerPort = u... | [
"func",
"NewAPIClient",
"(",
"serverURL",
",",
"caFile",
",",
"keyFile",
",",
"certFile",
",",
"authToken",
"string",
")",
"*",
"APIClient",
"{",
"useClientCerts",
":=",
"true",
"\n",
"c",
":=",
"APIClient",
"{",
"}",
"\n\n",
"c",
".",
"apiServerPort",
"="... | // NewAPIClient creates an instance of the k8s api client | [
"NewAPIClient",
"creates",
"an",
"instance",
"of",
"the",
"k8s",
"api",
"client"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/kubeClient.go#L88-L146 |
8,170 | contiv/netplugin | mgmtfn/k8splugin/kubeClient.go | fetchPodLabels | func (c *APIClient) fetchPodLabels(ns, name string) error {
var data interface{}
// initiate a get request to the api server
podURL := c.baseURL + ns + "/pods/" + name
req, err := http.NewRequest("GET", podURL, nil)
if err != nil {
return err
}
if len(strings.TrimSpace(c.authToken)) > 0 {
req.Header.Set("Au... | go | func (c *APIClient) fetchPodLabels(ns, name string) error {
var data interface{}
// initiate a get request to the api server
podURL := c.baseURL + ns + "/pods/" + name
req, err := http.NewRequest("GET", podURL, nil)
if err != nil {
return err
}
if len(strings.TrimSpace(c.authToken)) > 0 {
req.Header.Set("Au... | [
"func",
"(",
"c",
"*",
"APIClient",
")",
"fetchPodLabels",
"(",
"ns",
",",
"name",
"string",
")",
"error",
"{",
"var",
"data",
"interface",
"{",
"}",
"\n\n",
"// initiate a get request to the api server",
"podURL",
":=",
"c",
".",
"baseURL",
"+",
"ns",
"+",
... | // fetchPodLabels retrieves the labels from the podspec metadata | [
"fetchPodLabels",
"retrieves",
"the",
"labels",
"from",
"the",
"podspec",
"metadata"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/kubeClient.go#L157-L227 |
8,171 | contiv/netplugin | mgmtfn/k8splugin/kubeClient.go | GetPodLabel | func (c *APIClient) GetPodLabel(ns, name, label string) (string, error) {
// If cache does not match, fetch
if c.podCache.nameSpace != ns || c.podCache.name != name {
err := c.fetchPodLabels(ns, name)
if err != nil {
return "", err
}
}
c.podCache.labelsMutex.Lock()
defer c.podCache.labelsMutex.Unlock()
... | go | func (c *APIClient) GetPodLabel(ns, name, label string) (string, error) {
// If cache does not match, fetch
if c.podCache.nameSpace != ns || c.podCache.name != name {
err := c.fetchPodLabels(ns, name)
if err != nil {
return "", err
}
}
c.podCache.labelsMutex.Lock()
defer c.podCache.labelsMutex.Unlock()
... | [
"func",
"(",
"c",
"*",
"APIClient",
")",
"GetPodLabel",
"(",
"ns",
",",
"name",
",",
"label",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"// If cache does not match, fetch",
"if",
"c",
".",
"podCache",
".",
"nameSpace",
"!=",
"ns",
"||",
"c",
... | // GetPodLabel retrieves the specified label | [
"GetPodLabel",
"retrieves",
"the",
"specified",
"label"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/kubeClient.go#L230-L251 |
8,172 | contiv/netplugin | mgmtfn/k8splugin/kubeClient.go | WatchSvcEps | func (c *APIClient) WatchSvcEps(respCh chan EpWatchResp) {
ctx, _ := context.WithCancel(context.Background())
go func() {
// Make request to Kubernetes API
getURL := c.watchBase + "endpoints"
req, err := http.NewRequest("GET", getURL, nil)
if err != nil {
respCh <- EpWatchResp{opcode: "FATAL", errStr: fmt... | go | func (c *APIClient) WatchSvcEps(respCh chan EpWatchResp) {
ctx, _ := context.WithCancel(context.Background())
go func() {
// Make request to Kubernetes API
getURL := c.watchBase + "endpoints"
req, err := http.NewRequest("GET", getURL, nil)
if err != nil {
respCh <- EpWatchResp{opcode: "FATAL", errStr: fmt... | [
"func",
"(",
"c",
"*",
"APIClient",
")",
"WatchSvcEps",
"(",
"respCh",
"chan",
"EpWatchResp",
")",
"{",
"ctx",
",",
"_",
":=",
"context",
".",
"WithCancel",
"(",
"context",
".",
"Background",
"(",
")",
")",
"\n\n",
"go",
"func",
"(",
")",
"{",
"// Ma... | // WatchSvcEps watches the service endpoints object | [
"WatchSvcEps",
"watches",
"the",
"service",
"endpoints",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/kubeClient.go#L341-L408 |
8,173 | contiv/netplugin | netmaster/mastercfg/policyRuleState.go | ReadAll | func (s *CfgPolicyRule) ReadAll() ([]core.State, error) {
return s.StateDriver.ReadAllState(policyRuleConfigPathPrefix, s, json.Unmarshal)
} | go | func (s *CfgPolicyRule) ReadAll() ([]core.State, error) {
return s.StateDriver.ReadAllState(policyRuleConfigPathPrefix, s, json.Unmarshal)
} | [
"func",
"(",
"s",
"*",
"CfgPolicyRule",
")",
"ReadAll",
"(",
")",
"(",
"[",
"]",
"core",
".",
"State",
",",
"error",
")",
"{",
"return",
"s",
".",
"StateDriver",
".",
"ReadAllState",
"(",
"policyRuleConfigPathPrefix",
",",
"s",
",",
"json",
".",
"Unmar... | // ReadAll reads all state objects for the policy rules. | [
"ReadAll",
"reads",
"all",
"state",
"objects",
"for",
"the",
"policy",
"rules",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/mastercfg/policyRuleState.go#L50-L52 |
8,174 | contiv/netplugin | netmaster/mastercfg/policyRuleState.go | WatchAll | func (s *CfgPolicyRule) WatchAll(rsps chan core.WatchState) error {
return s.StateDriver.WatchAllState(policyRuleConfigPathPrefix, s, json.Unmarshal,
rsps)
} | go | func (s *CfgPolicyRule) WatchAll(rsps chan core.WatchState) error {
return s.StateDriver.WatchAllState(policyRuleConfigPathPrefix, s, json.Unmarshal,
rsps)
} | [
"func",
"(",
"s",
"*",
"CfgPolicyRule",
")",
"WatchAll",
"(",
"rsps",
"chan",
"core",
".",
"WatchState",
")",
"error",
"{",
"return",
"s",
".",
"StateDriver",
".",
"WatchAllState",
"(",
"policyRuleConfigPathPrefix",
",",
"s",
",",
"json",
".",
"Unmarshal",
... | // WatchAll fills a channel on each state event related to policy rules. | [
"WatchAll",
"fills",
"a",
"channel",
"on",
"each",
"state",
"event",
"related",
"to",
"policy",
"rules",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/mastercfg/policyRuleState.go#L55-L58 |
8,175 | contiv/netplugin | netmaster/mastercfg/policyRuleState.go | addPolicyRuleState | func addPolicyRuleState(ofnetRule *ofnet.OfnetPolicyRule) error {
ruleCfg := &CfgPolicyRule{}
ruleCfg.StateDriver = stateStore
ruleCfg.OfnetPolicyRule = (*ofnetRule)
// Save the rule
return ruleCfg.Write()
} | go | func addPolicyRuleState(ofnetRule *ofnet.OfnetPolicyRule) error {
ruleCfg := &CfgPolicyRule{}
ruleCfg.StateDriver = stateStore
ruleCfg.OfnetPolicyRule = (*ofnetRule)
// Save the rule
return ruleCfg.Write()
} | [
"func",
"addPolicyRuleState",
"(",
"ofnetRule",
"*",
"ofnet",
".",
"OfnetPolicyRule",
")",
"error",
"{",
"ruleCfg",
":=",
"&",
"CfgPolicyRule",
"{",
"}",
"\n",
"ruleCfg",
".",
"StateDriver",
"=",
"stateStore",
"\n",
"ruleCfg",
".",
"OfnetPolicyRule",
"=",
"(",... | // addPolicyRuleState adds policy rule to state store | [
"addPolicyRuleState",
"adds",
"policy",
"rule",
"to",
"state",
"store"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/mastercfg/policyRuleState.go#L67-L74 |
8,176 | contiv/netplugin | netmaster/mastercfg/policyRuleState.go | delPolicyRuleState | func delPolicyRuleState(ofnetRule *ofnet.OfnetPolicyRule) error {
ruleCfg := &CfgPolicyRule{}
ruleCfg.StateDriver = stateStore
ruleCfg.OfnetPolicyRule = (*ofnetRule)
// Delete the rule
return ruleCfg.Clear()
} | go | func delPolicyRuleState(ofnetRule *ofnet.OfnetPolicyRule) error {
ruleCfg := &CfgPolicyRule{}
ruleCfg.StateDriver = stateStore
ruleCfg.OfnetPolicyRule = (*ofnetRule)
// Delete the rule
return ruleCfg.Clear()
} | [
"func",
"delPolicyRuleState",
"(",
"ofnetRule",
"*",
"ofnet",
".",
"OfnetPolicyRule",
")",
"error",
"{",
"ruleCfg",
":=",
"&",
"CfgPolicyRule",
"{",
"}",
"\n",
"ruleCfg",
".",
"StateDriver",
"=",
"stateStore",
"\n",
"ruleCfg",
".",
"OfnetPolicyRule",
"=",
"(",... | // delPolicyRuleState deletes policy rule from state store | [
"delPolicyRuleState",
"deletes",
"policy",
"rule",
"from",
"state",
"store"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/mastercfg/policyRuleState.go#L77-L84 |
8,177 | contiv/netplugin | utils/netwrapper.go | ListenWrapper | func ListenWrapper(l net.Listener) net.Listener {
return &contivListener{
Listener: l,
cond: sync.NewCond(&sync.Mutex{})}
} | go | func ListenWrapper(l net.Listener) net.Listener {
return &contivListener{
Listener: l,
cond: sync.NewCond(&sync.Mutex{})}
} | [
"func",
"ListenWrapper",
"(",
"l",
"net",
".",
"Listener",
")",
"net",
".",
"Listener",
"{",
"return",
"&",
"contivListener",
"{",
"Listener",
":",
"l",
",",
"cond",
":",
"sync",
".",
"NewCond",
"(",
"&",
"sync",
".",
"Mutex",
"{",
"}",
")",
"}",
"... | // ListenWrapper is a wrapper over net.Listener | [
"ListenWrapper",
"is",
"a",
"wrapper",
"over",
"net",
".",
"Listener"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/utils/netwrapper.go#L24-L28 |
8,178 | contiv/netplugin | utils/netwrapper.go | Accept | func (s *contivListener) Accept() (net.Conn, error) {
s.incrementRef()
defer s.decrementRef()
return s.Listener.Accept()
} | go | func (s *contivListener) Accept() (net.Conn, error) {
s.incrementRef()
defer s.decrementRef()
return s.Listener.Accept()
} | [
"func",
"(",
"s",
"*",
"contivListener",
")",
"Accept",
"(",
")",
"(",
"net",
".",
"Conn",
",",
"error",
")",
"{",
"s",
".",
"incrementRef",
"(",
")",
"\n",
"defer",
"s",
".",
"decrementRef",
"(",
")",
"\n",
"return",
"s",
".",
"Listener",
".",
"... | // Accept is a wrapper over regular Accept call
// which also maintains the refCnt | [
"Accept",
"is",
"a",
"wrapper",
"over",
"regular",
"Accept",
"call",
"which",
"also",
"maintains",
"the",
"refCnt"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/utils/netwrapper.go#L54-L58 |
8,179 | contiv/netplugin | utils/netwrapper.go | Close | func (s *contivListener) Close() error {
if err := s.Listener.Close(); err != nil {
return err
}
s.cond.L.Lock()
for s.refCnt > 0 {
s.cond.Wait()
}
s.cond.L.Unlock()
return nil
} | go | func (s *contivListener) Close() error {
if err := s.Listener.Close(); err != nil {
return err
}
s.cond.L.Lock()
for s.refCnt > 0 {
s.cond.Wait()
}
s.cond.L.Unlock()
return nil
} | [
"func",
"(",
"s",
"*",
"contivListener",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"s",
".",
"Listener",
".",
"Close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"s",
".",
"cond",
".",
"L",
".",
... | // Close closes the contivListener. | [
"Close",
"closes",
"the",
"contivListener",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/utils/netwrapper.go#L61-L72 |
8,180 | contiv/netplugin | mgmtfn/k8splugin/contivk8s/clients/network.go | NewNWClient | func NewNWClient() *NWClient {
c := NWClient{}
c.baseURL = nwURL
transport := &http.Transport{Dial: unixDial}
c.client = &http.Client{Transport: transport}
return &c
} | go | func NewNWClient() *NWClient {
c := NWClient{}
c.baseURL = nwURL
transport := &http.Transport{Dial: unixDial}
c.client = &http.Client{Transport: transport}
return &c
} | [
"func",
"NewNWClient",
"(",
")",
"*",
"NWClient",
"{",
"c",
":=",
"NWClient",
"{",
"}",
"\n",
"c",
".",
"baseURL",
"=",
"nwURL",
"\n\n",
"transport",
":=",
"&",
"http",
".",
"Transport",
"{",
"Dial",
":",
"unixDial",
"}",
"\n",
"c",
".",
"client",
... | // NewNWClient creates an instance of the network driver client | [
"NewNWClient",
"creates",
"an",
"instance",
"of",
"the",
"network",
"driver",
"client"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/contivk8s/clients/network.go#L46-L54 |
8,181 | contiv/netplugin | mgmtfn/k8splugin/contivk8s/clients/network.go | AddPod | func (c *NWClient) AddPod(podInfo interface{}) (*cniapi.RspAddPod, error) {
data := cniapi.RspAddPod{}
buf, err := json.Marshal(podInfo)
if err != nil {
return nil, err
}
body := bytes.NewBuffer(buf)
url := c.baseURL + cniapi.EPAddURL
r, err := c.client.Post(url, "application/json", body)
if err != nil {
... | go | func (c *NWClient) AddPod(podInfo interface{}) (*cniapi.RspAddPod, error) {
data := cniapi.RspAddPod{}
buf, err := json.Marshal(podInfo)
if err != nil {
return nil, err
}
body := bytes.NewBuffer(buf)
url := c.baseURL + cniapi.EPAddURL
r, err := c.client.Post(url, "application/json", body)
if err != nil {
... | [
"func",
"(",
"c",
"*",
"NWClient",
")",
"AddPod",
"(",
"podInfo",
"interface",
"{",
"}",
")",
"(",
"*",
"cniapi",
".",
"RspAddPod",
",",
"error",
")",
"{",
"data",
":=",
"cniapi",
".",
"RspAddPod",
"{",
"}",
"\n",
"buf",
",",
"err",
":=",
"json",
... | // AddPod adds a pod to contiv using the cni api | [
"AddPod",
"adds",
"a",
"pod",
"to",
"contiv",
"using",
"the",
"cni",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/contivk8s/clients/network.go#L57-L107 |
8,182 | contiv/netplugin | mgmtfn/k8splugin/contivk8s/clients/network.go | DelPod | func (c *NWClient) DelPod(podInfo interface{}) error {
buf, err := json.Marshal(podInfo)
if err != nil {
return err
}
body := bytes.NewBuffer(buf)
url := c.baseURL + cniapi.EPDelURL
r, err := c.client.Post(url, "application/json", body)
if err != nil {
return err
}
defer r.Body.Close()
switch {
case r... | go | func (c *NWClient) DelPod(podInfo interface{}) error {
buf, err := json.Marshal(podInfo)
if err != nil {
return err
}
body := bytes.NewBuffer(buf)
url := c.baseURL + cniapi.EPDelURL
r, err := c.client.Post(url, "application/json", body)
if err != nil {
return err
}
defer r.Body.Close()
switch {
case r... | [
"func",
"(",
"c",
"*",
"NWClient",
")",
"DelPod",
"(",
"podInfo",
"interface",
"{",
"}",
")",
"error",
"{",
"buf",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"podInfo",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n... | // DelPod deletes a pod from contiv using the cni api | [
"DelPod",
"deletes",
"a",
"pod",
"from",
"contiv",
"using",
"the",
"cni",
"api"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/mgmtfn/k8splugin/contivk8s/clients/network.go#L110-L136 |
8,183 | contiv/netplugin | netmaster/objApi/apiController.go | NewAPIController | func NewAPIController(router *mux.Router, objdbClient objdb.API, configs *APIControllerConfig) *APIController {
ctrler := new(APIController)
ctrler.router = router
ctrler.objdbClient = objdbClient
// init modeldb
modeldb.Init(&objdbClient)
// initialize the model objects
contivModel.Init()
// Register Callba... | go | func NewAPIController(router *mux.Router, objdbClient objdb.API, configs *APIControllerConfig) *APIController {
ctrler := new(APIController)
ctrler.router = router
ctrler.objdbClient = objdbClient
// init modeldb
modeldb.Init(&objdbClient)
// initialize the model objects
contivModel.Init()
// Register Callba... | [
"func",
"NewAPIController",
"(",
"router",
"*",
"mux",
".",
"Router",
",",
"objdbClient",
"objdb",
".",
"API",
",",
"configs",
"*",
"APIControllerConfig",
")",
"*",
"APIController",
"{",
"ctrler",
":=",
"new",
"(",
"APIController",
")",
"\n",
"ctrler",
".",
... | // NewAPIController creates a new controller | [
"NewAPIController",
"creates",
"a",
"new",
"controller"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L79-L124 |
8,184 | contiv/netplugin | netmaster/objApi/apiController.go | GlobalGetOper | func (ac *APIController) GlobalGetOper(global *contivModel.GlobalInspect) error {
log.Infof("Received GlobalInspect: %+v", global)
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
gOper := &gstate.Oper{}
gOper.StateDriver = stateDriver
err = gOper.Read("")
if err != nil {
log.Errorf... | go | func (ac *APIController) GlobalGetOper(global *contivModel.GlobalInspect) error {
log.Infof("Received GlobalInspect: %+v", global)
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
gOper := &gstate.Oper{}
gOper.StateDriver = stateDriver
err = gOper.Read("")
if err != nil {
log.Errorf... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"GlobalGetOper",
"(",
"global",
"*",
"contivModel",
".",
"GlobalInspect",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"global",
")",
"\n\n",
"stateDriver",
",",
"err",
":=",
"utils",
".",
... | // GlobalGetOper retrieves glboal operational information | [
"GlobalGetOper",
"retrieves",
"glboal",
"operational",
"information"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L169-L198 |
8,185 | contiv/netplugin | netmaster/objApi/apiController.go | GlobalCreate | func (ac *APIController) GlobalCreate(global *contivModel.Global) error {
log.Infof("Received GlobalCreate: %+v", global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
// Build global config
gCfg := intent.ConfigGlobal{
NwInfraType: global.NetworkInfraType,... | go | func (ac *APIController) GlobalCreate(global *contivModel.Global) error {
log.Infof("Received GlobalCreate: %+v", global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
// Build global config
gCfg := intent.ConfigGlobal{
NwInfraType: global.NetworkInfraType,... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"GlobalCreate",
"(",
"global",
"*",
"contivModel",
".",
"Global",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"global",
")",
"\n\n",
"// Get the state driver",
"stateDriver",
",",
"err",
":=",... | // GlobalCreate creates global state | [
"GlobalCreate",
"creates",
"global",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L201-L228 |
8,186 | contiv/netplugin | netmaster/objApi/apiController.go | GlobalUpdate | func (ac *APIController) GlobalUpdate(global, params *contivModel.Global) error {
log.Infof("Received GlobalUpdate: %+v. Old: %+v", params, global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
gCfg := &gstate.Cfg{}
gCfg.StateDriver = stateDriver
numVlans, _... | go | func (ac *APIController) GlobalUpdate(global, params *contivModel.Global) error {
log.Infof("Received GlobalUpdate: %+v. Old: %+v", params, global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
gCfg := &gstate.Cfg{}
gCfg.StateDriver = stateDriver
numVlans, _... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"GlobalUpdate",
"(",
"global",
",",
"params",
"*",
"contivModel",
".",
"Global",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"params",
",",
"global",
")",
"\n\n",
"// Get the state driver",
... | // GlobalUpdate updates global state | [
"GlobalUpdate",
"updates",
"global",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L231-L315 |
8,187 | contiv/netplugin | netmaster/objApi/apiController.go | GlobalDelete | func (ac *APIController) GlobalDelete(global *contivModel.Global) error {
log.Infof("Received GlobalDelete: %+v", global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
// Delete global state
err = master.DeleteGlobal(stateDriver)
if err != nil {
log.Errorf... | go | func (ac *APIController) GlobalDelete(global *contivModel.Global) error {
log.Infof("Received GlobalDelete: %+v", global)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
// Delete global state
err = master.DeleteGlobal(stateDriver)
if err != nil {
log.Errorf... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"GlobalDelete",
"(",
"global",
"*",
"contivModel",
".",
"Global",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"global",
")",
"\n\n",
"// Get the state driver",
"stateDriver",
",",
"err",
":=",... | // GlobalDelete is not supported | [
"GlobalDelete",
"is",
"not",
"supported"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L318-L334 |
8,188 | contiv/netplugin | netmaster/objApi/apiController.go | AciGwCreate | func (ac *APIController) AciGwCreate(aci *contivModel.AciGw) error {
log.Infof("Received AciGwCreate: %+v", aci)
// Fail the create if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
log.Warnf("AciGwCreate: %d existing App-Profiles found.",
profCount)
}
return nil
} | go | func (ac *APIController) AciGwCreate(aci *contivModel.AciGw) error {
log.Infof("Received AciGwCreate: %+v", aci)
// Fail the create if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
log.Warnf("AciGwCreate: %d existing App-Profiles found.",
profCount)
}
return nil
} | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AciGwCreate",
"(",
"aci",
"*",
"contivModel",
".",
"AciGw",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"aci",
")",
"\n",
"// Fail the create if app profiles exist",
"profCount",
":=",
"contivM... | // AciGwCreate creates aci state | [
"AciGwCreate",
"creates",
"aci",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L337-L347 |
8,189 | contiv/netplugin | netmaster/objApi/apiController.go | AciGwUpdate | func (ac *APIController) AciGwUpdate(aci, params *contivModel.AciGw) error {
log.Infof("Received AciGwUpdate: %+v", params)
// Fail the update if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
log.Warnf("AciGwUpdate: %d existing App-Profiles found.",
profCount)
}
aci.En... | go | func (ac *APIController) AciGwUpdate(aci, params *contivModel.AciGw) error {
log.Infof("Received AciGwUpdate: %+v", params)
// Fail the update if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
log.Warnf("AciGwUpdate: %d existing App-Profiles found.",
profCount)
}
aci.En... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AciGwUpdate",
"(",
"aci",
",",
"params",
"*",
"contivModel",
".",
"AciGw",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"params",
")",
"\n",
"// Fail the update if app profiles exist",
"profCoun... | // AciGwUpdate updates aci state | [
"AciGwUpdate",
"updates",
"aci",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L350-L365 |
8,190 | contiv/netplugin | netmaster/objApi/apiController.go | AciGwDelete | func (ac *APIController) AciGwDelete(aci *contivModel.AciGw) error {
log.Infof("Received AciGwDelete")
// Fail the delete if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
return core.Errorf("%d App-Profiles found. Delete them first",
profCount)
}
return nil
} | go | func (ac *APIController) AciGwDelete(aci *contivModel.AciGw) error {
log.Infof("Received AciGwDelete")
// Fail the delete if app profiles exist
profCount := contivModel.GetAppProfileCount()
if profCount != 0 {
return core.Errorf("%d App-Profiles found. Delete them first",
profCount)
}
return nil
} | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AciGwDelete",
"(",
"aci",
"*",
"contivModel",
".",
"AciGw",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
")",
"\n",
"// Fail the delete if app profiles exist",
"profCount",
":=",
"contivModel",
".",
... | // AciGwDelete deletes aci state | [
"AciGwDelete",
"deletes",
"aci",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L368-L378 |
8,191 | contiv/netplugin | netmaster/objApi/apiController.go | AciGwGetOper | func (ac *APIController) AciGwGetOper(op *contivModel.AciGwInspect) error {
op.Oper.NumAppProfiles = contivModel.GetAppProfileCount()
return nil
} | go | func (ac *APIController) AciGwGetOper(op *contivModel.AciGwInspect) error {
op.Oper.NumAppProfiles = contivModel.GetAppProfileCount()
return nil
} | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AciGwGetOper",
"(",
"op",
"*",
"contivModel",
".",
"AciGwInspect",
")",
"error",
"{",
"op",
".",
"Oper",
".",
"NumAppProfiles",
"=",
"contivModel",
".",
"GetAppProfileCount",
"(",
")",
"\n",
"return",
"nil",
"... | // AciGwGetOper provides operational info for the aci object | [
"AciGwGetOper",
"provides",
"operational",
"info",
"for",
"the",
"aci",
"object"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L381-L384 |
8,192 | contiv/netplugin | netmaster/objApi/apiController.go | AppProfileCreate | func (ac *APIController) AppProfileCreate(prof *contivModel.AppProfile) error {
log.Infof("Received AppProfileCreate: %+v", prof)
// Make sure tenant exists
if prof.TenantName == "" {
return core.Errorf("Invalid tenant name")
}
tenant := contivModel.FindTenant(prof.TenantName)
if tenant == nil {
return core... | go | func (ac *APIController) AppProfileCreate(prof *contivModel.AppProfile) error {
log.Infof("Received AppProfileCreate: %+v", prof)
// Make sure tenant exists
if prof.TenantName == "" {
return core.Errorf("Invalid tenant name")
}
tenant := contivModel.FindTenant(prof.TenantName)
if tenant == nil {
return core... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AppProfileCreate",
"(",
"prof",
"*",
"contivModel",
".",
"AppProfile",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"prof",
")",
"\n\n",
"// Make sure tenant exists",
"if",
"prof",
".",
"Tenan... | // AppProfileCreate creates app profile state | [
"AppProfileCreate",
"creates",
"app",
"profile",
"state"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L387-L427 |
8,193 | contiv/netplugin | netmaster/objApi/apiController.go | AppProfileUpdate | func (ac *APIController) AppProfileUpdate(oldProf, newProf *contivModel.AppProfile) error {
log.Infof("Received AppProfileUpdate: %+v, newProf: %+v", oldProf, newProf)
// handle any epg addition
for _, epg := range newProf.EndpointGroups {
epgKey := newProf.TenantName + ":" + epg
log.Infof("Add %s to %s", epgKe... | go | func (ac *APIController) AppProfileUpdate(oldProf, newProf *contivModel.AppProfile) error {
log.Infof("Received AppProfileUpdate: %+v, newProf: %+v", oldProf, newProf)
// handle any epg addition
for _, epg := range newProf.EndpointGroups {
epgKey := newProf.TenantName + ":" + epg
log.Infof("Add %s to %s", epgKe... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AppProfileUpdate",
"(",
"oldProf",
",",
"newProf",
"*",
"contivModel",
".",
"AppProfile",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"oldProf",
",",
"newProf",
")",
"\n\n",
"// handle any ep... | // AppProfileUpdate updates app | [
"AppProfileUpdate",
"updates",
"app"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L430-L483 |
8,194 | contiv/netplugin | netmaster/objApi/apiController.go | AppProfileDelete | func (ac *APIController) AppProfileDelete(prof *contivModel.AppProfile) error {
log.Infof("Received AppProfileDelete: %+v", prof)
tenant := contivModel.FindTenant(prof.TenantName)
if tenant == nil {
return core.Errorf("Tenant %s not found", prof.TenantName)
}
DeleteAppNw(prof)
// remove all links
for _, epg... | go | func (ac *APIController) AppProfileDelete(prof *contivModel.AppProfile) error {
log.Infof("Received AppProfileDelete: %+v", prof)
tenant := contivModel.FindTenant(prof.TenantName)
if tenant == nil {
return core.Errorf("Tenant %s not found", prof.TenantName)
}
DeleteAppNw(prof)
// remove all links
for _, epg... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"AppProfileDelete",
"(",
"prof",
"*",
"contivModel",
".",
"AppProfile",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"prof",
")",
"\n\n",
"tenant",
":=",
"contivModel",
".",
"FindTenant",
"("... | // AppProfileDelete delete the app | [
"AppProfileDelete",
"delete",
"the",
"app"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L486-L514 |
8,195 | contiv/netplugin | netmaster/objApi/apiController.go | EndpointGetOper | func (ac *APIController) EndpointGetOper(endpoint *contivModel.EndpointInspect) error {
log.Infof("Received EndpointInspect: %+v", endpoint)
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
readEp := &mastercfg.CfgEndpointState{}
readEp.StateDriver = stateDriver
// TODO avoid linear re... | go | func (ac *APIController) EndpointGetOper(endpoint *contivModel.EndpointInspect) error {
log.Infof("Received EndpointInspect: %+v", endpoint)
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
readEp := &mastercfg.CfgEndpointState{}
readEp.StateDriver = stateDriver
// TODO avoid linear re... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"EndpointGetOper",
"(",
"endpoint",
"*",
"contivModel",
".",
"EndpointInspect",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"endpoint",
")",
"\n\n",
"stateDriver",
",",
"err",
":=",
"utils",
... | // EndpointGetOper retrieves glboal operational information | [
"EndpointGetOper",
"retrieves",
"glboal",
"operational",
"information"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L517-L562 |
8,196 | contiv/netplugin | netmaster/objApi/apiController.go | endpointGroupCleanup | func endpointGroupCleanup(endpointGroup *contivModel.EndpointGroup) error {
// delete the endpoint group state
err := master.DeleteEndpointGroup(endpointGroup.TenantName, endpointGroup.GroupName)
if err != nil {
log.Errorf("Error deleting endpoint group %+v. Err: %v", endpointGroup, err)
return err
}
// Detac... | go | func endpointGroupCleanup(endpointGroup *contivModel.EndpointGroup) error {
// delete the endpoint group state
err := master.DeleteEndpointGroup(endpointGroup.TenantName, endpointGroup.GroupName)
if err != nil {
log.Errorf("Error deleting endpoint group %+v. Err: %v", endpointGroup, err)
return err
}
// Detac... | [
"func",
"endpointGroupCleanup",
"(",
"endpointGroup",
"*",
"contivModel",
".",
"EndpointGroup",
")",
"error",
"{",
"// delete the endpoint group state",
"err",
":=",
"master",
".",
"DeleteEndpointGroup",
"(",
"endpointGroup",
".",
"TenantName",
",",
"endpointGroup",
"."... | // Cleans up state off endpointGroup and related objects. | [
"Cleans",
"up",
"state",
"off",
"endpointGroup",
"and",
"related",
"objects",
"."
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L579-L630 |
8,197 | contiv/netplugin | netmaster/objApi/apiController.go | EndpointGroupGetOper | func (ac *APIController) EndpointGroupGetOper(endpointGroup *contivModel.EndpointGroupInspect) error {
log.Infof("Received EndpointGroupInspect: %+v", endpointGroup)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
epgCfg := &mastercfg.EndpointGroupState{}
epgCf... | go | func (ac *APIController) EndpointGroupGetOper(endpointGroup *contivModel.EndpointGroupInspect) error {
log.Infof("Received EndpointGroupInspect: %+v", endpointGroup)
// Get the state driver
stateDriver, err := utils.GetStateDriver()
if err != nil {
return err
}
epgCfg := &mastercfg.EndpointGroupState{}
epgCf... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"EndpointGroupGetOper",
"(",
"endpointGroup",
"*",
"contivModel",
".",
"EndpointGroupInspect",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"endpointGroup",
")",
"\n\n",
"// Get the state driver",
"s... | // EndpointGroupGetOper inspects endpointGroup | [
"EndpointGroupGetOper",
"inspects",
"endpointGroup"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L942-L1003 |
8,198 | contiv/netplugin | netmaster/objApi/apiController.go | EndpointGroupDelete | func (ac *APIController) EndpointGroupDelete(endpointGroup *contivModel.EndpointGroup) error {
log.Infof("Received EndpointGroupDelete: %+v", endpointGroup)
// if this is associated with an app profile, reject the delete
if endpointGroup.Links.AppProfile.ObjKey != "" {
return core.Errorf("Cannot delete %s, associ... | go | func (ac *APIController) EndpointGroupDelete(endpointGroup *contivModel.EndpointGroup) error {
log.Infof("Received EndpointGroupDelete: %+v", endpointGroup)
// if this is associated with an app profile, reject the delete
if endpointGroup.Links.AppProfile.ObjKey != "" {
return core.Errorf("Cannot delete %s, associ... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"EndpointGroupDelete",
"(",
"endpointGroup",
"*",
"contivModel",
".",
"EndpointGroup",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"endpointGroup",
")",
"\n\n",
"// if this is associated with an app p... | // EndpointGroupDelete deletes end point group | [
"EndpointGroupDelete",
"deletes",
"end",
"point",
"group"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L1006-L1047 |
8,199 | contiv/netplugin | netmaster/objApi/apiController.go | NetworkCreate | func (ac *APIController) NetworkCreate(network *contivModel.Network) error {
log.Infof("Received NetworkCreate: %+v", network)
// Make sure global settings is valid
if err := validateGlobalConfig(network.Encap); err != nil {
return fmt.Errorf("Global configuration is not ready: %v", err.Error())
}
// Make sure... | go | func (ac *APIController) NetworkCreate(network *contivModel.Network) error {
log.Infof("Received NetworkCreate: %+v", network)
// Make sure global settings is valid
if err := validateGlobalConfig(network.Encap); err != nil {
return fmt.Errorf("Global configuration is not ready: %v", err.Error())
}
// Make sure... | [
"func",
"(",
"ac",
"*",
"APIController",
")",
"NetworkCreate",
"(",
"network",
"*",
"contivModel",
".",
"Network",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"network",
")",
"\n\n",
"// Make sure global settings is valid",
"if",
"err",
":=... | // NetworkCreate creates network | [
"NetworkCreate",
"creates",
"network"
] | 965773066d2b8ebed3514979949061a03d46fd20 | https://github.com/contiv/netplugin/blob/965773066d2b8ebed3514979949061a03d46fd20/netmaster/objApi/apiController.go#L1050-L1139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.