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 e3eac6a1
authored
7 years ago
by
diegolima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remover pg- dos nomes de instancias postgres
1 parent
db842ad8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
gce_parser.py
gce_parser.py
View file @
e3eac6a
...
@@ -29,10 +29,10 @@ GCE_REGIONS = [
...
@@ -29,10 +29,10 @@ GCE_REGIONS = [
]
]
GCE_OS
=
[
'linux'
,
'win'
,
'rhel'
,
'suse'
,
'suse-sap'
,
'sql-standard'
,
'sql-web'
,
'sql-enterprise'
]
GCE_OS
=
[
'linux'
,
'win'
,
'rhel'
,
'suse'
,
'suse-sap'
,
'sql-standard'
,
'sql-web'
,
'sql-enterprise'
]
with
urllib
.
request
.
urlopen
(
CATALOG
)
as
url
:
#
with urllib.request.urlopen(CATALOG) as url:
DATA
=
json
.
loads
(
url
.
read
()
.
decode
())
#
DATA = json.loads(url.read().decode())
#
with open(FCATALOG) as url:
with
open
(
FCATALOG
)
as
url
:
#
DATA = json.load(url)
DATA
=
json
.
load
(
url
)
for
product
in
DATA
[
'gcp_price_list'
]:
for
product
in
DATA
[
'gcp_price_list'
]:
if
'CUSTOM-VM-'
not
in
product
:
if
'CUSTOM-VM-'
not
in
product
:
if
PRODUCT_FAMILY
in
product
:
# Discard non-product entries
if
PRODUCT_FAMILY
in
product
:
# Discard non-product entries
...
@@ -97,4 +97,5 @@ with urllib.request.urlopen(CATALOG) as url:
...
@@ -97,4 +97,5 @@ with urllib.request.urlopen(CATALOG) as url:
realcpu
=
cpu
realcpu
=
cpu
print
(
'google,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s'
%
(
name
,
realcpu
,
memory
,
cost
,
region
,
os
,
sharedcores
))
print
(
'google,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s'
%
(
name
,
realcpu
,
memory
,
cost
,
region
,
os
,
sharedcores
))
else
:
else
:
realname
=
realname
.
replace
(
'pg-'
,
''
)
print
(
'google,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s'
%
(
realname
,
cpu
,
memory
,
cost
,
region
,
os
))
print
(
'google,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s'
%
(
realname
,
cpu
,
memory
,
cost
,
region
,
os
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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