Skip to content

Commit b3fa2a0

Browse files
dheimankevinmarete
andauthored
v0.16.38 (#190)
api.py: * get_storage_cost and get_bucket_usage updated to use the new getStorageCostEstimateV2 API (original APIs deprecated) fiss.py: * updated space_size and space_cost to return the applicable fields. --------- Co-authored-by: Kevin Marete <[email protected]>
1 parent 66e6b64 commit b3fa2a0

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ firecloud.egg-info/*
1313
# visual code settings
1414
.vscode
1515
firecloud.code-workspace
16+
17+
# IntelliJ IDEA settings
18+
.idea

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Change Log for FISSFC: the (Fi)recloud (S)ervice (S)elector
33
================================================================================
44
Terms used below: HL = high level interface, LL = low level interface
55

6+
v0.16.38 - LL: updated get_storage_cost and get_bucket_usage to use the new
7+
getStorageCostEstimateV2 API; HL: updated space_size and space_cost
8+
to return the applicable fields.
9+
610
v0.16.37 - LL: enhanced get_workflow_metadata to include the arguments
711
include_key, exclude_key, and expand_sub_workflows to match the API.
812

firecloud/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Package version
2-
__version__ = "0.16.37"
2+
__version__ = "0.16.38"

firecloud/api.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,21 +1395,18 @@ def get_storage_cost(namespace, workspace):
13951395
namespace (str): project to which workspace belongs
13961396
workspace (str): Workspace name
13971397
Swagger:
1398-
https://api.firecloud.org/#/Workspaces/getStorageCostEstimate
1398+
https://api.firecloud.org/#/WorkspacesV2/getStorageCostEstimateV2
13991399
"""
1400-
uri = "workspaces/{0}/{1}/storageCostEstimate".format(namespace, workspace)
1400+
uri = "workspaces/v2/{0}/{1}/storageCostEstimate".format(namespace, workspace)
14011401
return __get(uri)
14021402

14031403
def get_bucket_usage(namespace, workspace):
14041404
"""Request google bucket usage for workspace.
14051405
Args:
14061406
namespace (str): project to which workspace belongs
14071407
workspace (str): Workspace name
1408-
Swagger:
1409-
https://api.firecloud.org/#!/Workspaces/getBucketUsage
14101408
"""
1411-
uri = "workspaces/{0}/{1}/bucketUsage".format(namespace, workspace)
1412-
return __get(uri)
1409+
return get_storage_cost(namespace, workspace)
14131410

14141411
def create_workspace(namespace, name, authorizationDomain="", attributes=None,
14151412
noWorkspaceOwner=False, bucketLocation=""):

firecloud/fiss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ def space_size(args):
124124
""" Get storage size of a workspace. """
125125
r = fapi.get_bucket_usage(args.project, args.workspace)
126126
fapi._check_response_code(r, 200)
127-
return r.text
127+
return r.json()["usageInBytes"]
128128

129129
@fiss_cmd
130130
def space_cost(args):
131131
""" Get average monthly storage cost of a workspace. """
132132
r = fapi.get_storage_cost(args.project, args.workspace)
133133
fapi._check_response_code(r, 200)
134-
return r.text
134+
return r.json()["estimate"]
135135

136136
@fiss_cmd
137137
def space_delete(args):

0 commit comments

Comments
 (0)