// Lists the breakpoints in the script of an app.
331870
func (obj *Doc) GetScriptBreakpointsRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Breakpoints json.RawMessage	`json:"qBreakpoints"`
	} {}
	err := obj.rpc(ctx, "GetScriptBreakpoints", result)
	return result.Breakpoints, err 
}
581802
func (dao *ControlPlaneDao) ListSnapshots(serviceID string, snapshots *[]model.SnapshotInfo) (err error) {
	ctx := datastore.Get()

	// synchronize the dfs
	dfslocker := dao.facade.DFSLock(ctx)
	dfslocker.Lock("list snapshots")
	defer dfslocker.Unlock()

	*snapshots = make([]model.SnapshotInfo, 0)
	snapshotIDs, err := dao.facade.ListSnapshots(ctx, serviceID)
	if err != nil {
		return err
	}
	for _, snapshotID := range snapshotIDs {
		var newInfo model.SnapshotInfo

		info, err := dao.facade.GetSnapshotInfo(ctx, snapshotID)
		if err == volume.ErrInvalidSnapshot {
			newInfo = model.SnapshotInfo{
				SnapshotID: snapshotID,
				Invalid:    true,
			}

		} else if err != nil {
			return err
		} else {
			newInfo = model.SnapshotInfo{
				SnapshotID:  info.Name,
				TenantID:    info.TenantID,
				Description: info.Message,
				Tags:        info.Tags,
				Created:     info.Created,
				Invalid:     false,
			}
		}
		*snapshots = append(*snapshots, newInfo)
	}
	return
}
106713
func (client *Client) GetApplicationProcesses(appGUID string) ([]Process, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetApplicationProcessesRequest,
		URIParams:   map[string]string{"app_guid": appGUID},
	})
	if err != nil {
		return nil, nil, err
	}

	var fullProcessesList []Process
	warnings, err := client.paginate(request, Process{}, func(item interface{}) error {
		if process, ok := item.(Process); ok {
			fullProcessesList = append(fullProcessesList, process)
		} else {
			return ccerror.UnknownObjectInListError{
				Expected:   Process{},
				Unexpected: item,
			}
		}
		return nil
	})

	return fullProcessesList, warnings, err
}
457441
func (d *Deployment) List(args *structs.DeploymentListRequest, reply *structs.DeploymentListResponse) error {
	if done, err := d.srv.forward("Deployment.List", args, args, reply); done {
		return err
	}
	defer metrics.MeasureSince([]string{"nomad", "deployment", "list"}, time.Now())

	// Check namespace read-job permissions
	if aclObj, err := d.srv.ResolveToken(args.AuthToken); err != nil {
		return err
	} else if aclObj != nil && !aclObj.AllowNsOp(args.RequestNamespace(), acl.NamespaceCapabilityReadJob) {
		return structs.ErrPermissionDenied
	}

	// Setup the blocking query
	opts := blockingOptions{
		queryOpts: &args.QueryOptions,
		queryMeta: &reply.QueryMeta,
		run: func(ws memdb.WatchSet, state *state.StateStore) error {
			// Capture all the deployments
			var err error
			var iter memdb.ResultIterator
			if prefix := args.QueryOptions.Prefix; prefix != "" {
				iter, err = state.DeploymentsByIDPrefix(ws, args.RequestNamespace(), prefix)
			} else {
				iter, err = state.DeploymentsByNamespace(ws, args.RequestNamespace())
			}
			if err != nil {
				return err
			}

			var deploys []*structs.Deployment
			for {
				raw := iter.Next()
				if raw == nil {
					break
				}
				deploy := raw.(*structs.Deployment)
				deploys = append(deploys, deploy)
			}
			reply.Deployments = deploys

			// Use the last index that affected the deployment table
			index, err := state.Index("deployment")
			if err != nil {
				return err
			}
			reply.Index = index

			// Set the query response
			d.srv.setQueryMeta(&reply.QueryMeta)
			return nil
		}}
	return d.srv.blockingRPC(&opts)
}
1265458
func (d *Debugger) AmendBreakpoint(amend *api.Breakpoint) error {
	d.processMutex.Lock()
	defer d.processMutex.Unlock()

	original := d.findBreakpoint(amend.ID)
	if original == nil {
		return fmt.Errorf("no breakpoint with ID %d", amend.ID)
	}
	if err := api.ValidBreakpointName(amend.Name); err != nil {
		return err
	}
	return copyBreakpointInfo(original, amend)
}
399827
func (c *EndpointsController) List(ctx *app.ListEndpointsContext) error {
	c.endpointsLock.Lock()
	defer c.endpointsLock.Unlock()
	if c.endpoints == nil {
		endpoints, err := getEndpoints(ctx, c.FileHandler)
		if err != nil || endpoints == nil {
			log.Error(ctx, map[string]interface{}{
				"err":  errs.WithStack(err),
				"file": embeddedSwaggerSpecFile,
			}, err.Error())
			return jsonapi.JSONErrorResponse(ctx, errs.WithStack(err))
		}
		c.endpoints = endpoints
	}
	return ctx.OK(&app.EndpointSingle{Data: c.endpoints})
}
399239
func (a *Account) ListApplications() (apps []Application, err error) {
	err = a.get(a.auth.WithScope(scope.Apps), "/api/v2/applications", &apps)
	return apps, err
}
539886
func main() {
	flag.Parse()

	stage1initcommon.InitDebug(debug)

	log, diag, _ = rktlog.NewLogSet("app-rm", debug)
	if !debug {
		diag.SetOutput(ioutil.Discard)
	}

	appName, err := types.NewACName(flagApp)
	if err != nil {
		log.FatalE("invalid app name", err)
	}

	enterCmd := stage1common.PrepareEnterCmd(false)
	switch flagStage {
	case 0:
		// clean resources in stage0
		err = cleanupStage0(appName, enterCmd)
	case 1:
		// clean resources in stage1
		err = cleanupStage1(appName, enterCmd)
	default:
		// unknown step
		err = fmt.Errorf("unsupported cleaning step %d", flagStage)
	}
	if err != nil {
		log.FatalE("cleanup error", err)
	}

	os.Exit(0)
}
564122
func (manager *impl) ListCheckpoints() ([]string, error) {
	manager.mutex.Lock()
	defer manager.mutex.Unlock()
	keys, err := manager.store.List()
	if err != nil {
		return []string{}, fmt.Errorf("failed to list checkpoint store: %v", err)
	}
	return keys, nil
}
984851
func (c *SpaceCodebasesController) List(ctx *app.ListSpaceCodebasesContext) error {
	offset, limit := computePagingLimits(ctx.PageOffset, ctx.PageLimit)
	var codebases []codebase.Codebase
	var count int
	err := application.Transactional(c.db, func(appl application.Application) error {
		err := appl.Spaces().CheckExists(ctx, ctx.SpaceID)
		if err != nil {
			return err
		}

		codebases, count, err = appl.Codebases().List(ctx, ctx.SpaceID, &offset, &limit)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	res := &app.CodebaseList{
		Data:  ConvertCodebases(ctx.Request, codebases),
		Meta:  &app.CodebaseListMeta{TotalCount: count},
		Links: &app.PagingLinks{},
	}
	setPagingLinks(res.Links, buildAbsoluteURL(ctx.Request), len(codebases), offset, limit, count)
	return ctx.OK(res)
}
823195
func (r *AppService) List() *AppListCall {
	c := &AppListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
1096342
func ReleaseListStatuses(statuses []release.Status_Code) ReleaseListOption {
	return func(opts *options) {
		if len(statuses) == 0 {
			statuses = []release.Status_Code{release.Status_DEPLOYED}
		}
		opts.listReq.StatusCodes = statuses
	}
}
760232
func findScripts(path string) ([]script, error) {
	filenames, err := filepath.Glob(filepath.Join(path, "*.lua"))
	if err != nil {
		return nil, err
	}
	scripts := []script{}
	for _, filename := range filenames {
		script := script{
			VarName: convertUnderscoresToCamelCase(strings.TrimSuffix(filepath.Base(filename), ".lua")) + "Script",
		}
		src, err := ioutil.ReadFile(filename)
		if err != nil {
			return nil, err
		}
		script.Src = string(src)
		scripts = append(scripts, script)
	}
	return scripts, nil
}
1183571
func (c *RPCClient) ListCheckpoints() ([]api.Checkpoint, error) {
	var out ListCheckpointsOut
	err := c.call("ListCheckpoints", ListCheckpointsIn{}, &out)
	return out.Checkpoints, err
}
1303812
func (c *FakeAppProjects) List(opts v1.ListOptions) (result *v1alpha1.AppProjectList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewListAction(appprojectsResource, appprojectsKind, c.ns, opts), &v1alpha1.AppProjectList{})

	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1alpha1.AppProjectList{ListMeta: obj.(*v1alpha1.AppProjectList).ListMeta}
	for _, item := range obj.(*v1alpha1.AppProjectList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
1270541
func (c *Debugger) RemoveBreakpoint(breakpointId string) (*gcdmessage.ChromeResponse, error) {
	var v DebuggerRemoveBreakpointParams
	v.BreakpointId = breakpointId
	return c.RemoveBreakpointWithParams(&v)
}
1348483
func (c *Client) ListAppEventsByQuery(eventType string, queries []AppEventQuery) ([]AppEventEntity, error) {
	var events []AppEventEntity

	if eventType != AppCrash && eventType != AppStart && eventType != AppStop && eventType != AppUpdate && eventType != AppCreate &&
		eventType != AppDelete && eventType != AppSSHAuth && eventType != AppSSHUnauth && eventType != AppRestage &&
		eventType != AppMapRoute && eventType != AppUnmapRoute {
		return nil, errors.New("Unsupported app event type " + eventType)
	}

	var query = "/v2/events?q=type:" + eventType
	//adding the additional queries
	if queries != nil && len(queries) > 0 {
		for _, eventQuery := range queries {
			if eventQuery.Filter != FilterTimestamp && eventQuery.Filter != FilterActee {
				return nil, errors.New("Unsupported query filter type " + eventQuery.Filter)
			}
			if !stringInSlice(eventQuery.Operator, ValidOperators) {
				return nil, errors.New("Unsupported query operator type " + eventQuery.Operator)
			}
			query += "&q=" + eventQuery.Filter + eventQuery.Operator + eventQuery.Value
		}
	}

	for {
		eventResponse, err := c.getAppEventsResponse(query)
		if err != nil {
			return []AppEventEntity{}, err
		}
		for _, event := range eventResponse.Resources {
			events = append(events, event.Entity)
		}
		query = eventResponse.NextURL
		if query == "" {
			break
		}
	}

	return events, nil
}