Skip to content

Commit f1b8a3e

Browse files
committed
feat(Usage Reports): added subscription_id, created_at, deleted_at to usagereports instanceusage api response
Signed-off-by: Sowmya Kelam <sowmya.kelam@ibm.com>
1 parent f2d6e9b commit f1b8a3e

File tree

2 files changed

+133
-59
lines changed

2 files changed

+133
-59
lines changed

ibm_platform_services/usage_reports_v4.py

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ def new_instance(
5555
parameters and external configuration.
5656
"""
5757
authenticator = get_authenticator_from_environment(service_name)
58-
service = cls(
59-
authenticator
60-
)
58+
service = cls(authenticator)
6159
service.configure_service(service_name)
6260
return service
6361

@@ -255,7 +253,9 @@ def get_resource_group_usage(
255253
path_param_keys = ['account_id', 'resource_group_id', 'billingmonth']
256254
path_param_values = self.encode_path_vars(account_id, resource_group_id, billingmonth)
257255
path_param_dict = dict(zip(path_param_keys, path_param_values))
258-
url = '/v4/accounts/{account_id}/resource_groups/{resource_group_id}/usage/{billingmonth}'.format(**path_param_dict)
256+
url = '/v4/accounts/{account_id}/resource_groups/{resource_group_id}/usage/{billingmonth}'.format(
257+
**path_param_dict
258+
)
259259
request = self.prepare_request(
260260
method='GET',
261261
url=url,
@@ -445,7 +445,9 @@ def get_resource_usage_resource_group(
445445
path_param_keys = ['account_id', 'resource_group_id', 'billingmonth']
446446
path_param_values = self.encode_path_vars(account_id, resource_group_id, billingmonth)
447447
path_param_dict = dict(zip(path_param_keys, path_param_values))
448-
url = '/v4/accounts/{account_id}/resource_groups/{resource_group_id}/resource_instances/usage/{billingmonth}'.format(**path_param_dict)
448+
url = '/v4/accounts/{account_id}/resource_groups/{resource_group_id}/resource_instances/usage/{billingmonth}'.format(
449+
**path_param_dict
450+
)
449451
request = self.prepare_request(
450452
method='GET',
451453
url=url,
@@ -539,7 +541,11 @@ def get_resource_usage_org(
539541
path_param_keys = ['account_id', 'organization_id', 'billingmonth']
540542
path_param_values = self.encode_path_vars(account_id, organization_id, billingmonth)
541543
path_param_dict = dict(zip(path_param_keys, path_param_values))
542-
url = '/v4/accounts/{account_id}/organizations/{organization_id}/resource_instances/usage/{billingmonth}'.format(**path_param_dict)
544+
url = (
545+
'/v4/accounts/{account_id}/organizations/{organization_id}/resource_instances/usage/{billingmonth}'.format(
546+
**path_param_dict
547+
)
548+
)
543549
request = self.prepare_request(
544550
method='GET',
545551
url=url,
@@ -3260,7 +3266,6 @@ class StateEnum(str, Enum):
32603266
ENABLED = 'enabled'
32613267
DISABLED = 'disabled'
32623268

3263-
32643269
class AccountTypeEnum(str, Enum):
32653270
"""
32663271
Type of account. Possible values [enterprise, account].
@@ -3269,15 +3274,13 @@ class AccountTypeEnum(str, Enum):
32693274
ACCOUNT = 'account'
32703275
ENTERPRISE = 'enterprise'
32713276

3272-
32733277
class IntervalEnum(str, Enum):
32743278
"""
32753279
Frequency of taking the snapshot of the billing reports.
32763280
"""
32773281

32783282
DAILY = 'daily'
32793283

3280-
32813284
class VersioningEnum(str, Enum):
32823285
"""
32833286
A new version of report is created or the existing report version is overwritten
@@ -3287,7 +3290,6 @@ class VersioningEnum(str, Enum):
32873290
NEW = 'new'
32883291
OVERWRITE = 'overwrite'
32893292

3290-
32913293
class ReportTypesEnum(str, Enum):
32923294
"""
32933295
report_types.
@@ -3298,7 +3300,6 @@ class ReportTypesEnum(str, Enum):
32983300
ACCOUNT_RESOURCE_INSTANCE_USAGE = 'account_resource_instance_usage'
32993301

33003302

3301-
33023303
class SnapshotList:
33033304
"""
33043305
List of billing reports snapshots.
@@ -3741,7 +3742,6 @@ class AccountTypeEnum(str, Enum):
37413742
ACCOUNT = 'account'
37423743
ENTERPRISE = 'enterprise'
37433744

3744-
37453745
class StateEnum(str, Enum):
37463746
"""
37473747
Status of the billing snapshot configuration. Possible values are [enabled,
@@ -3752,7 +3752,6 @@ class StateEnum(str, Enum):
37523752
DISABLED = 'disabled'
37533753

37543754

3755-
37563755
class SnapshotListSnapshotsItemBillingPeriod:
37573756
"""
37583757
Period of billing in snapshot.
@@ -3915,7 +3914,6 @@ class ReportTypesEnum(str, Enum):
39153914
ACCOUNT_RESOURCE_INSTANCE_USAGE = 'account_resource_instance_usage'
39163915

39173916

3918-
39193917
class SnapshotListSnapshotsItemReportTypesItem:
39203918
"""
39213919
SnapshotListSnapshotsItemReportTypesItem.
@@ -3996,7 +3994,6 @@ class TypeEnum(str, Enum):
39963994
ACCOUNT_RESOURCE_INSTANCE_USAGE = 'account_resource_instance_usage'
39973995

39983996

3999-
40003997
class SnapshotConfig:
40013998
"""
40023999
Billing reports snapshot configuration.
@@ -4208,7 +4205,6 @@ class StateEnum(str, Enum):
42084205
ENABLED = 'enabled'
42094206
DISABLED = 'disabled'
42104207

4211-
42124208
class AccountTypeEnum(str, Enum):
42134209
"""
42144210
Type of account. Possible values are [enterprise, account].
@@ -4217,15 +4213,13 @@ class AccountTypeEnum(str, Enum):
42174213
ACCOUNT = 'account'
42184214
ENTERPRISE = 'enterprise'
42194215

4220-
42214216
class IntervalEnum(str, Enum):
42224217
"""
42234218
Frequency of taking the snapshot of the billing reports.
42244219
"""
42254220

42264221
DAILY = 'daily'
42274222

4228-
42294223
class VersioningEnum(str, Enum):
42304224
"""
42314225
A new version of report is created or the existing report version is overwritten
@@ -4235,7 +4229,6 @@ class VersioningEnum(str, Enum):
42354229
NEW = 'new'
42364230
OVERWRITE = 'overwrite'
42374231

4238-
42394232
class ReportTypesEnum(str, Enum):
42404233
"""
42414234
report_types.
@@ -4246,7 +4239,6 @@ class ReportTypesEnum(str, Enum):
42464239
ACCOUNT_RESOURCE_INSTANCE_USAGE = 'account_resource_instance_usage'
42474240

42484241

4249-
42504242
class SnapshotConfigValidateResponse:
42514243
"""
42524244
Validated billing service to COS bucket authorization.
@@ -4797,6 +4789,7 @@ def __ne__(self, other: 'SupportSummary') -> bool:
47974789
"""Return `true` when self and other are not equal, false otherwise."""
47984790
return not self == other
47994791

4792+
48004793
##############################################################################
48014794
# Pagers
48024795
##############################################################################

0 commit comments

Comments
 (0)