repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
cloudfoundry/cli | integration/helpers/matchers.go | SayPath | func SayPath(format string, path string) types.GomegaMatcher {
theRealDir, err := filepath.EvalSymlinks(filepath.Dir(path))
Expect(err).ToNot(HaveOccurred())
theRealPath := filepath.Join(theRealDir, filepath.Base(path))
if runtime.GOOS == "windows" {
expected := "(?i)" + format
expected = fmt.Sprintf(expected,... | go | func SayPath(format string, path string) types.GomegaMatcher {
theRealDir, err := filepath.EvalSymlinks(filepath.Dir(path))
Expect(err).ToNot(HaveOccurred())
theRealPath := filepath.Join(theRealDir, filepath.Base(path))
if runtime.GOOS == "windows" {
expected := "(?i)" + format
expected = fmt.Sprintf(expected,... | [
"func",
"SayPath",
"(",
"format",
"string",
",",
"path",
"string",
")",
"types",
".",
"GomegaMatcher",
"{",
"theRealDir",
",",
"err",
":=",
"filepath",
".",
"EvalSymlinks",
"(",
"filepath",
".",
"Dir",
"(",
"path",
")",
")",
"\n",
"Expect",
"(",
"err",
... | // SayPath is used to assert that a path is printed. On Windows, it uses a
// case-insensitive match and escapes the path. On non-Windows, it evaluates
// the base directory of the path for symlniks. | [
"SayPath",
"is",
"used",
"to",
"assert",
"that",
"a",
"path",
"is",
"printed",
".",
"On",
"Windows",
"it",
"uses",
"a",
"case",
"-",
"insensitive",
"match",
"and",
"escapes",
"the",
"path",
".",
"On",
"non",
"-",
"Windows",
"it",
"evaluates",
"the",
"b... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/matchers.go#L19-L30 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | CreateBuildpack | func (client *Client) CreateBuildpack(buildpack Buildpack) (Buildpack, Warnings, error) {
body, err := json.Marshal(buildpack)
if err != nil {
return Buildpack{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildpackRequest,
Body: bytes.NewReader(body),
... | go | func (client *Client) CreateBuildpack(buildpack Buildpack) (Buildpack, Warnings, error) {
body, err := json.Marshal(buildpack)
if err != nil {
return Buildpack{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildpackRequest,
Body: bytes.NewReader(body),
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateBuildpack",
"(",
"buildpack",
"Buildpack",
")",
"(",
"Buildpack",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"buildpack",
")",
"\n",
"if",
"err",
"!=... | // CreateBuildpack creates a new buildpack. | [
"CreateBuildpack",
"creates",
"a",
"new",
"buildpack",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L76-L97 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | GetBuildpacks | func (client *Client) GetBuildpacks(filters ...Filter) ([]Buildpack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildpacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var buildpacks []Buildpack
warn... | go | func (client *Client) GetBuildpacks(filters ...Filter) ([]Buildpack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildpacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var buildpacks []Buildpack
warn... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetBuildpacks",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Buildpack",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{... | // GetBuildpacks searches for a buildpack with the given name and returns it if it exists. | [
"GetBuildpacks",
"searches",
"for",
"a",
"buildpack",
"with",
"the",
"given",
"name",
"and",
"returns",
"it",
"if",
"it",
"exists",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L100-L124 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | UploadBuildpack | func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (Warnings, error) {
contentLength, err := buildpacks.CalculateRequestSize(buildpackLength, buildpackPath, "buildpack")
if err != nil {
return nil, err
}
contentType, body, writeErrors :=... | go | func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (Warnings, error) {
contentLength, err := buildpacks.CalculateRequestSize(buildpackLength, buildpackPath, "buildpack")
if err != nil {
return nil, err
}
contentType, body, writeErrors :=... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UploadBuildpack",
"(",
"buildpackGUID",
"string",
",",
"buildpackPath",
"string",
",",
"buildpack",
"io",
".",
"Reader",
",",
"buildpackLength",
"int64",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"contentLength",... | // UploadBuildpack uploads the contents of a buildpack zip to the server. | [
"UploadBuildpack",
"uploads",
"the",
"contents",
"of",
"a",
"buildpack",
"zip",
"to",
"the",
"server",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L158-L185 | train |
cloudfoundry/cli | util/sorting/alphabetic.go | LessIgnoreCase | func LessIgnoreCase(first string, second string) bool {
iRunes := []rune(first)
jRunes := []rune(second)
max := len(iRunes)
if max > len(jRunes) {
max = len(jRunes)
}
for idx := 0; idx < max; idx++ {
ir := iRunes[idx]
jr := jRunes[idx]
lir := unicode.ToLower(ir)
ljr := unicode.ToLower(jr)
if lir =... | go | func LessIgnoreCase(first string, second string) bool {
iRunes := []rune(first)
jRunes := []rune(second)
max := len(iRunes)
if max > len(jRunes) {
max = len(jRunes)
}
for idx := 0; idx < max; idx++ {
ir := iRunes[idx]
jr := jRunes[idx]
lir := unicode.ToLower(ir)
ljr := unicode.ToLower(jr)
if lir =... | [
"func",
"LessIgnoreCase",
"(",
"first",
"string",
",",
"second",
"string",
")",
"bool",
"{",
"iRunes",
":=",
"[",
"]",
"rune",
"(",
"first",
")",
"\n",
"jRunes",
":=",
"[",
"]",
"rune",
"(",
"second",
")",
"\n\n",
"max",
":=",
"len",
"(",
"iRunes",
... | // LessIgnoreCase returns true if first is alphabetically less than second. | [
"LessIgnoreCase",
"returns",
"true",
"if",
"first",
"is",
"alphabetically",
"less",
"than",
"second",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/sorting/alphabetic.go#L10-L34 | train |
cloudfoundry/cli | actor/v2action/security_group.go | GetSpaceRunningSecurityGroupsBySpace | func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceRunningSecurityGroupsBySpace",
"(",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2SecurityGroups",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudC... | // GetSpaceRunningSecurityGroupsBySpace returns a list of all security groups
// bound to this space in the 'running' lifecycle phase. | [
"GetSpaceRunningSecurityGroupsBySpace",
"returns",
"a",
"list",
"of",
"all",
"security",
"groups",
"bound",
"to",
"this",
"space",
"in",
"the",
"running",
"lifecycle",
"phase",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/security_group.go#L236-L239 | train |
cloudfoundry/cli | actor/v2action/security_group.go | GetSpaceStagingSecurityGroupsBySpace | func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceStagingSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceStagingSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceStagingSecurityGroupsBySpace",
"(",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2SecurityGroups",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudC... | // GetSpaceStagingSecurityGroupsBySpace returns a list of all security groups
// bound to this space in the 'staging' lifecycle phase. with an optional | [
"GetSpaceStagingSecurityGroupsBySpace",
"returns",
"a",
"list",
"of",
"all",
"security",
"groups",
"bound",
"to",
"this",
"space",
"in",
"the",
"staging",
"lifecycle",
"phase",
".",
"with",
"an",
"optional"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/security_group.go#L243-L246 | train |
cloudfoundry/cli | cf/util/downloader/file_download.go | DownloadFile | func (d *downloader) DownloadFile(url string) (int64, string, error) {
c := http.Client{
CheckRedirect: func(r *http.Request, via []*http.Request) error {
r.URL.Opaque = r.URL.Path
//some redirect return '/' as url
if strings.Trim(r.URL.Opaque, "/") != "" {
url = r.URL.Opaque
}
return nil
},
... | go | func (d *downloader) DownloadFile(url string) (int64, string, error) {
c := http.Client{
CheckRedirect: func(r *http.Request, via []*http.Request) error {
r.URL.Opaque = r.URL.Path
//some redirect return '/' as url
if strings.Trim(r.URL.Opaque, "/") != "" {
url = r.URL.Opaque
}
return nil
},
... | [
"func",
"(",
"d",
"*",
"downloader",
")",
"DownloadFile",
"(",
"url",
"string",
")",
"(",
"int64",
",",
"string",
",",
"error",
")",
"{",
"c",
":=",
"http",
".",
"Client",
"{",
"CheckRedirect",
":",
"func",
"(",
"r",
"*",
"http",
".",
"Request",
",... | //this func returns byte written, filename and error | [
"this",
"func",
"returns",
"byte",
"written",
"filename",
"and",
"error"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/util/downloader/file_download.go#L32-L76 | train |
cloudfoundry/cli | api/cloudcontroller/ccv2/paginated_resources.go | Resources | func (pr PaginatedResources) Resources() ([]interface{}, error) {
slicePtr := reflect.New(reflect.SliceOf(pr.resourceType))
err := json.Unmarshal([]byte(pr.ResourcesBytes), slicePtr.Interface())
slice := reflect.Indirect(slicePtr)
contents := make([]interface{}, 0, slice.Len())
for i := 0; i < slice.Len(); i++ {
... | go | func (pr PaginatedResources) Resources() ([]interface{}, error) {
slicePtr := reflect.New(reflect.SliceOf(pr.resourceType))
err := json.Unmarshal([]byte(pr.ResourcesBytes), slicePtr.Interface())
slice := reflect.Indirect(slicePtr)
contents := make([]interface{}, 0, slice.Len())
for i := 0; i < slice.Len(); i++ {
... | [
"func",
"(",
"pr",
"PaginatedResources",
")",
"Resources",
"(",
")",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"slicePtr",
":=",
"reflect",
".",
"New",
"(",
"reflect",
".",
"SliceOf",
"(",
"pr",
".",
"resourceType",
")",
")",
"\n"... | // Resources unmarshals JSON representing a page of resources and returns a
// slice of the given resource type. | [
"Resources",
"unmarshals",
"JSON",
"representing",
"a",
"page",
"of",
"resources",
"and",
"returns",
"a",
"slice",
"of",
"the",
"given",
"resource",
"type",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/paginated_resources.go#L29-L39 | train |
cloudfoundry/cli | actor/v2action/space.go | GetSpaceByOrganizationAndName | func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error) {
ccv2Spaces, warnings, err := actor.CloudControllerClient.GetSpaces(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{spaceName},
},
ccv2.Filter{
... | go | func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error) {
ccv2Spaces, warnings, err := actor.CloudControllerClient.GetSpaces(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{spaceName},
},
ccv2.Filter{
... | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceByOrganizationAndName",
"(",
"orgGUID",
"string",
",",
"spaceName",
"string",
")",
"(",
"Space",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2Spaces",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudContro... | // GetSpaceByOrganizationAndName returns an Space based on the org and name. | [
"GetSpaceByOrganizationAndName",
"returns",
"an",
"Space",
"based",
"on",
"the",
"org",
"and",
"name",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L101-L127 | train |
cloudfoundry/cli | actor/v2action/space.go | GrantSpaceManagerByUsername | func (actor Actor) GrantSpaceManagerByUsername(orgGUID string, spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
return actor.grantSpaceManagerByClientCredentials(orgGUID, spaceGUID, username)
}
return actor.grantSpaceManagerByUs... | go | func (actor Actor) GrantSpaceManagerByUsername(orgGUID string, spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
return actor.grantSpaceManagerByClientCredentials(orgGUID, spaceGUID, username)
}
return actor.grantSpaceManagerByUs... | [
"func",
"(",
"actor",
"Actor",
")",
"GrantSpaceManagerByUsername",
"(",
"orgGUID",
"string",
",",
"spaceGUID",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"if",
"actor",
".",
"Config",
".",
"UAAGrantType",
"(",
")",
"... | // GrantSpaceManagerByUsername makes the provided user a Space Manager in the
// space with the provided guid. | [
"GrantSpaceManagerByUsername",
"makes",
"the",
"provided",
"user",
"a",
"Space",
"Manager",
"in",
"the",
"space",
"with",
"the",
"provided",
"guid",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L131-L137 | train |
cloudfoundry/cli | actor/v2action/space.go | GrantSpaceDeveloperByUsername | func (actor Actor) GrantSpaceDeveloperByUsername(spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
warnings, err := actor.CloudControllerClient.UpdateSpaceDeveloper(spaceGUID, username)
return Warnings(warnings), err
}
warning... | go | func (actor Actor) GrantSpaceDeveloperByUsername(spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
warnings, err := actor.CloudControllerClient.UpdateSpaceDeveloper(spaceGUID, username)
return Warnings(warnings), err
}
warning... | [
"func",
"(",
"actor",
"Actor",
")",
"GrantSpaceDeveloperByUsername",
"(",
"spaceGUID",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"if",
"actor",
".",
"Config",
".",
"UAAGrantType",
"(",
")",
"==",
"string",
"(",
"uaa... | // GrantSpaceDeveloperByUsername makes the provided user a Space Developer in the
// space with the provided guid. | [
"GrantSpaceDeveloperByUsername",
"makes",
"the",
"provided",
"user",
"a",
"Space",
"Developer",
"in",
"the",
"space",
"with",
"the",
"provided",
"guid",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L170-L179 | train |
cloudfoundry/cli | actor/v2action/user.go | CreateUser | func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error) {
uaaUser, err := actor.UAAClient.CreateUser(username, password, origin)
if err != nil {
return User{}, nil, err
}
ccUser, ccWarnings, err := actor.CloudControllerClient.CreateUser(uaaUser.ID)
return User(ccU... | go | func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error) {
uaaUser, err := actor.UAAClient.CreateUser(username, password, origin)
if err != nil {
return User{}, nil, err
}
ccUser, ccWarnings, err := actor.CloudControllerClient.CreateUser(uaaUser.ID)
return User(ccU... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateUser",
"(",
"username",
"string",
",",
"password",
"string",
",",
"origin",
"string",
")",
"(",
"User",
",",
"Warnings",
",",
"error",
")",
"{",
"uaaUser",
",",
"err",
":=",
"actor",
".",
"UAAClient",
".",
"Cr... | // CreateUser creates a new user in UAA and registers it with cloud controller. | [
"CreateUser",
"creates",
"a",
"new",
"user",
"in",
"UAA",
"and",
"registers",
"it",
"with",
"cloud",
"controller",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/user.go#L9-L18 | train |
cloudfoundry/cli | command/v6/shared/new_networking_client.go | NewNetworkingClient | func NewNetworkingClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) (*cfnetv1.Client, error) {
if apiURL == "" {
return nil, translatableerror.CFNetworkingEndpointNotFoundError{}
}
wrappers := []cfnetv1.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
wr... | go | func NewNetworkingClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) (*cfnetv1.Client, error) {
if apiURL == "" {
return nil, translatableerror.CFNetworkingEndpointNotFoundError{}
}
wrappers := []cfnetv1.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
wr... | [
"func",
"NewNetworkingClient",
"(",
"apiURL",
"string",
",",
"config",
"command",
".",
"Config",
",",
"uaaClient",
"*",
"uaa",
".",
"Client",
",",
"ui",
"command",
".",
"UI",
")",
"(",
"*",
"cfnetv1",
".",
"Client",
",",
"error",
")",
"{",
"if",
"apiUR... | // NewNetworkingClient creates a new cfnetworking client. | [
"NewNetworkingClient",
"creates",
"a",
"new",
"cfnetworking",
"client",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/new_networking_client.go#L12-L40 | train |
cloudfoundry/cli | actor/v2action/service_plan.go | GetServicePlansForService | func (actor Actor) GetServicePlansForService(serviceName, brokerName string) ([]ServicePlan, Warnings, error) {
service, allWarnings, err := actor.GetServiceByNameAndBrokerName(serviceName, brokerName)
if err != nil {
return []ServicePlan{}, allWarnings, err
}
servicePlans, warnings, err := actor.CloudController... | go | func (actor Actor) GetServicePlansForService(serviceName, brokerName string) ([]ServicePlan, Warnings, error) {
service, allWarnings, err := actor.GetServiceByNameAndBrokerName(serviceName, brokerName)
if err != nil {
return []ServicePlan{}, allWarnings, err
}
servicePlans, warnings, err := actor.CloudController... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServicePlansForService",
"(",
"serviceName",
",",
"brokerName",
"string",
")",
"(",
"[",
"]",
"ServicePlan",
",",
"Warnings",
",",
"error",
")",
"{",
"service",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"Ge... | // GetServicePlansForService returns a list of plans associated with the service and the broker if provided | [
"GetServicePlansForService",
"returns",
"a",
"list",
"of",
"plans",
"associated",
"with",
"the",
"service",
"and",
"the",
"broker",
"if",
"provided"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_plan.go#L17-L39 | train |
cloudfoundry/cli | cf/terminal/table.go | NewTable | func NewTable(headers []string) *Table {
pt := &Table{
headers: headers,
columnWidth: make([]int, len(headers)),
colSpacing: " ",
transformer: make([]Transformer, len(headers)),
}
// Standard colorization, column 0 is auto-highlighted as some
// name. Everything else has no transformation (== identit... | go | func NewTable(headers []string) *Table {
pt := &Table{
headers: headers,
columnWidth: make([]int, len(headers)),
colSpacing: " ",
transformer: make([]Transformer, len(headers)),
}
// Standard colorization, column 0 is auto-highlighted as some
// name. Everything else has no transformation (== identit... | [
"func",
"NewTable",
"(",
"headers",
"[",
"]",
"string",
")",
"*",
"Table",
"{",
"pt",
":=",
"&",
"Table",
"{",
"headers",
":",
"headers",
",",
"columnWidth",
":",
"make",
"(",
"[",
"]",
"int",
",",
"len",
"(",
"headers",
")",
")",
",",
"colSpacing"... | // NewTable is the constructor function creating a new printable table
// from a list of headers. The table is also connected to a UI, which
// is where it will print itself to on demand. | [
"NewTable",
"is",
"the",
"constructor",
"function",
"creating",
"a",
"new",
"printable",
"table",
"from",
"a",
"list",
"of",
"headers",
".",
"The",
"table",
"is",
"also",
"connected",
"to",
"a",
"UI",
"which",
"is",
"where",
"it",
"will",
"print",
"itself"... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L32-L49 | train |
cloudfoundry/cli | cf/terminal/table.go | SetTransformer | func (t *Table) SetTransformer(columnIndex int, tr Transformer) {
t.transformer[columnIndex] = tr
} | go | func (t *Table) SetTransformer(columnIndex int, tr Transformer) {
t.transformer[columnIndex] = tr
} | [
"func",
"(",
"t",
"*",
"Table",
")",
"SetTransformer",
"(",
"columnIndex",
"int",
",",
"tr",
"Transformer",
")",
"{",
"t",
".",
"transformer",
"[",
"columnIndex",
"]",
"=",
"tr",
"\n",
"}"
] | // SetTransformer specifies a string transformer to apply to the
// content of the given column in the specified table. | [
"SetTransformer",
"specifies",
"a",
"string",
"transformer",
"to",
"apply",
"to",
"the",
"content",
"of",
"the",
"given",
"column",
"in",
"the",
"specified",
"table",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L61-L63 | train |
cloudfoundry/cli | cf/terminal/table.go | Add | func (t *Table) Add(row ...string) {
t.rows = append(t.rows, row)
} | go | func (t *Table) Add(row ...string) {
t.rows = append(t.rows, row)
} | [
"func",
"(",
"t",
"*",
"Table",
")",
"Add",
"(",
"row",
"...",
"string",
")",
"{",
"t",
".",
"rows",
"=",
"append",
"(",
"t",
".",
"rows",
",",
"row",
")",
"\n",
"}"
] | // Add extends the table by another row. | [
"Add",
"extends",
"the",
"table",
"by",
"another",
"row",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L66-L68 | train |
cloudfoundry/cli | cf/terminal/table.go | printRow | func (t *Table) printRow(result io.Writer, transformer rowTransformer, rowIndex int, row []string) error {
height := t.rowHeight[rowIndex]
// Compute the index of the last column as the min number of
// cells in the header and cells in the current row.
// Note: math.Min seems to be for float only :(
last := len(... | go | func (t *Table) printRow(result io.Writer, transformer rowTransformer, rowIndex int, row []string) error {
height := t.rowHeight[rowIndex]
// Compute the index of the last column as the min number of
// cells in the header and cells in the current row.
// Note: math.Min seems to be for float only :(
last := len(... | [
"func",
"(",
"t",
"*",
"Table",
")",
"printRow",
"(",
"result",
"io",
".",
"Writer",
",",
"transformer",
"rowTransformer",
",",
"rowIndex",
"int",
",",
"row",
"[",
"]",
"string",
")",
"error",
"{",
"height",
":=",
"t",
".",
"rowHeight",
"[",
"rowIndex"... | // printRow is responsible for the layouting, transforming and
// printing of the string in a single row | [
"printRow",
"is",
"responsible",
"for",
"the",
"layouting",
"transforming",
"and",
"printing",
"of",
"the",
"string",
"in",
"a",
"single",
"row"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L179-L255 | train |
cloudfoundry/cli | cf/terminal/table.go | printCellValue | func (t *Table) printCellValue(result io.Writer, transformer rowTransformer, col, last int, value string) error {
value = trim(transformer.Transform(col, trim(value)))
fmt.Fprint(result, value)
// Pad all columns, but the last in this row (with the size of
// the header row limiting this). This ensures that most o... | go | func (t *Table) printCellValue(result io.Writer, transformer rowTransformer, col, last int, value string) error {
value = trim(transformer.Transform(col, trim(value)))
fmt.Fprint(result, value)
// Pad all columns, but the last in this row (with the size of
// the header row limiting this). This ensures that most o... | [
"func",
"(",
"t",
"*",
"Table",
")",
"printCellValue",
"(",
"result",
"io",
".",
"Writer",
",",
"transformer",
"rowTransformer",
",",
"col",
",",
"last",
"int",
",",
"value",
"string",
")",
"error",
"{",
"value",
"=",
"trim",
"(",
"transformer",
".",
"... | // printCellValue pads the specified string to the width of the given
// column, adds the spacing bewtween columns, and returns the result. | [
"printCellValue",
"pads",
"the",
"specified",
"string",
"to",
"the",
"width",
"of",
"the",
"given",
"column",
"adds",
"the",
"spacing",
"bewtween",
"columns",
"and",
"returns",
"the",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L259-L300 | train |
cloudfoundry/cli | cf/terminal/table.go | Transform | func (th *transformHeader) Transform(column int, s string) string {
return HeaderColor(s)
} | go | func (th *transformHeader) Transform(column int, s string) string {
return HeaderColor(s)
} | [
"func",
"(",
"th",
"*",
"transformHeader",
")",
"Transform",
"(",
"column",
"int",
",",
"s",
"string",
")",
"string",
"{",
"return",
"HeaderColor",
"(",
"s",
")",
"\n",
"}"
] | // Transform performs the Header highlighting for transformHeader | [
"Transform",
"performs",
"the",
"Header",
"highlighting",
"for",
"transformHeader"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L318-L320 | train |
cloudfoundry/cli | cf/terminal/table.go | visibleSize | func visibleSize(s string) (int, error) {
// This code re-implements the basic functionality of
// RuneCountInString to account for special cases. Namely
// UTF-8 characters taking up 3 bytes (**) appear as double-width.
//
// (**) I wonder if that is the set of characters outside of
// the BMP <=> the set of cha... | go | func visibleSize(s string) (int, error) {
// This code re-implements the basic functionality of
// RuneCountInString to account for special cases. Namely
// UTF-8 characters taking up 3 bytes (**) appear as double-width.
//
// (**) I wonder if that is the set of characters outside of
// the BMP <=> the set of cha... | [
"func",
"visibleSize",
"(",
"s",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"// This code re-implements the basic functionality of",
"// RuneCountInString to account for special cases. Namely",
"// UTF-8 characters taking up 3 bytes (**) appear as double-width.",
"//",
"// (*... | // visibleSize returns the number of columns the string will cover
// when displayed in the terminal. This is the number of runes,
// i.e. characters, not the number of bytes it consists of. | [
"visibleSize",
"returns",
"the",
"number",
"of",
"columns",
"the",
"string",
"will",
"cover",
"when",
"displayed",
"in",
"the",
"terminal",
".",
"This",
"is",
"the",
"number",
"of",
"runes",
"i",
".",
"e",
".",
"characters",
"not",
"the",
"number",
"of",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L344-L370 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | DeleteIsolationSegmentOrganization | func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteIsolationSegmentRelationshipOrganizationRequest,
URIParams: internal.Params{"isolation_segment_guid": isolati... | go | func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteIsolationSegmentRelationshipOrganizationRequest,
URIParams: internal.Params{"isolation_segment_guid": isolati... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteIsolationSegmentOrganization",
"(",
"isolationSegmentGUID",
"string",
",",
"orgGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"... | // DeleteIsolationSegmentOrganization will delete the relationship between
// the isolation segment and the organization provided. | [
"DeleteIsolationSegmentOrganization",
"will",
"delete",
"the",
"relationship",
"between",
"the",
"isolation",
"segment",
"and",
"the",
"organization",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L53-L66 | train |
cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | DeleteServiceInstanceRelationshipsSharedSpace | func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteServiceInstanceRelationshipsSharedSpaceRequest,
URIParams: internal.Params{"service_instance_guid... | go | func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteServiceInstanceRelationshipsSharedSpaceRequest,
URIParams: internal.Params{"service_instance_guid... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteServiceInstanceRelationshipsSharedSpace",
"(",
"serviceInstanceGUID",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest"... | // DeleteServiceInstanceRelationshipsSharedSpace will delete the sharing relationship
// between the service instance and the shared-to space provided. | [
"DeleteServiceInstanceRelationshipsSharedSpace",
"will",
"delete",
"the",
"sharing",
"relationship",
"between",
"the",
"service",
"instance",
"and",
"the",
"shared",
"-",
"to",
"space",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L70-L82 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.