Skip to content

Instantly share code, notes, and snippets.

@rcj4747
Created February 10, 2017 22:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rcj4747/e5436e917f92bc1aa40e964148cc4396 to your computer and use it in GitHub Desktop.
Save rcj4747/e5436e917f92bc1aa40e964148cc4396 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OddBloke
Copy link

In [41]: locations = defaultdict(set)

In [42]: for product in data['products'].values():
    ...:     if product['attributes'].get('tenancy') != 'Shared':
    ...:         continue
    ...:     locations[product['attributes']['location']].add(product['attributes']['instanceType'])

produces a dict mapping location name -> set of instance types in that location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment