openapi: GET /script-policy endpoint to list script policies
This commit is contained in:
@@ -83,10 +83,12 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if len(elem) == 0 {
|
||||
switch r.Method {
|
||||
case "GET":
|
||||
s.handleListScriptPolicyRequest([0]string{}, elemIsEscaped, w, r)
|
||||
case "POST":
|
||||
s.handleCreateScriptPolicyRequest([0]string{}, elemIsEscaped, w, r)
|
||||
default:
|
||||
s.notAllowed(w, r, "POST")
|
||||
s.notAllowed(w, r, "GET,POST")
|
||||
}
|
||||
|
||||
return
|
||||
@@ -714,6 +716,14 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
|
||||
|
||||
if len(elem) == 0 {
|
||||
switch method {
|
||||
case "GET":
|
||||
r.name = ListScriptPolicyOperation
|
||||
r.summary = "Get list of script policies"
|
||||
r.operationID = "listScriptPolicy"
|
||||
r.pathPattern = "/script-policy"
|
||||
r.args = args
|
||||
r.count = 0
|
||||
return r, true
|
||||
case "POST":
|
||||
r.name = CreateScriptPolicyOperation
|
||||
r.summary = "Create a new script policy"
|
||||
|
||||
Reference in New Issue
Block a user