Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Diego Lima
/
aws-price-parser
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8b8206d3
authored
Oct 31, 2017
by
diegolima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Real-time updates
1 parent
187c8958
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
aws.py
aws.py
View file @
8b8206d
import
urllib.request
import
urllib.request
import
json
import
json
from
pprint
import
pprint
TERM_ONDEMAND
=
'JRTCKXETXF'
#TODO: Find out where to get this from
TERM_ONDEMAND
=
'JRTCKXETXF'
#TODO: Find out where to get this from
HOURLY_DIMENSION
=
'6YS6EN2CT7'
#TODO: Find out where to get this from
HOURLY_DIMENSION
=
'6YS6EN2CT7'
#TODO: Find out where to get this from
with
urllib
.
request
.
urlopen
(
"https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json"
)
as
url
:
with
urllib
.
request
.
urlopen
(
"https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json"
)
as
url
:
DATA
=
json
.
load
(
url
)
DATA
=
json
.
load
s
(
url
.
read
()
.
decode
()
)
for
product
in
DATA
[
"products"
]:
for
product
in
DATA
[
"products"
]:
if
DATA
[
'products'
][
product
][
'productFamily'
]
==
'Compute Instance'
:
if
DATA
[
'products'
][
product
][
'productFamily'
]
==
'Compute Instance'
:
sku
=
DATA
[
'products'
][
product
][
'sku'
]
sku
=
DATA
[
'products'
][
product
][
'sku'
]
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment