Skip to content

Commit 8c7742e

Browse files
authored
feat(Context-Based Restrictions): add Service Ref Target (#247)
Signed-off-by: Dylan <[email protected]>
1 parent 6171630 commit 8c7742e

File tree

4 files changed

+631
-280
lines changed

4 files changed

+631
-280
lines changed

examples/test_context_based_restrictions_v1_examples.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# (C) Copyright IBM Corp. 2023.
2+
# (C) Copyright IBM Corp. 2024.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -260,6 +260,30 @@ def test_list_available_serviceref_targets_example(self):
260260
except ApiException as e:
261261
pytest.fail(str(e))
262262

263+
@needscredentials
264+
def test_get_serviceref_target_example(self):
265+
"""
266+
get_serviceref_target request example
267+
"""
268+
try:
269+
print('\nget_serviceref_target() result:')
270+
271+
service_name = "containers-kubernetes"
272+
273+
# begin-get_serviceref_target
274+
275+
response = context_based_restrictions_service.get_serviceref_target(
276+
service_name=service_name,
277+
)
278+
service_ref_target = response.get_result()
279+
280+
print(json.dumps(service_ref_target, indent=2))
281+
282+
# end-get_serviceref_target
283+
284+
except ApiException as e:
285+
pytest.fail(str(e))
286+
263287
@needscredentials
264288
def test_create_rule_example(self):
265289
"""

0 commit comments

Comments
 (0)