tccli 3.0.898.1__py2.py3-none-any.whl → 3.0.899.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cfs/v20190719/CreateMigrationTask.md +1 -1
  3. tccli/examples/cfs/v20190719/DeleteMigrationTask.md +1 -1
  4. tccli/examples/cfs/v20190719/ModifyFileSystemAutoScaleUpRule.md +1 -1
  5. tccli/examples/cfs/v20190719/ScaleUpFileSystem.md +1 -1
  6. tccli/examples/cls/v20201016/DeleteShipper.md +2 -2
  7. tccli/examples/cls/v20201016/ModifyShipper.md +2 -2
  8. tccli/examples/live/v20180801/DescribeLiveDomains.md +1 -1
  9. tccli/examples/nlp/v20190408/AnalyzeSentiment.md +24 -0
  10. tccli/examples/nlp/v20190408/ClassifyContent.md +39 -0
  11. tccli/examples/nlp/v20190408/ComposeCouplet.md +27 -0
  12. tccli/examples/nlp/v20190408/ComposePoetry.md +29 -0
  13. tccli/examples/waf/v20180125/ModifySpartaProtection.md +154 -0
  14. tccli/examples/wedata/v20210820/DescribeDimensionScore.md +15 -3
  15. tccli/examples/wedata/v20210820/DescribeQualityScore.md +1 -1
  16. tccli/examples/wedata/v20210820/DescribeQualityScoreTrend.md +10 -2
  17. tccli/examples/wedata/v20210820/DescribeTableQualityDetails.md +1 -1
  18. tccli/examples/wedata/v20210820/DescribeTableScoreTrend.md +10 -2
  19. tccli/services/antiddos/v20200309/api.json +45 -26
  20. tccli/services/apigateway/v20180808/api.json +17 -28
  21. tccli/services/asr/v20190614/api.json +3 -2
  22. tccli/services/cdb/v20170320/api.json +16 -11
  23. tccli/services/cfs/v20190719/api.json +7 -0
  24. tccli/services/cfs/v20190719/examples.json +4 -4
  25. tccli/services/ckafka/v20190819/api.json +20 -8
  26. tccli/services/cls/v20201016/api.json +3 -4
  27. tccli/services/cls/v20201016/examples.json +4 -4
  28. tccli/services/ess/v20201111/api.json +2 -0
  29. tccli/services/live/v20180801/api.json +4 -11
  30. tccli/services/live/v20180801/examples.json +1 -1
  31. tccli/services/nlp/nlp_client.py +216 -4
  32. tccli/services/nlp/v20190408/api.json +329 -0
  33. tccli/services/nlp/v20190408/examples.json +32 -0
  34. tccli/services/tbaas/v20180416/api.json +16 -16
  35. tccli/services/tdid/tdid_client.py +0 -106
  36. tccli/services/tdid/v20210519/api.json +25 -306
  37. tccli/services/tdid/v20210519/examples.json +0 -16
  38. tccli/services/tts/v20190823/api.json +7 -3
  39. tccli/services/waf/v20180125/api.json +401 -0
  40. tccli/services/waf/v20180125/examples.json +26 -0
  41. tccli/services/waf/waf_client.py +57 -4
  42. tccli/services/wedata/v20210820/api.json +151 -83
  43. tccli/services/wedata/v20210820/examples.json +8 -8
  44. {tccli-3.0.898.1.dist-info → tccli-3.0.899.1.dist-info}/METADATA +2 -2
  45. {tccli-3.0.898.1.dist-info → tccli-3.0.899.1.dist-info}/RECORD +48 -43
  46. {tccli-3.0.898.1.dist-info → tccli-3.0.899.1.dist-info}/WHEEL +0 -0
  47. {tccli-3.0.898.1.dist-info → tccli-3.0.899.1.dist-info}/entry_points.txt +0 -0
  48. {tccli-3.0.898.1.dist-info → tccli-3.0.899.1.dist-info}/license_files/LICENSE +0 -0
@@ -294,6 +294,13 @@
294
294
  "output": "ModifyDomainWhiteRuleResponse",
295
295
  "status": "online"
296
296
  },
297
+ "ModifySpartaProtection": {
298
+ "document": "修改域名配置",
299
+ "input": "ModifySpartaProtectionRequest",
300
+ "name": "修改域名配置",
301
+ "output": "ModifySpartaProtectionResponse",
302
+ "status": "online"
303
+ },
297
304
  "ModifyWafAutoDenyRules": {
298
305
  "document": "修改ip惩罚规则",
299
306
  "input": "ModifyWafAutoDenyRulesRequest",
@@ -6268,6 +6275,344 @@
6268
6275
  ],
6269
6276
  "type": "object"
6270
6277
  },
6278
+ "ModifySpartaProtectionRequest": {
6279
+ "document": "ModifySpartaProtection请求参数结构体",
6280
+ "members": [
6281
+ {
6282
+ "default": "",
6283
+ "disabled": false,
6284
+ "document": "域名",
6285
+ "example": "www.test.com",
6286
+ "member": "string",
6287
+ "name": "Domain",
6288
+ "required": true,
6289
+ "type": "string"
6290
+ },
6291
+ {
6292
+ "default": "",
6293
+ "disabled": false,
6294
+ "document": "域名ID",
6295
+ "example": "s2dfd342dfd34423sdfs",
6296
+ "member": "string",
6297
+ "name": "DomainId",
6298
+ "required": false,
6299
+ "type": "string"
6300
+ },
6301
+ {
6302
+ "default": "",
6303
+ "disabled": false,
6304
+ "document": "证书类型,0表示没有证书,CertType=1表示自有证书,2 为托管证书",
6305
+ "example": "0",
6306
+ "member": "int64",
6307
+ "name": "CertType",
6308
+ "required": false,
6309
+ "type": "int"
6310
+ },
6311
+ {
6312
+ "default": "",
6313
+ "disabled": false,
6314
+ "document": "CertType=1时,需要填次参数,表示证书内容",
6315
+ "example": "sdfdfdf",
6316
+ "member": "string",
6317
+ "name": "Cert",
6318
+ "required": false,
6319
+ "type": "string"
6320
+ },
6321
+ {
6322
+ "default": "",
6323
+ "disabled": false,
6324
+ "document": "CertType=1时,需要填次参数,表示证书的私钥",
6325
+ "example": "sdfsdfs",
6326
+ "member": "string",
6327
+ "name": "PrivateKey",
6328
+ "required": false,
6329
+ "type": "string"
6330
+ },
6331
+ {
6332
+ "default": "",
6333
+ "disabled": false,
6334
+ "document": "CertType=2时,需要填次参数,表示证书的ID",
6335
+ "example": "3434",
6336
+ "member": "string",
6337
+ "name": "SSLId",
6338
+ "required": false,
6339
+ "type": "string"
6340
+ },
6341
+ {
6342
+ "default": "",
6343
+ "disabled": false,
6344
+ "document": "表示是否开启了CDN代理",
6345
+ "example": "0",
6346
+ "member": "int64",
6347
+ "name": "IsCdn",
6348
+ "required": false,
6349
+ "type": "int"
6350
+ },
6351
+ {
6352
+ "default": "",
6353
+ "disabled": false,
6354
+ "document": "HTTPS回源协议",
6355
+ "example": "https",
6356
+ "member": "string",
6357
+ "name": "UpstreamScheme",
6358
+ "required": false,
6359
+ "type": "string"
6360
+ },
6361
+ {
6362
+ "default": "",
6363
+ "disabled": false,
6364
+ "document": "HTTPS回源端口,仅UpstreamScheme为http时需要填当前字段",
6365
+ "example": "\"80,443\"",
6366
+ "member": "string",
6367
+ "name": "HttpsUpstreamPort",
6368
+ "required": false,
6369
+ "type": "string"
6370
+ },
6371
+ {
6372
+ "default": "",
6373
+ "disabled": false,
6374
+ "document": "表示是否强制跳转到HTTPS,1表示开启,0表示不开启",
6375
+ "example": "1",
6376
+ "member": "uint64",
6377
+ "name": "HttpsRewrite",
6378
+ "required": false,
6379
+ "type": "int"
6380
+ },
6381
+ {
6382
+ "default": "",
6383
+ "disabled": false,
6384
+ "document": "回源类型,0表示通过IP回源,1 表示通过域名回源",
6385
+ "example": "0",
6386
+ "member": "int64",
6387
+ "name": "UpstreamType",
6388
+ "required": false,
6389
+ "type": "int"
6390
+ },
6391
+ {
6392
+ "default": "",
6393
+ "disabled": false,
6394
+ "document": "UpstreamType=1时,填次字段表示回源域名",
6395
+ "example": "www.qq.com",
6396
+ "member": "string",
6397
+ "name": "UpstreamDomain",
6398
+ "required": false,
6399
+ "type": "string"
6400
+ },
6401
+ {
6402
+ "default": "",
6403
+ "disabled": false,
6404
+ "document": "UpstreamType=0时,填次字段表示回源ip",
6405
+ "example": "[\"1.1.1.1\\n\"]",
6406
+ "member": "string",
6407
+ "name": "SrcList",
6408
+ "required": false,
6409
+ "type": "list"
6410
+ },
6411
+ {
6412
+ "default": "",
6413
+ "disabled": false,
6414
+ "document": "是否开启HTTP2,1表示开启,0表示不开启http2。开启HTTP2需要HTTPS支持",
6415
+ "example": "0",
6416
+ "member": "int64",
6417
+ "name": "IsHttp2",
6418
+ "required": false,
6419
+ "type": "int"
6420
+ },
6421
+ {
6422
+ "default": "",
6423
+ "disabled": false,
6424
+ "document": "是否开启WebSocket, 1:开启WebSocket,0:不开启WebSocket",
6425
+ "example": "0",
6426
+ "member": "int64",
6427
+ "name": "IsWebsocket",
6428
+ "required": false,
6429
+ "type": "int"
6430
+ },
6431
+ {
6432
+ "default": "",
6433
+ "disabled": false,
6434
+ "document": "负载均衡策略,0表示轮徇,1表示IP hash",
6435
+ "example": "0",
6436
+ "member": "int64",
6437
+ "name": "LoadBalance",
6438
+ "required": false,
6439
+ "type": "int"
6440
+ },
6441
+ {
6442
+ "default": "",
6443
+ "disabled": false,
6444
+ "document": "是否灰度",
6445
+ "example": "0",
6446
+ "member": "int64",
6447
+ "name": "IsGray",
6448
+ "required": false,
6449
+ "type": "int"
6450
+ },
6451
+ {
6452
+ "default": "",
6453
+ "disabled": false,
6454
+ "document": "WAF版本",
6455
+ "example": "sparta-waf",
6456
+ "member": "string",
6457
+ "name": "Edition",
6458
+ "required": false,
6459
+ "type": "string"
6460
+ },
6461
+ {
6462
+ "default": "",
6463
+ "disabled": false,
6464
+ "document": "端口信息",
6465
+ "example": "无",
6466
+ "member": "SpartaProtectionPort",
6467
+ "name": "Ports",
6468
+ "required": false,
6469
+ "type": "list"
6470
+ },
6471
+ {
6472
+ "default": "",
6473
+ "disabled": false,
6474
+ "document": "长短连接标志,仅IP回源时有效",
6475
+ "example": "1",
6476
+ "member": "string",
6477
+ "name": "IsKeepAlive",
6478
+ "required": false,
6479
+ "type": "string"
6480
+ },
6481
+ {
6482
+ "default": "",
6483
+ "disabled": false,
6484
+ "document": "实例id",
6485
+ "example": "waf-sdjfksl",
6486
+ "member": "string",
6487
+ "name": "InstanceID",
6488
+ "required": false,
6489
+ "type": "string"
6490
+ },
6491
+ {
6492
+ "default": "",
6493
+ "disabled": false,
6494
+ "document": "是否为Anycast ip类型:1 Anycast 0 普通ip",
6495
+ "example": "0",
6496
+ "member": "int64",
6497
+ "name": "Anycast",
6498
+ "required": false,
6499
+ "type": "int"
6500
+ },
6501
+ {
6502
+ "default": "",
6503
+ "disabled": false,
6504
+ "document": "src的权重",
6505
+ "example": "[1.1.1]",
6506
+ "member": "int64",
6507
+ "name": "Weights",
6508
+ "required": false,
6509
+ "type": "list"
6510
+ },
6511
+ {
6512
+ "default": "",
6513
+ "disabled": false,
6514
+ "document": "是否开启源站的主动健康检测,1表示开启,0表示不开启",
6515
+ "example": "0",
6516
+ "member": "int64",
6517
+ "name": "ActiveCheck",
6518
+ "required": false,
6519
+ "type": "int"
6520
+ },
6521
+ {
6522
+ "default": "",
6523
+ "disabled": false,
6524
+ "document": "TLS版本信息",
6525
+ "example": "0",
6526
+ "member": "int64",
6527
+ "name": "TLSVersion",
6528
+ "required": false,
6529
+ "type": "int"
6530
+ },
6531
+ {
6532
+ "default": "",
6533
+ "disabled": false,
6534
+ "document": "加密套件信息",
6535
+ "example": "[0,1]",
6536
+ "member": "int64",
6537
+ "name": "Ciphers",
6538
+ "required": false,
6539
+ "type": "list"
6540
+ },
6541
+ {
6542
+ "default": "",
6543
+ "disabled": false,
6544
+ "document": "0:不支持选择:默认模版 1:通用型模版 2:安全型模版 3:自定义模版",
6545
+ "example": "0",
6546
+ "member": "int64",
6547
+ "name": "CipherTemplate",
6548
+ "required": false,
6549
+ "type": "int"
6550
+ },
6551
+ {
6552
+ "default": "",
6553
+ "disabled": false,
6554
+ "document": "300s",
6555
+ "example": "300",
6556
+ "member": "int64",
6557
+ "name": "ProxyReadTimeout",
6558
+ "required": false,
6559
+ "type": "int"
6560
+ },
6561
+ {
6562
+ "default": "",
6563
+ "disabled": false,
6564
+ "document": "300s",
6565
+ "example": "300",
6566
+ "member": "int64",
6567
+ "name": "ProxySendTimeout",
6568
+ "required": false,
6569
+ "type": "int"
6570
+ },
6571
+ {
6572
+ "default": "",
6573
+ "disabled": false,
6574
+ "document": "0:关闭SNI;1:开启SNI,SNI=源请求host;2:开启SNI,SNI=修改为源站host;3:开启SNI,自定义host,SNI=SniHost;",
6575
+ "example": "1",
6576
+ "member": "int64",
6577
+ "name": "SniType",
6578
+ "required": false,
6579
+ "type": "int"
6580
+ },
6581
+ {
6582
+ "default": "",
6583
+ "disabled": false,
6584
+ "document": "SniType=3时,需要填此参数,表示自定义的host;",
6585
+ "example": "test.com",
6586
+ "member": "string",
6587
+ "name": "SniHost",
6588
+ "required": false,
6589
+ "type": "string"
6590
+ },
6591
+ {
6592
+ "default": "",
6593
+ "disabled": false,
6594
+ "document": "IsCdn=3时,需要填此参数,表示自定义header",
6595
+ "example": "[\"x-real-ip\"]",
6596
+ "member": "string",
6597
+ "name": "IpHeaders",
6598
+ "required": false,
6599
+ "type": "list"
6600
+ }
6601
+ ],
6602
+ "type": "object"
6603
+ },
6604
+ "ModifySpartaProtectionResponse": {
6605
+ "document": "ModifySpartaProtection返回参数结构体",
6606
+ "members": [
6607
+ {
6608
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
6609
+ "member": "string",
6610
+ "name": "RequestId",
6611
+ "type": "string"
6612
+ }
6613
+ ],
6614
+ "type": "object"
6615
+ },
6271
6616
  "ModifyWafAutoDenyRulesRequest": {
6272
6617
  "document": "ModifyWafAutoDenyRules请求参数结构体",
6273
6618
  "members": [
@@ -7211,6 +7556,62 @@
7211
7556
  ],
7212
7557
  "type": "object"
7213
7558
  },
7559
+ "SpartaProtectionPort": {
7560
+ "document": "waf斯巴达-编辑防护域名中的端口结构",
7561
+ "members": [
7562
+ {
7563
+ "default": "",
7564
+ "disabled": false,
7565
+ "document": "nginx Id",
7566
+ "member": "uint64",
7567
+ "name": "NginxServerId",
7568
+ "required": true,
7569
+ "type": "int",
7570
+ "value_allowed_null": false
7571
+ },
7572
+ {
7573
+ "default": "",
7574
+ "disabled": false,
7575
+ "document": "端口",
7576
+ "member": "string",
7577
+ "name": "Port",
7578
+ "required": true,
7579
+ "type": "string",
7580
+ "value_allowed_null": false
7581
+ },
7582
+ {
7583
+ "default": "",
7584
+ "disabled": false,
7585
+ "document": "协议",
7586
+ "member": "string",
7587
+ "name": "Protocol",
7588
+ "required": true,
7589
+ "type": "string",
7590
+ "value_allowed_null": false
7591
+ },
7592
+ {
7593
+ "default": "",
7594
+ "disabled": false,
7595
+ "document": "后端端口",
7596
+ "member": "string",
7597
+ "name": "UpstreamPort",
7598
+ "required": true,
7599
+ "type": "string",
7600
+ "value_allowed_null": false
7601
+ },
7602
+ {
7603
+ "default": "",
7604
+ "disabled": false,
7605
+ "document": "后端协议",
7606
+ "member": "string",
7607
+ "name": "UpstreamProtocol",
7608
+ "required": true,
7609
+ "type": "string",
7610
+ "value_allowed_null": false
7611
+ }
7612
+ ],
7613
+ "usage": "in"
7614
+ },
7214
7615
  "Strategy": {
7215
7616
  "document": "自定义规则的匹配条件结构体",
7216
7617
  "members": [
@@ -354,6 +354,32 @@
354
354
  "title": "更改某一条规则"
355
355
  }
356
356
  ],
357
+ "ModifySpartaProtection": [
358
+ {
359
+ "document": "",
360
+ "input": "POST / HTTP/1.1\nHost: waf.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifySpartaProtection\n<公共请求参数>\n\n{\n \"Domain\": \"www.test.com\",\n \"LoadBalance\": \"0\",\n \"UpstreamType\": \"0\",\n \"CertType\": \"0\",\n \"Ports\": [\n {\n \"NginxServerId\": \"0\",\n \"Protocol\": \"http\",\n \"Port\": \"80\",\n \"UpstreamPort\": \"80\",\n \"UpstreamProtocol\": \"http\"\n }\n ],\n \"SrcList\": [\n \"1.1.1.1\"\n ],\n \"IsCdn\": \"0\",\n \"IsWebsocket\": \"0\",\n \"IsGray\": \"0\",\n \"IsHttp2\": \"0\"\n}",
361
+ "output": "{\n \"Response\": {\n \"RequestId\": \"9ee8be5b-6caa-4c39-ab70-890e0e673515\"\n }\n}",
362
+ "title": "修改域名配置"
363
+ },
364
+ {
365
+ "document": "",
366
+ "input": "POST / HTTP/1.1\nHost: waf.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifySpartaProtection\n<公共请求参数>\n\n{\n \"Domain\": \"lucas0407-1.qcloudwaf.com\",\n \"LoadBalance\": \"0\",\n \"InstanceID\": \"waf_2kuj60v200b09bsr\",\n \"UpstreamType\": \"0\",\n \"IsWebsocket\": \"0\",\n \"IsHttp2\": \"0\",\n \"SrcList\": [\n \"11.148.84.137\"\n ],\n \"CertType\": \"0\",\n \"DomainId\": \"eb454223185451fe8b255a82b9d4bf94\",\n \"Weights\": [\n \"100\"\n ],\n \"IsKeepAlive\": \"1\",\n \"IsCdn\": \"1\",\n \"IsGray\": \"0\",\n \"Anycast\": \"0\",\n \"Ports\": [\n {\n \"NginxServerId\": \"62094\",\n \"Protocol\": \"http\",\n \"Port\": \"80\",\n \"UpstreamPort\": \"80\",\n \"UpstreamProtocol\": \"http\"\n }\n ],\n \"ActiveCheck\": \"1\"\n}",
367
+ "output": "{\n \"Response\": {\n \"RequestId\": \"9c553d61-526a-44cf-a874-b24956033973\"\n }\n}",
368
+ "title": "修改域名接入配置"
369
+ },
370
+ {
371
+ "document": "",
372
+ "input": "POST / HTTP/1.1\nHost: waf.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifySpartaProtection\n<公共请求参数>\n\n{\n \"IsGray\": \"0\",\n \"Domain\": \"lucas0407-1.qcloudwaf.com\",\n \"LoadBalance\": \"0\",\n \"CipherTemplate\": \"0\",\n \"InstanceID\": \"waf_2kuj60v200b09bsr\",\n \"UpstreamType\": \"0\",\n \"IsWebsocket\": \"0\",\n \"IsHttp2\": \"0\",\n \"SrcList\": [\n \"114.132.223.23\"\n ],\n \"CertType\": \"0\",\n \"DomainId\": \"eb454223185451fe8b255a82b9d4bf94\",\n \"Weights\": [\n \"100\"\n ],\n \"IsKeepAlive\": \"1\",\n \"IsCdn\": \"1\",\n \"TLSVersion\": \"3\",\n \"Anycast\": \"0\",\n \"Ports\": [\n {\n \"NginxServerId\": \"62094\",\n \"Protocol\": \"http\",\n \"Port\": \"80\",\n \"UpstreamPort\": \"80\",\n \"UpstreamProtocol\": \"http\"\n }\n ],\n \"ActiveCheck\": \"1\"\n}",
373
+ "output": "{\n \"Response\": {\n \"RequestId\": \"13b8a309-3e7d-4393-91a4-271bf6d5dd71\"\n }\n}",
374
+ "title": "ts"
375
+ },
376
+ {
377
+ "document": "",
378
+ "input": "POST / HTTP/1.1\nHost: waf.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifySpartaProtection\n<公共请求参数>\n\n{\n \"IsGray\": \"0\",\n \"Domain\": \"lucas0919.qcloudwaf.com\",\n \"LoadBalance\": \"0\",\n \"CipherTemplate\": \"0\",\n \"InstanceID\": \"lucas\",\n \"UpstreamType\": \"0\",\n \"IsWebsocket\": \"0\",\n \"IsHttp2\": \"0\",\n \"SrcList\": [\n \"114.132.223.23\"\n ],\n \"CertType\": \"0\",\n \"DomainId\": \"e801733b69605960a17388999868512a\",\n \"Weights\": [\n \"100\"\n ],\n \"IsKeepAlive\": \"1\",\n \"IsCdn\": \"1\",\n \"TLSVersion\": \"3\",\n \"Anycast\": \"0\",\n \"Ports\": [\n {\n \"NginxServerId\": \"63953\",\n \"Protocol\": \"http\",\n \"Port\": \"80\",\n \"UpstreamPort\": \"80\",\n \"UpstreamProtocol\": \"http\"\n }\n ],\n \"ActiveCheck\": \"1\"\n}",
379
+ "output": "{\n \"Response\": {\n \"RequestId\": \"d6bd6f14-926e-4a3e-9a34-bb1dd7d9a51d\"\n }\n}",
380
+ "title": "Modify-Host-1"
381
+ }
382
+ ],
357
383
  "ModifyWafAutoDenyRules": [
358
384
  {
359
385
  "document": "修改ip惩罚配置",
@@ -1577,6 +1577,58 @@ def doModifyWafThreatenIntelligence(args, parsed_globals):
1577
1577
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1578
1578
 
1579
1579
 
1580
+ def doDescribeAttackOverview(args, parsed_globals):
1581
+ g_param = parse_global_arg(parsed_globals)
1582
+
1583
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1584
+ cred = credential.CVMRoleCredential()
1585
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1586
+ cred = credential.STSAssumeRoleCredential(
1587
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1588
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1589
+ )
1590
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1591
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1592
+ else:
1593
+ cred = credential.Credential(
1594
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1595
+ )
1596
+ http_profile = HttpProfile(
1597
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1598
+ reqMethod="POST",
1599
+ endpoint=g_param[OptionsDefine.Endpoint],
1600
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1601
+ )
1602
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1603
+ if g_param[OptionsDefine.Language]:
1604
+ profile.language = g_param[OptionsDefine.Language]
1605
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1606
+ client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
1607
+ client._sdkVersion += ("_CLI_" + __version__)
1608
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1609
+ model = models.DescribeAttackOverviewRequest()
1610
+ model.from_json_string(json.dumps(args))
1611
+ start_time = time.time()
1612
+ while True:
1613
+ rsp = client.DescribeAttackOverview(model)
1614
+ result = rsp.to_json_string()
1615
+ try:
1616
+ json_obj = json.loads(result)
1617
+ except TypeError as e:
1618
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1619
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1620
+ break
1621
+ cur_time = time.time()
1622
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1623
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1624
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1625
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1626
+ else:
1627
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1628
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1629
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1630
+
1631
+
1580
1632
  def doAddCustomWhiteRule(args, parsed_globals):
1581
1633
  g_param = parse_global_arg(parsed_globals)
1582
1634
 
@@ -1837,7 +1889,7 @@ def doDescribeWafAutoDenyRules(args, parsed_globals):
1837
1889
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1838
1890
 
1839
1891
 
1840
- def doDescribeAttackOverview(args, parsed_globals):
1892
+ def doModifySpartaProtection(args, parsed_globals):
1841
1893
  g_param = parse_global_arg(parsed_globals)
1842
1894
 
1843
1895
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1866,11 +1918,11 @@ def doDescribeAttackOverview(args, parsed_globals):
1866
1918
  client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
1867
1919
  client._sdkVersion += ("_CLI_" + __version__)
1868
1920
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1869
- model = models.DescribeAttackOverviewRequest()
1921
+ model = models.ModifySpartaProtectionRequest()
1870
1922
  model.from_json_string(json.dumps(args))
1871
1923
  start_time = time.time()
1872
1924
  while True:
1873
- rsp = client.DescribeAttackOverview(model)
1925
+ rsp = client.ModifySpartaProtection(model)
1874
1926
  result = rsp.to_json_string()
1875
1927
  try:
1876
1928
  json_obj = json.loads(result)
@@ -2658,12 +2710,13 @@ ACTION_MAP = {
2658
2710
  "ModifyCustomRuleStatus": doModifyCustomRuleStatus,
2659
2711
  "DescribePeakValue": doDescribePeakValue,
2660
2712
  "ModifyWafThreatenIntelligence": doModifyWafThreatenIntelligence,
2713
+ "DescribeAttackOverview": doDescribeAttackOverview,
2661
2714
  "AddCustomWhiteRule": doAddCustomWhiteRule,
2662
2715
  "ModifyWafAutoDenyRules": doModifyWafAutoDenyRules,
2663
2716
  "DescribeUserClbWafRegions": doDescribeUserClbWafRegions,
2664
2717
  "DeleteAttackDownloadRecord": doDeleteAttackDownloadRecord,
2665
2718
  "DescribeWafAutoDenyRules": doDescribeWafAutoDenyRules,
2666
- "DescribeAttackOverview": doDescribeAttackOverview,
2719
+ "ModifySpartaProtection": doModifySpartaProtection,
2667
2720
  "DeleteDownloadRecord": doDeleteDownloadRecord,
2668
2721
  "CreateHost": doCreateHost,
2669
2722
  "DeleteSession": doDeleteSession,