use of com.netflix.spinnaker.halyard.config.model.v1.node.Subscription in project halyard by spinnaker.
the class AbstractListSubscriptionsCommand method executeThis.
@Override
protected void executeThis() {
Pubsub pubsub = getPubsub();
List<Subscription> subscriptions = pubsub.getSubscriptions();
if (subscriptions.isEmpty()) {
AnsiUi.success("No configured subscriptions for " + getPubsubName() + ".");
} else {
AnsiUi.success("Subscriptions for " + getPubsubName() + ":");
subscriptions.forEach(subscription -> AnsiUi.listItem(subscription.getName()));
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.Subscription in project halyard by spinnaker.
the class SubscriptionService method deleteSubscription.
public void deleteSubscription(String deploymentName, String pubsubName, String subscriptionName) {
Pubsub pubsub = pubsubService.getPubsub(deploymentName, pubsubName);
boolean removed = pubsub.getSubscriptions().removeIf(subscription -> ((Subscription) subscription).getName().equals(subscriptionName));
if (!removed) {
throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Subscription \"" + subscriptionName + "\" wasn't found").build());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.Subscription in project halyard by spinnaker.
the class SubscriptionService method addSubscription.
public void addSubscription(String deploymentName, String pubsubName, Subscription newSubscription) {
Pubsub pubsub = pubsubService.getPubsub(deploymentName, pubsubName);
pubsub.getSubscriptions().add(newSubscription);
}
Aggregations