aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-01-11 10:50:17 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-01-11 10:50:17 +0100
commit41c63493a0ddb626def686ca710859da6b014141 (patch)
tree42b59567b2bf8658c74e5f566c1b68e74f3a6104 /vespa-maven-plugin
parente8921cf5e953e0abef58ace4cbdbb1877130d274 (diff)
Actually add new plugin goal :facepalm:
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SuspendMojo.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SuspendMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SuspendMojo.java
new file mode 100644
index 00000000000..f2bcb5288e0
--- /dev/null
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SuspendMojo.java
@@ -0,0 +1,24 @@
+// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.hosted.plugin;
+
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+/**
+ * Sets suspension status for a Vespa application deployment.
+ *
+ * @author jonmv
+ */
+@Mojo(name = "suspend")
+public class SuspendMojo extends AbstractVespaDeploymentMojo {
+
+ @Parameter(property = "suspend", required = true)
+ protected boolean suspend;
+
+ @Override
+ protected void doExecute() {
+ getLog().info(controller.suspend(id, zoneOf(environment, region), suspend));
+ }
+
+}
+