Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(servergroups): Add endpoint to retrieve server groups by applications #1734

Merged
merged 1 commit into from
Jul 13, 2017

Conversation

jeyrschabu
Copy link
Contributor

  • Takes a list of applications and return an aggregated summary

@jeyrschabu
Copy link
Contributor Author

Convenient way to get a list of server groups by applications. depends on spinnaker/gate#426

@spinnaker/netflix-reviewers PTAL

@anotherchrisberry
Copy link
Contributor

A couple of things:

  1. it might be nice to group the response by application, although I'm not sure of the particular use case this endpoint has in mind, so maybe leaving them ungrouped is totally fine.
  2. probably worth figuring out the @PreAuthorize story or adding a @PostAuthorize mechanism to filter out applications the user should not be able to access

@robzienert
Copy link
Member

robzienert commented Jul 11, 2017

RE @anotherchrisberry item 1: This is severe pedantry, but... I'd tend to disagree with grouping by application. The response is supposed to be a list of server groups. I'd be surprised to get a grouped response back. Maybe worth a query param to alter the response structure?

List getServerGroupsByApplications(@RequestParam(value = 'applications') List<String> applications,
@RequestParam(required = false, value = 'cloudProvider') String cloudProvider) {
def result = []
applications.forEach { application -> result +=summaryList(application, cloudProvider)}
Copy link
Member

@robzienert robzienert Jul 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make the entire method body applications.collectMany { summaryList(it, cloudProvider) }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fancy

@ajordens
Copy link
Contributor

I'd also argue against a query parameter that alters the response structure ... any sort of grouping can easily be done client-side.

@robzienert
Copy link
Member

robzienert commented Jul 11, 2017

Suppose response altering would make something like gRPC even harder. +1

@jeyrschabu
Copy link
Contributor Author

sounds like a strong consensus on not grouping the response. I will address item #2

@@ -179,6 +186,7 @@ class ServerGroupController {
String type
String cloudProvider
String instanceType
String application
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the application to the result

@@ -140,6 +139,14 @@ class ServerGroupController {
return summaryList(application, cloudProvider)
}

@PostFilter("hasPermission(filterObject?.application, 'APPLICATION', 'READ')")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a Post filter to remove unauthorized items

…tions

- Takes a list of applications and return an aggregated summary
@jeyrschabu jeyrschabu merged commit 3f687d5 into spinnaker:master Jul 13, 2017
lwander pushed a commit to lwander/clouddriver that referenced this pull request Aug 8, 2018
…r#1734)

This is a rollup of a bunch of individual changes to increase validation
flexibility and simplify some of the logging/reporting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants