api/service_instance.go
func serviceInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	serviceName := r.URL.Query().Get(":name")
	_, err := getService(serviceName)
	if err != nil {
		return err
	}
	contexts := permission.ContextsForPermission(t, permission.PermServiceInstanceRead)
	instances, err := readableInstances(t, contexts, "", serviceName)
	if err != nil {
		return err
	}
	var result []service.ServiceInstanceWithInfo
	for _, instance := range instances {
		infoData, err := instance.ToInfo()
		if err != nil {
			return err
		}
		result = append(result, infoData)
	}
	return json.NewEncoder(w).Encode(result)
}
func serviceInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	serviceName := r.URL.Query().Get(":name")
	_, err := getService(serviceName)
	if err != nil {
		return err
	}
	contexts := permission.ContextsForPermission(t, permission.PermServiceInstanceRead)
	instances, err := readableInstances(t, contexts, "", serviceName)
	if err != nil {
		return err
	}
	var result []service.ServiceInstanceWithInfo
	for _, instance := range instances {
		infoData, err := instance.ToInfo()
		if err != nil {
			return err
		}
		result = append(result, infoData)
	}
	return json.NewEncoder(w).Encode(result)
}
// title: service info
// path: /services/{name}
// method: GET
// produce: application/json
// responses:
//   200: OK