repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
cloudfoundry/cli | actor/v2action/application.go | CreateApplication | func (actor Actor) CreateApplication(application Application) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.CreateApplication(ccv2.Application(application))
return Application(app), Warnings(warnings), err
} | go | func (actor Actor) CreateApplication(application Application) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.CreateApplication(ccv2.Application(application))
return Application(app), Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"CreateApplication",
"(",
"application",
"Application",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"CreateApplicati... | // CreateApplication creates an application. | [
"CreateApplication",
"creates",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L115-L118 | train |
cloudfoundry/cli | actor/v2action/application.go | GetApplication | func (actor Actor) GetApplication(guid string) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.GetApplication(guid)
if _, ok := err.(ccerror.ResourceNotFoundError); ok {
return Application{}, Warnings(warnings), actionerror.ApplicationNotFoundError{GUID: guid}
}
return Applica... | go | func (actor Actor) GetApplication(guid string) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.GetApplication(guid)
if _, ok := err.(ccerror.ResourceNotFoundError); ok {
return Application{}, Warnings(warnings), actionerror.ApplicationNotFoundError{GUID: guid}
}
return Applica... | [
"func",
"(",
"actor",
"Actor",
")",
"GetApplication",
"(",
"guid",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetApplication",
"(",
"gui... | // GetApplication returns the application. | [
"GetApplication",
"returns",
"the",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L121-L129 | train |
cloudfoundry/cli | actor/v2action/application.go | GetApplicationByNameAndSpace | func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.GetApplications(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{name},
},
ccv2.Filter{
Ty... | go | func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error) {
app, warnings, err := actor.CloudControllerClient.GetApplications(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{name},
},
ccv2.Filter{
Ty... | [
"func",
"(",
"actor",
"Actor",
")",
"GetApplicationByNameAndSpace",
"(",
"name",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerC... | // GetApplicationByNameAndSpace returns an application with matching name in
// the space. | [
"GetApplicationByNameAndSpace",
"returns",
"an",
"application",
"with",
"matching",
"name",
"in",
"the",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L133-L158 | train |
cloudfoundry/cli | actor/v2action/application.go | GetRouteApplications | func (actor Actor) GetRouteApplications(routeGUID string) ([]Application, Warnings, error) {
apps, warnings, err := actor.CloudControllerClient.GetRouteApplications(routeGUID)
if err != nil {
return nil, Warnings(warnings), err
}
allApplications := []Application{}
for _, app := range apps {
allApplications = a... | go | func (actor Actor) GetRouteApplications(routeGUID string) ([]Application, Warnings, error) {
apps, warnings, err := actor.CloudControllerClient.GetRouteApplications(routeGUID)
if err != nil {
return nil, Warnings(warnings), err
}
allApplications := []Application{}
for _, app := range apps {
allApplications = a... | [
"func",
"(",
"actor",
"Actor",
")",
"GetRouteApplications",
"(",
"routeGUID",
"string",
")",
"(",
"[",
"]",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"apps",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetR... | // GetRouteApplications returns a list of apps associated with the provided
// Route GUID. | [
"GetRouteApplications",
"returns",
"a",
"list",
"of",
"apps",
"associated",
"with",
"the",
"provided",
"Route",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L184-L194 | train |
cloudfoundry/cli | actor/v2action/application.go | SetApplicationHealthCheckTypeByNameAndSpace | func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType constant.ApplicationHealthCheckType, httpEndpoint string) (Application, Warnings, error) {
if httpEndpoint != "/" && healthCheckType != constant.ApplicationHealthCheckHTTP {
return Application{}, nil, action... | go | func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType constant.ApplicationHealthCheckType, httpEndpoint string) (Application, Warnings, error) {
if httpEndpoint != "/" && healthCheckType != constant.ApplicationHealthCheckHTTP {
return Application{}, nil, action... | [
"func",
"(",
"actor",
"Actor",
")",
"SetApplicationHealthCheckTypeByNameAndSpace",
"(",
"name",
"string",
",",
"spaceGUID",
"string",
",",
"healthCheckType",
"constant",
".",
"ApplicationHealthCheckType",
",",
"httpEndpoint",
"string",
")",
"(",
"Application",
",",
"W... | // SetApplicationHealthCheckTypeByNameAndSpace updates an application's health
// check type if it is not already the desired type. | [
"SetApplicationHealthCheckTypeByNameAndSpace",
"updates",
"an",
"application",
"s",
"health",
"check",
"type",
"if",
"it",
"is",
"not",
"already",
"the",
"desired",
"type",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L198-L230 | train |
cloudfoundry/cli | actor/v2action/application.go | StartApplication | func (actor Actor) StartApplication(app Application, client NOAAClient) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error) {
messages, logErrs := actor.GetStreamingLogs(app.GUID, client)
appState := make(chan ApplicationStateChange)
allWarnings := make(chan string)
errs ... | go | func (actor Actor) StartApplication(app Application, client NOAAClient) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error) {
messages, logErrs := actor.GetStreamingLogs(app.GUID, client)
appState := make(chan ApplicationStateChange)
allWarnings := make(chan string)
errs ... | [
"func",
"(",
"actor",
"Actor",
")",
"StartApplication",
"(",
"app",
"Application",
",",
"client",
"NOAAClient",
")",
"(",
"<-",
"chan",
"*",
"LogMessage",
",",
"<-",
"chan",
"error",
",",
"<-",
"chan",
"ApplicationStateChange",
",",
"<-",
"chan",
"string",
... | // StartApplication restarts a given application. If already stopped, no stop
// call will be sent. | [
"StartApplication",
"restarts",
"a",
"given",
"application",
".",
"If",
"already",
"stopped",
"no",
"stop",
"call",
"will",
"be",
"sent",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L234-L267 | train |
cloudfoundry/cli | actor/v2action/application.go | RestageApplication | func (actor Actor) RestageApplication(app Application, client NOAAClient) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error) {
messages, logErrs := actor.GetStreamingLogs(app.GUID, client)
appState := make(chan ApplicationStateChange)
allWarnings := make(chan string)
err... | go | func (actor Actor) RestageApplication(app Application, client NOAAClient) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error) {
messages, logErrs := actor.GetStreamingLogs(app.GUID, client)
appState := make(chan ApplicationStateChange)
allWarnings := make(chan string)
err... | [
"func",
"(",
"actor",
"Actor",
")",
"RestageApplication",
"(",
"app",
"Application",
",",
"client",
"NOAAClient",
")",
"(",
"<-",
"chan",
"*",
"LogMessage",
",",
"<-",
"chan",
"error",
",",
"<-",
"chan",
"ApplicationStateChange",
",",
"<-",
"chan",
"string",... | // RestageApplication restarts a given application. If already stopped, no stop
// call will be sent. | [
"RestageApplication",
"restarts",
"a",
"given",
"application",
".",
"If",
"already",
"stopped",
"no",
"stop",
"call",
"will",
"be",
"sent",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L323-L352 | train |
cloudfoundry/cli | api/router/router_group.go | GetRouterGroupByName | func (client *Client) GetRouterGroupByName(name string) (RouterGroup, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouterGroups,
Query: url.Values{"name": []string{name}},
})
if err != nil {
return RouterGroup{}, err
}
var routerGroups []RouterGroup
var res... | go | func (client *Client) GetRouterGroupByName(name string) (RouterGroup, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouterGroups,
Query: url.Values{"name": []string{name}},
})
if err != nil {
return RouterGroup{}, err
}
var routerGroups []RouterGroup
var res... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetRouterGroupByName",
"(",
"name",
"string",
")",
"(",
"RouterGroup",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"internal... | // GetRouterGroupByName returns a list of RouterGroups. | [
"GetRouterGroupByName",
"returns",
"a",
"list",
"of",
"RouterGroups",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/router/router_group.go#L19-L46 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/build.go | MarshalJSON | func (b Build) MarshalJSON() ([]byte, error) {
var ccBuild struct {
Package struct {
GUID string `json:"guid"`
} `json:"package"`
}
ccBuild.Package.GUID = b.PackageGUID
return json.Marshal(ccBuild)
} | go | func (b Build) MarshalJSON() ([]byte, error) {
var ccBuild struct {
Package struct {
GUID string `json:"guid"`
} `json:"package"`
}
ccBuild.Package.GUID = b.PackageGUID
return json.Marshal(ccBuild)
} | [
"func",
"(",
"b",
"Build",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"var",
"ccBuild",
"struct",
"{",
"Package",
"struct",
"{",
"GUID",
"string",
"`json:\"guid\"`",
"\n",
"}",
"`json:\"package\"`",
"\n",
"}",
"\n\n",
... | // MarshalJSON converts a Build into a Cloud Controller Application. | [
"MarshalJSON",
"converts",
"a",
"Build",
"into",
"a",
"Cloud",
"Controller",
"Application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/build.go#L31-L41 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/build.go | UnmarshalJSON | func (b *Build) UnmarshalJSON(data []byte) error {
var ccBuild struct {
CreatedAt string `json:"created_at,omitempty"`
GUID string `json:"guid,omitempty"`
Error string `json:"error"`
Package struct {
GUID string `json:"guid"`
} `json:"package"`
State constant.BuildState `json:"state,omitemp... | go | func (b *Build) UnmarshalJSON(data []byte) error {
var ccBuild struct {
CreatedAt string `json:"created_at,omitempty"`
GUID string `json:"guid,omitempty"`
Error string `json:"error"`
Package struct {
GUID string `json:"guid"`
} `json:"package"`
State constant.BuildState `json:"state,omitemp... | [
"func",
"(",
"b",
"*",
"Build",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccBuild",
"struct",
"{",
"CreatedAt",
"string",
"`json:\"created_at,omitempty\"`",
"\n",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"Error",... | // UnmarshalJSON helps unmarshal a Cloud Controller Build response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Build",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/build.go#L44-L71 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/build.go | CreateBuild | func (client *Client) CreateBuild(build Build) (Build, Warnings, error) {
bodyBytes, err := json.Marshal(build)
if err != nil {
return Build{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildRequest,
Body: bytes.NewReader(bodyBytes),
})
if err != nil ... | go | func (client *Client) CreateBuild(build Build) (Build, Warnings, error) {
bodyBytes, err := json.Marshal(build)
if err != nil {
return Build{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildRequest,
Body: bytes.NewReader(bodyBytes),
})
if err != nil ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateBuild",
"(",
"build",
"Build",
")",
"(",
"Build",
",",
"Warnings",
",",
"error",
")",
"{",
"bodyBytes",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"build",
")",
"\n",
"if",
"err",
"!=",
"nil",
"... | // CreateBuild creates the given build, requires Package GUID to be set on the
// build. | [
"CreateBuild",
"creates",
"the",
"given",
"build",
"requires",
"Package",
"GUID",
"to",
"be",
"set",
"on",
"the",
"build",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/build.go#L75-L96 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/build.go | GetBuild | func (client *Client) GetBuild(guid string) (Build, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildRequest,
URIParams: internal.Params{"build_guid": guid},
})
if err != nil {
return Build{}, nil, err
}
var responseBuild Build
response := cloudcontro... | go | func (client *Client) GetBuild(guid string) (Build, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildRequest,
URIParams: internal.Params{"build_guid": guid},
})
if err != nil {
return Build{}, nil, err
}
var responseBuild Build
response := cloudcontro... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetBuild",
"(",
"guid",
"string",
")",
"(",
"Build",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"inter... | // GetBuild gets the build with the given GUID. | [
"GetBuild",
"gets",
"the",
"build",
"with",
"the",
"given",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/build.go#L99-L115 | train |
cloudfoundry/cli | actor/v3action/environment_variable.go | GetEnvironmentVariablesByApplicationNameAndSpace | func (actor *Actor) GetEnvironmentVariablesByApplicationNameAndSpace(appName string, spaceGUID string) (EnvironmentVariableGroups, Warnings, error) {
app, warnings, appErr := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if appErr != nil {
return EnvironmentVariableGroups{}, warnings, appErr
}
ccEnvGrou... | go | func (actor *Actor) GetEnvironmentVariablesByApplicationNameAndSpace(appName string, spaceGUID string) (EnvironmentVariableGroups, Warnings, error) {
app, warnings, appErr := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if appErr != nil {
return EnvironmentVariableGroups{}, warnings, appErr
}
ccEnvGrou... | [
"func",
"(",
"actor",
"*",
"Actor",
")",
"GetEnvironmentVariablesByApplicationNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"EnvironmentVariableGroups",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",
"appErr"... | // GetEnvironmentVariablesByApplicationNameAndSpace returns the environment
// variables for an application. | [
"GetEnvironmentVariablesByApplicationNameAndSpace",
"returns",
"the",
"environment",
"variables",
"for",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/environment_variable.go#L20-L29 | train |
cloudfoundry/cli | actor/v3action/environment_variable.go | SetEnvironmentVariableByApplicationNameAndSpace | func (actor *Actor) SetEnvironmentVariableByApplicationNameAndSpace(appName string, spaceGUID string, envPair EnvironmentVariablePair) (Warnings, error) {
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return warnings, err
}
_, v3Warnings, apiErr := actor.CloudContro... | go | func (actor *Actor) SetEnvironmentVariableByApplicationNameAndSpace(appName string, spaceGUID string, envPair EnvironmentVariablePair) (Warnings, error) {
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return warnings, err
}
_, v3Warnings, apiErr := actor.CloudContro... | [
"func",
"(",
"actor",
"*",
"Actor",
")",
"SetEnvironmentVariableByApplicationNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
",",
"envPair",
"EnvironmentVariablePair",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",
... | // SetEnvironmentVariableByApplicationNameAndSpace adds an
// EnvironmentVariablePair to an application. It must be restarted for changes
// to take effect. | [
"SetEnvironmentVariableByApplicationNameAndSpace",
"adds",
"an",
"EnvironmentVariablePair",
"to",
"an",
"application",
".",
"It",
"must",
"be",
"restarted",
"for",
"changes",
"to",
"take",
"effect",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/environment_variable.go#L34-L47 | train |
cloudfoundry/cli | actor/v3action/environment_variable.go | UnsetEnvironmentVariableByApplicationNameAndSpace | func (actor *Actor) UnsetEnvironmentVariableByApplicationNameAndSpace(appName string, spaceGUID string, environmentVariableName string) (Warnings, error) {
app, warnings, appErr := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if appErr != nil {
return warnings, appErr
}
envGroups, getWarnings, getErr :=... | go | func (actor *Actor) UnsetEnvironmentVariableByApplicationNameAndSpace(appName string, spaceGUID string, environmentVariableName string) (Warnings, error) {
app, warnings, appErr := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if appErr != nil {
return warnings, appErr
}
envGroups, getWarnings, getErr :=... | [
"func",
"(",
"actor",
"*",
"Actor",
")",
"UnsetEnvironmentVariableByApplicationNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
",",
"environmentVariableName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"warnings",
",",... | // UnsetEnvironmentVariableByApplicationNameAndSpace removes an enviornment
// variable from an application. It must be restarted for changes to take
// effect. | [
"UnsetEnvironmentVariableByApplicationNameAndSpace",
"removes",
"an",
"enviornment",
"variable",
"from",
"an",
"application",
".",
"It",
"must",
"be",
"restarted",
"for",
"changes",
"to",
"take",
"effect",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/environment_variable.go#L52-L74 | train |
cloudfoundry/cli | util/ui/prompt.go | DisplayBoolPrompt | func (ui *UI) DisplayBoolPrompt(defaultResponse bool, template string, templateValues ...map[string]interface{}) (bool, error) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
response := defaultResponse
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
intera... | go | func (ui *UI) DisplayBoolPrompt(defaultResponse bool, template string, templateValues ...map[string]interface{}) (bool, error) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
response := defaultResponse
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
intera... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayBoolPrompt",
"(",
"defaultResponse",
"bool",
",",
"template",
"string",
",",
"templateValues",
"...",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"bool",
",",
"error",
")",
"{",
"ui",
".",
"ter... | // DisplayBoolPrompt outputs the prompt and waits for user input. It only
// allows for a boolean response. A default boolean response can be set with
// defaultResponse. | [
"DisplayBoolPrompt",
"outputs",
"the",
"prompt",
"and",
"waits",
"for",
"user",
"input",
".",
"It",
"only",
"allows",
"for",
"a",
"boolean",
"response",
".",
"A",
"default",
"boolean",
"response",
"can",
"be",
"set",
"with",
"defaultResponse",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/prompt.go#L36-L49 | train |
cloudfoundry/cli | util/ui/prompt.go | DisplayPasswordPrompt | func (ui *UI) DisplayPasswordPrompt(template string, templateValues ...map[string]interface{}) (string, error) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var password interact.Password
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
interactivePrompt.S... | go | func (ui *UI) DisplayPasswordPrompt(template string, templateValues ...map[string]interface{}) (string, error) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var password interact.Password
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
interactivePrompt.S... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayPasswordPrompt",
"(",
"template",
"string",
",",
"templateValues",
"...",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"string",
",",
"error",
")",
"{",
"ui",
".",
"terminalLock",
".",
"Lock",
"... | // DisplayPasswordPrompt outputs the prompt and waits for user input. Hides
// user's response from the screen. | [
"DisplayPasswordPrompt",
"outputs",
"the",
"prompt",
"and",
"waits",
"for",
"user",
"input",
".",
"Hides",
"user",
"s",
"response",
"from",
"the",
"screen",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/prompt.go#L66-L79 | train |
cloudfoundry/cli | util/ui/prompt.go | DisplayTextMenu | func (ui *UI) DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error) {
for i, c := range choices {
t := fmt.Sprintf("%d. %s", i+1, c)
ui.DisplayText(t)
}
translatedPrompt := ui.TranslateText(promptTemplate, templateValues...)
interactivePrompt := ui.... | go | func (ui *UI) DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error) {
for i, c := range choices {
t := fmt.Sprintf("%d. %s", i+1, c)
ui.DisplayText(t)
}
translatedPrompt := ui.TranslateText(promptTemplate, templateValues...)
interactivePrompt := ui.... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayTextMenu",
"(",
"choices",
"[",
"]",
"string",
",",
"promptTemplate",
"string",
",",
"templateValues",
"...",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"string",
",",
"error",
")",
"{",
"for"... | // DisplayTextMenu lets the user choose from a list of options, either by name
// or by number. | [
"DisplayTextMenu",
"lets",
"the",
"user",
"choose",
"from",
"a",
"list",
"of",
"options",
"either",
"by",
"name",
"or",
"by",
"number",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/prompt.go#L83-L123 | train |
cloudfoundry/cli | util/ui/prompt.go | DisplayTextPrompt | func (ui *UI) DisplayTextPrompt(template string, templateValues ...map[string]interface{}) (string, error) {
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
var value string
interactivePrompt.SetIn(ui.In)
interactivePrompt.SetOut(ui.OutForInteration)
err := interact... | go | func (ui *UI) DisplayTextPrompt(template string, templateValues ...map[string]interface{}) (string, error) {
interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...))
var value string
interactivePrompt.SetIn(ui.In)
interactivePrompt.SetOut(ui.OutForInteration)
err := interact... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayTextPrompt",
"(",
"template",
"string",
",",
"templateValues",
"...",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"string",
",",
"error",
")",
"{",
"interactivePrompt",
":=",
"ui",
".",
"Interact... | // DisplayTextPrompt outputs the prompt and waits for user input. | [
"DisplayTextPrompt",
"outputs",
"the",
"prompt",
"and",
"waits",
"for",
"user",
"input",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/prompt.go#L126-L136 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | UnmarshalJSON | func (route *Route) UnmarshalJSON(data []byte) error {
var ccRoute struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Host string `json:"host"`
Path string `json:"path"`
Port types.NullInt `json:"port"`
DomainGUID string `json:"domain_guid"`
... | go | func (route *Route) UnmarshalJSON(data []byte) error {
var ccRoute struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Host string `json:"host"`
Path string `json:"path"`
Port types.NullInt `json:"port"`
DomainGUID string `json:"domain_guid"`
... | [
"func",
"(",
"route",
"*",
"Route",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccRoute",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Host",
"string",
"`... | // UnmarshalJSON helps unmarshal a Cloud Controller Route response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Route",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L39-L62 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | CheckRoute | func (client *Client) CheckRoute(route Route) (bool, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouteReservedRequest,
URIParams: map[string]string{"domain_guid": route.DomainGUID},
})
if err != nil {
return false, nil, err
}
queryParams := url.Values{... | go | func (client *Client) CheckRoute(route Route) (bool, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouteReservedRequest,
URIParams: map[string]string{"domain_guid": route.DomainGUID},
})
if err != nil {
return false, nil, err
}
queryParams := url.Values{... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CheckRoute",
"(",
"route",
"Route",
")",
"(",
"bool",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"inte... | // CheckRoute returns true if the route exists in the CF instance. | [
"CheckRoute",
"returns",
"true",
"if",
"the",
"route",
"exists",
"in",
"the",
"CF",
"instance",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L65-L93 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | DeleteRouteApplication | func (client *Client) DeleteRouteApplication(routeGUID string, appGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
retur... | go | func (client *Client) DeleteRouteApplication(routeGUID string, appGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
retur... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteRouteApplication",
"(",
"routeGUID",
"string",
",",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",... | // DeleteRouteApplication removes the link between the route and application. | [
"DeleteRouteApplication",
"removes",
"the",
"link",
"between",
"the",
"route",
"and",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L146-L161 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | DeleteSpaceUnmappedRoutes | func (client *Client) DeleteSpaceUnmappedRoutes(spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSpaceUnmappedRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
})
if err != nil {
return nil, err
}
var response cloud... | go | func (client *Client) DeleteSpaceUnmappedRoutes(spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSpaceUnmappedRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
})
if err != nil {
return nil, err
}
var response cloud... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteSpaceUnmappedRoutes",
"(",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"i... | // DeleteSpaceUnmappedRoutes deletes Routes within a specified Space not mapped
// to an Application | [
"DeleteSpaceUnmappedRoutes",
"deletes",
"Routes",
"within",
"a",
"specified",
"Space",
"not",
"mapped",
"to",
"an",
"Application"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L165-L177 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | GetRoute | func (client *Client) GetRoute(guid string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouteRequest,
URIParams: Params{"route_guid": guid},
})
if err != nil {
return Route{}, nil, err
}
var route Route
response := cloudcontroller.Response{
... | go | func (client *Client) GetRoute(guid string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRouteRequest,
URIParams: Params{"route_guid": guid},
})
if err != nil {
return Route{}, nil, err
}
var route Route
response := cloudcontroller.Response{
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetRoute",
"(",
"guid",
"string",
")",
"(",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"inter... | // GetRoute returns a route with the provided guid. | [
"GetRoute",
"returns",
"a",
"route",
"with",
"the",
"provided",
"guid",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L208-L224 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | GetRoutes | func (client *Client) GetRoutes(filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRoutesRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullRoutesList []Route
warnings, err := ... | go | func (client *Client) GetRoutes(filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRoutesRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullRoutesList []Route
warnings, err := ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetRoutes",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Re... | // GetRoutes returns a list of Routes based off of the provided filters. | [
"GetRoutes",
"returns",
"a",
"list",
"of",
"Routes",
"based",
"off",
"of",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L227-L250 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | GetSpaceRoutes | func (client *Client) GetSpaceRoutes(spaceGUID string, filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
Query: ConvertFilterParameters(filters),
})
if... | go | func (client *Client) GetSpaceRoutes(spaceGUID string, filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
Query: ConvertFilterParameters(filters),
})
if... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceRoutes",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetSpaceRoutes returns a list of Routes associated with the provided Space
// GUID, and filtered by the provided filters. | [
"GetSpaceRoutes",
"returns",
"a",
"list",
"of",
"Routes",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"and",
"filtered",
"by",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L254-L278 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | UpdateRouteApplication | func (client *Client) UpdateRouteApplication(routeGUID string, appGUID string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
r... | go | func (client *Client) UpdateRouteApplication(routeGUID string, appGUID string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
r... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateRouteApplication",
"(",
"routeGUID",
"string",
",",
"appGUID",
"string",
")",
"(",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"reque... | // UpdateRouteApplication creates a link between the route and application. | [
"UpdateRouteApplication",
"creates",
"a",
"link",
"between",
"the",
"route",
"and",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L281-L300 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | CreateApplicationProcessScale | func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error) {
body, err := json.Marshal(process)
if err != nil {
return Process{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationProcessActionScaleRequest,... | go | func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error) {
body, err := json.Marshal(process)
if err != nil {
return Process{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationProcessActionScaleRequest,... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateApplicationProcessScale",
"(",
"appGUID",
"string",
",",
"process",
"Process",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"process",... | // CreateApplicationProcessScale updates process instances count, memory or disk | [
"CreateApplicationProcessScale",
"updates",
"process",
"instances",
"count",
"memory",
"or",
"disk"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L81-L102 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | GetApplicationProcessByType | func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationProcessRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"type": processType,
},
})
if... | go | func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationProcessRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"type": processType,
},
})
if... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationProcessByType",
"(",
"appGUID",
"string",
",",
"processType",
"string",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",... | // GetApplicationProcessByType returns application process of specified type | [
"GetApplicationProcessByType",
"returns",
"application",
"process",
"of",
"specified",
"type"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L105-L123 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | UpdateProcess | func (client *Client) UpdateProcess(process Process) (Process, Warnings, error) {
body, err := json.Marshal(Process{
Command: process.Command,
HealthCheckType: process.HealthCheckType,
HealthCheckEndpoint: process.HealthCheckEndpoint,
HealthCheckTimeout: pro... | go | func (client *Client) UpdateProcess(process Process) (Process, Warnings, error) {
body, err := json.Marshal(Process{
Command: process.Command,
HealthCheckType: process.HealthCheckType,
HealthCheckEndpoint: process.HealthCheckEndpoint,
HealthCheckTimeout: pro... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateProcess",
"(",
"process",
"Process",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"Process",
"{",
"Command",
":",
"process",
".",
... | // UpdateProcess updates the process's command or health check settings. GUID
// is always required; HealthCheckType is only required when updating health
// check settings. | [
"UpdateProcess",
"updates",
"the",
"process",
"s",
"command",
"or",
"health",
"check",
"settings",
".",
"GUID",
"is",
"always",
"required",
";",
"HealthCheckType",
"is",
"only",
"required",
"when",
"updating",
"health",
"check",
"settings",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L155-L182 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance_shared_to.go | GetServiceInstanceSharedTos | func (client *Client) GetServiceInstanceSharedTos(serviceInstanceGUID string) ([]ServiceInstanceSharedTo, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceSharedToRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err... | go | func (client *Client) GetServiceInstanceSharedTos(serviceInstanceGUID string) ([]ServiceInstanceSharedTo, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceSharedToRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServiceInstanceSharedTos",
"(",
"serviceInstanceGUID",
"string",
")",
"(",
"[",
"]",
"ServiceInstanceSharedTo",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetServiceInstanceSharedTos returns a list of ServiceInstanceSharedTo objects. | [
"GetServiceInstanceSharedTos",
"returns",
"a",
"list",
"of",
"ServiceInstanceSharedTo",
"objects",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance_shared_to.go#L29-L53 | train |
cloudfoundry/cli | api/uaa/uaa_connection.go | NewConnection | func NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection {
tr := &http.Transport{
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}).DialContext,
DisableKeepAlives: disableKeepAlives,
Proxy: http.ProxyFromEnvi... | go | func NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection {
tr := &http.Transport{
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}).DialContext,
DisableKeepAlives: disableKeepAlives,
Proxy: http.ProxyFromEnvi... | [
"func",
"NewConnection",
"(",
"skipSSLValidation",
"bool",
",",
"disableKeepAlives",
"bool",
",",
"dialTimeout",
"time",
".",
"Duration",
")",
"*",
"UAAConnection",
"{",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"DialContext",
":",
"(",
"&",
"net",
"."... | // NewConnection returns a pointer to a new UAA Connection | [
"NewConnection",
"returns",
"a",
"pointer",
"to",
"a",
"new",
"UAA",
"Connection"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/uaa_connection.go#L21-L45 | train |
cloudfoundry/cli | api/uaa/uaa_connection.go | Make | func (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error {
// In case this function is called from a retry, passedResponse may already
// be populated with a previous response. We reset in case there's an HTTP
// error and we don't repopulate it in populateResponse.
passedRespons... | go | func (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error {
// In case this function is called from a retry, passedResponse may already
// be populated with a previous response. We reset in case there's an HTTP
// error and we don't repopulate it in populateResponse.
passedRespons... | [
"func",
"(",
"connection",
"*",
"UAAConnection",
")",
"Make",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"passedResponse",
"*",
"Response",
")",
"error",
"{",
"// In case this function is called from a retry, passedResponse may already",
"// be populated with a previ... | // Make takes a passedRequest, converts it into an HTTP request and then
// executes it. The response is then injected into passedResponse. | [
"Make",
"takes",
"a",
"passedRequest",
"converts",
"it",
"into",
"an",
"HTTP",
"request",
"and",
"then",
"executes",
"it",
".",
"The",
"response",
"is",
"then",
"injected",
"into",
"passedResponse",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/uaa_connection.go#L49-L61 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/event.go | UnmarshalJSON | func (event *Event) UnmarshalJSON(data []byte) error {
var ccEvent struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Type string `json:"type,omitempty"`
ActorGUID string `json:"actor,omitempty"`
ActorType string `json:"actor_type,o... | go | func (event *Event) UnmarshalJSON(data []byte) error {
var ccEvent struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Type string `json:"type,omitempty"`
ActorGUID string `json:"actor,omitempty"`
ActorType string `json:"actor_type,o... | [
"func",
"(",
"event",
"*",
"Event",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccEvent",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Type",
"string",
"`... | // UnmarshalJSON helps unmarshal a Cloud Controller Event response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Event",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/event.go#L46-L81 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/event.go | GetEvents | func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetEventsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullEventsList []Event
warnings, err := ... | go | func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetEventsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullEventsList []Event
warnings, err := ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetEvents",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Event",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Re... | // GetEvents returns back a list of Events based off of the provided queries. | [
"GetEvents",
"returns",
"back",
"a",
"list",
"of",
"Events",
"based",
"off",
"of",
"the",
"provided",
"queries",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/event.go#L84-L107 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/v2_formatted_resource.go | UnmarshalJSON | func (r *V2FormattedResource) UnmarshalJSON(data []byte) error {
var ccResource struct {
Filename string `json:"fn,omitempty"`
Mode string `json:"mode,omitempty"`
SHA1 string `json:"sha1"`
Size int64 `json:"size"`
}
err := cloudcontroller.DecodeJSON(data, &ccResource)
if err != nil {
return ... | go | func (r *V2FormattedResource) UnmarshalJSON(data []byte) error {
var ccResource struct {
Filename string `json:"fn,omitempty"`
Mode string `json:"mode,omitempty"`
SHA1 string `json:"sha1"`
Size int64 `json:"size"`
}
err := cloudcontroller.DecodeJSON(data, &ccResource)
if err != nil {
return ... | [
"func",
"(",
"r",
"*",
"V2FormattedResource",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccResource",
"struct",
"{",
"Filename",
"string",
"`json:\"fn,omitempty\"`",
"\n",
"Mode",
"string",
"`json:\"mode,omitempty\"`",
"\n",
... | // UnmarshalJSON helps unmarshal a Cloud Controller V2FormattedResource response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"V2FormattedResource",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/v2_formatted_resource.go#L50-L73 | train |
cloudfoundry/cli | api/uaa/auth.go | Authenticate | func (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error) {
requestBody := url.Values{
"grant_type": {string(grantType)},
}
for k, v := range creds {
requestBody.Set(k, v)
}
type loginHint struct {
Origin string `json:"origin"`
}
orig... | go | func (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error) {
requestBody := url.Values{
"grant_type": {string(grantType)},
}
for k, v := range creds {
requestBody.Set(k, v)
}
type loginHint struct {
Origin string `json:"origin"`
}
orig... | [
"func",
"(",
"client",
"Client",
")",
"Authenticate",
"(",
"creds",
"map",
"[",
"string",
"]",
"string",
",",
"origin",
"string",
",",
"grantType",
"constant",
".",
"GrantType",
")",
"(",
"string",
",",
"string",
",",
"error",
")",
"{",
"requestBody",
":... | // Authenticate sends a username and password to UAA then returns an access
// token and a refresh token. | [
"Authenticate",
"sends",
"a",
"username",
"and",
"password",
"to",
"UAA",
"then",
"returns",
"an",
"access",
"token",
"and",
"a",
"refresh",
"token",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/auth.go#L22-L72 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | UnmarshalJSON | func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
var ccOrgQuota struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
if err != nil {
return err
}
application.GU... | go | func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
var ccOrgQuota struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
if err != nil {
return err
}
application.GU... | [
"func",
"(",
"application",
"*",
"OrganizationQuota",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccOrgQuota",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Na... | // UnmarshalJSON helps unmarshal a Cloud Controller organization quota response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"organization",
"quota",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L20-L36 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | GetOrganizationQuota | func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionRequest,
URIParams: Params{"organization_quota_guid": guid},
})
if err != nil {
return OrganizationQuota{}, ... | go | func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionRequest,
URIParams: Params{"organization_quota_guid": guid},
})
if err != nil {
return OrganizationQuota{}, ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizationQuota",
"(",
"guid",
"string",
")",
"(",
"OrganizationQuota",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Reque... | // GetOrganizationQuota returns an Organization Quota associated with the
// provided GUID. | [
"GetOrganizationQuota",
"returns",
"an",
"Organization",
"Quota",
"associated",
"with",
"the",
"provided",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L40-L56 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | GetOrganizationQuotas | func (client *Client) GetOrganizationQuotas(filters ...Filter) ([]OrganizationQuota, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionsRequest,
Query: allQueries,
})
if err != nil {
... | go | func (client *Client) GetOrganizationQuotas(filters ...Filter) ([]OrganizationQuota, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionsRequest,
Query: allQueries,
})
if err != nil {
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizationQuotas",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"OrganizationQuota",
",",
"Warnings",
",",
"error",
")",
"{",
"allQueries",
":=",
"ConvertFilterParameters",
"(",
"filters",
")",
"\n",
"... | // GetOrganizationQuotas returns an Organization Quota list associated with the
// provided filters. | [
"GetOrganizationQuotas",
"returns",
"an",
"Organization",
"Quota",
"list",
"associated",
"with",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L60-L86 | train |
cloudfoundry/cli | actor/v7action/process.go | GetProcessByTypeAndApplication | func (actor Actor) GetProcessByTypeAndApplication(processType string, appGUID string) (Process, Warnings, error) {
process, warnings, err := actor.CloudControllerClient.GetApplicationProcessByType(appGUID, processType)
if _, ok := err.(ccerror.ProcessNotFoundError); ok {
return Process{}, Warnings(warnings), action... | go | func (actor Actor) GetProcessByTypeAndApplication(processType string, appGUID string) (Process, Warnings, error) {
process, warnings, err := actor.CloudControllerClient.GetApplicationProcessByType(appGUID, processType)
if _, ok := err.(ccerror.ProcessNotFoundError); ok {
return Process{}, Warnings(warnings), action... | [
"func",
"(",
"actor",
"Actor",
")",
"GetProcessByTypeAndApplication",
"(",
"processType",
"string",
",",
"appGUID",
"string",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"process",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudCont... | // GetProcessByTypeAndApplication returns a process for the given application
// and type. | [
"GetProcessByTypeAndApplication",
"returns",
"a",
"process",
"for",
"the",
"given",
"application",
"and",
"type",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/process.go#L15-L21 | train |
cloudfoundry/cli | types/filtered_string.go | ParseValue | func (n *FilteredString) ParseValue(val string) {
if val == "" {
n.IsSet = false
n.Value = ""
return
}
n.IsSet = true
switch val {
case "null", "default":
n.Value = ""
default:
n.Value = val
}
} | go | func (n *FilteredString) ParseValue(val string) {
if val == "" {
n.IsSet = false
n.Value = ""
return
}
n.IsSet = true
switch val {
case "null", "default":
n.Value = ""
default:
n.Value = val
}
} | [
"func",
"(",
"n",
"*",
"FilteredString",
")",
"ParseValue",
"(",
"val",
"string",
")",
"{",
"if",
"val",
"==",
"\"",
"\"",
"{",
"n",
".",
"IsSet",
"=",
"false",
"\n",
"n",
".",
"Value",
"=",
"\"",
"\"",
"\n",
"return",
"\n",
"}",
"\n\n",
"n",
"... | // ParseValue is used to parse a user provided flag argument. | [
"ParseValue",
"is",
"used",
"to",
"parse",
"a",
"user",
"provided",
"flag",
"argument",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/types/filtered_string.go#L27-L42 | train |
cloudfoundry/cli | types/filtered_string.go | MarshalJSON | func (n FilteredString) MarshalJSON() ([]byte, error) {
if n.Value != "" {
return json.Marshal(n.Value)
}
return json.Marshal(new(json.RawMessage))
} | go | func (n FilteredString) MarshalJSON() ([]byte, error) {
if n.Value != "" {
return json.Marshal(n.Value)
}
return json.Marshal(new(json.RawMessage))
} | [
"func",
"(",
"n",
"FilteredString",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"n",
".",
"Value",
"!=",
"\"",
"\"",
"{",
"return",
"json",
".",
"Marshal",
"(",
"n",
".",
"Value",
")",
"\n",
"}",
"\n\n",
"... | // MarshalJSON marshals the value field if it's not empty, otherwise returns an
// null. | [
"MarshalJSON",
"marshals",
"the",
"value",
"field",
"if",
"it",
"s",
"not",
"empty",
"otherwise",
"returns",
"an",
"null",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/types/filtered_string.go#L68-L74 | train |
cloudfoundry/cli | api/cloudcontroller/decode_json.go | DecodeJSON | func DecodeJSON(raw []byte, v interface{}) error {
decoder := json.NewDecoder(bytes.NewBuffer(raw))
decoder.UseNumber()
return decoder.Decode(v)
} | go | func DecodeJSON(raw []byte, v interface{}) error {
decoder := json.NewDecoder(bytes.NewBuffer(raw))
decoder.UseNumber()
return decoder.Decode(v)
} | [
"func",
"DecodeJSON",
"(",
"raw",
"[",
"]",
"byte",
",",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"decoder",
":=",
"json",
".",
"NewDecoder",
"(",
"bytes",
".",
"NewBuffer",
"(",
"raw",
")",
")",
"\n",
"decoder",
".",
"UseNumber",
"(",
")",
"... | // DecodeJSON unmarshals JSON into the given object with the appropriate
// settings. | [
"DecodeJSON",
"unmarshals",
"JSON",
"into",
"the",
"given",
"object",
"with",
"the",
"appropriate",
"settings",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/decode_json.go#L10-L14 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/deployment.go | MarshalJSON | func (d Deployment) MarshalJSON() ([]byte, error) {
type Droplet struct {
GUID string `json:"guid,omitempty"`
}
var ccDeployment struct {
Droplet *Droplet `json:"droplet,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
}
if d.DropletGUID != "" {
ccDeployment.Droplet = &... | go | func (d Deployment) MarshalJSON() ([]byte, error) {
type Droplet struct {
GUID string `json:"guid,omitempty"`
}
var ccDeployment struct {
Droplet *Droplet `json:"droplet,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
}
if d.DropletGUID != "" {
ccDeployment.Droplet = &... | [
"func",
"(",
"d",
"Deployment",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"type",
"Droplet",
"struct",
"{",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"}",
"\n\n",
"var",
"ccDeployment",
"struct",
"{",
"Droplet"... | // MarshalJSON converts a Deployment into a Cloud Controller Deployment. | [
"MarshalJSON",
"converts",
"a",
"Deployment",
"into",
"a",
"Cloud",
"Controller",
"Deployment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/deployment.go#L23-L40 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/deployment.go | UnmarshalJSON | func (d *Deployment) UnmarshalJSON(data []byte) error {
var ccDeployment struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
State constant.De... | go | func (d *Deployment) UnmarshalJSON(data []byte) error {
var ccDeployment struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
State constant.De... | [
"func",
"(",
"d",
"*",
"Deployment",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccDeployment",
"struct",
"{",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"CreatedAt",
"string",
"`json:\"created_at,omitempty\"`",
"\n",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Deployment response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Deployment",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/deployment.go#L43-L63 | train |
cloudfoundry/cli | integration/helpers/environment.go | CheckEnvironmentTargetedCorrectly | func CheckEnvironmentTargetedCorrectly(targetedOrganizationRequired bool, targetedSpaceRequired bool, testOrg string, command ...string) {
LoginCF()
if targetedOrganizationRequired {
By("errors if org is not targeted")
session := CF(command...)
Eventually(session).Should(Say("FAILED"))
Eventually(session.Err... | go | func CheckEnvironmentTargetedCorrectly(targetedOrganizationRequired bool, targetedSpaceRequired bool, testOrg string, command ...string) {
LoginCF()
if targetedOrganizationRequired {
By("errors if org is not targeted")
session := CF(command...)
Eventually(session).Should(Say("FAILED"))
Eventually(session.Err... | [
"func",
"CheckEnvironmentTargetedCorrectly",
"(",
"targetedOrganizationRequired",
"bool",
",",
"targetedSpaceRequired",
"bool",
",",
"testOrg",
"string",
",",
"command",
"...",
"string",
")",
"{",
"LoginCF",
"(",
")",
"\n\n",
"if",
"targetedOrganizationRequired",
"{",
... | // CheckEnvironmentTargetedCorrectly will confirm if the command requires an
// API to be targeted and logged in to run. It can optionally check if the
// command requires org and space to be targeted. | [
"CheckEnvironmentTargetedCorrectly",
"will",
"confirm",
"if",
"the",
"command",
"requires",
"an",
"API",
"to",
"be",
"targeted",
"and",
"logged",
"in",
"to",
"run",
".",
"It",
"can",
"optionally",
"check",
"if",
"the",
"command",
"requires",
"org",
"and",
"spa... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/environment.go#L32-L65 | train |
cloudfoundry/cli | util/manifest/manifest.go | ReadAndInterpolateManifest | func ReadAndInterpolateManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]Application, error) {
rawManifest, err := ReadAndInterpolateRawManifest(pathToManifest, pathsToVarsFiles, vars)
if err != nil {
return nil, err
}
var manifest Manifest
err = yaml.Unmarshal(rawManifest, &m... | go | func ReadAndInterpolateManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]Application, error) {
rawManifest, err := ReadAndInterpolateRawManifest(pathToManifest, pathsToVarsFiles, vars)
if err != nil {
return nil, err
}
var manifest Manifest
err = yaml.Unmarshal(rawManifest, &m... | [
"func",
"ReadAndInterpolateManifest",
"(",
"pathToManifest",
"string",
",",
"pathsToVarsFiles",
"[",
"]",
"string",
",",
"vars",
"[",
"]",
"template",
".",
"VarKV",
")",
"(",
"[",
"]",
"Application",
",",
"error",
")",
"{",
"rawManifest",
",",
"err",
":=",
... | // ReadAndInterpolateManifest reads the manifest at the provided paths,
// interpolates variables if a vars file is provided, and returns a fully
// merged set of applications. | [
"ReadAndInterpolateManifest",
"reads",
"the",
"manifest",
"at",
"the",
"provided",
"paths",
"interpolates",
"variables",
"if",
"a",
"vars",
"file",
"is",
"provided",
"and",
"returns",
"a",
"fully",
"merged",
"set",
"of",
"applications",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L37-L56 | train |
cloudfoundry/cli | util/manifest/manifest.go | ReadAndInterpolateRawManifest | func ReadAndInterpolateRawManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]byte, error) {
rawManifest, err := ioutil.ReadFile(pathToManifest)
if err != nil {
return nil, err
}
tpl := template.NewTemplate(rawManifest)
fileVars := template.StaticVariables{}
for _, path := ran... | go | func ReadAndInterpolateRawManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]byte, error) {
rawManifest, err := ioutil.ReadFile(pathToManifest)
if err != nil {
return nil, err
}
tpl := template.NewTemplate(rawManifest)
fileVars := template.StaticVariables{}
for _, path := ran... | [
"func",
"ReadAndInterpolateRawManifest",
"(",
"pathToManifest",
"string",
",",
"pathsToVarsFiles",
"[",
"]",
"string",
",",
"vars",
"[",
"]",
"template",
".",
"VarKV",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"rawManifest",
",",
"err",
":=",
"io... | // ReadAndInterpolateRawManifest reads the manifest at the provided paths,
// interpolates variables if a vars file is provided, and returns the
// Unmarshalled result. | [
"ReadAndInterpolateRawManifest",
"reads",
"the",
"manifest",
"at",
"the",
"provided",
"paths",
"interpolates",
"variables",
"if",
"a",
"vars",
"file",
"is",
"provided",
"and",
"returns",
"the",
"Unmarshalled",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L61-L97 | train |
cloudfoundry/cli | util/manifest/manifest.go | WriteApplicationManifest | func WriteApplicationManifest(application Application, filePath string) error {
manifest := Manifest{Applications: []Application{application}}
manifestBytes, err := yaml.Marshal(manifest)
if err != nil {
return ManifestCreationError{Err: err}
}
err = ioutil.WriteFile(filePath, manifestBytes, 0644)
if err != ni... | go | func WriteApplicationManifest(application Application, filePath string) error {
manifest := Manifest{Applications: []Application{application}}
manifestBytes, err := yaml.Marshal(manifest)
if err != nil {
return ManifestCreationError{Err: err}
}
err = ioutil.WriteFile(filePath, manifestBytes, 0644)
if err != ni... | [
"func",
"WriteApplicationManifest",
"(",
"application",
"Application",
",",
"filePath",
"string",
")",
"error",
"{",
"manifest",
":=",
"Manifest",
"{",
"Applications",
":",
"[",
"]",
"Application",
"{",
"application",
"}",
"}",
"\n",
"manifestBytes",
",",
"err",... | // WriteApplicationManifest writes the provided application to the given
// filepath. If the filepath does not exist, it will create it. | [
"WriteApplicationManifest",
"writes",
"the",
"provided",
"application",
"to",
"the",
"given",
"filepath",
".",
"If",
"the",
"filepath",
"does",
"not",
"exist",
"it",
"will",
"create",
"it",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L101-L114 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/isolation_segment.go | GetIsolationSegment | func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentRequest,
URIParams: map[string]string{"isolation_segment_guid": guid},
})
if err != nil {
return IsolationSegment{}, nil,... | go | func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentRequest,
URIParams: map[string]string{"isolation_segment_guid": guid},
})
if err != nil {
return IsolationSegment{}, nil,... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetIsolationSegment",
"(",
"guid",
"string",
")",
"(",
"IsolationSegment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Request... | // GetIsolationSegment returns back the requested isolation segment that
// matches the GUID. | [
"GetIsolationSegment",
"returns",
"back",
"the",
"requested",
"isolation",
"segment",
"that",
"matches",
"the",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/isolation_segment.go#L65-L84 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/isolation_segment.go | GetIsolationSegments | func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentsRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullIsolationSegmentsList []IsolationS... | go | func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentsRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullIsolationSegmentsList []IsolationS... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetIsolationSegments",
"(",
"query",
"...",
"Query",
")",
"(",
"[",
"]",
"IsolationSegment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOpt... | // GetIsolationSegments lists isolation segments with optional filters. | [
"GetIsolationSegments",
"lists",
"isolation",
"segments",
"with",
"optional",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/isolation_segment.go#L87-L110 | train |
cloudfoundry/cli | api/cloudcontroller/buildpacks/upload.go | CalculateRequestSize | func CalculateRequestSize(buildpackSize int64, bpPath string, fieldName string) (int64, error) {
body := &bytes.Buffer{}
form := multipart.NewWriter(body)
bpFileName := filepath.Base(bpPath)
_, err := form.CreateFormFile(fieldName, bpFileName)
if err != nil {
return 0, err
}
err = form.Close()
if err != ni... | go | func CalculateRequestSize(buildpackSize int64, bpPath string, fieldName string) (int64, error) {
body := &bytes.Buffer{}
form := multipart.NewWriter(body)
bpFileName := filepath.Base(bpPath)
_, err := form.CreateFormFile(fieldName, bpFileName)
if err != nil {
return 0, err
}
err = form.Close()
if err != ni... | [
"func",
"CalculateRequestSize",
"(",
"buildpackSize",
"int64",
",",
"bpPath",
"string",
",",
"fieldName",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"body",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"form",
":=",
"multipart",
".",
"New... | // tested via the ccv2.buildpack_test.go file at this point | [
"tested",
"via",
"the",
"ccv2",
".",
"buildpack_test",
".",
"go",
"file",
"at",
"this",
"point"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/buildpacks/upload.go#L14-L31 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | UnmarshalJSON | func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
var ccSecurityGroup struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Name string `json:"name"`
Rules []struct {
Description string `json:"description"`
Destination string `json... | go | func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
var ccSecurityGroup struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Name string `json:"name"`
Rules []struct {
Description string `json:"description"`
Destination string `json... | [
"func",
"(",
"securityGroup",
"*",
"SecurityGroup",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccSecurityGroup",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Security Group response | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Security",
"Group",
"response"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L26-L59 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | DeleteSecurityGroupSpace | func (client *Client) DeleteSecurityGroupSpace(securityGroupGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSecurityGroupSpaceRequest,
URIParams: Params{
"security_group_guid": securityGroupGUID,
"space_guid": space... | go | func (client *Client) DeleteSecurityGroupSpace(securityGroupGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSecurityGroupSpaceRequest,
URIParams: Params{
"security_group_guid": securityGroupGUID,
"space_guid": space... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteSecurityGroupSpace",
"(",
"securityGroupGUID",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOpti... | // DeleteSecurityGroupSpace disassociates a security group in the running phase
// for the lifecycle, specified by its GUID, from a space, which is also
// specified by its GUID. | [
"DeleteSecurityGroupSpace",
"disassociates",
"a",
"security",
"group",
"in",
"the",
"running",
"phase",
"for",
"the",
"lifecycle",
"specified",
"by",
"its",
"GUID",
"from",
"a",
"space",
"which",
"is",
"also",
"specified",
"by",
"its",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L64-L81 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSecurityGroups | func (client *Client) GetSecurityGroups(filters ...Filter) ([]SecurityGroup, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSecurityGroupsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var securityGroupsLi... | go | func (client *Client) GetSecurityGroups(filters ...Filter) ([]SecurityGroup, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSecurityGroupsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var securityGroupsLi... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSecurityGroups",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOption... | // GetSecurityGroups returns a list of Security Groups based off the provided
// filters. | [
"GetSecurityGroups",
"returns",
"a",
"list",
"of",
"Security",
"Groups",
"based",
"off",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L107-L131 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSpaceSecurityGroups | func (client *Client) GetSpaceSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceSecurityGroupsRequest, filters)
} | go | func (client *Client) GetSpaceSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceSecurityGroupsRequest, filters)
} | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceSecurityGroups",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"return",
"client",
".",
"getSpaceSecurityGroupsBySp... | // GetSpaceSecurityGroups returns the running Security Groups associated with
// the provided Space GUID. | [
"GetSpaceSecurityGroups",
"returns",
"the",
"running",
"Security",
"Groups",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L135-L137 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSpaceStagingSecurityGroups | func (client *Client) GetSpaceStagingSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceStagingSecurityGroupsRequest, filters)
} | go | func (client *Client) GetSpaceStagingSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceStagingSecurityGroupsRequest, filters)
} | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceStagingSecurityGroups",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"return",
"client",
".",
"getSpaceSecurityGro... | // GetSpaceStagingSecurityGroups returns the staging Security Groups
// associated with the provided Space GUID. | [
"GetSpaceStagingSecurityGroups",
"returns",
"the",
"staging",
"Security",
"Groups",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L141-L143 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/job.go | Errors | func (job Job) Errors() []error {
var errs []error
for _, errDetails := range job.RawErrors {
switch errDetails.Code {
case constant.JobErrorCodeBuildpackAlreadyExistsForStack:
errs = append(errs, ccerror.BuildpackAlreadyExistsForStackError{Message: errDetails.Detail})
case constant.JobErrorCodeBuildpackAlre... | go | func (job Job) Errors() []error {
var errs []error
for _, errDetails := range job.RawErrors {
switch errDetails.Code {
case constant.JobErrorCodeBuildpackAlreadyExistsForStack:
errs = append(errs, ccerror.BuildpackAlreadyExistsForStackError{Message: errDetails.Detail})
case constant.JobErrorCodeBuildpackAlre... | [
"func",
"(",
"job",
"Job",
")",
"Errors",
"(",
")",
"[",
"]",
"error",
"{",
"var",
"errs",
"[",
"]",
"error",
"\n",
"for",
"_",
",",
"errDetails",
":=",
"range",
"job",
".",
"RawErrors",
"{",
"switch",
"errDetails",
".",
"Code",
"{",
"case",
"const... | // Errors returns back a list of | [
"Errors",
"returns",
"back",
"a",
"list",
"of"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/job.go#L22-L46 | train |
cloudfoundry/cli | actor/v7action/application.go | CreateApplicationInSpace | func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: ... | go | func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: ... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateApplicationInSpace",
"(",
"app",
"Application",
",",
"spaceGUID",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"createdApp",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudCont... | // CreateApplicationInSpace creates and returns the application with the given
// name in the given space. | [
"CreateApplicationInSpace",
"creates",
"and",
"returns",
"the",
"application",
"with",
"the",
"given",
"name",
"in",
"the",
"given",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L106-L126 | train |
cloudfoundry/cli | actor/v7action/application.go | SetApplicationProcessHealthCheckTypeByNameAndSpace | func (actor Actor) SetApplicationProcessHealthCheckTypeByNameAndSpace(
appName string,
spaceGUID string,
healthCheckType constant.HealthCheckType,
httpEndpoint string,
processType string,
invocationTimeout int64,
) (Application, Warnings, error) {
app, getWarnings, err := actor.GetApplicationByNameAndSpace(appN... | go | func (actor Actor) SetApplicationProcessHealthCheckTypeByNameAndSpace(
appName string,
spaceGUID string,
healthCheckType constant.HealthCheckType,
httpEndpoint string,
processType string,
invocationTimeout int64,
) (Application, Warnings, error) {
app, getWarnings, err := actor.GetApplicationByNameAndSpace(appN... | [
"func",
"(",
"actor",
"Actor",
")",
"SetApplicationProcessHealthCheckTypeByNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
",",
"healthCheckType",
"constant",
".",
"HealthCheckType",
",",
"httpEndpoint",
"string",
",",
"processType",
"string",
",",
... | // SetApplicationProcessHealthCheckTypeByNameAndSpace sets the health check
// information of the provided processType for an application with the given
// name and space GUID. | [
"SetApplicationProcessHealthCheckTypeByNameAndSpace",
"sets",
"the",
"health",
"check",
"information",
"of",
"the",
"provided",
"processType",
"for",
"an",
"application",
"with",
"the",
"given",
"name",
"and",
"space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L131-L154 | train |
cloudfoundry/cli | actor/v7action/application.go | StopApplication | func (actor Actor) StopApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationStop(appGUID)
return Warnings(warnings), err
} | go | func (actor Actor) StopApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationStop(appGUID)
return Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"StopApplication",
"(",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateApplicationStop",
"(",
"appGUID",
")",
... | // StopApplication stops an application. | [
"StopApplication",
"stops",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L157-L161 | train |
cloudfoundry/cli | actor/v7action/application.go | StartApplication | func (actor Actor) StartApplication(appGUID string) (Application, Warnings, error) {
updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplicationStart(appGUID)
if err != nil {
return Application{}, Warnings(warnings), err
}
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), n... | go | func (actor Actor) StartApplication(appGUID string) (Application, Warnings, error) {
updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplicationStart(appGUID)
if err != nil {
return Application{}, Warnings(warnings), err
}
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), n... | [
"func",
"(",
"actor",
"Actor",
")",
"StartApplication",
"(",
"appGUID",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"updatedApp",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateApplicationS... | // StartApplication starts an application. | [
"StartApplication",
"starts",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L164-L171 | train |
cloudfoundry/cli | actor/v7action/application.go | RestartApplication | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
var allWarnings Warnings
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return allWarnings, err
}
pollingWarnings, err := actor.PollStart(a... | go | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
var allWarnings Warnings
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return allWarnings, err
}
pollingWarnings, err := actor.PollStart(a... | [
"func",
"(",
"actor",
"Actor",
")",
"RestartApplication",
"(",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"U... | // RestartApplication restarts an application and waits for it to start. | [
"RestartApplication",
"restarts",
"an",
"application",
"and",
"waits",
"for",
"it",
"to",
"start",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L174-L185 | train |
cloudfoundry/cli | actor/actionerror/domain_not_found_error.go | Error | func (e DomainNotFoundError) Error() string {
switch {
case e.Name != "":
return fmt.Sprintf("Domain %s not found", e.Name)
case e.GUID != "":
return fmt.Sprintf("Domain with GUID %s not found", e.GUID)
default:
return "Domain not found"
}
} | go | func (e DomainNotFoundError) Error() string {
switch {
case e.Name != "":
return fmt.Sprintf("Domain %s not found", e.Name)
case e.GUID != "":
return fmt.Sprintf("Domain with GUID %s not found", e.GUID)
default:
return "Domain not found"
}
} | [
"func",
"(",
"e",
"DomainNotFoundError",
")",
"Error",
"(",
")",
"string",
"{",
"switch",
"{",
"case",
"e",
".",
"Name",
"!=",
"\"",
"\"",
":",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Name",
")",
"\n",
"case",
"e",
".",
... | // Error method to display the error message. | [
"Error",
"method",
"to",
"display",
"the",
"error",
"message",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/actionerror/domain_not_found_error.go#L13-L22 | train |
cloudfoundry/cli | integration/helpers/app.go | WithProcfileApp | func WithProcfileApp(f func(dir string)) {
dir, err := ioutil.TempDir("", "simple-ruby-app")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
web: ruby -run -e httpd . -p $PORT
console: bundle exec irb`,
), 0666)
Expect(err).ToNot(HaveOc... | go | func WithProcfileApp(f func(dir string)) {
dir, err := ioutil.TempDir("", "simple-ruby-app")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
web: ruby -run -e httpd . -p $PORT
console: bundle exec irb`,
), 0666)
Expect(err).ToNot(HaveOc... | [
"func",
"WithProcfileApp",
"(",
"f",
"func",
"(",
"dir",
"string",
")",
")",
"{",
"dir",
",",
"err",
":=",
"ioutil",
".",
"TempDir",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ToNot",
"(",
"HaveOccurred",
"(",
"... | // WithProcfileApp creates an application to use with your CLI command
// that contains Procfile defining web and worker processes. | [
"WithProcfileApp",
"creates",
"an",
"application",
"to",
"use",
"with",
"your",
"CLI",
"command",
"that",
"contains",
"Procfile",
"defining",
"web",
"and",
"worker",
"processes",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L88-L117 | train |
cloudfoundry/cli | integration/helpers/app.go | AppGUID | func AppGUID(appName string) string {
session := CF("app", appName, "--guid")
Eventually(session).Should(Exit(0))
return strings.TrimSpace(string(session.Out.Contents()))
} | go | func AppGUID(appName string) string {
session := CF("app", appName, "--guid")
Eventually(session).Should(Exit(0))
return strings.TrimSpace(string(session.Out.Contents()))
} | [
"func",
"AppGUID",
"(",
"appName",
"string",
")",
"string",
"{",
"session",
":=",
"CF",
"(",
"\"",
"\"",
",",
"appName",
",",
"\"",
"\"",
")",
"\n",
"Eventually",
"(",
"session",
")",
".",
"Should",
"(",
"Exit",
"(",
"0",
")",
")",
"\n",
"return",
... | // AppGUID returns the GUID for an app in the currently targeted space. | [
"AppGUID",
"returns",
"the",
"GUID",
"for",
"an",
"app",
"in",
"the",
"currently",
"targeted",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L171-L175 | train |
cloudfoundry/cli | integration/helpers/app.go | WriteManifest | func WriteManifest(path string, manifest map[string]interface{}) {
body, err := yaml.Marshal(manifest)
Expect(err).ToNot(HaveOccurred())
err = ioutil.WriteFile(path, body, 0666)
Expect(err).ToNot(HaveOccurred())
} | go | func WriteManifest(path string, manifest map[string]interface{}) {
body, err := yaml.Marshal(manifest)
Expect(err).ToNot(HaveOccurred())
err = ioutil.WriteFile(path, body, 0666)
Expect(err).ToNot(HaveOccurred())
} | [
"func",
"WriteManifest",
"(",
"path",
"string",
",",
"manifest",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"{",
"body",
",",
"err",
":=",
"yaml",
".",
"Marshal",
"(",
"manifest",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ToNot",
"(",
... | // WriteManifest will write out a YAML manifest file at the specified path. | [
"WriteManifest",
"will",
"write",
"out",
"a",
"YAML",
"manifest",
"file",
"at",
"the",
"specified",
"path",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L185-L190 | train |
cloudfoundry/cli | integration/helpers/app.go | Zipit | func Zipit(source, target, prefix string) error {
// Thanks to Svett Ralchev
// http://blog.ralch.com/tutorial/golang-working-with-zip/
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
if prefix != "" {
_, err = io.WriteString(zipfile, prefix)
if err != nil {
return... | go | func Zipit(source, target, prefix string) error {
// Thanks to Svett Ralchev
// http://blog.ralch.com/tutorial/golang-working-with-zip/
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
if prefix != "" {
_, err = io.WriteString(zipfile, prefix)
if err != nil {
return... | [
"func",
"Zipit",
"(",
"source",
",",
"target",
",",
"prefix",
"string",
")",
"error",
"{",
"// Thanks to Svett Ralchev",
"// http://blog.ralch.com/tutorial/golang-working-with-zip/",
"zipfile",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"target",
")",
"\n",
"if",
... | // Zipit zips the source into a .zip file in the target dir | [
"Zipit",
"zips",
"the",
"source",
"into",
"a",
".",
"zip",
"file",
"in",
"the",
"target",
"dir"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L193-L261 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/filter.go | ConvertFilterParameters | func ConvertFilterParameters(filters []Filter) url.Values {
params := url.Values{"q": []string{}}
for _, filter := range filters {
params["q"] = append(params["q"], filter.format())
}
return params
} | go | func ConvertFilterParameters(filters []Filter) url.Values {
params := url.Values{"q": []string{}}
for _, filter := range filters {
params["q"] = append(params["q"], filter.format())
}
return params
} | [
"func",
"ConvertFilterParameters",
"(",
"filters",
"[",
"]",
"Filter",
")",
"url",
".",
"Values",
"{",
"params",
":=",
"url",
".",
"Values",
"{",
"\"",
"\"",
":",
"[",
"]",
"string",
"{",
"}",
"}",
"\n",
"for",
"_",
",",
"filter",
":=",
"range",
"f... | // ConvertFilterParameters converts a Filter object into a collection that
// cloudcontroller.Request can accept. | [
"ConvertFilterParameters",
"converts",
"a",
"Filter",
"object",
"into",
"a",
"collection",
"that",
"cloudcontroller",
".",
"Request",
"can",
"accept",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/filter.go#L30-L37 | train |
cloudfoundry/cli | actor/pluginaction/plugin_info.go | GetPluginInfoFromRepositoriesForPlatform | func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
var reposWithPlugin []string
var newestPluginInfo PluginInfo
var pluginFoundWithIncompatibleBinary bool
for _, repo := range pluginRepos {
plugi... | go | func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
var reposWithPlugin []string
var newestPluginInfo PluginInfo
var pluginFoundWithIncompatibleBinary bool
for _, repo := range pluginRepos {
plugi... | [
"func",
"(",
"actor",
"Actor",
")",
"GetPluginInfoFromRepositoriesForPlatform",
"(",
"pluginName",
"string",
",",
"pluginRepos",
"[",
"]",
"configv3",
".",
"PluginRepository",
",",
"platform",
"string",
")",
"(",
"PluginInfo",
",",
"[",
"]",
"string",
",",
"erro... | // GetPluginInfoFromRepositoriesForPlatform returns the newest version of the specified plugin
// and all the repositories that contain that version. | [
"GetPluginInfoFromRepositoriesForPlatform",
"returns",
"the",
"newest",
"version",
"of",
"the",
"specified",
"plugin",
"and",
"all",
"the",
"repositories",
"that",
"contain",
"that",
"version",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L20-L55 | train |
cloudfoundry/cli | actor/pluginaction/plugin_info.go | GetPlatformString | func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string {
return generic.GeneratePlatform(runtime.GOOS, runtime.GOARCH)
} | go | func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string {
return generic.GeneratePlatform(runtime.GOOS, runtime.GOARCH)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetPlatformString",
"(",
"runtimeGOOS",
"string",
",",
"runtimeGOARCH",
"string",
")",
"string",
"{",
"return",
"generic",
".",
"GeneratePlatform",
"(",
"runtime",
".",
"GOOS",
",",
"runtime",
".",
"GOARCH",
")",
"\n",
"}... | // GetPlatformString exists solely for the purposes of mocking it out for command-layers tests. | [
"GetPlatformString",
"exists",
"solely",
"for",
"the",
"purposes",
"of",
"mocking",
"it",
"out",
"for",
"command",
"-",
"layers",
"tests",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L58-L60 | train |
cloudfoundry/cli | actor/pluginaction/plugin_info.go | getPluginInfoFromRepositoryForPlatform | func (actor Actor) getPluginInfoFromRepositoryForPlatform(pluginName string, pluginRepo configv3.PluginRepository, platform string) (PluginInfo, error) {
pluginRepository, err := actor.client.GetPluginRepository(pluginRepo.URL)
if err != nil {
return PluginInfo{}, err
}
var pluginFoundWithIncompatibleBinary bool... | go | func (actor Actor) getPluginInfoFromRepositoryForPlatform(pluginName string, pluginRepo configv3.PluginRepository, platform string) (PluginInfo, error) {
pluginRepository, err := actor.client.GetPluginRepository(pluginRepo.URL)
if err != nil {
return PluginInfo{}, err
}
var pluginFoundWithIncompatibleBinary bool... | [
"func",
"(",
"actor",
"Actor",
")",
"getPluginInfoFromRepositoryForPlatform",
"(",
"pluginName",
"string",
",",
"pluginRepo",
"configv3",
".",
"PluginRepository",
",",
"platform",
"string",
")",
"(",
"PluginInfo",
",",
"error",
")",
"{",
"pluginRepository",
",",
"... | // getPluginInfoFromRepositoryForPlatform returns the plugin info, if found, from
// the specified repository for the specified platform. | [
"getPluginInfoFromRepositoryForPlatform",
"returns",
"the",
"plugin",
"info",
"if",
"found",
"from",
"the",
"specified",
"repository",
"for",
"the",
"specified",
"platform",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L64-L96 | train |
cloudfoundry/cli | util/generic/executable_filename_windows.go | ExecutableFilename | func ExecutableFilename(name string) string {
if strings.HasSuffix(name, ".exe") {
return name
}
return fmt.Sprintf("%s.exe", name)
} | go | func ExecutableFilename(name string) string {
if strings.HasSuffix(name, ".exe") {
return name
}
return fmt.Sprintf("%s.exe", name)
} | [
"func",
"ExecutableFilename",
"(",
"name",
"string",
")",
"string",
"{",
"if",
"strings",
".",
"HasSuffix",
"(",
"name",
",",
"\"",
"\"",
")",
"{",
"return",
"name",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"name",
")",... | // ExecutableFilename appends '.exe' to a filename when necessary in order to
// make it executable on Windows | [
"ExecutableFilename",
"appends",
".",
"exe",
"to",
"a",
"filename",
"when",
"necessary",
"in",
"order",
"to",
"make",
"it",
"executable",
"on",
"Windows"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/generic/executable_filename_windows.go#L12-L17 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/relationship_list.go | EntitleIsolationSegmentToOrganizations | func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: organizationGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPReq... | go | func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: organizationGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPReq... | [
"func",
"(",
"client",
"*",
"Client",
")",
"EntitleIsolationSegmentToOrganizations",
"(",
"isolationSegmentGUID",
"string",
",",
"organizationGUIDs",
"[",
"]",
"string",
")",
"(",
"RelationshipList",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
"... | // EntitleIsolationSegmentToOrganizations will create a link between the
// isolation segment and the list of organizations provided. | [
"EntitleIsolationSegmentToOrganizations",
"will",
"create",
"a",
"link",
"between",
"the",
"isolation",
"segment",
"and",
"the",
"list",
"of",
"organizations",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship_list.go#L50-L72 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/relationship_list.go | ShareServiceInstanceToSpaces | func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: spaceGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Re... | go | func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: spaceGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Re... | [
"func",
"(",
"client",
"*",
"Client",
")",
"ShareServiceInstanceToSpaces",
"(",
"serviceInstanceGUID",
"string",
",",
"spaceGUIDs",
"[",
"]",
"string",
")",
"(",
"RelationshipList",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
"... | // ShareServiceInstanceToSpaces will create a sharing relationship between
// the service instance and the shared-to space for each space provided. | [
"ShareServiceInstanceToSpaces",
"will",
"create",
"a",
"sharing",
"relationship",
"between",
"the",
"service",
"instance",
"and",
"the",
"shared",
"-",
"to",
"space",
"for",
"each",
"space",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship_list.go#L76-L99 | train |
cloudfoundry/cli | util/panichandler/handler.go | HandlePanic | func HandlePanic() {
stackTraceBytes := make([]byte, maxStackSizeLimit)
runtime.Stack(stackTraceBytes, true)
stackTrace := "\t" + strings.Replace(string(stackTraceBytes), "\n", "\n\t", -1)
if err := recover(); err != nil {
formattedString := `
Something unexpected happened. This is a bug in {{.Binary}}.
Plea... | go | func HandlePanic() {
stackTraceBytes := make([]byte, maxStackSizeLimit)
runtime.Stack(stackTraceBytes, true)
stackTrace := "\t" + strings.Replace(string(stackTraceBytes), "\n", "\n\t", -1)
if err := recover(); err != nil {
formattedString := `
Something unexpected happened. This is a bug in {{.Binary}}.
Plea... | [
"func",
"HandlePanic",
"(",
")",
"{",
"stackTraceBytes",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"maxStackSizeLimit",
")",
"\n",
"runtime",
".",
"Stack",
"(",
"stackTraceBytes",
",",
"true",
")",
"\n",
"stackTrace",
":=",
"\"",
"\\t",
"\"",
"+",
"strin... | // HandlePanic will recover from any panics and display a friendly error
// message with additional information used for debugging the panic. | [
"HandlePanic",
"will",
"recover",
"from",
"any",
"panics",
"and",
"display",
"a",
"friendly",
"error",
"message",
"with",
"additional",
"information",
"used",
"for",
"debugging",
"the",
"panic",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/panichandler/handler.go#L17-L77 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | UnmarshalJSON | func (domain *Domain) UnmarshalJSON(data []byte) error {
var ccDomain struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
RouterGroupGUID string `json:"router_group_guid"`
RouterGroupType string `json:"router_group_type"`
Internal bool `... | go | func (domain *Domain) UnmarshalJSON(data []byte) error {
var ccDomain struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
RouterGroupGUID string `json:"router_group_guid"`
RouterGroupType string `json:"router_group_type"`
Internal bool `... | [
"func",
"(",
"domain",
"*",
"Domain",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccDomain",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Domain response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Domain",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L38-L59 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | GetPrivateDomain | func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainRequest,
URIParams: map[string]string{"private_domain_guid": domainGUID},
})
if err != nil {
return Domain{}, nil, err
}
var dom... | go | func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainRequest,
URIParams: map[string]string{"private_domain_guid": domainGUID},
})
if err != nil {
return Domain{}, nil, err
}
var dom... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPrivateDomain",
"(",
"domainGUID",
"string",
")",
"(",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
... | // GetPrivateDomain returns the Private Domain associated with the provided
// Domain GUID. | [
"GetPrivateDomain",
"returns",
"the",
"Private",
"Domain",
"associated",
"with",
"the",
"provided",
"Domain",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L119-L140 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | GetPrivateDomains | func (client *Client) GetPrivateDomains(filters ...Filter) ([]Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return []Domain{}, nil, err
}
fullDomainsList := []... | go | func (client *Client) GetPrivateDomains(filters ...Filter) ([]Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return []Domain{}, nil, err
}
fullDomainsList := []... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPrivateDomains",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"... | // GetPrivateDomains returns the private domains this client has access to. | [
"GetPrivateDomains",
"returns",
"the",
"private",
"domains",
"this",
"client",
"has",
"access",
"to",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L143-L167 | train |
cloudfoundry/cli | command/common/command_list_v6.go | HasCommand | func (c commandList) HasCommand(name string) bool {
if name == "" {
return false
}
cType := reflect.TypeOf(c)
_, found := cType.FieldByNameFunc(
func(fieldName string) bool {
field, _ := cType.FieldByName(fieldName)
return field.Tag.Get("command") == name
},
)
return found
} | go | func (c commandList) HasCommand(name string) bool {
if name == "" {
return false
}
cType := reflect.TypeOf(c)
_, found := cType.FieldByNameFunc(
func(fieldName string) bool {
field, _ := cType.FieldByName(fieldName)
return field.Tag.Get("command") == name
},
)
return found
} | [
"func",
"(",
"c",
"commandList",
")",
"HasCommand",
"(",
"name",
"string",
")",
"bool",
"{",
"if",
"name",
"==",
"\"",
"\"",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"cType",
":=",
"reflect",
".",
"TypeOf",
"(",
"c",
")",
"\n",
"_",
",",
"found",... | // HasCommand returns true if the command name is in the command list. | [
"HasCommand",
"returns",
"true",
"if",
"the",
"command",
"name",
"is",
"in",
"the",
"command",
"list",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/common/command_list_v6.go#L218-L232 | train |
cloudfoundry/cli | util/ui/log_message.go | DisplayLogMessage | func (ui *UI) DisplayLogMessage(message LogMessage, displayHeader bool) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var header string
if displayHeader {
time := message.Timestamp().In(ui.TimezoneLocation).Format(LogTimestampFormat)
header = fmt.Sprintf("%s [%s/%s] %s ",
time,
message.SourceT... | go | func (ui *UI) DisplayLogMessage(message LogMessage, displayHeader bool) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var header string
if displayHeader {
time := message.Timestamp().In(ui.TimezoneLocation).Format(LogTimestampFormat)
header = fmt.Sprintf("%s [%s/%s] %s ",
time,
message.SourceT... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayLogMessage",
"(",
"message",
"LogMessage",
",",
"displayHeader",
"bool",
")",
"{",
"ui",
".",
"terminalLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"ui",
".",
"terminalLock",
".",
"Unlock",
"(",
")",
"\n\n",
"... | // DisplayLogMessage formats and outputs a given log message. | [
"DisplayLogMessage",
"formats",
"and",
"outputs",
"a",
"given",
"log",
"message",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/log_message.go#L27-L50 | train |
cloudfoundry/cli | command/common/install_plugin_command.go | handleFetchingPluginInfoFromRepositoriesError | func (InstallPluginCommand) handleFetchingPluginInfoFromRepositoriesError(fetchErr actionerror.FetchingPluginInfoFromRepositoryError) error {
switch clientErr := fetchErr.Err.(type) {
case pluginerror.RawHTTPStatusError:
return translatableerror.FetchingPluginInfoFromRepositoriesError{
Message: clientErr.... | go | func (InstallPluginCommand) handleFetchingPluginInfoFromRepositoriesError(fetchErr actionerror.FetchingPluginInfoFromRepositoryError) error {
switch clientErr := fetchErr.Err.(type) {
case pluginerror.RawHTTPStatusError:
return translatableerror.FetchingPluginInfoFromRepositoriesError{
Message: clientErr.... | [
"func",
"(",
"InstallPluginCommand",
")",
"handleFetchingPluginInfoFromRepositoriesError",
"(",
"fetchErr",
"actionerror",
".",
"FetchingPluginInfoFromRepositoryError",
")",
"error",
"{",
"switch",
"clientErr",
":=",
"fetchErr",
".",
"Err",
".",
"(",
"type",
")",
"{",
... | // These are specific errors that we output to the user in the context of
// installing from any repository. | [
"These",
"are",
"specific",
"errors",
"that",
"we",
"output",
"to",
"the",
"user",
"in",
"the",
"context",
"of",
"installing",
"from",
"any",
"repository",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/common/install_plugin_command.go#L246-L269 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/environment.go | GetApplicationEnvironment | func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
URIParams: internal.Params{"app_guid": appGUID},
RequestName: internal.GetApplicationEnvRequest,
})
if err != nil {
return Environment{}, nil, err
}
var re... | go | func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
URIParams: internal.Params{"app_guid": appGUID},
RequestName: internal.GetApplicationEnvRequest,
})
if err != nil {
return Environment{}, nil, err
}
var re... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationEnvironment",
"(",
"appGUID",
"string",
")",
"(",
"Environment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"URI... | // GetApplicationEnvironment fetches all the environment variables on
// an application by groups. | [
"GetApplicationEnvironment",
"fetches",
"all",
"the",
"environment",
"variables",
"on",
"an",
"application",
"by",
"groups",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/environment.go#L30-L45 | train |
cloudfoundry/cli | command/v6/shared/new_clients.go | NewClients | func NewClients(config command.Config, ui command.UI, targetCF bool) (*ccv2.Client, *uaa.Client, error) {
ccWrappers := []ccv2.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
}
if location != n... | go | func NewClients(config command.Config, ui command.UI, targetCF bool) (*ccv2.Client, *uaa.Client, error) {
ccWrappers := []ccv2.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
}
if location != n... | [
"func",
"NewClients",
"(",
"config",
"command",
".",
"Config",
",",
"ui",
"command",
".",
"UI",
",",
"targetCF",
"bool",
")",
"(",
"*",
"ccv2",
".",
"Client",
",",
"*",
"uaa",
".",
"Client",
",",
"error",
")",
"{",
"ccWrappers",
":=",
"[",
"]",
"cc... | // NewClients creates a new V2 Cloud Controller client and UAA client using the
// passed in config. | [
"NewClients",
"creates",
"a",
"new",
"V2",
"Cloud",
"Controller",
"client",
"and",
"UAA",
"client",
"using",
"the",
"passed",
"in",
"config",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/new_clients.go#L16-L90 | train |
cloudfoundry/cli | actor/sharedaction/check_target.go | CheckTarget | func (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error {
if !actor.IsLoggedIn() {
return actionerror.NotLoggedInError{
BinaryName: actor.Config.BinaryName(),
}
}
if targetedOrganizationRequired {
if !actor.IsOrgTargeted() {
return actionerror.NoOrganizationTa... | go | func (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error {
if !actor.IsLoggedIn() {
return actionerror.NotLoggedInError{
BinaryName: actor.Config.BinaryName(),
}
}
if targetedOrganizationRequired {
if !actor.IsOrgTargeted() {
return actionerror.NoOrganizationTa... | [
"func",
"(",
"actor",
"Actor",
")",
"CheckTarget",
"(",
"targetedOrganizationRequired",
"bool",
",",
"targetedSpaceRequired",
"bool",
")",
"error",
"{",
"if",
"!",
"actor",
".",
"IsLoggedIn",
"(",
")",
"{",
"return",
"actionerror",
".",
"NotLoggedInError",
"{",
... | // CheckTarget confirms that the user is logged in. Optionally it will also
// check if an organization and space are targeted. | [
"CheckTarget",
"confirms",
"that",
"the",
"user",
"is",
"logged",
"in",
".",
"Optionally",
"it",
"will",
"also",
"check",
"if",
"an",
"organization",
"and",
"space",
"are",
"targeted",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/check_target.go#L7-L31 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | CreateApplicationTask | func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error) {
bodyBytes, err := json.Marshal(task)
if err != nil {
return Task{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationTasksRequest,
URIParams: internal.Params{
... | go | func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error) {
bodyBytes, err := json.Marshal(task)
if err != nil {
return Task{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationTasksRequest,
URIParams: internal.Params{
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateApplicationTask",
"(",
"appGUID",
"string",
",",
"task",
"Task",
")",
"(",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"bodyBytes",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"task",
")",
"\n",... | // CreateApplicationTask runs a command in the Application environment
// associated with the provided Application GUID. | [
"CreateApplicationTask",
"runs",
"a",
"command",
"in",
"the",
"Application",
"environment",
"associated",
"with",
"the",
"provided",
"Application",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L37-L61 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | GetApplicationTasks | func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationTasksRequest,
URIParams: internal.Params{
"app_guid": appGUID,
},
Query: query,
})
if err != nil {
return nil, n... | go | func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationTasksRequest,
URIParams: internal.Params{
"app_guid": appGUID,
},
Query: query,
})
if err != nil {
return nil, n... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationTasks",
"(",
"appGUID",
"string",
",",
"query",
"...",
"Query",
")",
"(",
"[",
"]",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetApplicationTasks returns a list of tasks associated with the provided
// application GUID. Results can be filtered by providing URL queries. | [
"GetApplicationTasks",
"returns",
"a",
"list",
"of",
"tasks",
"associated",
"with",
"the",
"provided",
"application",
"GUID",
".",
"Results",
"can",
"be",
"filtered",
"by",
"providing",
"URL",
"queries",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L65-L91 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | UpdateTaskCancel | func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutTaskCancelRequest,
URIParams: internal.Params{
"task_guid": taskGUID,
},
})
if err != nil {
return Task{}, nil, err
}
var task Task
response ... | go | func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutTaskCancelRequest,
URIParams: internal.Params{
"task_guid": taskGUID,
},
})
if err != nil {
return Task{}, nil, err
}
var task Task
response ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateTaskCancel",
"(",
"taskGUID",
"string",
")",
"(",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":... | // UpdateTaskCancel cancels a task. | [
"UpdateTaskCancel",
"cancels",
"a",
"task",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L94-L116 | train |
cloudfoundry/cli | actor/v7action/feature_flag.go | GetFeatureFlagByName | func (actor Actor) GetFeatureFlagByName(featureFlagName string) (FeatureFlag, Warnings, error) {
var (
ccv3FeatureFlag ccv3.FeatureFlag
warnings ccv3.Warnings
err error
)
ccv3FeatureFlag, warnings, err = actor.CloudControllerClient.GetFeatureFlag(featureFlagName)
if err != nil {
if _, ok... | go | func (actor Actor) GetFeatureFlagByName(featureFlagName string) (FeatureFlag, Warnings, error) {
var (
ccv3FeatureFlag ccv3.FeatureFlag
warnings ccv3.Warnings
err error
)
ccv3FeatureFlag, warnings, err = actor.CloudControllerClient.GetFeatureFlag(featureFlagName)
if err != nil {
if _, ok... | [
"func",
"(",
"actor",
"Actor",
")",
"GetFeatureFlagByName",
"(",
"featureFlagName",
"string",
")",
"(",
"FeatureFlag",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"(",
"ccv3FeatureFlag",
"ccv3",
".",
"FeatureFlag",
"\n",
"warnings",
"ccv3",
".",
"Warnings"... | // GetFeatureFlagByName returns a featureFlag with the provided name. | [
"GetFeatureFlagByName",
"returns",
"a",
"featureFlag",
"with",
"the",
"provided",
"name",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/feature_flag.go#L12-L28 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | UnmarshalJSON | func (serviceInstance *ServiceInstance) UnmarshalJSON(data []byte) error {
var ccServiceInstance struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
SpaceGUID string `json:"space_guid"`
ServiceGUID string `json:"service_guid"`
Servic... | go | func (serviceInstance *ServiceInstance) UnmarshalJSON(data []byte) error {
var ccServiceInstance struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
SpaceGUID string `json:"space_guid"`
ServiceGUID string `json:"service_guid"`
Servic... | [
"func",
"(",
"serviceInstance",
"*",
"ServiceInstance",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccServiceInstance",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",... | // UnmarshalJSON helps unmarshal a Cloud Controller Service Instance response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Service",
"Instance",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L59-L90 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | CreateServiceInstance | func (client *Client) CreateServiceInstance(spaceGUID, servicePlanGUID, serviceInstance string, parameters map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) {
requestBody := createServiceInstanceRequestBody{
Name: serviceInstance,
ServicePlanGUID: servicePlanGUID,
SpaceGUID: ... | go | func (client *Client) CreateServiceInstance(spaceGUID, servicePlanGUID, serviceInstance string, parameters map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) {
requestBody := createServiceInstanceRequestBody{
Name: serviceInstance,
ServicePlanGUID: servicePlanGUID,
SpaceGUID: ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateServiceInstance",
"(",
"spaceGUID",
",",
"servicePlanGUID",
",",
"serviceInstance",
"string",
",",
"parameters",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"tags",
"[",
"]",
"string",
")",
"(",
... | // CreateServiceInstance posts a service instance resource with the provided
// attributes to the api and returns the result. | [
"CreateServiceInstance",
"posts",
"a",
"service",
"instance",
"resource",
"with",
"the",
"provided",
"attributes",
"to",
"the",
"api",
"and",
"returns",
"the",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L108-L138 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | GetServiceInstance | func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err != nil {
return ServiceIn... | go | func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err != nil {
return ServiceIn... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServiceInstance",
"(",
"serviceInstanceGUID",
"string",
")",
"(",
"ServiceInstance",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{... | // GetServiceInstance returns the service instance with the given GUID. This
// service can be either a managed or user provided. | [
"GetServiceInstance",
"returns",
"the",
"service",
"instance",
"with",
"the",
"given",
"GUID",
".",
"This",
"service",
"can",
"be",
"either",
"a",
"managed",
"or",
"user",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L142-L158 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | GetSpaceServiceInstances | func (client *Client) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, filters ...Filter) ([]ServiceInstance, Warnings, error) {
query := ConvertFilterParameters(filters)
if includeUserProvidedServices {
query.Add("return_user_provided_service_instances", "true")
}
request, err := cl... | go | func (client *Client) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, filters ...Filter) ([]ServiceInstance, Warnings, error) {
query := ConvertFilterParameters(filters)
if includeUserProvidedServices {
query.Add("return_user_provided_service_instances", "true")
}
request, err := cl... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceServiceInstances",
"(",
"spaceGUID",
"string",
",",
"includeUserProvidedServices",
"bool",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"ServiceInstance",
",",
"Warnings",
",",
"error",
")",
"{",
"que... | // GetSpaceServiceInstances returns back a list of Service Instances based off
// of the space and filters provided. User provided services will be included
// if includeUserProvidedServices is set to true. | [
"GetSpaceServiceInstances",
"returns",
"back",
"a",
"list",
"of",
"Service",
"Instances",
"based",
"off",
"of",
"the",
"space",
"and",
"filters",
"provided",
".",
"User",
"provided",
"services",
"will",
"be",
"included",
"if",
"includeUserProvidedServices",
"is",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L190-L220 | train |
cloudfoundry/cli | actor/v2action/service_instance_summary.go | getAndSetSharedInformation | func (actor Actor) getAndSetSharedInformation(summary *ServiceInstanceSummary, spaceGUID string) (Warnings, error) {
var (
warnings Warnings
err error
)
// Part of determining if a service instance is shareable, we need to find
// out if the service_instance_sharing feature flag is enabled
featureFlags, ... | go | func (actor Actor) getAndSetSharedInformation(summary *ServiceInstanceSummary, spaceGUID string) (Warnings, error) {
var (
warnings Warnings
err error
)
// Part of determining if a service instance is shareable, we need to find
// out if the service_instance_sharing feature flag is enabled
featureFlags, ... | [
"func",
"(",
"actor",
"Actor",
")",
"getAndSetSharedInformation",
"(",
"summary",
"*",
"ServiceInstanceSummary",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"var",
"(",
"warnings",
"Warnings",
"\n",
"err",
"error",
"\n",
")",
"\... | // getAndSetSharedInformation gets a service instance's shared from or shared to information, | [
"getAndSetSharedInformation",
"gets",
"a",
"service",
"instance",
"s",
"shared",
"from",
"or",
"shared",
"to",
"information"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_instance_summary.go#L106-L168 | train |
cloudfoundry/cli | actor/v3action/package.go | GetApplicationPackages | func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]Package, Warnings, error) {
app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return nil, allWarnings, err
}
ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3... | go | func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]Package, Warnings, error) {
app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return nil, allWarnings, err
}
ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3... | [
"func",
"(",
"actor",
"*",
"Actor",
")",
"GetApplicationPackages",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
... | // GetApplicationPackages returns a list of package of an app. | [
"GetApplicationPackages",
"returns",
"a",
"list",
"of",
"package",
"of",
"an",
"app",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/package.go#L133-L153 | train |
cloudfoundry/cli | actor/v3action/package.go | PollPackage | func (actor Actor) PollPackage(pkg Package) (Package, Warnings, error) {
var allWarnings Warnings
for pkg.State != constant.PackageReady && pkg.State != constant.PackageFailed && pkg.State != constant.PackageExpired {
time.Sleep(actor.Config.PollingInterval())
ccPkg, warnings, err := actor.CloudControllerClient.... | go | func (actor Actor) PollPackage(pkg Package) (Package, Warnings, error) {
var allWarnings Warnings
for pkg.State != constant.PackageReady && pkg.State != constant.PackageFailed && pkg.State != constant.PackageExpired {
time.Sleep(actor.Config.PollingInterval())
ccPkg, warnings, err := actor.CloudControllerClient.... | [
"func",
"(",
"actor",
"Actor",
")",
"PollPackage",
"(",
"pkg",
"Package",
")",
"(",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n\n",
"for",
"pkg",
".",
"State",
"!=",
"constant",
".",
"PackageReady",
"&&",
"pk... | // PollPackage returns a package of an app. | [
"PollPackage",
"returns",
"a",
"package",
"of",
"an",
"app",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/package.go#L183-L209 | train |
cloudfoundry/cli | integration/helpers/login.go | GetCredentials | func GetCredentials() (string, string) {
username := os.Getenv("CF_INT_USERNAME")
if username == "" {
username = "admin"
}
password := os.Getenv("CF_INT_PASSWORD")
if password == "" {
password = "admin"
}
return username, password
} | go | func GetCredentials() (string, string) {
username := os.Getenv("CF_INT_USERNAME")
if username == "" {
username = "admin"
}
password := os.Getenv("CF_INT_PASSWORD")
if password == "" {
password = "admin"
}
return username, password
} | [
"func",
"GetCredentials",
"(",
")",
"(",
"string",
",",
"string",
")",
"{",
"username",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"username",
"==",
"\"",
"\"",
"{",
"username",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"password",
":=",
... | // GetCredentials returns back the username and the password. | [
"GetCredentials",
"returns",
"back",
"the",
"username",
"and",
"the",
"password",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/login.go#L83-L93 | train |
cloudfoundry/cli | integration/helpers/login.go | SkipIfOIDCCredentialsNotSet | func SkipIfOIDCCredentialsNotSet() (string, string) {
oidcUsername := os.Getenv("CF_INT_OIDC_USERNAME")
oidcPassword := os.Getenv("CF_INT_OIDC_PASSWORD")
if oidcUsername == "" || oidcPassword == "" {
Skip("CF_INT_OIDC_USERNAME or CF_INT_OIDC_PASSWORD is not set")
}
return oidcUsername, oidcPassword
} | go | func SkipIfOIDCCredentialsNotSet() (string, string) {
oidcUsername := os.Getenv("CF_INT_OIDC_USERNAME")
oidcPassword := os.Getenv("CF_INT_OIDC_PASSWORD")
if oidcUsername == "" || oidcPassword == "" {
Skip("CF_INT_OIDC_USERNAME or CF_INT_OIDC_PASSWORD is not set")
}
return oidcUsername, oidcPassword
} | [
"func",
"SkipIfOIDCCredentialsNotSet",
"(",
")",
"(",
"string",
",",
"string",
")",
"{",
"oidcUsername",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"oidcPassword",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"oidcUsername",... | // SkipIfOIDCCredentialsNotSet returns back the username and the password for
// OIDC origin, or skips the test if those values are not set. | [
"SkipIfOIDCCredentialsNotSet",
"returns",
"back",
"the",
"username",
"and",
"the",
"password",
"for",
"OIDC",
"origin",
"or",
"skips",
"the",
"test",
"if",
"those",
"values",
"are",
"not",
"set",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/login.go#L97-L106 | train |
cloudfoundry/cli | actor/pushaction/domain.go | DefaultDomain | func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error) {
log.Infoln("getting org domains for org GUID:", orgGUID)
// the domains object contains all the shared domains AND all domains private to this org
domains, warnings, err := actor.V2Actor.GetOrganizationDomains(orgGUID)
if err != n... | go | func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error) {
log.Infoln("getting org domains for org GUID:", orgGUID)
// the domains object contains all the shared domains AND all domains private to this org
domains, warnings, err := actor.V2Actor.GetOrganizationDomains(orgGUID)
if err != n... | [
"func",
"(",
"actor",
"Actor",
")",
"DefaultDomain",
"(",
"orgGUID",
"string",
")",
"(",
"v2action",
".",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"log",
".",
"Infoln",
"(",
"\"",
"\"",
",",
"orgGUID",
")",
"\n",
"// the domains object contains a... | // DefaultDomain looks up the shared and then private domains and returns back
// the first one in the list as the default. | [
"DefaultDomain",
"looks",
"up",
"the",
"shared",
"and",
"then",
"private",
"domains",
"and",
"returns",
"back",
"the",
"first",
"one",
"in",
"the",
"list",
"as",
"the",
"default",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pushaction/domain.go#L11-L36 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.