code: func (c *DeploymentsController) ShowEnvironmentsBySpace(ctx *app.ShowEnvironmentsBySpaceDeploymentsContext) error {
  
  	kc, err := c.GetKubeClient(ctx)
  	defer cleanup(kc)
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  
  	kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID)
  	if err != nil || kubeSpaceName == nil {
  		return jsonapi.JSONErrorResponse(ctx, errors.NewNotFoundError("osio space", ctx.SpaceID.String()))
  	}
  
  	usage, err := kc.GetSpaceAndOtherEnvironmentUsage(*kubeSpaceName)
  
  	// Model the response
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, errs.Wrap(err, "error retrieving environments"))
  	}
  
  	res := &app.SpaceAndOtherEnvironmentUsageList{
  		Data: usage,
  	}
  
  	return ctx.OK(res)
  }
docs: // ShowEnvironmentsBySpace runs the showEnvironmentsBySpace action.