Tabnine Logo
GoogleCanaryAccount
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.netflix.spinnaker.halyard/halyard-cli

 @Override
 protected AbstractCanaryAccount editAccount(GoogleCanaryAccount account) {
  account.setProject(isSet(project) ? project : account.getProject());
  account.setJsonPath(isSet(jsonPath) ? jsonPath : account.getJsonPath());
  account.setBucket(isSet(bucket) ? bucket : account.getBucket());
  account.setRootFolder(isSet(rootFolder) ? rootFolder : account.getRootFolder());
  account.setBucketLocation(isSet(bucketLocation) ? bucketLocation : account.getBucketLocation());

  return account;
 }
}
origin: spinnaker/halyard

@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());
 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;
}
origin: spinnaker/halyard

GoogleNamedAccountCredentials credentials = canaryAccount.getNamedAccountCredentials(halyardVersion, p);
String jsonPath = canaryAccount.getJsonPath();
   canaryAccount.getBucket(),
   canaryAccount.getBucketLocation(),
   canaryAccount.getRootFolder(),
   canaryAccount.getProject(),
   jsonPath != null ? jsonPath : "",
   "halyard",
 p.addProblem(Severity.ERROR, "Failed to ensure the required bucket \"" + canaryAccount.getBucket() + "\" exists: " + e.getMessage());
origin: com.netflix.spinnaker.halyard/halyard-config

@JsonIgnore
public GoogleNamedAccountCredentials getNamedAccountCredentials(String version, ConfigProblemSetBuilder p) {
 String jsonKey = null;
 if (!StringUtils.isEmpty(getJsonPath())) {
  jsonKey = ValidatingFileReader.contents(p, getJsonPath());
 if (StringUtils.isEmpty(getProject())) {
  p.addProblem(Problem.Severity.ERROR, "No google project supplied.");
  return null;
    .name(getName())
    .jsonKey(jsonKey)
    .project(getProject())
    .applicationName("halyard " + version)
    .liveLookupsEnabled(false)
 } catch (Exception e) {
  p.addProblem(Problem.Severity.ERROR, "Error instantiating Google credentials: " + e.getMessage() + ".")
    .setRemediation("Do the provided credentials have access to project " + getProject() + "?");
  return null;
origin: com.netflix.spinnaker.halyard/halyard-config

 @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() + ".");
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

 @Override
 public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) {
  GoogleCanaryAccountValidator googleCanaryAccountValidator = new GoogleCanaryAccountValidator(halyardVersion);

  n.getAccounts().forEach(a -> googleCanaryAccountValidator.validate(p, a));

  if (n.isGcsEnabled()) {
   List<GoogleCanaryAccount> accountsWithBucket =
     n.getAccounts()
       .stream()
       .filter(a -> a.getBucket() != null)
       .collect(Collectors.toList());

   if (CollectionUtils.isEmpty(accountsWithBucket)) {
    p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled.");
   }
  }
 }
}
origin: spinnaker/halyard

 @Override
 protected AbstractCanaryAccount emptyAccount() {
  return new GoogleCanaryAccount();
 }
}
origin: com.netflix.spinnaker.halyard/halyard-cli

 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE));
} else {
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));
} else {
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));
origin: spinnaker/halyard

@JsonIgnore
public GoogleNamedAccountCredentials getNamedAccountCredentials(String version, ConfigProblemSetBuilder p) {
 String jsonKey = null;
 if (!StringUtils.isEmpty(getJsonPath())) {
  jsonKey = ValidatingFileReader.contents(p, getJsonPath());
 if (StringUtils.isEmpty(getProject())) {
  p.addProblem(Problem.Severity.ERROR, "No google project supplied.");
  return null;
    .name(getName())
    .jsonKey(jsonKey)
    .project(getProject())
    .applicationName("halyard " + version)
    .liveLookupsEnabled(false)
 } catch (Exception e) {
  p.addProblem(Problem.Severity.ERROR, "Error instantiating Google credentials: " + e.getMessage() + ".")
    .setRemediation("Do the provided credentials have access to project " + getProject() + "?");
  return null;
origin: spinnaker/halyard

 @Override
 public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) {
  GoogleCanaryAccountValidator googleCanaryAccountValidator =
    new GoogleCanaryAccountValidator()
      .setHalyardVersion(halyardVersion)
      .setRegistry(registry)
      .setTaskScheduler(taskScheduler);

  if (n.isGcsEnabled()) {
   List<GoogleCanaryAccount> accountsWithBucket =
     n.getAccounts()
       .stream()
       .filter(a -> a.getBucket() != null)
       .collect(Collectors.toList());

   if (CollectionUtils.isEmpty(accountsWithBucket)) {
    p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled.");
   } else {
    accountsWithBucket.forEach(a -> googleCanaryAccountValidator.validate(p, a));
   }
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-cli

 @Override
 protected AbstractCanaryAccount emptyAccount() {
  return new GoogleCanaryAccount();
 }
}
origin: spinnaker/halyard

 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE));
} else {
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));
} else {
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE));
 googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));
origin: spinnaker/halyard

 @Override
 protected AbstractCanaryAccount editAccount(GoogleCanaryAccount account) {
  account.setProject(isSet(project) ? project : account.getProject());
  account.setJsonPath(isSet(jsonPath) ? jsonPath : account.getJsonPath());
  account.setBucket(isSet(bucket) ? bucket : account.getBucket());
  account.setRootFolder(isSet(rootFolder) ? rootFolder : account.getRootFolder());
  account.setBucketLocation(isSet(bucketLocation) ? bucketLocation : account.getBucketLocation());

  return account;
 }
}
origin: com.netflix.spinnaker.halyard/halyard-cli

@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());
 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;
}
com.netflix.spinnaker.halyard.config.model.v1.canary.googleGoogleCanaryAccount

Most used methods

  • getBucket
  • getJsonPath
  • getProject
  • getBucketLocation
  • getRootFolder
  • <init>
  • getName
  • getNamedAccountCredentials
  • getSupportedTypes
  • setBucket
  • setBucketLocation
  • setJsonPath
  • setBucketLocation,
  • setJsonPath,
  • setName,
  • setProject,
  • setRootFolder

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Runner (org.openjdk.jmh.runner)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now