Merge pull request #2608 from semaphoreui/tf_state_mock

feat(tf): add andpoint mocks
This commit is contained in:
Denis Gukov 2024-12-04 13:08:44 +05:00 committed by GitHub
commit 3018d614e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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)