baiducloud-python-sdk-cloudassistant 0.0.1__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.
- baiducloud_python_sdk_cloudassistant/__init__.py +5 -0
- baiducloud_python_sdk_cloudassistant/api/__init__.py +0 -0
- baiducloud_python_sdk_cloudassistant/api/cloudassistant_client.py +418 -0
- baiducloud_python_sdk_cloudassistant/models/__init__.py +54 -0
- baiducloud_python_sdk_cloudassistant/models/action.py +164 -0
- baiducloud_python_sdk_cloudassistant/models/action_filter.py +100 -0
- baiducloud_python_sdk_cloudassistant/models/action_index.py +74 -0
- baiducloud_python_sdk_cloudassistant/models/action_list_request.py +99 -0
- baiducloud_python_sdk_cloudassistant/models/action_list_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/action_log_request.py +76 -0
- baiducloud_python_sdk_cloudassistant/models/action_log_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/action_page.py +84 -0
- baiducloud_python_sdk_cloudassistant/models/action_run.py +130 -0
- baiducloud_python_sdk_cloudassistant/models/action_run_list_request.py +143 -0
- baiducloud_python_sdk_cloudassistant/models/action_run_list_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/action_run_page.py +84 -0
- baiducloud_python_sdk_cloudassistant/models/action_run_request.py +101 -0
- baiducloud_python_sdk_cloudassistant/models/action_run_response.py +93 -0
- baiducloud_python_sdk_cloudassistant/models/agent.py +76 -0
- baiducloud_python_sdk_cloudassistant/models/batch_get_agent_request.py +61 -0
- baiducloud_python_sdk_cloudassistant/models/batch_get_agent_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/child_run.py +135 -0
- baiducloud_python_sdk_cloudassistant/models/command.py +135 -0
- baiducloud_python_sdk_cloudassistant/models/command_filter.py +74 -0
- baiducloud_python_sdk_cloudassistant/models/create_action_request.py +105 -0
- baiducloud_python_sdk_cloudassistant/models/create_action_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/delete_action_request.py +58 -0
- baiducloud_python_sdk_cloudassistant/models/delete_action_response.py +85 -0
- baiducloud_python_sdk_cloudassistant/models/execution.py +20 -0
- baiducloud_python_sdk_cloudassistant/models/file_upload.py +151 -0
- baiducloud_python_sdk_cloudassistant/models/get_action_request.py +64 -0
- baiducloud_python_sdk_cloudassistant/models/get_action_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/get_action_run_request.py +88 -0
- baiducloud_python_sdk_cloudassistant/models/get_action_run_response.py +94 -0
- baiducloud_python_sdk_cloudassistant/models/host.py +58 -0
- baiducloud_python_sdk_cloudassistant/models/id.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/instance_type.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/keyword_type.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/log.py +58 -0
- baiducloud_python_sdk_cloudassistant/models/log_result.py +84 -0
- baiducloud_python_sdk_cloudassistant/models/os.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/output.py +82 -0
- baiducloud_python_sdk_cloudassistant/models/parameter.py +82 -0
- baiducloud_python_sdk_cloudassistant/models/scope.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/state.py +20 -0
- baiducloud_python_sdk_cloudassistant/models/statistics.py +66 -0
- baiducloud_python_sdk_cloudassistant/models/tag.py +66 -0
- baiducloud_python_sdk_cloudassistant/models/target.py +106 -0
- baiducloud_python_sdk_cloudassistant/models/target_import.py +66 -0
- baiducloud_python_sdk_cloudassistant/models/target_selector.py +78 -0
- baiducloud_python_sdk_cloudassistant/models/target_selector_type.py +21 -0
- baiducloud_python_sdk_cloudassistant/models/type.py +19 -0
- baiducloud_python_sdk_cloudassistant/models/update_action_request.py +105 -0
- baiducloud_python_sdk_cloudassistant/models/update_action_response.py +85 -0
- baiducloud_python_sdk_cloudassistant-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_cloudassistant-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_cloudassistant-0.0.1.dist-info/RECORD +59 -0
- baiducloud_python_sdk_cloudassistant-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_cloudassistant-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ActionRun information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cloudassistant.models.action import Action
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_cloudassistant.models.statistics import Statistics
|
|
10
|
+
|
|
11
|
+
from baiducloud_python_sdk_cloudassistant.models.child_run import ChildRun
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActionRun(AbstractModel):
|
|
15
|
+
"""
|
|
16
|
+
ActionRun
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
id=None,
|
|
22
|
+
state=None,
|
|
23
|
+
action=None,
|
|
24
|
+
created_timestamp=None,
|
|
25
|
+
finished_timestamp=None,
|
|
26
|
+
statistics=None,
|
|
27
|
+
children=None,
|
|
28
|
+
total_count=None,
|
|
29
|
+
):
|
|
30
|
+
"""
|
|
31
|
+
Initialize ActionRun instance.
|
|
32
|
+
|
|
33
|
+
:param id: 执行ID
|
|
34
|
+
:type id: str (optional)
|
|
35
|
+
|
|
36
|
+
:param state: 执行状态
|
|
37
|
+
:type state: str (optional)
|
|
38
|
+
|
|
39
|
+
:param action: action attribute
|
|
40
|
+
:type action: Action (optional)
|
|
41
|
+
|
|
42
|
+
:param created_timestamp: 执行开始时间。unix时间戳,单位:毫秒
|
|
43
|
+
:type created_timestamp: int (optional)
|
|
44
|
+
|
|
45
|
+
:param finished_timestamp: 执行结束时间,仅执行结束时返回
|
|
46
|
+
:type finished_timestamp: int (optional)
|
|
47
|
+
|
|
48
|
+
:param statistics: statistics attribute
|
|
49
|
+
:type statistics: Statistics (optional)
|
|
50
|
+
|
|
51
|
+
:param children: 子执行列表,读取详情时,响应此字段
|
|
52
|
+
:type children: List[ChildRun] (optional)
|
|
53
|
+
|
|
54
|
+
:param total_count: 子执行总数,读取详情时,响应此字段
|
|
55
|
+
:type total_count: int (optional)
|
|
56
|
+
"""
|
|
57
|
+
super().__init__()
|
|
58
|
+
self.id = id
|
|
59
|
+
self.state = state
|
|
60
|
+
self.action = action
|
|
61
|
+
self.created_timestamp = created_timestamp
|
|
62
|
+
self.finished_timestamp = finished_timestamp
|
|
63
|
+
self.statistics = statistics
|
|
64
|
+
self.children = children
|
|
65
|
+
self.total_count = total_count
|
|
66
|
+
|
|
67
|
+
def to_dict(self):
|
|
68
|
+
"""
|
|
69
|
+
Convert the model instance to a dictionary representation.
|
|
70
|
+
|
|
71
|
+
Nested model objects are recursively converted to dictionaries.
|
|
72
|
+
|
|
73
|
+
:return: Dictionary representation of the model
|
|
74
|
+
:rtype: dict
|
|
75
|
+
"""
|
|
76
|
+
_map = super().to_dict()
|
|
77
|
+
if _map is not None:
|
|
78
|
+
return _map
|
|
79
|
+
result = dict()
|
|
80
|
+
if self.id is not None:
|
|
81
|
+
result['id'] = self.id
|
|
82
|
+
if self.state is not None:
|
|
83
|
+
result['state'] = self.state
|
|
84
|
+
if self.action is not None:
|
|
85
|
+
result['action'] = self.action.to_dict()
|
|
86
|
+
if self.created_timestamp is not None:
|
|
87
|
+
result['createdTimestamp'] = self.created_timestamp
|
|
88
|
+
if self.finished_timestamp is not None:
|
|
89
|
+
result['finishedTimestamp'] = self.finished_timestamp
|
|
90
|
+
if self.statistics is not None:
|
|
91
|
+
result['statistics'] = self.statistics.to_dict()
|
|
92
|
+
if self.children is not None:
|
|
93
|
+
result['children'] = [i.to_dict() for i in self.children]
|
|
94
|
+
if self.total_count is not None:
|
|
95
|
+
result['totalCount'] = self.total_count
|
|
96
|
+
return result
|
|
97
|
+
|
|
98
|
+
def from_dict(self, m):
|
|
99
|
+
"""
|
|
100
|
+
Populate the model instance from a dictionary.
|
|
101
|
+
|
|
102
|
+
Nested dictionaries are recursively converted to model objects.
|
|
103
|
+
|
|
104
|
+
:param m: Dictionary containing model data
|
|
105
|
+
:type m: dict
|
|
106
|
+
|
|
107
|
+
:return: Self reference for method chaining
|
|
108
|
+
:rtype: ActionRun
|
|
109
|
+
|
|
110
|
+
:raises TypeError: If input is not a dictionary type
|
|
111
|
+
:raises ValueError: If nested model conversion fails
|
|
112
|
+
"""
|
|
113
|
+
m = m or dict()
|
|
114
|
+
if m.get('id') is not None:
|
|
115
|
+
self.id = m.get('id')
|
|
116
|
+
if m.get('state') is not None:
|
|
117
|
+
self.state = m.get('state')
|
|
118
|
+
if m.get('action') is not None:
|
|
119
|
+
self.action = Action().from_dict(m.get('action'))
|
|
120
|
+
if m.get('createdTimestamp') is not None:
|
|
121
|
+
self.created_timestamp = m.get('createdTimestamp')
|
|
122
|
+
if m.get('finishedTimestamp') is not None:
|
|
123
|
+
self.finished_timestamp = m.get('finishedTimestamp')
|
|
124
|
+
if m.get('statistics') is not None:
|
|
125
|
+
self.statistics = Statistics().from_dict(m.get('statistics'))
|
|
126
|
+
if m.get('children') is not None:
|
|
127
|
+
self.children = [ChildRun().from_dict(i) for i in m.get('children')]
|
|
128
|
+
if m.get('totalCount') is not None:
|
|
129
|
+
self.total_count = m.get('totalCount')
|
|
130
|
+
return self
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for ActionRunListRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
from baiducloud_python_sdk_cloudassistant.models.action_filter import ActionFilter
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ActionRunListRequest(AbstractModel):
|
|
10
|
+
"""
|
|
11
|
+
Request entity for ActionRunListRequest operation.
|
|
12
|
+
|
|
13
|
+
This class encapsulates all parameters for the API request.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
page_no,
|
|
19
|
+
page_size,
|
|
20
|
+
locale=None,
|
|
21
|
+
sort=None,
|
|
22
|
+
ascending=None,
|
|
23
|
+
action=None,
|
|
24
|
+
state=None,
|
|
25
|
+
run_id=None,
|
|
26
|
+
start_time=None,
|
|
27
|
+
end_time=None,
|
|
28
|
+
):
|
|
29
|
+
"""
|
|
30
|
+
Initialize ActionRunListRequest request entity.
|
|
31
|
+
|
|
32
|
+
:param locale: locale parameter
|
|
33
|
+
:type locale: str (optional)
|
|
34
|
+
|
|
35
|
+
:param page_no: 页码
|
|
36
|
+
:type page_no: int (required)
|
|
37
|
+
|
|
38
|
+
:param page_size: 页大小
|
|
39
|
+
:type page_size: int (required)
|
|
40
|
+
|
|
41
|
+
:param sort: 排序字段
|
|
42
|
+
:type sort: str (optional)
|
|
43
|
+
|
|
44
|
+
:param ascending: 是否升序,默认false
|
|
45
|
+
:type ascending: bool (optional)
|
|
46
|
+
|
|
47
|
+
:param action: action parameter
|
|
48
|
+
:type action: ActionFilter (optional)
|
|
49
|
+
|
|
50
|
+
:param state: 根据执行状态过滤。枚举值:FAILED(执行失败),RUNNING(执行中),SUCCESS(执行完成)
|
|
51
|
+
:type state: str (optional)
|
|
52
|
+
|
|
53
|
+
:param run_id: 根据执行ID过滤
|
|
54
|
+
:type run_id: str (optional)
|
|
55
|
+
|
|
56
|
+
:param start_time: 时间筛选,Unix时间戳(毫秒)。执行开始时间 >= endTime,Unix时间戳(毫秒)
|
|
57
|
+
:type start_time: int (optional)
|
|
58
|
+
|
|
59
|
+
:param end_time: 时间筛选,Unix时间戳(毫秒)。执行开始时间 <= endTime,Unix时间戳(毫秒)
|
|
60
|
+
:type end_time: int (optional)
|
|
61
|
+
"""
|
|
62
|
+
super().__init__()
|
|
63
|
+
self.locale = locale
|
|
64
|
+
self.page_no = page_no
|
|
65
|
+
self.page_size = page_size
|
|
66
|
+
self.sort = sort
|
|
67
|
+
self.ascending = ascending
|
|
68
|
+
self.action = action
|
|
69
|
+
self.state = state
|
|
70
|
+
self.run_id = run_id
|
|
71
|
+
self.start_time = start_time
|
|
72
|
+
self.end_time = end_time
|
|
73
|
+
|
|
74
|
+
def to_dict(self):
|
|
75
|
+
"""
|
|
76
|
+
Convert the request entity to a dictionary representation.
|
|
77
|
+
|
|
78
|
+
Nested model objects are recursively converted to dictionaries.
|
|
79
|
+
|
|
80
|
+
:return: Dictionary representation of the request
|
|
81
|
+
:rtype: dict
|
|
82
|
+
"""
|
|
83
|
+
_map = super().to_dict()
|
|
84
|
+
if _map is not None:
|
|
85
|
+
return _map
|
|
86
|
+
result = dict()
|
|
87
|
+
if self.page_no is not None:
|
|
88
|
+
result['pageNo'] = self.page_no
|
|
89
|
+
if self.page_size is not None:
|
|
90
|
+
result['pageSize'] = self.page_size
|
|
91
|
+
if self.sort is not None:
|
|
92
|
+
result['sort'] = self.sort
|
|
93
|
+
if self.ascending is not None:
|
|
94
|
+
result['ascending'] = self.ascending
|
|
95
|
+
if self.action is not None:
|
|
96
|
+
result['action'] = self.action.to_dict()
|
|
97
|
+
if self.state is not None:
|
|
98
|
+
result['state'] = self.state
|
|
99
|
+
if self.run_id is not None:
|
|
100
|
+
result['runId'] = self.run_id
|
|
101
|
+
if self.start_time is not None:
|
|
102
|
+
result['startTime'] = self.start_time
|
|
103
|
+
if self.end_time is not None:
|
|
104
|
+
result['endTime'] = self.end_time
|
|
105
|
+
return result
|
|
106
|
+
|
|
107
|
+
def from_dict(self, m):
|
|
108
|
+
"""
|
|
109
|
+
Populate the request entity from a dictionary.
|
|
110
|
+
|
|
111
|
+
Nested dictionaries are recursively converted to model objects.
|
|
112
|
+
|
|
113
|
+
:param m: Dictionary containing request data
|
|
114
|
+
:type m: dict
|
|
115
|
+
|
|
116
|
+
:return: Self reference for method chaining
|
|
117
|
+
:rtype: ActionRunListRequest
|
|
118
|
+
|
|
119
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
120
|
+
:raises ValueError: If nested model conversion fails
|
|
121
|
+
"""
|
|
122
|
+
m = m or dict()
|
|
123
|
+
if m.get('locale') is not None:
|
|
124
|
+
self.locale = m.get('locale')
|
|
125
|
+
if m.get('pageNo') is not None:
|
|
126
|
+
self.page_no = m.get('pageNo')
|
|
127
|
+
if m.get('pageSize') is not None:
|
|
128
|
+
self.page_size = m.get('pageSize')
|
|
129
|
+
if m.get('sort') is not None:
|
|
130
|
+
self.sort = m.get('sort')
|
|
131
|
+
if m.get('ascending') is not None:
|
|
132
|
+
self.ascending = m.get('ascending')
|
|
133
|
+
if m.get('action') is not None:
|
|
134
|
+
self.action = ActionFilter().from_dict(m.get('action'))
|
|
135
|
+
if m.get('state') is not None:
|
|
136
|
+
self.state = m.get('state')
|
|
137
|
+
if m.get('runId') is not None:
|
|
138
|
+
self.run_id = m.get('runId')
|
|
139
|
+
if m.get('startTime') is not None:
|
|
140
|
+
self.start_time = m.get('startTime')
|
|
141
|
+
if m.get('endTime') is not None:
|
|
142
|
+
self.end_time = m.get('endTime')
|
|
143
|
+
return self
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for ActionRunListResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_cloudassistant.models.action_run_page import ActionRunPage
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ActionRunListResponse(BceResponse):
|
|
10
|
+
"""
|
|
11
|
+
ActionRunListResponse
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, request_id=None, code=None, message=None, success=None, result=None):
|
|
15
|
+
"""
|
|
16
|
+
Initialize ActionRunListResponse response.
|
|
17
|
+
|
|
18
|
+
:param request_id: 请求id
|
|
19
|
+
:type request_id: str (optional)
|
|
20
|
+
|
|
21
|
+
:param code: 响应状态,成功为success
|
|
22
|
+
:type code: str (optional)
|
|
23
|
+
|
|
24
|
+
:param message: 错误信息
|
|
25
|
+
:type message: str (optional)
|
|
26
|
+
|
|
27
|
+
:param success: 请求是否处理成功
|
|
28
|
+
:type success: bool (optional)
|
|
29
|
+
|
|
30
|
+
:param result: result field
|
|
31
|
+
:type result: ActionRunPage (optional)
|
|
32
|
+
"""
|
|
33
|
+
super().__init__()
|
|
34
|
+
self.request_id = request_id
|
|
35
|
+
self.code = code
|
|
36
|
+
self.message = message
|
|
37
|
+
self.success = success
|
|
38
|
+
self.result = result
|
|
39
|
+
|
|
40
|
+
def to_dict(self):
|
|
41
|
+
"""
|
|
42
|
+
Convert the response instance to a dictionary representation.
|
|
43
|
+
|
|
44
|
+
Includes metadata from the parent BceResponse class.
|
|
45
|
+
Nested model objects are recursively converted to dictionaries.
|
|
46
|
+
|
|
47
|
+
:return: Dictionary representation of the response
|
|
48
|
+
:rtype: dict
|
|
49
|
+
"""
|
|
50
|
+
_map = super().to_dict()
|
|
51
|
+
if _map is not None:
|
|
52
|
+
return _map
|
|
53
|
+
result = dict()
|
|
54
|
+
if self.metadata is not None:
|
|
55
|
+
result['metadata'] = dict(self.metadata)
|
|
56
|
+
if self.request_id is not None:
|
|
57
|
+
result['requestId'] = self.request_id
|
|
58
|
+
if self.code is not None:
|
|
59
|
+
result['code'] = self.code
|
|
60
|
+
if self.message is not None:
|
|
61
|
+
result['message'] = self.message
|
|
62
|
+
if self.success is not None:
|
|
63
|
+
result['success'] = self.success
|
|
64
|
+
if self.result is not None:
|
|
65
|
+
result['result'] = self.result.to_dict()
|
|
66
|
+
return result
|
|
67
|
+
|
|
68
|
+
def from_dict(self, m):
|
|
69
|
+
"""
|
|
70
|
+
Populate the response instance from a dictionary.
|
|
71
|
+
|
|
72
|
+
Nested dictionaries are recursively converted to model objects.
|
|
73
|
+
|
|
74
|
+
:param m: Dictionary containing response data
|
|
75
|
+
:type m: dict
|
|
76
|
+
|
|
77
|
+
:return: Self reference for method chaining
|
|
78
|
+
:rtype: ActionRunListResponse
|
|
79
|
+
|
|
80
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
81
|
+
:raises ValueError: If nested model conversion fails
|
|
82
|
+
"""
|
|
83
|
+
m = m or dict()
|
|
84
|
+
if m.get('requestId') is not None:
|
|
85
|
+
self.request_id = m.get('requestId')
|
|
86
|
+
if m.get('code') is not None:
|
|
87
|
+
self.code = m.get('code')
|
|
88
|
+
if m.get('message') is not None:
|
|
89
|
+
self.message = m.get('message')
|
|
90
|
+
if m.get('success') is not None:
|
|
91
|
+
self.success = m.get('success')
|
|
92
|
+
if m.get('result') is not None:
|
|
93
|
+
self.result = ActionRunPage().from_dict(m.get('result'))
|
|
94
|
+
return self
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ActionRunPage information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cloudassistant.models.action_run import ActionRun
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ActionRunPage(AbstractModel):
|
|
11
|
+
"""
|
|
12
|
+
ActionRunPage
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, page_no=None, page_size=None, total_count=None, data=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize ActionRunPage instance.
|
|
18
|
+
|
|
19
|
+
:param page_no: 页码
|
|
20
|
+
:type page_no: int (optional)
|
|
21
|
+
|
|
22
|
+
:param page_size: 页大小
|
|
23
|
+
:type page_size: int (optional)
|
|
24
|
+
|
|
25
|
+
:param total_count: 总数
|
|
26
|
+
:type total_count: int (optional)
|
|
27
|
+
|
|
28
|
+
:param data: 执行记录
|
|
29
|
+
:type data: List[ActionRun] (optional)
|
|
30
|
+
"""
|
|
31
|
+
super().__init__()
|
|
32
|
+
self.page_no = page_no
|
|
33
|
+
self.page_size = page_size
|
|
34
|
+
self.total_count = total_count
|
|
35
|
+
self.data = data
|
|
36
|
+
|
|
37
|
+
def to_dict(self):
|
|
38
|
+
"""
|
|
39
|
+
Convert the model instance to a dictionary representation.
|
|
40
|
+
|
|
41
|
+
Nested model objects are recursively converted to dictionaries.
|
|
42
|
+
|
|
43
|
+
:return: Dictionary representation of the model
|
|
44
|
+
:rtype: dict
|
|
45
|
+
"""
|
|
46
|
+
_map = super().to_dict()
|
|
47
|
+
if _map is not None:
|
|
48
|
+
return _map
|
|
49
|
+
result = dict()
|
|
50
|
+
if self.page_no is not None:
|
|
51
|
+
result['pageNo'] = self.page_no
|
|
52
|
+
if self.page_size is not None:
|
|
53
|
+
result['pageSize'] = self.page_size
|
|
54
|
+
if self.total_count is not None:
|
|
55
|
+
result['totalCount'] = self.total_count
|
|
56
|
+
if self.data is not None:
|
|
57
|
+
result['data'] = [i.to_dict() for i in self.data]
|
|
58
|
+
return result
|
|
59
|
+
|
|
60
|
+
def from_dict(self, m):
|
|
61
|
+
"""
|
|
62
|
+
Populate the model instance from a dictionary.
|
|
63
|
+
|
|
64
|
+
Nested dictionaries are recursively converted to model objects.
|
|
65
|
+
|
|
66
|
+
:param m: Dictionary containing model data
|
|
67
|
+
:type m: dict
|
|
68
|
+
|
|
69
|
+
:return: Self reference for method chaining
|
|
70
|
+
:rtype: ActionRunPage
|
|
71
|
+
|
|
72
|
+
:raises TypeError: If input is not a dictionary type
|
|
73
|
+
:raises ValueError: If nested model conversion fails
|
|
74
|
+
"""
|
|
75
|
+
m = m or dict()
|
|
76
|
+
if m.get('pageNo') is not None:
|
|
77
|
+
self.page_no = m.get('pageNo')
|
|
78
|
+
if m.get('pageSize') is not None:
|
|
79
|
+
self.page_size = m.get('pageSize')
|
|
80
|
+
if m.get('totalCount') is not None:
|
|
81
|
+
self.total_count = m.get('totalCount')
|
|
82
|
+
if m.get('data') is not None:
|
|
83
|
+
self.data = [ActionRun().from_dict(i) for i in m.get('data')]
|
|
84
|
+
return self
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for ActionRunRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
from baiducloud_python_sdk_cloudassistant.models.target_selector import TargetSelector
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ActionRunRequest(AbstractModel):
|
|
10
|
+
"""
|
|
11
|
+
Request entity for ActionRunRequest operation.
|
|
12
|
+
|
|
13
|
+
This class encapsulates all parameters for the API request.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self, action, locale=None, parameters=None, target_selector_type=None, targets=None, target_selector=None
|
|
18
|
+
):
|
|
19
|
+
"""
|
|
20
|
+
Initialize ActionRunRequest request entity.
|
|
21
|
+
|
|
22
|
+
:param locale: locale parameter
|
|
23
|
+
:type locale: str (optional)
|
|
24
|
+
|
|
25
|
+
:param action: 所要执行的命令,仅需填写id
|
|
26
|
+
:type action: object (required)
|
|
27
|
+
|
|
28
|
+
:param parameters: 执行命令时的参数值,仅在命令有参数时需要
|
|
29
|
+
:type parameters: object (optional)
|
|
30
|
+
|
|
31
|
+
:param target_selector_type: target_selector_type parameter
|
|
32
|
+
:type target_selector_type: str (optional)
|
|
33
|
+
|
|
34
|
+
:param targets: 实例ID列表,仅在targetSelectorType为INSTANCES_LIST时需要
|
|
35
|
+
:type targets: List[object] (optional)
|
|
36
|
+
|
|
37
|
+
:param target_selector: target_selector parameter
|
|
38
|
+
:type target_selector: TargetSelector (optional)
|
|
39
|
+
"""
|
|
40
|
+
super().__init__()
|
|
41
|
+
self.locale = locale
|
|
42
|
+
self.action = action
|
|
43
|
+
self.parameters = parameters
|
|
44
|
+
self.target_selector_type = target_selector_type
|
|
45
|
+
self.targets = targets
|
|
46
|
+
self.target_selector = target_selector
|
|
47
|
+
|
|
48
|
+
def to_dict(self):
|
|
49
|
+
"""
|
|
50
|
+
Convert the request entity to a dictionary representation.
|
|
51
|
+
|
|
52
|
+
Nested model objects are recursively converted to dictionaries.
|
|
53
|
+
|
|
54
|
+
:return: Dictionary representation of the request
|
|
55
|
+
:rtype: dict
|
|
56
|
+
"""
|
|
57
|
+
_map = super().to_dict()
|
|
58
|
+
if _map is not None:
|
|
59
|
+
return _map
|
|
60
|
+
result = dict()
|
|
61
|
+
if self.action is not None:
|
|
62
|
+
result['action'] = self.action
|
|
63
|
+
if self.parameters is not None:
|
|
64
|
+
result['parameters'] = self.parameters
|
|
65
|
+
if self.target_selector_type is not None:
|
|
66
|
+
result['targetSelectorType'] = self.target_selector_type
|
|
67
|
+
if self.targets is not None:
|
|
68
|
+
result['targets'] = self.targets
|
|
69
|
+
if self.target_selector is not None:
|
|
70
|
+
result['targetSelector'] = self.target_selector.to_dict()
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
def from_dict(self, m):
|
|
74
|
+
"""
|
|
75
|
+
Populate the request entity from a dictionary.
|
|
76
|
+
|
|
77
|
+
Nested dictionaries are recursively converted to model objects.
|
|
78
|
+
|
|
79
|
+
:param m: Dictionary containing request data
|
|
80
|
+
:type m: dict
|
|
81
|
+
|
|
82
|
+
:return: Self reference for method chaining
|
|
83
|
+
:rtype: ActionRunRequest
|
|
84
|
+
|
|
85
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
86
|
+
:raises ValueError: If nested model conversion fails
|
|
87
|
+
"""
|
|
88
|
+
m = m or dict()
|
|
89
|
+
if m.get('locale') is not None:
|
|
90
|
+
self.locale = m.get('locale')
|
|
91
|
+
if m.get('action') is not None:
|
|
92
|
+
self.action = m.get('action')
|
|
93
|
+
if m.get('parameters') is not None:
|
|
94
|
+
self.parameters = m.get('parameters')
|
|
95
|
+
if m.get('targetSelectorType') is not None:
|
|
96
|
+
self.target_selector_type = m.get('targetSelectorType')
|
|
97
|
+
if m.get('targets') is not None:
|
|
98
|
+
self.targets = m.get('targets')
|
|
99
|
+
if m.get('targetSelector') is not None:
|
|
100
|
+
self.target_selector = TargetSelector().from_dict(m.get('targetSelector'))
|
|
101
|
+
return self
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for ActionRunResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ActionRunResponse(BceResponse):
|
|
9
|
+
"""
|
|
10
|
+
ActionRunResponse
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, request_id=None, code=None, message=None, success=None, result=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize ActionRunResponse response.
|
|
16
|
+
|
|
17
|
+
:param request_id: 请求id
|
|
18
|
+
:type request_id: str (optional)
|
|
19
|
+
|
|
20
|
+
:param code: 响应状态,成功为success
|
|
21
|
+
:type code: str (optional)
|
|
22
|
+
|
|
23
|
+
:param message: 错误信息
|
|
24
|
+
:type message: str (optional)
|
|
25
|
+
|
|
26
|
+
:param success: 请求是否处理成功
|
|
27
|
+
:type success: bool (optional)
|
|
28
|
+
|
|
29
|
+
:param result: 命令执行结果
|
|
30
|
+
:type result: object (optional)
|
|
31
|
+
"""
|
|
32
|
+
super().__init__()
|
|
33
|
+
self.request_id = request_id
|
|
34
|
+
self.code = code
|
|
35
|
+
self.message = message
|
|
36
|
+
self.success = success
|
|
37
|
+
self.result = result
|
|
38
|
+
|
|
39
|
+
def to_dict(self):
|
|
40
|
+
"""
|
|
41
|
+
Convert the response instance to a dictionary representation.
|
|
42
|
+
|
|
43
|
+
Includes metadata from the parent BceResponse class.
|
|
44
|
+
Nested model objects are recursively converted to dictionaries.
|
|
45
|
+
|
|
46
|
+
:return: Dictionary representation of the response
|
|
47
|
+
:rtype: dict
|
|
48
|
+
"""
|
|
49
|
+
_map = super().to_dict()
|
|
50
|
+
if _map is not None:
|
|
51
|
+
return _map
|
|
52
|
+
result = dict()
|
|
53
|
+
if self.metadata is not None:
|
|
54
|
+
result['metadata'] = dict(self.metadata)
|
|
55
|
+
if self.request_id is not None:
|
|
56
|
+
result['requestId'] = self.request_id
|
|
57
|
+
if self.code is not None:
|
|
58
|
+
result['code'] = self.code
|
|
59
|
+
if self.message is not None:
|
|
60
|
+
result['message'] = self.message
|
|
61
|
+
if self.success is not None:
|
|
62
|
+
result['success'] = self.success
|
|
63
|
+
if self.result is not None:
|
|
64
|
+
result['result'] = self.result
|
|
65
|
+
return result
|
|
66
|
+
|
|
67
|
+
def from_dict(self, m):
|
|
68
|
+
"""
|
|
69
|
+
Populate the response instance from a dictionary.
|
|
70
|
+
|
|
71
|
+
Nested dictionaries are recursively converted to model objects.
|
|
72
|
+
|
|
73
|
+
:param m: Dictionary containing response data
|
|
74
|
+
:type m: dict
|
|
75
|
+
|
|
76
|
+
:return: Self reference for method chaining
|
|
77
|
+
:rtype: ActionRunResponse
|
|
78
|
+
|
|
79
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
80
|
+
:raises ValueError: If nested model conversion fails
|
|
81
|
+
"""
|
|
82
|
+
m = m or dict()
|
|
83
|
+
if m.get('requestId') is not None:
|
|
84
|
+
self.request_id = m.get('requestId')
|
|
85
|
+
if m.get('code') is not None:
|
|
86
|
+
self.code = m.get('code')
|
|
87
|
+
if m.get('message') is not None:
|
|
88
|
+
self.message = m.get('message')
|
|
89
|
+
if m.get('success') is not None:
|
|
90
|
+
self.success = m.get('success')
|
|
91
|
+
if m.get('result') is not None:
|
|
92
|
+
self.result = m.get('result')
|
|
93
|
+
return self
|