_id stringlengths 2 7 | title stringlengths 1 118 | partition stringclasses 3
values | text stringlengths 52 85.5k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q26000 | GetRoutes | train | func (client *Client) GetRoutes(filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRoutesRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullRoutesList []Route
warnings, err := ... | go | {
"resource": ""
} |
q26001 | GetSpaceRoutes | train | func (client *Client) GetSpaceRoutes(spaceGUID string, filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
Query: ConvertFilterParameters(filters),
})
if... | go | {
"resource": ""
} |
q26002 | UpdateRouteApplication | train | func (client *Client) UpdateRouteApplication(routeGUID string, appGUID string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
r... | go | {
"resource": ""
} |
q26003 | CreateApplicationProcessScale | train | func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error) {
body, err := json.Marshal(process)
if err != nil {
return Process{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationProcessActionScaleRequest,... | go | {
"resource": ""
} |
q26004 | GetApplicationProcessByType | train | func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationProcessRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"type": processType,
},
})
if... | go | {
"resource": ""
} |
q26005 | UpdateProcess | train | func (client *Client) UpdateProcess(process Process) (Process, Warnings, error) {
body, err := json.Marshal(Process{
Command: process.Command,
HealthCheckType: process.HealthCheckType,
HealthCheckEndpoint: process.HealthCheckEndpoint,
HealthCheckTimeout: pro... | go | {
"resource": ""
} |
q26006 | GetServiceInstanceSharedTos | train | func (client *Client) GetServiceInstanceSharedTos(serviceInstanceGUID string) ([]ServiceInstanceSharedTo, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceSharedToRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err... | go | {
"resource": ""
} |
q26007 | NewConnection | train | func NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection {
tr := &http.Transport{
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}).DialContext,
DisableKeepAlives: disableKeepAlives,
Proxy: http.ProxyFromEnvi... | go | {
"resource": ""
} |
q26008 | Make | train | func (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error {
// In case this function is called from a retry, passedResponse may already
// be populated with a previous response. We reset in case there's an HTTP
// error and we don't repopulate it in populateResponse.
passedRespons... | go | {
"resource": ""
} |
q26009 | UnmarshalJSON | train | func (event *Event) UnmarshalJSON(data []byte) error {
var ccEvent struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Type string `json:"type,omitempty"`
ActorGUID string `json:"actor,omitempty"`
ActorType string `json:"actor_type,o... | go | {
"resource": ""
} |
q26010 | GetEvents | train | func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetEventsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullEventsList []Event
warnings, err := ... | go | {
"resource": ""
} |
q26011 | UnmarshalJSON | train | func (r *V2FormattedResource) UnmarshalJSON(data []byte) error {
var ccResource struct {
Filename string `json:"fn,omitempty"`
Mode string `json:"mode,omitempty"`
SHA1 string `json:"sha1"`
Size int64 `json:"size"`
}
err := cloudcontroller.DecodeJSON(data, &ccResource)
if err != nil {
return ... | go | {
"resource": ""
} |
q26012 | Authenticate | train | func (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error) {
requestBody := url.Values{
"grant_type": {string(grantType)},
}
for k, v := range creds {
requestBody.Set(k, v)
}
type loginHint struct {
Origin string `json:"origin"`
}
orig... | go | {
"resource": ""
} |
q26013 | UnmarshalJSON | train | func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
var ccOrgQuota struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
if err != nil {
return err
}
application.GU... | go | {
"resource": ""
} |
q26014 | GetOrganizationQuota | train | func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionRequest,
URIParams: Params{"organization_quota_guid": guid},
})
if err != nil {
return OrganizationQuota{}, ... | go | {
"resource": ""
} |
q26015 | GetOrganizationQuotas | train | func (client *Client) GetOrganizationQuotas(filters ...Filter) ([]OrganizationQuota, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionsRequest,
Query: allQueries,
})
if err != nil {
... | go | {
"resource": ""
} |
q26016 | GetProcessByTypeAndApplication | train | func (actor Actor) GetProcessByTypeAndApplication(processType string, appGUID string) (Process, Warnings, error) {
process, warnings, err := actor.CloudControllerClient.GetApplicationProcessByType(appGUID, processType)
if _, ok := err.(ccerror.ProcessNotFoundError); ok {
return Process{}, Warnings(warnings), action... | go | {
"resource": ""
} |
q26017 | ParseValue | train | func (n *FilteredString) ParseValue(val string) {
if val == "" {
n.IsSet = false
n.Value = ""
return
}
n.IsSet = true
switch val {
case "null", "default":
n.Value = ""
default:
n.Value = val
}
} | go | {
"resource": ""
} |
q26018 | MarshalJSON | train | func (n FilteredString) MarshalJSON() ([]byte, error) {
if n.Value != "" {
return json.Marshal(n.Value)
}
return json.Marshal(new(json.RawMessage))
} | go | {
"resource": ""
} |
q26019 | DecodeJSON | train | func DecodeJSON(raw []byte, v interface{}) error {
decoder := json.NewDecoder(bytes.NewBuffer(raw))
decoder.UseNumber()
return decoder.Decode(v)
} | go | {
"resource": ""
} |
q26020 | MarshalJSON | train | func (d Deployment) MarshalJSON() ([]byte, error) {
type Droplet struct {
GUID string `json:"guid,omitempty"`
}
var ccDeployment struct {
Droplet *Droplet `json:"droplet,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
}
if d.DropletGUID != "" {
ccDeployment.Droplet = &... | go | {
"resource": ""
} |
q26021 | UnmarshalJSON | train | func (d *Deployment) UnmarshalJSON(data []byte) error {
var ccDeployment struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
State constant.De... | go | {
"resource": ""
} |
q26022 | CheckEnvironmentTargetedCorrectly | train | func CheckEnvironmentTargetedCorrectly(targetedOrganizationRequired bool, targetedSpaceRequired bool, testOrg string, command ...string) {
LoginCF()
if targetedOrganizationRequired {
By("errors if org is not targeted")
session := CF(command...)
Eventually(session).Should(Say("FAILED"))
Eventually(session.Err... | go | {
"resource": ""
} |
q26023 | ReadAndInterpolateManifest | train | func ReadAndInterpolateManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]Application, error) {
rawManifest, err := ReadAndInterpolateRawManifest(pathToManifest, pathsToVarsFiles, vars)
if err != nil {
return nil, err
}
var manifest Manifest
err = yaml.Unmarshal(rawManifest, &m... | go | {
"resource": ""
} |
q26024 | ReadAndInterpolateRawManifest | train | func ReadAndInterpolateRawManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]byte, error) {
rawManifest, err := ioutil.ReadFile(pathToManifest)
if err != nil {
return nil, err
}
tpl := template.NewTemplate(rawManifest)
fileVars := template.StaticVariables{}
for _, path := ran... | go | {
"resource": ""
} |
q26025 | WriteApplicationManifest | train | func WriteApplicationManifest(application Application, filePath string) error {
manifest := Manifest{Applications: []Application{application}}
manifestBytes, err := yaml.Marshal(manifest)
if err != nil {
return ManifestCreationError{Err: err}
}
err = ioutil.WriteFile(filePath, manifestBytes, 0644)
if err != ni... | go | {
"resource": ""
} |
q26026 | GetIsolationSegment | train | func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentRequest,
URIParams: map[string]string{"isolation_segment_guid": guid},
})
if err != nil {
return IsolationSegment{}, nil,... | go | {
"resource": ""
} |
q26027 | GetIsolationSegments | train | func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentsRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullIsolationSegmentsList []IsolationS... | go | {
"resource": ""
} |
q26028 | CalculateRequestSize | train | func CalculateRequestSize(buildpackSize int64, bpPath string, fieldName string) (int64, error) {
body := &bytes.Buffer{}
form := multipart.NewWriter(body)
bpFileName := filepath.Base(bpPath)
_, err := form.CreateFormFile(fieldName, bpFileName)
if err != nil {
return 0, err
}
err = form.Close()
if err != ni... | go | {
"resource": ""
} |
q26029 | UnmarshalJSON | train | func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
var ccSecurityGroup struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Name string `json:"name"`
Rules []struct {
Description string `json:"description"`
Destination string `json... | go | {
"resource": ""
} |
q26030 | DeleteSecurityGroupSpace | train | func (client *Client) DeleteSecurityGroupSpace(securityGroupGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSecurityGroupSpaceRequest,
URIParams: Params{
"security_group_guid": securityGroupGUID,
"space_guid": space... | go | {
"resource": ""
} |
q26031 | GetSecurityGroups | train | func (client *Client) GetSecurityGroups(filters ...Filter) ([]SecurityGroup, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSecurityGroupsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var securityGroupsLi... | go | {
"resource": ""
} |
q26032 | GetSpaceSecurityGroups | train | func (client *Client) GetSpaceSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceSecurityGroupsRequest, filters)
} | go | {
"resource": ""
} |
q26033 | GetSpaceStagingSecurityGroups | train | func (client *Client) GetSpaceStagingSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceStagingSecurityGroupsRequest, filters)
} | go | {
"resource": ""
} |
q26034 | Errors | train | func (job Job) Errors() []error {
var errs []error
for _, errDetails := range job.RawErrors {
switch errDetails.Code {
case constant.JobErrorCodeBuildpackAlreadyExistsForStack:
errs = append(errs, ccerror.BuildpackAlreadyExistsForStackError{Message: errDetails.Detail})
case constant.JobErrorCodeBuildpackAlre... | go | {
"resource": ""
} |
q26035 | CreateApplicationInSpace | train | func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: ... | go | {
"resource": ""
} |
q26036 | SetApplicationProcessHealthCheckTypeByNameAndSpace | train | func (actor Actor) SetApplicationProcessHealthCheckTypeByNameAndSpace(
appName string,
spaceGUID string,
healthCheckType constant.HealthCheckType,
httpEndpoint string,
processType string,
invocationTimeout int64,
) (Application, Warnings, error) {
app, getWarnings, err := actor.GetApplicationByNameAndSpace(appN... | go | {
"resource": ""
} |
q26037 | StopApplication | train | func (actor Actor) StopApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationStop(appGUID)
return Warnings(warnings), err
} | go | {
"resource": ""
} |
q26038 | StartApplication | train | func (actor Actor) StartApplication(appGUID string) (Application, Warnings, error) {
updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplicationStart(appGUID)
if err != nil {
return Application{}, Warnings(warnings), err
}
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), n... | go | {
"resource": ""
} |
q26039 | RestartApplication | train | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
var allWarnings Warnings
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return allWarnings, err
}
pollingWarnings, err := actor.PollStart(a... | go | {
"resource": ""
} |
q26040 | Error | train | func (e DomainNotFoundError) Error() string {
switch {
case e.Name != "":
return fmt.Sprintf("Domain %s not found", e.Name)
case e.GUID != "":
return fmt.Sprintf("Domain with GUID %s not found", e.GUID)
default:
return "Domain not found"
}
} | go | {
"resource": ""
} |
q26041 | WithProcfileApp | train | func WithProcfileApp(f func(dir string)) {
dir, err := ioutil.TempDir("", "simple-ruby-app")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
web: ruby -run -e httpd . -p $PORT
console: bundle exec irb`,
), 0666)
Expect(err).ToNot(HaveOc... | go | {
"resource": ""
} |
q26042 | AppGUID | train | func AppGUID(appName string) string {
session := CF("app", appName, "--guid")
Eventually(session).Should(Exit(0))
return strings.TrimSpace(string(session.Out.Contents()))
} | go | {
"resource": ""
} |
q26043 | WriteManifest | train | func WriteManifest(path string, manifest map[string]interface{}) {
body, err := yaml.Marshal(manifest)
Expect(err).ToNot(HaveOccurred())
err = ioutil.WriteFile(path, body, 0666)
Expect(err).ToNot(HaveOccurred())
} | go | {
"resource": ""
} |
q26044 | Zipit | train | func Zipit(source, target, prefix string) error {
// Thanks to Svett Ralchev
// http://blog.ralch.com/tutorial/golang-working-with-zip/
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
if prefix != "" {
_, err = io.WriteString(zipfile, prefix)
if err != nil {
return... | go | {
"resource": ""
} |
q26045 | ConvertFilterParameters | train | func ConvertFilterParameters(filters []Filter) url.Values {
params := url.Values{"q": []string{}}
for _, filter := range filters {
params["q"] = append(params["q"], filter.format())
}
return params
} | go | {
"resource": ""
} |
q26046 | GetPluginInfoFromRepositoriesForPlatform | train | func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
var reposWithPlugin []string
var newestPluginInfo PluginInfo
var pluginFoundWithIncompatibleBinary bool
for _, repo := range pluginRepos {
plugi... | go | {
"resource": ""
} |
q26047 | GetPlatformString | train | func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string {
return generic.GeneratePlatform(runtime.GOOS, runtime.GOARCH)
} | go | {
"resource": ""
} |
q26048 | getPluginInfoFromRepositoryForPlatform | train | func (actor Actor) getPluginInfoFromRepositoryForPlatform(pluginName string, pluginRepo configv3.PluginRepository, platform string) (PluginInfo, error) {
pluginRepository, err := actor.client.GetPluginRepository(pluginRepo.URL)
if err != nil {
return PluginInfo{}, err
}
var pluginFoundWithIncompatibleBinary bool... | go | {
"resource": ""
} |
q26049 | ExecutableFilename | train | func ExecutableFilename(name string) string {
if strings.HasSuffix(name, ".exe") {
return name
}
return fmt.Sprintf("%s.exe", name)
} | go | {
"resource": ""
} |
q26050 | EntitleIsolationSegmentToOrganizations | train | func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: organizationGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPReq... | go | {
"resource": ""
} |
q26051 | ShareServiceInstanceToSpaces | train | func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: spaceGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Re... | go | {
"resource": ""
} |
q26052 | HandlePanic | train | func HandlePanic() {
stackTraceBytes := make([]byte, maxStackSizeLimit)
runtime.Stack(stackTraceBytes, true)
stackTrace := "\t" + strings.Replace(string(stackTraceBytes), "\n", "\n\t", -1)
if err := recover(); err != nil {
formattedString := `
Something unexpected happened. This is a bug in {{.Binary}}.
Plea... | go | {
"resource": ""
} |
q26053 | UnmarshalJSON | train | func (domain *Domain) UnmarshalJSON(data []byte) error {
var ccDomain struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
RouterGroupGUID string `json:"router_group_guid"`
RouterGroupType string `json:"router_group_type"`
Internal bool `... | go | {
"resource": ""
} |
q26054 | GetPrivateDomain | train | func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainRequest,
URIParams: map[string]string{"private_domain_guid": domainGUID},
})
if err != nil {
return Domain{}, nil, err
}
var dom... | go | {
"resource": ""
} |
q26055 | GetPrivateDomains | train | func (client *Client) GetPrivateDomains(filters ...Filter) ([]Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return []Domain{}, nil, err
}
fullDomainsList := []... | go | {
"resource": ""
} |
q26056 | HasCommand | train | func (c commandList) HasCommand(name string) bool {
if name == "" {
return false
}
cType := reflect.TypeOf(c)
_, found := cType.FieldByNameFunc(
func(fieldName string) bool {
field, _ := cType.FieldByName(fieldName)
return field.Tag.Get("command") == name
},
)
return found
} | go | {
"resource": ""
} |
q26057 | DisplayLogMessage | train | func (ui *UI) DisplayLogMessage(message LogMessage, displayHeader bool) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var header string
if displayHeader {
time := message.Timestamp().In(ui.TimezoneLocation).Format(LogTimestampFormat)
header = fmt.Sprintf("%s [%s/%s] %s ",
time,
message.SourceT... | go | {
"resource": ""
} |
q26058 | handleFetchingPluginInfoFromRepositoriesError | train | func (InstallPluginCommand) handleFetchingPluginInfoFromRepositoriesError(fetchErr actionerror.FetchingPluginInfoFromRepositoryError) error {
switch clientErr := fetchErr.Err.(type) {
case pluginerror.RawHTTPStatusError:
return translatableerror.FetchingPluginInfoFromRepositoriesError{
Message: clientErr.... | go | {
"resource": ""
} |
q26059 | GetApplicationEnvironment | train | func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
URIParams: internal.Params{"app_guid": appGUID},
RequestName: internal.GetApplicationEnvRequest,
})
if err != nil {
return Environment{}, nil, err
}
var re... | go | {
"resource": ""
} |
q26060 | NewClients | train | func NewClients(config command.Config, ui command.UI, targetCF bool) (*ccv2.Client, *uaa.Client, error) {
ccWrappers := []ccv2.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
}
if location != n... | go | {
"resource": ""
} |
q26061 | CheckTarget | train | func (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error {
if !actor.IsLoggedIn() {
return actionerror.NotLoggedInError{
BinaryName: actor.Config.BinaryName(),
}
}
if targetedOrganizationRequired {
if !actor.IsOrgTargeted() {
return actionerror.NoOrganizationTa... | go | {
"resource": ""
} |
q26062 | CreateApplicationTask | train | func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error) {
bodyBytes, err := json.Marshal(task)
if err != nil {
return Task{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationTasksRequest,
URIParams: internal.Params{
... | go | {
"resource": ""
} |
q26063 | GetApplicationTasks | train | func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationTasksRequest,
URIParams: internal.Params{
"app_guid": appGUID,
},
Query: query,
})
if err != nil {
return nil, n... | go | {
"resource": ""
} |
q26064 | UpdateTaskCancel | train | func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutTaskCancelRequest,
URIParams: internal.Params{
"task_guid": taskGUID,
},
})
if err != nil {
return Task{}, nil, err
}
var task Task
response ... | go | {
"resource": ""
} |
q26065 | GetFeatureFlagByName | train | func (actor Actor) GetFeatureFlagByName(featureFlagName string) (FeatureFlag, Warnings, error) {
var (
ccv3FeatureFlag ccv3.FeatureFlag
warnings ccv3.Warnings
err error
)
ccv3FeatureFlag, warnings, err = actor.CloudControllerClient.GetFeatureFlag(featureFlagName)
if err != nil {
if _, ok... | go | {
"resource": ""
} |
q26066 | UnmarshalJSON | train | func (serviceInstance *ServiceInstance) UnmarshalJSON(data []byte) error {
var ccServiceInstance struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
SpaceGUID string `json:"space_guid"`
ServiceGUID string `json:"service_guid"`
Servic... | go | {
"resource": ""
} |
q26067 | CreateServiceInstance | train | func (client *Client) CreateServiceInstance(spaceGUID, servicePlanGUID, serviceInstance string, parameters map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) {
requestBody := createServiceInstanceRequestBody{
Name: serviceInstance,
ServicePlanGUID: servicePlanGUID,
SpaceGUID: ... | go | {
"resource": ""
} |
q26068 | GetServiceInstance | train | func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err != nil {
return ServiceIn... | go | {
"resource": ""
} |
q26069 | GetSpaceServiceInstances | train | func (client *Client) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, filters ...Filter) ([]ServiceInstance, Warnings, error) {
query := ConvertFilterParameters(filters)
if includeUserProvidedServices {
query.Add("return_user_provided_service_instances", "true")
}
request, err := cl... | go | {
"resource": ""
} |
q26070 | getAndSetSharedInformation | train | func (actor Actor) getAndSetSharedInformation(summary *ServiceInstanceSummary, spaceGUID string) (Warnings, error) {
var (
warnings Warnings
err error
)
// Part of determining if a service instance is shareable, we need to find
// out if the service_instance_sharing feature flag is enabled
featureFlags, ... | go | {
"resource": ""
} |
q26071 | GetApplicationPackages | train | func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]Package, Warnings, error) {
app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return nil, allWarnings, err
}
ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3... | go | {
"resource": ""
} |
q26072 | PollPackage | train | func (actor Actor) PollPackage(pkg Package) (Package, Warnings, error) {
var allWarnings Warnings
for pkg.State != constant.PackageReady && pkg.State != constant.PackageFailed && pkg.State != constant.PackageExpired {
time.Sleep(actor.Config.PollingInterval())
ccPkg, warnings, err := actor.CloudControllerClient.... | go | {
"resource": ""
} |
q26073 | GetCredentials | train | func GetCredentials() (string, string) {
username := os.Getenv("CF_INT_USERNAME")
if username == "" {
username = "admin"
}
password := os.Getenv("CF_INT_PASSWORD")
if password == "" {
password = "admin"
}
return username, password
} | go | {
"resource": ""
} |
q26074 | SkipIfOIDCCredentialsNotSet | train | func SkipIfOIDCCredentialsNotSet() (string, string) {
oidcUsername := os.Getenv("CF_INT_OIDC_USERNAME")
oidcPassword := os.Getenv("CF_INT_OIDC_PASSWORD")
if oidcUsername == "" || oidcPassword == "" {
Skip("CF_INT_OIDC_USERNAME or CF_INT_OIDC_PASSWORD is not set")
}
return oidcUsername, oidcPassword
} | go | {
"resource": ""
} |
q26075 | DefaultDomain | train | func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error) {
log.Infoln("getting org domains for org GUID:", orgGUID)
// the domains object contains all the shared domains AND all domains private to this org
domains, warnings, err := actor.V2Actor.GetOrganizationDomains(orgGUID)
if err != n... | go | {
"resource": ""
} |
q26076 | SayPath | train | 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 | {
"resource": ""
} |
q26077 | CreateBuildpack | train | 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 | {
"resource": ""
} |
q26078 | GetBuildpacks | train | 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 | {
"resource": ""
} |
q26079 | UploadBuildpack | train | 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 | {
"resource": ""
} |
q26080 | LessIgnoreCase | train | 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 | {
"resource": ""
} |
q26081 | GetSpaceRunningSecurityGroupsBySpace | train | func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | {
"resource": ""
} |
q26082 | GetSpaceStagingSecurityGroupsBySpace | train | func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceStagingSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | {
"resource": ""
} |
q26083 | DownloadFile | train | 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 | {
"resource": ""
} |
q26084 | Resources | train | 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 | {
"resource": ""
} |
q26085 | GetSpaceByOrganizationAndName | train | 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 | {
"resource": ""
} |
q26086 | GrantSpaceManagerByUsername | train | 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 | {
"resource": ""
} |
q26087 | GrantSpaceDeveloperByUsername | train | 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 | {
"resource": ""
} |
q26088 | CreateUser | train | 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 | {
"resource": ""
} |
q26089 | NewNetworkingClient | train | 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 | {
"resource": ""
} |
q26090 | GetServicePlansForService | train | 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 | {
"resource": ""
} |
q26091 | NewTable | train | 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 | {
"resource": ""
} |
q26092 | SetTransformer | train | func (t *Table) SetTransformer(columnIndex int, tr Transformer) {
t.transformer[columnIndex] = tr
} | go | {
"resource": ""
} |
q26093 | Add | train | func (t *Table) Add(row ...string) {
t.rows = append(t.rows, row)
} | go | {
"resource": ""
} |
q26094 | printRow | train | 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 | {
"resource": ""
} |
q26095 | printCellValue | train | 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 | {
"resource": ""
} |
q26096 | Transform | train | func (th *transformHeader) Transform(column int, s string) string {
return HeaderColor(s)
} | go | {
"resource": ""
} |
q26097 | visibleSize | train | 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 | {
"resource": ""
} |
q26098 | DeleteIsolationSegmentOrganization | train | 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 | {
"resource": ""
} |
q26099 | DeleteServiceInstanceRelationshipsSharedSpace | train | 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 | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.