aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
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));
+ }
+
+}
+