mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-23 11:21:33 +01:00
Merge pull request #2608 from semaphoreui/tf_state_mock
feat(tf): add andpoint mocks
This commit is contained in:
commit
3018d614e8
41
api/projects/terraform_inventory.go
Normal file
41
api/projects/terraform_inventory.go
Normal 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)
|
||||||
|
}
|
@ -283,6 +283,17 @@ func Route() *mux.Router {
|
|||||||
projectInventoryManagement.HandleFunc("/{inventory_id}", projects.UpdateInventory).Methods("PUT")
|
projectInventoryManagement.HandleFunc("/{inventory_id}", projects.UpdateInventory).Methods("PUT")
|
||||||
projectInventoryManagement.HandleFunc("/{inventory_id}", projects.RemoveInventory).Methods("DELETE")
|
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 := projectUserAPI.PathPrefix("/environment").Subrouter()
|
||||||
projectEnvManagement.Use(projects.EnvironmentMiddleware)
|
projectEnvManagement.Use(projects.EnvironmentMiddleware)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user