55
55
example_assignment_id = None
56
56
example_user_id = "IBMid-user1"
57
57
example_service_name = "iam-groups"
58
+ example_assignment_policy_id = None
58
59
59
60
##############################################################################
60
61
# Start of Examples for Service: IamPolicyManagementV1
@@ -809,7 +810,6 @@ def test_commit_policy_template_example(self):
809
810
response = iam_policy_management_service .commit_policy_template (
810
811
policy_template_id = example_template_id ,
811
812
version = example_template_version ,
812
- if_match = example_template_etag ,
813
813
)
814
814
815
815
# end-commit_policy_template
@@ -850,6 +850,8 @@ def test_get_policy_assignment_example(self):
850
850
"""
851
851
try :
852
852
print ('\n get_policy_assignment() result:' )
853
+
854
+ global example_assignment_policy_id
853
855
# begin-get_policy_assignment
854
856
855
857
response = iam_policy_management_service .get_policy_assignment (
@@ -859,11 +861,33 @@ def test_get_policy_assignment_example(self):
859
861
860
862
print (json .dumps (policy_assignment_record , indent = 2 ))
861
863
864
+ example_assignment_policy_id = policy_assignment_record ['resources' ][0 ]['policy' ]['resource_created' ]['id' ]
865
+
862
866
# end-get_policy_assignment
863
867
864
868
except ApiException as e :
865
869
pytest .fail (str (e ))
866
870
871
+ @needscredentials
872
+ def test_get_v2_assignment_policy_example (self ):
873
+ """
874
+ get_v2_assignment_policy request example
875
+ """
876
+ try :
877
+
878
+ print ('\n get_v2_assignment_policy() result:' )
879
+ # begin-get_v2_assignment_policy
880
+
881
+ response = iam_policy_management_service .get_v2_policy (id = example_assignment_policy_id )
882
+ policy = response .get_result ()
883
+
884
+ print (json .dumps (policy , indent = 2 ))
885
+
886
+ # end-get_v2_assignment_policy
887
+
888
+ except ApiException as e :
889
+ pytest .fail (str (e ))
890
+
867
891
@needscredentials
868
892
def test_delete_policy_template_example (self ):
869
893
"""
0 commit comments