use of com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler 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();
}
use of com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler in project halyard by spinnaker.
the class UiSecurityEditCommand method executeThis.
@Override
protected void executeThis() {
String currentDeployment = getCurrentDeployment();
UiSecurity uiSecurity = new OperationHandler<UiSecurity>().setOperation(Daemon.getUiSecurity(currentDeployment, false)).setFailureMesssage("Failed to load UI security settings.").get();
int originalHash = uiSecurity.hashCode();
uiSecurity.setOverrideBaseUrl(isSet(overrideBaseUrl) ? overrideBaseUrl : uiSecurity.getOverrideBaseUrl());
if (originalHash == uiSecurity.hashCode()) {
AnsiUi.failure("No changes supplied.");
return;
}
new OperationHandler<Void>().setOperation(Daemon.setUiSecurity(currentDeployment, !noValidate, uiSecurity)).setFailureMesssage("Failed to edit UI security settings.").setSuccessMessage("Successfully updated UI security settings.").get();
}
use of com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler in project halyard by spinnaker.
the class AbstractEditRoleProviderCommand method executeThis.
@Override
protected void executeThis() {
String currentDeployment = getCurrentDeployment();
String roleProviderName = getRoleProviderType() + "";
// Disable validation here, since we don't want an illegal config to prevent us from fixing it.
RoleProvider roleProvider = new OperationHandler<RoleProvider>().setOperation(Daemon.getRoleProvider(currentDeployment, roleProviderName, false)).setFailureMesssage("Failed to get " + roleProviderName + " method.").get();
new OperationHandler<Void>().setOperation(Daemon.setRoleProvider(currentDeployment, roleProviderName, !noValidate, editRoleProvider((T) roleProvider))).setFailureMesssage("Failed to edit " + roleProviderName + " method.").setSuccessMessage("Successfully edited " + roleProviderName + " method.").get();
}
use of com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler in project halyard by spinnaker.
the class SpringSslEditCommand method executeThis.
@Override
protected void executeThis() {
String currentDeployment = getCurrentDeployment();
SpringSsl springSsl = new OperationHandler<SpringSsl>().setOperation(Daemon.getSpringSsl(currentDeployment, false)).setFailureMesssage("Failed to load SSL settings.").get();
int originalHash = springSsl.hashCode();
springSsl.setKeyAlias(isSet(keyAlias) ? keyAlias : springSsl.getKeyAlias());
springSsl.setKeyStore(isSet(keyStore) ? keyStore : springSsl.getKeyStore());
springSsl.setKeyStoreType(isSet(keyStoreType) ? keyStoreType : springSsl.getKeyStoreType());
springSsl.setKeyStorePassword(isSet(keyStorePassword) ? keyStorePassword : springSsl.getKeyStorePassword());
springSsl.setTrustStore(isSet(trustStore) ? trustStore : springSsl.getTrustStore());
springSsl.setTrustStoreType(isSet(trustStoreType) ? trustStoreType : springSsl.getTrustStoreType());
springSsl.setTrustStorePassword(isSet(trustStorePassword) ? trustStorePassword : springSsl.getTrustStorePassword());
springSsl.setClientAuth(isSet(clientAuth) ? clientAuth : springSsl.getClientAuth());
if (originalHash == springSsl.hashCode()) {
AnsiUi.failure("No changes supplied.");
return;
}
new OperationHandler<Void>().setOperation(Daemon.setSpringSsl(currentDeployment, !noValidate, springSsl)).setFailureMesssage("Failed to edit SSL settings.").setFailureMesssage("Successfully updated SSL settings.").get();
}
use of com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler in project halyard by spinnaker.
the class AbstractEditSubscriptionCommand method executeThis.
@Override
protected void executeThis() {
String subscriptionName = getSubscriptionName();
String pubsubName = getPubsubName();
String currentDeployment = getCurrentDeployment();
// Disable validation here, since we don't want an illegal config to prevent us from fixing it.
Subscription subscription = new OperationHandler<Subscription>().setFailureMesssage("Failed to get subscription " + subscriptionName + " for pubsub " + pubsubName + ".").setOperation(Daemon.getSubscription(currentDeployment, pubsubName, subscriptionName, false)).get();
int originaHash = subscription.hashCode();
subscription = editSubscription((T) subscription);
if (originaHash == subscription.hashCode()) {
AnsiUi.failure("No changes supplied.");
return;
}
new OperationHandler<Void>().setFailureMesssage("Failed to edit subscription " + subscriptionName + " for pubsub " + pubsubName + ".").setSuccessMessage("Successfully edited subscription " + subscriptionName + " for pubsub " + pubsubName + ".").setOperation(Daemon.setSubscription(currentDeployment, pubsubName, subscriptionName, !noValidate, subscription)).get();
}
Aggregations