bce-python-sdk 0.9.17__py3-none-any.whl → 0.9.21__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.
baidubce/__init__.py CHANGED
@@ -18,7 +18,7 @@ from builtins import bytes
18
18
  from . import protocol
19
19
 
20
20
 
21
- SDK_VERSION = b'0.9.17'
21
+ SDK_VERSION = b'0.9.21'
22
22
  DEFAULT_SERVICE_DOMAIN = b'bcebos.com'
23
23
  URL_PREFIX = b'/v1'
24
24
  DEFAULT_ENCODING = 'UTF-8'
@@ -70,7 +70,7 @@ class BbcClient(bce_base_client.BceBaseClient):
70
70
  def create_instance(self, flavor_id, image_id, raid_id, root_disk_size_in_gb=20, purchase_count=1,
71
71
  zone_name=None, subnet_id=None, billing=None, name=None, admin_pass=None,
72
72
  auto_renew_time_unit=None, auto_renew_time=0, deploy_set_id=None, enable_ht=False,
73
- security_group_id=None, client_token=None, config=None):
73
+ security_group_id=None, client_token=None, config=None, tags=None):
74
74
 
75
75
  """
76
76
  Create a bbc instance with the specified options.
@@ -159,6 +159,10 @@ class BbcClient(bce_base_client.BceBaseClient):
159
159
  https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
160
160
  :type client_token: string
161
161
 
162
+ :param tags:
163
+ List of tags to be bind
164
+ :type tags: list
165
+
162
166
  :return:
163
167
  :rtype baidubce.bce_response.BceResponse
164
168
  """
@@ -208,6 +212,8 @@ class BbcClient(bce_base_client.BceBaseClient):
208
212
  body['autoRenewTimeUnit'] = auto_renew_time_unit
209
213
  if auto_renew_time != 0:
210
214
  body['autoRenewTime'] = auto_renew_time
215
+ if tags is not None:
216
+ body['tags'] = tags
211
217
  return self._send_request(http_methods.POST, path, json.dumps(body),
212
218
  params=params, config=config)
213
219
 
@@ -707,6 +713,38 @@ class BbcClient(bce_base_client.BceBaseClient):
707
713
  return self._send_request(http_methods.PUT, path, body=json.dumps(body),
708
714
  params=params, config=config)
709
715
 
716
+ @required(instance_id=(bytes, str), change_tags = list)
717
+ def bind_tags(self, instance_id, change_tags, config=None):
718
+ """
719
+ bind the tags of existing instances
720
+
721
+ :param instance_id:
722
+ The id of instance.
723
+ :type instance_id: string
724
+
725
+ :param change_tags:
726
+ List of tags to be bind
727
+ :type change_tags: list
728
+
729
+ :return:
730
+ :rtype baidubce.bce_response.BceResponse
731
+
732
+ """
733
+ instance_id = compat.convert_to_bytes(instance_id)
734
+ path = b'/instance/%s/tag' % instance_id
735
+
736
+ params = {
737
+ 'bind': None
738
+ }
739
+
740
+ body = {
741
+ 'changeTags': change_tags
742
+ }
743
+
744
+ return self._send_request(http_methods.PUT, path, body=json.dumps(body),
745
+ params=params, config=config)
746
+
747
+
710
748
  @required(reserved_instance_ids=list,
711
749
  tags=list)
712
750
  def bind_reserved_instance_to_tags(self, reserved_instance_ids, tags, config=None):
@@ -1069,7 +1069,7 @@ class BccClient(bce_base_client.BceBaseClient):
1069
1069
  body['userData'] = user_data
1070
1070
  if res_group_id is not None:
1071
1071
  body['resGroupId'] = res_group_id
1072
- body['isEipAutoRelatedDelete'] = is_eip_auto_related_delete
1072
+ body['isEipAutoRelatedDelete'] = is_eip_auto_related_delete
1073
1073
 
1074
1074
  return self._send_request(http_methods.POST, path, json.dumps(body),
1075
1075
  params=params, config=config)
@@ -4741,7 +4741,7 @@ class BccClient(bce_base_client.BceBaseClient):
4741
4741
  return self._send_request(http_methods.PUT, path, json.dumps(body), params=params, config=config)
4742
4742
 
4743
4743
  @required(instance_id=(bytes, str), is_eip_auto_related_delete=bool)
4744
- def modify_related_delete_policy(self, instance_id, is_eip_auto_related_delete, client_token=None, config=None):
4744
+ def modify_related_delete_policy(self, instance_id, is_eip_auto_related_delete, client_token=None, config=None):
4745
4745
  """
4746
4746
  Set bid instance eip_auto_related_delete.
4747
4747
 
@@ -5228,7 +5228,9 @@ class BccClient(bce_base_client.BceBaseClient):
5228
5228
  return self._send_request(http_methods.GET, path, prefix=b"/v1", params=params, config=config)
5229
5229
 
5230
5230
  def instance_change_subnet(self, instance_id, subnet_id=None,
5231
- internal_ip=None, reboot=None, client_token=None, config=None):
5231
+ internal_ip=None, reboot=None,
5232
+ security_group_ids=None, enterprise_security_group_ids=None,
5233
+ client_token=None, config=None):
5232
5234
  """
5233
5235
  Change instance subnet by id.
5234
5236
 
@@ -5248,6 +5250,12 @@ class BccClient(bce_base_client.BceBaseClient):
5248
5250
  Reboot instance or not. Default value is False.
5249
5251
  :type reboot: bool
5250
5252
 
5253
+ :param security_group_ids:
5254
+ :type security_group_ids: list<string>
5255
+
5256
+ :param enterprise_security_group_ids:
5257
+ :type enterprise_security_group_ids: list<string>
5258
+
5251
5259
  :return:
5252
5260
  :rtype baidubce.bce_response.BceResponse
5253
5261
  """
@@ -5268,6 +5276,12 @@ class BccClient(bce_base_client.BceBaseClient):
5268
5276
  if reboot is not None:
5269
5277
  body['reboot'] = reboot
5270
5278
 
5279
+ if security_group_ids is not None:
5280
+ body['securityGroupIds'] = security_group_ids
5281
+
5282
+ if enterprise_security_group_ids is not None:
5283
+ body['enterpriseSecurityGroupIds'] = enterprise_security_group_ids
5284
+
5271
5285
  return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
5272
5286
 
5273
5287
  def instance_change_vpc(self, instance_id, subnet_id=None,
@@ -5542,7 +5556,7 @@ class BccClient(bce_base_client.BceBaseClient):
5542
5556
  return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
5543
5557
 
5544
5558
  def batch_create_auto_renew_rules(self, instance_id, renew_time_unit="month", renew_time=1,
5545
- client_token=None, config=None):
5559
+ renew_cds=None, renew_eip=None, client_token=None, config=None):
5546
5560
  """
5547
5561
  create auto renew rules for instance
5548
5562
 
@@ -5557,6 +5571,10 @@ class BccClient(bce_base_client.BceBaseClient):
5557
5571
  :param renew_time:
5558
5572
  renew time of year, values: 1/2/3, default value: 1
5559
5573
  :type renew_time: int
5574
+ :param renew_cds:
5575
+ renew cds, values: True/False, default value: True
5576
+ :param renew_eip:
5577
+ renew eip, values: True/False, default value: True
5560
5578
 
5561
5579
  :return:
5562
5580
  :rtype baidubce.bce_response.BceResponse
@@ -5572,16 +5590,25 @@ class BccClient(bce_base_client.BceBaseClient):
5572
5590
  "renewTimeUnit": renew_time_unit,
5573
5591
  "renewTime": renew_time
5574
5592
  }
5593
+ if renew_cds is not None:
5594
+ body["renewCds"] = renew_cds
5595
+ if renew_eip is not None:
5596
+ body["renewEip"] = renew_eip
5597
+
5575
5598
  return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
5576
5599
 
5577
- def batch_delete_auto_renew_rules(self, instance_id, client_token=None, config=None):
5600
+ def batch_delete_auto_renew_rules(self, instance_id, renew_cds=None, renew_eip=None,
5601
+ client_token=None, config=None):
5578
5602
  """
5579
5603
  delete auto renew rules for instance
5580
5604
 
5581
5605
  :param instance_id:
5582
5606
  Identify of the instance to auto renew
5583
5607
  :type instance_id: string
5584
-
5608
+ :param renew_cds:
5609
+ renew cds, values: True/False, default value: True
5610
+ :param renew_eip:
5611
+ renew eip, values: True/False, default value: True
5585
5612
  :return:
5586
5613
  :rtype baidubce.bce_response.BceResponse
5587
5614
  """
@@ -5594,6 +5621,12 @@ class BccClient(bce_base_client.BceBaseClient):
5594
5621
  body = {
5595
5622
  "instanceId": instance_id
5596
5623
  }
5624
+
5625
+ if renew_cds is not None:
5626
+ body["renewCds"] = renew_cds
5627
+ if renew_eip is not None:
5628
+ body["renewEip"] = renew_eip
5629
+
5597
5630
  return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
5598
5631
 
5599
5632
  def delete_recycled_instance(self, instance_id, client_token=None, config=None):
@@ -6577,6 +6610,153 @@ class BccClient(bce_base_client.BceBaseClient):
6577
6610
 
6578
6611
  return self._send_request(http_methods.GET, path, params=params, config=config)
6579
6612
 
6613
+ def create_reserved_instances(self, reserved_instance_name=None, scope=None, zone_name=None, spec=None,
6614
+ offering_type=None, instance_count=None, reserved_instance_count=None,
6615
+ reserved_instance_time=None, reserved_instance_time_unit=None,
6616
+ auto_renew_time_unit=None, auto_renew_time=None, auto_renew=None,
6617
+ effective_time=None, ehc_cluster_id=None, ticket_id=None,
6618
+ tags=None, client_token=None, config=None):
6619
+
6620
+ """
6621
+ Create reserved instances.
6622
+
6623
+ :param reserved_instance_name:
6624
+ The name of the reserved instance.
6625
+ :type reserved_instance_name: string
6626
+
6627
+ :param scope:
6628
+ The scope.
6629
+ :type scope: string
6630
+
6631
+ :param zone_name:
6632
+ The name of the availability zone.
6633
+ :type zone_name: string
6634
+
6635
+ :param spec:
6636
+ The instance specification.
6637
+ :type spec: string
6638
+
6639
+ :param offering_type:
6640
+ The offering type.
6641
+ :type offering_type: string
6642
+
6643
+ :param instance_count:
6644
+ The number of instances.
6645
+ :type instance_count: int
6646
+
6647
+ :param reserved_instance_count:
6648
+ The number of reserved instances.
6649
+ :type reserved_instance_count: int
6650
+
6651
+ :param reserved_instance_time:
6652
+ The duration of the reserved instance.
6653
+ :type reserved_instance_time: int
6654
+
6655
+ :param reserved_instance_time_unit:
6656
+ The time unit of the reserved instance.
6657
+ :type reserved_instance_time_unit: string
6658
+
6659
+ :param auto_renew_time_unit:
6660
+ The time unit for automatic renewal.
6661
+ :type auto_renew_time_unit: string
6662
+
6663
+ :param auto_renew_time:
6664
+ The duration for automatic renewal.
6665
+ :type auto_renew_time: int
6666
+
6667
+ :param auto_renew:
6668
+ Whether to enable automatic renewal, defaults to False.
6669
+ :type auto_renew: bool
6670
+
6671
+ :param effective_time:
6672
+ The effective time.
6673
+ It is immediately effective by default.
6674
+ :type effective_time: string
6675
+
6676
+ :param ehc_cluster_id:
6677
+ The EHC cluster ID.
6678
+ :type ehc_cluster_id: string
6679
+
6680
+ :param ticket_id:
6681
+ The ticket ID.
6682
+ :type ticket_id: string
6683
+
6684
+ :param tags:
6685
+ The optional list of tag to be bonded.
6686
+ :type tags: list<bcc_model.TagModel>
6687
+
6688
+ :return:
6689
+ :rtype: baidubce.bce_response.BceResponse
6690
+ """
6691
+
6692
+ path = b'/instance/reserved/create' # 请替换为实际的请求路径
6693
+ params = {}
6694
+ if client_token is not None:
6695
+ params['clientToken'] = client_token
6696
+
6697
+ body = {}
6698
+
6699
+ if reserved_instance_name is not None:
6700
+ body['reservedInstanceName'] = reserved_instance_name
6701
+ if scope is not None:
6702
+ body['scope'] = scope
6703
+ if zone_name is not None:
6704
+ body['zoneName'] = zone_name
6705
+ if spec is not None:
6706
+ body['spec'] = spec
6707
+ if offering_type is not None:
6708
+ body['offeringType'] = offering_type
6709
+ if instance_count is not None:
6710
+ body['instanceCount'] = instance_count
6711
+ if reserved_instance_count is not None:
6712
+ body['reservedInstanceCount'] = reserved_instance_count
6713
+ if reserved_instance_time is not None:
6714
+ body['reservedInstanceTime'] = reserved_instance_time
6715
+ if reserved_instance_time_unit is not None:
6716
+ body['reservedInstanceTimeUnit'] = reserved_instance_time_unit
6717
+ if auto_renew_time_unit is not None:
6718
+ body['autoRenewTimeUnit'] = auto_renew_time_unit
6719
+ if auto_renew_time is not None:
6720
+ body['autoRenewTime'] = auto_renew_time
6721
+ if auto_renew is not False:
6722
+ body['autoRenew'] = str(auto_renew).lower()
6723
+ if effective_time is not None:
6724
+ body['effectiveTime'] = effective_time
6725
+ if ehc_cluster_id is not None:
6726
+ body['ehcClusterId'] = ehc_cluster_id
6727
+ if ticket_id is not None:
6728
+ body['ticketId'] = ticket_id
6729
+ if tags is not None:
6730
+ tag_list = [tag.__dict__ for tag in tags]
6731
+ body['tags'] = tag_list
6732
+
6733
+ return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
6734
+
6735
+ def modify_reserved_instances(self, reserved_instances=None, client_token=None, config=None):
6736
+
6737
+ """
6738
+ Modify the information of reserved instances.
6739
+
6740
+ :param reserved_instances:
6741
+ A list of dictionaries containing the information of reserved instances to be updated.
6742
+ :type reserved_instances: list<bcc_model.ModifyReservedInstanceModel>
6743
+
6744
+ :return:
6745
+ :rtype: baidubce.bce_response.BceResponse
6746
+ """
6747
+ path = b'/instance/reserved/modify'
6748
+ params = {}
6749
+ if client_token is not None:
6750
+ params['clientToken'] = client_token
6751
+
6752
+ body = {}
6753
+
6754
+ if reserved_instances is not None:
6755
+ reserved_instances_list = [reserved_instance.__dict__ for reserved_instance in reserved_instances]
6756
+ body['reservedInstances'] = reserved_instances_list
6757
+
6758
+ return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
6759
+
6580
6760
 
6581
6761
  def generate_client_token_by_uuid():
6582
6762
  """
@@ -170,6 +170,18 @@ class AutoSnapshotPolicyModel(object):
170
170
  self.retentionDays = retentionDays
171
171
 
172
172
 
173
+ class ModifyReservedInstanceModel(object):
174
+ """
175
+ ModifyReservedInstanceModel
176
+ """
177
+
178
+ def __init__(self, reservedInstanceId=None, zoneName=None, reservedInstanceName=None, ehcClusterId=None):
179
+ self.reservedInstanceId = reservedInstanceId
180
+ self.zoneName = zoneName
181
+ self.reservedInstanceName = reservedInstanceName
182
+ self.ehcClusterId = ehcClusterId
183
+
184
+
173
185
  class FileSystemModel(object):
174
186
  """
175
187
  This class define file system.
File without changes
@@ -0,0 +1,326 @@
1
+ """
2
+ This module provides a client class for CA.
3
+ """
4
+ import copy
5
+ import json
6
+ import uuid
7
+
8
+ from baidubce import bce_base_client, compat
9
+ from baidubce.auth import bce_v1_signer
10
+ from baidubce.http import handler, bce_http_client, http_methods
11
+ from baidubce.services.ca import ca_handler
12
+ from baidubce.utils import required
13
+
14
+
15
+ class CaClient(bce_base_client.BceBaseClient):
16
+ """
17
+ CA base sdk client
18
+ """
19
+ version = b'/v1'
20
+
21
+ content_type_header_key = b"content-type"
22
+ content_type_header_value = b"application/json;charset=UTF-8"
23
+ request_id_header_key = b"x-bce-request-id"
24
+
25
+ def __init__(self, config=None):
26
+ bce_base_client.BceBaseClient.__init__(self, config)
27
+
28
+ def _merge_config(self, config=None):
29
+ if config is None:
30
+ return self.config
31
+ else:
32
+ new_config = copy.copy(self.config)
33
+ new_config.merge_non_none_values(config)
34
+ return new_config
35
+
36
+ def _send_request(self, http_method, path,
37
+ body=None, headers=None, params=None, config=None, body_parser=None):
38
+ config = self._merge_config(config)
39
+ if body_parser is None:
40
+ body_parser = handler.parse_json
41
+ if headers is None:
42
+ headers = {}
43
+ if self.content_type_header_key not in headers:
44
+ headers[self.content_type_header_key] = self.content_type_header_value
45
+ if self.request_id_header_key not in headers:
46
+ headers[self.request_id_header_key] = uuid.uuid4()
47
+
48
+ return bce_http_client.send_request(
49
+ config, bce_v1_signer.sign, [ca_handler.parse_error, body_parser],
50
+ http_method, CaClient.version + path, body, headers, params)
51
+
52
+ def batch_get_agent(self, instance_list=None):
53
+ """
54
+ Batch get agent info
55
+
56
+ :param instance_list:
57
+ Instance List
58
+ :type instance: dict
59
+ """
60
+ path = b'/ca/agent/batch'
61
+ body = {
62
+ "hosts": instance_list
63
+ }
64
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))
65
+
66
+ def create_action(self, execution=None, user_id=None, action=None, targets=None,
67
+ parameters=None, target_selector=None, target_selector_type=None):
68
+ """
69
+ create execution
70
+ :param execution:
71
+ execution info
72
+ :type execution: string
73
+
74
+ :param user_id:
75
+ user_id
76
+ :type user_id: string
77
+
78
+ :param action:
79
+ action info
80
+ :type action: dict
81
+
82
+ :param targets:
83
+ targets info
84
+ :type targets:list
85
+
86
+ :param parameters:
87
+ parameters info
88
+ :type parameters:dict
89
+
90
+ :param target_selector:
91
+ target_selector info
92
+ :type target_selector:dict
93
+
94
+ :param target_selector_type:
95
+ target_selector_type info
96
+ :type target_selector_type:string
97
+
98
+ """
99
+ path = b'/ca/action'
100
+ body = {
101
+ "execution": execution,
102
+ "action": action,
103
+ "targets": targets,
104
+ "userId": user_id,
105
+ "parameters": parameters,
106
+ "targetSelector": target_selector,
107
+ "targetSelectorType": target_selector_type
108
+ }
109
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))
110
+
111
+ def delete_action(self, id):
112
+ """
113
+ Delete action
114
+ :param id: The ID of the execution to be deleted
115
+ :type id: str
116
+ """
117
+ id = compat.convert_to_bytes(id)
118
+ path = b'/ca/action/%s' % id
119
+ return self._send_request(http_methods.DELETE, path)
120
+
121
+ def get_action(self, id, user_id):
122
+ """
123
+ Query id
124
+ :param id: The ID of the execution to be queried
125
+ :type id: str
126
+
127
+ Query user_id
128
+ :param user_id: user_id
129
+ :type user_id: str
130
+
131
+ """
132
+ path = b'/ca/action'
133
+ params = {
134
+ "userId": user_id,
135
+ "id": id
136
+ }
137
+ return self._send_request(http_methods.GET, path, params=params)
138
+
139
+ def update_action(self, action=None, execution=None):
140
+ """
141
+ :param action:
142
+ action info
143
+ :type action: dict
144
+
145
+ :param execution
146
+ execution info
147
+ :type execution: string
148
+ """
149
+ path = b'/ca/action'
150
+ body = {
151
+ "action": action,
152
+ "execution": execution,
153
+ }
154
+ return self._send_request(http_methods.PUT, path, body=json.dumps(body))
155
+
156
+ def action_list(self, action=None, page_no=None, page_size=None, sort=None, ascending=None, user_id=None):
157
+ """
158
+ :param action:
159
+ action info
160
+ :type action: dict
161
+
162
+ :param page_no:
163
+ page number
164
+ :type page_no: int
165
+
166
+ :param page_size:
167
+ page number
168
+ :type page_size: int
169
+
170
+ :param sort:
171
+ sort order
172
+ :type sort: str
173
+
174
+ :param ascending:
175
+ ascending order
176
+ :type ascending: bool
177
+
178
+ :param user_id:
179
+ :type user_id: str
180
+ """
181
+ path = b'/ca/action/list'
182
+ body = {
183
+ "action": action,
184
+ "pageNo": page_no,
185
+ "pageSize": page_size,
186
+ "sort": sort,
187
+ "ascending": ascending,
188
+ "userId": user_id
189
+ }
190
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))
191
+
192
+ def action_run(self, action=None, parameters=None, user_id=None,
193
+ target_selector_type=None, targets=None, target_selector=None):
194
+ """
195
+ :param action:
196
+ action info
197
+ :type action: dict
198
+
199
+ :param parameters:
200
+ :param target_selector_type:map
201
+
202
+ :param user_id:
203
+ :type user_id: str
204
+
205
+ target selector type
206
+ :type target_selector_type: str
207
+
208
+ :param targets:
209
+ :type targets: list
210
+
211
+ :param target_selector:
212
+ :type target_selector: dict
213
+ """
214
+ path = b'/ca/actionRun'
215
+ body = {
216
+ "action": action,
217
+ "parameters": parameters,
218
+ "targetSelectorType": target_selector_type,
219
+ "targets": targets,
220
+ "targetSelector": target_selector,
221
+ "userId": user_id,
222
+ "execution": "RUN"
223
+ }
224
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))
225
+
226
+ def get_action_run(self, id=None, user_id=None):
227
+ """
228
+ Query id
229
+ :param id: The ID of the execution to be queried
230
+ :type id: str
231
+
232
+ user_id
233
+ :user_id id: str
234
+ """
235
+ params = {
236
+ "userId": user_id,
237
+ "id": id
238
+ }
239
+ path = b'/ca/actionRun'
240
+ return self._send_request(http_methods.GET, path, params=params)
241
+
242
+ def action_run_list(self, action=None, page_no=None, page_size=None, sort=None, ascending=None, user_id=None,
243
+ start_time=None, end_time=None, keyword=None, keyword_type=None, run_id=None, is_inited=False):
244
+ """
245
+ :param action:
246
+ action info
247
+ :type action: dict
248
+
249
+ :param page_no:
250
+ page number
251
+ :type page_no: int
252
+
253
+ :param page_size:
254
+ page number
255
+ :type page_size: int
256
+
257
+ :param sort:
258
+ sort order
259
+ :type sort: str
260
+
261
+ :param ascending:
262
+ ascending order
263
+ :type ascending: bool
264
+
265
+ :param user_id:
266
+ :type user_id: str
267
+
268
+ :param start_time:
269
+ start time
270
+ :type start_time:
271
+
272
+ :param end_time:
273
+ end time
274
+ :type end_time:
275
+
276
+ :param keyword:
277
+ keyword type
278
+ :type keyword: str
279
+
280
+ :param keyword_type:
281
+ keyword type
282
+ :type keyword_type: str
283
+
284
+ :param run_id:
285
+ run id
286
+ :type run_id: str
287
+
288
+ :param is_inited:
289
+ is inited or not inited
290
+ :type is_inited: bool
291
+ """
292
+ body = {
293
+ "action": action,
294
+ "pageNo": page_no,
295
+ "pageSize": page_size,
296
+ "sort": sort,
297
+ "ascending": ascending,
298
+ "userId": user_id,
299
+ "startTime": start_time,
300
+ "endTime": end_time,
301
+ "keyword": keyword,
302
+ "keyword_type": keyword_type,
303
+ "runId": run_id,
304
+ "isInited": is_inited
305
+ }
306
+ path = b'/ca/actionRun/list'
307
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))
308
+
309
+ def action_log(self, run_id=None, child_id=None, cursor=None):
310
+ """
311
+ :param run_id:
312
+ :type run_id: str
313
+
314
+ :param child_id:
315
+ :type child_id: str
316
+
317
+ :param cursor:
318
+ :type cursor: int
319
+ """
320
+ body = {
321
+ "runId": run_id,
322
+ "childId": child_id,
323
+ "cursor": cursor
324
+ }
325
+ path = b'/ca/log'
326
+ return self._send_request(http_methods.POST, path, body=json.dumps(body))