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;
}
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() + ".");
}
}
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);
}
Aggregations