feat(tf): add andpoint mocks

This commit is contained in:
Denis Gukov 2024-12-03 18:38:44 +00:00
parent 2455eb1785
commit b3d462a2fd
6 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,41 @@
//go:build !pro
package projects
import "net/http"
func GetTerraformInventoryAliases(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func AddTerraformInventoryAlias(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func GetTerraformInventoryAlias(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func DeleteTerraformInventoryAlias(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func SetTerraformInventoryAliasAccessKey(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func GetTerraformInventoryStates(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func AddTerraformInventoryState(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func GetTerraformInventoryState(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func DeleteTerraformInventoryState(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}

View File

@ -283,6 +283,17 @@ func Route() *mux.Router {
projectInventoryManagement.HandleFunc("/{inventory_id}", projects.UpdateInventory).Methods("PUT")
projectInventoryManagement.HandleFunc("/{inventory_id}", projects.RemoveInventory).Methods("DELETE")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/aliases", projects.GetTerraformInventoryAliases).Methods("GET", "HEAD")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/aliases", projects.AddTerraformInventoryAlias).Methods("POST")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/aliases/{alias_id}", projects.GetTerraformInventoryAlias).Methods("GET")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/aliases/{alias_id}", projects.DeleteTerraformInventoryAlias).Methods("DELETE")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/aliases/{alias_id}", projects.SetTerraformInventoryAliasAccessKey).Methods("PUT")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/states", projects.GetTerraformInventoryStates).Methods("GET", "HEAD")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/states", projects.AddTerraformInventoryState).Methods("POST")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/states/{state_id}", projects.GetTerraformInventoryState).Methods("GET")
projectInventoryManagement.HandleFunc("/{inventory_id}/terraform/states/{state_id}", projects.DeleteTerraformInventoryState).Methods("DELETE")
projectEnvManagement := projectUserAPI.PathPrefix("/environment").Subrouter()
projectEnvManagement.Use(projects.EnvironmentMiddleware)