summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index b202e32e4e..80f2243ef0 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -871,6 +871,15 @@ func Routes() *web.Route {
Delete(user.DeleteSecret)
})
+ m.Group("/variables", func() {
+ m.Get("", user.ListVariables)
+ m.Combo("/{variablename}").
+ Get(user.GetVariable).
+ Delete(user.DeleteVariable).
+ Post(bind(api.CreateVariableOption{}), user.CreateVariable).
+ Put(bind(api.UpdateVariableOption{}), user.UpdateVariable)
+ })
+
m.Group("/runners", func() {
m.Get("/registration-token", reqToken(), user.GetRegistrationToken)
})
@@ -990,6 +999,15 @@ func Routes() *web.Route {
Delete(reqToken(), reqOwner(), repo.DeleteSecret)
})
+ m.Group("/variables", func() {
+ m.Get("", reqToken(), reqOwner(), repo.ListVariables)
+ m.Combo("/{variablename}").
+ Get(reqToken(), reqOwner(), repo.GetVariable).
+ Delete(reqToken(), reqOwner(), repo.DeleteVariable).
+ Post(reqToken(), reqOwner(), bind(api.CreateVariableOption{}), repo.CreateVariable).
+ Put(reqToken(), reqOwner(), bind(api.UpdateVariableOption{}), repo.UpdateVariable)
+ })
+
m.Group("/runners", func() {
m.Get("/registration-token", reqToken(), reqOwner(), repo.GetRegistrationToken)
})
@@ -1393,6 +1411,15 @@ func Routes() *web.Route {
Delete(reqToken(), reqOrgOwnership(), org.DeleteSecret)
})
+ m.Group("/variables", func() {
+ m.Get("", reqToken(), reqOrgOwnership(), org.ListVariables)
+ m.Combo("/{variablename}").
+ Get(reqToken(), reqOrgOwnership(), org.GetVariable).
+ Delete(reqToken(), reqOrgOwnership(), org.DeleteVariable).
+ Post(reqToken(), reqOrgOwnership(), bind(api.CreateVariableOption{}), org.CreateVariable).
+ Put(reqToken(), reqOrgOwnership(), bind(api.UpdateVariableOption{}), org.UpdateVariable)
+ })
+
m.Group("/runners", func() {
m.Get("/registration-token", reqToken(), reqOrgOwnership(), org.GetRegistrationToken)
})