func (c *Client) GetConstraints(applications ...string) ([]constraints.Value, error) {
	var allConstraints []constraints.Value
	if c.BestAPIVersion() < 5 {
		for _, application := range applications {
			var result params.GetConstraintsResults
			err := c.facade.FacadeCall(
				"GetConstraints", params.GetApplicationConstraints{ApplicationName: application}, &result)
			if err != nil {
				return nil, errors.Trace(err)
			}
			allConstraints = append(allConstraints, result.Constraints)
		}
		return allConstraints, nil
	}

	// Make a single call to get all the constraints.
	var results params.ApplicationGetConstraintsResults
	var args params.Entities
	for _, application := range applications {
		args.Entities = append(args.Entities,
			params.Entity{Tag: names.NewApplicationTag(application).String()})
	}
	err := c.facade.FacadeCall("GetConstraints", args, &results)
	if err != nil {
		return nil, errors.Trace(err)
	}
	for i, result := range results.Results {
		if result.Error != nil {
			return nil, errors.Annotatef(result.Error, "unable to get constraints for %q", applications[i])
		}
		allConstraints = append(allConstraints, result.Constraints)
	}
	return allConstraints, nil
}
// GetConstraints returns the constraints for the given applications.
GetConstraints returns the constraints for the given applications.
// GetConstraints returns the constraints for the given applications .
func (c *Client) GetConstraints(applications ...string) ([]constraints.Value, error) {
	var allConstraints []constraints.Value
	if c.BestAPIVersion() < 5 {
		for _, application := range applications {
			var result params.GetConstraintsResults
			err := c.facade.FacadeCall(
				"GetConstraints", params.GetApplicationConstraints{ApplicationName: application}, &result)
			if err != nil {
				return nil, errors.Trace(err)
			}
			allConstraints = append(allConstraints, result.Constraints)
		}
		return allConstraints, nil
	}
	var results params.ApplicationGetConstraintsResults
	var args params.Entities
	for _, application := range applications {
		args.Entities = append(args.Entities,
			params.Entity{Tag: names.NewApplicationTag(application).String()})
	}
	err := c.facade.FacadeCall("GetConstraints", args, &results)
	if err != nil {
		return nil, errors.Trace(err)
	}
	for i, result := range results.Results {
		if result.Error != nil {
			return nil, errors.Annotatef(result.Error, "unable to get constraints for %q", applications[i])
		}
		allConstraints = append(allConstraints, result.Constraints)
	}
	return allConstraints, nil
}
func ( c * Client ) GetConstraints ( applications ... string ) ( [ ] constraints . Value , error ) { var allConstraints [ ] constraints . Value if c . BestAPIVersion ( ) < 5 { for _ , application := range applications { var result params . GetConstraintsResults err := c . facade . FacadeCall ( " " , params . GetApplicationConstraints { ApplicationName : application } , & result ) if err != nil { return nil , errors . Trace ( err ) } allConstraints = append ( allConstraints , result . Constraints ) } return allConstraints , nil } var results params . ApplicationGetConstraintsResults var args params . Entities for _ , application := range applications { args . Entities = append ( args . Entities , params . Entity { Tag : names . NewApplicationTag ( application ) . String ( ) } ) } err := c . facade . FacadeCall ( " " , args , & results ) if err != nil { return nil , errors . Trace ( err ) } for i , result := range results . Results { if result . Error != nil { return nil , errors . Annotatef ( result . Error , " " , applications [ i ] ) } allConstraints = append ( allConstraints , result . Constraints ) } return allConstraints , nil }
GetConstraints returns the constraints for the given applications.
GetConstraints returns the constraints for the given applications .
// Make a single call to get all the constraints.