configcommands/space_named_quota.go
func (c *SpaceNamedQuotaConfigurationCommand) Execute(args []string) error {
	c.initConfig()
	spaceQuota, err := c.ConfigManager.GetSpaceQuota(c.Name, c.Org)
	if err != nil {
		return err
	}
	if spaceQuota == nil {
		spaceQuota = &config.SpaceQuota{
			Name:                    c.Name,
			Org:                     c.Org,
			TotalReservedRoutePorts: "unlimited",
			TotalServiceKeys:        "unlimited",
			AppInstanceLimit:        "unlimited",
			AppTaskLimit:            "unlimited",
			InstanceMemoryLimit:     "unlimited",
			TotalRoutes:             "unlimited",
			TotalServices:           "unlimited",
			PaidServicePlansAllowed: true,
		}
	}
	errorString := ""
	updateSpaceNamedQuotaConfig(spaceQuota, c.Quota, &errorString)

	if errorString != "" {
		return errors.New(errorString)
	}
	return c.ConfigManager.SaveSpaceQuota(spaceQuota)
}
func (c *SpaceNamedQuotaConfigurationCommand) Execute(args []string) error {
	c.initConfig()
	spaceQuota, err := c.ConfigManager.GetSpaceQuota(c.Name, c.Org)
	if err != nil {
		return err
	}
	if spaceQuota == nil {
		spaceQuota = &config.SpaceQuota{
			Name:                    c.Name,
			Org:                     c.Org,
			TotalReservedRoutePorts: "unlimited",
			TotalServiceKeys:        "unlimited",
			AppInstanceLimit:        "unlimited",
			AppTaskLimit:            "unlimited",
			InstanceMemoryLimit:     "unlimited",
			TotalRoutes:             "unlimited",
			TotalServices:           "unlimited",
			PaidServicePlansAllowed: true,
		}
	}
	errorString := ""
	updateSpaceNamedQuotaConfig(spaceQuota, c.Quota, &errorString)

	if errorString != "" {
		return errors.New(errorString)
	}
	return c.ConfigManager.SaveSpaceQuota(spaceQuota)
}
func ( c * SpaceNamedQuotaConfigurationCommand ) Execute ( args [ ] string ) error { c . initConfig ( ) spaceQuota , err := c . ConfigManager . GetSpaceQuota ( c . Name , c . Org ) if err != nil { return err } if spaceQuota == nil { spaceQuota = & config . SpaceQuota { Name : c . Name , Org : c . Org , TotalReservedRoutePorts : " " , TotalServiceKeys : " " , AppInstanceLimit : " " , AppTaskLimit : " " , InstanceMemoryLimit : " " , TotalRoutes : " " , TotalServices : " " , PaidServicePlansAllowed : true , } } errorString := " " updateSpaceNamedQuotaConfig ( spaceQuota , c . Quota , & errorString ) if errorString != " " { return errors . New ( errorString ) } return c . ConfigManager . SaveSpaceQuota ( spaceQuota ) }
//Execute - updates space named quotas
Execute - updates space named quotas