diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 16:43:00 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 16:43:00 +0200 |
commit | 298f090ce646815fae6bb965f6a1ae1113ba4460 (patch) | |
tree | d483069237f0597c48c8ed5bc4de53038f0a60ed /controller-api | |
parent | a6bfd3c44e86cc78482d97c5fe3d3697b393f07b (diff) |
Separate development and production restarts
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java | 16 | ||||
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/Policy.java | 6 |
2 files changed, 16 insertions, 6 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java index c64d1f9f89b..f766e9331e9 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java @@ -70,11 +70,21 @@ enum PathGroup { "/application/v4/tenant/{tenant}/application/{application}/environment/{environment}/region/{region}/instance/{instance}/service/{*}", "/application/v4/tenant/{tenant}/application/{application}/environment/{environment}/region/{region}/instance/{instance}/global-rotation/{*}"), - /** Path used to restart application nodes. */ // TODO move to the above when everyone is on new pipeline. - applicationRestart(Matcher.tenant, + /** Path used to restart development nodes. */ + developmentRestart(Matcher.tenant, Matcher.application, Optional.of("/api"), - "/application/v4/tenant/{tenant}/application/{application}/environment/{environment}/region/{region}/instance/{ignored}/restart"), + "/application/v4/tenant/{tenant}/application/{application}/environment/dev/region/{region}/instance/{ignored}/restart", + "/application/v4/tenant/{tenant}/application/{application}/environment/perf/region/{region}/instance/{ignored}/restart"), + + /** Path used to restart production nodes. */ + productionRestart(Matcher.tenant, + Matcher.application, + Optional.of("/api"), + "/application/v4/tenant/{tenant}/application/{application}/environment/prod/region/{region}/instance/{ignored}/restart", + "/application/v4/tenant/{tenant}/application/{application}/environment/test/region/{region}/instance/{ignored}/restart", + "/application/v4/tenant/{tenant}/application/{application}/environment/staging/region/{region}/instance/{ignored}/restart"), + /** Paths used for development deployments. */ developmentDeployment(Matcher.tenant, Matcher.application, diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/Policy.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/Policy.java index 15745d69dc5..290382c6e6c 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/Policy.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/Policy.java @@ -80,12 +80,12 @@ enum Policy { /** Full access to application information and settings. */ applicationOperations(Privilege.grant(Action.write()) - .on(PathGroup.applicationInfo, PathGroup.applicationRestart) + .on(PathGroup.applicationInfo, PathGroup.productionRestart) .in(SystemName.all())), /** Full access to application development deployments. */ developmentDeployment(Privilege.grant(Action.all()) - .on(PathGroup.developmentDeployment) + .on(PathGroup.developmentDeployment, PathGroup.developmentRestart) .in(SystemName.all())), /** Full access to application production deployments. */ @@ -105,7 +105,7 @@ enum Policy { /** Full access to the additional tasks needed for continuous deployment. */ deploymentPipeline(Privilege.grant(Action.all()) // TODO remove when everyone is on new pipeline. - .on(PathGroup.buildService, PathGroup.applicationRestart) + .on(PathGroup.buildService, PathGroup.productionRestart) .in(SystemName.all())), /** Read access to all information in select systems. */ |