// UpdateAppGroup handles PUT /app-groups/<group_id> api endpoint
UpdateAppGroup handles PUT /app-groups/ api endpoint
// UpdateAppGroup handles PUT / app - groups / <group_id > api endpoint
func UpdateAppGroup(c *routing.Context) error {
	appGroupID := c.Param("group_id")
	if !bson.IsObjectIdHex(string(appGroupID)) {
		return http.Error(c, "Group id not valid.", 400, ServiceDiscoveryServiceName())
	}
	var aGroup appgroups.ApplicationGroup
	json.Unmarshal(c.Request.Body(), &aGroup)
	appGroupService, err := getAppGroupService(c)
	if err != nil {
		return http.Error(c, err.Error(), 400, ServiceDiscoveryServiceName())
	}
	err = appGroupService.UpdateApplicationGroup(appGroupID, aGroup)
	if err != nil {
		return http.Error(c, strconv.Quote(err.Error()), 400, ServiceDiscoveryServiceName())
	}
	return http.OkFormated(c, "Applications group updated successfuly.", ServiceDiscoveryServiceName())
}
func UpdateAppGroup ( c * routing . Context ) error { appGroupID := c . Param ( " " ) if ! bson . IsObjectIdHex ( string ( appGroupID ) ) { return http . Error ( c , " " , 400 , ServiceDiscoveryServiceName ( ) ) } var aGroup appgroups . ApplicationGroup json . Unmarshal ( c . Request . Body ( ) , & aGroup ) appGroupService , err := getAppGroupService ( c ) if err != nil { return http . Error ( c , err . Error ( ) , 400 , ServiceDiscoveryServiceName ( ) ) } err = appGroupService . UpdateApplicationGroup ( appGroupID , aGroup ) if err != nil { return http . Error ( c , strconv . Quote ( err . Error ( ) ) , 400 , ServiceDiscoveryServiceName ( ) ) } return http . OkFormated ( c , " " , ServiceDiscoveryServiceName ( ) ) }
UpdateAppGroup handles PUT /app-groups/ api endpoint
UpdateAppGroup handles PUT / app - groups / api endpoint
// Parse body // Get application group service // Update application group