use of com.netflix.spinnaker.halyard.config.model.v1.node.Account in project halyard by spinnaker.
the class DatadogAddCanaryAccountCommand method buildAccount.
@Override
protected AbstractCanaryAccount buildAccount(Canary canary, String accountName) {
DatadogCanaryAccount account = (DatadogCanaryAccount) new DatadogCanaryAccount().setName(accountName);
account.setEndpoint(new DatadogCanaryAccount.Endpoint().setBaseUrl(baseUrl)).setApiKey(apiKey).setApplicationKey(applicationKey);
return account;
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.Account in project halyard by spinnaker.
the class GoogleAddCanaryAccountCommand method buildAccount.
@Override
protected AbstractCanaryAccount buildAccount(Canary canary, String accountName) {
GoogleCanaryAccount account = (GoogleCanaryAccount) new GoogleCanaryAccount().setName(accountName);
account.setProject(project).setJsonPath(jsonPath);
account.setBucket(bucket).setBucketLocation(bucketLocation);
account.setRootFolder(isSet(rootFolder) ? rootFolder : account.getRootFolder());
if (account.getBucket() == null) {
String bucketName = "spin-kayenta-" + UUID.randomUUID().toString();
AnsiUi.raw("Generated canary bucket name: " + bucketName);
account.setBucket(bucketName);
}
GoogleCanaryServiceIntegration googleCanaryServiceIntegration = (GoogleCanaryServiceIntegration) CanaryUtils.getServiceIntegrationByClass(canary, GoogleCanaryServiceIntegration.class);
if (googleCanaryServiceIntegration.isStackdriverEnabled()) {
account.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE);
}
if (googleCanaryServiceIntegration.isGcsEnabled()) {
account.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE);
account.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE);
}
return account;
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.Account 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.node.Account in project halyard by spinnaker.
the class AbstractArtifactEditAccountCommand method executeThis.
@Override
protected void executeThis() {
String accountName = getArtifactAccountName();
String providerName = getArtifactProviderName();
String currentDeployment = getCurrentDeployment();
// Disable validation here, since we don't want an illegal config to prevent us from fixing it.
ArtifactAccount account = new OperationHandler<ArtifactAccount>().setFailureMesssage("Failed to get account " + accountName + " for provider " + providerName + ".").setOperation(Daemon.getArtifactAccount(currentDeployment, providerName, accountName, false)).get();
int originaHash = account.hashCode();
account = editArtifactAccount((T) account);
if (originaHash == account.hashCode()) {
AnsiUi.failure("No changes supplied.");
return;
}
new OperationHandler<Void>().setFailureMesssage("Failed to edit artifact account " + accountName + " for artifact provider " + providerName + ".").setSuccessMessage("Successfully edited artifact account " + accountName + " for artifact provider " + providerName + ".").setOperation(Daemon.setArtifactAccount(currentDeployment, providerName, accountName, !noValidate, account)).get();
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.Account in project halyard by spinnaker.
the class AbstractListArtifactAccountsCommand method executeThis.
@Override
protected void executeThis() {
ArtifactProvider provider = getArtifactProvider();
List<ArtifactAccount> accounts = provider.getAccounts();
if (accounts.isEmpty()) {
AnsiUi.success("No configured artifact accounts for " + getArtifactProviderName() + ".");
} else {
AnsiUi.success("Artifact accounts for " + getArtifactProviderName() + ":");
accounts.forEach(account -> AnsiUi.listItem(account.getName()));
}
}
Aggregations