Search in sources :

Example 11 with AbstractCanaryAccount

use of com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount in project halyard by spinnaker.

the class PrometheusAddCanaryAccountCommand method buildAccount.

@Override
protected AbstractCanaryAccount buildAccount(Canary canary, String accountName) {
    PrometheusCanaryAccount account = (PrometheusCanaryAccount) new PrometheusCanaryAccount().setName(accountName);
    account.setEndpoint(new PrometheusCanaryAccount.Endpoint().setBaseUrl(baseUrl));
    return account;
}
Also used : PrometheusCanaryAccount(com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryAccount)

Example 12 with AbstractCanaryAccount

use of com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount in project halyard by spinnaker.

the class GoogleCanaryAccountValidator method validate.

@Override
public void validate(ConfigProblemSetBuilder p, AbstractCanaryAccount n) {
    super.validate(p, n);
    GoogleCanaryAccount canaryAccount = (GoogleCanaryAccount) n;
    DaemonTaskHandler.message("Validating " + n.getNodeName() + " with " + GoogleCanaryAccountValidator.class.getSimpleName());
    GoogleNamedAccountCredentials credentials = canaryAccount.getNamedAccountCredentials(halyardVersion, p);
    if (credentials == null) {
        return;
    }
    try {
        Compute compute = credentials.getCompute();
        compute.projects().get(canaryAccount.getProject()).execute();
    } catch (IOException e) {
        p.addProblem(Severity.ERROR, "Failed to load project \"" + canaryAccount.getProject() + "\": " + e.getMessage() + ".");
    }
}
Also used : Compute(com.google.api.services.compute.Compute) IOException(java.io.IOException) GoogleCanaryAccount(com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryAccount) GoogleNamedAccountCredentials(com.netflix.spinnaker.clouddriver.google.security.GoogleNamedAccountCredentials)

Example 13 with AbstractCanaryAccount

use of com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount in project halyard by spinnaker.

the class CanaryAccountService method addAccount.

public void addAccount(String deploymentName, String serviceIntegrationName, AbstractCanaryAccount newCanaryAccount) {
    AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
    serviceIntegration.getAccounts().add(newCanaryAccount);
}
Also used : AbstractCanaryServiceIntegration(com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration)

Aggregations

AbstractCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount)7 AbstractCanaryServiceIntegration (com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration)4 OperationHandler (com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)2 GoogleCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryAccount)2 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)2 UpdateRequestBuilder (com.netflix.spinnaker.halyard.core.DaemonResponse.UpdateRequestBuilder)2 ProblemSet (com.netflix.spinnaker.halyard.core.problem.v1.ProblemSet)2 Path (java.nio.file.Path)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 Compute (com.google.api.services.compute.Compute)1 GoogleNamedAccountCredentials (com.netflix.spinnaker.clouddriver.google.security.GoogleNamedAccountCredentials)1 ConfigNotFoundException (com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException)1 IllegalConfigException (com.netflix.spinnaker.halyard.config.error.v1.IllegalConfigException)1 Canary (com.netflix.spinnaker.halyard.config.model.v1.canary.Canary)1 AwsCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.aws.AwsCanaryAccount)1 AwsCanaryServiceIntegration (com.netflix.spinnaker.halyard.config.model.v1.canary.aws.AwsCanaryServiceIntegration)1 DatadogCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.datadog.DatadogCanaryAccount)1 GoogleCanaryServiceIntegration (com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryServiceIntegration)1 PrometheusCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryAccount)1 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)1