diff --git a/.yamllint b/.yamllint index b5a4741a..c8b616a9 100644 --- a/.yamllint +++ b/.yamllint @@ -10,6 +10,7 @@ ignore: - 'node_modules/**' - 'dist/**' - 'ui/node_modules/**' + - 'pkg/api/docs/**' rules: anchors: enable diff --git a/go.mod b/go.mod index 05349287..c8dae35e 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,8 @@ require ( github.com/charmbracelet/lipgloss v0.12.1 github.com/go-chi/chi/v5 v5.1.0 github.com/stretchr/testify v1.9.0 + github.com/swaggo/http-swagger/v2 v2.0.2 + github.com/swaggo/swag v1.16.3 github.com/zarf-dev/zarf v0.37.0 k8s.io/api v0.30.3 k8s.io/apimachinery v0.30.3 @@ -17,6 +19,7 @@ require ( atomicgo.dev/cursor v0.2.0 // indirect atomicgo.dev/keyboard v0.2.9 // indirect atomicgo.dev/schedule v0.1.0 // indirect + github.com/KyleBanks/depth v1.2.1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect @@ -28,9 +31,10 @@ require ( github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/fatih/color v1.16.0 // indirect github.com/go-logr/logr v1.4.2 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/swag v0.22.9 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect @@ -62,15 +66,17 @@ require ( github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect + github.com/swaggo/files/v2 v2.0.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.23.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 02922b91..670b8fd9 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8= atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ= atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs= atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs= github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8= github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII= @@ -35,8 +37,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/defenseunicorns/pkg/helpers/v2 v2.0.1 h1:j08rz9vhyD9Bs+yKiyQMY2tSSejXRMxTqEObZ5M1Wbk= github.com/defenseunicorns/pkg/helpers/v2 v2.0.1/go.mod h1:u1PAqOICZyiGIVA2v28g55bQH1GiAt0Bc4U9/rnWQvQ= -github.com/defenseunicorns/zarf v0.36.1 h1:G1KRMt0O3JrXrQfiOUEtkoFoPYR1q9DPKrzgS53u3Zc= -github.com/defenseunicorns/zarf v0.36.1/go.mod h1:tLj5XZGOzYIbdD3phJB5d4B2QkGDzhYvnCfd/kqvanc= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= @@ -47,12 +47,14 @@ github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= -github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -145,8 +147,7 @@ github.com/pterm/pterm v0.12.78/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IG github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= @@ -162,6 +163,12 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/swaggo/files/v2 v2.0.1 h1:XCVJO/i/VosCDsJu1YLpdejGsGnBE9deRMpjN4pJLHk= +github.com/swaggo/files/v2 v2.0.1/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM= +github.com/swaggo/http-swagger/v2 v2.0.2 h1:FKCdLsl+sFCx60KFsyM0rDarwiUSZ8DqbfSyIKC9OBg= +github.com/swaggo/http-swagger/v2 v2.0.2/go.mod h1:r7/GBkAWIfK6E/OLnE8fXnviHiDeAHmgIyooa4xm3AQ= +github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= +github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= @@ -182,6 +189,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -189,8 +198,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -215,8 +224,6 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -224,8 +231,6 @@ golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -243,8 +248,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/api/docs/docs.go b/pkg/api/docs/docs.go new file mode 100644 index 00000000..e787bce4 --- /dev/null +++ b/pkg/api/docs/docs.go @@ -0,0 +1,1972 @@ +// Package docs Code generated by swaggo/swag. DO NOT EDIT +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/monitor/pepr/{stream}": { + "get": { + "description": "Get Pepr data", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream" + ], + "tags": [ + "monitor" + ], + "parameters": [ + { + "enum": [ + "AnyStream", + "PolicyStream", + "OperatorStream", + "AllowStream", + "DenyStream", + "MutateStream", + "FailureStream" + ], + "type": "string", + "description": "stream type to filter on, all streams by default", + "name": "stream", + "in": "path" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/hpas": { + "get": { + "description": "Get HPAs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/hpas/{uid}": { + "get": { + "description": "Get HPA by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get hpa by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/limit-ranges": { + "get": { + "description": "Get LimitRanges", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/limit-ranges/{uid}": { + "get": { + "description": "Get LimitRange by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get limit-range by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/mutatingwebhooks": { + "get": { + "description": "Get MutatingWebhooks", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/mutatingwebhooks/{uid}": { + "get": { + "description": "Get MutatingWebhook by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get mutatingwebhook by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/poddisruptionbudgets": { + "get": { + "description": "Get PodDisruptionBudgets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/poddisruptionbudgets/{uid}": { + "get": { + "description": "Get PodDisruptionBudget by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get poddisruptionbudget by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/priority-classes": { + "get": { + "description": "Get PriorityClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/priority-classes/{uid}": { + "get": { + "description": "Get PriorityClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get priority-class by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/resource-quotas": { + "get": { + "description": "Get ResourceQuotas", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/resource-quotas/{uid}": { + "get": { + "description": "Get ResourceQuota by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get resource-quota by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/runtime-classes": { + "get": { + "description": "Get RuntimeClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/runtime-classes/{uid}": { + "get": { + "description": "Get RuntimeClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get runtime-class by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/validatingwebhooks": { + "get": { + "description": "Get ValidatingWebhooks", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/validatingwebhooks/{uid}": { + "get": { + "description": "Get ValidatingWebhook by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get validatingwebhook by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/configmaps": { + "get": { + "description": "Get ConfigMaps", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/configmaps/{uid}": { + "get": { + "description": "Get ConfigMap by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get configmap by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/secrets": { + "get": { + "description": "Get Secrets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/secrets/{uid}": { + "get": { + "description": "Get Secret by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get secret by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-exemptions": { + "get": { + "description": "Get UDS Exemptions", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-exemptions/{uid}": { + "get": { + "description": "Get UDS Exemption by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get uds exemption by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-packages": { + "get": { + "description": "Get UDS Packages", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-packages/{uid}": { + "get": { + "description": "Get UDS Package by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get uds package by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/events": { + "get": { + "description": "Get Events", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/events/{uid}": { + "get": { + "description": "Get Event by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get event by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/namespaces": { + "get": { + "description": "Get Namespaces", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/namespaces/{uid}": { + "get": { + "description": "Get Namespace by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get namespace by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/endpoints": { + "get": { + "description": "Get Endpoints", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/endpoints/{uid}": { + "get": { + "description": "Get Endpoint by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get endpoint by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/networkpolicies": { + "get": { + "description": "Get NetworkPolicies", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/networkpolicies/{uid}": { + "get": { + "description": "Get NetworkPolicy by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get networkpolicy by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/services": { + "get": { + "description": "Get Services", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/services/{uid}": { + "get": { + "description": "Get Service by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get service by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/virtualservices": { + "get": { + "description": "Get VirtualServices", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/virtualservices/{uid}": { + "get": { + "description": "Get VirtualService by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get virtualservice by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/nodes": { + "get": { + "description": "Get Nodes", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/nodes/{uid}": { + "get": { + "description": "Get Node by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get node by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumeclaims": { + "get": { + "description": "Get PersistentVolumeClaims", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumeclaims/{uid}": { + "get": { + "description": "Get PersistentVolumeClaim by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get persistentvolumeclaim by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumes": { + "get": { + "description": "Get PersistentVolumes", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumes/{uid}": { + "get": { + "description": "Get PersistentVolume by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get persistentvolume by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/storageclasses": { + "get": { + "description": "Get StorageClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/storageclasses/{uid}": { + "get": { + "description": "Get StorageClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get storageclass by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/cronjobs": { + "get": { + "description": "Get CronJobs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/cronjobs/{uid}": { + "get": { + "description": "Get CronJob by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get cronjob by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/daemonsets": { + "get": { + "description": "Get Daemonsets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/daemonsets/{uid}": { + "get": { + "description": "Get Daemonset by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get daemonset by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/deployments": { + "get": { + "description": "Get Deployments", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/deployments/{uid}": { + "get": { + "description": "Get Deployment by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get deployment by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/jobs": { + "get": { + "description": "Get Jobs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/jobs/{uid}": { + "get": { + "description": "Get Job by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get job by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/podmetrics": { + "get": { + "description": "Get PodMetrics", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream" + ], + "tags": [ + "workloads" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/pods": { + "get": { + "description": "Get Pods", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/pods/{uid}": { + "get": { + "description": "Get Pod by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get pod by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/statefulsets": { + "get": { + "description": "Get Statefulsets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to` + "`" + `false` + "`" + ` and will return a text/event-stream. If set to ` + "`" + `true` + "`" + ` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/statefulsets/{uid}": { + "get": { + "description": "Get Statefulset by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get statefulset by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "0.0.0", + Host: "", + BasePath: "/api/v1", + Schemes: []string{"http", "https"}, + Title: "UDS Runtime API", + Description: "", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/pkg/api/docs/swagger.json b/pkg/api/docs/swagger.json new file mode 100644 index 00000000..86ed7dc5 --- /dev/null +++ b/pkg/api/docs/swagger.json @@ -0,0 +1,1950 @@ +{ + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "title": "UDS Runtime API", + "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "0.0.0" + }, + "basePath": "/api/v1", + "paths": { + "/monitor/pepr/{stream}": { + "get": { + "description": "Get Pepr data", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream" + ], + "tags": [ + "monitor" + ], + "parameters": [ + { + "enum": [ + "AnyStream", + "PolicyStream", + "OperatorStream", + "AllowStream", + "DenyStream", + "MutateStream", + "FailureStream" + ], + "type": "string", + "description": "stream type to filter on, all streams by default", + "name": "stream", + "in": "path" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/hpas": { + "get": { + "description": "Get HPAs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/hpas/{uid}": { + "get": { + "description": "Get HPA by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get hpa by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/limit-ranges": { + "get": { + "description": "Get LimitRanges", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/limit-ranges/{uid}": { + "get": { + "description": "Get LimitRange by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get limit-range by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/mutatingwebhooks": { + "get": { + "description": "Get MutatingWebhooks", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/mutatingwebhooks/{uid}": { + "get": { + "description": "Get MutatingWebhook by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get mutatingwebhook by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/poddisruptionbudgets": { + "get": { + "description": "Get PodDisruptionBudgets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/poddisruptionbudgets/{uid}": { + "get": { + "description": "Get PodDisruptionBudget by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get poddisruptionbudget by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/priority-classes": { + "get": { + "description": "Get PriorityClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/priority-classes/{uid}": { + "get": { + "description": "Get PriorityClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get priority-class by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/resource-quotas": { + "get": { + "description": "Get ResourceQuotas", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/resource-quotas/{uid}": { + "get": { + "description": "Get ResourceQuota by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get resource-quota by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/runtime-classes": { + "get": { + "description": "Get RuntimeClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/runtime-classes/{uid}": { + "get": { + "description": "Get RuntimeClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get runtime-class by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/validatingwebhooks": { + "get": { + "description": "Get ValidatingWebhooks", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/cluster-ops/validatingwebhooks/{uid}": { + "get": { + "description": "Get ValidatingWebhook by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "cluster ops" + ], + "parameters": [ + { + "type": "string", + "description": "Get validatingwebhook by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/configmaps": { + "get": { + "description": "Get ConfigMaps", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/configmaps/{uid}": { + "get": { + "description": "Get ConfigMap by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get configmap by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/secrets": { + "get": { + "description": "Get Secrets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/secrets/{uid}": { + "get": { + "description": "Get Secret by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get secret by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-exemptions": { + "get": { + "description": "Get UDS Exemptions", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-exemptions/{uid}": { + "get": { + "description": "Get UDS Exemption by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get uds exemption by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-packages": { + "get": { + "description": "Get UDS Packages", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/configs/uds-packages/{uid}": { + "get": { + "description": "Get UDS Package by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "configs" + ], + "parameters": [ + { + "type": "string", + "description": "Get uds package by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/events": { + "get": { + "description": "Get Events", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/events/{uid}": { + "get": { + "description": "Get Event by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get event by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/namespaces": { + "get": { + "description": "Get Namespaces", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/namespaces/{uid}": { + "get": { + "description": "Get Namespace by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get namespace by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/endpoints": { + "get": { + "description": "Get Endpoints", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/endpoints/{uid}": { + "get": { + "description": "Get Endpoint by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get endpoint by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/networkpolicies": { + "get": { + "description": "Get NetworkPolicies", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/networkpolicies/{uid}": { + "get": { + "description": "Get NetworkPolicy by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get networkpolicy by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/services": { + "get": { + "description": "Get Services", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/services/{uid}": { + "get": { + "description": "Get Service by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get service by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/virtualservices": { + "get": { + "description": "Get VirtualServices", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/networks/virtualservices/{uid}": { + "get": { + "description": "Get VirtualService by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "networks" + ], + "parameters": [ + { + "type": "string", + "description": "Get virtualservice by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/nodes": { + "get": { + "description": "Get Nodes", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/nodes/{uid}": { + "get": { + "description": "Get Node by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "resources" + ], + "parameters": [ + { + "type": "string", + "description": "Get node by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumeclaims": { + "get": { + "description": "Get PersistentVolumeClaims", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumeclaims/{uid}": { + "get": { + "description": "Get PersistentVolumeClaim by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get persistentvolumeclaim by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumes": { + "get": { + "description": "Get PersistentVolumes", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/persistentvolumes/{uid}": { + "get": { + "description": "Get PersistentVolume by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get persistentvolume by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/storageclasses": { + "get": { + "description": "Get StorageClasses", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/storage/storageclasses/{uid}": { + "get": { + "description": "Get StorageClass by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "storage" + ], + "parameters": [ + { + "type": "string", + "description": "Get storageclass by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/cronjobs": { + "get": { + "description": "Get CronJobs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/cronjobs/{uid}": { + "get": { + "description": "Get CronJob by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get cronjob by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/daemonsets": { + "get": { + "description": "Get Daemonsets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/daemonsets/{uid}": { + "get": { + "description": "Get Daemonset by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get daemonset by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/deployments": { + "get": { + "description": "Get Deployments", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/deployments/{uid}": { + "get": { + "description": "Get Deployment by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get deployment by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/jobs": { + "get": { + "description": "Get Jobs", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/jobs/{uid}": { + "get": { + "description": "Get Job by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get job by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/podmetrics": { + "get": { + "description": "Get PodMetrics", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream" + ], + "tags": [ + "workloads" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/pods": { + "get": { + "description": "Get Pods", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/pods/{uid}": { + "get": { + "description": "Get Pod by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get pod by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/statefulsets": { + "get": { + "description": "Get Statefulsets", + "consumes": [ + "text/html" + ], + "produces": [ + "text/event-stream", + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "boolean", + "description": "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json.", + "name": "once", + "in": "query" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/resources/workloads/statefulsets/{uid}": { + "get": { + "description": "Get Statefulset by UID", + "consumes": [ + "text/html" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workloads" + ], + "parameters": [ + { + "type": "string", + "description": "Get statefulset by uid", + "name": "uid", + "in": "path" + }, + { + "type": "boolean", + "description": "Send the data in dense format", + "name": "dense", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/pkg/api/docs/swagger.yaml b/pkg/api/docs/swagger.yaml new file mode 100644 index 00000000..eb9cccb9 --- /dev/null +++ b/pkg/api/docs/swagger.yaml @@ -0,0 +1,1310 @@ +basePath: /api/v1 +info: + contact: {} + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: UDS Runtime API + version: 0.0.0 +paths: + /monitor/pepr/{stream}: + get: + consumes: + - text/html + description: Get Pepr data + parameters: + - description: stream type to filter on, all streams by default + enum: + - AnyStream + - PolicyStream + - OperatorStream + - AllowStream + - DenyStream + - MutateStream + - FailureStream + in: path + name: stream + type: string + produces: + - text/event-stream + responses: + "200": + description: OK + tags: + - monitor + /resources/cluster-ops/hpas: + get: + consumes: + - text/html + description: Get HPAs + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/hpas/{uid}: + get: + consumes: + - text/html + description: Get HPA by UID + parameters: + - description: Get hpa by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/limit-ranges: + get: + consumes: + - text/html + description: Get LimitRanges + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/limit-ranges/{uid}: + get: + consumes: + - text/html + description: Get LimitRange by UID + parameters: + - description: Get limit-range by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/mutatingwebhooks: + get: + consumes: + - text/html + description: Get MutatingWebhooks + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/mutatingwebhooks/{uid}: + get: + consumes: + - text/html + description: Get MutatingWebhook by UID + parameters: + - description: Get mutatingwebhook by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/poddisruptionbudgets: + get: + consumes: + - text/html + description: Get PodDisruptionBudgets + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/poddisruptionbudgets/{uid}: + get: + consumes: + - text/html + description: Get PodDisruptionBudget by UID + parameters: + - description: Get poddisruptionbudget by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/priority-classes: + get: + consumes: + - text/html + description: Get PriorityClasses + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/priority-classes/{uid}: + get: + consumes: + - text/html + description: Get PriorityClass by UID + parameters: + - description: Get priority-class by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/resource-quotas: + get: + consumes: + - text/html + description: Get ResourceQuotas + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/resource-quotas/{uid}: + get: + consumes: + - text/html + description: Get ResourceQuota by UID + parameters: + - description: Get resource-quota by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/runtime-classes: + get: + consumes: + - text/html + description: Get RuntimeClasses + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/runtime-classes/{uid}: + get: + consumes: + - text/html + description: Get RuntimeClass by UID + parameters: + - description: Get runtime-class by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/validatingwebhooks: + get: + consumes: + - text/html + description: Get ValidatingWebhooks + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/cluster-ops/validatingwebhooks/{uid}: + get: + consumes: + - text/html + description: Get ValidatingWebhook by UID + parameters: + - description: Get validatingwebhook by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - cluster ops + /resources/configs/configmaps: + get: + consumes: + - text/html + description: Get ConfigMaps + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/configmaps/{uid}: + get: + consumes: + - text/html + description: Get ConfigMap by UID + parameters: + - description: Get configmap by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/secrets: + get: + consumes: + - text/html + description: Get Secrets + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/secrets/{uid}: + get: + consumes: + - text/html + description: Get Secret by UID + parameters: + - description: Get secret by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/uds-exemptions: + get: + consumes: + - text/html + description: Get UDS Exemptions + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/uds-exemptions/{uid}: + get: + consumes: + - text/html + description: Get UDS Exemption by UID + parameters: + - description: Get uds exemption by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/uds-packages: + get: + consumes: + - text/html + description: Get UDS Packages + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/configs/uds-packages/{uid}: + get: + consumes: + - text/html + description: Get UDS Package by UID + parameters: + - description: Get uds package by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - configs + /resources/events: + get: + consumes: + - text/html + description: Get Events + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/events/{uid}: + get: + consumes: + - text/html + description: Get Event by UID + parameters: + - description: Get event by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/namespaces: + get: + consumes: + - text/html + description: Get Namespaces + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/namespaces/{uid}: + get: + consumes: + - text/html + description: Get Namespace by UID + parameters: + - description: Get namespace by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/networks/endpoints: + get: + consumes: + - text/html + description: Get Endpoints + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/endpoints/{uid}: + get: + consumes: + - text/html + description: Get Endpoint by UID + parameters: + - description: Get endpoint by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/networkpolicies: + get: + consumes: + - text/html + description: Get NetworkPolicies + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/networkpolicies/{uid}: + get: + consumes: + - text/html + description: Get NetworkPolicy by UID + parameters: + - description: Get networkpolicy by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/services: + get: + consumes: + - text/html + description: Get Services + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/services/{uid}: + get: + consumes: + - text/html + description: Get Service by UID + parameters: + - description: Get service by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/virtualservices: + get: + consumes: + - text/html + description: Get VirtualServices + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/networks/virtualservices/{uid}: + get: + consumes: + - text/html + description: Get VirtualService by UID + parameters: + - description: Get virtualservice by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - networks + /resources/nodes: + get: + consumes: + - text/html + description: Get Nodes + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/nodes/{uid}: + get: + consumes: + - text/html + description: Get Node by UID + parameters: + - description: Get node by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - resources + /resources/storage/persistentvolumeclaims: + get: + consumes: + - text/html + description: Get PersistentVolumeClaims + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/storage/persistentvolumeclaims/{uid}: + get: + consumes: + - text/html + description: Get PersistentVolumeClaim by UID + parameters: + - description: Get persistentvolumeclaim by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/storage/persistentvolumes: + get: + consumes: + - text/html + description: Get PersistentVolumes + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/storage/persistentvolumes/{uid}: + get: + consumes: + - text/html + description: Get PersistentVolume by UID + parameters: + - description: Get persistentvolume by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/storage/storageclasses: + get: + consumes: + - text/html + description: Get StorageClasses + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/storage/storageclasses/{uid}: + get: + consumes: + - text/html + description: Get StorageClass by UID + parameters: + - description: Get storageclass by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - storage + /resources/workloads/cronjobs: + get: + consumes: + - text/html + description: Get CronJobs + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/cronjobs/{uid}: + get: + consumes: + - text/html + description: Get CronJob by UID + parameters: + - description: Get cronjob by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/daemonsets: + get: + consumes: + - text/html + description: Get Daemonsets + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/daemonsets/{uid}: + get: + consumes: + - text/html + description: Get Daemonset by UID + parameters: + - description: Get daemonset by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/deployments: + get: + consumes: + - text/html + description: Get Deployments + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/deployments/{uid}: + get: + consumes: + - text/html + description: Get Deployment by UID + parameters: + - description: Get deployment by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/jobs: + get: + consumes: + - text/html + description: Get Jobs + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/jobs/{uid}: + get: + consumes: + - text/html + description: Get Job by UID + parameters: + - description: Get job by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/podmetrics: + get: + consumes: + - text/html + description: Get PodMetrics + produces: + - text/event-stream + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/pods: + get: + consumes: + - text/html + description: Get Pods + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/pods/{uid}: + get: + consumes: + - text/html + description: Get Pod by UID + parameters: + - description: Get pod by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/statefulsets: + get: + consumes: + - text/html + description: Get Statefulsets + parameters: + - description: Send the data once and close the connection. By default this + is set to`false` and will return a text/event-stream. If set to `true` the + response content type is application/json. + in: query + name: once + type: boolean + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - text/event-stream + - application/json + responses: + "200": + description: OK + tags: + - workloads + /resources/workloads/statefulsets/{uid}: + get: + consumes: + - text/html + description: Get Statefulset by UID + parameters: + - description: Get statefulset by uid + in: path + name: uid + type: string + - description: Send the data in dense format + in: query + name: dense + type: boolean + produces: + - application/json + responses: + "200": + description: OK + tags: + - workloads +schemes: +- http +- https +swagger: "2.0" diff --git a/pkg/api/handlers.go b/pkg/api/handlers.go new file mode 100644 index 00000000..07c1e000 --- /dev/null +++ b/pkg/api/handlers.go @@ -0,0 +1,691 @@ +package api + +import ( + "net/http" + + _ "github.com/defenseunicorns/uds-runtime/pkg/api/docs" //nolint:staticcheck + "github.com/defenseunicorns/uds-runtime/pkg/api/resources" + "github.com/defenseunicorns/uds-runtime/pkg/api/sse" +) + +// @Description Get Nodes +// @Tags resources +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/nodes [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getNodes(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Nodes) +} + +// @Description Get Node by UID +// @Tags resources +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/nodes/{uid} [get] +// @Param uid path string false "Get node by uid" +// @Param dense query bool false "Send the data in dense format" +func getNode(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Nodes) +} + +// @Description Get Events +// @Tags resources +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/events [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getEvents(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Events) +} + +// @Description Get Event by UID +// @Tags resources +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/events/{uid} [get] +// @Param uid path string false "Get event by uid" +// @Param dense query bool false "Send the data in dense format" +func getEvent(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Events) +} + +// @Description Get Namespaces +// @Tags resources +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/namespaces [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getNamespaces(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Namespaces) +} + +// @Description Get Namespace by UID +// @Tags resources +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/namespaces/{uid} [get] +// @Param uid path string false "Get namespace by uid" +// @Param dense query bool false "Send the data in dense format" +func getNamespace(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Namespaces) +} + +// @Description Get Pods +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/pods [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getPods(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Pods) +} + +// @Description Get Pod by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/pods/{uid} [get] +// @Param uid path string false "Get pod by uid" +// @Param dense query bool false "Send the data in dense format" +func getPod(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Pods) +} + +// @Description Get Deployments +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/deployments [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getDeployments(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Deployments) +} + +// @Description Get Deployment by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/deployments/{uid} [get] +// @Param uid path string false "Get deployment by uid" +// @Param dense query bool false "Send the data in dense format" +func getDeployment(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Deployments) +} + +// @Description Get Daemonsets +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/daemonsets [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getDaemonsets(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Daemonsets) +} + +// @Description Get Daemonset by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/daemonsets/{uid} [get] +// @Param uid path string false "Get daemonset by uid" +// @Param dense query bool false "Send the data in dense format" +func getDaemonset(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Daemonsets) +} + +// @Description Get Statefulsets +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/statefulsets [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getStatefulsets(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Statefulsets) +} + +// @Description Get Statefulset by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/statefulsets/{uid} [get] +// @Param uid path string false "Get statefulset by uid" +// @Param dense query bool false "Send the data in dense format" +func getStatefulset(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Statefulsets) +} + +// @Description Get Jobs +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/jobs [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getJobs(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Jobs) +} + +// @Description Get Job by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/jobs/{uid} [get] +// @Param uid path string false "Get job by uid" +// @Param dense query bool false "Send the data in dense format" +func getJob(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Jobs) +} + +// @Description Get CronJobs +// @Tags workloads +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/workloads/cronjobs [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getCronJobs(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.CronJobs) +} + +// @Description Get CronJob by UID +// @Tags workloads +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/workloads/cronjobs/{uid} [get] +// @Param uid path string false "Get cronjob by uid" +// @Param dense query bool false "Send the data in dense format" +func getCronJob(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.CronJobs) +} + +// @Description Get PodMetrics +// @Tags workloads +// @Accept html +// @Produce text/event-stream +// @Success 200 +// @Router /resources/workloads/podmetrics [get] +func getPodMetrics(w http.ResponseWriter, r *http.Request, cache *resources.Cache) { + sse.Handler(w, r, cache.PodMetrics.GetAll, cache.MetricsChanges) +} + +// @Description Get UDS Packages +// @Tags configs +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/configs/uds-packages [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getUDSPackages(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.UDSPackages) +} + +// @Description Get UDS Package by UID +// @Tags configs +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/configs/uds-packages/{uid} [get] +// @Param uid path string false "Get uds package by uid" +// @Param dense query bool false "Send the data in dense format" +func getUDSPackage(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.UDSPackages) +} + +// @Description Get UDS Exemptions +// @Tags configs +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/configs/uds-exemptions [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getUDSExemptions(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.UDSExemptions) +} + +// @Description Get UDS Exemption by UID +// @Tags configs +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/configs/uds-exemptions/{uid} [get] +// @Param uid path string false "Get uds exemption by uid" +// @Param dense query bool false "Send the data in dense format" +func getUDSExemption(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.UDSExemptions) +} + +// @Description Get ConfigMaps +// @Tags configs +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/configs/configmaps [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getConfigMaps(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Configmaps) +} + +// @Description Get ConfigMap by UID +// @Tags configs +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/configs/configmaps/{uid} [get] +// @Param uid path string false "Get configmap by uid" +// @Param dense query bool false "Send the data in dense format" +func getConfigMap(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Configmaps) +} + +// @Description Get Secrets +// @Tags configs +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/configs/secrets [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getSecrets(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Secrets) +} + +// @Description Get Secret by UID +// @Tags configs +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/configs/secrets/{uid} [get] +// @Param uid path string false "Get secret by uid" +// @Param dense query bool false "Send the data in dense format" +func getSecret(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Secrets) +} + +// @Description Get MutatingWebhooks +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/mutatingwebhooks [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getMutatingWebhooks(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.MutatingWebhooks) +} + +// @Description Get MutatingWebhook by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/mutatingwebhooks/{uid} [get] +// @Param uid path string false "Get mutatingwebhook by uid" +// @Param dense query bool false "Send the data in dense format" +func getMutatingWebhook(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.MutatingWebhooks) +} + +// @Description Get ValidatingWebhooks +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/validatingwebhooks [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getValidatingWebhooks(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.ValidatingWebhooks) +} + +// @Description Get ValidatingWebhook by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/validatingwebhooks/{uid} [get] +// @Param uid path string false "Get validatingwebhook by uid" +// @Param dense query bool false "Send the data in dense format" +func getValidatingWebhook(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.ValidatingWebhooks) +} + +// @Description Get HPAs +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/hpas [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getHPAs(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.HPAs) +} + +// @Description Get HPA by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/hpas/{uid} [get] +// @Param uid path string false "Get hpa by uid" +// @Param dense query bool false "Send the data in dense format" +func getHPA(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.HPAs) +} + +// @Description Get PriorityClasses +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/priority-classes [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getPriorityClasses(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PriorityClasses) +} + +// @Description Get PriorityClass by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/priority-classes/{uid} [get] +// @Param uid path string false "Get priority-class by uid" +// @Param dense query bool false "Send the data in dense format" +func getPriorityClass(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PriorityClasses) +} + +// @Description Get RuntimeClasses +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/runtime-classes [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getRuntimeClasses(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.RuntimeClasses) +} + +// @Description Get RuntimeClass by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/runtime-classes/{uid} [get] +// @Param uid path string false "Get runtime-class by uid" +// @Param dense query bool false "Send the data in dense format" +func getRuntimeClass(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.RuntimeClasses) +} + +// @Description Get PodDisruptionBudgets +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/poddisruptionbudgets [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getPodDisruptionBudgets(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PodDisruptionBudgets) +} + +// @Description Get PodDisruptionBudget by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/poddisruptionbudgets/{uid} [get] +// @Param uid path string false "Get poddisruptionbudget by uid" +// @Param dense query bool false "Send the data in dense format" +func getPodDisruptionBudget(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PodDisruptionBudgets) +} + +// @Description Get LimitRanges +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/limit-ranges [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getLimitRanges(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.LimitRanges) +} + +// @Description Get LimitRange by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/limit-ranges/{uid} [get] +// @Param uid path string false "Get limit-range by uid" +// @Param dense query bool false "Send the data in dense format" +func getLimitRange(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.LimitRanges) +} + +// @Description Get ResourceQuotas +// @Tags cluster ops +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/cluster-ops/resource-quotas [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getResourceQuotas(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.ResourceQuotas) +} + +// @Description Get ResourceQuota by UID +// @Tags cluster ops +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/cluster-ops/resource-quotas/{uid} [get] +// @Param uid path string false "Get resource-quota by uid" +// @Param dense query bool false "Send the data in dense format" +func getResourceQuota(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.ResourceQuotas) +} + +// @Description Get Services +// @Tags networks +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/networks/services [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getServices(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Services) +} + +// @Description Get Service by UID +// @Tags networks +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/networks/services/{uid} [get] +// @Param uid path string false "Get service by uid" +// @Param dense query bool false "Send the data in dense format" +func getService(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Services) +} + +// @Description Get NetworkPolicies +// @Tags networks +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/networks/networkpolicies [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getNetworkPolicies(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.NetworkPolicies) +} + +// @Description Get NetworkPolicy by UID +// @Tags networks +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/networks/networkpolicies/{uid} [get] +// @Param uid path string false "Get networkpolicy by uid" +// @Param dense query bool false "Send the data in dense format" +func getNetworkPolicy(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.NetworkPolicies) +} + +// @Description Get Endpoints +// @Tags networks +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/networks/endpoints [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getEndpoints(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Endpoints) +} + +// @Description Get Endpoint by UID +// @Tags networks +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/networks/endpoints/{uid} [get] +// @Param uid path string false "Get endpoint by uid" +// @Param dense query bool false "Send the data in dense format" +func getEndpoint(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.Endpoints) +} + +// @Description Get VirtualServices +// @Tags networks +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/networks/virtualservices [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getVirtualServices(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.VirtualServices) +} + +// @Description Get VirtualService by UID +// @Tags networks +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/networks/virtualservices/{uid} [get] +// @Param uid path string false "Get virtualservice by uid" +// @Param dense query bool false "Send the data in dense format" +func getVirtualService(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.VirtualServices) +} + +// @Description Get PersistentVolumes +// @Tags storage +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/storage/persistentvolumes [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getPersistentVolumes(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PersistentVolumes) +} + +// @Description Get PersistentVolume by UID +// @Tags storage +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/storage/persistentvolumes/{uid} [get] +// @Param uid path string false "Get persistentvolume by uid" +// @Param dense query bool false "Send the data in dense format" +func getPersistentVolume(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PersistentVolumes) +} + +// @Description Get PersistentVolumeClaims +// @Tags storage +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/storage/persistentvolumeclaims [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getPersistentVolumeClaims(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PersistentVolumeClaims) +} + +// @Description Get PersistentVolumeClaim by UID +// @Tags storage +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/storage/persistentvolumeclaims/{uid} [get] +// @Param uid path string false "Get persistentvolumeclaim by uid" +// @Param dense query bool false "Send the data in dense format" +func getPersistentVolumeClaim(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.PersistentVolumeClaims) +} + +// @Description Get StorageClasses +// @Tags storage +// @Accept html +// @Produce text/event-stream,json +// @Success 200 +// @Router /resources/storage/storageclasses [get] +// @Param once query bool false "Send the data once and close the connection. By default this is set to`false` and will return a text/event-stream. If set to `true` the response content type is application/json." +// @Param dense query bool false "Send the data in dense format" +func getStorageClasses(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.StorageClasses) +} + +// @Description Get StorageClass by UID +// @Tags storage +// @Accept html +// @Produce json +// @Success 200 +// @Router /resources/storage/storageclasses/{uid} [get] +// @Param uid path string false "Get storageclass by uid" +// @Param dense query bool false "Send the data in dense format" +func getStorageClass(cache *resources.Cache) func(w http.ResponseWriter, r *http.Request) { + return sse.Bind(cache.StorageClasses) +} diff --git a/pkg/api/monitor/pepr.go b/pkg/api/monitor/pepr.go index 247f50ff..42111401 100644 --- a/pkg/api/monitor/pepr.go +++ b/pkg/api/monitor/pepr.go @@ -18,6 +18,13 @@ import ( "github.com/zarf-dev/zarf/src/pkg/message" ) +// @Description Get Pepr data +// @Tags monitor +// @Accept html +// @Produce text/event-stream +// @Success 200 +// @Router /monitor/pepr/{stream} [get] +// @Param stream path string false "stream type to filter on, all streams by default" Enums(AnyStream, PolicyStream, OperatorStream, AllowStream, DenyStream, MutateStream, FailureStream) func Pepr(w http.ResponseWriter, r *http.Request) { streamFilter := chi.URLParam(r, "stream") diff --git a/pkg/api/start.go b/pkg/api/start.go index fe973a78..44cdfe22 100644 --- a/pkg/api/start.go +++ b/pkg/api/start.go @@ -11,16 +11,24 @@ import ( "io/fs" "log" "net/http" + "strings" + _ "github.com/defenseunicorns/uds-runtime/pkg/api/docs" //nolint:staticcheck "github.com/defenseunicorns/uds-runtime/pkg/api/monitor" "github.com/defenseunicorns/uds-runtime/pkg/api/resources" - "github.com/defenseunicorns/uds-runtime/pkg/api/sse" "github.com/defenseunicorns/uds-runtime/pkg/api/udsmiddleware" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" + httpSwagger "github.com/swaggo/http-swagger/v2" ) +// @title UDS Runtime API +// @version 0.0.0 +// @license.name Apache 2.0 +// @license.url http://www.apache.org/licenses/LICENSE-2.0.html +// @BasePath /api/v1 +// @schemes http https func Start(assets embed.FS) error { r := chi.NewRouter() @@ -34,114 +42,116 @@ func Start(assets embed.FS) error { return fmt.Errorf("failed to create cache: %w", err) } + // Add Swagger UI route + r.Get("/swagger/*", httpSwagger.WrapHandler) r.Route("/api/v1", func(r chi.Router) { r.Get("/monitor/pepr/", monitor.Pepr) r.Get("/monitor/pepr/{stream}", monitor.Pepr) r.Route("/resources", func(r chi.Router) { - r.Get("/nodes", sse.Bind(cache.Nodes)) - r.Get("/nodes/{uid}", sse.Bind(cache.Nodes)) + r.Get("/nodes", getNodes(cache)) + r.Get("/nodes/{uid}", getNode(cache)) - r.Get("/events", sse.Bind(cache.Events)) - r.Get("/events/{uid}", sse.Bind(cache.Events)) + r.Get("/events", getEvents(cache)) + r.Get("/events/{uid}", getEvent(cache)) - r.Get("/namespaces", sse.Bind(cache.Namespaces)) - r.Get("/namespaces/{uid}", sse.Bind(cache.Namespaces)) + r.Get("/namespaces", getNamespaces(cache)) + r.Get("/namespaces/{uid}", getNamespace(cache)) // Workload resources r.Route("/workloads", func(r chi.Router) { - r.Get("/pods", sse.Bind(cache.Pods)) - r.Get("/pods/{uid}", sse.Bind(cache.Pods)) + r.Get("/pods", getPods(cache)) + r.Get("/pods/{uid}", getPod(cache)) - r.Get("/deployments", sse.Bind(cache.Deployments)) - r.Get("/deployments/{uid}", sse.Bind(cache.Deployments)) + r.Get("/deployments", getDeployments(cache)) + r.Get("/deployments/{uid}", getDeployment(cache)) - r.Get("/daemonsets", sse.Bind(cache.Daemonsets)) - r.Get("/daemonsets/{uid}", sse.Bind(cache.Daemonsets)) + r.Get("/daemonsets", getDaemonsets(cache)) + r.Get("/daemonsets/{uid}", getDaemonset(cache)) - r.Get("/statefulsets", sse.Bind(cache.Statefulsets)) - r.Get("/statefulsets/{uid}", sse.Bind(cache.Statefulsets)) + r.Get("/statefulsets", getStatefulsets(cache)) + r.Get("/statefulsets/{uid}", getStatefulset(cache)) - r.Get("/jobs", sse.Bind(cache.Jobs)) - r.Get("/jobs/{uid}", sse.Bind(cache.Jobs)) + r.Get("/jobs", getJobs(cache)) + r.Get("/jobs/{uid}", getJob(cache)) - r.Get("/cronjobs", sse.Bind(cache.CronJobs)) - r.Get("/cronjobs/{uid}", sse.Bind(cache.CronJobs)) + r.Get("/cronjobs", getCronJobs(cache)) + r.Get("/cronjobs/{uid}", getCronJob(cache)) // Metrics have their own cache and change channel that updates every 30 seconds // They do not support informers directly, so we need to poll the API r.Get("/podmetrics", func(w http.ResponseWriter, r *http.Request) { - sse.Handler(w, r, cache.PodMetrics.GetAll, cache.MetricsChanges) + getPodMetrics(w, r, cache) }) }) // Config resources r.Route("/configs", func(r chi.Router) { - r.Get("/uds-packages", sse.Bind(cache.UDSPackages)) - r.Get("/uds-packages/{uid}", sse.Bind(cache.UDSPackages)) + r.Get("/uds-packages", getUDSPackages(cache)) + r.Get("/uds-packages/{uid}", getUDSPackage(cache)) - r.Get("/uds-exemptions", sse.Bind(cache.UDSExemptions)) - r.Get("/uds-exemptions/{uid}", sse.Bind(cache.UDSExemptions)) + r.Get("/uds-exemptions", getUDSExemptions(cache)) + r.Get("/uds-exemptions/{uid}", getUDSExemption(cache)) - r.Get("/configmaps", sse.Bind(cache.Configmaps)) - r.Get("/configmaps/{uid}", sse.Bind(cache.Configmaps)) + r.Get("/configmaps", getConfigMaps(cache)) + r.Get("/configmaps/{uid}", getConfigMap(cache)) - r.Get("/secrets", sse.Bind(cache.Secrets)) - r.Get("/secrets/{uid}", sse.Bind(cache.Secrets)) + r.Get("/secrets", getSecrets(cache)) + r.Get("/secrets/{uid}", getSecret(cache)) }) // Cluster ops resources r.Route("/cluster-ops", func(r chi.Router) { - r.Get("/mutatingwebhooks", sse.Bind(cache.MutatingWebhooks)) - r.Get("/mutatingwebhooks/{uid}", sse.Bind(cache.MutatingWebhooks)) + r.Get("/mutatingwebhooks", getMutatingWebhooks(cache)) + r.Get("/mutatingwebhooks/{uid}", getMutatingWebhook(cache)) - r.Get("/validatingwebhooks", sse.Bind(cache.ValidatingWebhooks)) - r.Get("/validatingwebhooks/{uid}", sse.Bind(cache.ValidatingWebhooks)) + r.Get("/validatingwebhooks", getValidatingWebhooks(cache)) + r.Get("/validatingwebhooks/{uid}", getValidatingWebhook(cache)) - r.Get("/hpas", sse.Bind(cache.HPAs)) - r.Get("/hpas/{uid}", sse.Bind(cache.HPAs)) + r.Get("/hpas", getHPAs(cache)) + r.Get("/hpas/{uid}", getHPA(cache)) - r.Get("/priority-classes", sse.Bind(cache.PriorityClasses)) - r.Get("/priority-classes/{uid}", sse.Bind(cache.PriorityClasses)) + r.Get("/priority-classes", getPriorityClasses(cache)) + r.Get("/priority-classes/{uid}", getPriorityClass(cache)) - r.Get("/runtime-classes", sse.Bind(cache.RuntimeClasses)) - r.Get("/runtime-classes/{uid}", sse.Bind(cache.RuntimeClasses)) + r.Get("/runtime-classes", getRuntimeClasses(cache)) + r.Get("/runtime-classes/{uid}", getRuntimeClass(cache)) - r.Get("/poddisruptionbudgets", sse.Bind(cache.PodDisruptionBudgets)) - r.Get("/poddisruptionbudgets/{uid}", sse.Bind(cache.PodDisruptionBudgets)) + r.Get("/poddisruptionbudgets", getPodDisruptionBudgets(cache)) + r.Get("/poddisruptionbudgets/{uid}", getPodDisruptionBudget(cache)) - r.Get("/limit-ranges", sse.Bind(cache.LimitRanges)) - r.Get("/limit-ranges/{uid}", sse.Bind(cache.LimitRanges)) + r.Get("/limit-ranges", getLimitRanges(cache)) + r.Get("/limit-ranges/{uid}", getLimitRange(cache)) - r.Get("/resource-quotas", sse.Bind(cache.ResourceQuotas)) - r.Get("/resource-quotas/{uid}", sse.Bind(cache.ResourceQuotas)) + r.Get("/resource-quotas", getResourceQuotas(cache)) + r.Get("/resource-quotas/{uid}", getResourceQuota(cache)) }) // Network resources r.Route("/networks", func(r chi.Router) { - r.Get("/services", sse.Bind(cache.Services)) - r.Get("/services/{uid}", sse.Bind(cache.Services)) + r.Get("/services", getServices(cache)) + r.Get("/services/{uid}", getService(cache)) - r.Get("/networkpolicies", sse.Bind(cache.NetworkPolicies)) - r.Get("/networkpolicies/{uid}", sse.Bind(cache.NetworkPolicies)) + r.Get("/networkpolicies", getNetworkPolicies(cache)) + r.Get("/networkpolicies/{uid}", getNetworkPolicy(cache)) - r.Get("/endpoints", sse.Bind(cache.Endpoints)) - r.Get("/endpoints/{uid}", sse.Bind(cache.Endpoints)) + r.Get("/endpoints", getEndpoints(cache)) + r.Get("/endpoints/{uid}", getEndpoint(cache)) - r.Get("/virtualservices", sse.Bind(cache.VirtualServices)) - r.Get("/virtualservices/{uid}", sse.Bind(cache.VirtualServices)) + r.Get("/virtualservices", getVirtualServices(cache)) + r.Get("/virtualservices/{uid}", getVirtualService(cache)) }) // Storage resources r.Route("/storage", func(r chi.Router) { - r.Get("/persistentvolumes", sse.Bind(cache.PersistentVolumes)) - r.Get("/persistentvolumes/{uid}", sse.Bind(cache.PersistentVolumes)) + r.Get("/persistentvolumes", getPersistentVolumes(cache)) + r.Get("/persistentvolumes/{uid}", getPersistentVolume(cache)) - r.Get("/persistentvolumeclaims", sse.Bind(cache.PersistentVolumeClaims)) - r.Get("/persistentvolumeclaims/{uid}", sse.Bind(cache.PersistentVolumeClaims)) + r.Get("/persistentvolumeclaims", getPersistentVolumeClaims(cache)) + r.Get("/persistentvolumeclaims/{uid}", getPersistentVolumeClaim(cache)) - r.Get("/storageclasses", sse.Bind(cache.StorageClasses)) - r.Get("/storageclasses/{uid}", sse.Bind(cache.StorageClasses)) + r.Get("/storageclasses", getStorageClasses(cache)) + r.Get("/storageclasses/{uid}", getStorageClass(cache)) }) }) })