All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.hosted.plugin.DeleteMojo Maven / Gradle / Ivy

// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.hosted.plugin;

import com.yahoo.config.provision.Environment;
import org.apache.maven.plugins.annotations.Mojo;

/**
 * Deletes a Vespa application deployment, provided the deployment is in a manually deployed environment.
 *
 * @author jonmv
 */
@Mojo(name = "delete")
public class DeleteMojo extends AbstractVespaDeploymentMojo {

    @Override
    protected boolean requireInstance() { return true; }

    @Override
    protected void doExecute() {
        if (!isNullOrBlank(environment) && ! Environment.from(environment).isManuallyDeployed())
            throw new IllegalArgumentException("Manual deletion is not permitted in " + environment);

        getLog().info(controller.deactivate(id, zoneOf(environment, region)));
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy