67
67
68
68
account_settings_etag = None
69
69
70
+ report_reference_mfa = None
71
+
72
+ iam_id_member = None
73
+
70
74
71
75
##############################################################################
72
76
# Start of Examples for Service: IamIdentityV1
@@ -100,6 +104,9 @@ def setup_class(cls):
100
104
global iam_id
101
105
iam_id = config ['IAM_ID' ]
102
106
107
+ global iam_id_member
108
+ iam_id_member = config ['IAM_ID_MEMBER' ]
109
+
103
110
global apikey
104
111
apikey = config ['APIKEY' ]
105
112
@@ -789,7 +796,7 @@ def test_update_account_settings_example(self):
789
796
# begin-updateAccountSettings
790
797
791
798
account_settings_user_mfa = {}
792
- account_settings_user_mfa ['iam_id' ] = self . iam_id_member
799
+ account_settings_user_mfa ['iam_id' ] = iam_id_member
793
800
account_settings_user_mfa ['mfa' ] = 'NONE'
794
801
795
802
account_settings_response = iam_identity_service .update_account_settings (
@@ -803,7 +810,7 @@ def test_update_account_settings_example(self):
803
810
session_invalidation_in_seconds = "7200" ,
804
811
max_sessions_per_identity = '10' ,
805
812
system_access_token_expiration_in_seconds = '3600' ,
806
- system_refresh_token_expiration_in_seconds = '2592000 ' ,
813
+ system_refresh_token_expiration_in_seconds = '259200 ' ,
807
814
).get_result ()
808
815
809
816
print (json .dumps (account_settings_response , indent = 2 ))
@@ -845,8 +852,7 @@ def test_get_report(self):
845
852
# begin-get_report
846
853
847
854
get_report_response = iam_identity_service .get_report (
848
- account_id = account_id ,
849
- type = "latest" ,
855
+ account_id = account_id , reference = "latest"
850
856
).get_result ()
851
857
852
858
print (json .dumps (get_report_response , indent = 2 ))
@@ -856,6 +862,68 @@ def test_get_report(self):
856
862
except ApiException as e :
857
863
pytest .fail (str (e ))
858
864
865
+ @needscredentials
866
+ def test_create_mfa_report (self ):
867
+ """
868
+ create_mfa_report request example
869
+ """
870
+ try :
871
+ global report_reference_mfa
872
+ print ('\n create_mfa_report() result:' )
873
+ # begin-create_mfa_report
874
+
875
+ create_report_response = iam_identity_service .create_mfa_report (
876
+ account_id = account_id , type = "mfa_status"
877
+ ).get_result ()
878
+
879
+ print (json .dumps (create_report_response , indent = 2 ))
880
+ report_reference_mfa = create_report_response ['reference' ]
881
+
882
+ # end-create_mfa_report
883
+
884
+ except ApiException as e :
885
+ pytest .fail (str (e ))
886
+
887
+ @needscredentials
888
+ def test_get_mfa_report (self ):
889
+ """
890
+ get_mfa_report request example
891
+ """
892
+ try :
893
+ print ('\n get_mfa_report() result:' )
894
+ # begin-get_mfa_report
895
+
896
+ get_report_response = iam_identity_service .get_mfa_report (
897
+ account_id = account_id , reference = report_reference_mfa
898
+ ).get_result ()
899
+
900
+ print (json .dumps (get_report_response , indent = 2 ))
901
+
902
+ # end-get_mfa_report
903
+
904
+ except ApiException as e :
905
+ pytest .fail (str (e ))
906
+
907
+ @needscredentials
908
+ def test_get_mfa_status (self ):
909
+ """
910
+ get_mfa_status request example
911
+ """
912
+ try :
913
+ print ('\n get_mfa_status() result:' )
914
+ # begin-get_mfa_status
915
+
916
+ get_mfa_status_response = iam_identity_service .get_mfa_status (
917
+ account_id = account_id , iam_id = iam_id
918
+ ).get_result ()
919
+
920
+ print (json .dumps (get_mfa_status_response , indent = 2 ))
921
+
922
+ # end-get_mfa_status
923
+
924
+ except ApiException as e :
925
+ pytest .fail (str (e ))
926
+
859
927
860
928
# endregion
861
929
##############################################################################
0 commit comments