// ListDeployed returns all releases with Status == DEPLOYED. An error is returned
// if the storage backend fails to retrieve the releases.
489547
func (s *Storage) ListDeployed() ([]*rspb.Release, error) {
	s.Log("listing all deployed releases in storage")
	return s.Driver.List(func(rls *rspb.Release) bool {
		return relutil.StatusFilter(rspb.Status_DEPLOYED).Check(rls)
	})
}
700208
func (s *DescribeAvailabilityOptionsInput) SetDeployed(v bool) *DescribeAvailabilityOptionsInput {
	s.Deployed = &v
	return s
}
475755
func (s *DescribeExpressionsInput) SetDeployed(v bool) *DescribeExpressionsInput {
	s.Deployed = &v
	return s
}
365792
func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opt *ListOptions) ([]*DeploymentStatus, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var statuses []*DeploymentStatus
	resp, err := s.client.Do(ctx, req, &statuses)
	if err != nil {
		return nil, resp, err
	}

	return statuses, resp, nil
}
1099320
func (s *StoreToDeploymentLister) List() (deployments []extensions.Deployment, err error) {
	for _, c := range s.Store.List() {
		deployments = append(deployments, *(c.(*extensions.Deployment)))
	}
	return deployments, nil
}
222559
func (s *DescribeServiceAccessPoliciesInput) SetDeployed(v bool) *DescribeServiceAccessPoliciesInput {
	s.Deployed = &v
	return s
}
190974
func (s *BoltStateDB) PutDeploymentStatus(allocID string, ds *structs.AllocDeploymentStatus) error {
	return s.db.Update(func(tx *boltdd.Tx) error {
		return putDeploymentStatusImpl(tx, allocID, ds)
	})
}
579242
func List(cmd *cli.Cmd) {
	var a []application.Application

	all := cmd.BoolOpt("a all", false, "List all applications, including archived")

	cmd.Action = func() {
		resp, body, errs := application.List()

		if errs != nil {
			log.Fatalf("Could not retrieve applications: %s", errs)
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Could not retrieve applications: %s", resp.Status)
		}

		err := json.Unmarshal([]byte(body), &a)

		if err != nil {
			log.Fatal(err)
		}

		printAppBrief(a, *all)
	}
}
556419
func (s *Recipes) SetDeploy(v []*string) *Recipes {
	s.Deploy = v
	return s
}
872825
func (s *DescribeIndexFieldsInput) SetDeployed(v bool) *DescribeIndexFieldsInput {
	s.Deployed = &v
	return s
}
469580
func (m *MockDeploymentInterface) List(arg0 v10.ListOptions) (*v1.DeploymentList, error) {
	ret := m.ctrl.Call(m, "List", arg0)
	ret0, _ := ret[0].(*v1.DeploymentList)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
496455
func (w *deploymentWatcher) getDeployment() *structs.Deployment {
	w.l.RLock()
	defer w.l.RUnlock()
	return w.d
}
1226332
func (b *BlockChain) IsDeploymentActive(deploymentID uint32) (bool, error) {
	b.chainLock.Lock()
	state, err := b.deploymentState(b.bestChain.Tip(), deploymentID)
	b.chainLock.Unlock()
	if err != nil {
		return false, err
	}

	return state == ThresholdActive, nil
}
845318
func (js *JobsService) ListFromBuild(buildId uint) ([]Job, *http.Response, error) {
	u, err := urlWithOptions(fmt.Sprintf("/builds/%d", buildId), nil)
	if err != nil {
		return nil, nil, err
	}

	req, err := js.client.NewRequest("GET", u, nil, nil)
	if err != nil {
		return nil, nil, err
	}

	var buildResp getBuildResponse
	resp, err := js.client.Do(req, &buildResp)
	if err != nil {
		return nil, resp, err
	}

	return buildResp.Jobs, resp, err
}
608498
func (s *ListApplicationRevisionsInput) SetDeployed(v string) *ListApplicationRevisionsInput {
	s.Deployed = &v
	return s
}
1344113
func isAllDeployed(expected []uint64, actual []uint64) bool {
	if len(expected) == 0 {
		return true
	}

	exp := make([]uint64, len(expected))
	copy(exp, expected)
	for _, c := range actual {
		// remove value c from exp
		for i := 0; i < len(exp); i++ {
			if exp[i] == c {
				exp = removeListElement(exp, i)
				if len(exp) == 0 {
					return true
				}
			}
		}
	}
	return len(exp) == 0
}
252851
func (a allocSet) filterByDeployment(id string) (match, nonmatch allocSet) {
	match = make(map[string]*structs.Allocation)
	nonmatch = make(map[string]*structs.Allocation)
	for _, alloc := range a {
		if alloc.DeploymentID == id {
			match[alloc.ID] = alloc
		} else {
			nonmatch[alloc.ID] = alloc
		}
	}
	return
}