// GetAppGroupByID handles GET /app-groups/<group_id> api endpoint
GetAppGroupByID handles GET /app-groups/ api endpoint
// GetAppGroupByID handles GET / app - groups / <group_id > api endpoint
func GetAppGroupByID(c *routing.Context) error {
	appGroupID := c.Param("group_id")
	if !bson.IsObjectIdHex(string(appGroupID)) {
		return http.Error(c, "Group id not valid.", 400, ServiceDiscoveryServiceName())
	}
	appGroupService, err := getAppGroupService(c)
	if err != nil {
		return http.Error(c, err.Error(), 400, ServiceDiscoveryServiceName())
	}
	group, err := appGroupService.GetApplicationGroupByID(appGroupID)
	if err != nil {
		return http.Error(c, strconv.Quote(err.Error()), 400, ServiceDiscoveryServiceName())
	}
	servicesList, err := appGroupService.GetServicesForApplicationGroup(group)
	if err != nil {
		return http.Error(c, strconv.Quote(err.Error()), 400, ServiceDiscoveryServiceName())
	}
	responseMap := make(map[string]interface{})
	responseMap["Name"] = group.Name
	responseMap["Id"] = group.Id
	responseMap["Services"] = servicesList
	if len(servicesList) == 0 {
		responseMap["Services"] = []string{}
	}
	gjson, _ := json.Marshal(responseMap)
	return http.Ok(c, string(gjson), ServiceDiscoveryServiceName())
}
func GetAppGroupByID ( c * routing . Context ) error { appGroupID := c . Param ( " " ) if ! bson . IsObjectIdHex ( string ( appGroupID ) ) { return http . Error ( c , " " , 400 , ServiceDiscoveryServiceName ( ) ) } appGroupService , err := getAppGroupService ( c ) if err != nil { return http . Error ( c , err . Error ( ) , 400 , ServiceDiscoveryServiceName ( ) ) } group , err := appGroupService . GetApplicationGroupByID ( appGroupID ) if err != nil { return http . Error ( c , strconv . Quote ( err . Error ( ) ) , 400 , ServiceDiscoveryServiceName ( ) ) } servicesList , err := appGroupService . GetServicesForApplicationGroup ( group ) if err != nil { return http . Error ( c , strconv . Quote ( err . Error ( ) ) , 400 , ServiceDiscoveryServiceName ( ) ) } responseMap := make ( map [ string ] interface { } ) responseMap [ " " ] = group . Name responseMap [ " " ] = group . Id responseMap [ " " ] = servicesList if len ( servicesList ) == 0 { responseMap [ " " ] = [ ] string { } } gjson , _ := json . Marshal ( responseMap ) return http . Ok ( c , string ( gjson ) , ServiceDiscoveryServiceName ( ) ) }
GetAppGroupByID handles GET /app-groups/ api endpoint
GetAppGroupByID handles GET / app - groups / api endpoint
// Get application group service // Get application group by id // Get all services associated to applicaiton group //var responseMap map[string]interface{}