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 list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
143,900 | die-net/lrucache | twotier/twotier.go | New | func New(first, second httpcache.Cache) *TwoTier {
if first == nil || second == nil || first == second {
return nil
}
return &TwoTier{first: first, second: second}
} | go | func New(first, second httpcache.Cache) *TwoTier {
if first == nil || second == nil || first == second {
return nil
}
return &TwoTier{first: first, second: second}
} | [
"func",
"New",
"(",
"first",
",",
"second",
"httpcache",
".",
"Cache",
")",
"*",
"TwoTier",
"{",
"if",
"first",
"==",
"nil",
"||",
"second",
"==",
"nil",
"||",
"first",
"==",
"second",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"&",
"TwoTier",
... | // New creates a TwoTier. Both first and second must be non-nil. | [
"New",
"creates",
"a",
"TwoTier",
".",
"Both",
"first",
"and",
"second",
"must",
"be",
"non",
"-",
"nil",
"."
] | 19a39ef22a11a471b23c3beb9cb39903f6cff332 | https://github.com/die-net/lrucache/blob/19a39ef22a11a471b23c3beb9cb39903f6cff332/twotier/twotier.go#L18-L23 |
143,901 | die-net/lrucache | twotier/twotier.go | Delete | func (c *TwoTier) Delete(key string) {
c.second.Delete(key)
c.first.Delete(key)
} | go | func (c *TwoTier) Delete(key string) {
c.second.Delete(key)
c.first.Delete(key)
} | [
"func",
"(",
"c",
"*",
"TwoTier",
")",
"Delete",
"(",
"key",
"string",
")",
"{",
"c",
".",
"second",
".",
"Delete",
"(",
"key",
")",
"\n",
"c",
".",
"first",
".",
"Delete",
"(",
"key",
")",
"\n",
"}"
] | // Delete removes the value associated with a key from both the first and
// second tier caches. | [
"Delete",
"removes",
"the",
"value",
"associated",
"with",
"a",
"key",
"from",
"both",
"the",
"first",
"and",
"second",
"tier",
"caches",
"."
] | 19a39ef22a11a471b23c3beb9cb39903f6cff332 | https://github.com/die-net/lrucache/blob/19a39ef22a11a471b23c3beb9cb39903f6cff332/twotier/twotier.go#L54-L57 |
143,902 | die-net/lrucache | lrucache.go | New | func New(maxSize, maxAge int64) *LruCache {
c := &LruCache{
MaxSize: maxSize,
MaxAge: maxAge,
lru: list.New(),
cache: make(map[string]*list.Element),
}
return c
} | go | func New(maxSize, maxAge int64) *LruCache {
c := &LruCache{
MaxSize: maxSize,
MaxAge: maxAge,
lru: list.New(),
cache: make(map[string]*list.Element),
}
return c
} | [
"func",
"New",
"(",
"maxSize",
",",
"maxAge",
"int64",
")",
"*",
"LruCache",
"{",
"c",
":=",
"&",
"LruCache",
"{",
"MaxSize",
":",
"maxSize",
",",
"MaxAge",
":",
"maxAge",
",",
"lru",
":",
"list",
".",
"New",
"(",
")",
",",
"cache",
":",
"make",
... | // New creates an LruCache that will restrict itself to maxSize bytes of
// memory. If maxAge > 0, entries will also be expired after maxAge
// seconds. | [
"New",
"creates",
"an",
"LruCache",
"that",
"will",
"restrict",
"itself",
"to",
"maxSize",
"bytes",
"of",
"memory",
".",
"If",
"maxAge",
">",
"0",
"entries",
"will",
"also",
"be",
"expired",
"after",
"maxAge",
"seconds",
"."
] | 19a39ef22a11a471b23c3beb9cb39903f6cff332 | https://github.com/die-net/lrucache/blob/19a39ef22a11a471b23c3beb9cb39903f6cff332/lrucache.go#L28-L37 |
143,903 | die-net/lrucache | lrucache.go | Delete | func (c *LruCache) Delete(key string) {
c.mu.Lock()
if le, ok := c.cache[key]; ok {
c.deleteElement(le)
}
c.mu.Unlock()
} | go | func (c *LruCache) Delete(key string) {
c.mu.Lock()
if le, ok := c.cache[key]; ok {
c.deleteElement(le)
}
c.mu.Unlock()
} | [
"func",
"(",
"c",
"*",
"LruCache",
")",
"Delete",
"(",
"key",
"string",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n\n",
"if",
"le",
",",
"ok",
":=",
"c",
".",
"cache",
"[",
"key",
"]",
";",
"ok",
"{",
"c",
".",
"deleteElement",
"(",
... | // Delete removes the value associated with a key. | [
"Delete",
"removes",
"the",
"value",
"associated",
"with",
"a",
"key",
"."
] | 19a39ef22a11a471b23c3beb9cb39903f6cff332 | https://github.com/die-net/lrucache/blob/19a39ef22a11a471b23c3beb9cb39903f6cff332/lrucache.go#L92-L100 |
143,904 | die-net/lrucache | lrucache.go | Size | func (c *LruCache) Size() int64 {
c.mu.Lock()
size := c.size
c.mu.Unlock()
return size
} | go | func (c *LruCache) Size() int64 {
c.mu.Lock()
size := c.size
c.mu.Unlock()
return size
} | [
"func",
"(",
"c",
"*",
"LruCache",
")",
"Size",
"(",
")",
"int64",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"size",
":=",
"c",
".",
"size",
"\n",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"size",
"\n",
"}"
] | // Size returns the estimated current memory usage of LruCache. | [
"Size",
"returns",
"the",
"estimated",
"current",
"memory",
"usage",
"of",
"LruCache",
"."
] | 19a39ef22a11a471b23c3beb9cb39903f6cff332 | https://github.com/die-net/lrucache/blob/19a39ef22a11a471b23c3beb9cb39903f6cff332/lrucache.go#L103-L109 |
143,905 | vmware/photon-controller-go-sdk | photon/disks.go | Get | func (api *DisksAPI) Get(diskID string) (disk *PersistentDisk, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+diskUrl+diskID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
disk = &PersistentDisk{}
e... | go | func (api *DisksAPI) Get(diskID string) (disk *PersistentDisk, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+diskUrl+diskID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
disk = &PersistentDisk{}
e... | [
"func",
"(",
"api",
"*",
"DisksAPI",
")",
"Get",
"(",
"diskID",
"string",
")",
"(",
"disk",
"*",
"PersistentDisk",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client... | // Gets a PersistentDisk for the disk with specified ID. | [
"Gets",
"a",
"PersistentDisk",
"for",
"the",
"disk",
"with",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/disks.go#L25-L38 |
143,906 | vmware/photon-controller-go-sdk | photon/disks.go | Delete | func (api *DisksAPI) Delete(diskID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+diskUrl+diskID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *DisksAPI) Delete(diskID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+diskUrl+diskID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"DisksAPI",
")",
"Delete",
"(",
"diskID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"client",
... | // Deletes a disk with the specified ID. | [
"Deletes",
"a",
"disk",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/disks.go#L41-L49 |
143,907 | vmware/photon-controller-go-sdk | photon/disks.go | GetIam | func (api *DisksAPI) GetIam(id string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+diskUrl+id+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
err = json.NewDecod... | go | func (api *DisksAPI) GetIam(id string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+diskUrl+id+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
err = json.NewDecod... | [
"func",
"(",
"api",
"*",
"DisksAPI",
")",
"GetIam",
"(",
"id",
"string",
")",
"(",
"policy",
"[",
"]",
"*",
"RoleBinding",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".... | // Gets IAM Policy on a disk. | [
"Gets",
"IAM",
"Policy",
"on",
"a",
"disk",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/disks.go#L69-L83 |
143,908 | vmware/photon-controller-go-sdk | photon/disks.go | ModifyIam | func (api *DisksAPI) ModifyIam(id string, policyDelta []*RoleBindingDelta) (task *Task, err error) {
body, err := json.Marshal(policyDelta)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+diskUrl+id+"/iam",
"application/json",
bytes.NewReader(body),
api.client.options... | go | func (api *DisksAPI) ModifyIam(id string, policyDelta []*RoleBindingDelta) (task *Task, err error) {
body, err := json.Marshal(policyDelta)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+diskUrl+id+"/iam",
"application/json",
bytes.NewReader(body),
api.client.options... | [
"func",
"(",
"api",
"*",
"DisksAPI",
")",
"ModifyIam",
"(",
"id",
"string",
",",
"policyDelta",
"[",
"]",
"*",
"RoleBindingDelta",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
... | // Modifies IAM Policy on a disk. | [
"Modifies",
"IAM",
"Policy",
"on",
"a",
"disk",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/disks.go#L105-L121 |
143,909 | vmware/photon-controller-go-sdk | photon/flavors.go | Create | func (api *FlavorsAPI) Create(spec *FlavorCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+flavorUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
ret... | go | func (api *FlavorsAPI) Create(spec *FlavorCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+flavorUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
ret... | [
"func",
"(",
"api",
"*",
"FlavorsAPI",
")",
"Create",
"(",
"spec",
"*",
"FlavorCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"spec",
")",
"\n",
"if",
"err",
"!=",
... | // Creates a flavor. | [
"Creates",
"a",
"flavor",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/flavors.go#L31-L47 |
143,910 | vmware/photon-controller-go-sdk | photon/flavors.go | Get | func (api *FlavorsAPI) Get(flavorID string) (flavor *Flavor, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+flavorUrl+"/"+flavorID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
flavor = &Flavor{}
e... | go | func (api *FlavorsAPI) Get(flavorID string) (flavor *Flavor, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+flavorUrl+"/"+flavorID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
flavor = &Flavor{}
e... | [
"func",
"(",
"api",
"*",
"FlavorsAPI",
")",
"Get",
"(",
"flavorID",
"string",
")",
"(",
"flavor",
"*",
"Flavor",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",... | // Gets details of flavor with specified ID. | [
"Gets",
"details",
"of",
"flavor",
"with",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/flavors.go#L50-L63 |
143,911 | vmware/photon-controller-go-sdk | photon/flavors.go | GetAll | func (api *FlavorsAPI) GetAll(options *FlavorGetOptions) (flavors *FlavorList, err error) {
uri := api.client.Endpoint + flavorUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
... | go | func (api *FlavorsAPI) GetAll(options *FlavorGetOptions) (flavors *FlavorList, err error) {
uri := api.client.Endpoint + flavorUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
... | [
"func",
"(",
"api",
"*",
"FlavorsAPI",
")",
"GetAll",
"(",
"options",
"*",
"FlavorGetOptions",
")",
"(",
"flavors",
"*",
"FlavorList",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"flavorUrl",
"\n",
"if",
"opt... | // Gets flavors using options to filter results. Returns all flavors if options is nil. | [
"Gets",
"flavors",
"using",
"options",
"to",
"filter",
"results",
".",
"Returns",
"all",
"flavors",
"if",
"options",
"is",
"nil",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/flavors.go#L66-L79 |
143,912 | vmware/photon-controller-go-sdk | photon/flavors.go | Delete | func (api *FlavorsAPI) Delete(flavorID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+flavorUrl+"/"+flavorID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *FlavorsAPI) Delete(flavorID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+flavorUrl+"/"+flavorID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"FlavorsAPI",
")",
"Delete",
"(",
"flavorID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"client... | // Deletes flavor with specified ID. | [
"Deletes",
"flavor",
"with",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/flavors.go#L82-L90 |
143,913 | vmware/photon-controller-go-sdk | photon/subnets.go | Create | func (api *SubnetsAPI) Create(subnetSpec *SubnetCreateSpec) (task *Task, err error) {
body, err := json.Marshal(subnetSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+subnetUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !=... | go | func (api *SubnetsAPI) Create(subnetSpec *SubnetCreateSpec) (task *Task, err error) {
body, err := json.Marshal(subnetSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+subnetUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !=... | [
"func",
"(",
"api",
"*",
"SubnetsAPI",
")",
"Create",
"(",
"subnetSpec",
"*",
"SubnetCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"subnetSpec",
")",
"\n",
"if",
"err... | // Creates a portgroup. | [
"Creates",
"a",
"portgroup",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/subnets.go#L30-L46 |
143,914 | vmware/photon-controller-go-sdk | photon/subnets.go | Get | func (api *SubnetsAPI) Get(id string) (subnet *Subnet, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+subnetUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Subnet
err = json.New... | go | func (api *SubnetsAPI) Get(id string) (subnet *Subnet, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+subnetUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Subnet
err = json.New... | [
"func",
"(",
"api",
"*",
"SubnetsAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"subnet",
"*",
"Subnet",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
"."... | // Gets a subnet with the specified ID. | [
"Gets",
"a",
"subnet",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/subnets.go#L62-L75 |
143,915 | vmware/photon-controller-go-sdk | photon/subnets.go | Update | func (api *SubnetsAPI) Update(id string, subnetSpec *SubnetUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(subnetSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+subnetUrl+"/"+id,
"application/json",
bytes.NewReader(body),
api.client.options.Toke... | go | func (api *SubnetsAPI) Update(id string, subnetSpec *SubnetUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(subnetSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+subnetUrl+"/"+id,
"application/json",
bytes.NewReader(body),
api.client.options.Toke... | [
"func",
"(",
"api",
"*",
"SubnetsAPI",
")",
"Update",
"(",
"id",
"string",
",",
"subnetSpec",
"*",
"SubnetUpdateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"subnetSpec",
... | // Updates subnet's attributes. | [
"Updates",
"subnet",
"s",
"attributes",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/subnets.go#L78-L96 |
143,916 | vmware/photon-controller-go-sdk | photon/subnets.go | GetAll | func (api *SubnetsAPI) GetAll(options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + subnetUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
re... | go | func (api *SubnetsAPI) GetAll(options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + subnetUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
re... | [
"func",
"(",
"api",
"*",
"SubnetsAPI",
")",
"GetAll",
"(",
"options",
"*",
"SubnetGetOptions",
")",
"(",
"result",
"*",
"Subnets",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"subnetUrl",
"\n",
"if",
"options... | // Returns all subnets | [
"Returns",
"all",
"subnets"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/subnets.go#L99-L112 |
143,917 | vmware/photon-controller-go-sdk | photon/subnets.go | SetDefault | func (api *SubnetsAPI) SetDefault(id string) (task *Task, err error) {
res, err := api.client.restClient.Post(
api.client.Endpoint+subnetUrl+"/"+id+"/set_default",
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err =... | go | func (api *SubnetsAPI) SetDefault(id string) (task *Task, err error) {
res, err := api.client.restClient.Post(
api.client.Endpoint+subnetUrl+"/"+id+"/set_default",
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err =... | [
"func",
"(",
"api",
"*",
"SubnetsAPI",
")",
"SetDefault",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Post",
"(",
"api",
".",
"client",
... | // Sets default subnet. | [
"Sets",
"default",
"subnet",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/subnets.go#L115-L127 |
143,918 | vmware/photon-controller-go-sdk | photon/infrastructure.go | SyncHostsConfig | func (api *InfraAPI) SyncHostsConfig() (task *Task, err error) {
res, err := api.client.restClient.Post(
api.client.Endpoint+infraUrl+"/sync-hosts-config",
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTas... | go | func (api *InfraAPI) SyncHostsConfig() (task *Task, err error) {
res, err := api.client.restClient.Post(
api.client.Endpoint+infraUrl+"/sync-hosts-config",
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTas... | [
"func",
"(",
"api",
"*",
"InfraAPI",
")",
"SyncHostsConfig",
"(",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Post",
"(",
"api",
".",
"client",
".",
"Endpoint... | // Synchronizes hosts configurations | [
"Synchronizes",
"hosts",
"configurations"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/infrastructure.go#L25-L38 |
143,919 | vmware/photon-controller-go-sdk | photon/infrastructure.go | SetImageDatastores | func (api *InfraAPI) SetImageDatastores(imageDatastores *ImageDatastores) (task *Task, err error) {
body, err := json.Marshal(imageDatastores)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+infraUrl+"/image-datastores",
"application/json",
bytes.NewReader(body),
api.... | go | func (api *InfraAPI) SetImageDatastores(imageDatastores *ImageDatastores) (task *Task, err error) {
body, err := json.Marshal(imageDatastores)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+infraUrl+"/image-datastores",
"application/json",
bytes.NewReader(body),
api.... | [
"func",
"(",
"api",
"*",
"InfraAPI",
")",
"SetImageDatastores",
"(",
"imageDatastores",
"*",
"ImageDatastores",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"imageDatastores",
")",
"... | // Set image datastores. | [
"Set",
"image",
"datastores",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/infrastructure.go#L41-L59 |
143,920 | vmware/photon-controller-go-sdk | photon/system.go | GetSystemStatus | func (api *SystemAPI) GetSystemStatus() (status *Status, err error) {
res, err := api.client.restClient.Get(api.getEndpointUrl("status"), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
status = &Status{}
err = json.NewDecod... | go | func (api *SystemAPI) GetSystemStatus() (status *Status, err error) {
res, err := api.client.restClient.Get(api.getEndpointUrl("status"), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
status = &Status{}
err = json.NewDecod... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"GetSystemStatus",
"(",
")",
"(",
"status",
"*",
"Status",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"getEndpointUrl",
"(",... | // Get status of photon controller | [
"Get",
"status",
"of",
"photon",
"controller"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L25-L38 |
143,921 | vmware/photon-controller-go-sdk | photon/system.go | PauseBackgroundTasks | func (api *SystemAPI) PauseBackgroundTasks() (task *Task, err error) {
res, err := api.client.restClient.Post(
api.getEndpointUrl("pause-background-tasks"),
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTa... | go | func (api *SystemAPI) PauseBackgroundTasks() (task *Task, err error) {
res, err := api.client.restClient.Post(
api.getEndpointUrl("pause-background-tasks"),
"application/json",
bytes.NewReader([]byte("")),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTa... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"PauseBackgroundTasks",
"(",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Post",
"(",
"api",
".",
"getEndpointUrl",
"(... | // Pause system background tasks. | [
"Pause",
"system",
"background",
"tasks",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L73-L86 |
143,922 | vmware/photon-controller-go-sdk | photon/system.go | SetSecurityGroups | func (api *SystemAPI) SetSecurityGroups(securityGroups *SecurityGroupsSpec) (task *Task, err error) {
body, err := json.Marshal(securityGroups)
if err != nil {
return
}
url := api.getEndpointUrl("set-security-groups")
res, err := api.client.restClient.Post(
url,
"application/json",
bytes.NewReader(body),
... | go | func (api *SystemAPI) SetSecurityGroups(securityGroups *SecurityGroupsSpec) (task *Task, err error) {
body, err := json.Marshal(securityGroups)
if err != nil {
return
}
url := api.getEndpointUrl("set-security-groups")
res, err := api.client.restClient.Post(
url,
"application/json",
bytes.NewReader(body),
... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"SetSecurityGroups",
"(",
"securityGroups",
"*",
"SecurityGroupsSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"securityGroups",
")",
... | // Sets security groups for the system | [
"Sets",
"security",
"groups",
"for",
"the",
"system"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L105-L122 |
143,923 | vmware/photon-controller-go-sdk | photon/system.go | GetAuthInfo | func (api *SystemAPI) GetAuthInfo() (info *AuthInfo, err error) {
res, err := api.client.restClient.Get(api.getEndpointUrl("auth"), nil)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
info = &AuthInfo{}
err = json.NewDecoder(res.Body).Decode(info)
return
... | go | func (api *SystemAPI) GetAuthInfo() (info *AuthInfo, err error) {
res, err := api.client.restClient.Get(api.getEndpointUrl("auth"), nil)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
info = &AuthInfo{}
err = json.NewDecoder(res.Body).Decode(info)
return
... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"GetAuthInfo",
"(",
")",
"(",
"info",
"*",
"AuthInfo",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"getEndpointUrl",
"(",
"... | // Gets authentication info. | [
"Gets",
"authentication",
"info",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L141-L154 |
143,924 | vmware/photon-controller-go-sdk | photon/system.go | GetSystemVms | func (api *SystemAPI) GetSystemVms() (result *VMs, err error) {
res, err := api.client.restClient.GetList(api.client.Endpoint, api.getEndpointUrl("vms"),
api.client.options.TokenOptions)
if err != nil {
return
}
result = &VMs{}
err = json.Unmarshal(res, result)
return
} | go | func (api *SystemAPI) GetSystemVms() (result *VMs, err error) {
res, err := api.client.restClient.GetList(api.client.Endpoint, api.getEndpointUrl("vms"),
api.client.options.TokenOptions)
if err != nil {
return
}
result = &VMs{}
err = json.Unmarshal(res, result)
return
} | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"GetSystemVms",
"(",
")",
"(",
"result",
"*",
"VMs",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"GetList",
"(",
"api",
".",
"client",
".",
"Endpoi... | // Gets all the system vms | [
"Gets",
"all",
"the",
"system",
"vms"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L157-L167 |
143,925 | vmware/photon-controller-go-sdk | photon/system.go | EnableServiceType | func (api *SystemAPI) EnableServiceType(serviceConfigSpec *ServiceConfigurationSpec) (task *Task, err error) {
body, err := json.Marshal(serviceConfigSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.getEndpointUrl("enable-service-type"),
"application/json",
bytes.NewReader(body),
... | go | func (api *SystemAPI) EnableServiceType(serviceConfigSpec *ServiceConfigurationSpec) (task *Task, err error) {
body, err := json.Marshal(serviceConfigSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.getEndpointUrl("enable-service-type"),
"application/json",
bytes.NewReader(body),
... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"EnableServiceType",
"(",
"serviceConfigSpec",
"*",
"ServiceConfigurationSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"serviceConfigSpec... | // Enable service type | [
"Enable",
"service",
"type"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L170-L187 |
143,926 | vmware/photon-controller-go-sdk | photon/system.go | ConfigureNsx | func (api *SystemAPI) ConfigureNsx(nsxConfigSpec *NsxConfigurationSpec) (task *Task, err error) {
body, err := json.Marshal(nsxConfigSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.getEndpointUrl("configure-nsx"),
"application/json",
bytes.NewReader(body),
api.client.options.To... | go | func (api *SystemAPI) ConfigureNsx(nsxConfigSpec *NsxConfigurationSpec) (task *Task, err error) {
body, err := json.Marshal(nsxConfigSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.getEndpointUrl("configure-nsx"),
"application/json",
bytes.NewReader(body),
api.client.options.To... | [
"func",
"(",
"api",
"*",
"SystemAPI",
")",
"ConfigureNsx",
"(",
"nsxConfigSpec",
"*",
"NsxConfigurationSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"nsxConfigSpec",
")",
"\n",... | // Configure NSX. | [
"Configure",
"NSX",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/system.go#L210-L228 |
143,927 | vmware/photon-controller-go-sdk | photon/datastores.go | GetAll | func (api *DatastoresAPI) GetAll() (result *Datastores, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+datastoresURL, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
result = &Datastores{}
err = json.... | go | func (api *DatastoresAPI) GetAll() (result *Datastores, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+datastoresURL, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
result = &Datastores{}
err = json.... | [
"func",
"(",
"api",
"*",
"DatastoresAPI",
")",
"GetAll",
"(",
")",
"(",
"result",
"*",
"Datastores",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
".",
"Endpo... | // GetAll returns all datastores; requires system administrator privileges | [
"GetAll",
"returns",
"all",
"datastores",
";",
"requires",
"system",
"administrator",
"privileges"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/datastores.go#L24-L37 |
143,928 | vmware/photon-controller-go-sdk | photon/datastores.go | Get | func (api *DatastoresAPI) Get(id string) (datastore *Datastore, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+datastoresURL+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Datastore... | go | func (api *DatastoresAPI) Get(id string) (datastore *Datastore, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+datastoresURL+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Datastore... | [
"func",
"(",
"api",
"*",
"DatastoresAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"datastore",
"*",
"Datastore",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"clien... | // Get returns a single datastore with the specified ID; requires system administrator privileges | [
"Get",
"returns",
"a",
"single",
"datastore",
"with",
"the",
"specified",
"ID",
";",
"requires",
"system",
"administrator",
"privileges"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/datastores.go#L40-L53 |
143,929 | vmware/photon-controller-go-sdk | photon/routers.go | Get | func (api *RoutersAPI) Get(id string) (router *Router, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+routerUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Router
err = json.NewDeco... | go | func (api *RoutersAPI) Get(id string) (router *Router, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+routerUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Router
err = json.NewDeco... | [
"func",
"(",
"api",
"*",
"RoutersAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"router",
"*",
"Router",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
"."... | // Gets a router with the specified ID. | [
"Gets",
"a",
"router",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/routers.go#L25-L38 |
143,930 | vmware/photon-controller-go-sdk | photon/routers.go | UpdateRouter | func (api *RoutersAPI) UpdateRouter(id string, routerSpec *RouterUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(routerSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+routerUrl+id,
"application/json",
bytes.NewReader(body),
api.client.options.To... | go | func (api *RoutersAPI) UpdateRouter(id string, routerSpec *RouterUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(routerSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+routerUrl+id,
"application/json",
bytes.NewReader(body),
api.client.options.To... | [
"func",
"(",
"api",
"*",
"RoutersAPI",
")",
"UpdateRouter",
"(",
"id",
"string",
",",
"routerSpec",
"*",
"RouterUpdateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"routerSpe... | // Updates router's attributes. | [
"Updates",
"router",
"s",
"attributes",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/routers.go#L41-L59 |
143,931 | vmware/photon-controller-go-sdk | photon/routers.go | Delete | func (api *RoutersAPI) Delete(routerID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+routerUrl+routerID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *RoutersAPI) Delete(routerID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+routerUrl+routerID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"RoutersAPI",
")",
"Delete",
"(",
"routerID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"client... | // Deletes a router with specified ID. | [
"Deletes",
"a",
"router",
"with",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/routers.go#L62-L71 |
143,932 | vmware/photon-controller-go-sdk | photon/routers.go | GetSubnets | func (api *RoutersAPI) GetSubnets(routerID string, options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + routerUrl + routerID + "/subnets"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.To... | go | func (api *RoutersAPI) GetSubnets(routerID string, options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + routerUrl + routerID + "/subnets"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.To... | [
"func",
"(",
"api",
"*",
"RoutersAPI",
")",
"GetSubnets",
"(",
"routerID",
"string",
",",
"options",
"*",
"SubnetGetOptions",
")",
"(",
"result",
"*",
"Subnets",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"r... | // Gets subnets for router with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"subnets",
"for",
"router",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/routers.go#L94-L107 |
143,933 | vmware/photon-controller-go-sdk | photon/zones.go | Create | func (api *ZonesAPI) Create(zoneSpec *ZoneCreateSpec) (task *Task, err error) {
body, err := json.Marshal(zoneSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+zoneUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
r... | go | func (api *ZonesAPI) Create(zoneSpec *ZoneCreateSpec) (task *Task, err error) {
body, err := json.Marshal(zoneSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+zoneUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
r... | [
"func",
"(",
"api",
"*",
"ZonesAPI",
")",
"Create",
"(",
"zoneSpec",
"*",
"ZoneCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"zoneSpec",
")",
"\n",
"if",
"err",
"!=... | // Creates zone. | [
"Creates",
"zone",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/zones.go#L25-L41 |
143,934 | vmware/photon-controller-go-sdk | photon/zones.go | Get | func (api *ZonesAPI) Get(id string) (zone *Zone, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(id), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
zone = &Zone{}
err = json.NewDecoder(res.Body).Decode(... | go | func (api *ZonesAPI) Get(id string) (zone *Zone, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(id), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
zone = &Zone{}
err = json.NewDecoder(res.Body).Decode(... | [
"func",
"(",
"api",
"*",
"ZonesAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"zone",
"*",
"Zone",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"getEntityUrl",
"("... | // Gets zone with the specified ID. | [
"Gets",
"zone",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/zones.go#L44-L57 |
143,935 | vmware/photon-controller-go-sdk | photon/zones.go | GetAll | func (api *ZonesAPI) GetAll() (result *Zones, err error) {
uri := api.client.Endpoint + zoneUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Zones{}
err = json.Unmarshal(res, result)
return
} | go | func (api *ZonesAPI) GetAll() (result *Zones, err error) {
uri := api.client.Endpoint + zoneUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Zones{}
err = json.Unmarshal(res, result)
return
} | [
"func",
"(",
"api",
"*",
"ZonesAPI",
")",
"GetAll",
"(",
")",
"(",
"result",
"*",
"Zones",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"zoneUrl",
"\n",
"res",
",",
"err",
":=",
"api",
".",
"client",
"."... | // Returns all zones on an photon instance. | [
"Returns",
"all",
"zones",
"on",
"an",
"photon",
"instance",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/zones.go#L60-L70 |
143,936 | vmware/photon-controller-go-sdk | photon/infrastructure_hosts.go | Create | func (api *InfraHostsAPI) Create(hostSpec *HostCreateSpec) (task *Task, err error) {
body, err := json.Marshal(hostSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+InfraHostsUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !... | go | func (api *InfraHostsAPI) Create(hostSpec *HostCreateSpec) (task *Task, err error) {
body, err := json.Marshal(hostSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+InfraHostsUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !... | [
"func",
"(",
"api",
"*",
"InfraHostsAPI",
")",
"Create",
"(",
"hostSpec",
"*",
"HostCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"hostSpec",
")",
"\n",
"if",
"err",
... | // Register a host with photon platform | [
"Register",
"a",
"host",
"with",
"photon",
"platform"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/infrastructure_hosts.go#L25-L41 |
143,937 | vmware/photon-controller-go-sdk | photon/infrastructure_hosts.go | GetHosts | func (api *InfraHostsAPI) GetHosts() (result *Hosts, err error) {
uri := api.client.Endpoint + InfraHostsUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Hosts{}
err = json.Unmarshal(res, result)
return
} | go | func (api *InfraHostsAPI) GetHosts() (result *Hosts, err error) {
uri := api.client.Endpoint + InfraHostsUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Hosts{}
err = json.Unmarshal(res, result)
return
} | [
"func",
"(",
"api",
"*",
"InfraHostsAPI",
")",
"GetHosts",
"(",
")",
"(",
"result",
"*",
"Hosts",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"InfraHostsUrl",
"\n",
"res",
",",
"err",
":=",
"api",
".",
"c... | // Gets all hosts. | [
"Gets",
"all",
"hosts",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/infrastructure_hosts.go#L44-L54 |
143,938 | vmware/photon-controller-go-sdk | photon/infrastructure_hosts.go | GetVMs | func (api *InfraHostsAPI) GetVMs(id string) (result *VMs, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+InfraHostsUrl+"/"+id+"/vms", api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
result = &VMs{}
er... | go | func (api *InfraHostsAPI) GetVMs(id string) (result *VMs, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+InfraHostsUrl+"/"+id+"/vms", api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
result = &VMs{}
er... | [
"func",
"(",
"api",
"*",
"InfraHostsAPI",
")",
"GetVMs",
"(",
"id",
"string",
")",
"(",
"result",
"*",
"VMs",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
... | // Gets all the VMs with the specified host ID. | [
"Gets",
"all",
"the",
"VMs",
"with",
"the",
"specified",
"host",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/infrastructure_hosts.go#L100-L113 |
143,939 | vmware/photon-controller-go-sdk | photon/projects.go | Delete | func (api *ProjectsAPI) Delete(projectID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+projectUrl+projectID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *ProjectsAPI) Delete(projectID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+projectUrl+projectID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"Delete",
"(",
"projectID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"clie... | // Deletes the project with specified ID. Any VMs, disks, etc., owned by the project must be deleted first. | [
"Deletes",
"the",
"project",
"with",
"specified",
"ID",
".",
"Any",
"VMs",
"disks",
"etc",
".",
"owned",
"by",
"the",
"project",
"must",
"be",
"deleted",
"first",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L47-L55 |
143,940 | vmware/photon-controller-go-sdk | photon/projects.go | CreateDisk | func (api *ProjectsAPI) CreateDisk(projectID string, spec *DiskCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+projectUrl+projectID+"/disks",
"application/json",
bytes.NewReader(body),
api.client.opt... | go | func (api *ProjectsAPI) CreateDisk(projectID string, spec *DiskCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+projectUrl+projectID+"/disks",
"application/json",
bytes.NewReader(body),
api.client.opt... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"CreateDisk",
"(",
"projectID",
"string",
",",
"spec",
"*",
"DiskCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"spec",
")... | // Creates a disk on the specified project. | [
"Creates",
"a",
"disk",
"on",
"the",
"specified",
"project",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L58-L74 |
143,941 | vmware/photon-controller-go-sdk | photon/projects.go | GetDisks | func (api *ProjectsAPI) GetDisks(projectID string, options *DiskGetOptions) (result *DiskList, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/disks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.Tok... | go | func (api *ProjectsAPI) GetDisks(projectID string, options *DiskGetOptions) (result *DiskList, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/disks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.Tok... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetDisks",
"(",
"projectID",
"string",
",",
"options",
"*",
"DiskGetOptions",
")",
"(",
"result",
"*",
"DiskList",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"pr... | // Gets disks for project with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"disks",
"for",
"project",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L78-L91 |
143,942 | vmware/photon-controller-go-sdk | photon/projects.go | GetVMs | func (api *ProjectsAPI) GetVMs(projectID string, options *VmGetOptions) (result *VMs, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/vms"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
... | go | func (api *ProjectsAPI) GetVMs(projectID string, options *VmGetOptions) (result *VMs, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/vms"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetVMs",
"(",
"projectID",
"string",
",",
"options",
"*",
"VmGetOptions",
")",
"(",
"result",
"*",
"VMs",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"projectUrl"... | // Gets vms for project with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"vms",
"for",
"project",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L131-L144 |
143,943 | vmware/photon-controller-go-sdk | photon/projects.go | CreateImage | func (api *ProjectsAPI) CreateImage(projectID string, reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUpload(api.client.Endpoint+projectUrl+projectID+"/images", reader, name, params, api.cli... | go | func (api *ProjectsAPI) CreateImage(projectID string, reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUpload(api.client.Endpoint+projectUrl+projectID+"/images", reader, name, params, api.cli... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"CreateImage",
"(",
"projectID",
"string",
",",
"reader",
"io",
".",
"ReadSeeker",
",",
"name",
"string",
",",
"options",
"*",
"ImageCreateOptions",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{"... | // Creates an image on the specified project. | [
"Creates",
"an",
"image",
"on",
"the",
"specified",
"project",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L166-L175 |
143,944 | vmware/photon-controller-go-sdk | photon/projects.go | GetServices | func (api *ProjectsAPI) GetServices(projectID string) (result *Services, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/services"
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Services{}
err = json.U... | go | func (api *ProjectsAPI) GetServices(projectID string) (result *Services, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/services"
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Services{}
err = json.U... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetServices",
"(",
"projectID",
"string",
")",
"(",
"result",
"*",
"Services",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"projectUrl",
"+",
"projectID",
"+",
"\... | // Gets services for project with the specified ID | [
"Gets",
"services",
"for",
"project",
"with",
"the",
"specified",
"ID"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L178-L188 |
143,945 | vmware/photon-controller-go-sdk | photon/projects.go | Get | func (api *ProjectsAPI) Get(id string) (project *ProjectCompact, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(id), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
project = &ProjectCompact{}
err = json... | go | func (api *ProjectsAPI) Get(id string) (project *ProjectCompact, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(id), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
project = &ProjectCompact{}
err = json... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"project",
"*",
"ProjectCompact",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"getE... | // Gets the project with a specified ID. | [
"Gets",
"the",
"project",
"with",
"a",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L191-L204 |
143,946 | vmware/photon-controller-go-sdk | photon/projects.go | SetSecurityGroups | func (api *ProjectsAPI) SetSecurityGroups(projectID string, securityGroups *SecurityGroupsSpec) (*Task, error) {
return setSecurityGroups(api.client, api.getEntityUrl(projectID), securityGroups)
} | go | func (api *ProjectsAPI) SetSecurityGroups(projectID string, securityGroups *SecurityGroupsSpec) (*Task, error) {
return setSecurityGroups(api.client, api.getEntityUrl(projectID), securityGroups)
} | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"SetSecurityGroups",
"(",
"projectID",
"string",
",",
"securityGroups",
"*",
"SecurityGroupsSpec",
")",
"(",
"*",
"Task",
",",
"error",
")",
"{",
"return",
"setSecurityGroups",
"(",
"api",
".",
"client",
",",
"api... | // Set security groups for this project, overwriting any existing ones. | [
"Set",
"security",
"groups",
"for",
"this",
"project",
"overwriting",
"any",
"existing",
"ones",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L207-L209 |
143,947 | vmware/photon-controller-go-sdk | photon/projects.go | GetRouters | func (api *ProjectsAPI) GetRouters(projectID string, options *RouterGetOptions) (result *Routers, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/routers"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.option... | go | func (api *ProjectsAPI) GetRouters(projectID string, options *RouterGetOptions) (result *Routers, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/routers"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.option... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetRouters",
"(",
"projectID",
"string",
",",
"options",
"*",
"RouterGetOptions",
")",
"(",
"result",
"*",
"Routers",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
... | // Gets routers for project with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"routers",
"for",
"project",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L236-L249 |
143,948 | vmware/photon-controller-go-sdk | photon/projects.go | GetNetworks | func (api *ProjectsAPI) GetNetworks(projectID string, options *NetworkGetOptions) (result *Networks, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/networks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.op... | go | func (api *ProjectsAPI) GetNetworks(projectID string, options *NetworkGetOptions) (result *Networks, err error) {
uri := api.client.Endpoint + projectUrl + projectID + "/networks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.op... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetNetworks",
"(",
"projectID",
"string",
",",
"options",
"*",
"NetworkGetOptions",
")",
"(",
"result",
"*",
"Networks",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",... | // Gets networks for project with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"networks",
"for",
"project",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L272-L285 |
143,949 | vmware/photon-controller-go-sdk | photon/projects.go | ExcludeQuota | func (api *ProjectsAPI) ExcludeQuota(projectId string, spec *QuotaSpec) (task *Task, err error) {
task, err = api.modifyQuota("DELETE", projectId, spec)
return
} | go | func (api *ProjectsAPI) ExcludeQuota(projectId string, spec *QuotaSpec) (task *Task, err error) {
task, err = api.modifyQuota("DELETE", projectId, spec)
return
} | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"ExcludeQuota",
"(",
"projectId",
"string",
",",
"spec",
"*",
"QuotaSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"task",
",",
"err",
"=",
"api",
".",
"modifyQuota",
"(",
"\"",
"\"",... | // Exclude project quota line items from the specific quota spec. | [
"Exclude",
"project",
"quota",
"line",
"items",
"from",
"the",
"specific",
"quota",
"spec",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L325-L328 |
143,950 | vmware/photon-controller-go-sdk | photon/projects.go | modifyQuota | func (api *ProjectsAPI) modifyQuota(method string, projectId string, spec *QuotaSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.SendRequestCommon(
method,
api.client.Endpoint+projectUrl+projectId+"/quota",
"application/json",
bytes... | go | func (api *ProjectsAPI) modifyQuota(method string, projectId string, spec *QuotaSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.SendRequestCommon(
method,
api.client.Endpoint+projectUrl+projectId+"/quota",
"application/json",
bytes... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"modifyQuota",
"(",
"method",
"string",
",",
"projectId",
"string",
",",
"spec",
"*",
"QuotaSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Mars... | // A private common function for modifying quota for the specified project with the quota line items specified
// in quota spec. | [
"A",
"private",
"common",
"function",
"for",
"modifying",
"quota",
"for",
"the",
"specified",
"project",
"with",
"the",
"quota",
"line",
"items",
"specified",
"in",
"quota",
"spec",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L332-L349 |
143,951 | vmware/photon-controller-go-sdk | photon/projects.go | GetIam | func (api *ProjectsAPI) GetIam(projectId string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+projectUrl+projectId+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
... | go | func (api *ProjectsAPI) GetIam(projectId string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+projectUrl+projectId+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
... | [
"func",
"(",
"api",
"*",
"ProjectsAPI",
")",
"GetIam",
"(",
"projectId",
"string",
")",
"(",
"policy",
"[",
"]",
"*",
"RoleBinding",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"... | // Gets IAM Policy of a project. | [
"Gets",
"IAM",
"Policy",
"of",
"a",
"project",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/projects.go#L352-L366 |
143,952 | vmware/photon-controller-go-sdk | photon/tasks.go | Get | func (api *TasksAPI) Get(id string) (task *Task, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+taskUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
result, err := getTask(getError(res))
return result, err
} | go | func (api *TasksAPI) Get(id string) (task *Task, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+taskUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
result, err := getTask(getError(res))
return result, err
} | [
"func",
"(",
"api",
"*",
"TasksAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
".",
"E... | // Gets a task by ID. | [
"Gets",
"a",
"task",
"by",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tasks.go#L25-L33 |
143,953 | vmware/photon-controller-go-sdk | photon/tasks.go | GetAll | func (api *TasksAPI) GetAll(options *TaskGetOptions) (result *TaskList, err error) {
uri := api.client.Endpoint + taskUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result ... | go | func (api *TasksAPI) GetAll(options *TaskGetOptions) (result *TaskList, err error) {
uri := api.client.Endpoint + taskUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result ... | [
"func",
"(",
"api",
"*",
"TasksAPI",
")",
"GetAll",
"(",
"options",
"*",
"TaskGetOptions",
")",
"(",
"result",
"*",
"TaskList",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"taskUrl",
"\n",
"if",
"options",
... | // Gets all tasks, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"all",
"tasks",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tasks.go#L37-L51 |
143,954 | vmware/photon-controller-go-sdk | photon/tasks.go | WaitTimeout | func (api *TasksAPI) WaitTimeout(id string, timeout time.Duration) (task *Task, err error) {
start := time.Now()
numErrors := 0
maxErrors := api.client.options.TaskRetryCount
for time.Since(start) < timeout {
task, err = api.Get(id)
if err != nil {
switch err.(type) {
// If an ApiError comes back, someth... | go | func (api *TasksAPI) WaitTimeout(id string, timeout time.Duration) (task *Task, err error) {
start := time.Now()
numErrors := 0
maxErrors := api.client.options.TaskRetryCount
for time.Since(start) < timeout {
task, err = api.Get(id)
if err != nil {
switch err.(type) {
// If an ApiError comes back, someth... | [
"func",
"(",
"api",
"*",
"TasksAPI",
")",
"WaitTimeout",
"(",
"id",
"string",
",",
"timeout",
"time",
".",
"Duration",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"start",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
"numErrors",
":=... | // Waits for a task to complete by polling the tasks API until a task returns with
// the state COMPLETED or ERROR. Will wait no longer than the duration specified by timeout. | [
"Waits",
"for",
"a",
"task",
"to",
"complete",
"by",
"polling",
"the",
"tasks",
"API",
"until",
"a",
"task",
"returns",
"with",
"the",
"state",
"COMPLETED",
"or",
"ERROR",
".",
"Will",
"wait",
"no",
"longer",
"than",
"the",
"duration",
"specified",
"by",
... | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tasks.go#L55-L89 |
143,955 | vmware/photon-controller-go-sdk | photon/tasks.go | Wait | func (api *TasksAPI) Wait(id string) (task *Task, err error) {
return api.WaitTimeout(id, api.client.options.TaskPollTimeout)
} | go | func (api *TasksAPI) Wait(id string) (task *Task, err error) {
return api.WaitTimeout(id, api.client.options.TaskPollTimeout)
} | [
"func",
"(",
"api",
"*",
"TasksAPI",
")",
"Wait",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"return",
"api",
".",
"WaitTimeout",
"(",
"id",
",",
"api",
".",
"client",
".",
"options",
".",
"TaskPollTimeout",
... | // Waits for a task to complete by polling the tasks API until a task returns with
// the state COMPLETED or ERROR. | [
"Waits",
"for",
"a",
"task",
"to",
"complete",
"by",
"polling",
"the",
"tasks",
"API",
"until",
"a",
"task",
"returns",
"with",
"the",
"state",
"COMPLETED",
"or",
"ERROR",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tasks.go#L93-L95 |
143,956 | vmware/photon-controller-go-sdk | photon/tasks.go | getFailedStep | func getFailedStep(task *Task) (step Step) {
var errorStep Step
for _, s := range task.Steps {
if s.State == "ERROR" {
errorStep = s
break
}
}
return errorStep
} | go | func getFailedStep(task *Task) (step Step) {
var errorStep Step
for _, s := range task.Steps {
if s.State == "ERROR" {
errorStep = s
break
}
}
return errorStep
} | [
"func",
"getFailedStep",
"(",
"task",
"*",
"Task",
")",
"(",
"step",
"Step",
")",
"{",
"var",
"errorStep",
"Step",
"\n",
"for",
"_",
",",
"s",
":=",
"range",
"task",
".",
"Steps",
"{",
"if",
"s",
".",
"State",
"==",
"\"",
"\"",
"{",
"errorStep",
... | // Gets the failed step in the task to get error details for failed task. | [
"Gets",
"the",
"failed",
"step",
"in",
"the",
"task",
"to",
"get",
"error",
"details",
"for",
"failed",
"task",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tasks.go#L98-L108 |
143,957 | vmware/photon-controller-go-sdk | photon/auth.go | GetClientTokensByPassword | func (api *AuthAPI) GetClientTokensByPassword(username string, password string, clientID string) (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetClientTokenByPasswordGrant(username, password, clientID)
if err != nil ... | go | func (api *AuthAPI) GetClientTokensByPassword(username string, password string, clientID string) (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetClientTokenByPasswordGrant(username, password, clientID)
if err != nil ... | [
"func",
"(",
"api",
"*",
"AuthAPI",
")",
"GetClientTokensByPassword",
"(",
"username",
"string",
",",
"password",
"string",
",",
"clientID",
"string",
")",
"(",
"tokenOptions",
"*",
"TokenOptions",
",",
"err",
"error",
")",
"{",
"oidcClient",
",",
"err",
":=... | // Gets tokens for client from username, password and a client ID. | [
"Gets",
"tokens",
"for",
"client",
"from",
"username",
"password",
"and",
"a",
"client",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/auth.go#L38-L50 |
143,958 | vmware/photon-controller-go-sdk | photon/auth.go | GetTokensFromWindowsLogInContext | func (api *AuthAPI) GetTokensFromWindowsLogInContext() (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetTokensFromWindowsLogInContext()
if err != nil {
return
}
return api.toTokenOptions(tokenResponse), nil
} | go | func (api *AuthAPI) GetTokensFromWindowsLogInContext() (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetTokensFromWindowsLogInContext()
if err != nil {
return
}
return api.toTokenOptions(tokenResponse), nil
} | [
"func",
"(",
"api",
"*",
"AuthAPI",
")",
"GetTokensFromWindowsLogInContext",
"(",
")",
"(",
"tokenOptions",
"*",
"TokenOptions",
",",
"err",
"error",
")",
"{",
"oidcClient",
",",
"err",
":=",
"api",
".",
"buildOIDCClient",
"(",
")",
"\n",
"if",
"err",
"!="... | // GetTokensFromWindowsLogInContext gets tokens based on Windows logged in context
// In case of running on platform other than Windows, it returns error | [
"GetTokensFromWindowsLogInContext",
"gets",
"tokens",
"based",
"on",
"Windows",
"logged",
"in",
"context",
"In",
"case",
"of",
"running",
"on",
"platform",
"other",
"than",
"Windows",
"it",
"returns",
"error"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/auth.go#L54-L66 |
143,959 | vmware/photon-controller-go-sdk | photon/auth.go | GetTokensByRefreshToken | func (api *AuthAPI) GetTokensByRefreshToken(refreshtoken string) (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetTokenByRefreshTokenGrant(refreshtoken)
if err != nil {
return
}
return api.toTokenOptions(tokenRes... | go | func (api *AuthAPI) GetTokensByRefreshToken(refreshtoken string) (tokenOptions *TokenOptions, err error) {
oidcClient, err := api.buildOIDCClient()
if err != nil {
return
}
tokenResponse, err := oidcClient.GetTokenByRefreshTokenGrant(refreshtoken)
if err != nil {
return
}
return api.toTokenOptions(tokenRes... | [
"func",
"(",
"api",
"*",
"AuthAPI",
")",
"GetTokensByRefreshToken",
"(",
"refreshtoken",
"string",
")",
"(",
"tokenOptions",
"*",
"TokenOptions",
",",
"err",
"error",
")",
"{",
"oidcClient",
",",
"err",
":=",
"api",
".",
"buildOIDCClient",
"(",
")",
"\n",
... | // Gets tokens from refresh token. | [
"Gets",
"tokens",
"from",
"refresh",
"token",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/auth.go#L69-L81 |
143,960 | vmware/photon-controller-go-sdk | photon/auth.go | parseTokenDetails | func (api *AuthAPI) parseTokenDetails(token string) (jwtToken *lightwave.JWTToken, err error) {
jwtToken = lightwave.ParseTokenDetails(token)
return jwtToken, nil
} | go | func (api *AuthAPI) parseTokenDetails(token string) (jwtToken *lightwave.JWTToken, err error) {
jwtToken = lightwave.ParseTokenDetails(token)
return jwtToken, nil
} | [
"func",
"(",
"api",
"*",
"AuthAPI",
")",
"parseTokenDetails",
"(",
"token",
"string",
")",
"(",
"jwtToken",
"*",
"lightwave",
".",
"JWTToken",
",",
"err",
"error",
")",
"{",
"jwtToken",
"=",
"lightwave",
".",
"ParseTokenDetails",
"(",
"token",
")",
"\n",
... | // Parse the given token details. | [
"Parse",
"the",
"given",
"token",
"details",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/auth.go#L129-L132 |
143,961 | vmware/photon-controller-go-sdk | photon/auth.go | parseRawTokenDetails | func (api *AuthAPI) parseRawTokenDetails(token string) (jwtToken []string, err error) {
jwtToken, err = lightwave.ParseRawTokenDetails(token)
return jwtToken, err
} | go | func (api *AuthAPI) parseRawTokenDetails(token string) (jwtToken []string, err error) {
jwtToken, err = lightwave.ParseRawTokenDetails(token)
return jwtToken, err
} | [
"func",
"(",
"api",
"*",
"AuthAPI",
")",
"parseRawTokenDetails",
"(",
"token",
"string",
")",
"(",
"jwtToken",
"[",
"]",
"string",
",",
"err",
"error",
")",
"{",
"jwtToken",
",",
"err",
"=",
"lightwave",
".",
"ParseRawTokenDetails",
"(",
"token",
")",
"\... | // Parse the given token raw details. | [
"Parse",
"the",
"given",
"token",
"raw",
"details",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/auth.go#L135-L138 |
143,962 | vmware/photon-controller-go-sdk | photon/apitypes.go | Error | func (e TaskError) Error() string {
return fmt.Sprintf("photon: Task '%s' is in error state: {@step==%s}", e.ID, GetStep(e.Step))
} | go | func (e TaskError) Error() string {
return fmt.Sprintf("photon: Task '%s' is in error state: {@step==%s}", e.ID, GetStep(e.Step))
} | [
"func",
"(",
"e",
"TaskError",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"ID",
",",
"GetStep",
"(",
"e",
".",
"Step",
")",
")",
"\n",
"}"
] | // Implement Go error interface for TaskError. | [
"Implement",
"Go",
"error",
"interface",
"for",
"TaskError",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/apitypes.go#L68-L70 |
143,963 | vmware/photon-controller-go-sdk | photon/apitypes.go | GetStep | func GetStep(s Step) string {
return fmt.Sprintf("{\"sequence\"=>\"%d\",\"state\"=>\"%s\",\"errors\"=>%s,\"warnings\"=>%s,\"operation\"=>\"%s\","+
"\"startedTime\"=>\"%d\",\"queuedTime\"=>\"%d\",\"endTime\"=>\"%d\",\"options\"=>%s}",
s.Sequence, s.State, s.Errors, s.Warnings, s.Operation, s.StartedTime, s.QueuedTi... | go | func GetStep(s Step) string {
return fmt.Sprintf("{\"sequence\"=>\"%d\",\"state\"=>\"%s\",\"errors\"=>%s,\"warnings\"=>%s,\"operation\"=>\"%s\","+
"\"startedTime\"=>\"%d\",\"queuedTime\"=>\"%d\",\"endTime\"=>\"%d\",\"options\"=>%s}",
s.Sequence, s.State, s.Errors, s.Warnings, s.Operation, s.StartedTime, s.QueuedTi... | [
"func",
"GetStep",
"(",
"s",
"Step",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\"",
"+",
"\"",
"\\\... | // Implement Go error interface for Step. | [
"Implement",
"Go",
"error",
"interface",
"for",
"Step",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/apitypes.go#L100-L106 |
143,964 | vmware/photon-controller-go-sdk | photon/services.go | Get | func (api *ServicesAPI) Get(id string) (service *Service, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+serviceUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Service
err = json.Ne... | go | func (api *ServicesAPI) Get(id string) (service *Service, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+serviceUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Service
err = json.Ne... | [
"func",
"(",
"api",
"*",
"ServicesAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"service",
"*",
"Service",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
... | // Gets a service with the specified ID. | [
"Gets",
"a",
"service",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/services.go#L56-L69 |
143,965 | vmware/photon-controller-go-sdk | photon/services.go | GetVMs | func (api *ServicesAPI) GetVMs(id string) (result *VMs, err error) {
uri := api.client.Endpoint + serviceUrl + id + "/vms"
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &VMs{}
err = json.Unmarshal(res, result)
return
} | go | func (api *ServicesAPI) GetVMs(id string) (result *VMs, err error) {
uri := api.client.Endpoint + serviceUrl + id + "/vms"
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &VMs{}
err = json.Unmarshal(res, result)
return
} | [
"func",
"(",
"api",
"*",
"ServicesAPI",
")",
"GetVMs",
"(",
"id",
"string",
")",
"(",
"result",
"*",
"VMs",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"serviceUrl",
"+",
"id",
"+",
"\"",
"\"",
"\n",
"r... | // Gets vms for service with the specified ID. | [
"Gets",
"vms",
"for",
"service",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/services.go#L72-L82 |
143,966 | vmware/photon-controller-go-sdk | photon/services.go | Resize | func (api *ServicesAPI) Resize(id string, resize *ServiceResizeOperation) (task *Task, err error) {
body, err := json.Marshal(resize)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+serviceUrl+id+"/resize",
"application/json",
bytes.NewReader(body),
api.client.options.... | go | func (api *ServicesAPI) Resize(id string, resize *ServiceResizeOperation) (task *Task, err error) {
body, err := json.Marshal(resize)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+serviceUrl+id+"/resize",
"application/json",
bytes.NewReader(body),
api.client.options.... | [
"func",
"(",
"api",
"*",
"ServicesAPI",
")",
"Resize",
"(",
"id",
"string",
",",
"resize",
"*",
"ServiceResizeOperation",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"resize",
"... | // Resize a service to specified count. | [
"Resize",
"a",
"service",
"to",
"specified",
"count",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/services.go#L85-L101 |
143,967 | vmware/photon-controller-go-sdk | photon/services.go | TriggerMaintenance | func (api *ServicesAPI) TriggerMaintenance(id string) (task *Task, err error) {
body := []byte{}
res, err := api.client.restClient.Post(
api.client.Endpoint+serviceUrl+id+"/trigger_maintenance",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res... | go | func (api *ServicesAPI) TriggerMaintenance(id string) (task *Task, err error) {
body := []byte{}
res, err := api.client.restClient.Post(
api.client.Endpoint+serviceUrl+id+"/trigger_maintenance",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res... | [
"func",
"(",
"api",
"*",
"ServicesAPI",
")",
"TriggerMaintenance",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
":=",
"[",
"]",
"byte",
"{",
"}",
"\n",
"res",
",",
"err",
":=",
"api",
".",
"client",
"... | // Start a background process to recreate failed VMs in a service with the specified ID. | [
"Start",
"a",
"background",
"process",
"to",
"recreate",
"failed",
"VMs",
"in",
"a",
"service",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/services.go#L104-L117 |
143,968 | vmware/photon-controller-go-sdk | photon/util.go | getError | func getError(res *http.Response) (*http.Response, error) {
// Do nothing if the response is a successful 2xx
if res.StatusCode/100 == 2 {
return res, nil
}
var apiError ApiError
// ReadAll is usually a bad practice, but here we need to read the response all
// at once because we may attempt to use the data twi... | go | func getError(res *http.Response) (*http.Response, error) {
// Do nothing if the response is a successful 2xx
if res.StatusCode/100 == 2 {
return res, nil
}
var apiError ApiError
// ReadAll is usually a bad practice, but here we need to read the response all
// at once because we may attempt to use the data twi... | [
"func",
"getError",
"(",
"res",
"*",
"http",
".",
"Response",
")",
"(",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"// Do nothing if the response is a successful 2xx",
"if",
"res",
".",
"StatusCode",
"/",
"100",
"==",
"2",
"{",
"return",
"res",
... | // Reads an error out of the HTTP response, or does nothing if
// no error occurred. | [
"Reads",
"an",
"error",
"out",
"of",
"the",
"HTTP",
"response",
"or",
"does",
"nothing",
"if",
"no",
"error",
"occurred",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/util.go#L24-L44 |
143,969 | vmware/photon-controller-go-sdk | photon/hosts.go | SetAvailabilityZone | func (api *HostsAPI) SetAvailabilityZone(id string, availabilityZone *HostSetAvailabilityZoneOperation) (task *Task, err error) {
body, err := json.Marshal(availabilityZone)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+hostUrl+"/"+id+"/set_availability_zone",
"applicat... | go | func (api *HostsAPI) SetAvailabilityZone(id string, availabilityZone *HostSetAvailabilityZoneOperation) (task *Task, err error) {
body, err := json.Marshal(availabilityZone)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+hostUrl+"/"+id+"/set_availability_zone",
"applicat... | [
"func",
"(",
"api",
"*",
"HostsAPI",
")",
"SetAvailabilityZone",
"(",
"id",
"string",
",",
"availabilityZone",
"*",
"HostSetAvailabilityZoneOperation",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Ma... | // Sets host's availability zone. | [
"Sets",
"host",
"s",
"availability",
"zone",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/hosts.go#L25-L44 |
143,970 | vmware/photon-controller-go-sdk | photon/hosts.go | GetTasks | func (api *HostsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error) {
uri := api.client.Endpoint + hostUrl + "/" + id + "/tasks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if... | go | func (api *HostsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error) {
uri := api.client.Endpoint + hostUrl + "/" + id + "/tasks"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if... | [
"func",
"(",
"api",
"*",
"HostsAPI",
")",
"GetTasks",
"(",
"id",
"string",
",",
"options",
"*",
"TaskGetOptions",
")",
"(",
"result",
"*",
"TaskList",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"hostUrl",
... | // Gets all tasks with the specified host ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"all",
"tasks",
"with",
"the",
"specified",
"host",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/hosts.go#L48-L61 |
143,971 | vmware/photon-controller-go-sdk | photon/hosts.go | Provision | func (api *HostsAPI) Provision(id string) (task *Task, err error) {
body := []byte{}
res, err := api.client.restClient.Post(
api.client.Endpoint+hostUrl+"/"+id+"/provision",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, ... | go | func (api *HostsAPI) Provision(id string) (task *Task, err error) {
body := []byte{}
res, err := api.client.restClient.Post(
api.client.Endpoint+hostUrl+"/"+id+"/provision",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, ... | [
"func",
"(",
"api",
"*",
"HostsAPI",
")",
"Provision",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
":=",
"[",
"]",
"byte",
"{",
"}",
"\n",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restC... | // provision the host with the specified id | [
"provision",
"the",
"host",
"with",
"the",
"specified",
"id"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/hosts.go#L64-L77 |
143,972 | vmware/photon-controller-go-sdk | photon/tenants.go | GetAll | func (api *TenantsAPI) GetAll() (result *Tenants, err error) {
uri := api.client.Endpoint + tenantUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Tenants{}
err = json.Unmarshal(res, result)
return
} | go | func (api *TenantsAPI) GetAll() (result *Tenants, err error) {
uri := api.client.Endpoint + tenantUrl
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
result = &Tenants{}
err = json.Unmarshal(res, result)
return
} | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"GetAll",
"(",
")",
"(",
"result",
"*",
"Tenants",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"tenantUrl",
"\n",
"res",
",",
"err",
":=",
"api",
".",
"client",... | // Returns all tenants on an photon instance. | [
"Returns",
"all",
"tenants",
"on",
"an",
"photon",
"instance",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L37-L47 |
143,973 | vmware/photon-controller-go-sdk | photon/tenants.go | Create | func (api *TenantsAPI) Create(tenantSpec *TenantCreateSpec) (task *Task, err error) {
body, err := json.Marshal(tenantSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+tenantUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !=... | go | func (api *TenantsAPI) Create(tenantSpec *TenantCreateSpec) (task *Task, err error) {
body, err := json.Marshal(tenantSpec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+tenantUrl,
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions)
if err !=... | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"Create",
"(",
"tenantSpec",
"*",
"TenantCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"tenantSpec",
")",
"\n",
"if",
"err... | // Creates a tenant. | [
"Creates",
"a",
"tenant",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L50-L66 |
143,974 | vmware/photon-controller-go-sdk | photon/tenants.go | Delete | func (api *TenantsAPI) Delete(id string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+tenantUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *TenantsAPI) Delete(id string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+tenantUrl+"/"+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"Delete",
"(",
"id",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"client",
"... | // Deletes the tenant with specified ID. Any projects, VMs, disks, etc., owned by the tenant must be deleted first. | [
"Deletes",
"the",
"tenant",
"with",
"specified",
"ID",
".",
"Any",
"projects",
"VMs",
"disks",
"etc",
".",
"owned",
"by",
"the",
"tenant",
"must",
"be",
"deleted",
"first",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L69-L77 |
143,975 | vmware/photon-controller-go-sdk | photon/tenants.go | GetProjects | func (api *TenantsAPI) GetProjects(tenantId string, options *ProjectGetOptions) (result *ProjectList, err error) {
uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/projects"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.clie... | go | func (api *TenantsAPI) GetProjects(tenantId string, options *ProjectGetOptions) (result *ProjectList, err error) {
uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/projects"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.clie... | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"GetProjects",
"(",
"tenantId",
"string",
",",
"options",
"*",
"ProjectGetOptions",
")",
"(",
"result",
"*",
"ProjectList",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+"... | // Gets the projects for tenant with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"the",
"projects",
"for",
"tenant",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L100-L113 |
143,976 | vmware/photon-controller-go-sdk | photon/tenants.go | Get | func (api *TenantsAPI) Get(identity string) (tenant *Tenant, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(identity), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
tenant = &Tenant{}
if res != nil {
... | go | func (api *TenantsAPI) Get(identity string) (tenant *Tenant, err error) {
res, err := api.client.restClient.Get(api.getEntityUrl(identity), api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
tenant = &Tenant{}
if res != nil {
... | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"Get",
"(",
"identity",
"string",
")",
"(",
"tenant",
"*",
"Tenant",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"getEntit... | // Gets a tenant with the specified ID or name | [
"Gets",
"a",
"tenant",
"with",
"the",
"specified",
"ID",
"or",
"name"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L133-L172 |
143,977 | vmware/photon-controller-go-sdk | photon/tenants.go | SetSecurityGroups | func (api *TenantsAPI) SetSecurityGroups(id string, securityGroups *SecurityGroupsSpec) (*Task, error) {
return setSecurityGroups(api.client, api.getEntityUrl(id), securityGroups)
} | go | func (api *TenantsAPI) SetSecurityGroups(id string, securityGroups *SecurityGroupsSpec) (*Task, error) {
return setSecurityGroups(api.client, api.getEntityUrl(id), securityGroups)
} | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"SetSecurityGroups",
"(",
"id",
"string",
",",
"securityGroups",
"*",
"SecurityGroupsSpec",
")",
"(",
"*",
"Task",
",",
"error",
")",
"{",
"return",
"setSecurityGroups",
"(",
"api",
".",
"client",
",",
"api",
"."... | // Set security groups for this tenant, overwriting any existing ones. | [
"Set",
"security",
"groups",
"for",
"this",
"tenant",
"overwriting",
"any",
"existing",
"ones",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L175-L177 |
143,978 | vmware/photon-controller-go-sdk | photon/tenants.go | GetQuota | func (api *TenantsAPI) GetQuota(tenantId string) (quota *Quota, err error) {
uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/quota"
res, err := api.client.restClient.Get(uri, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
... | go | func (api *TenantsAPI) GetQuota(tenantId string) (quota *Quota, err error) {
uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/quota"
res, err := api.client.restClient.Get(uri, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
... | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"GetQuota",
"(",
"tenantId",
"string",
")",
"(",
"quota",
"*",
"Quota",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"tenantUrl",
"+",
"\"",
"\"",
"+",
"tenantId",... | // Get quota for project with the specified ID. | [
"Get",
"quota",
"for",
"project",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L184-L206 |
143,979 | vmware/photon-controller-go-sdk | photon/tenants.go | GetIam | func (api *TenantsAPI) GetIam(tenantId string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+tenantUrl+"/"+tenantId+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
... | go | func (api *TenantsAPI) GetIam(tenantId string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+tenantUrl+"/"+tenantId+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
... | [
"func",
"(",
"api",
"*",
"TenantsAPI",
")",
"GetIam",
"(",
"tenantId",
"string",
")",
"(",
"policy",
"[",
"]",
"*",
"RoleBinding",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"ap... | // Gets IAM Policy of a tenant. | [
"Gets",
"IAM",
"Policy",
"of",
"a",
"tenant",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/tenants.go#L248-L262 |
143,980 | vmware/photon-controller-go-sdk | photon/networks.go | Get | func (api *NetworksAPI) Get(id string) (network *Network, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+networkUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Network
err = json.Ne... | go | func (api *NetworksAPI) Get(id string) (network *Network, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+networkUrl+id, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Network
err = json.Ne... | [
"func",
"(",
"api",
"*",
"NetworksAPI",
")",
"Get",
"(",
"id",
"string",
")",
"(",
"network",
"*",
"Network",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
... | // Gets a network with the specified ID. | [
"Gets",
"a",
"network",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/networks.go#L25-L38 |
143,981 | vmware/photon-controller-go-sdk | photon/networks.go | UpdateNetwork | func (api *NetworksAPI) UpdateNetwork(id string, networkSpec *NetworkUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(networkSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+networkUrl+id,
"application/json",
bytes.NewReader(body),
api.client.opti... | go | func (api *NetworksAPI) UpdateNetwork(id string, networkSpec *NetworkUpdateSpec) (task *Task, err error) {
body, err := json.Marshal(networkSpec)
if err != nil {
return
}
res, err := api.client.restClient.Patch(
api.client.Endpoint+networkUrl+id,
"application/json",
bytes.NewReader(body),
api.client.opti... | [
"func",
"(",
"api",
"*",
"NetworksAPI",
")",
"UpdateNetwork",
"(",
"id",
"string",
",",
"networkSpec",
"*",
"NetworkUpdateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"netwo... | // Updates network's attributes. | [
"Updates",
"network",
"s",
"attributes",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/networks.go#L41-L59 |
143,982 | vmware/photon-controller-go-sdk | photon/networks.go | Delete | func (api *NetworksAPI) Delete(networkID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+networkUrl+networkID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | go | func (api *NetworksAPI) Delete(networkID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+networkUrl+networkID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
} | [
"func",
"(",
"api",
"*",
"NetworksAPI",
")",
"Delete",
"(",
"networkID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"clie... | // Deletes a network with specified ID. | [
"Deletes",
"a",
"network",
"with",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/networks.go#L62-L71 |
143,983 | vmware/photon-controller-go-sdk | photon/networks.go | CreateSubnet | func (api *NetworksAPI) CreateSubnet(networkID string, spec *SubnetCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+networkUrl+networkID+"/subnets",
"application/json",
bytes.NewReader(body),
api.clie... | go | func (api *NetworksAPI) CreateSubnet(networkID string, spec *SubnetCreateSpec) (task *Task, err error) {
body, err := json.Marshal(spec)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+networkUrl+networkID+"/subnets",
"application/json",
bytes.NewReader(body),
api.clie... | [
"func",
"(",
"api",
"*",
"NetworksAPI",
")",
"CreateSubnet",
"(",
"networkID",
"string",
",",
"spec",
"*",
"SubnetCreateSpec",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"spec",
... | // Creates a subnet on the specified network. | [
"Creates",
"a",
"subnet",
"on",
"the",
"specified",
"network",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/networks.go#L74-L90 |
143,984 | vmware/photon-controller-go-sdk | photon/networks.go | GetSubnets | func (api *NetworksAPI) GetSubnets(networkID string, options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + networkUrl + networkID + "/subnets"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.option... | go | func (api *NetworksAPI) GetSubnets(networkID string, options *SubnetGetOptions) (result *Subnets, err error) {
uri := api.client.Endpoint + networkUrl + networkID + "/subnets"
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.option... | [
"func",
"(",
"api",
"*",
"NetworksAPI",
")",
"GetSubnets",
"(",
"networkID",
"string",
",",
"options",
"*",
"SubnetGetOptions",
")",
"(",
"result",
"*",
"Subnets",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
... | // Gets subnets for network with the specified ID, using options to filter the results.
// If options is nil, no filtering will occur. | [
"Gets",
"subnets",
"for",
"network",
"with",
"the",
"specified",
"ID",
"using",
"options",
"to",
"filter",
"the",
"results",
".",
"If",
"options",
"is",
"nil",
"no",
"filtering",
"will",
"occur",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/networks.go#L94-L107 |
143,985 | vmware/photon-controller-go-sdk | photon/restclient.go | createFieldPart | func (client *restClient) createFieldPart(fieldname, value, boundary string) io.Reader {
str := fmt.Sprintf("\r\n--%s\r\n", boundary)
str += fmt.Sprintf("Content-Disposition: form-data; name=\"%s\"\r\n\r\n", quoteEscaper.Replace(fieldname))
str += value
return strings.NewReader(str)
} | go | func (client *restClient) createFieldPart(fieldname, value, boundary string) io.Reader {
str := fmt.Sprintf("\r\n--%s\r\n", boundary)
str += fmt.Sprintf("Content-Disposition: form-data; name=\"%s\"\r\n\r\n", quoteEscaper.Replace(fieldname))
str += value
return strings.NewReader(str)
} | [
"func",
"(",
"client",
"*",
"restClient",
")",
"createFieldPart",
"(",
"fieldname",
",",
"value",
",",
"boundary",
"string",
")",
"io",
".",
"Reader",
"{",
"str",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\r",
"\\n",
"\\r",
"\\n",
"\"",
",",
"boundary"... | // Creates a reader that encapsulates a single multipart form part | [
"Creates",
"a",
"reader",
"that",
"encapsulates",
"a",
"single",
"multipart",
"form",
"part"
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/restclient.go#L308-L313 |
143,986 | vmware/photon-controller-go-sdk | photon/images.go | CreateFromFile | func (api *ImagesAPI) CreateFromFile(imagePath string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUploadFile(api.client.Endpoint+imageUrl, imagePath, params, api.client.options.TokenOptions)
if err != nil {
return
}
... | go | func (api *ImagesAPI) CreateFromFile(imagePath string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUploadFile(api.client.Endpoint+imageUrl, imagePath, params, api.client.options.TokenOptions)
if err != nil {
return
}
... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"CreateFromFile",
"(",
"imagePath",
"string",
",",
"options",
"*",
"ImageCreateOptions",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"params",
":=",
"imageCreateOptionsToMap",
"(",
"options",
")",
... | // Uploads a new image, reading from the specified image path.
// If options is nil, default options are used. | [
"Uploads",
"a",
"new",
"image",
"reading",
"from",
"the",
"specified",
"image",
"path",
".",
"If",
"options",
"is",
"nil",
"default",
"options",
"are",
"used",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L32-L41 |
143,987 | vmware/photon-controller-go-sdk | photon/images.go | Create | func (api *ImagesAPI) Create(reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUpload(api.client.Endpoint+imageUrl, reader, name, params, api.client.options.TokenOptions)
if err != nil {
re... | go | func (api *ImagesAPI) Create(reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error) {
params := imageCreateOptionsToMap(options)
res, err := api.client.restClient.MultipartUpload(api.client.Endpoint+imageUrl, reader, name, params, api.client.options.TokenOptions)
if err != nil {
re... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"Create",
"(",
"reader",
"io",
".",
"ReadSeeker",
",",
"name",
"string",
",",
"options",
"*",
"ImageCreateOptions",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"params",
":=",
"imageCreateOptio... | // Uploads a new image, reading from the specified io.Reader.
// Name is a descriptive name of the image, it is used in the filename field of the Content-Disposition header,
// and does not need to be unique.
// If options is nil, default options are used. | [
"Uploads",
"a",
"new",
"image",
"reading",
"from",
"the",
"specified",
"io",
".",
"Reader",
".",
"Name",
"is",
"a",
"descriptive",
"name",
"of",
"the",
"image",
"it",
"is",
"used",
"in",
"the",
"filename",
"field",
"of",
"the",
"Content",
"-",
"Dispositi... | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L47-L56 |
143,988 | vmware/photon-controller-go-sdk | photon/images.go | GetAll | func (api *ImagesAPI) GetAll(options *ImageGetOptions) (images *Images, err error) {
uri := api.client.Endpoint + imageUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
images... | go | func (api *ImagesAPI) GetAll(options *ImageGetOptions) (images *Images, err error) {
uri := api.client.Endpoint + imageUrl
if options != nil {
uri += getQueryString(options)
}
res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
if err != nil {
return
}
images... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"GetAll",
"(",
"options",
"*",
"ImageGetOptions",
")",
"(",
"images",
"*",
"Images",
",",
"err",
"error",
")",
"{",
"uri",
":=",
"api",
".",
"client",
".",
"Endpoint",
"+",
"imageUrl",
"\n",
"if",
"options",
... | // Gets all images on this photon instance. | [
"Gets",
"all",
"images",
"on",
"this",
"photon",
"instance",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L59-L72 |
143,989 | vmware/photon-controller-go-sdk | photon/images.go | Get | func (api *ImagesAPI) Get(imageID string) (image *Image, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+imageUrl+"/"+imageID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Image
err = jso... | go | func (api *ImagesAPI) Get(imageID string) (image *Image, err error) {
res, err := api.client.restClient.Get(api.client.Endpoint+imageUrl+"/"+imageID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
var result Image
err = jso... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"Get",
"(",
"imageID",
"string",
")",
"(",
"image",
"*",
"Image",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api",
".",
"client",
"... | // Gets details of image with the specified ID. | [
"Gets",
"details",
"of",
"image",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L75-L88 |
143,990 | vmware/photon-controller-go-sdk | photon/images.go | Delete | func (api *ImagesAPI) Delete(imageID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+imageUrl+"/"+imageID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
result, err := getTask(getError(res))
return result, err
} | go | func (api *ImagesAPI) Delete(imageID string) (task *Task, err error) {
res, err := api.client.restClient.Delete(api.client.Endpoint+imageUrl+"/"+imageID, api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
result, err := getTask(getError(res))
return result, err
} | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"Delete",
"(",
"imageID",
"string",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Delete",
"(",
"api",
".",
"client",... | // Deletes image with the specified ID. | [
"Deletes",
"image",
"with",
"the",
"specified",
"ID",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L91-L99 |
143,991 | vmware/photon-controller-go-sdk | photon/images.go | GetIam | func (api *ImagesAPI) GetIam(imageID string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+imageUrl+"/"+imageID+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
err... | go | func (api *ImagesAPI) GetIam(imageID string) (policy []*RoleBinding, err error) {
res, err := api.client.restClient.Get(
api.client.Endpoint+imageUrl+"/"+imageID+"/iam",
api.client.options.TokenOptions)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
err... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"GetIam",
"(",
"imageID",
"string",
")",
"(",
"policy",
"[",
"]",
"*",
"RoleBinding",
",",
"err",
"error",
")",
"{",
"res",
",",
"err",
":=",
"api",
".",
"client",
".",
"restClient",
".",
"Get",
"(",
"api"... | // Gets IAM Policy of an image. | [
"Gets",
"IAM",
"Policy",
"of",
"an",
"image",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L120-L134 |
143,992 | vmware/photon-controller-go-sdk | photon/images.go | SetIam | func (api *ImagesAPI) SetIam(imageID string, policy []*RoleBinding) (task *Task, err error) {
body, err := json.Marshal(policy)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+imageUrl+"/"+imageID+"/iam",
"application/json",
bytes.NewReader(body),
api.client.options.To... | go | func (api *ImagesAPI) SetIam(imageID string, policy []*RoleBinding) (task *Task, err error) {
body, err := json.Marshal(policy)
if err != nil {
return
}
res, err := api.client.restClient.Post(
api.client.Endpoint+imageUrl+"/"+imageID+"/iam",
"application/json",
bytes.NewReader(body),
api.client.options.To... | [
"func",
"(",
"api",
"*",
"ImagesAPI",
")",
"SetIam",
"(",
"imageID",
"string",
",",
"policy",
"[",
"]",
"*",
"RoleBinding",
")",
"(",
"task",
"*",
"Task",
",",
"err",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"policy... | // Sets IAM Policy on an image. | [
"Sets",
"IAM",
"Policy",
"on",
"an",
"image",
"."
] | e3620ad3ad39dcb965dee64917d8880475a95e77 | https://github.com/vmware/photon-controller-go-sdk/blob/e3620ad3ad39dcb965dee64917d8880475a95e77/photon/images.go#L137-L153 |
143,993 | domainr/dnsr | cache.go | newCache | func newCache(capacity int) *cache {
if capacity <= 0 {
capacity = MinCacheCapacity
}
return &cache{
capacity: capacity,
entries: make(map[string]entry),
}
} | go | func newCache(capacity int) *cache {
if capacity <= 0 {
capacity = MinCacheCapacity
}
return &cache{
capacity: capacity,
entries: make(map[string]entry),
}
} | [
"func",
"newCache",
"(",
"capacity",
"int",
")",
"*",
"cache",
"{",
"if",
"capacity",
"<=",
"0",
"{",
"capacity",
"=",
"MinCacheCapacity",
"\n",
"}",
"\n",
"return",
"&",
"cache",
"{",
"capacity",
":",
"capacity",
",",
"entries",
":",
"make",
"(",
"map... | // newCache initializes and returns a new cache instance.
// Cache capacity defaults to MinCacheCapacity if <= 0. | [
"newCache",
"initializes",
"and",
"returns",
"a",
"new",
"cache",
"instance",
".",
"Cache",
"capacity",
"defaults",
"to",
"MinCacheCapacity",
"if",
"<",
"=",
"0",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L17-L25 |
143,994 | domainr/dnsr | cache.go | add | func (c *cache) add(qname string, rr RR) {
c.m.Lock()
defer c.m.Unlock()
c._add(qname, rr)
} | go | func (c *cache) add(qname string, rr RR) {
c.m.Lock()
defer c.m.Unlock()
c._add(qname, rr)
} | [
"func",
"(",
"c",
"*",
"cache",
")",
"add",
"(",
"qname",
"string",
",",
"rr",
"RR",
")",
"{",
"c",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"m",
".",
"Unlock",
"(",
")",
"\n",
"c",
".",
"_add",
"(",
"qname",
",",
"rr",
"... | // add adds 0 or more DNS records to the resolver cache for a specific
// domain name and record type. This ensures the cache entry exists, even
// if empty, for NXDOMAIN responses. | [
"add",
"adds",
"0",
"or",
"more",
"DNS",
"records",
"to",
"the",
"resolver",
"cache",
"for",
"a",
"specific",
"domain",
"name",
"and",
"record",
"type",
".",
"This",
"ensures",
"the",
"cache",
"entry",
"exists",
"even",
"if",
"empty",
"for",
"NXDOMAIN",
... | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L30-L34 |
143,995 | domainr/dnsr | cache.go | addNX | func (c *cache) addNX(qname string) {
c.m.Lock()
defer c.m.Unlock()
c._addEntry(qname)
} | go | func (c *cache) addNX(qname string) {
c.m.Lock()
defer c.m.Unlock()
c._addEntry(qname)
} | [
"func",
"(",
"c",
"*",
"cache",
")",
"addNX",
"(",
"qname",
"string",
")",
"{",
"c",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"m",
".",
"Unlock",
"(",
")",
"\n",
"c",
".",
"_addEntry",
"(",
"qname",
")",
"\n",
"}"
] | // addNX adds an NXDOMAIN to the cache.
// Safe for concurrent usage. | [
"addNX",
"adds",
"an",
"NXDOMAIN",
"to",
"the",
"cache",
".",
"Safe",
"for",
"concurrent",
"usage",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L38-L42 |
143,996 | domainr/dnsr | cache.go | _add | func (c *cache) _add(qname string, rr RR) {
e, ok := c.entries[qname]
if !ok {
c._evict()
}
if e == nil {
c.entries[qname] = make(map[RR]struct{})
e = c.entries[qname]
}
e[rr] = struct{}{}
} | go | func (c *cache) _add(qname string, rr RR) {
e, ok := c.entries[qname]
if !ok {
c._evict()
}
if e == nil {
c.entries[qname] = make(map[RR]struct{})
e = c.entries[qname]
}
e[rr] = struct{}{}
} | [
"func",
"(",
"c",
"*",
"cache",
")",
"_add",
"(",
"qname",
"string",
",",
"rr",
"RR",
")",
"{",
"e",
",",
"ok",
":=",
"c",
".",
"entries",
"[",
"qname",
"]",
"\n",
"if",
"!",
"ok",
"{",
"c",
".",
"_evict",
"(",
")",
"\n",
"}",
"\n",
"if",
... | // _add does NOT lock the mutex so unsafe for concurrent usage. | [
"_add",
"does",
"NOT",
"lock",
"the",
"mutex",
"so",
"unsafe",
"for",
"concurrent",
"usage",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L45-L55 |
143,997 | domainr/dnsr | cache.go | _addEntry | func (c *cache) _addEntry(qname string) {
_, ok := c.entries[qname]
if !ok {
c._evict()
// For NXDOMAIN responses,
// the cache entry is present, but nil.
c.entries[qname] = nil
}
} | go | func (c *cache) _addEntry(qname string) {
_, ok := c.entries[qname]
if !ok {
c._evict()
// For NXDOMAIN responses,
// the cache entry is present, but nil.
c.entries[qname] = nil
}
} | [
"func",
"(",
"c",
"*",
"cache",
")",
"_addEntry",
"(",
"qname",
"string",
")",
"{",
"_",
",",
"ok",
":=",
"c",
".",
"entries",
"[",
"qname",
"]",
"\n",
"if",
"!",
"ok",
"{",
"c",
".",
"_evict",
"(",
")",
"\n",
"// For NXDOMAIN responses,",
"// the ... | // addEntry adds an entry for qname to c.
// Not safe for concurrent usage. | [
"addEntry",
"adds",
"an",
"entry",
"for",
"qname",
"to",
"c",
".",
"Not",
"safe",
"for",
"concurrent",
"usage",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L59-L67 |
143,998 | domainr/dnsr | cache.go | get | func (c *cache) get(qname string) RRs {
c.m.RLock()
defer c.m.RUnlock()
e, ok := c.entries[qname]
if !ok {
return nil
}
if len(e) == 0 {
return emptyRRs
}
i := 0
rrs := make(RRs, len(e))
for rr, _ := range e {
rrs[i] = rr
i++
}
return rrs
} | go | func (c *cache) get(qname string) RRs {
c.m.RLock()
defer c.m.RUnlock()
e, ok := c.entries[qname]
if !ok {
return nil
}
if len(e) == 0 {
return emptyRRs
}
i := 0
rrs := make(RRs, len(e))
for rr, _ := range e {
rrs[i] = rr
i++
}
return rrs
} | [
"func",
"(",
"c",
"*",
"cache",
")",
"get",
"(",
"qname",
"string",
")",
"RRs",
"{",
"c",
".",
"m",
".",
"RLock",
"(",
")",
"\n",
"defer",
"c",
".",
"m",
".",
"RUnlock",
"(",
")",
"\n",
"e",
",",
"ok",
":=",
"c",
".",
"entries",
"[",
"qname... | // get returns a randomly ordered slice of DNS records. | [
"get",
"returns",
"a",
"randomly",
"ordered",
"slice",
"of",
"DNS",
"records",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/cache.go#L84-L101 |
143,999 | domainr/dnsr | rr.go | String | func (rr *RR) String() string {
return rr.Name + "\t 3600\tIN\t" + rr.Type + "\t" + rr.Value
} | go | func (rr *RR) String() string {
return rr.Name + "\t 3600\tIN\t" + rr.Type + "\t" + rr.Value
} | [
"func",
"(",
"rr",
"*",
"RR",
")",
"String",
"(",
")",
"string",
"{",
"return",
"rr",
".",
"Name",
"+",
"\"",
"\\t",
"\\t",
"\\t",
"\"",
"+",
"rr",
".",
"Type",
"+",
"\"",
"\\t",
"\"",
"+",
"rr",
".",
"Value",
"\n",
"}"
] | // String returns a string representation of an RR in zone-file format. | [
"String",
"returns",
"a",
"string",
"representation",
"of",
"an",
"RR",
"in",
"zone",
"-",
"file",
"format",
"."
] | 74d2205fe905616d3201a0329e65eefe9ecff03a | https://github.com/domainr/dnsr/blob/74d2205fe905616d3201a0329e65eefe9ecff03a/rr.go#L32-L34 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.