repo
stringlengths 5
67
| path
stringlengths 4
218
| func_name
stringlengths 0
151
| original_string
stringlengths 52
373k
| language
stringclasses 6
values | code
stringlengths 52
373k
| code_tokens
listlengths 10
512
| docstring
stringlengths 3
47.2k
| docstring_tokens
listlengths 3
234
| sha
stringlengths 40
40
| url
stringlengths 85
339
| partition
stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
rightscale/rsc
|
rsapi/http.go
|
LoadResponse
|
func (a *API) LoadResponse(resp *http.Response) (interface{}, error) {
defer resp.Body.Close()
var respBody interface{}
jsonResp, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("Failed to read response (%s)", err)
}
if len(jsonResp) > 0 {
err = json.Unmarshal(jsonResp, &respBody)
if err != nil {
return nil, fmt.Errorf("Failed to load response (%s)", err)
}
}
// Special case for "Location" header, assume that if there is a location there is no body
loc := resp.Header.Get("Location")
if len(loc) > 0 {
var bodyMap = make(map[string]interface{})
bodyMap["Location"] = loc
respBody = interface{}(bodyMap)
}
return respBody, err
}
|
go
|
func (a *API) LoadResponse(resp *http.Response) (interface{}, error) {
defer resp.Body.Close()
var respBody interface{}
jsonResp, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("Failed to read response (%s)", err)
}
if len(jsonResp) > 0 {
err = json.Unmarshal(jsonResp, &respBody)
if err != nil {
return nil, fmt.Errorf("Failed to load response (%s)", err)
}
}
// Special case for "Location" header, assume that if there is a location there is no body
loc := resp.Header.Get("Location")
if len(loc) > 0 {
var bodyMap = make(map[string]interface{})
bodyMap["Location"] = loc
respBody = interface{}(bodyMap)
}
return respBody, err
}
|
[
"func",
"(",
"a",
"*",
"API",
")",
"LoadResponse",
"(",
"resp",
"*",
"http",
".",
"Response",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"var",
"respBody",
"interface",
"{",
"}",
"\n",
"jsonResp",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"Failed to read response (%s)\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"jsonResp",
")",
">",
"0",
"{",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"jsonResp",
",",
"&",
"respBody",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"Failed to load response (%s)\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n",
"loc",
":=",
"resp",
".",
"Header",
".",
"Get",
"(",
"\"Location\"",
")",
"\n",
"if",
"len",
"(",
"loc",
")",
">",
"0",
"{",
"var",
"bodyMap",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"bodyMap",
"[",
"\"Location\"",
"]",
"=",
"loc",
"\n",
"respBody",
"=",
"interface",
"{",
"}",
"(",
"bodyMap",
")",
"\n",
"}",
"\n",
"return",
"respBody",
",",
"err",
"\n",
"}"
] |
// LoadResponse deserializes the JSON response into a generic object.
// If the response has a "Location" header then the returned object is a map with one key "Location"
// containing the value of the header.
|
[
"LoadResponse",
"deserializes",
"the",
"JSON",
"response",
"into",
"a",
"generic",
"object",
".",
"If",
"the",
"response",
"has",
"a",
"Location",
"header",
"then",
"the",
"returned",
"object",
"is",
"a",
"map",
"with",
"one",
"key",
"Location",
"containing",
"the",
"value",
"of",
"the",
"header",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/http.go#L270-L291
|
test
|
rightscale/rsc
|
ss/ssd/codegen_client.go
|
ScheduleLocator
|
func (api *API) ScheduleLocator(href string) *ScheduleLocator {
return &ScheduleLocator{Href(href), api}
}
|
go
|
func (api *API) ScheduleLocator(href string) *ScheduleLocator {
return &ScheduleLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ScheduleLocator",
"(",
"href",
"string",
")",
"*",
"ScheduleLocator",
"{",
"return",
"&",
"ScheduleLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ScheduleLocator builds a locator from the given href.
|
[
"ScheduleLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ss/ssd/codegen_client.go#L88-L90
|
test
|
rightscale/rsc
|
ss/ssd/codegen_client.go
|
TemplateLocator
|
func (api *API) TemplateLocator(href string) *TemplateLocator {
return &TemplateLocator{Href(href), api}
}
|
go
|
func (api *API) TemplateLocator(href string) *TemplateLocator {
return &TemplateLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"TemplateLocator",
"(",
"href",
"string",
")",
"*",
"TemplateLocator",
"{",
"return",
"&",
"TemplateLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// TemplateLocator builds a locator from the given href.
|
[
"TemplateLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ss/ssd/codegen_client.go#L389-L391
|
test
|
rightscale/rsc
|
cm15/examples/rsssh/main.go
|
fetchDetails
|
func fetchDetails(client *cm15.API, envName string, envDetail EnvironmentDetail, sshConfig *[]SSHConfig) {
for nickname, name := range envDetail.ServerArrays {
// Obtain the resource
instances := serverArray(client, name)
// Obtain the IP address of the first instance (only one instance is considered here -- for now)
for _, instance := range instances {
ipAddress := instance.PublicIpAddresses[0]
number := getInstanceNumber(instance.Name)
*sshConfig = append(*sshConfig, SSHConfig{Name: envName + "_" + nickname + number, IPAddress: ipAddress})
}
}
for nickname, name := range envDetail.Servers {
instance := server(client, name)
ipAddress := instance.PublicIpAddresses[0]
*sshConfig = append(*sshConfig, SSHConfig{Name: envName + "_" + nickname, IPAddress: ipAddress})
}
}
|
go
|
func fetchDetails(client *cm15.API, envName string, envDetail EnvironmentDetail, sshConfig *[]SSHConfig) {
for nickname, name := range envDetail.ServerArrays {
// Obtain the resource
instances := serverArray(client, name)
// Obtain the IP address of the first instance (only one instance is considered here -- for now)
for _, instance := range instances {
ipAddress := instance.PublicIpAddresses[0]
number := getInstanceNumber(instance.Name)
*sshConfig = append(*sshConfig, SSHConfig{Name: envName + "_" + nickname + number, IPAddress: ipAddress})
}
}
for nickname, name := range envDetail.Servers {
instance := server(client, name)
ipAddress := instance.PublicIpAddresses[0]
*sshConfig = append(*sshConfig, SSHConfig{Name: envName + "_" + nickname, IPAddress: ipAddress})
}
}
|
[
"func",
"fetchDetails",
"(",
"client",
"*",
"cm15",
".",
"API",
",",
"envName",
"string",
",",
"envDetail",
"EnvironmentDetail",
",",
"sshConfig",
"*",
"[",
"]",
"SSHConfig",
")",
"{",
"for",
"nickname",
",",
"name",
":=",
"range",
"envDetail",
".",
"ServerArrays",
"{",
"instances",
":=",
"serverArray",
"(",
"client",
",",
"name",
")",
"\n",
"for",
"_",
",",
"instance",
":=",
"range",
"instances",
"{",
"ipAddress",
":=",
"instance",
".",
"PublicIpAddresses",
"[",
"0",
"]",
"\n",
"number",
":=",
"getInstanceNumber",
"(",
"instance",
".",
"Name",
")",
"\n",
"*",
"sshConfig",
"=",
"append",
"(",
"*",
"sshConfig",
",",
"SSHConfig",
"{",
"Name",
":",
"envName",
"+",
"\"_\"",
"+",
"nickname",
"+",
"number",
",",
"IPAddress",
":",
"ipAddress",
"}",
")",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"nickname",
",",
"name",
":=",
"range",
"envDetail",
".",
"Servers",
"{",
"instance",
":=",
"server",
"(",
"client",
",",
"name",
")",
"\n",
"ipAddress",
":=",
"instance",
".",
"PublicIpAddresses",
"[",
"0",
"]",
"\n",
"*",
"sshConfig",
"=",
"append",
"(",
"*",
"sshConfig",
",",
"SSHConfig",
"{",
"Name",
":",
"envName",
"+",
"\"_\"",
"+",
"nickname",
",",
"IPAddress",
":",
"ipAddress",
"}",
")",
"\n",
"}",
"\n",
"}"
] |
// Fetch details about all servers and server arrays in an environment
|
[
"Fetch",
"details",
"about",
"all",
"servers",
"and",
"server",
"arrays",
"in",
"an",
"environment"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/examples/rsssh/main.go#L109-L125
|
test
|
rightscale/rsc
|
cm15/examples/rsssh/main.go
|
buildAliases
|
func buildAliases(sshConfig []SSHConfig, sshOptions, sshUser string) string {
var aliases string
for _, conf := range sshConfig {
aliases = aliases + fmt.Sprintf("alias %v='ssh %v %v@%v'\n", conf.Name, sshOptions, sshUser, conf.IPAddress)
}
return aliases
}
|
go
|
func buildAliases(sshConfig []SSHConfig, sshOptions, sshUser string) string {
var aliases string
for _, conf := range sshConfig {
aliases = aliases + fmt.Sprintf("alias %v='ssh %v %v@%v'\n", conf.Name, sshOptions, sshUser, conf.IPAddress)
}
return aliases
}
|
[
"func",
"buildAliases",
"(",
"sshConfig",
"[",
"]",
"SSHConfig",
",",
"sshOptions",
",",
"sshUser",
"string",
")",
"string",
"{",
"var",
"aliases",
"string",
"\n",
"for",
"_",
",",
"conf",
":=",
"range",
"sshConfig",
"{",
"aliases",
"=",
"aliases",
"+",
"fmt",
".",
"Sprintf",
"(",
"\"alias %v='ssh %v %v@%v'\\n\"",
",",
"\\n",
",",
"conf",
".",
"Name",
",",
"sshOptions",
",",
"sshUser",
")",
"\n",
"}",
"\n",
"conf",
".",
"IPAddress",
"\n",
"}"
] |
// Builds the aliases string based on the SSH configuration of all servers and server arrays in all environments.
|
[
"Builds",
"the",
"aliases",
"string",
"based",
"on",
"the",
"SSH",
"configuration",
"of",
"all",
"servers",
"and",
"server",
"arrays",
"in",
"all",
"environments",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/examples/rsssh/main.go#L139-L145
|
test
|
rightscale/rsc
|
cm15/examples/rsssh/main.go
|
serverArray
|
func serverArray(client *cm15.API, name string) []*cm15.Instance {
serverArrayLocator := client.ServerArrayLocator("/api/server_arrays")
serverArrays, err := serverArrayLocator.Index(rsapi.APIParams{"view": "default", "filter": []string{"name==" + name}})
if err != nil {
fail("Failed to retrieve server array: %v\n", err.Error())
}
if len(serverArrays) == 0 {
fail("Could not find server array with name: %v\n", name)
} else if len(serverArrays) != 1 {
fail("More than one server array found with name: %v\n", name)
}
array := serverArrays[0]
var instancesHref string
for _, l := range array.Links {
if l["rel"] == "current_instances" {
instancesHref = l["href"]
break
}
}
instanceLocator := client.InstanceLocator(instancesHref)
instances, err := instanceLocator.Index(rsapi.APIParams{})
if err != nil {
fail("Failed to retrieve current instances of the server array: %v\n", err.Error())
}
if len(instances) == 0 {
fail("No instances found in server array: %v\n", name)
}
return instances
}
|
go
|
func serverArray(client *cm15.API, name string) []*cm15.Instance {
serverArrayLocator := client.ServerArrayLocator("/api/server_arrays")
serverArrays, err := serverArrayLocator.Index(rsapi.APIParams{"view": "default", "filter": []string{"name==" + name}})
if err != nil {
fail("Failed to retrieve server array: %v\n", err.Error())
}
if len(serverArrays) == 0 {
fail("Could not find server array with name: %v\n", name)
} else if len(serverArrays) != 1 {
fail("More than one server array found with name: %v\n", name)
}
array := serverArrays[0]
var instancesHref string
for _, l := range array.Links {
if l["rel"] == "current_instances" {
instancesHref = l["href"]
break
}
}
instanceLocator := client.InstanceLocator(instancesHref)
instances, err := instanceLocator.Index(rsapi.APIParams{})
if err != nil {
fail("Failed to retrieve current instances of the server array: %v\n", err.Error())
}
if len(instances) == 0 {
fail("No instances found in server array: %v\n", name)
}
return instances
}
|
[
"func",
"serverArray",
"(",
"client",
"*",
"cm15",
".",
"API",
",",
"name",
"string",
")",
"[",
"]",
"*",
"cm15",
".",
"Instance",
"{",
"serverArrayLocator",
":=",
"client",
".",
"ServerArrayLocator",
"(",
"\"/api/server_arrays\"",
")",
"\n",
"serverArrays",
",",
"err",
":=",
"serverArrayLocator",
".",
"Index",
"(",
"rsapi",
".",
"APIParams",
"{",
"\"view\"",
":",
"\"default\"",
",",
"\"filter\"",
":",
"[",
"]",
"string",
"{",
"\"name==\"",
"+",
"name",
"}",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"fail",
"(",
"\"Failed to retrieve server array: %v\\n\"",
",",
"\\n",
")",
"\n",
"}",
"\n",
"err",
".",
"Error",
"(",
")",
"\n",
"if",
"len",
"(",
"serverArrays",
")",
"==",
"0",
"{",
"fail",
"(",
"\"Could not find server array with name: %v\\n\"",
",",
"\\n",
")",
"\n",
"}",
"else",
"name",
"\n",
"if",
"len",
"(",
"serverArrays",
")",
"!=",
"1",
"{",
"fail",
"(",
"\"More than one server array found with name: %v\\n\"",
",",
"\\n",
")",
"\n",
"}",
"\n",
"name",
"\n",
"array",
":=",
"serverArrays",
"[",
"0",
"]",
"\n",
"var",
"instancesHref",
"string",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"array",
".",
"Links",
"{",
"if",
"l",
"[",
"\"rel\"",
"]",
"==",
"\"current_instances\"",
"{",
"instancesHref",
"=",
"l",
"[",
"\"href\"",
"]",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"instanceLocator",
":=",
"client",
".",
"InstanceLocator",
"(",
"instancesHref",
")",
"\n",
"instances",
",",
"err",
":=",
"instanceLocator",
".",
"Index",
"(",
"rsapi",
".",
"APIParams",
"{",
"}",
")",
"\n",
"}"
] |
// Makes a GET call on the given server array and returns all its current instances.
|
[
"Makes",
"a",
"GET",
"call",
"on",
"the",
"given",
"server",
"array",
"and",
"returns",
"all",
"its",
"current",
"instances",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/examples/rsssh/main.go#L148-L176
|
test
|
rightscale/rsc
|
cm15/examples/rsssh/main.go
|
server
|
func server(client *cm15.API, name string) *cm15.Instance {
serverLocator := client.ServerLocator("/api/servers")
servers, err := serverLocator.Index(rsapi.APIParams{"view": "instance_detail", "filter": []string{"name==" + name}})
if err != nil {
fail("Failed to retrieve server: %v\n", err.Error())
}
if len(servers) == 0 {
fail("Could not find server with name: %v\n", name)
} else if len(servers) != 1 {
fail("More than one server found with name: %v\n", name)
}
return servers[0].CurrentInstance
}
|
go
|
func server(client *cm15.API, name string) *cm15.Instance {
serverLocator := client.ServerLocator("/api/servers")
servers, err := serverLocator.Index(rsapi.APIParams{"view": "instance_detail", "filter": []string{"name==" + name}})
if err != nil {
fail("Failed to retrieve server: %v\n", err.Error())
}
if len(servers) == 0 {
fail("Could not find server with name: %v\n", name)
} else if len(servers) != 1 {
fail("More than one server found with name: %v\n", name)
}
return servers[0].CurrentInstance
}
|
[
"func",
"server",
"(",
"client",
"*",
"cm15",
".",
"API",
",",
"name",
"string",
")",
"*",
"cm15",
".",
"Instance",
"{",
"serverLocator",
":=",
"client",
".",
"ServerLocator",
"(",
"\"/api/servers\"",
")",
"\n",
"servers",
",",
"err",
":=",
"serverLocator",
".",
"Index",
"(",
"rsapi",
".",
"APIParams",
"{",
"\"view\"",
":",
"\"instance_detail\"",
",",
"\"filter\"",
":",
"[",
"]",
"string",
"{",
"\"name==\"",
"+",
"name",
"}",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"fail",
"(",
"\"Failed to retrieve server: %v\\n\"",
",",
"\\n",
")",
"\n",
"}",
"\n",
"err",
".",
"Error",
"(",
")",
"\n",
"if",
"len",
"(",
"servers",
")",
"==",
"0",
"{",
"fail",
"(",
"\"Could not find server with name: %v\\n\"",
",",
"\\n",
")",
"\n",
"}",
"else",
"name",
"\n",
"}"
] |
// Makes a GET call on the given server and returns the current instance of the server.
|
[
"Makes",
"a",
"GET",
"call",
"on",
"the",
"given",
"server",
"and",
"returns",
"the",
"current",
"instance",
"of",
"the",
"server",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/examples/rsssh/main.go#L179-L191
|
test
|
rightscale/rsc
|
gen/praxisgen/main.go
|
toPackageName
|
func toPackageName(version string) string {
if version == "unversioned" {
return "v0"
}
parts := strings.Split(version, ".")
i := 1
p := parts[len(parts)-i]
for p == "0" && i <= len(parts) {
i++
p = parts[len(parts)-i]
}
version = strings.Join(parts, "_")
return fmt.Sprintf("v%s", version)
}
|
go
|
func toPackageName(version string) string {
if version == "unversioned" {
return "v0"
}
parts := strings.Split(version, ".")
i := 1
p := parts[len(parts)-i]
for p == "0" && i <= len(parts) {
i++
p = parts[len(parts)-i]
}
version = strings.Join(parts, "_")
return fmt.Sprintf("v%s", version)
}
|
[
"func",
"toPackageName",
"(",
"version",
"string",
")",
"string",
"{",
"if",
"version",
"==",
"\"unversioned\"",
"{",
"return",
"\"v0\"",
"\n",
"}",
"\n",
"parts",
":=",
"strings",
".",
"Split",
"(",
"version",
",",
"\".\"",
")",
"\n",
"i",
":=",
"1",
"\n",
"p",
":=",
"parts",
"[",
"len",
"(",
"parts",
")",
"-",
"i",
"]",
"\n",
"for",
"p",
"==",
"\"0\"",
"&&",
"i",
"<=",
"len",
"(",
"parts",
")",
"{",
"i",
"++",
"\n",
"p",
"=",
"parts",
"[",
"len",
"(",
"parts",
")",
"-",
"i",
"]",
"\n",
"}",
"\n",
"version",
"=",
"strings",
".",
"Join",
"(",
"parts",
",",
"\"_\"",
")",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"v%s\"",
",",
"version",
")",
"\n",
"}"
] |
// Convert version number in index.json to go package name
// "1.6" => "v1_6"
|
[
"Convert",
"version",
"number",
"in",
"index",
".",
"json",
"to",
"go",
"package",
"name",
"1",
".",
"6",
"=",
">",
"v1_6"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/gen/praxisgen/main.go#L173-L186
|
test
|
rightscale/rsc
|
gen/praxisgen/main.go
|
loadFile
|
func loadFile(file string) ([]byte, error) {
if _, err := os.Stat(file); err != nil {
return nil, fmt.Errorf("Cannot find '%s'", file)
}
js, err := ioutil.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("Cannot read '%s': %s", file, err)
}
return js, nil
}
|
go
|
func loadFile(file string) ([]byte, error) {
if _, err := os.Stat(file); err != nil {
return nil, fmt.Errorf("Cannot find '%s'", file)
}
js, err := ioutil.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("Cannot read '%s': %s", file, err)
}
return js, nil
}
|
[
"func",
"loadFile",
"(",
"file",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"file",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"Cannot find '%s'\"",
",",
"file",
")",
"\n",
"}",
"\n",
"js",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"file",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"Cannot read '%s': %s\"",
",",
"file",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"js",
",",
"nil",
"\n",
"}"
] |
// Helper function that reads content from given file
|
[
"Helper",
"function",
"that",
"reads",
"content",
"from",
"given",
"file"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/gen/praxisgen/main.go#L189-L198
|
test
|
rightscale/rsc
|
main.go
|
main
|
func main() {
app := kingpin.New("rsc", "A RightScale API client")
app.Writer(os.Stdout)
app.Version(VV)
cmdLine, err := ParseCommandLine(app)
if err != nil {
line := strings.Join(os.Args, " ")
PrintFatal("%s: %s", line, err.Error())
}
resp, err := ExecuteCommand(app, cmdLine)
if err != nil {
PrintFatal("%s", err.Error())
}
if resp == nil {
return // No results, just exit (e.g. setup, printed help...)
}
var notExactlyOneError bool
displayer, err := NewDisplayer(resp)
if err != nil {
PrintFatal("%s", err.Error())
}
if resp.StatusCode < 200 || resp.StatusCode > 299 {
// Let user know if something went wrong
fmt.Fprintln(errOut, resp.Status)
if len(displayer.body) > 0 {
fmt.Fprintln(errOut, displayer.body)
}
} else if cmdLine.ExtractOneSelect != "" {
err = displayer.ApplySingleExtract(cmdLine.ExtractOneSelect)
if err != nil {
notExactlyOneError = strings.Contains(err.Error(),
"instead of one value") // Ugh, there has to be a better way
PrintError(err.Error())
}
fmt.Fprint(out, displayer.Output())
} else {
if cmdLine.ExtractSelector != "" {
err = displayer.ApplyExtract(cmdLine.ExtractSelector, false)
} else if cmdLine.ExtractSelectorJSON != "" {
err = displayer.ApplyExtract(cmdLine.ExtractSelectorJSON, true)
} else if cmdLine.ExtractHeader != "" {
err = displayer.ApplyHeaderExtract(cmdLine.ExtractHeader)
}
if err != nil {
PrintFatal("%s", err.Error())
} else if cmdLine.Pretty {
displayer.Pretty()
}
fmt.Fprint(out, displayer.Output())
}
// Figure out exit code
exitStatus := 0
switch {
case notExactlyOneError:
exitStatus = 6
case resp.StatusCode == 401:
exitStatus = 1
case resp.StatusCode == 403:
exitStatus = 3
case resp.StatusCode == 404:
exitStatus = 4
case resp.StatusCode > 399 && resp.StatusCode < 500:
exitStatus = 2
case resp.StatusCode > 499:
exitStatus = 5
}
//fmt.Fprintf(os.Stderr, "exitStatus=%d\n", exitStatus)
osExit(exitStatus)
}
|
go
|
func main() {
app := kingpin.New("rsc", "A RightScale API client")
app.Writer(os.Stdout)
app.Version(VV)
cmdLine, err := ParseCommandLine(app)
if err != nil {
line := strings.Join(os.Args, " ")
PrintFatal("%s: %s", line, err.Error())
}
resp, err := ExecuteCommand(app, cmdLine)
if err != nil {
PrintFatal("%s", err.Error())
}
if resp == nil {
return // No results, just exit (e.g. setup, printed help...)
}
var notExactlyOneError bool
displayer, err := NewDisplayer(resp)
if err != nil {
PrintFatal("%s", err.Error())
}
if resp.StatusCode < 200 || resp.StatusCode > 299 {
// Let user know if something went wrong
fmt.Fprintln(errOut, resp.Status)
if len(displayer.body) > 0 {
fmt.Fprintln(errOut, displayer.body)
}
} else if cmdLine.ExtractOneSelect != "" {
err = displayer.ApplySingleExtract(cmdLine.ExtractOneSelect)
if err != nil {
notExactlyOneError = strings.Contains(err.Error(),
"instead of one value") // Ugh, there has to be a better way
PrintError(err.Error())
}
fmt.Fprint(out, displayer.Output())
} else {
if cmdLine.ExtractSelector != "" {
err = displayer.ApplyExtract(cmdLine.ExtractSelector, false)
} else if cmdLine.ExtractSelectorJSON != "" {
err = displayer.ApplyExtract(cmdLine.ExtractSelectorJSON, true)
} else if cmdLine.ExtractHeader != "" {
err = displayer.ApplyHeaderExtract(cmdLine.ExtractHeader)
}
if err != nil {
PrintFatal("%s", err.Error())
} else if cmdLine.Pretty {
displayer.Pretty()
}
fmt.Fprint(out, displayer.Output())
}
// Figure out exit code
exitStatus := 0
switch {
case notExactlyOneError:
exitStatus = 6
case resp.StatusCode == 401:
exitStatus = 1
case resp.StatusCode == 403:
exitStatus = 3
case resp.StatusCode == 404:
exitStatus = 4
case resp.StatusCode > 399 && resp.StatusCode < 500:
exitStatus = 2
case resp.StatusCode > 499:
exitStatus = 5
}
//fmt.Fprintf(os.Stderr, "exitStatus=%d\n", exitStatus)
osExit(exitStatus)
}
|
[
"func",
"main",
"(",
")",
"{",
"app",
":=",
"kingpin",
".",
"New",
"(",
"\"rsc\"",
",",
"\"A RightScale API client\"",
")",
"\n",
"app",
".",
"Writer",
"(",
"os",
".",
"Stdout",
")",
"\n",
"app",
".",
"Version",
"(",
"VV",
")",
"\n",
"cmdLine",
",",
"err",
":=",
"ParseCommandLine",
"(",
"app",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"line",
":=",
"strings",
".",
"Join",
"(",
"os",
".",
"Args",
",",
"\" \"",
")",
"\n",
"PrintFatal",
"(",
"\"%s: %s\"",
",",
"line",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"resp",
",",
"err",
":=",
"ExecuteCommand",
"(",
"app",
",",
"cmdLine",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"PrintFatal",
"(",
"\"%s\"",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"resp",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"var",
"notExactlyOneError",
"bool",
"\n",
"displayer",
",",
"err",
":=",
"NewDisplayer",
"(",
"resp",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"PrintFatal",
"(",
"\"%s\"",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"resp",
".",
"StatusCode",
"<",
"200",
"||",
"resp",
".",
"StatusCode",
">",
"299",
"{",
"fmt",
".",
"Fprintln",
"(",
"errOut",
",",
"resp",
".",
"Status",
")",
"\n",
"if",
"len",
"(",
"displayer",
".",
"body",
")",
">",
"0",
"{",
"fmt",
".",
"Fprintln",
"(",
"errOut",
",",
"displayer",
".",
"body",
")",
"\n",
"}",
"\n",
"}",
"else",
"if",
"cmdLine",
".",
"ExtractOneSelect",
"!=",
"\"\"",
"{",
"err",
"=",
"displayer",
".",
"ApplySingleExtract",
"(",
"cmdLine",
".",
"ExtractOneSelect",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"notExactlyOneError",
"=",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"\"instead of one value\"",
")",
"\n",
"PrintError",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"fmt",
".",
"Fprint",
"(",
"out",
",",
"displayer",
".",
"Output",
"(",
")",
")",
"\n",
"}",
"else",
"{",
"if",
"cmdLine",
".",
"ExtractSelector",
"!=",
"\"\"",
"{",
"err",
"=",
"displayer",
".",
"ApplyExtract",
"(",
"cmdLine",
".",
"ExtractSelector",
",",
"false",
")",
"\n",
"}",
"else",
"if",
"cmdLine",
".",
"ExtractSelectorJSON",
"!=",
"\"\"",
"{",
"err",
"=",
"displayer",
".",
"ApplyExtract",
"(",
"cmdLine",
".",
"ExtractSelectorJSON",
",",
"true",
")",
"\n",
"}",
"else",
"if",
"cmdLine",
".",
"ExtractHeader",
"!=",
"\"\"",
"{",
"err",
"=",
"displayer",
".",
"ApplyHeaderExtract",
"(",
"cmdLine",
".",
"ExtractHeader",
")",
"\n",
"}",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"PrintFatal",
"(",
"\"%s\"",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"else",
"if",
"cmdLine",
".",
"Pretty",
"{",
"displayer",
".",
"Pretty",
"(",
")",
"\n",
"}",
"\n",
"fmt",
".",
"Fprint",
"(",
"out",
",",
"displayer",
".",
"Output",
"(",
")",
")",
"\n",
"}",
"\n",
"exitStatus",
":=",
"0",
"\n",
"switch",
"{",
"case",
"notExactlyOneError",
":",
"exitStatus",
"=",
"6",
"\n",
"case",
"resp",
".",
"StatusCode",
"==",
"401",
":",
"exitStatus",
"=",
"1",
"\n",
"case",
"resp",
".",
"StatusCode",
"==",
"403",
":",
"exitStatus",
"=",
"3",
"\n",
"case",
"resp",
".",
"StatusCode",
"==",
"404",
":",
"exitStatus",
"=",
"4",
"\n",
"case",
"resp",
".",
"StatusCode",
">",
"399",
"&&",
"resp",
".",
"StatusCode",
"<",
"500",
":",
"exitStatus",
"=",
"2",
"\n",
"case",
"resp",
".",
"StatusCode",
">",
"499",
":",
"exitStatus",
"=",
"5",
"\n",
"}",
"\n",
"osExit",
"(",
"exitStatus",
")",
"\n",
"}"
] |
// Command line client entry point.
|
[
"Command",
"line",
"client",
"entry",
"point",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/main.go#L23-L94
|
test
|
rightscale/rsc
|
main.go
|
runCommand
|
func runCommand(client cmd.CommandClient, cmdLine *cmd.CommandLine) (resp *http.Response, err error) {
cmds := strings.Split(cmdLine.Command, " ")
if cmdLine.ShowHelp {
err = client.ShowCommandHelp(cmdLine.Command)
} else if len(cmds) > 1 && cmds[1] == "actions" {
err = client.ShowAPIActions(cmdLine.Command)
} else {
resp, err = client.RunCommand(cmdLine.Command)
}
return
}
|
go
|
func runCommand(client cmd.CommandClient, cmdLine *cmd.CommandLine) (resp *http.Response, err error) {
cmds := strings.Split(cmdLine.Command, " ")
if cmdLine.ShowHelp {
err = client.ShowCommandHelp(cmdLine.Command)
} else if len(cmds) > 1 && cmds[1] == "actions" {
err = client.ShowAPIActions(cmdLine.Command)
} else {
resp, err = client.RunCommand(cmdLine.Command)
}
return
}
|
[
"func",
"runCommand",
"(",
"client",
"cmd",
".",
"CommandClient",
",",
"cmdLine",
"*",
"cmd",
".",
"CommandLine",
")",
"(",
"resp",
"*",
"http",
".",
"Response",
",",
"err",
"error",
")",
"{",
"cmds",
":=",
"strings",
".",
"Split",
"(",
"cmdLine",
".",
"Command",
",",
"\" \"",
")",
"\n",
"if",
"cmdLine",
".",
"ShowHelp",
"{",
"err",
"=",
"client",
".",
"ShowCommandHelp",
"(",
"cmdLine",
".",
"Command",
")",
"\n",
"}",
"else",
"if",
"len",
"(",
"cmds",
")",
">",
"1",
"&&",
"cmds",
"[",
"1",
"]",
"==",
"\"actions\"",
"{",
"err",
"=",
"client",
".",
"ShowAPIActions",
"(",
"cmdLine",
".",
"Command",
")",
"\n",
"}",
"else",
"{",
"resp",
",",
"err",
"=",
"client",
".",
"RunCommand",
"(",
"cmdLine",
".",
"Command",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
// Helper that runs command line with give command client
|
[
"Helper",
"that",
"runs",
"command",
"line",
"with",
"give",
"command",
"client"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/main.go#L97-L107
|
test
|
rightscale/rsc
|
main.go
|
CreateJSONResponse
|
func CreateJSONResponse(b []byte) (resp *http.Response) {
// Remove UTF-8 Byte Order Mark if it exists
b = bytes.TrimPrefix(b, []byte{0xef, 0xbb, 0xbf})
resp = &http.Response{
StatusCode: 200,
Body: ioutil.NopCloser(bytes.NewBuffer(b)),
}
return resp
}
|
go
|
func CreateJSONResponse(b []byte) (resp *http.Response) {
// Remove UTF-8 Byte Order Mark if it exists
b = bytes.TrimPrefix(b, []byte{0xef, 0xbb, 0xbf})
resp = &http.Response{
StatusCode: 200,
Body: ioutil.NopCloser(bytes.NewBuffer(b)),
}
return resp
}
|
[
"func",
"CreateJSONResponse",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"resp",
"*",
"http",
".",
"Response",
")",
"{",
"b",
"=",
"bytes",
".",
"TrimPrefix",
"(",
"b",
",",
"[",
"]",
"byte",
"{",
"0xef",
",",
"0xbb",
",",
"0xbf",
"}",
")",
"\n",
"resp",
"=",
"&",
"http",
".",
"Response",
"{",
"StatusCode",
":",
"200",
",",
"Body",
":",
"ioutil",
".",
"NopCloser",
"(",
"bytes",
".",
"NewBuffer",
"(",
"b",
")",
")",
",",
"}",
"\n",
"return",
"resp",
"\n",
"}"
] |
// Constructs an http response from JSON input from Stdin
|
[
"Constructs",
"an",
"http",
"response",
"from",
"JSON",
"input",
"from",
"Stdin"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/main.go#L136-L144
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
AccountLocator
|
func (api *API) AccountLocator(href string) *AccountLocator {
return &AccountLocator{Href(href), api}
}
|
go
|
func (api *API) AccountLocator(href string) *AccountLocator {
return &AccountLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AccountLocator",
"(",
"href",
"string",
")",
"*",
"AccountLocator",
"{",
"return",
"&",
"AccountLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AccountLocator builds a locator from the given href.
|
[
"AccountLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L87-L89
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
AccountGroupLocator
|
func (api *API) AccountGroupLocator(href string) *AccountGroupLocator {
return &AccountGroupLocator{Href(href), api}
}
|
go
|
func (api *API) AccountGroupLocator(href string) *AccountGroupLocator {
return &AccountGroupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AccountGroupLocator",
"(",
"href",
"string",
")",
"*",
"AccountGroupLocator",
"{",
"return",
"&",
"AccountGroupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AccountGroupLocator builds a locator from the given href.
|
[
"AccountGroupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L161-L163
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
AlertLocator
|
func (api *API) AlertLocator(href string) *AlertLocator {
return &AlertLocator{Href(href), api}
}
|
go
|
func (api *API) AlertLocator(href string) *AlertLocator {
return &AlertLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AlertLocator",
"(",
"href",
"string",
")",
"*",
"AlertLocator",
"{",
"return",
"&",
"AlertLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AlertLocator builds a locator from the given href.
|
[
"AlertLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L292-L294
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
AlertSpecLocator
|
func (api *API) AlertSpecLocator(href string) *AlertSpecLocator {
return &AlertSpecLocator{Href(href), api}
}
|
go
|
func (api *API) AlertSpecLocator(href string) *AlertSpecLocator {
return &AlertSpecLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AlertSpecLocator",
"(",
"href",
"string",
")",
"*",
"AlertSpecLocator",
"{",
"return",
"&",
"AlertSpecLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AlertSpecLocator builds a locator from the given href.
|
[
"AlertSpecLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L590-L592
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
AuditEntryLocator
|
func (api *API) AuditEntryLocator(href string) *AuditEntryLocator {
return &AuditEntryLocator{Href(href), api}
}
|
go
|
func (api *API) AuditEntryLocator(href string) *AuditEntryLocator {
return &AuditEntryLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AuditEntryLocator",
"(",
"href",
"string",
")",
"*",
"AuditEntryLocator",
"{",
"return",
"&",
"AuditEntryLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AuditEntryLocator builds a locator from the given href.
|
[
"AuditEntryLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L857-L859
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
BackupLocator
|
func (api *API) BackupLocator(href string) *BackupLocator {
return &BackupLocator{Href(href), api}
}
|
go
|
func (api *API) BackupLocator(href string) *BackupLocator {
return &BackupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"BackupLocator",
"(",
"href",
"string",
")",
"*",
"BackupLocator",
"{",
"return",
"&",
"BackupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// BackupLocator builds a locator from the given href.
|
[
"BackupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L1206-L1208
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ChildAccountLocator
|
func (api *API) ChildAccountLocator(href string) *ChildAccountLocator {
return &ChildAccountLocator{Href(href), api}
}
|
go
|
func (api *API) ChildAccountLocator(href string) *ChildAccountLocator {
return &ChildAccountLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ChildAccountLocator",
"(",
"href",
"string",
")",
"*",
"ChildAccountLocator",
"{",
"return",
"&",
"ChildAccountLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ChildAccountLocator builds a locator from the given href.
|
[
"ChildAccountLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L1579-L1581
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
CloudLocator
|
func (api *API) CloudLocator(href string) *CloudLocator {
return &CloudLocator{Href(href), api}
}
|
go
|
func (api *API) CloudLocator(href string) *CloudLocator {
return &CloudLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CloudLocator",
"(",
"href",
"string",
")",
"*",
"CloudLocator",
"{",
"return",
"&",
"CloudLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CloudLocator builds a locator from the given href.
|
[
"CloudLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L1746-L1748
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
CloudAccountLocator
|
func (api *API) CloudAccountLocator(href string) *CloudAccountLocator {
return &CloudAccountLocator{Href(href), api}
}
|
go
|
func (api *API) CloudAccountLocator(href string) *CloudAccountLocator {
return &CloudAccountLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CloudAccountLocator",
"(",
"href",
"string",
")",
"*",
"CloudAccountLocator",
"{",
"return",
"&",
"CloudAccountLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CloudAccountLocator builds a locator from the given href.
|
[
"CloudAccountLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L1873-L1875
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
CookbookLocator
|
func (api *API) CookbookLocator(href string) *CookbookLocator {
return &CookbookLocator{Href(href), api}
}
|
go
|
func (api *API) CookbookLocator(href string) *CookbookLocator {
return &CookbookLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CookbookLocator",
"(",
"href",
"string",
")",
"*",
"CookbookLocator",
"{",
"return",
"&",
"CookbookLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CookbookLocator builds a locator from the given href.
|
[
"CookbookLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L2114-L2116
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
CookbookAttachmentLocator
|
func (api *API) CookbookAttachmentLocator(href string) *CookbookAttachmentLocator {
return &CookbookAttachmentLocator{Href(href), api}
}
|
go
|
func (api *API) CookbookAttachmentLocator(href string) *CookbookAttachmentLocator {
return &CookbookAttachmentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CookbookAttachmentLocator",
"(",
"href",
"string",
")",
"*",
"CookbookAttachmentLocator",
"{",
"return",
"&",
"CookbookAttachmentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CookbookAttachmentLocator builds a locator from the given href.
|
[
"CookbookAttachmentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L2388-L2390
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
CredentialLocator
|
func (api *API) CredentialLocator(href string) *CredentialLocator {
return &CredentialLocator{Href(href), api}
}
|
go
|
func (api *API) CredentialLocator(href string) *CredentialLocator {
return &CredentialLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CredentialLocator",
"(",
"href",
"string",
")",
"*",
"CredentialLocator",
"{",
"return",
"&",
"CredentialLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CredentialLocator builds a locator from the given href.
|
[
"CredentialLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L2677-L2679
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
DatacenterLocator
|
func (api *API) DatacenterLocator(href string) *DatacenterLocator {
return &DatacenterLocator{Href(href), api}
}
|
go
|
func (api *API) DatacenterLocator(href string) *DatacenterLocator {
return &DatacenterLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"DatacenterLocator",
"(",
"href",
"string",
")",
"*",
"DatacenterLocator",
"{",
"return",
"&",
"DatacenterLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// DatacenterLocator builds a locator from the given href.
|
[
"DatacenterLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L2921-L2923
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
DeploymentLocator
|
func (api *API) DeploymentLocator(href string) *DeploymentLocator {
return &DeploymentLocator{Href(href), api}
}
|
go
|
func (api *API) DeploymentLocator(href string) *DeploymentLocator {
return &DeploymentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"DeploymentLocator",
"(",
"href",
"string",
")",
"*",
"DeploymentLocator",
"{",
"return",
"&",
"DeploymentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// DeploymentLocator builds a locator from the given href.
|
[
"DeploymentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3052-L3054
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
HealthCheckLocator
|
func (api *API) HealthCheckLocator(href string) *HealthCheckLocator {
return &HealthCheckLocator{Href(href), api}
}
|
go
|
func (api *API) HealthCheckLocator(href string) *HealthCheckLocator {
return &HealthCheckLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"HealthCheckLocator",
"(",
"href",
"string",
")",
"*",
"HealthCheckLocator",
"{",
"return",
"&",
"HealthCheckLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// HealthCheckLocator builds a locator from the given href.
|
[
"HealthCheckLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3424-L3426
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
IdentityProviderLocator
|
func (api *API) IdentityProviderLocator(href string) *IdentityProviderLocator {
return &IdentityProviderLocator{Href(href), api}
}
|
go
|
func (api *API) IdentityProviderLocator(href string) *IdentityProviderLocator {
return &IdentityProviderLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"IdentityProviderLocator",
"(",
"href",
"string",
")",
"*",
"IdentityProviderLocator",
"{",
"return",
"&",
"IdentityProviderLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// IdentityProviderLocator builds a locator from the given href.
|
[
"IdentityProviderLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3500-L3502
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ImageLocator
|
func (api *API) ImageLocator(href string) *ImageLocator {
return &ImageLocator{Href(href), api}
}
|
go
|
func (api *API) ImageLocator(href string) *ImageLocator {
return &ImageLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ImageLocator",
"(",
"href",
"string",
")",
"*",
"ImageLocator",
"{",
"return",
"&",
"ImageLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ImageLocator builds a locator from the given href.
|
[
"ImageLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3636-L3638
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
InputLocator
|
func (api *API) InputLocator(href string) *InputLocator {
return &InputLocator{Href(href), api}
}
|
go
|
func (api *API) InputLocator(href string) *InputLocator {
return &InputLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InputLocator",
"(",
"href",
"string",
")",
"*",
"InputLocator",
"{",
"return",
"&",
"InputLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InputLocator builds a locator from the given href.
|
[
"InputLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3755-L3757
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
InstanceLocator
|
func (api *API) InstanceLocator(href string) *InstanceLocator {
return &InstanceLocator{Href(href), api}
}
|
go
|
func (api *API) InstanceLocator(href string) *InstanceLocator {
return &InstanceLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InstanceLocator",
"(",
"href",
"string",
")",
"*",
"InstanceLocator",
"{",
"return",
"&",
"InstanceLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InstanceLocator builds a locator from the given href.
|
[
"InstanceLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L3969-L3971
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
InstanceTypeLocator
|
func (api *API) InstanceTypeLocator(href string) *InstanceTypeLocator {
return &InstanceTypeLocator{Href(href), api}
}
|
go
|
func (api *API) InstanceTypeLocator(href string) *InstanceTypeLocator {
return &InstanceTypeLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InstanceTypeLocator",
"(",
"href",
"string",
")",
"*",
"InstanceTypeLocator",
"{",
"return",
"&",
"InstanceTypeLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InstanceTypeLocator builds a locator from the given href.
|
[
"InstanceTypeLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L4606-L4608
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
IpAddressLocator
|
func (api *API) IpAddressLocator(href string) *IpAddressLocator {
return &IpAddressLocator{Href(href), api}
}
|
go
|
func (api *API) IpAddressLocator(href string) *IpAddressLocator {
return &IpAddressLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"IpAddressLocator",
"(",
"href",
"string",
")",
"*",
"IpAddressLocator",
"{",
"return",
"&",
"IpAddressLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// IpAddressLocator builds a locator from the given href.
|
[
"IpAddressLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L4747-L4749
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
IpAddressBindingLocator
|
func (api *API) IpAddressBindingLocator(href string) *IpAddressBindingLocator {
return &IpAddressBindingLocator{Href(href), api}
}
|
go
|
func (api *API) IpAddressBindingLocator(href string) *IpAddressBindingLocator {
return &IpAddressBindingLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"IpAddressBindingLocator",
"(",
"href",
"string",
")",
"*",
"IpAddressBindingLocator",
"{",
"return",
"&",
"IpAddressBindingLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// IpAddressBindingLocator builds a locator from the given href.
|
[
"IpAddressBindingLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L4979-L4981
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
MonitoringMetricLocator
|
func (api *API) MonitoringMetricLocator(href string) *MonitoringMetricLocator {
return &MonitoringMetricLocator{Href(href), api}
}
|
go
|
func (api *API) MonitoringMetricLocator(href string) *MonitoringMetricLocator {
return &MonitoringMetricLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"MonitoringMetricLocator",
"(",
"href",
"string",
")",
"*",
"MonitoringMetricLocator",
"{",
"return",
"&",
"MonitoringMetricLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// MonitoringMetricLocator builds a locator from the given href.
|
[
"MonitoringMetricLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L5179-L5181
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
MultiCloudImageLocator
|
func (api *API) MultiCloudImageLocator(href string) *MultiCloudImageLocator {
return &MultiCloudImageLocator{Href(href), api}
}
|
go
|
func (api *API) MultiCloudImageLocator(href string) *MultiCloudImageLocator {
return &MultiCloudImageLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"MultiCloudImageLocator",
"(",
"href",
"string",
")",
"*",
"MultiCloudImageLocator",
"{",
"return",
"&",
"MultiCloudImageLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// MultiCloudImageLocator builds a locator from the given href.
|
[
"MultiCloudImageLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L5396-L5398
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
MultiCloudImageMatcherLocator
|
func (api *API) MultiCloudImageMatcherLocator(href string) *MultiCloudImageMatcherLocator {
return &MultiCloudImageMatcherLocator{Href(href), api}
}
|
go
|
func (api *API) MultiCloudImageMatcherLocator(href string) *MultiCloudImageMatcherLocator {
return &MultiCloudImageMatcherLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"MultiCloudImageMatcherLocator",
"(",
"href",
"string",
")",
"*",
"MultiCloudImageMatcherLocator",
"{",
"return",
"&",
"MultiCloudImageMatcherLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// MultiCloudImageMatcherLocator builds a locator from the given href.
|
[
"MultiCloudImageMatcherLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L5712-L5714
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
MultiCloudImageSettingLocator
|
func (api *API) MultiCloudImageSettingLocator(href string) *MultiCloudImageSettingLocator {
return &MultiCloudImageSettingLocator{Href(href), api}
}
|
go
|
func (api *API) MultiCloudImageSettingLocator(href string) *MultiCloudImageSettingLocator {
return &MultiCloudImageSettingLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"MultiCloudImageSettingLocator",
"(",
"href",
"string",
")",
"*",
"MultiCloudImageSettingLocator",
"{",
"return",
"&",
"MultiCloudImageSettingLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// MultiCloudImageSettingLocator builds a locator from the given href.
|
[
"MultiCloudImageSettingLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L5925-L5927
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
NetworkLocator
|
func (api *API) NetworkLocator(href string) *NetworkLocator {
return &NetworkLocator{Href(href), api}
}
|
go
|
func (api *API) NetworkLocator(href string) *NetworkLocator {
return &NetworkLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"NetworkLocator",
"(",
"href",
"string",
")",
"*",
"NetworkLocator",
"{",
"return",
"&",
"NetworkLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// NetworkLocator builds a locator from the given href.
|
[
"NetworkLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L6157-L6159
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
NetworkGatewayLocator
|
func (api *API) NetworkGatewayLocator(href string) *NetworkGatewayLocator {
return &NetworkGatewayLocator{Href(href), api}
}
|
go
|
func (api *API) NetworkGatewayLocator(href string) *NetworkGatewayLocator {
return &NetworkGatewayLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"NetworkGatewayLocator",
"(",
"href",
"string",
")",
"*",
"NetworkGatewayLocator",
"{",
"return",
"&",
"NetworkGatewayLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// NetworkGatewayLocator builds a locator from the given href.
|
[
"NetworkGatewayLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L6390-L6392
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
NetworkOptionGroupLocator
|
func (api *API) NetworkOptionGroupLocator(href string) *NetworkOptionGroupLocator {
return &NetworkOptionGroupLocator{Href(href), api}
}
|
go
|
func (api *API) NetworkOptionGroupLocator(href string) *NetworkOptionGroupLocator {
return &NetworkOptionGroupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"NetworkOptionGroupLocator",
"(",
"href",
"string",
")",
"*",
"NetworkOptionGroupLocator",
"{",
"return",
"&",
"NetworkOptionGroupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// NetworkOptionGroupLocator builds a locator from the given href.
|
[
"NetworkOptionGroupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L6628-L6630
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
NetworkOptionGroupAttachmentLocator
|
func (api *API) NetworkOptionGroupAttachmentLocator(href string) *NetworkOptionGroupAttachmentLocator {
return &NetworkOptionGroupAttachmentLocator{Href(href), api}
}
|
go
|
func (api *API) NetworkOptionGroupAttachmentLocator(href string) *NetworkOptionGroupAttachmentLocator {
return &NetworkOptionGroupAttachmentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"NetworkOptionGroupAttachmentLocator",
"(",
"href",
"string",
")",
"*",
"NetworkOptionGroupAttachmentLocator",
"{",
"return",
"&",
"NetworkOptionGroupAttachmentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// NetworkOptionGroupAttachmentLocator builds a locator from the given href.
|
[
"NetworkOptionGroupAttachmentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L6865-L6867
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
Oauth2Locator
|
func (api *API) Oauth2Locator(href string) *Oauth2Locator {
return &Oauth2Locator{Href(href), api}
}
|
go
|
func (api *API) Oauth2Locator(href string) *Oauth2Locator {
return &Oauth2Locator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"Oauth2Locator",
"(",
"href",
"string",
")",
"*",
"Oauth2Locator",
"{",
"return",
"&",
"Oauth2Locator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// Oauth2Locator builds a locator from the given href.
|
[
"Oauth2Locator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L7090-L7092
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
PermissionLocator
|
func (api *API) PermissionLocator(href string) *PermissionLocator {
return &PermissionLocator{Href(href), api}
}
|
go
|
func (api *API) PermissionLocator(href string) *PermissionLocator {
return &PermissionLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PermissionLocator",
"(",
"href",
"string",
")",
"*",
"PermissionLocator",
"{",
"return",
"&",
"PermissionLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PermissionLocator builds a locator from the given href.
|
[
"PermissionLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L7232-L7234
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
PlacementGroupLocator
|
func (api *API) PlacementGroupLocator(href string) *PlacementGroupLocator {
return &PlacementGroupLocator{Href(href), api}
}
|
go
|
func (api *API) PlacementGroupLocator(href string) *PlacementGroupLocator {
return &PlacementGroupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PlacementGroupLocator",
"(",
"href",
"string",
")",
"*",
"PlacementGroupLocator",
"{",
"return",
"&",
"PlacementGroupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PlacementGroupLocator builds a locator from the given href.
|
[
"PlacementGroupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L7441-L7443
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
PreferenceLocator
|
func (api *API) PreferenceLocator(href string) *PreferenceLocator {
return &PreferenceLocator{Href(href), api}
}
|
go
|
func (api *API) PreferenceLocator(href string) *PreferenceLocator {
return &PreferenceLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PreferenceLocator",
"(",
"href",
"string",
")",
"*",
"PreferenceLocator",
"{",
"return",
"&",
"PreferenceLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PreferenceLocator builds a locator from the given href.
|
[
"PreferenceLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L7644-L7646
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
PublicationLocator
|
func (api *API) PublicationLocator(href string) *PublicationLocator {
return &PublicationLocator{Href(href), api}
}
|
go
|
func (api *API) PublicationLocator(href string) *PublicationLocator {
return &PublicationLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PublicationLocator",
"(",
"href",
"string",
")",
"*",
"PublicationLocator",
"{",
"return",
"&",
"PublicationLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PublicationLocator builds a locator from the given href.
|
[
"PublicationLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L7838-L7840
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
PublicationLineageLocator
|
func (api *API) PublicationLineageLocator(href string) *PublicationLineageLocator {
return &PublicationLineageLocator{Href(href), api}
}
|
go
|
func (api *API) PublicationLineageLocator(href string) *PublicationLineageLocator {
return &PublicationLineageLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PublicationLineageLocator",
"(",
"href",
"string",
")",
"*",
"PublicationLineageLocator",
"{",
"return",
"&",
"PublicationLineageLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PublicationLineageLocator builds a locator from the given href.
|
[
"PublicationLineageLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L8004-L8006
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RecurringVolumeAttachmentLocator
|
func (api *API) RecurringVolumeAttachmentLocator(href string) *RecurringVolumeAttachmentLocator {
return &RecurringVolumeAttachmentLocator{Href(href), api}
}
|
go
|
func (api *API) RecurringVolumeAttachmentLocator(href string) *RecurringVolumeAttachmentLocator {
return &RecurringVolumeAttachmentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RecurringVolumeAttachmentLocator",
"(",
"href",
"string",
")",
"*",
"RecurringVolumeAttachmentLocator",
"{",
"return",
"&",
"RecurringVolumeAttachmentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RecurringVolumeAttachmentLocator builds a locator from the given href.
|
[
"RecurringVolumeAttachmentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L8090-L8092
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RepositoryLocator
|
func (api *API) RepositoryLocator(href string) *RepositoryLocator {
return &RepositoryLocator{Href(href), api}
}
|
go
|
func (api *API) RepositoryLocator(href string) *RepositoryLocator {
return &RepositoryLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RepositoryLocator",
"(",
"href",
"string",
")",
"*",
"RepositoryLocator",
"{",
"return",
"&",
"RepositoryLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RepositoryLocator builds a locator from the given href.
|
[
"RepositoryLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L8312-L8314
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RepositoryAssetLocator
|
func (api *API) RepositoryAssetLocator(href string) *RepositoryAssetLocator {
return &RepositoryAssetLocator{Href(href), api}
}
|
go
|
func (api *API) RepositoryAssetLocator(href string) *RepositoryAssetLocator {
return &RepositoryAssetLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RepositoryAssetLocator",
"(",
"href",
"string",
")",
"*",
"RepositoryAssetLocator",
"{",
"return",
"&",
"RepositoryAssetLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RepositoryAssetLocator builds a locator from the given href.
|
[
"RepositoryAssetLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L8773-L8775
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ResourceGroupLocator
|
func (api *API) ResourceGroupLocator(href string) *ResourceGroupLocator {
return &ResourceGroupLocator{Href(href), api}
}
|
go
|
func (api *API) ResourceGroupLocator(href string) *ResourceGroupLocator {
return &ResourceGroupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ResourceGroupLocator",
"(",
"href",
"string",
")",
"*",
"ResourceGroupLocator",
"{",
"return",
"&",
"ResourceGroupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ResourceGroupLocator builds a locator from the given href.
|
[
"ResourceGroupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L8903-L8905
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RightScriptLocator
|
func (api *API) RightScriptLocator(href string) *RightScriptLocator {
return &RightScriptLocator{Href(href), api}
}
|
go
|
func (api *API) RightScriptLocator(href string) *RightScriptLocator {
return &RightScriptLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RightScriptLocator",
"(",
"href",
"string",
")",
"*",
"RightScriptLocator",
"{",
"return",
"&",
"RightScriptLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RightScriptLocator builds a locator from the given href.
|
[
"RightScriptLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L9143-L9145
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RightScriptAttachmentLocator
|
func (api *API) RightScriptAttachmentLocator(href string) *RightScriptAttachmentLocator {
return &RightScriptAttachmentLocator{Href(href), api}
}
|
go
|
func (api *API) RightScriptAttachmentLocator(href string) *RightScriptAttachmentLocator {
return &RightScriptAttachmentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RightScriptAttachmentLocator",
"(",
"href",
"string",
")",
"*",
"RightScriptAttachmentLocator",
"{",
"return",
"&",
"RightScriptAttachmentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RightScriptAttachmentLocator builds a locator from the given href.
|
[
"RightScriptAttachmentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L9494-L9496
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RouteLocator
|
func (api *API) RouteLocator(href string) *RouteLocator {
return &RouteLocator{Href(href), api}
}
|
go
|
func (api *API) RouteLocator(href string) *RouteLocator {
return &RouteLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RouteLocator",
"(",
"href",
"string",
")",
"*",
"RouteLocator",
"{",
"return",
"&",
"RouteLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RouteLocator builds a locator from the given href.
|
[
"RouteLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L9742-L9744
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RouteTableLocator
|
func (api *API) RouteTableLocator(href string) *RouteTableLocator {
return &RouteTableLocator{Href(href), api}
}
|
go
|
func (api *API) RouteTableLocator(href string) *RouteTableLocator {
return &RouteTableLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RouteTableLocator",
"(",
"href",
"string",
")",
"*",
"RouteTableLocator",
"{",
"return",
"&",
"RouteTableLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RouteTableLocator builds a locator from the given href.
|
[
"RouteTableLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L9979-L9981
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
RunnableBindingLocator
|
func (api *API) RunnableBindingLocator(href string) *RunnableBindingLocator {
return &RunnableBindingLocator{Href(href), api}
}
|
go
|
func (api *API) RunnableBindingLocator(href string) *RunnableBindingLocator {
return &RunnableBindingLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"RunnableBindingLocator",
"(",
"href",
"string",
")",
"*",
"RunnableBindingLocator",
"{",
"return",
"&",
"RunnableBindingLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// RunnableBindingLocator builds a locator from the given href.
|
[
"RunnableBindingLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L10224-L10226
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SchedulerLocator
|
func (api *API) SchedulerLocator(href string) *SchedulerLocator {
return &SchedulerLocator{Href(href), api}
}
|
go
|
func (api *API) SchedulerLocator(href string) *SchedulerLocator {
return &SchedulerLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SchedulerLocator",
"(",
"href",
"string",
")",
"*",
"SchedulerLocator",
"{",
"return",
"&",
"SchedulerLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SchedulerLocator builds a locator from the given href.
|
[
"SchedulerLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L10451-L10453
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SecurityGroupLocator
|
func (api *API) SecurityGroupLocator(href string) *SecurityGroupLocator {
return &SecurityGroupLocator{Href(href), api}
}
|
go
|
func (api *API) SecurityGroupLocator(href string) *SecurityGroupLocator {
return &SecurityGroupLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SecurityGroupLocator",
"(",
"href",
"string",
")",
"*",
"SecurityGroupLocator",
"{",
"return",
"&",
"SecurityGroupLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SecurityGroupLocator builds a locator from the given href.
|
[
"SecurityGroupLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L10633-L10635
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SecurityGroupRuleLocator
|
func (api *API) SecurityGroupRuleLocator(href string) *SecurityGroupRuleLocator {
return &SecurityGroupRuleLocator{Href(href), api}
}
|
go
|
func (api *API) SecurityGroupRuleLocator(href string) *SecurityGroupRuleLocator {
return &SecurityGroupRuleLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SecurityGroupRuleLocator",
"(",
"href",
"string",
")",
"*",
"SecurityGroupRuleLocator",
"{",
"return",
"&",
"SecurityGroupRuleLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SecurityGroupRuleLocator builds a locator from the given href.
|
[
"SecurityGroupRuleLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L10853-L10855
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ServerLocator
|
func (api *API) ServerLocator(href string) *ServerLocator {
return &ServerLocator{Href(href), api}
}
|
go
|
func (api *API) ServerLocator(href string) *ServerLocator {
return &ServerLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ServerLocator",
"(",
"href",
"string",
")",
"*",
"ServerLocator",
"{",
"return",
"&",
"ServerLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ServerLocator builds a locator from the given href.
|
[
"ServerLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L11111-L11113
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ServerArrayLocator
|
func (api *API) ServerArrayLocator(href string) *ServerArrayLocator {
return &ServerArrayLocator{Href(href), api}
}
|
go
|
func (api *API) ServerArrayLocator(href string) *ServerArrayLocator {
return &ServerArrayLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ServerArrayLocator",
"(",
"href",
"string",
")",
"*",
"ServerArrayLocator",
"{",
"return",
"&",
"ServerArrayLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ServerArrayLocator builds a locator from the given href.
|
[
"ServerArrayLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L11628-L11630
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ServerTemplateLocator
|
func (api *API) ServerTemplateLocator(href string) *ServerTemplateLocator {
return &ServerTemplateLocator{Href(href), api}
}
|
go
|
func (api *API) ServerTemplateLocator(href string) *ServerTemplateLocator {
return &ServerTemplateLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ServerTemplateLocator",
"(",
"href",
"string",
")",
"*",
"ServerTemplateLocator",
"{",
"return",
"&",
"ServerTemplateLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ServerTemplateLocator builds a locator from the given href.
|
[
"ServerTemplateLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L12286-L12288
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
ServerTemplateMultiCloudImageLocator
|
func (api *API) ServerTemplateMultiCloudImageLocator(href string) *ServerTemplateMultiCloudImageLocator {
return &ServerTemplateMultiCloudImageLocator{Href(href), api}
}
|
go
|
func (api *API) ServerTemplateMultiCloudImageLocator(href string) *ServerTemplateMultiCloudImageLocator {
return &ServerTemplateMultiCloudImageLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ServerTemplateMultiCloudImageLocator",
"(",
"href",
"string",
")",
"*",
"ServerTemplateMultiCloudImageLocator",
"{",
"return",
"&",
"ServerTemplateMultiCloudImageLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ServerTemplateMultiCloudImageLocator builds a locator from the given href.
|
[
"ServerTemplateMultiCloudImageLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L12814-L12816
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SessionLocator
|
func (api *API) SessionLocator(href string) *SessionLocator {
return &SessionLocator{Href(href), api}
}
|
go
|
func (api *API) SessionLocator(href string) *SessionLocator {
return &SessionLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SessionLocator",
"(",
"href",
"string",
")",
"*",
"SessionLocator",
"{",
"return",
"&",
"SessionLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SessionLocator builds a locator from the given href.
|
[
"SessionLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L13051-L13053
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SshKeyLocator
|
func (api *API) SshKeyLocator(href string) *SshKeyLocator {
return &SshKeyLocator{Href(href), api}
}
|
go
|
func (api *API) SshKeyLocator(href string) *SshKeyLocator {
return &SshKeyLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SshKeyLocator",
"(",
"href",
"string",
")",
"*",
"SshKeyLocator",
"{",
"return",
"&",
"SshKeyLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SshKeyLocator builds a locator from the given href.
|
[
"SshKeyLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L13238-L13240
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
SubnetLocator
|
func (api *API) SubnetLocator(href string) *SubnetLocator {
return &SubnetLocator{Href(href), api}
}
|
go
|
func (api *API) SubnetLocator(href string) *SubnetLocator {
return &SubnetLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"SubnetLocator",
"(",
"href",
"string",
")",
"*",
"SubnetLocator",
"{",
"return",
"&",
"SubnetLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// SubnetLocator builds a locator from the given href.
|
[
"SubnetLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L13445-L13447
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
TagLocator
|
func (api *API) TagLocator(href string) *TagLocator {
return &TagLocator{Href(href), api}
}
|
go
|
func (api *API) TagLocator(href string) *TagLocator {
return &TagLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"TagLocator",
"(",
"href",
"string",
")",
"*",
"TagLocator",
"{",
"return",
"&",
"TagLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// TagLocator builds a locator from the given href.
|
[
"TagLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L13666-L13668
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
TaskLocator
|
func (api *API) TaskLocator(href string) *TaskLocator {
return &TaskLocator{Href(href), api}
}
|
go
|
func (api *API) TaskLocator(href string) *TaskLocator {
return &TaskLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"TaskLocator",
"(",
"href",
"string",
")",
"*",
"TaskLocator",
"{",
"return",
"&",
"TaskLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// TaskLocator builds a locator from the given href.
|
[
"TaskLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L13920-L13922
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
UserLocator
|
func (api *API) UserLocator(href string) *UserLocator {
return &UserLocator{Href(href), api}
}
|
go
|
func (api *API) UserLocator(href string) *UserLocator {
return &UserLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"UserLocator",
"(",
"href",
"string",
")",
"*",
"UserLocator",
"{",
"return",
"&",
"UserLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// UserLocator builds a locator from the given href.
|
[
"UserLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L14007-L14009
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
UserDataLocator
|
func (api *API) UserDataLocator(href string) *UserDataLocator {
return &UserDataLocator{Href(href), api}
}
|
go
|
func (api *API) UserDataLocator(href string) *UserDataLocator {
return &UserDataLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"UserDataLocator",
"(",
"href",
"string",
")",
"*",
"UserDataLocator",
"{",
"return",
"&",
"UserDataLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// UserDataLocator builds a locator from the given href.
|
[
"UserDataLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L14222-L14224
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
VolumeLocator
|
func (api *API) VolumeLocator(href string) *VolumeLocator {
return &VolumeLocator{Href(href), api}
}
|
go
|
func (api *API) VolumeLocator(href string) *VolumeLocator {
return &VolumeLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"VolumeLocator",
"(",
"href",
"string",
")",
"*",
"VolumeLocator",
"{",
"return",
"&",
"VolumeLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// VolumeLocator builds a locator from the given href.
|
[
"VolumeLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L14303-L14305
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
VolumeAttachmentLocator
|
func (api *API) VolumeAttachmentLocator(href string) *VolumeAttachmentLocator {
return &VolumeAttachmentLocator{Href(href), api}
}
|
go
|
func (api *API) VolumeAttachmentLocator(href string) *VolumeAttachmentLocator {
return &VolumeAttachmentLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"VolumeAttachmentLocator",
"(",
"href",
"string",
")",
"*",
"VolumeAttachmentLocator",
"{",
"return",
"&",
"VolumeAttachmentLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// VolumeAttachmentLocator builds a locator from the given href.
|
[
"VolumeAttachmentLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L14547-L14549
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
VolumeSnapshotLocator
|
func (api *API) VolumeSnapshotLocator(href string) *VolumeSnapshotLocator {
return &VolumeSnapshotLocator{Href(href), api}
}
|
go
|
func (api *API) VolumeSnapshotLocator(href string) *VolumeSnapshotLocator {
return &VolumeSnapshotLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"VolumeSnapshotLocator",
"(",
"href",
"string",
")",
"*",
"VolumeSnapshotLocator",
"{",
"return",
"&",
"VolumeSnapshotLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// VolumeSnapshotLocator builds a locator from the given href.
|
[
"VolumeSnapshotLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L14776-L14778
|
test
|
rightscale/rsc
|
cm15/codegen_client.go
|
VolumeTypeLocator
|
func (api *API) VolumeTypeLocator(href string) *VolumeTypeLocator {
return &VolumeTypeLocator{Href(href), api}
}
|
go
|
func (api *API) VolumeTypeLocator(href string) *VolumeTypeLocator {
return &VolumeTypeLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"VolumeTypeLocator",
"(",
"href",
"string",
")",
"*",
"VolumeTypeLocator",
"{",
"return",
"&",
"VolumeTypeLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// VolumeTypeLocator builds a locator from the given href.
|
[
"VolumeTypeLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/cm15/codegen_client.go#L15025-L15027
|
test
|
rightscale/rsc
|
rl10/commands.go
|
RegisterCommands
|
func RegisterCommands(registrar rsapi.APICommandRegistrar) {
commandValues = rsapi.ActionCommands{}
registrar.RegisterActionCommands(APIName, GenMetadata, commandValues)
}
|
go
|
func RegisterCommands(registrar rsapi.APICommandRegistrar) {
commandValues = rsapi.ActionCommands{}
registrar.RegisterActionCommands(APIName, GenMetadata, commandValues)
}
|
[
"func",
"RegisterCommands",
"(",
"registrar",
"rsapi",
".",
"APICommandRegistrar",
")",
"{",
"commandValues",
"=",
"rsapi",
".",
"ActionCommands",
"{",
"}",
"\n",
"registrar",
".",
"RegisterActionCommands",
"(",
"APIName",
",",
"GenMetadata",
",",
"commandValues",
")",
"\n",
"}"
] |
// RegisterCommands registers all the commands with the kinpin application.
|
[
"RegisterCommands",
"registers",
"all",
"the",
"commands",
"with",
"the",
"kinpin",
"application",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rl10/commands.go#L18-L21
|
test
|
rightscale/rsc
|
rl10/commands.go
|
ShowCommandHelp
|
func (a *API) ShowCommandHelp(cmd string) error {
return a.ShowHelp(cmd, "/rll", commandValues)
}
|
go
|
func (a *API) ShowCommandHelp(cmd string) error {
return a.ShowHelp(cmd, "/rll", commandValues)
}
|
[
"func",
"(",
"a",
"*",
"API",
")",
"ShowCommandHelp",
"(",
"cmd",
"string",
")",
"error",
"{",
"return",
"a",
".",
"ShowHelp",
"(",
"cmd",
",",
"\"/rll\"",
",",
"commandValues",
")",
"\n",
"}"
] |
// ShowCommandHelp displays the command help.
|
[
"ShowCommandHelp",
"displays",
"the",
"command",
"help",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rl10/commands.go#L37-L39
|
test
|
rightscale/rsc
|
rl10/commands.go
|
ShowAPIActions
|
func (a *API) ShowAPIActions(cmd string) error {
return a.ShowActions(cmd, "/rll", commandValues)
}
|
go
|
func (a *API) ShowAPIActions(cmd string) error {
return a.ShowActions(cmd, "/rll", commandValues)
}
|
[
"func",
"(",
"a",
"*",
"API",
")",
"ShowAPIActions",
"(",
"cmd",
"string",
")",
"error",
"{",
"return",
"a",
".",
"ShowActions",
"(",
"cmd",
",",
"\"/rll\"",
",",
"commandValues",
")",
"\n",
"}"
] |
// ShowAPIActions displays the command hrefs.
|
[
"ShowAPIActions",
"displays",
"the",
"command",
"hrefs",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rl10/commands.go#L42-L44
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
ShowHelp
|
func (a *API) ShowHelp(cmd, hrefPrefix string, values ActionCommands) error {
target, _, err := a.ParseCommandAndFlags(cmd, hrefPrefix, values)
if err != nil {
return err
}
_, action, href := target.Resource, target.Action, target.Href
if len(action.CommandFlags) == 0 {
fmt.Printf("usage: rsc [<FLAGS>] %s %s %s\n\n%s\n", strings.Split(cmd, " ")[0],
action.Name, href, action.Description)
return nil
}
flagHelp := make([]string, len(action.CommandFlags))
for i, f := range action.CommandFlags {
var attrs string
if f.Mandatory {
attrs = "required"
} else {
attrs = "optional"
}
if len(f.ValidValues) > 0 {
attrs += ", [" + strings.Join(f.ValidValues, "|") + "]"
}
if f.Regexp != nil {
attrs += ", /" + f.Regexp.String() + "/"
}
flagHelp[i] = fmt.Sprintf("%s=%s\n <%s> %s", f.Name, f.Type, attrs, f.Description)
}
fmt.Printf("usage: rsc [<FLAGS>] %s %s %s [<PARAMS>]\n\n%s\n\n", strings.Split(cmd, " ")[0],
action.Name, href, action.Description)
fmt.Printf("PARAMS:\n%s\n", strings.Join(flagHelp, "\n\n"))
return nil
}
|
go
|
func (a *API) ShowHelp(cmd, hrefPrefix string, values ActionCommands) error {
target, _, err := a.ParseCommandAndFlags(cmd, hrefPrefix, values)
if err != nil {
return err
}
_, action, href := target.Resource, target.Action, target.Href
if len(action.CommandFlags) == 0 {
fmt.Printf("usage: rsc [<FLAGS>] %s %s %s\n\n%s\n", strings.Split(cmd, " ")[0],
action.Name, href, action.Description)
return nil
}
flagHelp := make([]string, len(action.CommandFlags))
for i, f := range action.CommandFlags {
var attrs string
if f.Mandatory {
attrs = "required"
} else {
attrs = "optional"
}
if len(f.ValidValues) > 0 {
attrs += ", [" + strings.Join(f.ValidValues, "|") + "]"
}
if f.Regexp != nil {
attrs += ", /" + f.Regexp.String() + "/"
}
flagHelp[i] = fmt.Sprintf("%s=%s\n <%s> %s", f.Name, f.Type, attrs, f.Description)
}
fmt.Printf("usage: rsc [<FLAGS>] %s %s %s [<PARAMS>]\n\n%s\n\n", strings.Split(cmd, " ")[0],
action.Name, href, action.Description)
fmt.Printf("PARAMS:\n%s\n", strings.Join(flagHelp, "\n\n"))
return nil
}
|
[
"func",
"(",
"a",
"*",
"API",
")",
"ShowHelp",
"(",
"cmd",
",",
"hrefPrefix",
"string",
",",
"values",
"ActionCommands",
")",
"error",
"{",
"target",
",",
"_",
",",
"err",
":=",
"a",
".",
"ParseCommandAndFlags",
"(",
"cmd",
",",
"hrefPrefix",
",",
"values",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"_",
",",
"action",
",",
"href",
":=",
"target",
".",
"Resource",
",",
"target",
".",
"Action",
",",
"target",
".",
"Href",
"\n",
"if",
"len",
"(",
"action",
".",
"CommandFlags",
")",
"==",
"0",
"{",
"fmt",
".",
"Printf",
"(",
"\"usage: rsc [<FLAGS>] %s %s %s\\n\\n%s\\n\"",
",",
"\\n",
",",
"\\n",
",",
"\\n",
",",
"strings",
".",
"Split",
"(",
"cmd",
",",
"\" \"",
")",
"[",
"0",
"]",
")",
"\n",
"action",
".",
"Name",
"\n",
"}",
"\n",
"href",
"\n",
"action",
".",
"Description",
"\n",
"return",
"nil",
"\n",
"flagHelp",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"action",
".",
"CommandFlags",
")",
")",
"\n",
"for",
"i",
",",
"f",
":=",
"range",
"action",
".",
"CommandFlags",
"{",
"var",
"attrs",
"string",
"\n",
"if",
"f",
".",
"Mandatory",
"{",
"attrs",
"=",
"\"required\"",
"\n",
"}",
"else",
"{",
"attrs",
"=",
"\"optional\"",
"\n",
"}",
"\n",
"if",
"len",
"(",
"f",
".",
"ValidValues",
")",
">",
"0",
"{",
"attrs",
"+=",
"\", [\"",
"+",
"strings",
".",
"Join",
"(",
"f",
".",
"ValidValues",
",",
"\"|\"",
")",
"+",
"\"]\"",
"\n",
"}",
"\n",
"if",
"f",
".",
"Regexp",
"!=",
"nil",
"{",
"attrs",
"+=",
"\", /\"",
"+",
"f",
".",
"Regexp",
".",
"String",
"(",
")",
"+",
"\"/\"",
"\n",
"}",
"\n",
"flagHelp",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"%s=%s\\n <%s> %s\"",
",",
"\\n",
",",
"f",
".",
"Name",
",",
"f",
".",
"Type",
",",
"attrs",
")",
"\n",
"}",
"\n",
"}"
] |
// ShowHelp displays help for the given command and flags.
|
[
"ShowHelp",
"displays",
"help",
"for",
"the",
"given",
"command",
"and",
"flags",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L167-L198
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
ParseCommandAndFlags
|
func (a *API) ParseCommandAndFlags(cmd, hrefPrefix string, values ActionCommands) (*CommandTarget, []string, error) {
resource, vars, err := a.parseResource(cmd, hrefPrefix, values)
if err != nil {
return nil, nil, err
}
var action *metadata.Action
elems := strings.Split(cmd, " ")
actionName := elems[len(elems)-1]
for _, a := range resource.Actions {
if a.Name == actionName {
action = a
break
}
}
if action == nil {
supported := make([]string, len(resource.Actions))
for i, a := range resource.Actions {
supported[i] = a.Name
}
return nil, nil, fmt.Errorf("Unknown %s action '%s'. Supported actions are: %s",
resource.Name, actionName, strings.Join(supported, ", "))
}
path, err := action.URL(vars)
if err != nil {
return nil, nil, err
}
flags := values[cmd]
return &CommandTarget{resource, action, path, flags.Href}, flags.Params, nil
}
|
go
|
func (a *API) ParseCommandAndFlags(cmd, hrefPrefix string, values ActionCommands) (*CommandTarget, []string, error) {
resource, vars, err := a.parseResource(cmd, hrefPrefix, values)
if err != nil {
return nil, nil, err
}
var action *metadata.Action
elems := strings.Split(cmd, " ")
actionName := elems[len(elems)-1]
for _, a := range resource.Actions {
if a.Name == actionName {
action = a
break
}
}
if action == nil {
supported := make([]string, len(resource.Actions))
for i, a := range resource.Actions {
supported[i] = a.Name
}
return nil, nil, fmt.Errorf("Unknown %s action '%s'. Supported actions are: %s",
resource.Name, actionName, strings.Join(supported, ", "))
}
path, err := action.URL(vars)
if err != nil {
return nil, nil, err
}
flags := values[cmd]
return &CommandTarget{resource, action, path, flags.Href}, flags.Params, nil
}
|
[
"func",
"(",
"a",
"*",
"API",
")",
"ParseCommandAndFlags",
"(",
"cmd",
",",
"hrefPrefix",
"string",
",",
"values",
"ActionCommands",
")",
"(",
"*",
"CommandTarget",
",",
"[",
"]",
"string",
",",
"error",
")",
"{",
"resource",
",",
"vars",
",",
"err",
":=",
"a",
".",
"parseResource",
"(",
"cmd",
",",
"hrefPrefix",
",",
"values",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n",
"var",
"action",
"*",
"metadata",
".",
"Action",
"\n",
"elems",
":=",
"strings",
".",
"Split",
"(",
"cmd",
",",
"\" \"",
")",
"\n",
"actionName",
":=",
"elems",
"[",
"len",
"(",
"elems",
")",
"-",
"1",
"]",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"resource",
".",
"Actions",
"{",
"if",
"a",
".",
"Name",
"==",
"actionName",
"{",
"action",
"=",
"a",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"action",
"==",
"nil",
"{",
"supported",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"resource",
".",
"Actions",
")",
")",
"\n",
"for",
"i",
",",
"a",
":=",
"range",
"resource",
".",
"Actions",
"{",
"supported",
"[",
"i",
"]",
"=",
"a",
".",
"Name",
"\n",
"}",
"\n",
"return",
"nil",
",",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"Unknown %s action '%s'. Supported actions are: %s\"",
",",
"resource",
".",
"Name",
",",
"actionName",
",",
"strings",
".",
"Join",
"(",
"supported",
",",
"\", \"",
")",
")",
"\n",
"}",
"\n",
"path",
",",
"err",
":=",
"action",
".",
"URL",
"(",
"vars",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n",
"flags",
":=",
"values",
"[",
"cmd",
"]",
"\n",
"return",
"&",
"CommandTarget",
"{",
"resource",
",",
"action",
",",
"path",
",",
"flags",
".",
"Href",
"}",
",",
"flags",
".",
"Params",
",",
"nil",
"\n",
"}"
] |
// ParseCommandAndFlags parses a command flag and infers the resource, action, href and params.
|
[
"ParseCommandAndFlags",
"parses",
"a",
"command",
"flag",
"and",
"infers",
"the",
"resource",
"action",
"href",
"and",
"params",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L209-L239
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
validateFlagValue
|
func validateFlagValue(value string, param *metadata.ActionParam) error {
if param.Regexp != nil {
if !param.Regexp.MatchString(value) {
return fmt.Errorf("Invalid value '%s' for '%s', value must validate /%s/",
value, param.Name, param.Regexp.String())
}
}
if param.NonBlank && value == "" {
return fmt.Errorf("Invalid value for '%s', value must not be blank",
param.Name)
}
if len(param.ValidValues) > 0 && param.Name != "filter[]" { // filter[] is special: it has values just so --help can list them
found := false
for _, v := range param.ValidValues {
if v == value {
found = true
break
}
}
if !found {
return fmt.Errorf("Invalid value for '%s', value must be one of %s, value provided was '%s'",
param.Name, strings.Join(param.ValidValues, ", "), value)
}
}
return nil
}
|
go
|
func validateFlagValue(value string, param *metadata.ActionParam) error {
if param.Regexp != nil {
if !param.Regexp.MatchString(value) {
return fmt.Errorf("Invalid value '%s' for '%s', value must validate /%s/",
value, param.Name, param.Regexp.String())
}
}
if param.NonBlank && value == "" {
return fmt.Errorf("Invalid value for '%s', value must not be blank",
param.Name)
}
if len(param.ValidValues) > 0 && param.Name != "filter[]" { // filter[] is special: it has values just so --help can list them
found := false
for _, v := range param.ValidValues {
if v == value {
found = true
break
}
}
if !found {
return fmt.Errorf("Invalid value for '%s', value must be one of %s, value provided was '%s'",
param.Name, strings.Join(param.ValidValues, ", "), value)
}
}
return nil
}
|
[
"func",
"validateFlagValue",
"(",
"value",
"string",
",",
"param",
"*",
"metadata",
".",
"ActionParam",
")",
"error",
"{",
"if",
"param",
".",
"Regexp",
"!=",
"nil",
"{",
"if",
"!",
"param",
".",
"Regexp",
".",
"MatchString",
"(",
"value",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"Invalid value '%s' for '%s', value must validate /%s/\"",
",",
"value",
",",
"param",
".",
"Name",
",",
"param",
".",
"Regexp",
".",
"String",
"(",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"param",
".",
"NonBlank",
"&&",
"value",
"==",
"\"\"",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"Invalid value for '%s', value must not be blank\"",
",",
"param",
".",
"Name",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"param",
".",
"ValidValues",
")",
">",
"0",
"&&",
"param",
".",
"Name",
"!=",
"\"filter[]\"",
"{",
"found",
":=",
"false",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"param",
".",
"ValidValues",
"{",
"if",
"v",
"==",
"value",
"{",
"found",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"found",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"Invalid value for '%s', value must be one of %s, value provided was '%s'\"",
",",
"param",
".",
"Name",
",",
"strings",
".",
"Join",
"(",
"param",
".",
"ValidValues",
",",
"\", \"",
")",
",",
"value",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
// Validate flag value using validation criteria provided in metadata
|
[
"Validate",
"flag",
"value",
"using",
"validation",
"criteria",
"provided",
"in",
"metadata"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L425-L451
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
buildQuery
|
func buildQuery(values []APIParams) (APIParams, error) {
query := APIParams{}
for _, value := range values {
// Only one iteration below, flatten params only have one element each
for name, param := range value {
if q, ok := query[name]; ok {
if a, ok := q.([]interface{}); ok {
query[name] = append(a, param)
} else {
query[name] = []interface{}{q, param}
}
} else {
query[name] = param
}
}
}
return query, nil
}
|
go
|
func buildQuery(values []APIParams) (APIParams, error) {
query := APIParams{}
for _, value := range values {
// Only one iteration below, flatten params only have one element each
for name, param := range value {
if q, ok := query[name]; ok {
if a, ok := q.([]interface{}); ok {
query[name] = append(a, param)
} else {
query[name] = []interface{}{q, param}
}
} else {
query[name] = param
}
}
}
return query, nil
}
|
[
"func",
"buildQuery",
"(",
"values",
"[",
"]",
"APIParams",
")",
"(",
"APIParams",
",",
"error",
")",
"{",
"query",
":=",
"APIParams",
"{",
"}",
"\n",
"for",
"_",
",",
"value",
":=",
"range",
"values",
"{",
"for",
"name",
",",
"param",
":=",
"range",
"value",
"{",
"if",
"q",
",",
"ok",
":=",
"query",
"[",
"name",
"]",
";",
"ok",
"{",
"if",
"a",
",",
"ok",
":=",
"q",
".",
"(",
"[",
"]",
"interface",
"{",
"}",
")",
";",
"ok",
"{",
"query",
"[",
"name",
"]",
"=",
"append",
"(",
"a",
",",
"param",
")",
"\n",
"}",
"else",
"{",
"query",
"[",
"name",
"]",
"=",
"[",
"]",
"interface",
"{",
"}",
"{",
"q",
",",
"param",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"query",
"[",
"name",
"]",
"=",
"param",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"query",
",",
"nil",
"\n",
"}"
] |
// Reconstruct query from flatten values
|
[
"Reconstruct",
"query",
"from",
"flatten",
"values"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L454-L471
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
buildPayload
|
func buildPayload(values []APIParams) (APIParams, error) {
payload := APIParams{}
for _, value := range values {
// Only one iteration below, flatten params only have one element each
for name, param := range value {
if _, err := Normalize(payload, name, param); err != nil {
return nil, err
}
}
}
return payload, nil
}
|
go
|
func buildPayload(values []APIParams) (APIParams, error) {
payload := APIParams{}
for _, value := range values {
// Only one iteration below, flatten params only have one element each
for name, param := range value {
if _, err := Normalize(payload, name, param); err != nil {
return nil, err
}
}
}
return payload, nil
}
|
[
"func",
"buildPayload",
"(",
"values",
"[",
"]",
"APIParams",
")",
"(",
"APIParams",
",",
"error",
")",
"{",
"payload",
":=",
"APIParams",
"{",
"}",
"\n",
"for",
"_",
",",
"value",
":=",
"range",
"values",
"{",
"for",
"name",
",",
"param",
":=",
"range",
"value",
"{",
"if",
"_",
",",
"err",
":=",
"Normalize",
"(",
"payload",
",",
"name",
",",
"param",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"payload",
",",
"nil",
"\n",
"}"
] |
// Reconstruct payload map from flatten values
|
[
"Reconstruct",
"payload",
"map",
"from",
"flatten",
"values"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L474-L485
|
test
|
rightscale/rsc
|
rsapi/commands.go
|
shortenPattern
|
func shortenPattern(res *metadata.Resource, pattern, suffix string) (string, bool) {
if strings.HasSuffix(pattern, suffix) {
pat := strings.TrimSuffix(pattern, suffix)
for _, action := range res.Actions {
for _, pattern2 := range action.PathPatterns {
vars := pattern2.Variables
ivars := make([]interface{}, len(vars))
for i, v := range vars {
ivars[i] = interface{}(":" + v)
}
subPattern := pattern2.Pattern
pat2 := fmt.Sprintf(subPattern, ivars...)
if pat == pat2 {
return pat, true
}
}
}
}
return pattern, false
}
|
go
|
func shortenPattern(res *metadata.Resource, pattern, suffix string) (string, bool) {
if strings.HasSuffix(pattern, suffix) {
pat := strings.TrimSuffix(pattern, suffix)
for _, action := range res.Actions {
for _, pattern2 := range action.PathPatterns {
vars := pattern2.Variables
ivars := make([]interface{}, len(vars))
for i, v := range vars {
ivars[i] = interface{}(":" + v)
}
subPattern := pattern2.Pattern
pat2 := fmt.Sprintf(subPattern, ivars...)
if pat == pat2 {
return pat, true
}
}
}
}
return pattern, false
}
|
[
"func",
"shortenPattern",
"(",
"res",
"*",
"metadata",
".",
"Resource",
",",
"pattern",
",",
"suffix",
"string",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"strings",
".",
"HasSuffix",
"(",
"pattern",
",",
"suffix",
")",
"{",
"pat",
":=",
"strings",
".",
"TrimSuffix",
"(",
"pattern",
",",
"suffix",
")",
"\n",
"for",
"_",
",",
"action",
":=",
"range",
"res",
".",
"Actions",
"{",
"for",
"_",
",",
"pattern2",
":=",
"range",
"action",
".",
"PathPatterns",
"{",
"vars",
":=",
"pattern2",
".",
"Variables",
"\n",
"ivars",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"len",
"(",
"vars",
")",
")",
"\n",
"for",
"i",
",",
"v",
":=",
"range",
"vars",
"{",
"ivars",
"[",
"i",
"]",
"=",
"interface",
"{",
"}",
"(",
"\":\"",
"+",
"v",
")",
"\n",
"}",
"\n",
"subPattern",
":=",
"pattern2",
".",
"Pattern",
"\n",
"pat2",
":=",
"fmt",
".",
"Sprintf",
"(",
"subPattern",
",",
"ivars",
"...",
")",
"\n",
"if",
"pat",
"==",
"pat2",
"{",
"return",
"pat",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"pattern",
",",
"false",
"\n",
"}"
] |
// Attempt to shorten action pattern for display by looking at other action hrefs
// and picking one that doesn't have the suffix if there is one.
|
[
"Attempt",
"to",
"shorten",
"action",
"pattern",
"for",
"display",
"by",
"looking",
"at",
"other",
"action",
"hrefs",
"and",
"picking",
"one",
"that",
"doesn",
"t",
"have",
"the",
"suffix",
"if",
"there",
"is",
"one",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/rsapi/commands.go#L572-L591
|
test
|
rightscale/rsc
|
gen/goav2gen/helpers.go
|
cleanDescription
|
func cleanDescription(doc string) string {
docBits := strings.Split(doc, "Required security scope")
doc = docBits[0]
lines := strings.Split(doc, "\n")
fullLines := make([]string, len(lines))
i := 0
for _, line := range lines {
if len(line) > 0 && !blankRegexp.MatchString(line) {
fullLines[i] = line
i++
}
}
return strings.Join(fullLines[:i], "\n")
}
|
go
|
func cleanDescription(doc string) string {
docBits := strings.Split(doc, "Required security scope")
doc = docBits[0]
lines := strings.Split(doc, "\n")
fullLines := make([]string, len(lines))
i := 0
for _, line := range lines {
if len(line) > 0 && !blankRegexp.MatchString(line) {
fullLines[i] = line
i++
}
}
return strings.Join(fullLines[:i], "\n")
}
|
[
"func",
"cleanDescription",
"(",
"doc",
"string",
")",
"string",
"{",
"docBits",
":=",
"strings",
".",
"Split",
"(",
"doc",
",",
"\"Required security scope\"",
")",
"\n",
"doc",
"=",
"docBits",
"[",
"0",
"]",
"\n",
"lines",
":=",
"strings",
".",
"Split",
"(",
"doc",
",",
"\"\\n\"",
")",
"\n",
"\\n",
"\n",
"fullLines",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"lines",
")",
")",
"\n",
"i",
":=",
"0",
"\n",
"for",
"_",
",",
"line",
":=",
"range",
"lines",
"{",
"if",
"len",
"(",
"line",
")",
">",
"0",
"&&",
"!",
"blankRegexp",
".",
"MatchString",
"(",
"line",
")",
"{",
"fullLines",
"[",
"i",
"]",
"=",
"line",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
// cleans up description, removing blank lines and extraneous info
|
[
"cleans",
"up",
"description",
"removing",
"blank",
"lines",
"and",
"extraneous",
"info"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/gen/goav2gen/helpers.go#L64-L78
|
test
|
rightscale/rsc
|
gen/goav2gen/main.go
|
fileExists
|
func fileExists(file string) bool {
_, err := os.Stat(file)
return err == nil
}
|
go
|
func fileExists(file string) bool {
_, err := os.Stat(file)
return err == nil
}
|
[
"func",
"fileExists",
"(",
"file",
"string",
")",
"bool",
"{",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"file",
")",
"\n",
"return",
"err",
"==",
"nil",
"\n",
"}"
] |
// fileExists reads content from existing file and returns a byte array
|
[
"fileExists",
"reads",
"content",
"from",
"existing",
"file",
"and",
"returns",
"a",
"byte",
"array"
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/gen/goav2gen/main.go#L131-L134
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
AnalysisSnapshotLocator
|
func (api *API) AnalysisSnapshotLocator(href string) *AnalysisSnapshotLocator {
return &AnalysisSnapshotLocator{Href(href), api}
}
|
go
|
func (api *API) AnalysisSnapshotLocator(href string) *AnalysisSnapshotLocator {
return &AnalysisSnapshotLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"AnalysisSnapshotLocator",
"(",
"href",
"string",
")",
"*",
"AnalysisSnapshotLocator",
"{",
"return",
"&",
"AnalysisSnapshotLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// AnalysisSnapshotLocator builds a locator from the given href.
|
[
"AnalysisSnapshotLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L221-L223
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
BudgetAlertLocator
|
func (api *API) BudgetAlertLocator(href string) *BudgetAlertLocator {
return &BudgetAlertLocator{Href(href), api}
}
|
go
|
func (api *API) BudgetAlertLocator(href string) *BudgetAlertLocator {
return &BudgetAlertLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"BudgetAlertLocator",
"(",
"href",
"string",
")",
"*",
"BudgetAlertLocator",
"{",
"return",
"&",
"BudgetAlertLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// BudgetAlertLocator builds a locator from the given href.
|
[
"BudgetAlertLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L355-L357
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
CloudBillLocator
|
func (api *API) CloudBillLocator(href string) *CloudBillLocator {
return &CloudBillLocator{Href(href), api}
}
|
go
|
func (api *API) CloudBillLocator(href string) *CloudBillLocator {
return &CloudBillLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CloudBillLocator",
"(",
"href",
"string",
")",
"*",
"CloudBillLocator",
"{",
"return",
"&",
"CloudBillLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CloudBillLocator builds a locator from the given href.
|
[
"CloudBillLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L628-L630
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
CloudBillMetricLocator
|
func (api *API) CloudBillMetricLocator(href string) *CloudBillMetricLocator {
return &CloudBillMetricLocator{Href(href), api}
}
|
go
|
func (api *API) CloudBillMetricLocator(href string) *CloudBillMetricLocator {
return &CloudBillMetricLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CloudBillMetricLocator",
"(",
"href",
"string",
")",
"*",
"CloudBillMetricLocator",
"{",
"return",
"&",
"CloudBillMetricLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CloudBillMetricLocator builds a locator from the given href.
|
[
"CloudBillMetricLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L702-L704
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
CurrentUserLocator
|
func (api *API) CurrentUserLocator(href string) *CurrentUserLocator {
return &CurrentUserLocator{Href(href), api}
}
|
go
|
func (api *API) CurrentUserLocator(href string) *CurrentUserLocator {
return &CurrentUserLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"CurrentUserLocator",
"(",
"href",
"string",
")",
"*",
"CurrentUserLocator",
"{",
"return",
"&",
"CurrentUserLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// CurrentUserLocator builds a locator from the given href.
|
[
"CurrentUserLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L778-L780
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
InstanceCombinationLocator
|
func (api *API) InstanceCombinationLocator(href string) *InstanceCombinationLocator {
return &InstanceCombinationLocator{Href(href), api}
}
|
go
|
func (api *API) InstanceCombinationLocator(href string) *InstanceCombinationLocator {
return &InstanceCombinationLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InstanceCombinationLocator",
"(",
"href",
"string",
")",
"*",
"InstanceCombinationLocator",
"{",
"return",
"&",
"InstanceCombinationLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InstanceCombinationLocator builds a locator from the given href.
|
[
"InstanceCombinationLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L1373-L1375
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
InstanceMetricLocator
|
func (api *API) InstanceMetricLocator(href string) *InstanceMetricLocator {
return &InstanceMetricLocator{Href(href), api}
}
|
go
|
func (api *API) InstanceMetricLocator(href string) *InstanceMetricLocator {
return &InstanceMetricLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InstanceMetricLocator",
"(",
"href",
"string",
")",
"*",
"InstanceMetricLocator",
"{",
"return",
"&",
"InstanceMetricLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InstanceMetricLocator builds a locator from the given href.
|
[
"InstanceMetricLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L1663-L1665
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
InstanceUsagePeriodLocator
|
func (api *API) InstanceUsagePeriodLocator(href string) *InstanceUsagePeriodLocator {
return &InstanceUsagePeriodLocator{Href(href), api}
}
|
go
|
func (api *API) InstanceUsagePeriodLocator(href string) *InstanceUsagePeriodLocator {
return &InstanceUsagePeriodLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"InstanceUsagePeriodLocator",
"(",
"href",
"string",
")",
"*",
"InstanceUsagePeriodLocator",
"{",
"return",
"&",
"InstanceUsagePeriodLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// InstanceUsagePeriodLocator builds a locator from the given href.
|
[
"InstanceUsagePeriodLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L2012-L2014
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
PatternLocator
|
func (api *API) PatternLocator(href string) *PatternLocator {
return &PatternLocator{Href(href), api}
}
|
go
|
func (api *API) PatternLocator(href string) *PatternLocator {
return &PatternLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"PatternLocator",
"(",
"href",
"string",
")",
"*",
"PatternLocator",
"{",
"return",
"&",
"PatternLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// PatternLocator builds a locator from the given href.
|
[
"PatternLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L2081-L2083
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
ReservedInstanceLocator
|
func (api *API) ReservedInstanceLocator(href string) *ReservedInstanceLocator {
return &ReservedInstanceLocator{Href(href), api}
}
|
go
|
func (api *API) ReservedInstanceLocator(href string) *ReservedInstanceLocator {
return &ReservedInstanceLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ReservedInstanceLocator",
"(",
"href",
"string",
")",
"*",
"ReservedInstanceLocator",
"{",
"return",
"&",
"ReservedInstanceLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ReservedInstanceLocator builds a locator from the given href.
|
[
"ReservedInstanceLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L2400-L2402
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
ReservedInstancePurchaseLocator
|
func (api *API) ReservedInstancePurchaseLocator(href string) *ReservedInstancePurchaseLocator {
return &ReservedInstancePurchaseLocator{Href(href), api}
}
|
go
|
func (api *API) ReservedInstancePurchaseLocator(href string) *ReservedInstancePurchaseLocator {
return &ReservedInstancePurchaseLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ReservedInstancePurchaseLocator",
"(",
"href",
"string",
")",
"*",
"ReservedInstancePurchaseLocator",
"{",
"return",
"&",
"ReservedInstancePurchaseLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ReservedInstancePurchaseLocator builds a locator from the given href.
|
[
"ReservedInstancePurchaseLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L2727-L2729
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
ScenarioLocator
|
func (api *API) ScenarioLocator(href string) *ScenarioLocator {
return &ScenarioLocator{Href(href), api}
}
|
go
|
func (api *API) ScenarioLocator(href string) *ScenarioLocator {
return &ScenarioLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ScenarioLocator",
"(",
"href",
"string",
")",
"*",
"ScenarioLocator",
"{",
"return",
"&",
"ScenarioLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ScenarioLocator builds a locator from the given href.
|
[
"ScenarioLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L2978-L2980
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
ScheduledReportLocator
|
func (api *API) ScheduledReportLocator(href string) *ScheduledReportLocator {
return &ScheduledReportLocator{Href(href), api}
}
|
go
|
func (api *API) ScheduledReportLocator(href string) *ScheduledReportLocator {
return &ScheduledReportLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"ScheduledReportLocator",
"(",
"href",
"string",
")",
"*",
"ScheduledReportLocator",
"{",
"return",
"&",
"ScheduledReportLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// ScheduledReportLocator builds a locator from the given href.
|
[
"ScheduledReportLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L3285-L3287
|
test
|
rightscale/rsc
|
ca/cac/codegen_client.go
|
TempInstancePriceLocator
|
func (api *API) TempInstancePriceLocator(href string) *TempInstancePriceLocator {
return &TempInstancePriceLocator{Href(href), api}
}
|
go
|
func (api *API) TempInstancePriceLocator(href string) *TempInstancePriceLocator {
return &TempInstancePriceLocator{Href(href), api}
}
|
[
"func",
"(",
"api",
"*",
"API",
")",
"TempInstancePriceLocator",
"(",
"href",
"string",
")",
"*",
"TempInstancePriceLocator",
"{",
"return",
"&",
"TempInstancePriceLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
// TempInstancePriceLocator builds a locator from the given href.
|
[
"TempInstancePriceLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] |
96079a1ee7238dae9cbb7efa77dd94a479d217bd
|
https://github.com/rightscale/rsc/blob/96079a1ee7238dae9cbb7efa77dd94a479d217bd/ca/cac/codegen_client.go#L3585-L3587
|
test
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.