baiducloud-python-sdk-rds 0.0.1__tar.gz → 0.0.2__tar.gz

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 (23) hide show
  1. baiducloud-python-sdk-rds-0.0.2/ChangeLog.md +8 -0
  2. {baiducloud-python-sdk-rds-0.0.1/baiducloud_python_sdk_rds.egg-info → baiducloud-python-sdk-rds-0.0.2}/PKG-INFO +1 -1
  3. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds/__init__.py +1 -1
  4. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds/api/rds_client.py +10 -3
  5. baiducloud-python-sdk-rds-0.0.2/baiducloud_python_sdk_rds/models/__init__.py +8 -0
  6. baiducloud-python-sdk-rds-0.0.2/baiducloud_python_sdk_rds/models/progress.py +115 -0
  7. baiducloud-python-sdk-rds-0.0.2/baiducloud_python_sdk_rds/models/query_task_list_response.py +70 -0
  8. baiducloud-python-sdk-rds-0.0.2/baiducloud_python_sdk_rds/models/task.py +171 -0
  9. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2/baiducloud_python_sdk_rds.egg-info}/PKG-INFO +1 -1
  10. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds.egg-info/SOURCES.txt +4 -1
  11. baiducloud-python-sdk-rds-0.0.1/ChangeLog.md +0 -3
  12. baiducloud-python-sdk-rds-0.0.1/baiducloud_python_sdk_rds/models/__init__.py +0 -5
  13. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/LICENSE +0 -0
  14. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/MANIFEST.in +0 -0
  15. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/README-CN.md +0 -0
  16. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/README.md +0 -0
  17. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds/api/__init__.py +0 -0
  18. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds/models/query_task_list_request.py +0 -0
  19. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds.egg-info/dependency_links.txt +0 -0
  20. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds.egg-info/requires.txt +0 -0
  21. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/baiducloud_python_sdk_rds.egg-info/top_level.txt +0 -0
  22. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/setup.cfg +0 -0
  23. {baiducloud-python-sdk-rds-0.0.1 → baiducloud-python-sdk-rds-0.0.2}/setup.py +0 -0
@@ -0,0 +1,8 @@
1
+ 2026-10-14 Version: 0.0.2
2
+ - 涉及产品: RDS,查询任务列表返回任务信息
3
+ - 涉及产品: RDS,新增任务进度与状态字段
4
+ - 涉及产品: RDS,返回创建完成取消等时间信息
5
+
6
+ 2026-10-10 Version: 0.0.1
7
+ 新增RDS查询任务列表接口
8
+ - 涉及产品: RDS,支持查询任务列表
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: baiducloud-python-sdk-rds
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Baidu Cloud rdsApi SDK Library for Python
5
5
  Home-page: https://github.com/baidubce/baiducloud-python-sdk
6
6
  Author: Baidu Cloud SDK
@@ -2,4 +2,4 @@
2
2
  This module defines some common string constants.
3
3
  """
4
4
 
5
- SDK_VERSION = b'0.0.1'
5
+ SDK_VERSION = b'0.0.2'
@@ -11,6 +11,7 @@ from baiducloud_python_sdk_core.http import bce_http_client
11
11
  from baiducloud_python_sdk_core.http import handler
12
12
  from baiducloud_python_sdk_core.http import http_methods
13
13
  from baiducloud_python_sdk_core.util import request_body_utils
14
+ from baiducloud_python_sdk_rds.models.query_task_list_response import QueryTaskListResponse
14
15
 
15
16
  _logger = logging.getLogger(__name__)
16
17
 
@@ -44,8 +45,8 @@ class RdsClient(BceBaseClient):
44
45
  :param config: Optional request configuration override
45
46
  :type config: baiducloud_python_sdk_core.BceClientConfiguration
46
47
 
47
- :return: API response
48
- :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
48
+ :return: API response containing QueryTaskListResponse data
49
+ :rtype: QueryTaskListResponse
49
50
 
50
51
  :raises BceClientError: Client error (network failure, invalid parameters, etc.)
51
52
  :raises BceServerError: Server error (4xx/5xx HTTP status codes)
@@ -53,7 +54,13 @@ class RdsClient(BceBaseClient):
53
54
  path = utils.append_uri(b'/', RdsClient.CONSTANT_V1, RdsClient.CONSTANT_INSTANCE, RdsClient.CONSTANT_TASK)
54
55
  headers = None
55
56
  merged_config = self._create_request_with_host(request, config)
56
- return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
57
+ return self._send_request(
58
+ http_methods.POST,
59
+ path=path,
60
+ body=request.to_json_string(),
61
+ config=merged_config,
62
+ model=QueryTaskListResponse,
63
+ )
57
64
 
58
65
  def _merge_config(self, config=None):
59
66
  """
@@ -0,0 +1,8 @@
1
+ """
2
+ Models for rds SDK.
3
+ """
4
+
5
+ from .progress import Progress
6
+ from .query_task_list_request import QueryTaskListRequest
7
+ from .query_task_list_response import QueryTaskListResponse
8
+ from .task import Task
@@ -0,0 +1,115 @@
1
+ """
2
+ Progress information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Progress(AbstractModel):
9
+ """
10
+ Progress
11
+ """
12
+
13
+ def __init__(
14
+ self,
15
+ step=None,
16
+ status=None,
17
+ description=None,
18
+ start_time=None,
19
+ finish_time=None,
20
+ percentage=None,
21
+ estimate_time=None,
22
+ ):
23
+ """
24
+ Initialize Progress instance.
25
+
26
+ :param step: step attribute
27
+ :type step: str (optional)
28
+
29
+ :param status: 步骤状态,可取值:created/running/success/failed
30
+ :type status: str (optional)
31
+
32
+ :param description: 步骤描述
33
+ :type description: str (optional)
34
+
35
+ :param start_time: 步骤开始时间,未开始时可能不返回
36
+ :type start_time: str (optional)
37
+
38
+ :param finish_time: 步骤完成时间,未完成时可能不返回
39
+ :type finish_time: str (optional)
40
+
41
+ :param percentage: 当前步骤完成百分比,取值 0~100
42
+ :type percentage: int (optional)
43
+
44
+ :param estimate_time: 当前步骤预估剩余时间,单位:秒
45
+ :type estimate_time: int (optional)
46
+ """
47
+ super().__init__()
48
+ self.step = step
49
+ self.status = status
50
+ self.description = description
51
+ self.start_time = start_time
52
+ self.finish_time = finish_time
53
+ self.percentage = percentage
54
+ self.estimate_time = estimate_time
55
+
56
+ def to_dict(self):
57
+ """
58
+ Convert the model instance to a dictionary representation.
59
+
60
+ Nested model objects are recursively converted to dictionaries.
61
+
62
+ :return: Dictionary representation of the model
63
+ :rtype: dict
64
+ """
65
+ _map = super().to_dict()
66
+ if _map is not None:
67
+ return _map
68
+ result = dict()
69
+ if self.step is not None:
70
+ result['step'] = self.step
71
+ if self.status is not None:
72
+ result['status'] = self.status
73
+ if self.description is not None:
74
+ result['description'] = self.description
75
+ if self.start_time is not None:
76
+ result['startTime'] = self.start_time
77
+ if self.finish_time is not None:
78
+ result['finishTime'] = self.finish_time
79
+ if self.percentage is not None:
80
+ result['percentage'] = self.percentage
81
+ if self.estimate_time is not None:
82
+ result['estimateTime'] = self.estimate_time
83
+ return result
84
+
85
+ def from_dict(self, m):
86
+ """
87
+ Populate the model instance from a dictionary.
88
+
89
+ Nested dictionaries are recursively converted to model objects.
90
+
91
+ :param m: Dictionary containing model data
92
+ :type m: dict
93
+
94
+ :return: Self reference for method chaining
95
+ :rtype: Progress
96
+
97
+ :raises TypeError: If input is not a dictionary type
98
+ :raises ValueError: If nested model conversion fails
99
+ """
100
+ m = m or dict()
101
+ if m.get('step') is not None:
102
+ self.step = m.get('step')
103
+ if m.get('status') is not None:
104
+ self.status = m.get('status')
105
+ if m.get('description') is not None:
106
+ self.description = m.get('description')
107
+ if m.get('startTime') is not None:
108
+ self.start_time = m.get('startTime')
109
+ if m.get('finishTime') is not None:
110
+ self.finish_time = m.get('finishTime')
111
+ if m.get('percentage') is not None:
112
+ self.percentage = m.get('percentage')
113
+ if m.get('estimateTime') is not None:
114
+ self.estimate_time = m.get('estimateTime')
115
+ return self
@@ -0,0 +1,70 @@
1
+ """
2
+ Request entity for QueryTaskListResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_rds.models.task import Task
7
+
8
+
9
+ class QueryTaskListResponse(BceResponse):
10
+ """
11
+ QueryTaskListResponse
12
+ """
13
+
14
+ def __init__(self, tasks=None, count=None):
15
+ """
16
+ Initialize QueryTaskListResponse response.
17
+
18
+ :param tasks: 任务列表,元素结构见下方 Task
19
+ :type tasks: List[Task] (optional)
20
+
21
+ :param count: 符合查询条件的任务总数
22
+ :type count: int (optional)
23
+ """
24
+ super().__init__()
25
+ self.tasks = tasks
26
+ self.count = count
27
+
28
+ def to_dict(self):
29
+ """
30
+ Convert the response instance to a dictionary representation.
31
+
32
+ Includes metadata from the parent BceResponse class.
33
+ Nested model objects are recursively converted to dictionaries.
34
+
35
+ :return: Dictionary representation of the response
36
+ :rtype: dict
37
+ """
38
+ _map = super().to_dict()
39
+ if _map is not None:
40
+ return _map
41
+ result = dict()
42
+ if self.metadata is not None:
43
+ result['metadata'] = dict(self.metadata)
44
+ if self.tasks is not None:
45
+ result['tasks'] = [i.to_dict() for i in self.tasks]
46
+ if self.count is not None:
47
+ result['count'] = self.count
48
+ return result
49
+
50
+ def from_dict(self, m):
51
+ """
52
+ Populate the response instance from a dictionary.
53
+
54
+ Nested dictionaries are recursively converted to model objects.
55
+
56
+ :param m: Dictionary containing response data
57
+ :type m: dict
58
+
59
+ :return: Self reference for method chaining
60
+ :rtype: QueryTaskListResponse
61
+
62
+ :raises TypeError: If input is not a dictionary or field type mismatch
63
+ :raises ValueError: If nested model conversion fails
64
+ """
65
+ m = m or dict()
66
+ if m.get('tasks') is not None:
67
+ self.tasks = [Task().from_dict(i) for i in m.get('tasks')]
68
+ if m.get('count') is not None:
69
+ self.count = m.get('count')
70
+ return self
@@ -0,0 +1,171 @@
1
+ """
2
+ Task information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_rds.models.progress import Progress
8
+
9
+
10
+ class Task(AbstractModel):
11
+ """
12
+ Task
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ task_id=None,
18
+ task_type=None,
19
+ task_name=None,
20
+ instance_id=None,
21
+ instance_name=None,
22
+ user_id=None,
23
+ region=None,
24
+ task_status=None,
25
+ create_time=None,
26
+ update_time=None,
27
+ finish_time=None,
28
+ cancel_flag=None,
29
+ progress=None,
30
+ ):
31
+ """
32
+ Initialize Task instance.
33
+
34
+ :param task_id: 任务ID
35
+ :type task_id: int (optional)
36
+
37
+ :param task_type: task_type attribute
38
+ :type task_type: str (optional)
39
+
40
+ :param task_name: 任务名称,如:配置变更/主备切换/原地重启实例/迁移可用区/切换重启实例
41
+ :type task_name: str (optional)
42
+
43
+ :param instance_id: 实例ID
44
+ :type instance_id: str (optional)
45
+
46
+ :param instance_name: 实例名称
47
+ :type instance_name: str (optional)
48
+
49
+ :param user_id: 用户ID
50
+ :type user_id: str (optional)
51
+
52
+ :param region: 实例所在地域
53
+ :type region: str (optional)
54
+
55
+ :param task_status: 任务状态,可取值:created/running/success/failed/cancelled
56
+ :type task_status: str (optional)
57
+
58
+ :param create_time: 任务创建时间
59
+ :type create_time: str (optional)
60
+
61
+ :param update_time: 任务更新时间
62
+ :type update_time: str (optional)
63
+
64
+ :param finish_time: 任务完成时间,未完成时为 `0000-00-00 00:00:00`
65
+ :type finish_time: str (optional)
66
+
67
+ :param cancel_flag: 是否可取消标志,0:不可取消,1:可取消
68
+ :type cancel_flag: int (optional)
69
+
70
+ :param progress: 任务进度步骤列表,元素结构见下方 Progress
71
+ :type progress: List[Progress] (optional)
72
+ """
73
+ super().__init__()
74
+ self.task_id = task_id
75
+ self.task_type = task_type
76
+ self.task_name = task_name
77
+ self.instance_id = instance_id
78
+ self.instance_name = instance_name
79
+ self.user_id = user_id
80
+ self.region = region
81
+ self.task_status = task_status
82
+ self.create_time = create_time
83
+ self.update_time = update_time
84
+ self.finish_time = finish_time
85
+ self.cancel_flag = cancel_flag
86
+ self.progress = progress
87
+
88
+ def to_dict(self):
89
+ """
90
+ Convert the model instance to a dictionary representation.
91
+
92
+ Nested model objects are recursively converted to dictionaries.
93
+
94
+ :return: Dictionary representation of the model
95
+ :rtype: dict
96
+ """
97
+ _map = super().to_dict()
98
+ if _map is not None:
99
+ return _map
100
+ result = dict()
101
+ if self.task_id is not None:
102
+ result['taskId'] = self.task_id
103
+ if self.task_type is not None:
104
+ result['taskType'] = self.task_type
105
+ if self.task_name is not None:
106
+ result['taskName'] = self.task_name
107
+ if self.instance_id is not None:
108
+ result['instanceId'] = self.instance_id
109
+ if self.instance_name is not None:
110
+ result['instanceName'] = self.instance_name
111
+ if self.user_id is not None:
112
+ result['userId'] = self.user_id
113
+ if self.region is not None:
114
+ result['region'] = self.region
115
+ if self.task_status is not None:
116
+ result['taskStatus'] = self.task_status
117
+ if self.create_time is not None:
118
+ result['createTime'] = self.create_time
119
+ if self.update_time is not None:
120
+ result['updateTime'] = self.update_time
121
+ if self.finish_time is not None:
122
+ result['finishTime'] = self.finish_time
123
+ if self.cancel_flag is not None:
124
+ result['cancelFlag'] = self.cancel_flag
125
+ if self.progress is not None:
126
+ result['progress'] = [i.to_dict() for i in self.progress]
127
+ return result
128
+
129
+ def from_dict(self, m):
130
+ """
131
+ Populate the model instance from a dictionary.
132
+
133
+ Nested dictionaries are recursively converted to model objects.
134
+
135
+ :param m: Dictionary containing model data
136
+ :type m: dict
137
+
138
+ :return: Self reference for method chaining
139
+ :rtype: Task
140
+
141
+ :raises TypeError: If input is not a dictionary type
142
+ :raises ValueError: If nested model conversion fails
143
+ """
144
+ m = m or dict()
145
+ if m.get('taskId') is not None:
146
+ self.task_id = m.get('taskId')
147
+ if m.get('taskType') is not None:
148
+ self.task_type = m.get('taskType')
149
+ if m.get('taskName') is not None:
150
+ self.task_name = m.get('taskName')
151
+ if m.get('instanceId') is not None:
152
+ self.instance_id = m.get('instanceId')
153
+ if m.get('instanceName') is not None:
154
+ self.instance_name = m.get('instanceName')
155
+ if m.get('userId') is not None:
156
+ self.user_id = m.get('userId')
157
+ if m.get('region') is not None:
158
+ self.region = m.get('region')
159
+ if m.get('taskStatus') is not None:
160
+ self.task_status = m.get('taskStatus')
161
+ if m.get('createTime') is not None:
162
+ self.create_time = m.get('createTime')
163
+ if m.get('updateTime') is not None:
164
+ self.update_time = m.get('updateTime')
165
+ if m.get('finishTime') is not None:
166
+ self.finish_time = m.get('finishTime')
167
+ if m.get('cancelFlag') is not None:
168
+ self.cancel_flag = m.get('cancelFlag')
169
+ if m.get('progress') is not None:
170
+ self.progress = [Progress().from_dict(i) for i in m.get('progress')]
171
+ return self
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: baiducloud-python-sdk-rds
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Baidu Cloud rdsApi SDK Library for Python
5
5
  Home-page: https://github.com/baidubce/baiducloud-python-sdk
6
6
  Author: Baidu Cloud SDK
@@ -14,4 +14,7 @@ baiducloud_python_sdk_rds.egg-info/top_level.txt
14
14
  baiducloud_python_sdk_rds/api/__init__.py
15
15
  baiducloud_python_sdk_rds/api/rds_client.py
16
16
  baiducloud_python_sdk_rds/models/__init__.py
17
- baiducloud_python_sdk_rds/models/query_task_list_request.py
17
+ baiducloud_python_sdk_rds/models/progress.py
18
+ baiducloud_python_sdk_rds/models/query_task_list_request.py
19
+ baiducloud_python_sdk_rds/models/query_task_list_response.py
20
+ baiducloud_python_sdk_rds/models/task.py
@@ -1,3 +0,0 @@
1
- 2026-10-10 Version: 0.0.1
2
- 新增RDS查询任务列表接口
3
- - 涉及产品: RDS,支持查询任务列表
@@ -1,5 +0,0 @@
1
- """
2
- Models for rds SDK.
3
- """
4
-
5
- from .query_task_list_request import QueryTaskListRequest