baiducloud-python-sdk-bls 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_bls/__init__.py +5 -0
- baiducloud_python_sdk_bls/api/__init__.py +0 -0
- baiducloud_python_sdk_bls/api/bls_client.py +378 -0
- baiducloud_python_sdk_bls/models/__init__.py +33 -0
- baiducloud_python_sdk_bls/models/bucket.py +66 -0
- baiducloud_python_sdk_bls/models/create_project_request.py +68 -0
- baiducloud_python_sdk_bls/models/create_project_response.py +78 -0
- baiducloud_python_sdk_bls/models/dataset_scan_info.py +68 -0
- baiducloud_python_sdk_bls/models/delete_project_request.py +58 -0
- baiducloud_python_sdk_bls/models/delete_project_response.py +77 -0
- baiducloud_python_sdk_bls/models/describe_project_request.py +58 -0
- baiducloud_python_sdk_bls/models/describe_project_response.py +86 -0
- baiducloud_python_sdk_bls/models/list_project_request.py +100 -0
- baiducloud_python_sdk_bls/models/list_project_response.py +86 -0
- baiducloud_python_sdk_bls/models/log_record.py +66 -0
- baiducloud_python_sdk_bls/models/log_tag.py +66 -0
- baiducloud_python_sdk_bls/models/project.py +115 -0
- baiducloud_python_sdk_bls/models/project_list_result.py +112 -0
- baiducloud_python_sdk_bls/models/project_result.py +60 -0
- baiducloud_python_sdk_bls/models/pull_log_record_request.py +96 -0
- baiducloud_python_sdk_bls/models/pull_log_record_response.py +86 -0
- baiducloud_python_sdk_bls/models/push_log_record_request.py +98 -0
- baiducloud_python_sdk_bls/models/push_log_record_response.py +69 -0
- baiducloud_python_sdk_bls/models/query_log_histogram_request.py +88 -0
- baiducloud_python_sdk_bls/models/query_log_histogram_response.py +71 -0
- baiducloud_python_sdk_bls/models/query_log_record_request.py +131 -0
- baiducloud_python_sdk_bls/models/query_log_record_response.py +79 -0
- baiducloud_python_sdk_bls/models/result_set.py +82 -0
- baiducloud_python_sdk_bls/models/search_info.py +74 -0
- baiducloud_python_sdk_bls/models/search_statistic.py +84 -0
- baiducloud_python_sdk_bls/models/statistics.py +74 -0
- baiducloud_python_sdk_bls/models/update_project_request.py +68 -0
- baiducloud_python_sdk_bls/models/update_project_response.py +77 -0
- baiducloud_python_sdk_bls-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_bls-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_bls-0.0.1.dist-info/RECORD +38 -0
- baiducloud_python_sdk_bls-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_bls-0.0.1.dist-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Example for bls client.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
import logging
|
|
7
|
+
|
|
8
|
+
from baiducloud_python_sdk_core import utils, bce_base_client
|
|
9
|
+
from baiducloud_python_sdk_core.auth import bce_v1_signer
|
|
10
|
+
from baiducloud_python_sdk_core.bce_base_client import BceBaseClient
|
|
11
|
+
from baiducloud_python_sdk_core.http import bce_http_client
|
|
12
|
+
from baiducloud_python_sdk_core.http import handler
|
|
13
|
+
from baiducloud_python_sdk_core.http import http_methods
|
|
14
|
+
from baiducloud_python_sdk_bls.models.create_project_response import CreateProjectResponse
|
|
15
|
+
from baiducloud_python_sdk_bls.models.delete_project_response import DeleteProjectResponse
|
|
16
|
+
from baiducloud_python_sdk_bls.models.describe_project_response import DescribeProjectResponse
|
|
17
|
+
from baiducloud_python_sdk_bls.models.list_project_response import ListProjectResponse
|
|
18
|
+
from baiducloud_python_sdk_bls.models.pull_log_record_response import PullLogRecordResponse
|
|
19
|
+
from baiducloud_python_sdk_bls.models.push_log_record_response import PushLogRecordResponse
|
|
20
|
+
from baiducloud_python_sdk_bls.models.query_log_histogram_response import QueryLogHistogramResponse
|
|
21
|
+
from baiducloud_python_sdk_bls.models.query_log_record_response import QueryLogRecordResponse
|
|
22
|
+
from baiducloud_python_sdk_bls.models.update_project_response import UpdateProjectResponse
|
|
23
|
+
|
|
24
|
+
_logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class BlsClient(BceBaseClient):
|
|
28
|
+
"""
|
|
29
|
+
bls base sdk client
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
VERSION_V1 = b'/v1'
|
|
33
|
+
|
|
34
|
+
VERSION_V2 = b'/v2'
|
|
35
|
+
|
|
36
|
+
CONSTANT_PROJECT = b'project'
|
|
37
|
+
|
|
38
|
+
CONSTANT_LOGSTORE = b'logstore'
|
|
39
|
+
|
|
40
|
+
CONSTANT_LOGRECORD = b'logrecord'
|
|
41
|
+
|
|
42
|
+
CONSTANT_LIST = b'list'
|
|
43
|
+
|
|
44
|
+
CONSTANT_LOGHISTOGRAM = b'loghistogram'
|
|
45
|
+
|
|
46
|
+
def __init__(self, config=None):
|
|
47
|
+
"""
|
|
48
|
+
Initialize the bls client.
|
|
49
|
+
|
|
50
|
+
:param config: Client configuration
|
|
51
|
+
:type config: baidubce.BceClientConfiguration
|
|
52
|
+
"""
|
|
53
|
+
bce_base_client.BceBaseClient.__init__(self, config)
|
|
54
|
+
|
|
55
|
+
def create_project(self, request, config=None):
|
|
56
|
+
"""
|
|
57
|
+
create_project
|
|
58
|
+
|
|
59
|
+
:param request: Request entity containing all parameters
|
|
60
|
+
:type request: BlsClientRequest
|
|
61
|
+
:param config: Optional request configuration override
|
|
62
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
63
|
+
|
|
64
|
+
:return: API response containing CreateProjectResponse data
|
|
65
|
+
:rtype: CreateProjectResponse
|
|
66
|
+
|
|
67
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
68
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
69
|
+
"""
|
|
70
|
+
path = utils.append_uri(BlsClient.VERSION_V1, BlsClient.CONSTANT_PROJECT)
|
|
71
|
+
headers = None
|
|
72
|
+
merged_config = self._create_request_with_host(request, config)
|
|
73
|
+
return self._send_request(
|
|
74
|
+
http_methods.POST,
|
|
75
|
+
path=path,
|
|
76
|
+
body=request.to_json_string(),
|
|
77
|
+
config=merged_config,
|
|
78
|
+
model=CreateProjectResponse,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def delete_project(self, request, config=None):
|
|
82
|
+
"""
|
|
83
|
+
delete_project
|
|
84
|
+
|
|
85
|
+
:param request: Request entity containing all parameters
|
|
86
|
+
:type request: BlsClientRequest
|
|
87
|
+
:param config: Optional request configuration override
|
|
88
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
89
|
+
|
|
90
|
+
:return: API response containing DeleteProjectResponse data
|
|
91
|
+
:rtype: DeleteProjectResponse
|
|
92
|
+
|
|
93
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
94
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
95
|
+
"""
|
|
96
|
+
path = utils.append_uri(BlsClient.VERSION_V1, BlsClient.CONSTANT_PROJECT, request.uuid)
|
|
97
|
+
headers = None
|
|
98
|
+
merged_config = self._create_request_with_host(request, config)
|
|
99
|
+
return self._send_request(http_methods.DELETE, path=path, config=merged_config, model=DeleteProjectResponse)
|
|
100
|
+
|
|
101
|
+
def describe_project(self, request, config=None):
|
|
102
|
+
"""
|
|
103
|
+
describe_project
|
|
104
|
+
|
|
105
|
+
:param request: Request entity containing all parameters
|
|
106
|
+
:type request: BlsClientRequest
|
|
107
|
+
:param config: Optional request configuration override
|
|
108
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
109
|
+
|
|
110
|
+
:return: API response containing DescribeProjectResponse data
|
|
111
|
+
:rtype: DescribeProjectResponse
|
|
112
|
+
|
|
113
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
114
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
115
|
+
"""
|
|
116
|
+
path = utils.append_uri(BlsClient.VERSION_V1, BlsClient.CONSTANT_PROJECT, request.uuid)
|
|
117
|
+
headers = None
|
|
118
|
+
merged_config = self._create_request_with_host(request, config)
|
|
119
|
+
return self._send_request(http_methods.GET, path=path, config=merged_config, model=DescribeProjectResponse)
|
|
120
|
+
|
|
121
|
+
def list_project(self, request, config=None):
|
|
122
|
+
"""
|
|
123
|
+
list_project
|
|
124
|
+
|
|
125
|
+
:param request: Request entity containing all parameters
|
|
126
|
+
:type request: BlsClientRequest
|
|
127
|
+
:param config: Optional request configuration override
|
|
128
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
129
|
+
|
|
130
|
+
:return: API response containing ListProjectResponse data
|
|
131
|
+
:rtype: ListProjectResponse
|
|
132
|
+
|
|
133
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
134
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
135
|
+
"""
|
|
136
|
+
path = utils.append_uri(BlsClient.VERSION_V1, BlsClient.CONSTANT_PROJECT, BlsClient.CONSTANT_LIST)
|
|
137
|
+
headers = None
|
|
138
|
+
merged_config = self._create_request_with_host(request, config)
|
|
139
|
+
return self._send_request(
|
|
140
|
+
http_methods.POST,
|
|
141
|
+
path=path,
|
|
142
|
+
body=request.to_json_string(),
|
|
143
|
+
config=merged_config,
|
|
144
|
+
model=ListProjectResponse,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
def pull_log_record(self, request, config=None):
|
|
148
|
+
"""
|
|
149
|
+
pull_log_record
|
|
150
|
+
|
|
151
|
+
:param request: Request entity containing all parameters
|
|
152
|
+
:type request: BlsClientRequest
|
|
153
|
+
:param config: Optional request configuration override
|
|
154
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
155
|
+
|
|
156
|
+
:return: API response containing PullLogRecordResponse data
|
|
157
|
+
:rtype: PullLogRecordResponse
|
|
158
|
+
|
|
159
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
160
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
161
|
+
"""
|
|
162
|
+
path = utils.append_uri(
|
|
163
|
+
BlsClient.VERSION_V1, BlsClient.CONSTANT_LOGSTORE, request.log_store_name, BlsClient.CONSTANT_LOGRECORD
|
|
164
|
+
)
|
|
165
|
+
headers = None
|
|
166
|
+
params = {}
|
|
167
|
+
if request.log_stream_name is not None:
|
|
168
|
+
params['logStreamName'] = request.log_stream_name
|
|
169
|
+
if request.start_date_time is not None:
|
|
170
|
+
params['startDateTime'] = request.start_date_time
|
|
171
|
+
if request.end_date_time is not None:
|
|
172
|
+
params['endDateTime'] = request.end_date_time
|
|
173
|
+
if request.project is not None:
|
|
174
|
+
params['project'] = request.project
|
|
175
|
+
if request.limit is not None:
|
|
176
|
+
params['limit'] = request.limit
|
|
177
|
+
if request.marker is not None:
|
|
178
|
+
params['marker'] = request.marker
|
|
179
|
+
merged_config = self._create_request_with_host(request, config)
|
|
180
|
+
return self._send_request(
|
|
181
|
+
http_methods.GET, path=path, params=params, config=merged_config, model=PullLogRecordResponse
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
def push_log_record(self, request, config=None):
|
|
185
|
+
"""
|
|
186
|
+
push_log_record
|
|
187
|
+
|
|
188
|
+
:param request: Request entity containing all parameters
|
|
189
|
+
:type request: BlsClientRequest
|
|
190
|
+
:param config: Optional request configuration override
|
|
191
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
192
|
+
|
|
193
|
+
:return: API response containing PushLogRecordResponse data
|
|
194
|
+
:rtype: PushLogRecordResponse
|
|
195
|
+
|
|
196
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
197
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
198
|
+
"""
|
|
199
|
+
path = utils.append_uri(
|
|
200
|
+
BlsClient.VERSION_V1, BlsClient.CONSTANT_LOGSTORE, request.log_store_name, BlsClient.CONSTANT_LOGRECORD
|
|
201
|
+
)
|
|
202
|
+
headers = None
|
|
203
|
+
params = {}
|
|
204
|
+
if request.project is not None:
|
|
205
|
+
params['project'] = request.project
|
|
206
|
+
merged_config = self._create_request_with_host(request, config)
|
|
207
|
+
return self._send_request(
|
|
208
|
+
http_methods.POST,
|
|
209
|
+
path=path,
|
|
210
|
+
body=request.to_json_string(),
|
|
211
|
+
params=params,
|
|
212
|
+
config=merged_config,
|
|
213
|
+
model=PushLogRecordResponse,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
def query_log_histogram(self, request, config=None):
|
|
217
|
+
"""
|
|
218
|
+
query_log_histogram
|
|
219
|
+
|
|
220
|
+
:param request: Request entity containing all parameters
|
|
221
|
+
:type request: BlsClientRequest
|
|
222
|
+
:param config: Optional request configuration override
|
|
223
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
224
|
+
|
|
225
|
+
:return: API response containing QueryLogHistogramResponse data
|
|
226
|
+
:rtype: QueryLogHistogramResponse
|
|
227
|
+
|
|
228
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
229
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
230
|
+
"""
|
|
231
|
+
path = utils.append_uri(
|
|
232
|
+
BlsClient.VERSION_V2, BlsClient.CONSTANT_LOGSTORE, request.log_store_name, BlsClient.CONSTANT_LOGHISTOGRAM
|
|
233
|
+
)
|
|
234
|
+
headers = None
|
|
235
|
+
params = {}
|
|
236
|
+
if request.query is not None:
|
|
237
|
+
params['query'] = request.query
|
|
238
|
+
if request.start_date_time is not None:
|
|
239
|
+
params['startDateTime'] = request.start_date_time
|
|
240
|
+
if request.end_date_time is not None:
|
|
241
|
+
params['endDateTime'] = request.end_date_time
|
|
242
|
+
if request.project is not None:
|
|
243
|
+
params['project'] = request.project
|
|
244
|
+
if request.log_stream_name is not None:
|
|
245
|
+
params['logStreamName'] = request.log_stream_name
|
|
246
|
+
merged_config = self._create_request_with_host(request, config)
|
|
247
|
+
return self._send_request(
|
|
248
|
+
http_methods.GET, path=path, params=params, config=merged_config, model=QueryLogHistogramResponse
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
def query_log_record(self, request, config=None):
|
|
252
|
+
"""
|
|
253
|
+
query_log_record
|
|
254
|
+
|
|
255
|
+
:param request: Request entity containing all parameters
|
|
256
|
+
:type request: BlsClientRequest
|
|
257
|
+
:param config: Optional request configuration override
|
|
258
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
259
|
+
|
|
260
|
+
:return: API response containing QueryLogRecordResponse data
|
|
261
|
+
:rtype: QueryLogRecordResponse
|
|
262
|
+
|
|
263
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
264
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
265
|
+
"""
|
|
266
|
+
path = utils.append_uri(
|
|
267
|
+
BlsClient.VERSION_V1, BlsClient.CONSTANT_LOGSTORE, request.log_store_name, BlsClient.CONSTANT_LOGRECORD
|
|
268
|
+
)
|
|
269
|
+
headers = None
|
|
270
|
+
params = {}
|
|
271
|
+
if request.query is not None:
|
|
272
|
+
params['query'] = request.query
|
|
273
|
+
if request.start_date_time is not None:
|
|
274
|
+
params['startDateTime'] = request.start_date_time
|
|
275
|
+
if request.end_date_time is not None:
|
|
276
|
+
params['endDateTime'] = request.end_date_time
|
|
277
|
+
if request.project is not None:
|
|
278
|
+
params['project'] = request.project
|
|
279
|
+
if request.log_stream_name is not None:
|
|
280
|
+
params['logStreamName'] = request.log_stream_name
|
|
281
|
+
if request.marker is not None:
|
|
282
|
+
params['marker'] = request.marker
|
|
283
|
+
if request.limit is not None:
|
|
284
|
+
params['limit'] = request.limit
|
|
285
|
+
if request.sort is not None:
|
|
286
|
+
params['sort'] = request.sort
|
|
287
|
+
if request.page_no is not None:
|
|
288
|
+
params['pageNo'] = request.page_no
|
|
289
|
+
if request.page_size is not None:
|
|
290
|
+
params['pageSize'] = request.page_size
|
|
291
|
+
merged_config = self._create_request_with_host(request, config)
|
|
292
|
+
return self._send_request(
|
|
293
|
+
http_methods.GET, path=path, params=params, config=merged_config, model=QueryLogRecordResponse
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
def update_project(self, request, config=None):
|
|
297
|
+
"""
|
|
298
|
+
update_project
|
|
299
|
+
|
|
300
|
+
:param request: Request entity containing all parameters
|
|
301
|
+
:type request: BlsClientRequest
|
|
302
|
+
:param config: Optional request configuration override
|
|
303
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
304
|
+
|
|
305
|
+
:return: API response containing UpdateProjectResponse data
|
|
306
|
+
:rtype: UpdateProjectResponse
|
|
307
|
+
|
|
308
|
+
:raises BceClientError: Client error (network failure, invalid parameters, etc.)
|
|
309
|
+
:raises BceServerError: Server error (4xx/5xx HTTP status codes)
|
|
310
|
+
"""
|
|
311
|
+
path = utils.append_uri(BlsClient.VERSION_V1, BlsClient.CONSTANT_PROJECT)
|
|
312
|
+
headers = None
|
|
313
|
+
merged_config = self._create_request_with_host(request, config)
|
|
314
|
+
return self._send_request(
|
|
315
|
+
http_methods.PUT,
|
|
316
|
+
path=path,
|
|
317
|
+
body=request.to_json_string(),
|
|
318
|
+
config=merged_config,
|
|
319
|
+
model=UpdateProjectResponse,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
def _merge_config(self, config=None):
|
|
323
|
+
"""
|
|
324
|
+
:param config:
|
|
325
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
326
|
+
"""
|
|
327
|
+
if config is None:
|
|
328
|
+
return self.config
|
|
329
|
+
else:
|
|
330
|
+
new_config = copy.copy(self.config)
|
|
331
|
+
new_config.merge_non_none_values(config)
|
|
332
|
+
return new_config
|
|
333
|
+
|
|
334
|
+
def _send_request(
|
|
335
|
+
self, http_method, path, body=None, headers=None, params=None, config=None, body_parser=None, model=None
|
|
336
|
+
):
|
|
337
|
+
"""
|
|
338
|
+
Send an HTTP request to the service endpoint.
|
|
339
|
+
|
|
340
|
+
:param http_method: HTTP method (GET, POST, PUT, DELETE, etc.)
|
|
341
|
+
:type http_method: bytes
|
|
342
|
+
:param path: Request path
|
|
343
|
+
:type path: bytes
|
|
344
|
+
:param body: Optional request body
|
|
345
|
+
:type body: str or bytes
|
|
346
|
+
:param headers: Optional HTTP headers
|
|
347
|
+
:type headers: dict
|
|
348
|
+
:param params: Optional query parameters
|
|
349
|
+
:type params: dict
|
|
350
|
+
:param config: Optional request configuration override
|
|
351
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
352
|
+
:param body_parser: Optional custom body parser function
|
|
353
|
+
:type body_parser: callable
|
|
354
|
+
:param model: Optional response model class for deserialization
|
|
355
|
+
:type model: class
|
|
356
|
+
|
|
357
|
+
:return: API response
|
|
358
|
+
:rtype: baiducloud_python_sdk_core.bce_response.BceResponse
|
|
359
|
+
|
|
360
|
+
:raises BceClientError: Client error (network connection failure, SSL errors, etc.)
|
|
361
|
+
:raises BceServerError: Server returned error response
|
|
362
|
+
"""
|
|
363
|
+
config = self._merge_config(config)
|
|
364
|
+
if body_parser is None:
|
|
365
|
+
body_parser = handler.parse_json
|
|
366
|
+
if headers is None:
|
|
367
|
+
headers = {b'Accept': b'*/*', b'Content-Type': b'application/json;charset=utf-8'}
|
|
368
|
+
return bce_http_client.send_request(
|
|
369
|
+
config,
|
|
370
|
+
bce_v1_signer.sign,
|
|
371
|
+
[handler.parse_error, body_parser],
|
|
372
|
+
http_method,
|
|
373
|
+
path,
|
|
374
|
+
body,
|
|
375
|
+
headers,
|
|
376
|
+
params,
|
|
377
|
+
model=model,
|
|
378
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Models for bls SDK.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .bucket import Bucket
|
|
6
|
+
from .create_project_request import CreateProjectRequest
|
|
7
|
+
from .create_project_response import CreateProjectResponse
|
|
8
|
+
from .dataset_scan_info import DatasetScanInfo
|
|
9
|
+
from .delete_project_response import DeleteProjectResponse
|
|
10
|
+
from .describe_project_response import DescribeProjectResponse
|
|
11
|
+
from .list_project_request import ListProjectRequest
|
|
12
|
+
from .list_project_response import ListProjectResponse
|
|
13
|
+
from .log_record import LogRecord
|
|
14
|
+
from .log_tag import LogTag
|
|
15
|
+
from .project import Project
|
|
16
|
+
from .project_list_result import ProjectListResult
|
|
17
|
+
from .project_result import ProjectResult
|
|
18
|
+
from .pull_log_record_response import PullLogRecordResponse
|
|
19
|
+
from .push_log_record_request import PushLogRecordRequest
|
|
20
|
+
from .push_log_record_response import PushLogRecordResponse
|
|
21
|
+
from .query_log_histogram_response import QueryLogHistogramResponse
|
|
22
|
+
from .query_log_record_response import QueryLogRecordResponse
|
|
23
|
+
from .result_set import ResultSet
|
|
24
|
+
from .search_info import SearchInfo
|
|
25
|
+
from .search_statistic import SearchStatistic
|
|
26
|
+
from .statistics import Statistics
|
|
27
|
+
from .update_project_request import UpdateProjectRequest
|
|
28
|
+
from .update_project_response import UpdateProjectResponse
|
|
29
|
+
from .describe_project_request import DescribeProjectRequest
|
|
30
|
+
from .delete_project_request import DeleteProjectRequest
|
|
31
|
+
from .query_log_record_request import QueryLogRecordRequest
|
|
32
|
+
from .query_log_histogram_request import QueryLogHistogramRequest
|
|
33
|
+
from .pull_log_record_request import PullLogRecordRequest
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Bucket information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Bucket(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Bucket
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, key=None, doc_count=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize Bucket instance.
|
|
16
|
+
|
|
17
|
+
:param key: key attribute
|
|
18
|
+
:type key: int (optional)
|
|
19
|
+
|
|
20
|
+
:param doc_count: 时间区间内的文档数量
|
|
21
|
+
:type doc_count: int (optional)
|
|
22
|
+
"""
|
|
23
|
+
super().__init__()
|
|
24
|
+
self.key = key
|
|
25
|
+
self.doc_count = doc_count
|
|
26
|
+
|
|
27
|
+
def to_dict(self):
|
|
28
|
+
"""
|
|
29
|
+
Convert the model instance to a dictionary representation.
|
|
30
|
+
|
|
31
|
+
Nested model objects are recursively converted to dictionaries.
|
|
32
|
+
|
|
33
|
+
:return: Dictionary representation of the model
|
|
34
|
+
:rtype: dict
|
|
35
|
+
"""
|
|
36
|
+
_map = super().to_dict()
|
|
37
|
+
if _map is not None:
|
|
38
|
+
return _map
|
|
39
|
+
result = dict()
|
|
40
|
+
if self.key is not None:
|
|
41
|
+
result['key'] = self.key
|
|
42
|
+
if self.doc_count is not None:
|
|
43
|
+
result['doc_count'] = self.doc_count
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
def from_dict(self, m):
|
|
47
|
+
"""
|
|
48
|
+
Populate the model instance from a dictionary.
|
|
49
|
+
|
|
50
|
+
Nested dictionaries are recursively converted to model objects.
|
|
51
|
+
|
|
52
|
+
:param m: Dictionary containing model data
|
|
53
|
+
:type m: dict
|
|
54
|
+
|
|
55
|
+
:return: Self reference for method chaining
|
|
56
|
+
:rtype: Bucket
|
|
57
|
+
|
|
58
|
+
:raises TypeError: If input is not a dictionary type
|
|
59
|
+
:raises ValueError: If nested model conversion fails
|
|
60
|
+
"""
|
|
61
|
+
m = m or dict()
|
|
62
|
+
if m.get('key') is not None:
|
|
63
|
+
self.key = m.get('key')
|
|
64
|
+
if m.get('doc_count') is not None:
|
|
65
|
+
self.doc_count = m.get('doc_count')
|
|
66
|
+
return self
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for CreateProjectRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CreateProjectRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for CreateProjectRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, name, description=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize CreateProjectRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param name: 日志组名称
|
|
20
|
+
:type name: str (required)
|
|
21
|
+
|
|
22
|
+
:param description: 日志组描述
|
|
23
|
+
:type description: str (optional)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.name = name
|
|
27
|
+
self.description = description
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""
|
|
31
|
+
Convert the request entity to a dictionary representation.
|
|
32
|
+
|
|
33
|
+
Nested model objects are recursively converted to dictionaries.
|
|
34
|
+
|
|
35
|
+
:return: Dictionary representation of the request
|
|
36
|
+
:rtype: dict
|
|
37
|
+
"""
|
|
38
|
+
_map = super().to_dict()
|
|
39
|
+
if _map is not None:
|
|
40
|
+
return _map
|
|
41
|
+
result = dict()
|
|
42
|
+
if self.name is not None:
|
|
43
|
+
result['name'] = self.name
|
|
44
|
+
if self.description is not None:
|
|
45
|
+
result['description'] = self.description
|
|
46
|
+
return result
|
|
47
|
+
|
|
48
|
+
def from_dict(self, m):
|
|
49
|
+
"""
|
|
50
|
+
Populate the request entity from a dictionary.
|
|
51
|
+
|
|
52
|
+
Nested dictionaries are recursively converted to model objects.
|
|
53
|
+
|
|
54
|
+
:param m: Dictionary containing request data
|
|
55
|
+
:type m: dict
|
|
56
|
+
|
|
57
|
+
:return: Self reference for method chaining
|
|
58
|
+
:rtype: CreateProjectRequest
|
|
59
|
+
|
|
60
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
61
|
+
:raises ValueError: If nested model conversion fails
|
|
62
|
+
"""
|
|
63
|
+
m = m or dict()
|
|
64
|
+
if m.get('name') is not None:
|
|
65
|
+
self.name = m.get('name')
|
|
66
|
+
if m.get('description') is not None:
|
|
67
|
+
self.description = m.get('description')
|
|
68
|
+
return self
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CreateProjectResponse information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CreateProjectResponse(BceResponse):
|
|
9
|
+
"""
|
|
10
|
+
CreateProjectResponse
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, success=None, code=None, message=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize CreateProjectResponse instance.
|
|
16
|
+
|
|
17
|
+
:param success: 请求是否成功
|
|
18
|
+
:type success: bool (optional)
|
|
19
|
+
|
|
20
|
+
:param code: 请求码,成功为OK,错误为具体的错误码
|
|
21
|
+
:type code: str (optional)
|
|
22
|
+
|
|
23
|
+
:param message: 请求成功为空,失败为具体的错误信息
|
|
24
|
+
:type message: str (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.success = success
|
|
28
|
+
self.code = code
|
|
29
|
+
self.message = message
|
|
30
|
+
|
|
31
|
+
def to_dict(self):
|
|
32
|
+
"""
|
|
33
|
+
Convert the model instance to a dictionary representation.
|
|
34
|
+
|
|
35
|
+
Nested model objects are recursively converted to dictionaries.
|
|
36
|
+
|
|
37
|
+
Includes metadata from the parent BceResponse class.
|
|
38
|
+
|
|
39
|
+
:return: Dictionary representation of the model
|
|
40
|
+
:rtype: dict
|
|
41
|
+
"""
|
|
42
|
+
_map = super().to_dict()
|
|
43
|
+
if _map is not None:
|
|
44
|
+
return _map
|
|
45
|
+
result = dict()
|
|
46
|
+
if self.metadata is not None:
|
|
47
|
+
result['metadata'] = dict(self.metadata)
|
|
48
|
+
if self.success is not None:
|
|
49
|
+
result['success'] = self.success
|
|
50
|
+
if self.code is not None:
|
|
51
|
+
result['code'] = self.code
|
|
52
|
+
if self.message is not None:
|
|
53
|
+
result['message'] = self.message
|
|
54
|
+
return result
|
|
55
|
+
|
|
56
|
+
def from_dict(self, m):
|
|
57
|
+
"""
|
|
58
|
+
Populate the model instance from a dictionary.
|
|
59
|
+
|
|
60
|
+
Nested dictionaries are recursively converted to model objects.
|
|
61
|
+
|
|
62
|
+
:param m: Dictionary containing model data
|
|
63
|
+
:type m: dict
|
|
64
|
+
|
|
65
|
+
:return: Self reference for method chaining
|
|
66
|
+
:rtype: CreateProjectResponse
|
|
67
|
+
|
|
68
|
+
:raises TypeError: If input is not a dictionary type
|
|
69
|
+
:raises ValueError: If nested model conversion fails
|
|
70
|
+
"""
|
|
71
|
+
m = m or dict()
|
|
72
|
+
if m.get('success') is not None:
|
|
73
|
+
self.success = m.get('success')
|
|
74
|
+
if m.get('code') is not None:
|
|
75
|
+
self.code = m.get('code')
|
|
76
|
+
if m.get('message') is not None:
|
|
77
|
+
self.message = m.get('message')
|
|
78
|
+
return self
|