tccli-intl-en 3.0.1265.1__py2.py3-none-any.whl → 3.0.1283.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/argument.py +1 -1
  3. tccli/services/__init__.py +5 -1
  4. tccli/services/advisor/advisor_client.py +10 -4
  5. tccli/services/aiart/aiart_client.py +5 -2
  6. tccli/services/ams/ams_client.py +20 -8
  7. tccli/services/antiddos/antiddos_client.py +350 -140
  8. tccli/services/apigateway/apigateway_client.py +465 -186
  9. tccli/services/apm/apm_client.py +835 -68
  10. tccli/services/apm/v20210622/api.json +3936 -1145
  11. tccli/services/apm/v20210622/examples.json +133 -23
  12. tccli/services/asr/asr_client.py +10 -4
  13. tccli/services/autoscaling/autoscaling_client.py +290 -116
  14. tccli/services/autoscaling/v20180419/api.json +1 -1
  15. tccli/services/batch/batch_client.py +140 -56
  16. tccli/services/bi/bi_client.py +120 -48
  17. tccli/services/billing/billing_client.py +210 -84
  18. tccli/services/cam/cam_client.py +405 -162
  19. tccli/services/captcha/captcha_client.py +5 -2
  20. tccli/services/car/car_client.py +165 -66
  21. tccli/services/cbs/cbs_client.py +190 -76
  22. tccli/services/ccc/ccc_client.py +515 -146
  23. tccli/services/ccc/v20200210/api.json +511 -27
  24. tccli/services/ccc/v20200210/examples.json +24 -0
  25. tccli/services/cdb/cdb_client.py +665 -266
  26. tccli/services/cdc/cdc_client.py +100 -40
  27. tccli/services/cdn/cdn_client.py +220 -88
  28. tccli/services/cdwdoris/cdwdoris_client.py +385 -154
  29. tccli/services/cdwpg/cdwpg_client.py +120 -48
  30. tccli/services/cdz/cdz_client.py +5 -2
  31. tccli/services/cfg/cfg_client.py +80 -32
  32. tccli/services/cfs/cfs_client.py +195 -78
  33. tccli/services/cfw/cfw_client.py +330 -132
  34. tccli/services/chdfs/chdfs_client.py +145 -58
  35. tccli/services/ciam/ciam_client.py +80 -32
  36. tccli/services/ckafka/ckafka_client.py +629 -131
  37. tccli/services/ckafka/v20190819/api.json +2749 -1470
  38. tccli/services/ckafka/v20190819/examples.json +209 -155
  39. tccli/services/clb/clb_client.py +415 -166
  40. tccli/services/clb/v20180317/api.json +29 -14
  41. tccli/services/cloudaudit/cloudaudit_client.py +90 -36
  42. tccli/services/cls/cls_client.py +434 -173
  43. tccli/services/cmq/cmq_client.py +10 -4
  44. tccli/services/config/config_client.py +30 -12
  45. tccli/services/controlcenter/controlcenter_client.py +5 -2
  46. tccli/services/csip/csip_client.py +170 -68
  47. tccli/services/ctsdb/ctsdb_client.py +10 -4
  48. tccli/services/cvm/cvm_client.py +420 -168
  49. tccli/services/cvm/v20170312/api.json +239 -133
  50. tccli/services/cvm/v20170312/examples.json +101 -101
  51. tccli/services/cwp/cwp_client.py +2325 -930
  52. tccli/services/cynosdb/cynosdb_client.py +1887 -577
  53. tccli/services/cynosdb/v20190107/api.json +11763 -7697
  54. tccli/services/cynosdb/v20190107/examples.json +132 -4
  55. tccli/services/dataintegration/dataintegration_client.py +5 -2
  56. tccli/services/dayu/dayu_client.py +515 -206
  57. tccli/services/dbbrain/dbbrain_client.py +210 -84
  58. tccli/services/dc/dc_client.py +90 -36
  59. tccli/services/dcdb/dcdb_client.py +310 -124
  60. tccli/services/dlc/dlc_client.py +808 -216
  61. tccli/services/dlc/v20210125/api.json +534 -13
  62. tccli/services/dlc/v20210125/examples.json +40 -0
  63. tccli/services/dms/dms_client.py +10 -4
  64. tccli/services/dnspod/dnspod_client.py +200 -80
  65. tccli/services/domain/domain_client.py +120 -48
  66. tccli/services/dts/dts_client.py +415 -166
  67. tccli/services/eb/eb_client.py +130 -52
  68. tccli/services/ecdn/ecdn_client.py +75 -30
  69. tccli/services/ecm/ecm_client.py +620 -248
  70. tccli/services/eiam/eiam_client.py +200 -80
  71. tccli/services/emr/emr_client.py +385 -154
  72. tccli/services/es/es_client.py +105 -42
  73. tccli/services/facefusion/facefusion_client.py +15 -6
  74. tccli/services/faceid/faceid_client.py +95 -38
  75. tccli/services/faceid/v20180301/examples.json +2 -2
  76. tccli/services/gaap/gaap_client.py +440 -176
  77. tccli/services/gme/gme_client.py +50 -20
  78. tccli/services/gpm/gpm_client.py +90 -36
  79. tccli/services/gse/gse_client.py +110 -44
  80. tccli/services/gwlb/gwlb_client.py +90 -36
  81. tccli/services/iai/iai_client.py +145 -58
  82. tccli/services/iap/iap_client.py +30 -12
  83. tccli/services/ims/ims_client.py +5 -2
  84. tccli/services/intlpartnersmgt/intlpartnersmgt_client.py +210 -84
  85. tccli/services/iotcloud/iotcloud_client.py +100 -40
  86. tccli/services/ip/ip_client.py +30 -12
  87. tccli/services/kms/kms_client.py +340 -136
  88. tccli/services/lcic/lcic_client.py +265 -106
  89. tccli/services/lighthouse/lighthouse_client.py +370 -148
  90. tccli/services/live/live_client.py +600 -240
  91. tccli/services/lke/lke_client.py +450 -180
  92. tccli/services/lkeap/lkeap_client.py +142 -12
  93. tccli/services/lkeap/v20240522/api.json +263 -0
  94. tccli/services/lkeap/v20240522/examples.json +35 -1
  95. tccli/services/mariadb/mariadb_client.py +250 -100
  96. tccli/services/mdc/mdc_client.py +90 -36
  97. tccli/services/mdl/mdl_client.py +165 -66
  98. tccli/services/mdl/v20200326/api.json +186 -12
  99. tccli/services/mdl/v20200326/examples.json +16 -16
  100. tccli/services/mdp/mdp_client.py +416 -124
  101. tccli/services/mdp/v20200527/api.json +146 -14
  102. tccli/services/mdp/v20200527/examples.json +95 -79
  103. tccli/services/message/__init__.py +4 -0
  104. tccli/services/message/message_client.py +210 -0
  105. tccli/services/message/v20181225/api.json +72 -0
  106. tccli/services/message/v20181225/examples.json +13 -0
  107. tccli/services/mongodb/mongodb_client.py +369 -58
  108. tccli/services/mongodb/v20190725/api.json +811 -226
  109. tccli/services/mongodb/v20190725/examples.json +54 -22
  110. tccli/services/monitor/monitor_client.py +1008 -296
  111. tccli/services/monitor/v20180724/api.json +657 -8
  112. tccli/services/monitor/v20180724/examples.json +152 -4
  113. tccli/services/mps/mps_client.py +684 -184
  114. tccli/services/mps/v20190612/api.json +1656 -222
  115. tccli/services/mps/v20190612/examples.json +60 -10
  116. tccli/services/msp/msp_client.py +35 -14
  117. tccli/services/ocr/ocr_client.py +246 -76
  118. tccli/services/ocr/v20181119/api.json +83 -4
  119. tccli/services/ocr/v20181119/examples.json +8 -0
  120. tccli/services/omics/omics_client.py +100 -40
  121. tccli/services/organization/organization_client.py +580 -232
  122. tccli/services/postgres/postgres_client.py +455 -182
  123. tccli/services/privatedns/privatedns_client.py +155 -62
  124. tccli/services/pts/pts_client.py +240 -96
  125. tccli/services/quota/quota_client.py +229 -2
  126. tccli/services/quota/v20241204/api.json +451 -2
  127. tccli/services/quota/v20241204/examples.json +42 -3
  128. tccli/services/rce/rce_client.py +5 -2
  129. tccli/services/redis/redis_client.py +545 -218
  130. tccli/services/redis/v20180412/api.json +225 -113
  131. tccli/services/redis/v20180412/examples.json +19 -19
  132. tccli/services/region/region_client.py +15 -6
  133. tccli/services/rum/rum_client.py +300 -120
  134. tccli/services/scf/scf_client.py +210 -84
  135. tccli/services/ses/ses_client.py +145 -58
  136. tccli/services/sms/sms_client.py +90 -36
  137. tccli/services/sqlserver/sqlserver_client.py +695 -278
  138. tccli/services/ssl/ssl_client.py +190 -76
  139. tccli/services/ssm/ssm_client.py +120 -48
  140. tccli/services/sts/sts_client.py +25 -10
  141. tccli/services/tag/tag_client.py +150 -60
  142. tccli/services/tat/tat_client.py +95 -38
  143. tccli/services/tbaas/tbaas_client.py +20 -8
  144. tccli/services/tcaplusdb/tcaplusdb_client.py +260 -104
  145. tccli/services/tchd/tchd_client.py +5 -2
  146. tccli/services/tcmpp/tcmpp_client.py +520 -208
  147. tccli/services/tcr/tcr_client.py +380 -152
  148. tccli/services/tcsas/tcsas_client.py +295 -118
  149. tccli/services/tcsas/v20250106/api.json +101 -61
  150. tccli/services/tcsas/v20250106/examples.json +2 -2
  151. tccli/services/tcss/tcss_client.py +1650 -660
  152. tccli/services/tdid/tdid_client.py +240 -96
  153. tccli/services/tdmq/tdmq_client.py +470 -188
  154. tccli/services/tem/tem_client.py +280 -112
  155. tccli/services/teo/teo_client.py +1365 -483
  156. tccli/services/teo/v20220901/api.json +354 -39
  157. tccli/services/teo/v20220901/examples.json +24 -0
  158. tccli/services/tione/tione_client.py +5 -2
  159. tccli/services/tiw/tiw_client.py +255 -102
  160. tccli/services/tke/tke_client.py +690 -276
  161. tccli/services/tms/tms_client.py +5 -2
  162. tccli/services/tmt/tmt_client.py +5 -2
  163. tccli/services/trabbit/trabbit_client.py +145 -58
  164. tccli/services/trro/trro_client.py +95 -38
  165. tccli/services/trtc/trtc_client.py +255 -102
  166. tccli/services/trtc/v20190722/api.json +6 -6
  167. tccli/services/trtc/v20190722/examples.json +7 -7
  168. tccli/services/tts/tts_client.py +5 -2
  169. tccli/services/vclm/vclm_client.py +10 -4
  170. tccli/services/vm/vm_client.py +20 -8
  171. tccli/services/vod/vod_client.py +895 -358
  172. tccli/services/vpc/v20170312/api.json +970 -75
  173. tccli/services/vpc/v20170312/examples.json +106 -10
  174. tccli/services/vpc/vpc_client.py +2159 -644
  175. tccli/services/waf/waf_client.py +535 -214
  176. tccli/services/wedata/v20250806/api.json +13644 -0
  177. tccli/services/wedata/v20250806/examples.json +621 -0
  178. tccli/services/wedata/wedata_client.py +6067 -1263
  179. tccli/services/yunjing/yunjing_client.py +355 -142
  180. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/METADATA +4 -7
  181. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/RECORD +185 -179
  182. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/WHEEL +1 -1
  183. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/entry_points.txt +0 -1
  184. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/LICENSE +0 -0
  185. {tccli_intl_en-3.0.1265.1.dist-info → tccli_intl_en-3.0.1283.1.dist-info}/top_level.txt +0 -0
@@ -17,6 +17,226 @@ from tencentcloud.apm.v20210622 import models as models_v20210622
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
+ def doModifyApmInstance(args, parsed_globals):
21
+ g_param = parse_global_arg(parsed_globals)
22
+
23
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
24
+ cred = credential.CVMRoleCredential()
25
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
+ cred = credential.STSAssumeRoleCredential(
27
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
+ )
30
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
31
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
32
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
33
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
34
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
35
+ else:
36
+ cred = credential.Credential(
37
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
38
+ )
39
+ http_profile = HttpProfile(
40
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
41
+ reqMethod="POST",
42
+ endpoint=g_param[OptionsDefine.Endpoint],
43
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
44
+ )
45
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
46
+ if g_param[OptionsDefine.Language]:
47
+ profile.language = g_param[OptionsDefine.Language]
48
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
49
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
50
+ client._sdkVersion += ("_CLI_" + __version__)
51
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
52
+ model = models.ModifyApmInstanceRequest()
53
+ model.from_json_string(json.dumps(args))
54
+ start_time = time.time()
55
+ while True:
56
+ rsp = client.ModifyApmInstance(model)
57
+ result = rsp.to_json_string()
58
+ try:
59
+ json_obj = json.loads(result)
60
+ except TypeError as e:
61
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
62
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
63
+ break
64
+ cur_time = time.time()
65
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
66
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
67
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
68
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
69
+ else:
70
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
71
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
72
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
73
+
74
+
75
+ def doDescribeGeneralSpanList(args, parsed_globals):
76
+ g_param = parse_global_arg(parsed_globals)
77
+
78
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
79
+ cred = credential.CVMRoleCredential()
80
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
81
+ cred = credential.STSAssumeRoleCredential(
82
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
83
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
84
+ )
85
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
86
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
87
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
88
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
89
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
90
+ else:
91
+ cred = credential.Credential(
92
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
93
+ )
94
+ http_profile = HttpProfile(
95
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
96
+ reqMethod="POST",
97
+ endpoint=g_param[OptionsDefine.Endpoint],
98
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
99
+ )
100
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
101
+ if g_param[OptionsDefine.Language]:
102
+ profile.language = g_param[OptionsDefine.Language]
103
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
104
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
105
+ client._sdkVersion += ("_CLI_" + __version__)
106
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
107
+ model = models.DescribeGeneralSpanListRequest()
108
+ model.from_json_string(json.dumps(args))
109
+ start_time = time.time()
110
+ while True:
111
+ rsp = client.DescribeGeneralSpanList(model)
112
+ result = rsp.to_json_string()
113
+ try:
114
+ json_obj = json.loads(result)
115
+ except TypeError as e:
116
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
117
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
118
+ break
119
+ cur_time = time.time()
120
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
121
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
122
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
123
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
124
+ else:
125
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
126
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
127
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
128
+
129
+
130
+ def doDescribeGeneralOTSpanList(args, parsed_globals):
131
+ g_param = parse_global_arg(parsed_globals)
132
+
133
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
134
+ cred = credential.CVMRoleCredential()
135
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
136
+ cred = credential.STSAssumeRoleCredential(
137
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
138
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
139
+ )
140
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
141
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
142
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
143
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
144
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
145
+ else:
146
+ cred = credential.Credential(
147
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
148
+ )
149
+ http_profile = HttpProfile(
150
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
151
+ reqMethod="POST",
152
+ endpoint=g_param[OptionsDefine.Endpoint],
153
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
154
+ )
155
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
156
+ if g_param[OptionsDefine.Language]:
157
+ profile.language = g_param[OptionsDefine.Language]
158
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
159
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
160
+ client._sdkVersion += ("_CLI_" + __version__)
161
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
162
+ model = models.DescribeGeneralOTSpanListRequest()
163
+ model.from_json_string(json.dumps(args))
164
+ start_time = time.time()
165
+ while True:
166
+ rsp = client.DescribeGeneralOTSpanList(model)
167
+ result = rsp.to_json_string()
168
+ try:
169
+ json_obj = json.loads(result)
170
+ except TypeError as e:
171
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
172
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
173
+ break
174
+ cur_time = time.time()
175
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
176
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
177
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
178
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
179
+ else:
180
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
181
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
182
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
183
+
184
+
185
+ def doCreateApmInstance(args, parsed_globals):
186
+ g_param = parse_global_arg(parsed_globals)
187
+
188
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
189
+ cred = credential.CVMRoleCredential()
190
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
191
+ cred = credential.STSAssumeRoleCredential(
192
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
193
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
194
+ )
195
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
196
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
197
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
198
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
199
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
200
+ else:
201
+ cred = credential.Credential(
202
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
203
+ )
204
+ http_profile = HttpProfile(
205
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
206
+ reqMethod="POST",
207
+ endpoint=g_param[OptionsDefine.Endpoint],
208
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
209
+ )
210
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
211
+ if g_param[OptionsDefine.Language]:
212
+ profile.language = g_param[OptionsDefine.Language]
213
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
214
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
215
+ client._sdkVersion += ("_CLI_" + __version__)
216
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
217
+ model = models.CreateApmInstanceRequest()
218
+ model.from_json_string(json.dumps(args))
219
+ start_time = time.time()
220
+ while True:
221
+ rsp = client.CreateApmInstance(model)
222
+ result = rsp.to_json_string()
223
+ try:
224
+ json_obj = json.loads(result)
225
+ except TypeError as e:
226
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
227
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
228
+ break
229
+ cur_time = time.time()
230
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
231
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
232
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
233
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
234
+ else:
235
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
236
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
237
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
238
+
239
+
20
240
  def doDescribeGeneralApmApplicationConfig(args, parsed_globals):
21
241
  g_param = parse_global_arg(parsed_globals)
22
242
 
@@ -27,7 +247,285 @@ def doDescribeGeneralApmApplicationConfig(args, parsed_globals):
27
247
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
248
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
249
  )
30
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
250
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
251
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
252
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
253
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
254
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
255
+ else:
256
+ cred = credential.Credential(
257
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
258
+ )
259
+ http_profile = HttpProfile(
260
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
261
+ reqMethod="POST",
262
+ endpoint=g_param[OptionsDefine.Endpoint],
263
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
264
+ )
265
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
266
+ if g_param[OptionsDefine.Language]:
267
+ profile.language = g_param[OptionsDefine.Language]
268
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
269
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
270
+ client._sdkVersion += ("_CLI_" + __version__)
271
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
272
+ model = models.DescribeGeneralApmApplicationConfigRequest()
273
+ model.from_json_string(json.dumps(args))
274
+ start_time = time.time()
275
+ while True:
276
+ rsp = client.DescribeGeneralApmApplicationConfig(model)
277
+ result = rsp.to_json_string()
278
+ try:
279
+ json_obj = json.loads(result)
280
+ except TypeError as e:
281
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
282
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
283
+ break
284
+ cur_time = time.time()
285
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
286
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
287
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
288
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
289
+ else:
290
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
291
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
292
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
293
+
294
+
295
+ def doModifyApmAssociation(args, parsed_globals):
296
+ g_param = parse_global_arg(parsed_globals)
297
+
298
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
299
+ cred = credential.CVMRoleCredential()
300
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
301
+ cred = credential.STSAssumeRoleCredential(
302
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
303
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
304
+ )
305
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
306
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
307
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
308
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
309
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
310
+ else:
311
+ cred = credential.Credential(
312
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
313
+ )
314
+ http_profile = HttpProfile(
315
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
316
+ reqMethod="POST",
317
+ endpoint=g_param[OptionsDefine.Endpoint],
318
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
319
+ )
320
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
321
+ if g_param[OptionsDefine.Language]:
322
+ profile.language = g_param[OptionsDefine.Language]
323
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
324
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
325
+ client._sdkVersion += ("_CLI_" + __version__)
326
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
327
+ model = models.ModifyApmAssociationRequest()
328
+ model.from_json_string(json.dumps(args))
329
+ start_time = time.time()
330
+ while True:
331
+ rsp = client.ModifyApmAssociation(model)
332
+ result = rsp.to_json_string()
333
+ try:
334
+ json_obj = json.loads(result)
335
+ except TypeError as e:
336
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
337
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
338
+ break
339
+ cur_time = time.time()
340
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
341
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
342
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
343
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
344
+ else:
345
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
346
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
347
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
348
+
349
+
350
+ def doModifyApmSampleConfig(args, parsed_globals):
351
+ g_param = parse_global_arg(parsed_globals)
352
+
353
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
354
+ cred = credential.CVMRoleCredential()
355
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
356
+ cred = credential.STSAssumeRoleCredential(
357
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
358
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
359
+ )
360
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
361
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
362
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
363
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
364
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
365
+ else:
366
+ cred = credential.Credential(
367
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
368
+ )
369
+ http_profile = HttpProfile(
370
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
371
+ reqMethod="POST",
372
+ endpoint=g_param[OptionsDefine.Endpoint],
373
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
374
+ )
375
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
376
+ if g_param[OptionsDefine.Language]:
377
+ profile.language = g_param[OptionsDefine.Language]
378
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
379
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
380
+ client._sdkVersion += ("_CLI_" + __version__)
381
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
382
+ model = models.ModifyApmSampleConfigRequest()
383
+ model.from_json_string(json.dumps(args))
384
+ start_time = time.time()
385
+ while True:
386
+ rsp = client.ModifyApmSampleConfig(model)
387
+ result = rsp.to_json_string()
388
+ try:
389
+ json_obj = json.loads(result)
390
+ except TypeError as e:
391
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
392
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
393
+ break
394
+ cur_time = time.time()
395
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
396
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
397
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
398
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
399
+ else:
400
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
401
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
402
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
403
+
404
+
405
+ def doDescribeApmAgent(args, parsed_globals):
406
+ g_param = parse_global_arg(parsed_globals)
407
+
408
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
409
+ cred = credential.CVMRoleCredential()
410
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
411
+ cred = credential.STSAssumeRoleCredential(
412
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
413
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
414
+ )
415
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
416
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
417
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
418
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
419
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
420
+ else:
421
+ cred = credential.Credential(
422
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
423
+ )
424
+ http_profile = HttpProfile(
425
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
426
+ reqMethod="POST",
427
+ endpoint=g_param[OptionsDefine.Endpoint],
428
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
429
+ )
430
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
431
+ if g_param[OptionsDefine.Language]:
432
+ profile.language = g_param[OptionsDefine.Language]
433
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
434
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
435
+ client._sdkVersion += ("_CLI_" + __version__)
436
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
437
+ model = models.DescribeApmAgentRequest()
438
+ model.from_json_string(json.dumps(args))
439
+ start_time = time.time()
440
+ while True:
441
+ rsp = client.DescribeApmAgent(model)
442
+ result = rsp.to_json_string()
443
+ try:
444
+ json_obj = json.loads(result)
445
+ except TypeError as e:
446
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
447
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
448
+ break
449
+ cur_time = time.time()
450
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
451
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
452
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
453
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
454
+ else:
455
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
456
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
457
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
458
+
459
+
460
+ def doDescribeGeneralMetricData(args, parsed_globals):
461
+ g_param = parse_global_arg(parsed_globals)
462
+
463
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
464
+ cred = credential.CVMRoleCredential()
465
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
466
+ cred = credential.STSAssumeRoleCredential(
467
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
468
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
469
+ )
470
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
471
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
472
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
473
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
474
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
475
+ else:
476
+ cred = credential.Credential(
477
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
478
+ )
479
+ http_profile = HttpProfile(
480
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
481
+ reqMethod="POST",
482
+ endpoint=g_param[OptionsDefine.Endpoint],
483
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
484
+ )
485
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
486
+ if g_param[OptionsDefine.Language]:
487
+ profile.language = g_param[OptionsDefine.Language]
488
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
489
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
490
+ client._sdkVersion += ("_CLI_" + __version__)
491
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
492
+ model = models.DescribeGeneralMetricDataRequest()
493
+ model.from_json_string(json.dumps(args))
494
+ start_time = time.time()
495
+ while True:
496
+ rsp = client.DescribeGeneralMetricData(model)
497
+ result = rsp.to_json_string()
498
+ try:
499
+ json_obj = json.loads(result)
500
+ except TypeError as e:
501
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
502
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
503
+ break
504
+ cur_time = time.time()
505
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
506
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
507
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
508
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
509
+ else:
510
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
511
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
512
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
513
+
514
+
515
+ def doCreateApmPrometheusRule(args, parsed_globals):
516
+ g_param = parse_global_arg(parsed_globals)
517
+
518
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
519
+ cred = credential.CVMRoleCredential()
520
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
521
+ cred = credential.STSAssumeRoleCredential(
522
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
523
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
524
+ )
525
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
526
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
527
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
528
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
31
529
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
32
530
  else:
33
531
  cred = credential.Credential(
@@ -39,18 +537,18 @@ def doDescribeGeneralApmApplicationConfig(args, parsed_globals):
39
537
  endpoint=g_param[OptionsDefine.Endpoint],
40
538
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
41
539
  )
42
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
540
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
43
541
  if g_param[OptionsDefine.Language]:
44
542
  profile.language = g_param[OptionsDefine.Language]
45
543
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
46
544
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
47
545
  client._sdkVersion += ("_CLI_" + __version__)
48
546
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
- model = models.DescribeGeneralApmApplicationConfigRequest()
547
+ model = models.CreateApmPrometheusRuleRequest()
50
548
  model.from_json_string(json.dumps(args))
51
549
  start_time = time.time()
52
550
  while True:
53
- rsp = client.DescribeGeneralApmApplicationConfig(model)
551
+ rsp = client.CreateApmPrometheusRule(model)
54
552
  result = rsp.to_json_string()
55
553
  try:
56
554
  json_obj = json.loads(result)
@@ -69,7 +567,7 @@ def doDescribeGeneralApmApplicationConfig(args, parsed_globals):
69
567
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
568
 
71
569
 
72
- def doDescribeTagValues(args, parsed_globals):
570
+ def doTerminateApmInstance(args, parsed_globals):
73
571
  g_param = parse_global_arg(parsed_globals)
74
572
 
75
573
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -79,7 +577,10 @@ def doDescribeTagValues(args, parsed_globals):
79
577
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
578
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
81
579
  )
82
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
580
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
581
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
582
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
583
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
83
584
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
84
585
  else:
85
586
  cred = credential.Credential(
@@ -91,18 +592,18 @@ def doDescribeTagValues(args, parsed_globals):
91
592
  endpoint=g_param[OptionsDefine.Endpoint],
92
593
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
93
594
  )
94
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
595
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
95
596
  if g_param[OptionsDefine.Language]:
96
597
  profile.language = g_param[OptionsDefine.Language]
97
598
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
98
599
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
99
600
  client._sdkVersion += ("_CLI_" + __version__)
100
601
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
- model = models.DescribeTagValuesRequest()
602
+ model = models.TerminateApmInstanceRequest()
102
603
  model.from_json_string(json.dumps(args))
103
604
  start_time = time.time()
104
605
  while True:
105
- rsp = client.DescribeTagValues(model)
606
+ rsp = client.TerminateApmInstance(model)
106
607
  result = rsp.to_json_string()
107
608
  try:
108
609
  json_obj = json.loads(result)
@@ -121,7 +622,7 @@ def doDescribeTagValues(args, parsed_globals):
121
622
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
623
 
123
624
 
124
- def doDescribeGeneralSpanList(args, parsed_globals):
625
+ def doDescribeApmAssociation(args, parsed_globals):
125
626
  g_param = parse_global_arg(parsed_globals)
126
627
 
127
628
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -131,7 +632,10 @@ def doDescribeGeneralSpanList(args, parsed_globals):
131
632
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
633
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
634
  )
134
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
635
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
636
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
637
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
638
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
135
639
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
136
640
  else:
137
641
  cred = credential.Credential(
@@ -143,18 +647,18 @@ def doDescribeGeneralSpanList(args, parsed_globals):
143
647
  endpoint=g_param[OptionsDefine.Endpoint],
144
648
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
145
649
  )
146
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
650
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
147
651
  if g_param[OptionsDefine.Language]:
148
652
  profile.language = g_param[OptionsDefine.Language]
149
653
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
150
654
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
151
655
  client._sdkVersion += ("_CLI_" + __version__)
152
656
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
- model = models.DescribeGeneralSpanListRequest()
657
+ model = models.DescribeApmAssociationRequest()
154
658
  model.from_json_string(json.dumps(args))
155
659
  start_time = time.time()
156
660
  while True:
157
- rsp = client.DescribeGeneralSpanList(model)
661
+ rsp = client.DescribeApmAssociation(model)
158
662
  result = rsp.to_json_string()
159
663
  try:
160
664
  json_obj = json.loads(result)
@@ -173,7 +677,7 @@ def doDescribeGeneralSpanList(args, parsed_globals):
173
677
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
678
 
175
679
 
176
- def doDescribeApmInstances(args, parsed_globals):
680
+ def doDescribeApmServiceMetric(args, parsed_globals):
177
681
  g_param = parse_global_arg(parsed_globals)
178
682
 
179
683
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -183,7 +687,10 @@ def doDescribeApmInstances(args, parsed_globals):
183
687
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
688
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
689
  )
186
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
690
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
691
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
692
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
693
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
187
694
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
188
695
  else:
189
696
  cred = credential.Credential(
@@ -195,18 +702,18 @@ def doDescribeApmInstances(args, parsed_globals):
195
702
  endpoint=g_param[OptionsDefine.Endpoint],
196
703
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
197
704
  )
198
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
705
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
199
706
  if g_param[OptionsDefine.Language]:
200
707
  profile.language = g_param[OptionsDefine.Language]
201
708
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
202
709
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
203
710
  client._sdkVersion += ("_CLI_" + __version__)
204
711
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
- model = models.DescribeApmInstancesRequest()
712
+ model = models.DescribeApmServiceMetricRequest()
206
713
  model.from_json_string(json.dumps(args))
207
714
  start_time = time.time()
208
715
  while True:
209
- rsp = client.DescribeApmInstances(model)
716
+ rsp = client.DescribeApmServiceMetric(model)
210
717
  result = rsp.to_json_string()
211
718
  try:
212
719
  json_obj = json.loads(result)
@@ -225,7 +732,7 @@ def doDescribeApmInstances(args, parsed_globals):
225
732
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
733
 
227
734
 
228
- def doDescribeApmAgent(args, parsed_globals):
735
+ def doModifyApmPrometheusRule(args, parsed_globals):
229
736
  g_param = parse_global_arg(parsed_globals)
230
737
 
231
738
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -235,7 +742,10 @@ def doDescribeApmAgent(args, parsed_globals):
235
742
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
743
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
744
  )
238
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
745
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
746
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
747
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
748
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
239
749
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
240
750
  else:
241
751
  cred = credential.Credential(
@@ -247,18 +757,18 @@ def doDescribeApmAgent(args, parsed_globals):
247
757
  endpoint=g_param[OptionsDefine.Endpoint],
248
758
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
249
759
  )
250
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
760
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
251
761
  if g_param[OptionsDefine.Language]:
252
762
  profile.language = g_param[OptionsDefine.Language]
253
763
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
254
764
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
255
765
  client._sdkVersion += ("_CLI_" + __version__)
256
766
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.DescribeApmAgentRequest()
767
+ model = models.ModifyApmPrometheusRuleRequest()
258
768
  model.from_json_string(json.dumps(args))
259
769
  start_time = time.time()
260
770
  while True:
261
- rsp = client.DescribeApmAgent(model)
771
+ rsp = client.ModifyApmPrometheusRule(model)
262
772
  result = rsp.to_json_string()
263
773
  try:
264
774
  json_obj = json.loads(result)
@@ -277,7 +787,7 @@ def doDescribeApmAgent(args, parsed_globals):
277
787
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
788
 
279
789
 
280
- def doDescribeGeneralOTSpanList(args, parsed_globals):
790
+ def doCreateApmSampleConfig(args, parsed_globals):
281
791
  g_param = parse_global_arg(parsed_globals)
282
792
 
283
793
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -287,7 +797,10 @@ def doDescribeGeneralOTSpanList(args, parsed_globals):
287
797
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
798
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
799
  )
290
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
800
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
801
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
802
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
803
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
291
804
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
292
805
  else:
293
806
  cred = credential.Credential(
@@ -299,18 +812,18 @@ def doDescribeGeneralOTSpanList(args, parsed_globals):
299
812
  endpoint=g_param[OptionsDefine.Endpoint],
300
813
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
301
814
  )
302
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
815
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
303
816
  if g_param[OptionsDefine.Language]:
304
817
  profile.language = g_param[OptionsDefine.Language]
305
818
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
306
819
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
307
820
  client._sdkVersion += ("_CLI_" + __version__)
308
821
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
- model = models.DescribeGeneralOTSpanListRequest()
822
+ model = models.CreateApmSampleConfigRequest()
310
823
  model.from_json_string(json.dumps(args))
311
824
  start_time = time.time()
312
825
  while True:
313
- rsp = client.DescribeGeneralOTSpanList(model)
826
+ rsp = client.CreateApmSampleConfig(model)
314
827
  result = rsp.to_json_string()
315
828
  try:
316
829
  json_obj = json.loads(result)
@@ -329,7 +842,7 @@ def doDescribeGeneralOTSpanList(args, parsed_globals):
329
842
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
843
 
331
844
 
332
- def doModifyApmInstance(args, parsed_globals):
845
+ def doDescribeApmSampleConfig(args, parsed_globals):
333
846
  g_param = parse_global_arg(parsed_globals)
334
847
 
335
848
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -339,7 +852,10 @@ def doModifyApmInstance(args, parsed_globals):
339
852
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
853
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
854
  )
342
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
855
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
856
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
857
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
858
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
343
859
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
344
860
  else:
345
861
  cred = credential.Credential(
@@ -351,18 +867,18 @@ def doModifyApmInstance(args, parsed_globals):
351
867
  endpoint=g_param[OptionsDefine.Endpoint],
352
868
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
353
869
  )
354
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
870
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
355
871
  if g_param[OptionsDefine.Language]:
356
872
  profile.language = g_param[OptionsDefine.Language]
357
873
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
358
874
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
359
875
  client._sdkVersion += ("_CLI_" + __version__)
360
876
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
- model = models.ModifyApmInstanceRequest()
877
+ model = models.DescribeApmSampleConfigRequest()
362
878
  model.from_json_string(json.dumps(args))
363
879
  start_time = time.time()
364
880
  while True:
365
- rsp = client.ModifyApmInstance(model)
881
+ rsp = client.DescribeApmSampleConfig(model)
366
882
  result = rsp.to_json_string()
367
883
  try:
368
884
  json_obj = json.loads(result)
@@ -381,7 +897,7 @@ def doModifyApmInstance(args, parsed_globals):
381
897
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
898
 
383
899
 
384
- def doModifyGeneralApmApplicationConfig(args, parsed_globals):
900
+ def doDescribeTagValues(args, parsed_globals):
385
901
  g_param = parse_global_arg(parsed_globals)
386
902
 
387
903
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -391,7 +907,10 @@ def doModifyGeneralApmApplicationConfig(args, parsed_globals):
391
907
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
392
908
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
393
909
  )
394
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
910
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
911
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
912
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
913
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
395
914
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
396
915
  else:
397
916
  cred = credential.Credential(
@@ -403,18 +922,18 @@ def doModifyGeneralApmApplicationConfig(args, parsed_globals):
403
922
  endpoint=g_param[OptionsDefine.Endpoint],
404
923
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
405
924
  )
406
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
925
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
407
926
  if g_param[OptionsDefine.Language]:
408
927
  profile.language = g_param[OptionsDefine.Language]
409
928
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
410
929
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
411
930
  client._sdkVersion += ("_CLI_" + __version__)
412
931
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
413
- model = models.ModifyGeneralApmApplicationConfigRequest()
932
+ model = models.DescribeTagValuesRequest()
414
933
  model.from_json_string(json.dumps(args))
415
934
  start_time = time.time()
416
935
  while True:
417
- rsp = client.ModifyGeneralApmApplicationConfig(model)
936
+ rsp = client.DescribeTagValues(model)
418
937
  result = rsp.to_json_string()
419
938
  try:
420
939
  json_obj = json.loads(result)
@@ -433,7 +952,7 @@ def doModifyGeneralApmApplicationConfig(args, parsed_globals):
433
952
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
953
 
435
954
 
436
- def doDescribeGeneralMetricData(args, parsed_globals):
955
+ def doDescribeApmPrometheusRule(args, parsed_globals):
437
956
  g_param = parse_global_arg(parsed_globals)
438
957
 
439
958
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -443,7 +962,10 @@ def doDescribeGeneralMetricData(args, parsed_globals):
443
962
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
444
963
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
445
964
  )
446
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
965
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
966
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
967
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
968
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
447
969
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
448
970
  else:
449
971
  cred = credential.Credential(
@@ -455,18 +977,18 @@ def doDescribeGeneralMetricData(args, parsed_globals):
455
977
  endpoint=g_param[OptionsDefine.Endpoint],
456
978
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
457
979
  )
458
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
980
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
459
981
  if g_param[OptionsDefine.Language]:
460
982
  profile.language = g_param[OptionsDefine.Language]
461
983
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
462
984
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
463
985
  client._sdkVersion += ("_CLI_" + __version__)
464
986
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
- model = models.DescribeGeneralMetricDataRequest()
987
+ model = models.DescribeApmPrometheusRuleRequest()
466
988
  model.from_json_string(json.dumps(args))
467
989
  start_time = time.time()
468
990
  while True:
469
- rsp = client.DescribeGeneralMetricData(model)
991
+ rsp = client.DescribeApmPrometheusRule(model)
470
992
  result = rsp.to_json_string()
471
993
  try:
472
994
  json_obj = json.loads(result)
@@ -485,7 +1007,7 @@ def doDescribeGeneralMetricData(args, parsed_globals):
485
1007
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
1008
 
487
1009
 
488
- def doDescribeMetricRecords(args, parsed_globals):
1010
+ def doDescribeApmInstances(args, parsed_globals):
489
1011
  g_param = parse_global_arg(parsed_globals)
490
1012
 
491
1013
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -495,7 +1017,10 @@ def doDescribeMetricRecords(args, parsed_globals):
495
1017
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
496
1018
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
497
1019
  )
498
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1020
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1021
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1022
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1023
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
499
1024
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
500
1025
  else:
501
1026
  cred = credential.Credential(
@@ -507,18 +1032,18 @@ def doDescribeMetricRecords(args, parsed_globals):
507
1032
  endpoint=g_param[OptionsDefine.Endpoint],
508
1033
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
509
1034
  )
510
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1035
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
511
1036
  if g_param[OptionsDefine.Language]:
512
1037
  profile.language = g_param[OptionsDefine.Language]
513
1038
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
514
1039
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
515
1040
  client._sdkVersion += ("_CLI_" + __version__)
516
1041
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
517
- model = models.DescribeMetricRecordsRequest()
1042
+ model = models.DescribeApmInstancesRequest()
518
1043
  model.from_json_string(json.dumps(args))
519
1044
  start_time = time.time()
520
1045
  while True:
521
- rsp = client.DescribeMetricRecords(model)
1046
+ rsp = client.DescribeApmInstances(model)
522
1047
  result = rsp.to_json_string()
523
1048
  try:
524
1049
  json_obj = json.loads(result)
@@ -537,7 +1062,7 @@ def doDescribeMetricRecords(args, parsed_globals):
537
1062
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
1063
 
539
1064
 
540
- def doTerminateApmInstance(args, parsed_globals):
1065
+ def doDeleteApmSampleConfig(args, parsed_globals):
541
1066
  g_param = parse_global_arg(parsed_globals)
542
1067
 
543
1068
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -547,7 +1072,10 @@ def doTerminateApmInstance(args, parsed_globals):
547
1072
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
1073
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
1074
  )
550
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1075
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1076
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1077
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1078
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
551
1079
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
1080
  else:
553
1081
  cred = credential.Credential(
@@ -559,18 +1087,18 @@ def doTerminateApmInstance(args, parsed_globals):
559
1087
  endpoint=g_param[OptionsDefine.Endpoint],
560
1088
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
1089
  )
562
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1090
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
563
1091
  if g_param[OptionsDefine.Language]:
564
1092
  profile.language = g_param[OptionsDefine.Language]
565
1093
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
1094
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
567
1095
  client._sdkVersion += ("_CLI_" + __version__)
568
1096
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
- model = models.TerminateApmInstanceRequest()
1097
+ model = models.DeleteApmSampleConfigRequest()
570
1098
  model.from_json_string(json.dumps(args))
571
1099
  start_time = time.time()
572
1100
  while True:
573
- rsp = client.TerminateApmInstance(model)
1101
+ rsp = client.DeleteApmSampleConfig(model)
574
1102
  result = rsp.to_json_string()
575
1103
  try:
576
1104
  json_obj = json.loads(result)
@@ -589,7 +1117,7 @@ def doTerminateApmInstance(args, parsed_globals):
589
1117
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
1118
 
591
1119
 
592
- def doCreateApmInstance(args, parsed_globals):
1120
+ def doCreateProfileTask(args, parsed_globals):
593
1121
  g_param = parse_global_arg(parsed_globals)
594
1122
 
595
1123
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -599,7 +1127,10 @@ def doCreateApmInstance(args, parsed_globals):
599
1127
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
600
1128
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
601
1129
  )
602
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1130
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1131
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1132
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1133
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
603
1134
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
604
1135
  else:
605
1136
  cred = credential.Credential(
@@ -611,18 +1142,238 @@ def doCreateApmInstance(args, parsed_globals):
611
1142
  endpoint=g_param[OptionsDefine.Endpoint],
612
1143
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
613
1144
  )
614
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1145
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
615
1146
  if g_param[OptionsDefine.Language]:
616
1147
  profile.language = g_param[OptionsDefine.Language]
617
1148
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
618
1149
  client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
619
1150
  client._sdkVersion += ("_CLI_" + __version__)
620
1151
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
- model = models.CreateApmInstanceRequest()
1152
+ model = models.CreateProfileTaskRequest()
622
1153
  model.from_json_string(json.dumps(args))
623
1154
  start_time = time.time()
624
1155
  while True:
625
- rsp = client.CreateApmInstance(model)
1156
+ rsp = client.CreateProfileTask(model)
1157
+ result = rsp.to_json_string()
1158
+ try:
1159
+ json_obj = json.loads(result)
1160
+ except TypeError as e:
1161
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1162
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1163
+ break
1164
+ cur_time = time.time()
1165
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1166
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1167
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1168
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1169
+ else:
1170
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1171
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1172
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1173
+
1174
+
1175
+ def doDescribeApmApplicationConfig(args, parsed_globals):
1176
+ g_param = parse_global_arg(parsed_globals)
1177
+
1178
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1179
+ cred = credential.CVMRoleCredential()
1180
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1181
+ cred = credential.STSAssumeRoleCredential(
1182
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1183
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1184
+ )
1185
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1186
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1187
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1188
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1189
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1190
+ else:
1191
+ cred = credential.Credential(
1192
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1193
+ )
1194
+ http_profile = HttpProfile(
1195
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1196
+ reqMethod="POST",
1197
+ endpoint=g_param[OptionsDefine.Endpoint],
1198
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1199
+ )
1200
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
1201
+ if g_param[OptionsDefine.Language]:
1202
+ profile.language = g_param[OptionsDefine.Language]
1203
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1204
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
1205
+ client._sdkVersion += ("_CLI_" + __version__)
1206
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1207
+ model = models.DescribeApmApplicationConfigRequest()
1208
+ model.from_json_string(json.dumps(args))
1209
+ start_time = time.time()
1210
+ while True:
1211
+ rsp = client.DescribeApmApplicationConfig(model)
1212
+ result = rsp.to_json_string()
1213
+ try:
1214
+ json_obj = json.loads(result)
1215
+ except TypeError as e:
1216
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1217
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1218
+ break
1219
+ cur_time = time.time()
1220
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1221
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1222
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1223
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1224
+ else:
1225
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1226
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1227
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1228
+
1229
+
1230
+ def doModifyGeneralApmApplicationConfig(args, parsed_globals):
1231
+ g_param = parse_global_arg(parsed_globals)
1232
+
1233
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1234
+ cred = credential.CVMRoleCredential()
1235
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1236
+ cred = credential.STSAssumeRoleCredential(
1237
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1238
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1239
+ )
1240
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1241
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1242
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1243
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1244
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1245
+ else:
1246
+ cred = credential.Credential(
1247
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1248
+ )
1249
+ http_profile = HttpProfile(
1250
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1251
+ reqMethod="POST",
1252
+ endpoint=g_param[OptionsDefine.Endpoint],
1253
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1254
+ )
1255
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
1256
+ if g_param[OptionsDefine.Language]:
1257
+ profile.language = g_param[OptionsDefine.Language]
1258
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1259
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
1260
+ client._sdkVersion += ("_CLI_" + __version__)
1261
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1262
+ model = models.ModifyGeneralApmApplicationConfigRequest()
1263
+ model.from_json_string(json.dumps(args))
1264
+ start_time = time.time()
1265
+ while True:
1266
+ rsp = client.ModifyGeneralApmApplicationConfig(model)
1267
+ result = rsp.to_json_string()
1268
+ try:
1269
+ json_obj = json.loads(result)
1270
+ except TypeError as e:
1271
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1272
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1273
+ break
1274
+ cur_time = time.time()
1275
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1276
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1277
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1278
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1279
+ else:
1280
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1281
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1282
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1283
+
1284
+
1285
+ def doDescribeMetricRecords(args, parsed_globals):
1286
+ g_param = parse_global_arg(parsed_globals)
1287
+
1288
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1289
+ cred = credential.CVMRoleCredential()
1290
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1291
+ cred = credential.STSAssumeRoleCredential(
1292
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1293
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1294
+ )
1295
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1296
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1297
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1298
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1299
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1300
+ else:
1301
+ cred = credential.Credential(
1302
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1303
+ )
1304
+ http_profile = HttpProfile(
1305
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1306
+ reqMethod="POST",
1307
+ endpoint=g_param[OptionsDefine.Endpoint],
1308
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1309
+ )
1310
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
1311
+ if g_param[OptionsDefine.Language]:
1312
+ profile.language = g_param[OptionsDefine.Language]
1313
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1314
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
1315
+ client._sdkVersion += ("_CLI_" + __version__)
1316
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1317
+ model = models.DescribeMetricRecordsRequest()
1318
+ model.from_json_string(json.dumps(args))
1319
+ start_time = time.time()
1320
+ while True:
1321
+ rsp = client.DescribeMetricRecords(model)
1322
+ result = rsp.to_json_string()
1323
+ try:
1324
+ json_obj = json.loads(result)
1325
+ except TypeError as e:
1326
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1327
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1328
+ break
1329
+ cur_time = time.time()
1330
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1331
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1332
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1333
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1334
+ else:
1335
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1336
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1337
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1338
+
1339
+
1340
+ def doModifyApmApplicationConfig(args, parsed_globals):
1341
+ g_param = parse_global_arg(parsed_globals)
1342
+
1343
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1344
+ cred = credential.CVMRoleCredential()
1345
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1346
+ cred = credential.STSAssumeRoleCredential(
1347
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1348
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1349
+ )
1350
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1351
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1352
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1353
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1354
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1355
+ else:
1356
+ cred = credential.Credential(
1357
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1358
+ )
1359
+ http_profile = HttpProfile(
1360
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1361
+ reqMethod="POST",
1362
+ endpoint=g_param[OptionsDefine.Endpoint],
1363
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1364
+ )
1365
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
1366
+ if g_param[OptionsDefine.Language]:
1367
+ profile.language = g_param[OptionsDefine.Language]
1368
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1369
+ client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
1370
+ client._sdkVersion += ("_CLI_" + __version__)
1371
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1372
+ model = models.ModifyApmApplicationConfigRequest()
1373
+ model.from_json_string(json.dumps(args))
1374
+ start_time = time.time()
1375
+ while True:
1376
+ rsp = client.ModifyApmApplicationConfig(model)
626
1377
  result = rsp.to_json_string()
627
1378
  try:
628
1379
  json_obj = json.loads(result)
@@ -651,7 +1402,10 @@ def doDescribeServiceOverview(args, parsed_globals):
651
1402
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
1403
  g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
1404
  )
654
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1405
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
1406
+ and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
1407
+ and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
1408
+ and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
655
1409
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
656
1410
  else:
657
1411
  cred = credential.Credential(
@@ -663,7 +1417,7 @@ def doDescribeServiceOverview(args, parsed_globals):
663
1417
  endpoint=g_param[OptionsDefine.Endpoint],
664
1418
  proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
665
1419
  )
666
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1420
+ profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
667
1421
  if g_param[OptionsDefine.Language]:
668
1422
  profile.language = g_param[OptionsDefine.Language]
669
1423
  mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
@@ -704,18 +1458,31 @@ MODELS_MAP = {
704
1458
  }
705
1459
 
706
1460
  ACTION_MAP = {
1461
+ "ModifyApmInstance": doModifyApmInstance,
1462
+ "DescribeGeneralSpanList": doDescribeGeneralSpanList,
1463
+ "DescribeGeneralOTSpanList": doDescribeGeneralOTSpanList,
1464
+ "CreateApmInstance": doCreateApmInstance,
707
1465
  "DescribeGeneralApmApplicationConfig": doDescribeGeneralApmApplicationConfig,
1466
+ "ModifyApmAssociation": doModifyApmAssociation,
1467
+ "ModifyApmSampleConfig": doModifyApmSampleConfig,
1468
+ "DescribeApmAgent": doDescribeApmAgent,
1469
+ "DescribeGeneralMetricData": doDescribeGeneralMetricData,
1470
+ "CreateApmPrometheusRule": doCreateApmPrometheusRule,
1471
+ "TerminateApmInstance": doTerminateApmInstance,
1472
+ "DescribeApmAssociation": doDescribeApmAssociation,
1473
+ "DescribeApmServiceMetric": doDescribeApmServiceMetric,
1474
+ "ModifyApmPrometheusRule": doModifyApmPrometheusRule,
1475
+ "CreateApmSampleConfig": doCreateApmSampleConfig,
1476
+ "DescribeApmSampleConfig": doDescribeApmSampleConfig,
708
1477
  "DescribeTagValues": doDescribeTagValues,
709
- "DescribeGeneralSpanList": doDescribeGeneralSpanList,
1478
+ "DescribeApmPrometheusRule": doDescribeApmPrometheusRule,
710
1479
  "DescribeApmInstances": doDescribeApmInstances,
711
- "DescribeApmAgent": doDescribeApmAgent,
712
- "DescribeGeneralOTSpanList": doDescribeGeneralOTSpanList,
713
- "ModifyApmInstance": doModifyApmInstance,
1480
+ "DeleteApmSampleConfig": doDeleteApmSampleConfig,
1481
+ "CreateProfileTask": doCreateProfileTask,
1482
+ "DescribeApmApplicationConfig": doDescribeApmApplicationConfig,
714
1483
  "ModifyGeneralApmApplicationConfig": doModifyGeneralApmApplicationConfig,
715
- "DescribeGeneralMetricData": doDescribeGeneralMetricData,
716
1484
  "DescribeMetricRecords": doDescribeMetricRecords,
717
- "TerminateApmInstance": doTerminateApmInstance,
718
- "CreateApmInstance": doCreateApmInstance,
1485
+ "ModifyApmApplicationConfig": doModifyApmApplicationConfig,
719
1486
  "DescribeServiceOverview": doDescribeServiceOverview,
720
1487
 
721
1488
  }