id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26,100 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | GetOrganizationDefaultIsolationSegment | func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (Relationship, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationRelationshipDefaultIsolationSegmentRequest,
URIParams: internal.Params{"organization_guid": orgGUID},
})
if e... | go | func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (Relationship, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationRelationshipDefaultIsolationSegmentRequest,
URIParams: internal.Params{"organization_guid": orgGUID},
})
if e... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizationDefaultIsolationSegment",
"(",
"orgGUID",
"string",
")",
"(",
"Relationship",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",... | // GetOrganizationDefaultIsolationSegment returns the relationship between an
// organization and it's default isolation segment. | [
"GetOrganizationDefaultIsolationSegment",
"returns",
"the",
"relationship",
"between",
"an",
"organization",
"and",
"it",
"s",
"default",
"isolation",
"segment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L86-L102 |
26,101 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | GetSpaceIsolationSegment | func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (Relationship, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRelationshipIsolationSegmentRequest,
URIParams: internal.Params{"space_guid": spaceGUID},
})
if err != nil {
return Relationsh... | go | func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (Relationship, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRelationshipIsolationSegmentRequest,
URIParams: internal.Params{"space_guid": spaceGUID},
})
if err != nil {
return Relationsh... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceIsolationSegment",
"(",
"spaceGUID",
"string",
")",
"(",
"Relationship",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"R... | // GetSpaceIsolationSegment returns the relationship between a space and it's
// isolation segment. | [
"GetSpaceIsolationSegment",
"returns",
"the",
"relationship",
"between",
"a",
"space",
"and",
"it",
"s",
"isolation",
"segment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L106-L122 |
26,102 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | SetApplicationDroplet | func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (Relationship, Warnings, error) {
relationship := Relationship{GUID: dropletGUID}
bodyBytes, err := json.Marshal(relationship)
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
... | go | func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (Relationship, Warnings, error) {
relationship := Relationship{GUID: dropletGUID}
bodyBytes, err := json.Marshal(relationship)
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"SetApplicationDroplet",
"(",
"appGUID",
"string",
",",
"dropletGUID",
"string",
")",
"(",
"Relationship",
",",
"Warnings",
",",
"error",
")",
"{",
"relationship",
":=",
"Relationship",
"{",
"GUID",
":",
"dropletGUID"... | // SetApplicationDroplet sets the specified droplet on the given application. | [
"SetApplicationDroplet",
"sets",
"the",
"specified",
"droplet",
"on",
"the",
"given",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L125-L148 |
26,103 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | UpdateOrganizationDefaultIsolationSegmentRelationship | func (client *Client) UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isoSegGUID string) (Relationship, Warnings, error) {
body, err := json.Marshal(Relationship{GUID: isoSegGUID})
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Requ... | go | func (client *Client) UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isoSegGUID string) (Relationship, Warnings, error) {
body, err := json.Marshal(Relationship{GUID: isoSegGUID})
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Requ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateOrganizationDefaultIsolationSegmentRelationship",
"(",
"orgGUID",
"string",
",",
"isoSegGUID",
"string",
")",
"(",
"Relationship",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
... | // UpdateOrganizationDefaultIsolationSegmentRelationship sets the default isolation segment
// for an organization on the controller.
// If isoSegGuid is empty it will reset the default isolation segment. | [
"UpdateOrganizationDefaultIsolationSegmentRelationship",
"sets",
"the",
"default",
"isolation",
"segment",
"for",
"an",
"organization",
"on",
"the",
"controller",
".",
"If",
"isoSegGuid",
"is",
"empty",
"it",
"will",
"reset",
"the",
"default",
"isolation",
"segment",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L153-L174 |
26,104 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | UpdateSpaceIsolationSegmentRelationship | func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error) {
body, err := json.Marshal(Relationship{GUID: isolationSegmentGUID})
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions... | go | func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error) {
body, err := json.Marshal(Relationship{GUID: isolationSegmentGUID})
if err != nil {
return Relationship{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateSpaceIsolationSegmentRelationship",
"(",
"spaceGUID",
"string",
",",
"isolationSegmentGUID",
"string",
")",
"(",
"Relationship",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"... | // UpdateSpaceIsolationSegmentRelationship assigns an isolation segment to a space and
// returns the relationship. | [
"UpdateSpaceIsolationSegmentRelationship",
"assigns",
"an",
"isolation",
"segment",
"to",
"a",
"space",
"and",
"returns",
"the",
"relationship",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L178-L200 |
26,105 | cloudfoundry/cli | cf/terminal/ui_unix.go | echoOn | func echoOn(fd []uintptr) {
// Turn on the terminal echo.
pid, e := syscall.ForkExec(sttyArg0, sttyArgvEOn, &syscall.ProcAttr{Dir: execCWDir, Files: fd})
if e == nil {
_, _ = syscall.Wait4(pid, &ws, 0, nil)
}
} | go | func echoOn(fd []uintptr) {
// Turn on the terminal echo.
pid, e := syscall.ForkExec(sttyArg0, sttyArgvEOn, &syscall.ProcAttr{Dir: execCWDir, Files: fd})
if e == nil {
_, _ = syscall.Wait4(pid, &ws, 0, nil)
}
} | [
"func",
"echoOn",
"(",
"fd",
"[",
"]",
"uintptr",
")",
"{",
"// Turn on the terminal echo.",
"pid",
",",
"e",
":=",
"syscall",
".",
"ForkExec",
"(",
"sttyArg0",
",",
"sttyArgvEOn",
",",
"&",
"syscall",
".",
"ProcAttr",
"{",
"Dir",
":",
"execCWDir",
",",
... | // echoOn turns back on the terminal echo. | [
"echoOn",
"turns",
"back",
"on",
"the",
"terminal",
"echo",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/ui_unix.go#L84-L91 |
26,106 | cloudfoundry/cli | cf/terminal/ui_unix.go | catchSignal | func catchSignal(fd []uintptr, sig chan os.Signal) {
select {
case <-sig:
echoOn(fd)
os.Exit(2)
}
} | go | func catchSignal(fd []uintptr, sig chan os.Signal) {
select {
case <-sig:
echoOn(fd)
os.Exit(2)
}
} | [
"func",
"catchSignal",
"(",
"fd",
"[",
"]",
"uintptr",
",",
"sig",
"chan",
"os",
".",
"Signal",
")",
"{",
"select",
"{",
"case",
"<-",
"sig",
":",
"echoOn",
"(",
"fd",
")",
"\n",
"os",
".",
"Exit",
"(",
"2",
")",
"\n",
"}",
"\n",
"}"
] | // catchSignal tries to catch SIGKILL, SIGQUIT and SIGINT so that we can turn terminal
// echo back on before the program ends. Otherwise the user is left with echo off on
// their terminal. | [
"catchSignal",
"tries",
"to",
"catch",
"SIGKILL",
"SIGQUIT",
"and",
"SIGINT",
"so",
"that",
"we",
"can",
"turn",
"terminal",
"echo",
"back",
"on",
"before",
"the",
"program",
"ends",
".",
"Otherwise",
"the",
"user",
"is",
"left",
"with",
"echo",
"off",
"on... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/ui_unix.go#L96-L102 |
26,107 | cloudfoundry/cli | actor/v3action/task.go | RunTask | func (actor Actor) RunTask(appGUID string, task Task) (Task, Warnings, error) {
createdTask, warnings, err := actor.CloudControllerClient.CreateApplicationTask(appGUID, ccv3.Task(task))
if err != nil {
if e, ok := err.(ccerror.TaskWorkersUnavailableError); ok {
return Task{}, Warnings(warnings), actionerror.Task... | go | func (actor Actor) RunTask(appGUID string, task Task) (Task, Warnings, error) {
createdTask, warnings, err := actor.CloudControllerClient.CreateApplicationTask(appGUID, ccv3.Task(task))
if err != nil {
if e, ok := err.(ccerror.TaskWorkersUnavailableError); ok {
return Task{}, Warnings(warnings), actionerror.Task... | [
"func",
"(",
"actor",
"Actor",
")",
"RunTask",
"(",
"appGUID",
"string",
",",
"task",
"Task",
")",
"(",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"createdTask",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"Create... | // RunTask runs the provided command in the application environment associated
// with the provided application GUID. | [
"RunTask",
"runs",
"the",
"provided",
"command",
"in",
"the",
"application",
"environment",
"associated",
"with",
"the",
"provided",
"application",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/task.go#L18-L27 |
26,108 | cloudfoundry/cli | actor/v3action/task.go | GetApplicationTasks | func (actor Actor) GetApplicationTasks(appGUID string, sortOrder SortOrder) ([]Task, Warnings, error) {
tasks, warnings, err := actor.CloudControllerClient.GetApplicationTasks(appGUID)
actorWarnings := Warnings(warnings)
if err != nil {
return nil, actorWarnings, err
}
allTasks := []Task{}
for _, task := range... | go | func (actor Actor) GetApplicationTasks(appGUID string, sortOrder SortOrder) ([]Task, Warnings, error) {
tasks, warnings, err := actor.CloudControllerClient.GetApplicationTasks(appGUID)
actorWarnings := Warnings(warnings)
if err != nil {
return nil, actorWarnings, err
}
allTasks := []Task{}
for _, task := range... | [
"func",
"(",
"actor",
"Actor",
")",
"GetApplicationTasks",
"(",
"appGUID",
"string",
",",
"sortOrder",
"SortOrder",
")",
"(",
"[",
"]",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"tasks",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudContr... | // GetApplicationTasks returns a list of tasks associated with the provided
// appplication GUID. | [
"GetApplicationTasks",
"returns",
"a",
"list",
"of",
"tasks",
"associated",
"with",
"the",
"provided",
"appplication",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/task.go#L31-L50 |
26,109 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | UnmarshalJSON | func (org *Organization) UnmarshalJSON(data []byte) error {
var ccOrg struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
QuotaDefinitionGUID string `json:"quota_definition_guid"`
DefaultIsolationSegmentGUID string `json:"default... | go | func (org *Organization) UnmarshalJSON(data []byte) error {
var ccOrg struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
QuotaDefinitionGUID string `json:"quota_definition_guid"`
DefaultIsolationSegmentGUID string `json:"default... | [
"func",
"(",
"org",
"*",
"Organization",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccOrg",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Organization response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Organization",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L32-L51 |
26,110 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | GetOrganization | func (client *Client) GetOrganization(guid string) (Organization, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationRequest,
URIParams: Params{"organization_guid": guid},
})
if err != nil {
return Organization{}, nil, err
}
var org Organization
... | go | func (client *Client) GetOrganization(guid string) (Organization, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationRequest,
URIParams: Params{"organization_guid": guid},
})
if err != nil {
return Organization{}, nil, err
}
var org Organization
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganization",
"(",
"guid",
"string",
")",
"(",
"Organization",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
... | // GetOrganization returns an Organization associated with the provided GUID. | [
"GetOrganization",
"returns",
"an",
"Organization",
"associated",
"with",
"the",
"provided",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L113-L129 |
26,111 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | GetOrganizations | func (client *Client) GetOrganizations(filters ...Filter) ([]Organization, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
allQueries.Add("order-by", "name")
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationsRequest,
Query: allQueries,
})
if er... | go | func (client *Client) GetOrganizations(filters ...Filter) ([]Organization, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
allQueries.Add("order-by", "name")
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationsRequest,
Query: allQueries,
})
if er... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizations",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Organization",
",",
"Warnings",
",",
"error",
")",
"{",
"allQueries",
":=",
"ConvertFilterParameters",
"(",
"filters",
")",
"\n",
"allQueries... | // GetOrganizations returns back a list of Organizations based off of the
// provided filters. | [
"GetOrganizations",
"returns",
"back",
"a",
"list",
"of",
"Organizations",
"based",
"off",
"of",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L133-L159 |
26,112 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | UpdateOrganizationManager | func (client *Client) UpdateOrganizationManager(guid string, uaaID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutOrganizationManagerRequest,
URIParams: Params{"organization_guid": guid, "manager_guid": uaaID},
})
if err != nil {
return nil, err
}
... | go | func (client *Client) UpdateOrganizationManager(guid string, uaaID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutOrganizationManagerRequest,
URIParams: Params{"organization_guid": guid, "manager_guid": uaaID},
})
if err != nil {
return nil, err
}
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateOrganizationManager",
"(",
"guid",
"string",
",",
"uaaID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"... | // UpdateOrganizationManager assigns the org manager role to the UAA user or client with the provided ID. | [
"UpdateOrganizationManager",
"assigns",
"the",
"org",
"manager",
"role",
"to",
"the",
"UAA",
"user",
"or",
"client",
"with",
"the",
"provided",
"ID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L166-L179 |
26,113 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | UpdateOrganizationManagerByUsername | func (client *Client) UpdateOrganizationManagerByUsername(guid string, username string) (Warnings, error) {
requestBody := updateOrgManagerByUsernameRequestBody{
Username: username,
}
body, err := json.Marshal(requestBody)
if err != nil {
return nil, err
}
request, err := client.newHTTPRequest(requestOption... | go | func (client *Client) UpdateOrganizationManagerByUsername(guid string, username string) (Warnings, error) {
requestBody := updateOrgManagerByUsernameRequestBody{
Username: username,
}
body, err := json.Marshal(requestBody)
if err != nil {
return nil, err
}
request, err := client.newHTTPRequest(requestOption... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateOrganizationManagerByUsername",
"(",
"guid",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"requestBody",
":=",
"updateOrgManagerByUsernameRequestBody",
"{",
"Username",
":",
"u... | // UpdateOrganizationManagerByUsername assigns the org manager role to the user with the provided name. | [
"UpdateOrganizationManagerByUsername",
"assigns",
"the",
"org",
"manager",
"role",
"to",
"the",
"user",
"with",
"the",
"provided",
"name",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L182-L205 |
26,114 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization.go | UpdateOrganizationUserByUsername | func (client Client) UpdateOrganizationUserByUsername(orgGUID string, username string) (Warnings, error) {
requestBody := updateOrgUserByUsernameRequestBody{
Username: username,
}
body, err := json.Marshal(requestBody)
if err != nil {
return Warnings{}, err
}
request, err := client.newHTTPRequest(requestOpt... | go | func (client Client) UpdateOrganizationUserByUsername(orgGUID string, username string) (Warnings, error) {
requestBody := updateOrgUserByUsernameRequestBody{
Username: username,
}
body, err := json.Marshal(requestBody)
if err != nil {
return Warnings{}, err
}
request, err := client.newHTTPRequest(requestOpt... | [
"func",
"(",
"client",
"Client",
")",
"UpdateOrganizationUserByUsername",
"(",
"orgGUID",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"requestBody",
":=",
"updateOrgUserByUsernameRequestBody",
"{",
"Username",
":",
"username",
... | // UpdateOrganizationUserByUsername makes the user with the given username a member of
// the org. | [
"UpdateOrganizationUserByUsername",
"makes",
"the",
"user",
"with",
"the",
"given",
"username",
"a",
"member",
"of",
"the",
"org",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization.go#L230-L253 |
26,115 | cloudfoundry/cli | api/cloudcontroller/ccv3/query.go | FormatQueryParameters | func FormatQueryParameters(queries []Query) url.Values {
params := url.Values{}
for _, query := range queries {
params.Add(string(query.Key), strings.Join(query.Values, ","))
}
return params
} | go | func FormatQueryParameters(queries []Query) url.Values {
params := url.Values{}
for _, query := range queries {
params.Add(string(query.Key), strings.Join(query.Values, ","))
}
return params
} | [
"func",
"FormatQueryParameters",
"(",
"queries",
"[",
"]",
"Query",
")",
"url",
".",
"Values",
"{",
"params",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"for",
"_",
",",
"query",
":=",
"range",
"queries",
"{",
"params",
".",
"Add",
"(",
"string",
"(... | // FormatQueryParameters converts a Query object into a collection that
// cloudcontroller.Request can accept. | [
"FormatQueryParameters",
"converts",
"a",
"Query",
"object",
"into",
"a",
"collection",
"that",
"cloudcontroller",
".",
"Request",
"can",
"accept",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/query.go#L52-L59 |
26,116 | cloudfoundry/cli | api/uaa/noaabridge/token_refresher.go | NewTokenRefresher | func NewTokenRefresher(uaaClient UAAClient, cache TokenCache) *TokenRefresher {
return &TokenRefresher{
uaaClient: uaaClient,
cache: cache,
}
} | go | func NewTokenRefresher(uaaClient UAAClient, cache TokenCache) *TokenRefresher {
return &TokenRefresher{
uaaClient: uaaClient,
cache: cache,
}
} | [
"func",
"NewTokenRefresher",
"(",
"uaaClient",
"UAAClient",
",",
"cache",
"TokenCache",
")",
"*",
"TokenRefresher",
"{",
"return",
"&",
"TokenRefresher",
"{",
"uaaClient",
":",
"uaaClient",
",",
"cache",
":",
"cache",
",",
"}",
"\n",
"}"
] | // NewTokenRefresher returns back a pointer to a TokenRefresher. | [
"NewTokenRefresher",
"returns",
"back",
"a",
"pointer",
"to",
"a",
"TokenRefresher",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/noaabridge/token_refresher.go#L31-L36 |
26,117 | cloudfoundry/cli | api/uaa/noaabridge/token_refresher.go | RefreshAuthToken | func (t *TokenRefresher) RefreshAuthToken() (string, error) {
tokens, err := t.uaaClient.RefreshAccessToken(t.cache.RefreshToken())
if err != nil {
return "", err
}
t.cache.SetAccessToken(tokens.AuthorizationToken())
t.cache.SetRefreshToken(tokens.RefreshToken)
return tokens.AuthorizationToken(), nil
} | go | func (t *TokenRefresher) RefreshAuthToken() (string, error) {
tokens, err := t.uaaClient.RefreshAccessToken(t.cache.RefreshToken())
if err != nil {
return "", err
}
t.cache.SetAccessToken(tokens.AuthorizationToken())
t.cache.SetRefreshToken(tokens.RefreshToken)
return tokens.AuthorizationToken(), nil
} | [
"func",
"(",
"t",
"*",
"TokenRefresher",
")",
"RefreshAuthToken",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"tokens",
",",
"err",
":=",
"t",
".",
"uaaClient",
".",
"RefreshAccessToken",
"(",
"t",
".",
"cache",
".",
"RefreshToken",
"(",
")",
")",... | // RefreshAuthToken refreshes the current Authorization Token and stores the
// Access and Refresh token in it's cache. The returned Authorization Token
// includes the type prefixed by a space. | [
"RefreshAuthToken",
"refreshes",
"the",
"current",
"Authorization",
"Token",
"and",
"stores",
"the",
"Access",
"and",
"Refresh",
"token",
"in",
"it",
"s",
"cache",
".",
"The",
"returned",
"Authorization",
"Token",
"includes",
"the",
"type",
"prefixed",
"by",
"a"... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/noaabridge/token_refresher.go#L41-L50 |
26,118 | cloudfoundry/cli | api/cloudcontroller/pipebomb.go | Seek | func (*Pipebomb) Seek(offset int64, whence int) (int64, error) {
return 0, ccerror.PipeSeekError{}
} | go | func (*Pipebomb) Seek(offset int64, whence int) (int64, error) {
return 0, ccerror.PipeSeekError{}
} | [
"func",
"(",
"*",
"Pipebomb",
")",
"Seek",
"(",
"offset",
"int64",
",",
"whence",
"int",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"0",
",",
"ccerror",
".",
"PipeSeekError",
"{",
"}",
"\n",
"}"
] | // Seek returns a PipeSeekError; allowing the top level calling function to
// handle the retry instead of seeking back to the beginning of the Reader. | [
"Seek",
"returns",
"a",
"PipeSeekError",
";",
"allowing",
"the",
"top",
"level",
"calling",
"function",
"to",
"handle",
"the",
"retry",
"instead",
"of",
"seeking",
"back",
"to",
"the",
"beginning",
"of",
"the",
"Reader",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/pipebomb.go#L18-L20 |
26,119 | cloudfoundry/cli | api/cloudcontroller/pipebomb.go | NewPipeBomb | func NewPipeBomb() (*Pipebomb, io.WriteCloser) {
writerOutput, writerInput := io.Pipe()
return &Pipebomb{ReadCloser: writerOutput}, writerInput
} | go | func NewPipeBomb() (*Pipebomb, io.WriteCloser) {
writerOutput, writerInput := io.Pipe()
return &Pipebomb{ReadCloser: writerOutput}, writerInput
} | [
"func",
"NewPipeBomb",
"(",
")",
"(",
"*",
"Pipebomb",
",",
"io",
".",
"WriteCloser",
")",
"{",
"writerOutput",
",",
"writerInput",
":=",
"io",
".",
"Pipe",
"(",
")",
"\n",
"return",
"&",
"Pipebomb",
"{",
"ReadCloser",
":",
"writerOutput",
"}",
",",
"w... | // NewPipeBomb returns an io.WriteCloser that can be used to stream data to a
// the Pipebomb. | [
"NewPipeBomb",
"returns",
"an",
"io",
".",
"WriteCloser",
"that",
"can",
"be",
"used",
"to",
"stream",
"data",
"to",
"a",
"the",
"Pipebomb",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/pipebomb.go#L24-L27 |
26,120 | cloudfoundry/cli | actor/v2action/service_binding.go | BindServiceByApplicationAndServiceInstance | func (actor Actor) BindServiceByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.CreateServiceBinding(appGUID, serviceInstanceGUID, "", false, nil)
return Warnings(warnings), err
} | go | func (actor Actor) BindServiceByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.CreateServiceBinding(appGUID, serviceInstanceGUID, "", false, nil)
return Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"BindServiceByApplicationAndServiceInstance",
"(",
"appGUID",
"string",
",",
"serviceInstanceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudController... | // BindServiceByApplicationAndServiceInstance binds the service instance to an application. | [
"BindServiceByApplicationAndServiceInstance",
"binds",
"the",
"service",
"instance",
"to",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_binding.go#L18-L22 |
26,121 | cloudfoundry/cli | actor/v2action/service_binding.go | BindServiceBySpace | func (actor Actor) BindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string, bindingName string, parameters map[string]interface{}) (ServiceBinding, Warnings, error) {
var allWarnings Warnings
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(all... | go | func (actor Actor) BindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string, bindingName string, parameters map[string]interface{}) (ServiceBinding, Warnings, error) {
var allWarnings Warnings
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(all... | [
"func",
"(",
"actor",
"Actor",
")",
"BindServiceBySpace",
"(",
"appName",
"string",
",",
"serviceInstanceName",
"string",
",",
"spaceGUID",
"string",
",",
"bindingName",
"string",
",",
"parameters",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
... | // BindServiceBySpace binds the service instance to an application for a given space. | [
"BindServiceBySpace",
"binds",
"the",
"service",
"instance",
"to",
"an",
"application",
"for",
"a",
"given",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_binding.go#L25-L43 |
26,122 | cloudfoundry/cli | actor/v2action/service_binding.go | GetServiceBindingByApplicationAndServiceInstance | func (actor Actor) GetServiceBindingByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (ServiceBinding, Warnings, error) {
serviceBindings, warnings, err := actor.CloudControllerClient.GetServiceBindings(
ccv2.Filter{
Type: constant.AppGUIDFilter,
Operator: constant.EqualOperator,
... | go | func (actor Actor) GetServiceBindingByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (ServiceBinding, Warnings, error) {
serviceBindings, warnings, err := actor.CloudControllerClient.GetServiceBindings(
ccv2.Filter{
Type: constant.AppGUIDFilter,
Operator: constant.EqualOperator,
... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServiceBindingByApplicationAndServiceInstance",
"(",
"appGUID",
"string",
",",
"serviceInstanceGUID",
"string",
")",
"(",
"ServiceBinding",
",",
"Warnings",
",",
"error",
")",
"{",
"serviceBindings",
",",
"warnings",
",",
"err... | // GetServiceBindingByApplicationAndServiceInstance returns a service binding
// given an application GUID and and service instance GUID. | [
"GetServiceBindingByApplicationAndServiceInstance",
"returns",
"a",
"service",
"binding",
"given",
"an",
"application",
"GUID",
"and",
"and",
"service",
"instance",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_binding.go#L47-L73 |
26,123 | cloudfoundry/cli | actor/v2action/service_binding.go | UnbindServiceBySpace | func (actor Actor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (ServiceBinding, Warnings, error) {
var allWarnings Warnings
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return Ser... | go | func (actor Actor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (ServiceBinding, Warnings, error) {
var allWarnings Warnings
app, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return Ser... | [
"func",
"(",
"actor",
"Actor",
")",
"UnbindServiceBySpace",
"(",
"appName",
"string",
",",
"serviceInstanceName",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"ServiceBinding",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n\n",... | // UnbindServiceBySpace deletes the service binding between an application and
// service instance for a given space. | [
"UnbindServiceBySpace",
"deletes",
"the",
"service",
"binding",
"between",
"an",
"application",
"and",
"service",
"instance",
"for",
"a",
"given",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_binding.go#L77-L102 |
26,124 | cloudfoundry/cli | integration/helpers/sha.go | Sha1Sum | func Sha1Sum(path string) string {
f, err := os.Open(path)
Expect(err).ToNot(HaveOccurred())
defer f.Close()
hash := sha1.New()
_, err = io.Copy(hash, f)
Expect(err).ToNot(HaveOccurred())
return fmt.Sprintf("%x", hash.Sum(nil))
} | go | func Sha1Sum(path string) string {
f, err := os.Open(path)
Expect(err).ToNot(HaveOccurred())
defer f.Close()
hash := sha1.New()
_, err = io.Copy(hash, f)
Expect(err).ToNot(HaveOccurred())
return fmt.Sprintf("%x", hash.Sum(nil))
} | [
"func",
"Sha1Sum",
"(",
"path",
"string",
")",
"string",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"path",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ToNot",
"(",
"HaveOccurred",
"(",
")",
")",
"\n",
"defer",
"f",
".",
"Close",
"(",
... | // Sha1Sum calculates the SHA1 sum of a file. | [
"Sha1Sum",
"calculates",
"the",
"SHA1",
"sum",
"of",
"a",
"file",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/sha.go#L13-L23 |
26,125 | cloudfoundry/cli | command/v6/push_command.go | GetCommandLineSettings | func (cmd PushCommand) GetCommandLineSettings() (pushaction.CommandLineSettings, error) {
err := cmd.validateArgs()
if err != nil {
return pushaction.CommandLineSettings{}, err
}
pwd, err := os.Getwd()
if err != nil {
return pushaction.CommandLineSettings{}, err
}
dockerPassword := cmd.Config.DockerPasswor... | go | func (cmd PushCommand) GetCommandLineSettings() (pushaction.CommandLineSettings, error) {
err := cmd.validateArgs()
if err != nil {
return pushaction.CommandLineSettings{}, err
}
pwd, err := os.Getwd()
if err != nil {
return pushaction.CommandLineSettings{}, err
}
dockerPassword := cmd.Config.DockerPasswor... | [
"func",
"(",
"cmd",
"PushCommand",
")",
"GetCommandLineSettings",
"(",
")",
"(",
"pushaction",
".",
"CommandLineSettings",
",",
"error",
")",
"{",
"err",
":=",
"cmd",
".",
"validateArgs",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"pushaction... | // GetCommandLineSettings generates a push CommandLineSettings object from the
// command's command line flags. It also validates those settings, preventing
// contradictory flags. | [
"GetCommandLineSettings",
"generates",
"a",
"push",
"CommandLineSettings",
"object",
"from",
"the",
"command",
"s",
"command",
"line",
"flags",
".",
"It",
"also",
"validates",
"those",
"settings",
"preventing",
"contradictory",
"flags",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/push_command.go#L227-L275 |
26,126 | cloudfoundry/cli | command/v6/shared/noaa_client.go | NewNOAAClient | func NewNOAAClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) *consumer.Consumer {
client := consumer.New(
apiURL,
&tls.Config{
InsecureSkipVerify: config.SkipSSLValidation(),
},
http.ProxyFromEnvironment,
)
client.RefreshTokenFrom(noaabridge.NewTokenRefresher(uaaClient, c... | go | func NewNOAAClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) *consumer.Consumer {
client := consumer.New(
apiURL,
&tls.Config{
InsecureSkipVerify: config.SkipSSLValidation(),
},
http.ProxyFromEnvironment,
)
client.RefreshTokenFrom(noaabridge.NewTokenRefresher(uaaClient, c... | [
"func",
"NewNOAAClient",
"(",
"apiURL",
"string",
",",
"config",
"command",
".",
"Config",
",",
"uaaClient",
"*",
"uaa",
".",
"Client",
",",
"ui",
"command",
".",
"UI",
")",
"*",
"consumer",
".",
"Consumer",
"{",
"client",
":=",
"consumer",
".",
"New",
... | // NewNOAAClient returns back a configured NOAA Client. | [
"NewNOAAClient",
"returns",
"back",
"a",
"configured",
"NOAA",
"Client",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/noaa_client.go#L41-L67 |
26,127 | cloudfoundry/cli | api/uaa/error_converter.go | Wrap | func (e *errorWrapper) Wrap(innerconnection Connection) Connection {
e.connection = innerconnection
return e
} | go | func (e *errorWrapper) Wrap(innerconnection Connection) Connection {
e.connection = innerconnection
return e
} | [
"func",
"(",
"e",
"*",
"errorWrapper",
")",
"Wrap",
"(",
"innerconnection",
"Connection",
")",
"Connection",
"{",
"e",
".",
"connection",
"=",
"innerconnection",
"\n",
"return",
"e",
"\n",
"}"
] | // Wrap wraps a UAA connection in this error handling wrapper. | [
"Wrap",
"wraps",
"a",
"UAA",
"connection",
"in",
"this",
"error",
"handling",
"wrapper",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/error_converter.go#L32-L35 |
26,128 | cloudfoundry/cli | integration/helpers/reporters.go | WriteFailureSummary | func WriteFailureSummary(outputRoot, filename string) {
outfile, err := os.Create(filepath.Join(outputRoot, filename))
failureSummaries := make([]string, 0)
if err != nil {
panic(err)
}
err = filepath.Walk(outputRoot, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
i... | go | func WriteFailureSummary(outputRoot, filename string) {
outfile, err := os.Create(filepath.Join(outputRoot, filename))
failureSummaries := make([]string, 0)
if err != nil {
panic(err)
}
err = filepath.Walk(outputRoot, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
i... | [
"func",
"WriteFailureSummary",
"(",
"outputRoot",
",",
"filename",
"string",
")",
"{",
"outfile",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"filepath",
".",
"Join",
"(",
"outputRoot",
",",
"filename",
")",
")",
"\n",
"failureSummaries",
":=",
"make",
"("... | // WriteFailureSummary aggregates test failures from all parallel nodes, sorts
// them, and writes the result to a file. | [
"WriteFailureSummary",
"aggregates",
"test",
"failures",
"from",
"all",
"parallel",
"nodes",
"sorts",
"them",
"and",
"writes",
"the",
"result",
"to",
"a",
"file",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/reporters.go#L61-L107 |
26,129 | cloudfoundry/cli | cf/terminal/ui.go | Print | func (u *UITable) Print() error {
result := &bytes.Buffer{}
t := u.Table
err := t.PrintTo(result)
if err != nil {
return err
}
// DevNote. With the change to printing into a buffer all
// lines now come with a terminating \n. The t.ui.Say() below
// will then add another \n to that. To avoid this additional... | go | func (u *UITable) Print() error {
result := &bytes.Buffer{}
t := u.Table
err := t.PrintTo(result)
if err != nil {
return err
}
// DevNote. With the change to printing into a buffer all
// lines now come with a terminating \n. The t.ui.Say() below
// will then add another \n to that. To avoid this additional... | [
"func",
"(",
"u",
"*",
"UITable",
")",
"Print",
"(",
")",
"error",
"{",
"result",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"t",
":=",
"u",
".",
"Table",
"\n\n",
"err",
":=",
"t",
".",
"PrintTo",
"(",
"result",
")",
"\n",
"if",
"err",
... | // Print formats the table and then prints it to the UI specified at
// the time of the construction. Afterwards the table is cleared,
// becoming ready for another round of rows and printing. | [
"Print",
"formats",
"the",
"table",
"and",
"then",
"prints",
"it",
"to",
"the",
"UI",
"specified",
"at",
"the",
"time",
"of",
"the",
"construction",
".",
"Afterwards",
"the",
"table",
"is",
"cleared",
"becoming",
"ready",
"for",
"another",
"round",
"of",
"... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/ui.go#L272-L300 |
26,130 | cloudfoundry/cli | actor/v2action/stack.go | GetStack | func (actor Actor) GetStack(guid string) (Stack, Warnings, error) {
stack, warnings, err := actor.CloudControllerClient.GetStack(guid)
if _, ok := err.(ccerror.ResourceNotFoundError); ok {
return Stack{}, Warnings(warnings), actionerror.StackNotFoundError{GUID: guid}
}
return Stack(stack), Warnings(warnings), e... | go | func (actor Actor) GetStack(guid string) (Stack, Warnings, error) {
stack, warnings, err := actor.CloudControllerClient.GetStack(guid)
if _, ok := err.(ccerror.ResourceNotFoundError); ok {
return Stack{}, Warnings(warnings), actionerror.StackNotFoundError{GUID: guid}
}
return Stack(stack), Warnings(warnings), e... | [
"func",
"(",
"actor",
"Actor",
")",
"GetStack",
"(",
"guid",
"string",
")",
"(",
"Stack",
",",
"Warnings",
",",
"error",
")",
"{",
"stack",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetStack",
"(",
"guid",
")",
"\n... | // GetStack returns the stack information associated with the provided stack GUID. | [
"GetStack",
"returns",
"the",
"stack",
"information",
"associated",
"with",
"the",
"provided",
"stack",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/stack.go#L13-L21 |
26,131 | cloudfoundry/cli | actor/v2action/stack.go | GetStackByName | func (actor Actor) GetStackByName(stackName string) (Stack, Warnings, error) {
stacks, warnings, err := actor.CloudControllerClient.GetStacks(ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{stackName},
})
if err != nil {
return Stack{}, Warnings(warnings), err... | go | func (actor Actor) GetStackByName(stackName string) (Stack, Warnings, error) {
stacks, warnings, err := actor.CloudControllerClient.GetStacks(ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{stackName},
})
if err != nil {
return Stack{}, Warnings(warnings), err... | [
"func",
"(",
"actor",
"Actor",
")",
"GetStackByName",
"(",
"stackName",
"string",
")",
"(",
"Stack",
",",
"Warnings",
",",
"error",
")",
"{",
"stacks",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetStacks",
"(",
"ccv2",... | // GetStackByName returns the provided stack | [
"GetStackByName",
"returns",
"the",
"provided",
"stack"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/stack.go#L24-L39 |
26,132 | cloudfoundry/cli | api/cloudcontroller/ccv2/job.go | UnmarshalJSON | func (job *Job) UnmarshalJSON(data []byte) error {
var ccJob struct {
Entity struct {
Error string `json:"error"`
ErrorDetails struct {
Description string `json:"description"`
} `json:"error_details"`
GUID string `json:"guid"`
Status string `json:"status"`
} `json:"entity"`
Metadata i... | go | func (job *Job) UnmarshalJSON(data []byte) error {
var ccJob struct {
Entity struct {
Error string `json:"error"`
ErrorDetails struct {
Description string `json:"description"`
} `json:"error_details"`
GUID string `json:"guid"`
Status string `json:"status"`
} `json:"entity"`
Metadata i... | [
"func",
"(",
"job",
"*",
"Job",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccJob",
"struct",
"{",
"Entity",
"struct",
"{",
"Error",
"string",
"`json:\"error\"`",
"\n",
"ErrorDetails",
"struct",
"{",
"Description",
"stri... | // UnmarshalJSON helps unmarshal a Cloud Controller Job response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Job",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/job.go#L54-L76 |
26,133 | cloudfoundry/cli | api/cloudcontroller/ccv2/job.go | UploadDroplet | func (client *Client) UploadDroplet(appGUID string, droplet io.Reader, dropletLength int64) (Job, Warnings, error) {
contentLength, err := client.calculateDropletRequestSize(dropletLength)
if err != nil {
return Job{}, nil, err
}
contentType, body, writeErrors := client.createMultipartBodyAndHeaderForDroplet(dro... | go | func (client *Client) UploadDroplet(appGUID string, droplet io.Reader, dropletLength int64) (Job, Warnings, error) {
contentLength, err := client.calculateDropletRequestSize(dropletLength)
if err != nil {
return Job{}, nil, err
}
contentType, body, writeErrors := client.createMultipartBodyAndHeaderForDroplet(dro... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UploadDroplet",
"(",
"appGUID",
"string",
",",
"droplet",
"io",
".",
"Reader",
",",
"dropletLength",
"int64",
")",
"(",
"Job",
",",
"Warnings",
",",
"error",
")",
"{",
"contentLength",
",",
"err",
":=",
"client... | // UploadDroplet defines and uploads a previously staged droplet that an
// application will run, using a multipart PUT request. The uploaded file
// should be a gzipped tar file. | [
"UploadDroplet",
"defines",
"and",
"uploads",
"a",
"previously",
"staged",
"droplet",
"that",
"an",
"application",
"will",
"run",
"using",
"a",
"multipart",
"PUT",
"request",
".",
"The",
"uploaded",
"file",
"should",
"be",
"a",
"gzipped",
"tar",
"file",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/job.go#L209-L230 |
26,134 | cloudfoundry/cli | api/cloudcontroller/ccv3/process_instance.go | UnmarshalJSON | func (instance *ProcessInstance) UnmarshalJSON(data []byte) error {
var inputInstance struct {
Details string `json:"details"`
DiskQuota uint64 `json:"disk_quota"`
Index int64 `json:"index"`
IsolationSegment string `json:"isolation_segment"`
MemQuota uint64 `json:"mem_quot... | go | func (instance *ProcessInstance) UnmarshalJSON(data []byte) error {
var inputInstance struct {
Details string `json:"details"`
DiskQuota uint64 `json:"disk_quota"`
Index int64 `json:"index"`
IsolationSegment string `json:"isolation_segment"`
MemQuota uint64 `json:"mem_quot... | [
"func",
"(",
"instance",
"*",
"ProcessInstance",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"inputInstance",
"struct",
"{",
"Details",
"string",
"`json:\"details\"`",
"\n",
"DiskQuota",
"uint64",
"`json:\"disk_quota\"`",
"\n",
... | // UnmarshalJSON helps unmarshal a V3 Cloud Controller Instance response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"V3",
"Cloud",
"Controller",
"Instance",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process_instance.go#L44-L82 |
26,135 | cloudfoundry/cli | api/cloudcontroller/ccv3/process_instance.go | GetProcessInstances | func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetProcessStatsRequest,
URIParams: map[string]string{"process_guid": processGUID},
})
if err != nil {
return nil, nil, err
}
var ... | go | func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetProcessStatsRequest,
URIParams: map[string]string{"process_guid": processGUID},
})
if err != nil {
return nil, nil, err
}
var ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetProcessInstances",
"(",
"processGUID",
"string",
")",
"(",
"[",
"]",
"ProcessInstance",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions... | // GetProcessInstances lists instance stats for a given process. | [
"GetProcessInstances",
"lists",
"instance",
"stats",
"for",
"a",
"given",
"process",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process_instance.go#L106-L129 |
26,136 | cloudfoundry/cli | actor/v3action/application.go | GetApplicationsByGUIDs | func (actor Actor) GetApplicationsByGUIDs(appGUIDs ...string) ([]Application, Warnings, error) {
ccApps, warnings, err := actor.CloudControllerClient.GetApplications(
ccv3.Query{Key: ccv3.GUIDFilter, Values: appGUIDs},
)
if err != nil {
return []Application{}, Warnings(warnings), err
}
var apps []Application... | go | func (actor Actor) GetApplicationsByGUIDs(appGUIDs ...string) ([]Application, Warnings, error) {
ccApps, warnings, err := actor.CloudControllerClient.GetApplications(
ccv3.Query{Key: ccv3.GUIDFilter, Values: appGUIDs},
)
if err != nil {
return []Application{}, Warnings(warnings), err
}
var apps []Application... | [
"func",
"(",
"actor",
"Actor",
")",
"GetApplicationsByGUIDs",
"(",
"appGUIDs",
"...",
"string",
")",
"(",
"[",
"]",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"ccApps",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
... | // GetApplicationsByGUIDs returns all applications with the provided GUIDs. | [
"GetApplicationsByGUIDs",
"returns",
"all",
"applications",
"with",
"the",
"provided",
"GUIDs",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/application.go#L87-L101 |
26,137 | cloudfoundry/cli | actor/v3action/application.go | RestartApplication | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
return Warnings(warnings), err
} | go | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
return Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"RestartApplication",
"(",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateApplicationRestart",
"(",
"appGUID",
... | // RestartApplication restarts an application. | [
"RestartApplication",
"restarts",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/application.go#L145-L149 |
26,138 | cloudfoundry/cli | actor/v3action/application.go | UpdateApplication | func (actor Actor) UpdateApplication(app Application) (Application, Warnings, error) {
ccApp := ccv3.Application{
GUID: app.GUID,
StackName: app.StackName,
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
}
updatedApp, warnings, err := actor.Clou... | go | func (actor Actor) UpdateApplication(app Application) (Application, Warnings, error) {
ccApp := ccv3.Application{
GUID: app.GUID,
StackName: app.StackName,
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
}
updatedApp, warnings, err := actor.Clou... | [
"func",
"(",
"actor",
"Actor",
")",
"UpdateApplication",
"(",
"app",
"Application",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"ccApp",
":=",
"ccv3",
".",
"Application",
"{",
"GUID",
":",
"app",
".",
"GUID",
",",
"StackName",
":",
... | // UpdateApplication updates the buildpacks on an application | [
"UpdateApplication",
"updates",
"the",
"buildpacks",
"on",
"an",
"application"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/application.go#L182-L196 |
26,139 | cloudfoundry/cli | api/router/wrapper/uaa_authentication.go | NewUAAAuthentication | func NewUAAAuthentication(client UAAClient, cache TokenCache) *UAAAuthentication {
return &UAAAuthentication{
client: client,
cache: cache,
}
} | go | func NewUAAAuthentication(client UAAClient, cache TokenCache) *UAAAuthentication {
return &UAAAuthentication{
client: client,
cache: cache,
}
} | [
"func",
"NewUAAAuthentication",
"(",
"client",
"UAAClient",
",",
"cache",
"TokenCache",
")",
"*",
"UAAAuthentication",
"{",
"return",
"&",
"UAAAuthentication",
"{",
"client",
":",
"client",
",",
"cache",
":",
"cache",
",",
"}",
"\n",
"}"
] | // NewUAAAuthentication returns a pointer to a UAAAuthentication wrapper with
// the client and a token cache. | [
"NewUAAAuthentication",
"returns",
"a",
"pointer",
"to",
"a",
"UAAAuthentication",
"wrapper",
"with",
"the",
"client",
"and",
"a",
"token",
"cache",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/router/wrapper/uaa_authentication.go#L36-L41 |
26,140 | cloudfoundry/cli | util/configv3/write_config.go | WriteConfig | func WriteConfig(c *Config) error {
rawConfig, err := json.MarshalIndent(c.ConfigFile, "", " ")
if err != nil {
return err
}
dir := configDirectory()
err = os.MkdirAll(dir, 0700)
if err != nil {
return err
}
// Developer Note: The following is untested! Change at your own risk.
// Setup notifications of... | go | func WriteConfig(c *Config) error {
rawConfig, err := json.MarshalIndent(c.ConfigFile, "", " ")
if err != nil {
return err
}
dir := configDirectory()
err = os.MkdirAll(dir, 0700)
if err != nil {
return err
}
// Developer Note: The following is untested! Change at your own risk.
// Setup notifications of... | [
"func",
"WriteConfig",
"(",
"c",
"*",
"Config",
")",
"error",
"{",
"rawConfig",
",",
"err",
":=",
"json",
".",
"MarshalIndent",
"(",
"c",
".",
"ConfigFile",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err"... | // WriteConfig creates the .cf directory and then writes the config.json. The
// location of .cf directory is written in the same way LoadConfig reads .cf
// directory. | [
"WriteConfig",
"creates",
"the",
".",
"cf",
"directory",
"and",
"then",
"writes",
"the",
"config",
".",
"json",
".",
"The",
"location",
"of",
".",
"cf",
"directory",
"is",
"written",
"in",
"the",
"same",
"way",
"LoadConfig",
"reads",
".",
"cf",
"directory"... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/write_config.go#L14-L48 |
26,141 | cloudfoundry/cli | actor/v3action/space.go | ResetSpaceIsolationSegment | func (actor Actor) ResetSpaceIsolationSegment(orgGUID string, spaceGUID string) (string, Warnings, error) {
var allWarnings Warnings
_, apiWarnings, err := actor.CloudControllerClient.UpdateSpaceIsolationSegmentRelationship(spaceGUID, "")
allWarnings = append(allWarnings, apiWarnings...)
if err != nil {
return "... | go | func (actor Actor) ResetSpaceIsolationSegment(orgGUID string, spaceGUID string) (string, Warnings, error) {
var allWarnings Warnings
_, apiWarnings, err := actor.CloudControllerClient.UpdateSpaceIsolationSegmentRelationship(spaceGUID, "")
allWarnings = append(allWarnings, apiWarnings...)
if err != nil {
return "... | [
"func",
"(",
"actor",
"Actor",
")",
"ResetSpaceIsolationSegment",
"(",
"orgGUID",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"string",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n\n",
"_",
",",
"apiWarnings",
",",
"err"... | // ResetSpaceIsolationSegment disassociates a space from an isolation segment.
//
// If the space's organization has a default isolation segment, return its
// name. Otherwise return the empty string. | [
"ResetSpaceIsolationSegment",
"disassociates",
"a",
"space",
"from",
"an",
"isolation",
"segment",
".",
"If",
"the",
"space",
"s",
"organization",
"has",
"a",
"default",
"isolation",
"segment",
"return",
"its",
"name",
".",
"Otherwise",
"return",
"the",
"empty",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/space.go#L21-L47 |
26,142 | cloudfoundry/cli | command/v6/shared/new_v3_based_clients.go | NewV3BasedClients | func NewV3BasedClients(config command.Config, ui command.UI, targetCF bool, minVersionV3 string) (*ccv3.Client, *uaa.Client, error) {
ccWrappers := []ccv3.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDispl... | go | func NewV3BasedClients(config command.Config, ui command.UI, targetCF bool, minVersionV3 string) (*ccv3.Client, *uaa.Client, error) {
ccWrappers := []ccv3.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDispl... | [
"func",
"NewV3BasedClients",
"(",
"config",
"command",
".",
"Config",
",",
"ui",
"command",
".",
"UI",
",",
"targetCF",
"bool",
",",
"minVersionV3",
"string",
")",
"(",
"*",
"ccv3",
".",
"Client",
",",
"*",
"uaa",
".",
"Client",
",",
"error",
")",
"{",... | // NewV3BasedClients creates a new V3 Cloud Controller client and UAA client using the
// passed in config. | [
"NewV3BasedClients",
"creates",
"a",
"new",
"V3",
"Cloud",
"Controller",
"client",
"and",
"UAA",
"client",
"using",
"the",
"passed",
"in",
"config",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/new_v3_based_clients.go#L14-L93 |
26,143 | cloudfoundry/cli | actor/v2action/service_broker.go | CreateServiceBroker | func (actor Actor) CreateServiceBroker(serviceBrokerName, username, password, brokerURI, spaceGUID string) (ServiceBroker, Warnings, error) {
serviceBroker, warnings, err := actor.CloudControllerClient.CreateServiceBroker(serviceBrokerName, username, password, brokerURI, spaceGUID)
return ServiceBroker(serviceBroker)... | go | func (actor Actor) CreateServiceBroker(serviceBrokerName, username, password, brokerURI, spaceGUID string) (ServiceBroker, Warnings, error) {
serviceBroker, warnings, err := actor.CloudControllerClient.CreateServiceBroker(serviceBrokerName, username, password, brokerURI, spaceGUID)
return ServiceBroker(serviceBroker)... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateServiceBroker",
"(",
"serviceBrokerName",
",",
"username",
",",
"password",
",",
"brokerURI",
",",
"spaceGUID",
"string",
")",
"(",
"ServiceBroker",
",",
"Warnings",
",",
"error",
")",
"{",
"serviceBroker",
",",
"warn... | // CreateServiceBroker returns a ServiceBroker and any warnings or errors. | [
"CreateServiceBroker",
"returns",
"a",
"ServiceBroker",
"and",
"any",
"warnings",
"or",
"errors",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_broker.go#L12-L15 |
26,144 | cloudfoundry/cli | actor/v2action/service_broker.go | GetServiceBrokers | func (actor Actor) GetServiceBrokers() ([]ServiceBroker, Warnings, error) {
brokers, warnings, err := actor.CloudControllerClient.GetServiceBrokers()
if err != nil {
return nil, Warnings(warnings), err
}
var brokersToReturn []ServiceBroker
for _, b := range brokers {
brokersToReturn = append(brokersToReturn, ... | go | func (actor Actor) GetServiceBrokers() ([]ServiceBroker, Warnings, error) {
brokers, warnings, err := actor.CloudControllerClient.GetServiceBrokers()
if err != nil {
return nil, Warnings(warnings), err
}
var brokersToReturn []ServiceBroker
for _, b := range brokers {
brokersToReturn = append(brokersToReturn, ... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServiceBrokers",
"(",
")",
"(",
"[",
"]",
"ServiceBroker",
",",
"Warnings",
",",
"error",
")",
"{",
"brokers",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetServiceBrokers",
"(",
... | // GetServiceBrokers returns all ServiceBrokers and any warnings or errors. | [
"GetServiceBrokers",
"returns",
"all",
"ServiceBrokers",
"and",
"any",
"warnings",
"or",
"errors",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_broker.go#L18-L30 |
26,145 | cloudfoundry/cli | actor/v2action/service_broker.go | GetServiceBrokerByName | func (actor Actor) GetServiceBrokerByName(brokerName string) (ServiceBroker, Warnings, error) {
serviceBrokers, warnings, err := actor.CloudControllerClient.GetServiceBrokers(ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{brokerName},
})
if err != nil {
retu... | go | func (actor Actor) GetServiceBrokerByName(brokerName string) (ServiceBroker, Warnings, error) {
serviceBrokers, warnings, err := actor.CloudControllerClient.GetServiceBrokers(ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{brokerName},
})
if err != nil {
retu... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServiceBrokerByName",
"(",
"brokerName",
"string",
")",
"(",
"ServiceBroker",
",",
"Warnings",
",",
"error",
")",
"{",
"serviceBrokers",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"Get... | // GetServiceBrokerByName returns a ServiceBroker and any warnings or errors. | [
"GetServiceBrokerByName",
"returns",
"a",
"ServiceBroker",
"and",
"any",
"warnings",
"or",
"errors",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_broker.go#L33-L49 |
26,146 | cloudfoundry/cli | api/cloudcontroller/ccv2/space_summary.go | UnmarshalJSON | func (spaceSummary *SpaceSummary) UnmarshalJSON(data []byte) error {
var ccSpaceSummary struct {
Applications []SpaceSummaryApplication `json:"apps"`
Name string `json:"name"`
ServiceInstances []SpaceSummaryServiceInstance `json:"services"`
}
err := cloudcontroller.De... | go | func (spaceSummary *SpaceSummary) UnmarshalJSON(data []byte) error {
var ccSpaceSummary struct {
Applications []SpaceSummaryApplication `json:"apps"`
Name string `json:"name"`
ServiceInstances []SpaceSummaryServiceInstance `json:"services"`
}
err := cloudcontroller.De... | [
"func",
"(",
"spaceSummary",
"*",
"SpaceSummary",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccSpaceSummary",
"struct",
"{",
"Applications",
"[",
"]",
"SpaceSummaryApplication",
"`json:\"apps\"`",
"\n",
"Name",
"string",
"`js... | // UnmarshalJSON helps unmarshal a Cloud Controller Space Summary response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Space",
"Summary",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space_summary.go#L43-L59 |
26,147 | cloudfoundry/cli | api/cloudcontroller/ccv2/space_summary.go | GetSpaceSummary | func (client *Client) GetSpaceSummary(spaceGUID string) (SpaceSummary, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceSummaryRequest,
URIParams: Params{"space_guid": spaceGUID},
})
if err != nil {
return SpaceSummary{}, nil, err
}
var spaceSummary Sp... | go | func (client *Client) GetSpaceSummary(spaceGUID string) (SpaceSummary, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceSummaryRequest,
URIParams: Params{"space_guid": spaceGUID},
})
if err != nil {
return SpaceSummary{}, nil, err
}
var spaceSummary Sp... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceSummary",
"(",
"spaceGUID",
"string",
")",
"(",
"SpaceSummary",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestNam... | // GetSpaceSummary returns the summary of the space with the given GUID. | [
"GetSpaceSummary",
"returns",
"the",
"summary",
"of",
"the",
"space",
"with",
"the",
"given",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space_summary.go#L62-L78 |
26,148 | cloudfoundry/cli | command/v6/target_command.go | setOrg | func (cmd *TargetCommand) setOrg() error {
org, warnings, err := cmd.Actor.GetOrganizationByName(cmd.Organization)
cmd.UI.DisplayWarnings(warnings)
if err != nil {
return err
}
cmd.Config.SetOrganizationInformation(org.GUID, cmd.Organization)
cmd.Config.UnsetSpaceInformation()
return nil
} | go | func (cmd *TargetCommand) setOrg() error {
org, warnings, err := cmd.Actor.GetOrganizationByName(cmd.Organization)
cmd.UI.DisplayWarnings(warnings)
if err != nil {
return err
}
cmd.Config.SetOrganizationInformation(org.GUID, cmd.Organization)
cmd.Config.UnsetSpaceInformation()
return nil
} | [
"func",
"(",
"cmd",
"*",
"TargetCommand",
")",
"setOrg",
"(",
")",
"error",
"{",
"org",
",",
"warnings",
",",
"err",
":=",
"cmd",
".",
"Actor",
".",
"GetOrganizationByName",
"(",
"cmd",
".",
"Organization",
")",
"\n",
"cmd",
".",
"UI",
".",
"DisplayWar... | // setOrg sets organization | [
"setOrg",
"sets",
"organization"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/target_command.go#L141-L152 |
26,149 | cloudfoundry/cli | command/v6/target_command.go | autoTargetSpace | func (cmd *TargetCommand) autoTargetSpace(orgGUID string) error {
spaces, warnings, err := cmd.Actor.GetOrganizationSpaces(orgGUID)
cmd.UI.DisplayWarnings(warnings)
if err != nil {
return err
}
if len(spaces) == 1 {
space := spaces[0]
cmd.Config.SetSpaceInformation(space.GUID, space.Name, space.AllowSSH)
}... | go | func (cmd *TargetCommand) autoTargetSpace(orgGUID string) error {
spaces, warnings, err := cmd.Actor.GetOrganizationSpaces(orgGUID)
cmd.UI.DisplayWarnings(warnings)
if err != nil {
return err
}
if len(spaces) == 1 {
space := spaces[0]
cmd.Config.SetSpaceInformation(space.GUID, space.Name, space.AllowSSH)
}... | [
"func",
"(",
"cmd",
"*",
"TargetCommand",
")",
"autoTargetSpace",
"(",
"orgGUID",
"string",
")",
"error",
"{",
"spaces",
",",
"warnings",
",",
"err",
":=",
"cmd",
".",
"Actor",
".",
"GetOrganizationSpaces",
"(",
"orgGUID",
")",
"\n",
"cmd",
".",
"UI",
".... | // autoTargetSpace targets the space if there is only one space in the org
// and no space arg was provided. | [
"autoTargetSpace",
"targets",
"the",
"space",
"if",
"there",
"is",
"only",
"one",
"space",
"in",
"the",
"org",
"and",
"no",
"space",
"arg",
"was",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/target_command.go#L156-L169 |
26,150 | cloudfoundry/cli | command/v6/target_command.go | setSpace | func (cmd *TargetCommand) setSpace() error {
if !cmd.Config.HasTargetedOrganization() {
return translatableerror.NoOrganizationTargetedError{BinaryName: cmd.Config.BinaryName()}
}
space, warnings, err := cmd.Actor.GetSpaceByOrganizationAndName(cmd.Config.TargetedOrganization().GUID, cmd.Space)
cmd.UI.DisplayWarn... | go | func (cmd *TargetCommand) setSpace() error {
if !cmd.Config.HasTargetedOrganization() {
return translatableerror.NoOrganizationTargetedError{BinaryName: cmd.Config.BinaryName()}
}
space, warnings, err := cmd.Actor.GetSpaceByOrganizationAndName(cmd.Config.TargetedOrganization().GUID, cmd.Space)
cmd.UI.DisplayWarn... | [
"func",
"(",
"cmd",
"*",
"TargetCommand",
")",
"setSpace",
"(",
")",
"error",
"{",
"if",
"!",
"cmd",
".",
"Config",
".",
"HasTargetedOrganization",
"(",
")",
"{",
"return",
"translatableerror",
".",
"NoOrganizationTargetedError",
"{",
"BinaryName",
":",
"cmd",... | // setSpace sets space | [
"setSpace",
"sets",
"space"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/target_command.go#L172-L186 |
26,151 | cloudfoundry/cli | command/v6/target_command.go | displayTargetTable | func (cmd *TargetCommand) displayTargetTable(user configv3.User) {
table := [][]string{
{cmd.UI.TranslateText("api endpoint:"), cmd.Config.Target()},
{cmd.UI.TranslateText("api version:"), cmd.Actor.CloudControllerAPIVersion()},
{cmd.UI.TranslateText("user:"), user.Name},
}
if cmd.Config.HasTargetedOrganizati... | go | func (cmd *TargetCommand) displayTargetTable(user configv3.User) {
table := [][]string{
{cmd.UI.TranslateText("api endpoint:"), cmd.Config.Target()},
{cmd.UI.TranslateText("api version:"), cmd.Actor.CloudControllerAPIVersion()},
{cmd.UI.TranslateText("user:"), user.Name},
}
if cmd.Config.HasTargetedOrganizati... | [
"func",
"(",
"cmd",
"*",
"TargetCommand",
")",
"displayTargetTable",
"(",
"user",
"configv3",
".",
"User",
")",
"{",
"table",
":=",
"[",
"]",
"[",
"]",
"string",
"{",
"{",
"cmd",
".",
"UI",
".",
"TranslateText",
"(",
"\"",
"\"",
")",
",",
"cmd",
".... | // displayTargetTable neatly displays target information. | [
"displayTargetTable",
"neatly",
"displays",
"target",
"information",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/target_command.go#L189-L208 |
26,152 | cloudfoundry/cli | actor/actionerror/plugin_not_found_in_repository_error.go | Error | func (e PluginNotFoundInRepositoryError) Error() string {
return fmt.Sprintf("Plugin %s not found in repository %s", e.PluginName, e.RepositoryName)
} | go | func (e PluginNotFoundInRepositoryError) Error() string {
return fmt.Sprintf("Plugin %s not found in repository %s", e.PluginName, e.RepositoryName)
} | [
"func",
"(",
"e",
"PluginNotFoundInRepositoryError",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"PluginName",
",",
"e",
".",
"RepositoryName",
")",
"\n",
"}"
] | // Error outputs the plugin not found in repository error message. | [
"Error",
"outputs",
"the",
"plugin",
"not",
"found",
"in",
"repository",
"error",
"message",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/actionerror/plugin_not_found_in_repository_error.go#L13-L15 |
26,153 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_plan.go | UnmarshalJSON | func (servicePlan *ServicePlan) UnmarshalJSON(data []byte) error {
var ccServicePlan struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
ServiceGUID string `json:"service_guid"`
Public bool `json:"public"`
Description string `json:"description"`
Free ... | go | func (servicePlan *ServicePlan) UnmarshalJSON(data []byte) error {
var ccServicePlan struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
ServiceGUID string `json:"service_guid"`
Public bool `json:"public"`
Description string `json:"description"`
Free ... | [
"func",
"(",
"servicePlan",
"*",
"ServicePlan",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccServicePlan",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
"`json:\"... | // UnmarshalJSON helps unmarshal a Cloud Controller Service Plan response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Service",
"Plan",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_plan.go#L36-L59 |
26,154 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_plan.go | GetServicePlan | func (client *Client) GetServicePlan(servicePlanGUID string) (ServicePlan, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServicePlanRequest,
URIParams: Params{"service_plan_guid": servicePlanGUID},
})
if err != nil {
return ServicePlan{}, nil, err
}
var ... | go | func (client *Client) GetServicePlan(servicePlanGUID string) (ServicePlan, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServicePlanRequest,
URIParams: Params{"service_plan_guid": servicePlanGUID},
})
if err != nil {
return ServicePlan{}, nil, err
}
var ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServicePlan",
"(",
"servicePlanGUID",
"string",
")",
"(",
"ServicePlan",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Reques... | // GetServicePlan returns the service plan with the given GUID. | [
"GetServicePlan",
"returns",
"the",
"service",
"plan",
"with",
"the",
"given",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_plan.go#L62-L78 |
26,155 | cloudfoundry/cli | actor/v3action/isolation_segment.go | CreateIsolationSegmentByName | func (actor Actor) CreateIsolationSegmentByName(isolationSegment IsolationSegment) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.CreateIsolationSegment(ccv3.IsolationSegment(isolationSegment))
if _, ok := err.(ccerror.UnprocessableEntityError); ok {
return Warnings(warnings), actionerror.Isola... | go | func (actor Actor) CreateIsolationSegmentByName(isolationSegment IsolationSegment) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.CreateIsolationSegment(ccv3.IsolationSegment(isolationSegment))
if _, ok := err.(ccerror.UnprocessableEntityError); ok {
return Warnings(warnings), actionerror.Isola... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateIsolationSegmentByName",
"(",
"isolationSegment",
"IsolationSegment",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"CreateIsolationSegme... | // CreateIsolationSegmentByName creates a given isolation segment. | [
"CreateIsolationSegmentByName",
"creates",
"a",
"given",
"isolation",
"segment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L53-L59 |
26,156 | cloudfoundry/cli | actor/v3action/isolation_segment.go | DeleteIsolationSegmentByName | func (actor Actor) DeleteIsolationSegmentByName(name string) (Warnings, error) {
isolationSegment, warnings, err := actor.GetIsolationSegmentByName(name)
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return allWarnings, err
}
apiWarnings, err := actor.CloudControllerClient.DeleteIsolationSegmen... | go | func (actor Actor) DeleteIsolationSegmentByName(name string) (Warnings, error) {
isolationSegment, warnings, err := actor.GetIsolationSegmentByName(name)
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return allWarnings, err
}
apiWarnings, err := actor.CloudControllerClient.DeleteIsolationSegmen... | [
"func",
"(",
"actor",
"Actor",
")",
"DeleteIsolationSegmentByName",
"(",
"name",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"isolationSegment",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"GetIsolationSegmentByName",
"(",
"name",
")",
"\n",
... | // DeleteIsolationSegmentByName deletes the given isolation segment. | [
"DeleteIsolationSegmentByName",
"deletes",
"the",
"given",
"isolation",
"segment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L62-L71 |
26,157 | cloudfoundry/cli | actor/v3action/isolation_segment.go | EntitleIsolationSegmentToOrganizationByName | func (actor Actor) EntitleIsolationSegmentToOrganizationByName(isolationSegmentName string, orgName string) (Warnings, error) {
isolationSegment, warnings, err := actor.GetIsolationSegmentByName(isolationSegmentName)
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return allWarnings, err
}
organi... | go | func (actor Actor) EntitleIsolationSegmentToOrganizationByName(isolationSegmentName string, orgName string) (Warnings, error) {
isolationSegment, warnings, err := actor.GetIsolationSegmentByName(isolationSegmentName)
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return allWarnings, err
}
organi... | [
"func",
"(",
"actor",
"Actor",
")",
"EntitleIsolationSegmentToOrganizationByName",
"(",
"isolationSegmentName",
"string",
",",
"orgName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"isolationSegment",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
... | // EntitleIsolationSegmentToOrganizationByName entitles the given organization
// to use the specified isolation segment | [
"EntitleIsolationSegmentToOrganizationByName",
"entitles",
"the",
"given",
"organization",
"to",
"use",
"the",
"specified",
"isolation",
"segment"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L75-L90 |
26,158 | cloudfoundry/cli | actor/v3action/isolation_segment.go | GetIsolationSegmentByName | func (actor Actor) GetIsolationSegmentByName(name string) (IsolationSegment, Warnings, error) {
isolationSegments, warnings, err := actor.CloudControllerClient.GetIsolationSegments(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}},
)
if err != nil {
return IsolationSegment{}, Warnings(warnings), err
}
... | go | func (actor Actor) GetIsolationSegmentByName(name string) (IsolationSegment, Warnings, error) {
isolationSegments, warnings, err := actor.CloudControllerClient.GetIsolationSegments(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}},
)
if err != nil {
return IsolationSegment{}, Warnings(warnings), err
}
... | [
"func",
"(",
"actor",
"Actor",
")",
"GetIsolationSegmentByName",
"(",
"name",
"string",
")",
"(",
"IsolationSegment",
",",
"Warnings",
",",
"error",
")",
"{",
"isolationSegments",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"... | // GetIsolationSegmentByName returns the requested isolation segment. | [
"GetIsolationSegmentByName",
"returns",
"the",
"requested",
"isolation",
"segment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L103-L116 |
26,159 | cloudfoundry/cli | actor/v3action/isolation_segment.go | GetIsolationSegmentSummaries | func (actor Actor) GetIsolationSegmentSummaries() ([]IsolationSegmentSummary, Warnings, error) {
isolationSegments, warnings, err := actor.CloudControllerClient.GetIsolationSegments()
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return nil, allWarnings, err
}
var isolationSegmentSummaries []Is... | go | func (actor Actor) GetIsolationSegmentSummaries() ([]IsolationSegmentSummary, Warnings, error) {
isolationSegments, warnings, err := actor.CloudControllerClient.GetIsolationSegments()
allWarnings := append(Warnings{}, warnings...)
if err != nil {
return nil, allWarnings, err
}
var isolationSegmentSummaries []Is... | [
"func",
"(",
"actor",
"Actor",
")",
"GetIsolationSegmentSummaries",
"(",
")",
"(",
"[",
"]",
"IsolationSegmentSummary",
",",
"Warnings",
",",
"error",
")",
"{",
"isolationSegments",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
... | // GetIsolationSegmentSummaries returns all isolation segments and their entitled orgs | [
"GetIsolationSegmentSummaries",
"returns",
"all",
"isolation",
"segments",
"and",
"their",
"entitled",
"orgs"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L119-L147 |
26,160 | cloudfoundry/cli | actor/v3action/isolation_segment.go | SetOrganizationDefaultIsolationSegment | func (actor Actor) SetOrganizationDefaultIsolationSegment(orgGUID string, isoSegGUID string) (Warnings, error) {
_, apiWarnings, err := actor.CloudControllerClient.UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID, isoSegGUID)
return Warnings(apiWarnings), err
} | go | func (actor Actor) SetOrganizationDefaultIsolationSegment(orgGUID string, isoSegGUID string) (Warnings, error) {
_, apiWarnings, err := actor.CloudControllerClient.UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID, isoSegGUID)
return Warnings(apiWarnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"SetOrganizationDefaultIsolationSegment",
"(",
"orgGUID",
"string",
",",
"isoSegGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"apiWarnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
... | // SetOrganizationDefaultIsolationSegment sets a default isolation segment on
// an organization. | [
"SetOrganizationDefaultIsolationSegment",
"sets",
"a",
"default",
"isolation",
"segment",
"on",
"an",
"organization",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L188-L191 |
26,161 | cloudfoundry/cli | actor/v3action/isolation_segment.go | ResetOrganizationDefaultIsolationSegment | func (actor Actor) ResetOrganizationDefaultIsolationSegment(orgGUID string) (Warnings, error) {
_, apiWarnings, err := actor.CloudControllerClient.UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID, "")
return Warnings(apiWarnings), err
} | go | func (actor Actor) ResetOrganizationDefaultIsolationSegment(orgGUID string) (Warnings, error) {
_, apiWarnings, err := actor.CloudControllerClient.UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID, "")
return Warnings(apiWarnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"ResetOrganizationDefaultIsolationSegment",
"(",
"orgGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"apiWarnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateOrganizationDefaul... | // ResetOrganizationDefaultIsolationSegment resets the default isolation segment fon
// an organization. | [
"ResetOrganizationDefaultIsolationSegment",
"resets",
"the",
"default",
"isolation",
"segment",
"fon",
"an",
"organization",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/isolation_segment.go#L195-L198 |
26,162 | cloudfoundry/cli | api/cloudcontroller/ccv3/package.go | UnmarshalJSON | func (p *Package) UnmarshalJSON(data []byte) error {
var ccPackage struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Links APILinks `json:"links,omitempty"`
Relationships Relationships `json:"relat... | go | func (p *Package) UnmarshalJSON(data []byte) error {
var ccPackage struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Links APILinks `json:"links,omitempty"`
Relationships Relationships `json:"relat... | [
"func",
"(",
"p",
"*",
"Package",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccPackage",
"struct",
"{",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"CreatedAt",
"string",
"`json:\"created_at,omitempty\"`",
"\n",
"Lin... | // UnmarshalJSON helps unmarshal a Cloud Controller Package response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Package",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/package.go#L84-L114 |
26,163 | cloudfoundry/cli | api/cloudcontroller/ccv3/package.go | CreatePackage | func (client *Client) CreatePackage(pkg Package) (Package, Warnings, error) {
bodyBytes, err := json.Marshal(pkg)
if err != nil {
return Package{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostPackageRequest,
Body: bytes.NewReader(bodyBytes),
})
if err !... | go | func (client *Client) CreatePackage(pkg Package) (Package, Warnings, error) {
bodyBytes, err := json.Marshal(pkg)
if err != nil {
return Package{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostPackageRequest,
Body: bytes.NewReader(bodyBytes),
})
if err !... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreatePackage",
"(",
"pkg",
"Package",
")",
"(",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"bodyBytes",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"pkg",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // CreatePackage creates a package with the given settings, Type and the
// ApplicationRelationship must be set. | [
"CreatePackage",
"creates",
"a",
"package",
"with",
"the",
"given",
"settings",
"Type",
"and",
"the",
"ApplicationRelationship",
"must",
"be",
"set",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/package.go#L118-L139 |
26,164 | cloudfoundry/cli | api/cloudcontroller/ccv3/package.go | GetPackage | func (client *Client) GetPackage(packageGUID string) (Package, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPackageRequest,
URIParams: internal.Params{"package_guid": packageGUID},
})
if err != nil {
return Package{}, nil, err
}
var responsePackage Pack... | go | func (client *Client) GetPackage(packageGUID string) (Package, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPackageRequest,
URIParams: internal.Params{"package_guid": packageGUID},
})
if err != nil {
return Package{}, nil, err
}
var responsePackage Pack... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPackage",
"(",
"packageGUID",
"string",
")",
"(",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":... | // GetPackage returns the package with the given GUID. | [
"GetPackage",
"returns",
"the",
"package",
"with",
"the",
"given",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/package.go#L142-L158 |
26,165 | cloudfoundry/cli | api/cloudcontroller/ccv3/package.go | GetPackages | func (client *Client) GetPackages(query ...Query) ([]Package, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPackagesRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullPackagesList []Package
warnings, err := client.paginate(requ... | go | func (client *Client) GetPackages(query ...Query) ([]Package, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPackagesRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullPackagesList []Package
warnings, err := client.paginate(requ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPackages",
"(",
"query",
"...",
"Query",
")",
"(",
"[",
"]",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"R... | // GetPackages returns the list of packages. | [
"GetPackages",
"returns",
"the",
"list",
"of",
"packages",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/package.go#L161-L184 |
26,166 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_broker.go | UnmarshalJSON | func (serviceBroker *ServiceBroker) UnmarshalJSON(data []byte) error {
var ccServiceBroker struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
BrokerURL string `json:"broker_url"`
AuthUsername string `json:"auth_username"`
SpaceGUID string `json:"space_guid"`
... | go | func (serviceBroker *ServiceBroker) UnmarshalJSON(data []byte) error {
var ccServiceBroker struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
BrokerURL string `json:"broker_url"`
AuthUsername string `json:"auth_username"`
SpaceGUID string `json:"space_guid"`
... | [
"func",
"(",
"serviceBroker",
"*",
"ServiceBroker",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccServiceBroker",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
"`j... | // UnmarshalJSON helps unmarshal a Cloud Controller Service Broker response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Service",
"Broker",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_broker.go#L27-L48 |
26,167 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_broker.go | CreateServiceBroker | func (client *Client) CreateServiceBroker(brokerName, username, password, url, spaceGUID string) (ServiceBroker, Warnings, error) {
requestBody := createServiceBrokerRequestBody{
Name: brokerName,
BrokerURL: url,
AuthUsername: username,
AuthPassword: password,
SpaceGUID: spaceGUID,
}
bodyByt... | go | func (client *Client) CreateServiceBroker(brokerName, username, password, url, spaceGUID string) (ServiceBroker, Warnings, error) {
requestBody := createServiceBrokerRequestBody{
Name: brokerName,
BrokerURL: url,
AuthUsername: username,
AuthPassword: password,
SpaceGUID: spaceGUID,
}
bodyByt... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateServiceBroker",
"(",
"brokerName",
",",
"username",
",",
"password",
",",
"url",
",",
"spaceGUID",
"string",
")",
"(",
"ServiceBroker",
",",
"Warnings",
",",
"error",
")",
"{",
"requestBody",
":=",
"createSer... | // CreateServiceBroker posts a service broker resource with the provided
// attributes to the api and returns the result. | [
"CreateServiceBroker",
"posts",
"a",
"service",
"broker",
"resource",
"with",
"the",
"provided",
"attributes",
"to",
"the",
"api",
"and",
"returns",
"the",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_broker.go#L60-L91 |
26,168 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_broker.go | GetServiceBrokers | func (client *Client) GetServiceBrokers(filters ...Filter) ([]ServiceBroker, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceBrokersRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullBrokersList ... | go | func (client *Client) GetServiceBrokers(filters ...Filter) ([]ServiceBroker, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceBrokersRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullBrokersList ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServiceBrokers",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"ServiceBroker",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOption... | // GetServiceBrokers returns back a list of Service Brokers given the provided
// filters. | [
"GetServiceBrokers",
"returns",
"back",
"a",
"list",
"of",
"Service",
"Brokers",
"given",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_broker.go#L95-L119 |
26,169 | cloudfoundry/cli | cf/util/glob/glob.go | MustCompileGlob | func MustCompileGlob(pat string) Glob {
g, err := CompileGlob(pat)
if err != nil {
panic(err)
}
return g
} | go | func MustCompileGlob(pat string) Glob {
g, err := CompileGlob(pat)
if err != nil {
panic(err)
}
return g
} | [
"func",
"MustCompileGlob",
"(",
"pat",
"string",
")",
"Glob",
"{",
"g",
",",
"err",
":=",
"CompileGlob",
"(",
"pat",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"g",
"\n",
"}"
] | // MustCompileGlob is like CompileGlob, but it panics if an error occurs,
// simplifying safe initialization of global variables holding glob patterns. | [
"MustCompileGlob",
"is",
"like",
"CompileGlob",
"but",
"it",
"panics",
"if",
"an",
"error",
"occurs",
"simplifying",
"safe",
"initialization",
"of",
"global",
"variables",
"holding",
"glob",
"patterns",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/util/glob/glob.go#L84-L90 |
26,170 | cloudfoundry/cli | actor/v7action/buildpack.go | GetBuildpackByNameAndStack | func (actor Actor) GetBuildpackByNameAndStack(buildpackName string, buildpackStack string) (Buildpack, Warnings, error) {
var (
ccv3Buildpacks []ccv3.Buildpack
warnings ccv3.Warnings
err error
)
if buildpackStack == "" {
ccv3Buildpacks, warnings, err = actor.CloudControllerClient.GetBuildpa... | go | func (actor Actor) GetBuildpackByNameAndStack(buildpackName string, buildpackStack string) (Buildpack, Warnings, error) {
var (
ccv3Buildpacks []ccv3.Buildpack
warnings ccv3.Warnings
err error
)
if buildpackStack == "" {
ccv3Buildpacks, warnings, err = actor.CloudControllerClient.GetBuildpa... | [
"func",
"(",
"actor",
"Actor",
")",
"GetBuildpackByNameAndStack",
"(",
"buildpackName",
"string",
",",
"buildpackStack",
"string",
")",
"(",
"Buildpack",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"(",
"ccv3Buildpacks",
"[",
"]",
"ccv3",
".",
"Buildpack",... | // GetBuildpackByNameAndStack returns a buildpack with the provided name and
// stack. If `buildpackStack` is not specified, and there are multiple
// buildpacks with the same name, it will return the one with no stack, if
// present. | [
"GetBuildpackByNameAndStack",
"returns",
"a",
"buildpack",
"with",
"the",
"provided",
"name",
"and",
"stack",
".",
"If",
"buildpackStack",
"is",
"not",
"specified",
"and",
"there",
"are",
"multiple",
"buildpacks",
"with",
"the",
"same",
"name",
"it",
"will",
"re... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/buildpack.go#L42-L85 |
26,171 | cloudfoundry/cli | actor/v3action/droplet.go | SetApplicationDropletByApplicationNameAndSpace | func (actor Actor) SetApplicationDropletByApplicationNameAndSpace(appName string, spaceGUID string, dropletGUID string) (Warnings, error) {
allWarnings := Warnings{}
application, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
... | go | func (actor Actor) SetApplicationDropletByApplicationNameAndSpace(appName string, spaceGUID string, dropletGUID string) (Warnings, error) {
allWarnings := Warnings{}
application, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
... | [
"func",
"(",
"actor",
"Actor",
")",
"SetApplicationDropletByApplicationNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
",",
"dropletGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"allWarnings",
":=",
"Warnings",
"{",
"}",
"\n... | // SetApplicationDropletByApplicationNameAndSpace sets the droplet for an application. | [
"SetApplicationDropletByApplicationNameAndSpace",
"sets",
"the",
"droplet",
"for",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/droplet.go#L23-L39 |
26,172 | cloudfoundry/cli | actor/v3action/droplet.go | GetApplicationDroplets | func (actor Actor) GetApplicationDroplets(appName string, spaceGUID string) ([]Droplet, Warnings, error) {
allWarnings := Warnings{}
application, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return nil, allWarnings, err
}
... | go | func (actor Actor) GetApplicationDroplets(appName string, spaceGUID string) ([]Droplet, Warnings, error) {
allWarnings := Warnings{}
application, warnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return nil, allWarnings, err
}
... | [
"func",
"(",
"actor",
"Actor",
")",
"GetApplicationDroplets",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"Droplet",
",",
"Warnings",
",",
"error",
")",
"{",
"allWarnings",
":=",
"Warnings",
"{",
"}",
"\n",
"application",
",",... | // GetApplicationDroplets returns the list of droplets that belong to applicaiton. | [
"GetApplicationDroplets",
"returns",
"the",
"list",
"of",
"droplets",
"that",
"belong",
"to",
"applicaiton",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/droplet.go#L52-L75 |
26,173 | cloudfoundry/cli | api/cloudcontroller/ccv2/resource.go | UpdateResourceMatch | func (client *Client) UpdateResourceMatch(resourcesToMatch []Resource) ([]Resource, Warnings, error) {
body, err := json.Marshal(resourcesToMatch)
if err != nil {
return nil, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutResourceMatchRequest,
Body: bytes.New... | go | func (client *Client) UpdateResourceMatch(resourcesToMatch []Resource) ([]Resource, Warnings, error) {
body, err := json.Marshal(resourcesToMatch)
if err != nil {
return nil, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutResourceMatchRequest,
Body: bytes.New... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateResourceMatch",
"(",
"resourcesToMatch",
"[",
"]",
"Resource",
")",
"(",
"[",
"]",
"Resource",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"resourcesToM... | // UpdateResourceMatch returns the resources that exist on the cloud foundry instance
// from the set of resources given. | [
"UpdateResourceMatch",
"returns",
"the",
"resources",
"that",
"exist",
"on",
"the",
"cloud",
"foundry",
"instance",
"from",
"the",
"set",
"of",
"resources",
"given",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/resource.go#L74-L97 |
26,174 | cloudfoundry/cli | api/uaa/user.go | CreateUser | func (client *Client) CreateUser(user string, password string, origin string) (User, error) {
userRequest := newUserRequestBody{
Username: user,
Password: password,
Origin: origin,
Name: userName{
FamilyName: user,
GivenName: user,
},
Emails: []email{
{
Value: user,
Primary: true,
... | go | func (client *Client) CreateUser(user string, password string, origin string) (User, error) {
userRequest := newUserRequestBody{
Username: user,
Password: password,
Origin: origin,
Name: userName{
FamilyName: user,
GivenName: user,
},
Emails: []email{
{
Value: user,
Primary: true,
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateUser",
"(",
"user",
"string",
",",
"password",
"string",
",",
"origin",
"string",
")",
"(",
"User",
",",
"error",
")",
"{",
"userRequest",
":=",
"newUserRequestBody",
"{",
"Username",
":",
"user",
",",
"P... | // CreateUser creates a new UAA user account with the provided password. | [
"CreateUser",
"creates",
"a",
"new",
"UAA",
"user",
"account",
"with",
"the",
"provided",
"password",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/user.go#L41-L85 |
26,175 | cloudfoundry/cli | actor/v2action/resource.go | ResourceMatch | func (actor Actor) ResourceMatch(allResources []Resource) ([]Resource, []Resource, Warnings, error) {
resourcesToSend := [][]ccv2.Resource{{}}
var currentList, sendCount int
for _, resource := range allResources {
// Skip if resource is a directory, symlink, or empty file.
if resource.Size == 0 {
continue
}... | go | func (actor Actor) ResourceMatch(allResources []Resource) ([]Resource, []Resource, Warnings, error) {
resourcesToSend := [][]ccv2.Resource{{}}
var currentList, sendCount int
for _, resource := range allResources {
// Skip if resource is a directory, symlink, or empty file.
if resource.Size == 0 {
continue
}... | [
"func",
"(",
"actor",
"Actor",
")",
"ResourceMatch",
"(",
"allResources",
"[",
"]",
"Resource",
")",
"(",
"[",
"]",
"Resource",
",",
"[",
"]",
"Resource",
",",
"Warnings",
",",
"error",
")",
"{",
"resourcesToSend",
":=",
"[",
"]",
"[",
"]",
"ccv2",
"... | // ResourceMatch returns a set of matched resources and unmatched resources in
// the order they were given in allResources. | [
"ResourceMatch",
"returns",
"a",
"set",
"of",
"matched",
"resources",
"and",
"unmatched",
"resources",
"in",
"the",
"order",
"they",
"were",
"given",
"in",
"allResources",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/resource.go#L30-L89 |
26,176 | cloudfoundry/cli | api/cloudcontroller/cloud_controller_connection.go | NewConnection | func NewConnection(config Config) *CloudControllerConnection {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.SkipSSLValidation,
},
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: config.DialTimeout,
}).DialContext... | go | func NewConnection(config Config) *CloudControllerConnection {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.SkipSSLValidation,
},
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: config.DialTimeout,
}).DialContext... | [
"func",
"NewConnection",
"(",
"config",
"Config",
")",
"*",
"CloudControllerConnection",
"{",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"InsecureSkipVerify",
":",
"config",
".",
"SkipSSLValidation",
... | // NewConnection returns a new CloudControllerConnection with provided
// configuration. | [
"NewConnection",
"returns",
"a",
"new",
"CloudControllerConnection",
"with",
"provided",
"configuration",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/cloud_controller_connection.go#L31-L46 |
26,177 | cloudfoundry/cli | api/cloudcontroller/cloud_controller_connection.go | handleWarnings | func (*CloudControllerConnection) handleWarnings(response *http.Response) ([]string, error) {
rawWarnings := response.Header.Get("X-Cf-Warnings")
if len(rawWarnings) == 0 {
return nil, nil
}
var warnings []string
for _, rawWarning := range strings.Split(rawWarnings, ",") {
warning, err := url.QueryUnescape(ra... | go | func (*CloudControllerConnection) handleWarnings(response *http.Response) ([]string, error) {
rawWarnings := response.Header.Get("X-Cf-Warnings")
if len(rawWarnings) == 0 {
return nil, nil
}
var warnings []string
for _, rawWarning := range strings.Split(rawWarnings, ",") {
warning, err := url.QueryUnescape(ra... | [
"func",
"(",
"*",
"CloudControllerConnection",
")",
"handleWarnings",
"(",
"response",
"*",
"http",
".",
"Response",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"rawWarnings",
":=",
"response",
".",
"Header",
".",
"Get",
"(",
"\"",
"\"",
")",
... | // handleWarnings looks for the "X-Cf-Warnings" header in the cloud controller
// response and URI decodes them. The value can contain multiple warnings that
// are comma separated. | [
"handleWarnings",
"looks",
"for",
"the",
"X",
"-",
"Cf",
"-",
"Warnings",
"header",
"in",
"the",
"cloud",
"controller",
"response",
"and",
"URI",
"decodes",
"them",
".",
"The",
"value",
"can",
"contain",
"multiple",
"warnings",
"that",
"are",
"comma",
"separ... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/cloud_controller_connection.go#L90-L106 |
26,178 | cloudfoundry/cli | cf/actors/push.go | ProcessPath | func (actor PushActorImpl) ProcessPath(dirOrZipFile string, f func(string) error) error {
if !actor.zipper.IsZipFile(dirOrZipFile) {
if filepath.IsAbs(dirOrZipFile) {
appDir, err := filepath.EvalSymlinks(dirOrZipFile)
if err != nil {
return err
}
err = f(appDir)
if err != nil {
return err
}... | go | func (actor PushActorImpl) ProcessPath(dirOrZipFile string, f func(string) error) error {
if !actor.zipper.IsZipFile(dirOrZipFile) {
if filepath.IsAbs(dirOrZipFile) {
appDir, err := filepath.EvalSymlinks(dirOrZipFile)
if err != nil {
return err
}
err = f(appDir)
if err != nil {
return err
}... | [
"func",
"(",
"actor",
"PushActorImpl",
")",
"ProcessPath",
"(",
"dirOrZipFile",
"string",
",",
"f",
"func",
"(",
"string",
")",
"error",
")",
"error",
"{",
"if",
"!",
"actor",
".",
"zipper",
".",
"IsZipFile",
"(",
"dirOrZipFile",
")",
"{",
"if",
"filepat... | // ProcessPath takes in a director of app files or a zip file which contains
// the app files. If given a zip file, it will extract the zip to a temporary
// location, call the provided callback with that location, and then clean up
// the location after the callback has been executed.
//
// This was done so that the c... | [
"ProcessPath",
"takes",
"in",
"a",
"director",
"of",
"app",
"files",
"or",
"a",
"zip",
"file",
"which",
"contains",
"the",
"app",
"files",
".",
"If",
"given",
"a",
"zip",
"file",
"it",
"will",
"extract",
"the",
"zip",
"to",
"a",
"temporary",
"location",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/actors/push.go#L55-L106 |
26,179 | cloudfoundry/cli | actor/sharedaction/is_logged_in.go | IsLoggedIn | func (actor Actor) IsLoggedIn() bool {
return actor.Config.AccessToken() != "" || actor.Config.RefreshToken() != ""
} | go | func (actor Actor) IsLoggedIn() bool {
return actor.Config.AccessToken() != "" || actor.Config.RefreshToken() != ""
} | [
"func",
"(",
"actor",
"Actor",
")",
"IsLoggedIn",
"(",
")",
"bool",
"{",
"return",
"actor",
".",
"Config",
".",
"AccessToken",
"(",
")",
"!=",
"\"",
"\"",
"||",
"actor",
".",
"Config",
".",
"RefreshToken",
"(",
")",
"!=",
"\"",
"\"",
"\n",
"}"
] | // IsLoggedIn checks whether a user has authenticated with CF | [
"IsLoggedIn",
"checks",
"whether",
"a",
"user",
"has",
"authenticated",
"with",
"CF"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/is_logged_in.go#L4-L6 |
26,180 | cloudfoundry/cli | api/plugin/request.go | newGETRequest | func (client *Client) newGETRequest(url string) (*http.Request, error) {
request, err := http.NewRequest(
http.MethodGet,
url,
nil,
)
if err != nil {
return nil, err
}
request.Header = http.Header{}
request.Header.Set("Accept", "application/json")
request.Header.Set("Content-Type", "application/json")
... | go | func (client *Client) newGETRequest(url string) (*http.Request, error) {
request, err := http.NewRequest(
http.MethodGet,
url,
nil,
)
if err != nil {
return nil, err
}
request.Header = http.Header{}
request.Header.Set("Accept", "application/json")
request.Header.Set("Content-Type", "application/json")
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"newGETRequest",
"(",
"url",
"string",
")",
"(",
"*",
"http",
".",
"Request",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"http",
".",
"MethodGet",
",",
"url",
",",
... | // newGETRequest returns a constructed HTTP.Request with some defaults.
// Defaults are applied when Request options are not filled in. | [
"newGETRequest",
"returns",
"a",
"constructed",
"HTTP",
".",
"Request",
"with",
"some",
"defaults",
".",
"Defaults",
"are",
"applied",
"when",
"Request",
"options",
"are",
"not",
"filled",
"in",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/plugin/request.go#L7-L23 |
26,181 | cloudfoundry/cli | api/cloudcontroller/minimum_version_check.go | MinimumAPIVersionCheck | func MinimumAPIVersionCheck(current string, minimum string) error {
if minimum == "" {
return nil
}
currentSemver, err := semver.Make(current)
if err != nil {
return err
}
minimumSemver, err := semver.Make(minimum)
if err != nil {
return err
}
if currentSemver.Compare(minimumSemver) == -1 {
return c... | go | func MinimumAPIVersionCheck(current string, minimum string) error {
if minimum == "" {
return nil
}
currentSemver, err := semver.Make(current)
if err != nil {
return err
}
minimumSemver, err := semver.Make(minimum)
if err != nil {
return err
}
if currentSemver.Compare(minimumSemver) == -1 {
return c... | [
"func",
"MinimumAPIVersionCheck",
"(",
"current",
"string",
",",
"minimum",
"string",
")",
"error",
"{",
"if",
"minimum",
"==",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"currentSemver",
",",
"err",
":=",
"semver",
".",
"Make",
"(",
"current",
... | // MinimumAPIVersionCheck compares `current` to `minimum`. If `current` is
// older than `minimum` then an error is returned; otherwise, nil is returned. | [
"MinimumAPIVersionCheck",
"compares",
"current",
"to",
"minimum",
".",
"If",
"current",
"is",
"older",
"than",
"minimum",
"then",
"an",
"error",
"is",
"returned",
";",
"otherwise",
"nil",
"is",
"returned",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/minimum_version_check.go#L10-L33 |
26,182 | cloudfoundry/cli | util/ui/request_logger_file_writer.go | RequestLoggerFileWriter | func (ui *UI) RequestLoggerFileWriter(filePaths []string) *RequestLoggerFileWriter {
return newRequestLoggerFileWriter(ui, ui.fileLock, filePaths)
} | go | func (ui *UI) RequestLoggerFileWriter(filePaths []string) *RequestLoggerFileWriter {
return newRequestLoggerFileWriter(ui, ui.fileLock, filePaths)
} | [
"func",
"(",
"ui",
"*",
"UI",
")",
"RequestLoggerFileWriter",
"(",
"filePaths",
"[",
"]",
"string",
")",
"*",
"RequestLoggerFileWriter",
"{",
"return",
"newRequestLoggerFileWriter",
"(",
"ui",
",",
"ui",
".",
"fileLock",
",",
"filePaths",
")",
"\n",
"}"
] | // RequestLoggerFileWriter returns a RequestLoggerFileWriter that cannot
// overwrite another RequestLoggerFileWriter. | [
"RequestLoggerFileWriter",
"returns",
"a",
"RequestLoggerFileWriter",
"that",
"cannot",
"overwrite",
"another",
"RequestLoggerFileWriter",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/request_logger_file_writer.go#L142-L144 |
26,183 | cloudfoundry/cli | api/cloudcontroller/ccv2/stack.go | UnmarshalJSON | func (stack *Stack) UnmarshalJSON(data []byte) error {
var ccStack struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
Description string `json:"description"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccStack)
if err != nil {
retu... | go | func (stack *Stack) UnmarshalJSON(data []byte) error {
var ccStack struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
Description string `json:"description"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccStack)
if err != nil {
retu... | [
"func",
"(",
"stack",
"*",
"Stack",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccStack",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
"`... | // UnmarshalJSON helps unmarshal a Cloud Controller Stack response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Stack",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/stack.go#L22-L39 |
26,184 | cloudfoundry/cli | api/cloudcontroller/ccv2/stack.go | GetStack | func (client *Client) GetStack(guid string) (Stack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetStackRequest,
URIParams: Params{"stack_guid": guid},
})
if err != nil {
return Stack{}, nil, err
}
var stack Stack
response := cloudcontroller.Response{
... | go | func (client *Client) GetStack(guid string) (Stack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetStackRequest,
URIParams: Params{"stack_guid": guid},
})
if err != nil {
return Stack{}, nil, err
}
var stack Stack
response := cloudcontroller.Response{
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetStack",
"(",
"guid",
"string",
")",
"(",
"Stack",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":",
"inter... | // GetStack returns the requested stack. | [
"GetStack",
"returns",
"the",
"requested",
"stack",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/stack.go#L42-L58 |
26,185 | cloudfoundry/cli | api/cloudcontroller/ccv2/stack.go | GetStacks | func (client *Client) GetStacks(filters ...Filter) ([]Stack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetStacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullStacksList []Stack
warnings, err := ... | go | func (client *Client) GetStacks(filters ...Filter) ([]Stack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetStacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullStacksList []Stack
warnings, err := ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetStacks",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Stack",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Re... | // GetStacks returns a list of Stacks based off of the provided filters. | [
"GetStacks",
"returns",
"a",
"list",
"of",
"Stacks",
"based",
"off",
"of",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/stack.go#L61-L84 |
26,186 | cloudfoundry/cli | api/cloudcontroller/wrapper/uaa_authentication.go | refreshToken | func (t *UAAAuthentication) refreshToken() error {
var expiresIn time.Duration
tokenStr := strings.TrimPrefix(t.cache.AccessToken(), "bearer ")
token, err := jws.ParseJWT([]byte(tokenStr))
if err != nil {
// if the JWT could not be parsed, force a refresh
expiresIn = 0
} else {
expiration, _ := token.Claims... | go | func (t *UAAAuthentication) refreshToken() error {
var expiresIn time.Duration
tokenStr := strings.TrimPrefix(t.cache.AccessToken(), "bearer ")
token, err := jws.ParseJWT([]byte(tokenStr))
if err != nil {
// if the JWT could not be parsed, force a refresh
expiresIn = 0
} else {
expiration, _ := token.Claims... | [
"func",
"(",
"t",
"*",
"UAAAuthentication",
")",
"refreshToken",
"(",
")",
"error",
"{",
"var",
"expiresIn",
"time",
".",
"Duration",
"\n\n",
"tokenStr",
":=",
"strings",
".",
"TrimPrefix",
"(",
"t",
".",
"cache",
".",
"AccessToken",
"(",
")",
",",
"\"",... | // refreshToken refreshes the JWT access token if it is expired or about to expire.
// If the access token is not yet expired, no action is performed. | [
"refreshToken",
"refreshes",
"the",
"JWT",
"access",
"token",
"if",
"it",
"is",
"expired",
"or",
"about",
"to",
"expire",
".",
"If",
"the",
"access",
"token",
"is",
"not",
"yet",
"expired",
"no",
"action",
"is",
"performed",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/wrapper/uaa_authentication.go#L83-L105 |
26,187 | cloudfoundry/cli | actor/v2action/service_access.go | EnableServiceForOrg | func (actor Actor) EnableServiceForOrg(serviceName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
allWarnings = app... | go | func (actor Actor) EnableServiceForOrg(serviceName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
allWarnings = app... | [
"func",
"(",
"actor",
"Actor",
")",
"EnableServiceForOrg",
"(",
"serviceName",
",",
"orgName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"GetServicePlansForSer... | // EnableServiceForOrg enables access for the given service in a specific org. | [
"EnableServiceForOrg",
"enables",
"access",
"for",
"the",
"given",
"service",
"in",
"a",
"specific",
"org",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L63-L89 |
26,188 | cloudfoundry/cli | actor/v2action/service_access.go | EnablePlanForOrg | func (actor Actor) EnablePlanForOrg(serviceName, servicePlanName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
all... | go | func (actor Actor) EnablePlanForOrg(serviceName, servicePlanName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
all... | [
"func",
"(",
"actor",
"Actor",
")",
"EnablePlanForOrg",
"(",
"serviceName",
",",
"servicePlanName",
",",
"orgName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",... | // EnablePlanForOrg enables access to a specific plan of the given service in a specific org. | [
"EnablePlanForOrg",
"enables",
"access",
"to",
"a",
"specific",
"plan",
"of",
"the",
"given",
"service",
"in",
"a",
"specific",
"org",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L92-L119 |
26,189 | cloudfoundry/cli | actor/v2action/service_access.go | DisableServiceForAllOrgs | func (actor Actor) DisableServiceForAllOrgs(serviceName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
for _, plan := range servicePlans {
warnings, err := actor.removeOrgLevelServicePl... | go | func (actor Actor) DisableServiceForAllOrgs(serviceName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
for _, plan := range servicePlans {
warnings, err := actor.removeOrgLevelServicePl... | [
"func",
"(",
"actor",
"Actor",
")",
"DisableServiceForAllOrgs",
"(",
"serviceName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"GetServicePlansForService",
"(",
... | // DisableServiceForAllOrgs disables access for the given service in all orgs. | [
"DisableServiceForAllOrgs",
"disables",
"access",
"for",
"the",
"given",
"service",
"in",
"all",
"orgs",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L122-L144 |
26,190 | cloudfoundry/cli | actor/v2action/service_access.go | DisablePlanForAllOrgs | func (actor Actor) DisablePlanForAllOrgs(serviceName, servicePlanName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
planFound := false
for _, plan := range servicePlans {
if plan.Name... | go | func (actor Actor) DisablePlanForAllOrgs(serviceName, servicePlanName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
planFound := false
for _, plan := range servicePlans {
if plan.Name... | [
"func",
"(",
"actor",
"Actor",
")",
"DisablePlanForAllOrgs",
"(",
"serviceName",
",",
"servicePlanName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"GetServiceP... | // DisablePlanForAllOrgs disables access to a specific plan of the given service, from the given broker in all orgs. | [
"DisablePlanForAllOrgs",
"disables",
"access",
"to",
"a",
"specific",
"plan",
"of",
"the",
"given",
"service",
"from",
"the",
"given",
"broker",
"in",
"all",
"orgs",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L147-L176 |
26,191 | cloudfoundry/cli | actor/v2action/service_access.go | DisableServiceForOrg | func (actor Actor) DisableServiceForOrg(serviceName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
allWarnings = ap... | go | func (actor Actor) DisableServiceForOrg(serviceName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
allWarnings = ap... | [
"func",
"(",
"actor",
"Actor",
")",
"DisableServiceForOrg",
"(",
"serviceName",
",",
"orgName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"GetServicePlansForSe... | // DisableServiceForOrg disables access for the given service in a specific org. | [
"DisableServiceForOrg",
"disables",
"access",
"for",
"the",
"given",
"service",
"in",
"a",
"specific",
"org",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L179-L199 |
26,192 | cloudfoundry/cli | actor/v2action/service_access.go | DisablePlanForOrg | func (actor Actor) DisablePlanForOrg(serviceName, servicePlanName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
al... | go | func (actor Actor) DisablePlanForOrg(serviceName, servicePlanName, orgName, brokerName string) (Warnings, error) {
servicePlans, allWarnings, err := actor.GetServicePlansForService(serviceName, brokerName)
if err != nil {
return allWarnings, err
}
org, orgWarnings, err := actor.GetOrganizationByName(orgName)
al... | [
"func",
"(",
"actor",
"Actor",
")",
"DisablePlanForOrg",
"(",
"serviceName",
",",
"servicePlanName",
",",
"orgName",
",",
"brokerName",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"servicePlans",
",",
"allWarnings",
",",
"err",
":=",
"actor",
"."... | // DisablePlanForOrg disables access to a specific plan of the given service from the given broker in a specific org. | [
"DisablePlanForOrg",
"disables",
"access",
"to",
"a",
"specific",
"plan",
"of",
"the",
"given",
"service",
"from",
"the",
"given",
"broker",
"in",
"a",
"specific",
"org",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_access.go#L202-L231 |
26,193 | cloudfoundry/cli | integration/helpers/service_instance.go | ManagedServiceInstanceGUID | func ManagedServiceInstanceGUID(managedServiceInstanceName string) string {
session := CF("curl", fmt.Sprintf("/v2/service_instances?q=name:%s", managedServiceInstanceName))
Eventually(session).Should(Exit(0))
rawJSON := strings.TrimSpace(string(session.Out.Contents()))
var serviceInstanceGUID ServiceInstanceGUID... | go | func ManagedServiceInstanceGUID(managedServiceInstanceName string) string {
session := CF("curl", fmt.Sprintf("/v2/service_instances?q=name:%s", managedServiceInstanceName))
Eventually(session).Should(Exit(0))
rawJSON := strings.TrimSpace(string(session.Out.Contents()))
var serviceInstanceGUID ServiceInstanceGUID... | [
"func",
"ManagedServiceInstanceGUID",
"(",
"managedServiceInstanceName",
"string",
")",
"string",
"{",
"session",
":=",
"CF",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"managedServiceInstanceName",
")",
")",
"\n",
"Eventually",
"(",
"s... | // ManagedServiceInstanceGUID returns the GUID for a managed service instance. | [
"ManagedServiceInstanceGUID",
"returns",
"the",
"GUID",
"for",
"a",
"managed",
"service",
"instance",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/service_instance.go#L21-L33 |
26,194 | cloudfoundry/cli | api/uaa/wrapper/uaa_authentication.go | Make | func (t *UAAAuthentication) Make(request *http.Request, passedResponse *uaa.Response) error {
if t.client == nil {
return t.connection.Make(request, passedResponse)
}
var err error
var rawRequestBody []byte
if request.Body != nil {
rawRequestBody, err = ioutil.ReadAll(request.Body)
defer request.Body.Close... | go | func (t *UAAAuthentication) Make(request *http.Request, passedResponse *uaa.Response) error {
if t.client == nil {
return t.connection.Make(request, passedResponse)
}
var err error
var rawRequestBody []byte
if request.Body != nil {
rawRequestBody, err = ioutil.ReadAll(request.Body)
defer request.Body.Close... | [
"func",
"(",
"t",
"*",
"UAAAuthentication",
")",
"Make",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"passedResponse",
"*",
"uaa",
".",
"Response",
")",
"error",
"{",
"if",
"t",
".",
"client",
"==",
"nil",
"{",
"return",
"t",
".",
"connection",
... | // Make adds authentication headers to the passed in request and then calls the
// wrapped connection's Make | [
"Make",
"adds",
"authentication",
"headers",
"to",
"the",
"passed",
"in",
"request",
"and",
"then",
"calls",
"the",
"wrapped",
"connection",
"s",
"Make"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/wrapper/uaa_authentication.go#L48-L90 |
26,195 | cloudfoundry/cli | api/uaa/wrapper/uaa_authentication.go | skipAuthenticationHeader | func skipAuthenticationHeader(request *http.Request, body []byte) bool {
stringBody := string(body)
return strings.Contains(request.URL.String(), "/oauth/token") &&
request.Method == http.MethodPost &&
(strings.Contains(stringBody, "grant_type=refresh_token") ||
strings.Contains(stringBody, "grant_type=passwo... | go | func skipAuthenticationHeader(request *http.Request, body []byte) bool {
stringBody := string(body)
return strings.Contains(request.URL.String(), "/oauth/token") &&
request.Method == http.MethodPost &&
(strings.Contains(stringBody, "grant_type=refresh_token") ||
strings.Contains(stringBody, "grant_type=passwo... | [
"func",
"skipAuthenticationHeader",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"body",
"[",
"]",
"byte",
")",
"bool",
"{",
"stringBody",
":=",
"string",
"(",
"body",
")",
"\n\n",
"return",
"strings",
".",
"Contains",
"(",
"request",
".",
"URL",
".... | // The authentication header is not added to token refresh requests or login
// requests. | [
"The",
"authentication",
"header",
"is",
"not",
"added",
"to",
"token",
"refresh",
"requests",
"or",
"login",
"requests",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/wrapper/uaa_authentication.go#L105-L113 |
26,196 | cloudfoundry/cli | api/plugin/plugin_connection.go | NewConnection | func NewConnection(skipSSLValidation bool, dialTimeout time.Duration) *PluginConnection {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: skipSSLValidation,
},
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}... | go | func NewConnection(skipSSLValidation bool, dialTimeout time.Duration) *PluginConnection {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: skipSSLValidation,
},
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}... | [
"func",
"NewConnection",
"(",
"skipSSLValidation",
"bool",
",",
"dialTimeout",
"time",
".",
"Duration",
")",
"*",
"PluginConnection",
"{",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"InsecureSkipVeri... | // NewConnection returns a new PluginConnection | [
"NewConnection",
"returns",
"a",
"new",
"PluginConnection"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/plugin/plugin_connection.go#L25-L40 |
26,197 | cloudfoundry/cli | actor/v2action/service.go | GetService | func (actor Actor) GetService(serviceGUID string) (Service, Warnings, error) {
service, warnings, err := actor.CloudControllerClient.GetService(serviceGUID)
return Service(service), Warnings(warnings), err
} | go | func (actor Actor) GetService(serviceGUID string) (Service, Warnings, error) {
service, warnings, err := actor.CloudControllerClient.GetService(serviceGUID)
return Service(service), Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetService",
"(",
"serviceGUID",
"string",
")",
"(",
"Service",
",",
"Warnings",
",",
"error",
")",
"{",
"service",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetService",
"(",
"serv... | // GetService fetches a service by GUID. | [
"GetService",
"fetches",
"a",
"service",
"by",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service.go#L19-L22 |
26,198 | cloudfoundry/cli | actor/v2action/service.go | GetServicesWithPlans | func (actor Actor) GetServicesWithPlans(filters ...Filter) (ServicesWithPlans, Warnings, error) {
ccv2Filters := []ccv2.Filter{}
for _, f := range filters {
ccv2Filters = append(ccv2Filters, ccv2.Filter(f))
}
var allWarnings Warnings
services, warnings, err := actor.CloudControllerClient.GetServices(ccv2Filter... | go | func (actor Actor) GetServicesWithPlans(filters ...Filter) (ServicesWithPlans, Warnings, error) {
ccv2Filters := []ccv2.Filter{}
for _, f := range filters {
ccv2Filters = append(ccv2Filters, ccv2.Filter(f))
}
var allWarnings Warnings
services, warnings, err := actor.CloudControllerClient.GetServices(ccv2Filter... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServicesWithPlans",
"(",
"filters",
"...",
"Filter",
")",
"(",
"ServicesWithPlans",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2Filters",
":=",
"[",
"]",
"ccv2",
".",
"Filter",
"{",
"}",
"\n",
"for",
"_",
",",
... | // GetServicesWithPlans returns a map of Services to ServicePlans for a particular broker.
// A particular service with associated plans from a broker can be fetched by additionally providing
// a service label filter. | [
"GetServicesWithPlans",
"returns",
"a",
"map",
"of",
"Services",
"to",
"ServicePlans",
"for",
"a",
"particular",
"broker",
".",
"A",
"particular",
"service",
"with",
"associated",
"plans",
"from",
"a",
"broker",
"can",
"be",
"fetched",
"by",
"additionally",
"pro... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service.go#L93-L128 |
26,199 | cloudfoundry/cli | actor/v2action/service.go | ServiceExistsWithName | func (actor Actor) ServiceExistsWithName(serviceName string) (bool, Warnings, error) {
services, warnings, err := actor.CloudControllerClient.GetServices(ccv2.Filter{
Type: constant.LabelFilter,
Operator: constant.EqualOperator,
Values: []string{serviceName},
})
if err != nil {
return false, Warnings(w... | go | func (actor Actor) ServiceExistsWithName(serviceName string) (bool, Warnings, error) {
services, warnings, err := actor.CloudControllerClient.GetServices(ccv2.Filter{
Type: constant.LabelFilter,
Operator: constant.EqualOperator,
Values: []string{serviceName},
})
if err != nil {
return false, Warnings(w... | [
"func",
"(",
"actor",
"Actor",
")",
"ServiceExistsWithName",
"(",
"serviceName",
"string",
")",
"(",
"bool",
",",
"Warnings",
",",
"error",
")",
"{",
"services",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"GetServices",
"(... | // ServiceExistsWithName returns true if there is an Organization with the
// provided name, otherwise false. | [
"ServiceExistsWithName",
"returns",
"true",
"if",
"there",
"is",
"an",
"Organization",
"with",
"the",
"provided",
"name",
"otherwise",
"false",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service.go#L132-L147 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.