Skip to content

Commit

Permalink
feat(IAM Identity): add support for inactivity reports (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooraniss-ibm authored Apr 6, 2022
1 parent e3c97a1 commit d748f00
Show file tree
Hide file tree
Showing 4 changed files with 1,880 additions and 492 deletions.
50 changes: 47 additions & 3 deletions examples/test_iam_identity_v1_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def test_get_api_key_example(self):
# begin-get_api_key

response = iam_identity_service.get_api_key(
id=apikey_id
id=apikey_id,
include_activity=True,
)

apikey_etag = response.get_headers()['Etag']
Expand Down Expand Up @@ -322,7 +323,8 @@ def test_get_service_id_example(self):
# begin-get_service_id

response = iam_identity_service.get_service_id(
id=svc_id
id=svc_id,
include_history=True,
)

svc_id_etag = response.get_headers()['Etag']
Expand Down Expand Up @@ -475,7 +477,8 @@ def test_get_profile_example(self):
# begin-get_profile

response = iam_identity_service.get_profile(
profile_id=profile_id
profile_id=profile_id,
include_history=True,
)

profile_etag = response.get_headers()['Etag']
Expand Down Expand Up @@ -831,6 +834,47 @@ def test_update_account_settings_example(self):

except ApiException as e:
pytest.fail(str(e))
@needscredentials
def test_create_report(self):
"""
create_report request example
"""
try:
print('\ncreate_report() result:')
# begin-createReport

create_report_response = iam_identity_service.create_report(
account_id=account_id,
type="inactive",
duration="120",
).get_result()

print(json.dumps(create_report_response, indent=2))

# end-createReport

except ApiException as e:
pytest.fail(str(e))
@needscredentials
def test_get_report(self):
"""
get_report request example
"""
try:
print('\nget_report() result:')
# begin-getReport

get_report_response = iam_identity_service.get_report(
account_id=account_id,
type="latest",
).get_result()

print(json.dumps(get_report_response, indent=2))

# end-getReport

except ApiException as e:
pytest.fail(str(e))

# endregion
##############################################################################
Expand Down
Loading

0 comments on commit d748f00

Please sign in to comment.