Skip to content

Commit 5e536d7

Browse files
authored
feat(Context-based Restrictions): update service after recent API changes (#164)
Signed-off-by: Stephen SooHoo <[email protected]>
1 parent 4eecea3 commit 5e536d7

File tree

4 files changed

+1041
-26
lines changed

4 files changed

+1041
-26
lines changed

examples/test_context_based_restrictions_v1_examples.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ def test_create_zone_example(self):
105105
}
106106

107107
zone = context_based_restrictions_service.create_zone(
108-
name='SDK TEST - an example of zone',
108+
name='an example of zone',
109109
account_id=account_id,
110110
addresses=[address_model],
111-
description='SDK TEST - this is an example of zone',
111+
description='this is an example of zone',
112112
).get_result()
113113

114114
print(json.dumps(zone, indent=2))
@@ -180,10 +180,10 @@ def test_replace_zone_example(self):
180180
zone = context_based_restrictions_service.replace_zone(
181181
zone_id=zone_id,
182182
if_match=zone_rev,
183-
name='SDK TEST - an example of updated zone',
183+
name='an example of updated zone',
184184
account_id=account_id,
185185
addresses=[address_model],
186-
description='SDK TEST - this is an example of updated zone',
186+
description='this is an example of updated zone',
187187
).get_result()
188188

189189
print(json.dumps(zone, indent=2))
@@ -246,7 +246,7 @@ def test_create_rule_example(self):
246246
rule = context_based_restrictions_service.create_rule(
247247
contexts=[rule_context_model],
248248
resources=[resource_model],
249-
description='SDK TEST - this is an example of rule',
249+
description='this is an example of rule',
250250
enforcement_mode='enabled'
251251
).get_result()
252252

@@ -345,7 +345,7 @@ def test_replace_rule_example(self):
345345
if_match=rule_rev,
346346
contexts=[rule_context_model],
347347
resources=[resource_model],
348-
description='SDK TEST - this is an example of updated rule',
348+
description='this is an example of updated rule',
349349
enforcement_mode='disabled'
350350
).get_result()
351351

@@ -376,6 +376,26 @@ def test_get_account_settings_example(self):
376376
except ApiException as e:
377377
pytest.fail(str(e))
378378

379+
@needscredentials
380+
def test_list_available_service_operations_example(self):
381+
"""
382+
list_available_service_operations request example
383+
"""
384+
try:
385+
print('\nlist_available_service_operations() result:')
386+
# begin-list_available_service_operations
387+
388+
operations_list = context_based_restrictions_service.list_available_service_operations(
389+
service_name='containers-kubernetes'
390+
).get_result()
391+
392+
print(json.dumps(operations_list, indent=2))
393+
394+
# end-list_available_service_operations
395+
396+
except ApiException as e:
397+
pytest.fail(str(e))
398+
379399
@needscredentials
380400
def test_delete_rule_example(self):
381401
"""

0 commit comments

Comments
 (0)