Exemplo n.º 1
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Path("/operations_profiles").
		Name("List Operations Profiles").
		Handler(confhandler.Respond(List))

	s.Methods("GET").
		Path("/operations_profiles/{ID}").
		Name("List One Operations Profile").
		Handler(confhandler.Respond(ListOne))

	s.Methods("POST").
		Path("/operations_profiles").
		Name("Create Operations Profile").
		Handler(confhandler.Respond(Create))

	s.Methods("PUT").
		Path("/operations_profiles/{ID}").
		Name("Update Operations Profile").
		Handler(confhandler.Respond(Update))

	s.Methods("DELETE").
		Path("/operations_profiles/{ID}").
		Name("Delete Operations Profile").
		Handler(confhandler.Respond(Delete))
}
Exemplo n.º 2
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("POST").Path("/reports").Handler(confhandler.Respond(Create))
	s.Methods("PUT").Path("/reports/{id}").Handler(confhandler.Respond(Update))
	s.Methods("DELETE").Path("/reports/{id}").Handler(confhandler.Respond(Delete))
	s.Methods("GET").Path("/reports/{id}").Handler(confhandler.Respond(ListOne))
	s.Methods("GET").Path("/reports").Handler(confhandler.Respond(List))
}
Exemplo n.º 3
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {

	s.Path("/{endpoint_name}/{metric_name}").
		Methods("GET").
		Name("Metric Result").
		Handler(confhandler.Respond(GetMetricResult))

}
Exemplo n.º 4
0
// HandleSubrouter contains the different paths to follow during subrouting
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {

	// eg. timelines/critical/SITE/mysite/service/apache/endpoints/apache01.host/metrics/memory_used
	s.Path("/{report_name}/{group_type}/{group_name}/services/{service_name}/endpoints/{endpoint_name}/metrics/{metric_name}").
		Methods("GET").
		Name("metric name").
		Handler(confhandler.Respond(routeCheckGroup))

	// eg. timelines/critical/SITE/mysite/service/apache/endpoints/apache01.host/metrics
	s.Path("/{report_name}/{group_type}/{group_name}/services/{service_name}/endpoints/{endpoint_name}/metrics").
		Methods("GET").
		Name("all metrics").
		Handler(confhandler.Respond(routeCheckGroup))

}
Exemplo n.º 5
0
// HandleSubrouter contains the different paths to follow during subrouting
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {

	// eg. timelines/critical/SITES/mysite
	s.Path("/{report_name}/{group_type}/{group_name}").
		Methods("GET").
		Name("endpoint group name").
		Handler(confhandler.Respond(routeCheckGroup))

	// eg. timelines/critical/SITES
	s.Path("/{report_name}/{group_type}").
		Methods("GET").
		Name("all endpoint groups").
		Handler(confhandler.Respond(routeCheckGroup))

}
Exemplo n.º 6
0
// HandleSubrouter contains the different paths to follow during subrouting
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {

	// eg. timelines/critical/SITE/mysite/services/apache
	s.Path("/{report_name}/{group_type}/{group_name}/services/{service_name}").
		Methods("GET").
		Name("service name").
		Handler(confhandler.Respond(routeCheckGroup))

	// eg. timelines/critical/SITE/mysite/services
	s.Path("/{report_name}/{group_type}/{group_name}/services").
		Methods("GET").
		Name("all services").
		Handler(confhandler.Respond(routeCheckGroup))

}
Exemplo n.º 7
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Path("/recomputations/{ID}").
		Name("List Single Recomputation").
		Handler(confhandler.Respond(ListOne))

	// strictRoute := s.MatcherFunc(respond.MatchRegex("^" + confhandler.Routes.V2["recomputations"] + "$")).Subrouter()

	s.Methods("GET").
		Path("/recomputations").
		Name("List Recomputations").
		Handler(confhandler.Respond(List))

	s.Methods("POST").
		Path("/recomputations").
		Name("Recomputations").
		Handler(confhandler.Respond(SubmitRecomputation))
}
Exemplo n.º 8
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {

	serviceSubrouter := s.PathPrefix("/{report_name}").Subrouter()

	serviceSubrouter.Path("/{group_type}/{group_name}/{lgroup_type}/{lgroup_name}/services/{service_type}").
		Methods("GET").
		Name("Service Flavor").
		Handler(confhandler.Respond(ListServiceFlavorResults))

	serviceSubrouter.Path("/{group_type}/{group_name}/{lgroup_type}/{lgroup_name}/services").
		Methods("GET").
		Name("Service Flavor").
		Handler(confhandler.Respond(ListServiceFlavorResults))

	serviceSubrouter.Path("/{lgroup_type}/{lgroup_name}/services/{service_type}").
		Methods("GET").
		Name("Service Flavor").
		Handler(confhandler.Respond(ListServiceFlavorResults))

	serviceSubrouter.Path("/{lgroup_type}/{lgroup_name}/services").
		Methods("GET").
		Name("Service Flavor").
		Handler(confhandler.Respond(ListServiceFlavorResults))

	groupSubrouter := s.PathPrefix("/{report_name}/{group_type}").Subrouter()
	groupSubrouter.
		Path("/{group_name}/{lgroup_type}/{lgroup_name}").
		Methods("GET").
		Name("Group name").
		Handler(confhandler.Respond(ListEndpointGroupResults))
	groupSubrouter.
		Path("/{group_name}/{lgroup_type}").
		Methods("GET").
		Name("Group name").
		Handler(confhandler.Respond(ListEndpointGroupResults))
	groupSubrouter.
		Path("/{group_name}").
		Methods("GET").
		Name("Group name").
		Handler(confhandler.Respond(routeGroup))
	groupSubrouter.
		Methods("GET").
		Name("Group Type").
		Handler(confhandler.Respond(routeGroup))
}
Exemplo n.º 9
0
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Name("List Factors").
		Handler(confhandler.Respond(List))
}