Codota Logo
AbstractCanaryServiceIntegration
Code IndexAdd Codota to your IDE (free)

How to use
AbstractCanaryServiceIntegration
in
com.netflix.spinnaker.halyard.config.model.v1.canary

Best Java code snippets using com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: com.netflix.spinnaker.halyard/halyard-config

public void addAccount(String deploymentName, String serviceIntegrationName, AbstractCanaryAccount newCanaryAccount) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 serviceIntegration.getAccounts().add(newCanaryAccount);
}
origin: com.netflix.spinnaker.halyard/halyard-config

@Override
public String getNodeName() {
 return getName();
}
origin: com.netflix.spinnaker.halyard/halyard-config

for (AbstractCanaryAccount account : (List<AbstractCanaryAccount>)svc.getAccounts()) {
 if (accounts.contains(account.getName())) {
  p.addProblem(Problem.Severity.FATAL, "Canary account \"" + account.getName() + "\" appears more than once.")
   .setRemediation("Change the name of the account in " + svc.getNodeName() + " service integration");
 } else {
  accounts.add(account.getName());
origin: com.netflix.spinnaker.halyard/halyard-cli

 @Override
 protected void executeThis() {
  String currentDeployment = getCurrentDeployment();

  // Disable validation here, since we don't want an illegal config to prevent us from fixing it.
  Canary canary = new OperationHandler<Canary>()
    .setFailureMesssage("Failed to get canary.")
    .setOperation(Daemon.getCanary(currentDeployment, false))
    .get();

  int originalHash = canary.hashCode();

  AbstractCanaryServiceIntegration canaryServiceIntegration = CanaryUtils.getServiceIntegrationByName(canary, currentDeployment, getName(), true);

  canaryServiceIntegration.setEnabled(isEnable());

  if (originalHash == canary.hashCode()) {
   AnsiUi.failure("No changes supplied.");
   return;
  }

  new OperationHandler<Void>()
    .setSuccessMessage("Successfully " + indicativePastPerfectAction() + " canary analysis " + getName() + " service integration.")
    .setFailureMesssage("Failed to " + getCommandName() + " canary analysis " + getName() + " service integration.")
    .setOperation(Daemon.setCanary(currentDeployment, !noValidate, canary))
    .get();
 }
}
origin: spinnaker/halyard

for (AbstractCanaryAccount account : (List<AbstractCanaryAccount>)svc.getAccounts()) {
 if (accounts.contains(account.getName())) {
  p.addProblem(Problem.Severity.FATAL, "Canary account \"" + account.getName() + "\" appears more than once.")
   .setRemediation("Change the name of the account in " + svc.getNodeName() + " service integration");
 } else {
  accounts.add(account.getName());
origin: spinnaker/halyard

 @Override
 protected void executeThis() {
  String currentDeployment = getCurrentDeployment();

  // Disable validation here, since we don't want an illegal config to prevent us from fixing it.
  Canary canary = new OperationHandler<Canary>()
    .setFailureMesssage("Failed to get canary.")
    .setOperation(Daemon.getCanary(currentDeployment, false))
    .get();

  int originalHash = canary.hashCode();

  AbstractCanaryServiceIntegration canaryServiceIntegration = CanaryUtils.getServiceIntegrationByName(canary, currentDeployment, getName(), true);

  canaryServiceIntegration.setEnabled(isEnable());

  if (originalHash == canary.hashCode()) {
   AnsiUi.failure("No changes supplied.");
   return;
  }

  new OperationHandler<Void>()
    .setSuccessMessage("Successfully " + indicativePastPerfectAction() + " canary analysis " + getName() + " service integration.")
    .setFailureMesssage("Failed to " + getCommandName() + " canary analysis " + getName() + " service integration.")
    .setOperation(Daemon.setCanary(currentDeployment, !noValidate, canary))
    .get();
 }
}
origin: spinnaker/halyard

public void addAccount(String deploymentName, String serviceIntegrationName, AbstractCanaryAccount newCanaryAccount) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 serviceIntegration.getAccounts().add(newCanaryAccount);
}
origin: spinnaker/halyard

@Override
public String getNodeName() {
 return getName();
}
origin: com.netflix.spinnaker.halyard/halyard-config

public void setAccount(String deploymentName, String serviceIntegrationName, String accountName, AbstractCanaryAccount newAccount) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 for (int i = 0; i < serviceIntegration.getAccounts().size(); i++) {
  AbstractCanaryAccount account = (AbstractCanaryAccount)serviceIntegration.getAccounts().get(i);
  if (account.getNodeName().equals(accountName)) {
   serviceIntegration.getAccounts().set(i, newAccount);
   return;
  }
 }
 throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Canary account \"" + accountName + "\" wasn't found").build());
}
origin: spinnaker/halyard

private AbstractCanaryServiceIntegration getServiceIntegration(String deploymentName, String serviceIntegrationName) {
 Canary canary = canaryService.getCanary(deploymentName);
 return canary.getServiceIntegrations()
   .stream()
   .filter(s -> s.getName().equals(serviceIntegrationName))
   .findFirst()
   .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found."));
}
origin: spinnaker/halyard

public void setAccount(String deploymentName, String serviceIntegrationName, String accountName, AbstractCanaryAccount newAccount) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 for (int i = 0; i < serviceIntegration.getAccounts().size(); i++) {
  AbstractCanaryAccount account = (AbstractCanaryAccount)serviceIntegration.getAccounts().get(i);
  if (account.getNodeName().equals(accountName)) {
   serviceIntegration.getAccounts().set(i, newAccount);
   return;
  }
 }
 throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Canary account \"" + accountName + "\" wasn't found").build());
}
origin: com.netflix.spinnaker.halyard/halyard-config

private AbstractCanaryServiceIntegration getServiceIntegration(String deploymentName, String serviceIntegrationName) {
 Canary canary = canaryService.getCanary(deploymentName);
 return canary.getServiceIntegrations()
   .stream()
   .filter(s -> s.getName().equals(serviceIntegrationName))
   .findFirst()
   .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found."));
}
origin: spinnaker/halyard

public void deleteAccount(String deploymentName, String serviceIntegrationName, String accountName) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 boolean removed = serviceIntegration.getAccounts().removeIf(account -> ((AbstractCanaryAccount)account).getName().equals(accountName));
 if (!removed) {
  throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Canary account \"" + accountName + "\" wasn't found").build());
 }
}
origin: spinnaker/halyard

 public static AbstractCanaryServiceIntegration getServiceIntegrationByName(Canary canary,
                                       String currentDeployment,
                                       String serviceIntegrationName,
                                       boolean noValidate) {
  if (canary == null) {
   canary = new OperationHandler<Canary>()
     .setFailureMesssage("Failed to get canary.")
     .setOperation(Daemon.getCanary(currentDeployment, !noValidate))
     .get();
  }

  return canary.getServiceIntegrations()
    .stream()
    .filter(s -> s.getName().equals(serviceIntegrationName.toLowerCase()))
    .findFirst()
    .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found."));
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

public void deleteAccount(String deploymentName, String serviceIntegrationName, String accountName) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 boolean removed = serviceIntegration.getAccounts().removeIf(account -> ((AbstractCanaryAccount)account).getName().equals(accountName));
 if (!removed) {
  throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Canary account \"" + accountName + "\" wasn't found").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-cli

 public static AbstractCanaryServiceIntegration getServiceIntegrationByName(Canary canary,
                                       String currentDeployment,
                                       String serviceIntegrationName,
                                       boolean noValidate) {
  if (canary == null) {
   canary = new OperationHandler<Canary>()
     .setFailureMesssage("Failed to get canary.")
     .setOperation(Daemon.getCanary(currentDeployment, !noValidate))
     .get();
  }

  return canary.getServiceIntegrations()
    .stream()
    .filter(s -> s.getName().equals(serviceIntegrationName.toLowerCase()))
    .findFirst()
    .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found."));
 }
}
origin: spinnaker/halyard

public AbstractCanaryAccount getCanaryAccount(String deploymentName, String serviceIntegrationName, String accountName) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 List<AbstractCanaryAccount> matchingAccounts =
   (List<AbstractCanaryAccount>)serviceIntegration.getAccounts()
     .stream()
     .filter(a -> (((AbstractCanaryAccount)a).getName().equals(accountName)))
     .collect(Collectors.toList());
 switch (matchingAccounts.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No account with name \"" + accountName + "\" was found")
     .setRemediation("Check if this account was defined in another service integration, or create a new one").build());
  case 1:
   return matchingAccounts.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one account named \"" + accountName + "\" was found")
     .setRemediation("Manually delete/rename duplicate canary accounts with name \"" + accountName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

public AbstractCanaryAccount getCanaryAccount(String deploymentName, String serviceIntegrationName, String accountName) {
 AbstractCanaryServiceIntegration serviceIntegration = getServiceIntegration(deploymentName, serviceIntegrationName);
 List<AbstractCanaryAccount> matchingAccounts =
   (List<AbstractCanaryAccount>)serviceIntegration.getAccounts()
     .stream()
     .filter(a -> (((AbstractCanaryAccount)a).getName().equals(accountName)))
     .collect(Collectors.toList());
 switch (matchingAccounts.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No account with name \"" + accountName + "\" was found")
     .setRemediation("Check if this account was defined in another service integration, or create a new one").build());
  case 1:
   return matchingAccounts.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one account named \"" + accountName + "\" was found")
     .setRemediation("Manually delete/rename duplicate canary accounts with name \"" + accountName + "\" in your halconfig file").build());
 }
}
origin: spinnaker/halyard

 @Override
 protected void executeThis() {
  AbstractCanaryServiceIntegration serviceIntegration = CanaryUtils.getServiceIntegrationByName(null, getCurrentDeployment(), getServiceIntegration(), noValidate);
  List<AbstractCanaryAccount> accounts = serviceIntegration.getAccounts();

  if (accounts.isEmpty()) {
   AnsiUi.success("No configured accounts for " + getServiceIntegration() + ".");
  } else {
   AnsiUi.success("Accounts for " + getServiceIntegration() + ":");
   accounts.forEach(account -> AnsiUi.listItem(account.getName()));
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-cli

 @Override
 protected void executeThis() {
  AbstractCanaryServiceIntegration serviceIntegration = CanaryUtils.getServiceIntegrationByName(null, getCurrentDeployment(), getServiceIntegration(), noValidate);
  List<AbstractCanaryAccount> accounts = serviceIntegration.getAccounts();

  if (accounts.isEmpty()) {
   AnsiUi.success("No configured accounts for " + getServiceIntegration() + ".");
  } else {
   AnsiUi.success("Accounts for " + getServiceIntegration() + ":");
   accounts.forEach(account -> AnsiUi.listItem(account.getName()));
  }
 }
}
com.netflix.spinnaker.halyard.config.model.v1.canaryAbstractCanaryServiceIntegration

Most used methods

  • getAccounts
  • getName
  • getNodeName
  • setEnabled

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now