Search in sources :

Example 1 with ADDED

use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff.ChangeType.ADDED in project halyard by spinnaker.

the class AbstractAddArtifactAccountCommand method executeThis.

@Override
protected void executeThis() {
    String accountName = getArtifactAccountName();
    ArtifactAccount account = buildArtifactAccount(accountName);
    String providerName = getArtifactProviderName();
    String currentDeployment = getCurrentDeployment();
    new OperationHandler<Void>().setFailureMesssage("Failed to add artifact account " + accountName + " for artifact provider " + providerName + ".").setSuccessMessage("Successfully added artifact account " + accountName + " for artifact provider " + providerName + ".").setOperation(Daemon.addArtifactAccount(currentDeployment, providerName, !noValidate, account)).get();
}
Also used : ArtifactAccount(com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 2 with ADDED

use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff.ChangeType.ADDED in project halyard by spinnaker.

the class AbstractAddMasterCommand method executeThis.

@Override
protected void executeThis() {
    String masterName = getMasterName();
    Master master = buildMaster(masterName);
    String ciName = getCiName();
    String currentDeployment = getCurrentDeployment();
    new OperationHandler<Void>().setOperation(Daemon.addMaster(currentDeployment, ciName, !noValidate, master)).setSuccessMessage("Added " + masterName + " for " + ciName + ".").setFailureMesssage("Failed to add " + masterName + " for " + ciName + ".").get();
}
Also used : Master(com.netflix.spinnaker.halyard.config.model.v1.node.Master) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 3 with ADDED

use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff.ChangeType.ADDED in project halyard by spinnaker.

the class DCOSAddClusterCommand method executeThis.

@Override
protected void executeThis() {
    DCOSCluster cluster = new DCOSCluster();
    cluster.setName(getClusterName()).setDcosUrl(dcosUrl).setCaCertFile(caCertFile).setInsecureSkipTlsVerify(insecureSkipTlsVerify);
    if (nonNull(loadBalancerImage)) {
        final DCOSCluster.LoadBalancer loadBalancer = new DCOSCluster.LoadBalancer().setImage(loadBalancerImage).setServiceAccountSecret(loadBalancerServiceAccountSecret);
        cluster.setLoadBalancer(loadBalancer);
    }
    new OperationHandler<Void>().setFailureMesssage("Failed to add cluster " + getClusterName() + " for provider " + getProviderName() + ".").setSuccessMessage("Successfully added cluster " + getClusterName() + " for provider " + getProviderName() + ".").setOperation(Daemon.addCluster(getCurrentDeployment(), getProviderName(), !noValidate, cluster)).get();
}
Also used : DCOSCluster(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSCluster) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 4 with ADDED

use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff.ChangeType.ADDED in project halyard by spinnaker.

the class AbstractAddCanaryAccountCommand method executeThis.

@Override
protected void executeThis() {
    String currentDeployment = getCurrentDeployment();
    // Disable validation here, since we don't want an illegal config to prevent us from fixing it.
    Canary canary = new OperationHandler<Canary>().setFailureMesssage("Failed to get canary.").setOperation(Daemon.getCanary(currentDeployment, false)).get();
    String accountName = getAccountName();
    AbstractCanaryAccount account = buildAccount(canary, accountName);
    String serviceIntegration = getServiceIntegration();
    new OperationHandler<Void>().setFailureMesssage("Failed to add canary account " + accountName + " for service integration " + serviceIntegration + ".").setSuccessMessage("Successfully added canary account " + accountName + " for service integration " + serviceIntegration + ".").setOperation(Daemon.addCanaryAccount(currentDeployment, serviceIntegration.toLowerCase(), !noValidate, account)).get();
}
Also used : Canary(com.netflix.spinnaker.halyard.config.model.v1.canary.Canary) AbstractCanaryAccount(com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 5 with ADDED

use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff.ChangeType.ADDED in project halyard by spinnaker.

the class AbstractAddSubscriptionCommand method executeThis.

@Override
protected void executeThis() {
    String subscriptionName = getSubscriptionName();
    Subscription subscription = buildSubscription(subscriptionName);
    String pubsubName = getPubsubName();
    String currentDeployment = getCurrentDeployment();
    new OperationHandler<Void>().setFailureMesssage("Failed to add subscription " + subscriptionName + " for pubsub " + pubsubName + ".").setSuccessMessage("Successfully added subscription " + subscriptionName + " for pubsub " + pubsubName + ".").setOperation(Daemon.addSubscription(currentDeployment, pubsubName, !noValidate, subscription)).get();
}
Also used : Subscription(com.netflix.spinnaker.halyard.config.model.v1.node.Subscription) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Aggregations

OperationHandler (com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)7 BaseImage (com.netflix.spinnaker.halyard.config.model.v1.node.BaseImage)2 AbstractCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount)1 Canary (com.netflix.spinnaker.halyard.config.model.v1.canary.Canary)1 Account (com.netflix.spinnaker.halyard.config.model.v1.node.Account)1 ArtifactAccount (com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount)1 Master (com.netflix.spinnaker.halyard.config.model.v1.node.Master)1 NodeDiff (com.netflix.spinnaker.halyard.config.model.v1.node.NodeDiff)1 Subscription (com.netflix.spinnaker.halyard.config.model.v1.node.Subscription)1 DCOSCluster (com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSCluster)1 UpdateRequestBuilder (com.netflix.spinnaker.halyard.core.DaemonResponse.UpdateRequestBuilder)1 ProblemSet (com.netflix.spinnaker.halyard.core.problem.v1.ProblemSet)1 Path (java.nio.file.Path)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1