Skip to content

Commit

Permalink
EVG-12586: query subnet availability zones (#4092)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaJoon committed Oct 20, 2020
1 parent 0345c4e commit 4d8fd79
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 29 deletions.
116 changes: 87 additions & 29 deletions graphql/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions graphql/resolvers.go
Expand Up @@ -1421,6 +1421,14 @@ func (r *queryResolver) AwsRegions(ctx context.Context) ([]string, error) {
return evergreen.GetEnvironment().Settings().Providers.AWS.AllowedRegions, nil
}

func (r *queryResolver) SubnetAvailabilityZones(ctx context.Context) ([]string, error) {
zones := []string{}
for _, subnet := range evergreen.GetEnvironment().Settings().Providers.AWS.Subnets {
zones = append(zones, subnet.AZ)
}
return zones, nil
}

func (r *queryResolver) SpruceConfig(ctx context.Context) (*restModel.APIAdminSettings, error) {
config, err := evergreen.GetConfig()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions graphql/schema.graphql
Expand Up @@ -40,6 +40,7 @@ type Query {
userSettings: UserSettings
spruceConfig: SpruceConfig
awsRegions: [String!]
subnetAvailabilityZones: [String!]!
userConfig: UserConfig
clientConfig: ClientConfig
host(hostId: String!): Host
Expand Down
1 change: 1 addition & 0 deletions graphql/tests/subnetAvailabilityZones/data.json
@@ -0,0 +1 @@
{}
@@ -0,0 +1,3 @@
{
subnetAvailabilityZones
}
12 changes: 12 additions & 0 deletions graphql/tests/subnetAvailabilityZones/results.json
@@ -0,0 +1,12 @@
{
"tests": [
{
"query_file": "subnetAvailabilityZones.graphql",
"result": {
"data": {
"subnetAvailabilityZones":[]
}
}
}
]
}

0 comments on commit 4d8fd79

Please sign in to comment.