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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for QueryLogHistogramRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class QueryLogHistogramRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for QueryLogHistogramRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, log_store_name, query, start_date_time, end_date_time, project=None, log_stream_name=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize QueryLogHistogramRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param log_store_name: log_store_name parameter
|
|
20
|
+
:type log_store_name: str (required)
|
|
21
|
+
|
|
22
|
+
:param project: project parameter
|
|
23
|
+
:type project: str (optional)
|
|
24
|
+
|
|
25
|
+
:param log_stream_name: log_stream_name parameter
|
|
26
|
+
:type log_stream_name: str (optional)
|
|
27
|
+
|
|
28
|
+
:param query: query parameter
|
|
29
|
+
:type query: str (required)
|
|
30
|
+
|
|
31
|
+
:param start_date_time: start_date_time parameter
|
|
32
|
+
:type start_date_time: datetime (required)
|
|
33
|
+
|
|
34
|
+
:param end_date_time: end_date_time parameter
|
|
35
|
+
:type end_date_time: datetime (required)
|
|
36
|
+
"""
|
|
37
|
+
super().__init__()
|
|
38
|
+
self.log_store_name = log_store_name
|
|
39
|
+
self.project = project
|
|
40
|
+
self.log_stream_name = log_stream_name
|
|
41
|
+
self.query = query
|
|
42
|
+
self.start_date_time = start_date_time
|
|
43
|
+
self.end_date_time = end_date_time
|
|
44
|
+
|
|
45
|
+
def to_dict(self):
|
|
46
|
+
"""
|
|
47
|
+
Convert the request entity to a dictionary representation.
|
|
48
|
+
|
|
49
|
+
Nested model objects are recursively converted to dictionaries.
|
|
50
|
+
|
|
51
|
+
:return: Dictionary representation of the request
|
|
52
|
+
:rtype: dict
|
|
53
|
+
"""
|
|
54
|
+
_map = super().to_dict()
|
|
55
|
+
if _map is not None:
|
|
56
|
+
return _map
|
|
57
|
+
result = dict()
|
|
58
|
+
return result
|
|
59
|
+
|
|
60
|
+
def from_dict(self, m):
|
|
61
|
+
"""
|
|
62
|
+
Populate the request entity from a dictionary.
|
|
63
|
+
|
|
64
|
+
Nested dictionaries are recursively converted to model objects.
|
|
65
|
+
|
|
66
|
+
:param m: Dictionary containing request data
|
|
67
|
+
:type m: dict
|
|
68
|
+
|
|
69
|
+
:return: Self reference for method chaining
|
|
70
|
+
:rtype: QueryLogHistogramRequest
|
|
71
|
+
|
|
72
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
73
|
+
:raises ValueError: If nested model conversion fails
|
|
74
|
+
"""
|
|
75
|
+
m = m or dict()
|
|
76
|
+
if m.get('logStoreName') is not None:
|
|
77
|
+
self.log_store_name = m.get('logStoreName')
|
|
78
|
+
if m.get('project') is not None:
|
|
79
|
+
self.project = m.get('project')
|
|
80
|
+
if m.get('logStreamName') is not None:
|
|
81
|
+
self.log_stream_name = m.get('logStreamName')
|
|
82
|
+
if m.get('query') is not None:
|
|
83
|
+
self.query = m.get('query')
|
|
84
|
+
if m.get('startDateTime') is not None:
|
|
85
|
+
self.start_date_time = m.get('startDateTime')
|
|
86
|
+
if m.get('endDateTime') is not None:
|
|
87
|
+
self.end_date_time = m.get('endDateTime')
|
|
88
|
+
return self
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for QueryLogHistogramResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_bls.models.search_info import SearchInfo
|
|
7
|
+
from baiducloud_python_sdk_bls.models.search_statistic import SearchStatistic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class QueryLogHistogramResponse(BceResponse):
|
|
11
|
+
"""
|
|
12
|
+
QueryLogHistogramResponse
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, search_info=None, search_statistic=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize QueryLogHistogramResponse response.
|
|
18
|
+
|
|
19
|
+
:param search_info: search_info field
|
|
20
|
+
:type search_info: SearchInfo (optional)
|
|
21
|
+
|
|
22
|
+
:param search_statistic: search_statistic field
|
|
23
|
+
:type search_statistic: SearchStatistic (optional)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.search_info = search_info
|
|
27
|
+
self.search_statistic = search_statistic
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""
|
|
31
|
+
Convert the response instance to a dictionary representation.
|
|
32
|
+
|
|
33
|
+
Includes metadata from the parent BceResponse class.
|
|
34
|
+
Nested model objects are recursively converted to dictionaries.
|
|
35
|
+
|
|
36
|
+
:return: Dictionary representation of the response
|
|
37
|
+
:rtype: dict
|
|
38
|
+
"""
|
|
39
|
+
_map = super().to_dict()
|
|
40
|
+
if _map is not None:
|
|
41
|
+
return _map
|
|
42
|
+
result = dict()
|
|
43
|
+
if self.metadata is not None:
|
|
44
|
+
result['metadata'] = dict(self.metadata)
|
|
45
|
+
if self.search_info is not None:
|
|
46
|
+
result['searchInfo'] = self.search_info.to_dict()
|
|
47
|
+
if self.search_statistic is not None:
|
|
48
|
+
result['searchStatistic'] = self.search_statistic.to_dict()
|
|
49
|
+
return result
|
|
50
|
+
|
|
51
|
+
def from_dict(self, m):
|
|
52
|
+
"""
|
|
53
|
+
Populate the response instance from a dictionary.
|
|
54
|
+
|
|
55
|
+
Nested dictionaries are recursively converted to model objects.
|
|
56
|
+
|
|
57
|
+
:param m: Dictionary containing response data
|
|
58
|
+
:type m: dict
|
|
59
|
+
|
|
60
|
+
:return: Self reference for method chaining
|
|
61
|
+
:rtype: QueryLogHistogramResponse
|
|
62
|
+
|
|
63
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
64
|
+
:raises ValueError: If nested model conversion fails
|
|
65
|
+
"""
|
|
66
|
+
m = m or dict()
|
|
67
|
+
if m.get('searchInfo') is not None:
|
|
68
|
+
self.search_info = SearchInfo().from_dict(m.get('searchInfo'))
|
|
69
|
+
if m.get('searchStatistic') is not None:
|
|
70
|
+
self.search_statistic = SearchStatistic().from_dict(m.get('searchStatistic'))
|
|
71
|
+
return self
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for QueryLogRecordRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class QueryLogRecordRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for QueryLogRecordRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(
|
|
16
|
+
self,
|
|
17
|
+
log_store_name,
|
|
18
|
+
query,
|
|
19
|
+
start_date_time,
|
|
20
|
+
end_date_time,
|
|
21
|
+
project=None,
|
|
22
|
+
log_stream_name=None,
|
|
23
|
+
marker=None,
|
|
24
|
+
limit=None,
|
|
25
|
+
sort=None,
|
|
26
|
+
page_no=None,
|
|
27
|
+
page_size=None,
|
|
28
|
+
):
|
|
29
|
+
"""
|
|
30
|
+
Initialize QueryLogRecordRequest request entity.
|
|
31
|
+
|
|
32
|
+
:param log_store_name: log_store_name parameter
|
|
33
|
+
:type log_store_name: str (required)
|
|
34
|
+
|
|
35
|
+
:param project: project parameter
|
|
36
|
+
:type project: str (optional)
|
|
37
|
+
|
|
38
|
+
:param log_stream_name: log_stream_name parameter
|
|
39
|
+
:type log_stream_name: str (optional)
|
|
40
|
+
|
|
41
|
+
:param query: query parameter
|
|
42
|
+
:type query: str (required)
|
|
43
|
+
|
|
44
|
+
:param start_date_time: start_date_time parameter
|
|
45
|
+
:type start_date_time: datetime (required)
|
|
46
|
+
|
|
47
|
+
:param end_date_time: end_date_time parameter
|
|
48
|
+
:type end_date_time: datetime (required)
|
|
49
|
+
|
|
50
|
+
:param marker: marker parameter
|
|
51
|
+
:type marker: str (optional)
|
|
52
|
+
|
|
53
|
+
:param limit: limit parameter
|
|
54
|
+
:type limit: int (optional)
|
|
55
|
+
|
|
56
|
+
:param sort: sort parameter
|
|
57
|
+
:type sort: str (optional)
|
|
58
|
+
|
|
59
|
+
:param page_no: page_no parameter
|
|
60
|
+
:type page_no: int (optional)
|
|
61
|
+
|
|
62
|
+
:param page_size: page_size parameter
|
|
63
|
+
:type page_size: int (optional)
|
|
64
|
+
"""
|
|
65
|
+
super().__init__()
|
|
66
|
+
self.log_store_name = log_store_name
|
|
67
|
+
self.project = project
|
|
68
|
+
self.log_stream_name = log_stream_name
|
|
69
|
+
self.query = query
|
|
70
|
+
self.start_date_time = start_date_time
|
|
71
|
+
self.end_date_time = end_date_time
|
|
72
|
+
self.marker = marker
|
|
73
|
+
self.limit = limit
|
|
74
|
+
self.sort = sort
|
|
75
|
+
self.page_no = page_no
|
|
76
|
+
self.page_size = page_size
|
|
77
|
+
|
|
78
|
+
def to_dict(self):
|
|
79
|
+
"""
|
|
80
|
+
Convert the request entity to a dictionary representation.
|
|
81
|
+
|
|
82
|
+
Nested model objects are recursively converted to dictionaries.
|
|
83
|
+
|
|
84
|
+
:return: Dictionary representation of the request
|
|
85
|
+
:rtype: dict
|
|
86
|
+
"""
|
|
87
|
+
_map = super().to_dict()
|
|
88
|
+
if _map is not None:
|
|
89
|
+
return _map
|
|
90
|
+
result = dict()
|
|
91
|
+
return result
|
|
92
|
+
|
|
93
|
+
def from_dict(self, m):
|
|
94
|
+
"""
|
|
95
|
+
Populate the request entity from a dictionary.
|
|
96
|
+
|
|
97
|
+
Nested dictionaries are recursively converted to model objects.
|
|
98
|
+
|
|
99
|
+
:param m: Dictionary containing request data
|
|
100
|
+
:type m: dict
|
|
101
|
+
|
|
102
|
+
:return: Self reference for method chaining
|
|
103
|
+
:rtype: QueryLogRecordRequest
|
|
104
|
+
|
|
105
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
106
|
+
:raises ValueError: If nested model conversion fails
|
|
107
|
+
"""
|
|
108
|
+
m = m or dict()
|
|
109
|
+
if m.get('logStoreName') is not None:
|
|
110
|
+
self.log_store_name = m.get('logStoreName')
|
|
111
|
+
if m.get('project') is not None:
|
|
112
|
+
self.project = m.get('project')
|
|
113
|
+
if m.get('logStreamName') is not None:
|
|
114
|
+
self.log_stream_name = m.get('logStreamName')
|
|
115
|
+
if m.get('query') is not None:
|
|
116
|
+
self.query = m.get('query')
|
|
117
|
+
if m.get('startDateTime') is not None:
|
|
118
|
+
self.start_date_time = m.get('startDateTime')
|
|
119
|
+
if m.get('endDateTime') is not None:
|
|
120
|
+
self.end_date_time = m.get('endDateTime')
|
|
121
|
+
if m.get('marker') is not None:
|
|
122
|
+
self.marker = m.get('marker')
|
|
123
|
+
if m.get('limit') is not None:
|
|
124
|
+
self.limit = m.get('limit')
|
|
125
|
+
if m.get('sort') is not None:
|
|
126
|
+
self.sort = m.get('sort')
|
|
127
|
+
if m.get('pageNo') is not None:
|
|
128
|
+
self.page_no = m.get('pageNo')
|
|
129
|
+
if m.get('pageSize') is not None:
|
|
130
|
+
self.page_size = m.get('pageSize')
|
|
131
|
+
return self
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for QueryLogRecordResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_bls.models.result_set import ResultSet
|
|
7
|
+
from baiducloud_python_sdk_bls.models.dataset_scan_info import DatasetScanInfo
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class QueryLogRecordResponse(BceResponse):
|
|
11
|
+
"""
|
|
12
|
+
QueryLogRecordResponse
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, next_marker=None, result_set=None, dataset_scan_info=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize QueryLogRecordResponse response.
|
|
18
|
+
|
|
19
|
+
:param next_marker: 当query为检索语句时,如果还有日志数据,将会返回nextMarker字段,标记下一条位置,用于获取下一页日志数据
|
|
20
|
+
:type next_marker: str (optional)
|
|
21
|
+
|
|
22
|
+
:param result_set: result_set field
|
|
23
|
+
:type result_set: ResultSet (optional)
|
|
24
|
+
|
|
25
|
+
:param dataset_scan_info: dataset_scan_info field
|
|
26
|
+
:type dataset_scan_info: DatasetScanInfo (optional)
|
|
27
|
+
"""
|
|
28
|
+
super().__init__()
|
|
29
|
+
self.next_marker = next_marker
|
|
30
|
+
self.result_set = result_set
|
|
31
|
+
self.dataset_scan_info = dataset_scan_info
|
|
32
|
+
|
|
33
|
+
def to_dict(self):
|
|
34
|
+
"""
|
|
35
|
+
Convert the response instance to a dictionary representation.
|
|
36
|
+
|
|
37
|
+
Includes metadata from the parent BceResponse class.
|
|
38
|
+
Nested model objects are recursively converted to dictionaries.
|
|
39
|
+
|
|
40
|
+
:return: Dictionary representation of the response
|
|
41
|
+
:rtype: dict
|
|
42
|
+
"""
|
|
43
|
+
_map = super().to_dict()
|
|
44
|
+
if _map is not None:
|
|
45
|
+
return _map
|
|
46
|
+
result = dict()
|
|
47
|
+
if self.metadata is not None:
|
|
48
|
+
result['metadata'] = dict(self.metadata)
|
|
49
|
+
if self.next_marker is not None:
|
|
50
|
+
result['nextMarker'] = self.next_marker
|
|
51
|
+
if self.result_set is not None:
|
|
52
|
+
result['resultSet'] = self.result_set.to_dict()
|
|
53
|
+
if self.dataset_scan_info is not None:
|
|
54
|
+
result['datasetScanInfo'] = self.dataset_scan_info.to_dict()
|
|
55
|
+
return result
|
|
56
|
+
|
|
57
|
+
def from_dict(self, m):
|
|
58
|
+
"""
|
|
59
|
+
Populate the response instance from a dictionary.
|
|
60
|
+
|
|
61
|
+
Nested dictionaries are recursively converted to model objects.
|
|
62
|
+
|
|
63
|
+
:param m: Dictionary containing response data
|
|
64
|
+
:type m: dict
|
|
65
|
+
|
|
66
|
+
:return: Self reference for method chaining
|
|
67
|
+
:rtype: QueryLogRecordResponse
|
|
68
|
+
|
|
69
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
70
|
+
:raises ValueError: If nested model conversion fails
|
|
71
|
+
"""
|
|
72
|
+
m = m or dict()
|
|
73
|
+
if m.get('nextMarker') is not None:
|
|
74
|
+
self.next_marker = m.get('nextMarker')
|
|
75
|
+
if m.get('resultSet') is not None:
|
|
76
|
+
self.result_set = ResultSet().from_dict(m.get('resultSet'))
|
|
77
|
+
if m.get('datasetScanInfo') is not None:
|
|
78
|
+
self.dataset_scan_info = DatasetScanInfo().from_dict(m.get('datasetScanInfo'))
|
|
79
|
+
return self
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ResultSet information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResultSet(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
ResultSet
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, query_type=None, columns=None, column_types=None, rows=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize ResultSet instance.
|
|
16
|
+
|
|
17
|
+
:param query_type: 查询类型
|
|
18
|
+
:type query_type: str (optional)
|
|
19
|
+
|
|
20
|
+
:param columns: 列名列表
|
|
21
|
+
:type columns: List[str] (optional)
|
|
22
|
+
|
|
23
|
+
:param column_types: 列类型列表
|
|
24
|
+
:type column_types: List[str] (optional)
|
|
25
|
+
|
|
26
|
+
:param rows: 结果行数据
|
|
27
|
+
:type rows: List[List[object]] (optional)
|
|
28
|
+
"""
|
|
29
|
+
super().__init__()
|
|
30
|
+
self.query_type = query_type
|
|
31
|
+
self.columns = columns
|
|
32
|
+
self.column_types = column_types
|
|
33
|
+
self.rows = rows
|
|
34
|
+
|
|
35
|
+
def to_dict(self):
|
|
36
|
+
"""
|
|
37
|
+
Convert the model instance to a dictionary representation.
|
|
38
|
+
|
|
39
|
+
Nested model objects are recursively converted to dictionaries.
|
|
40
|
+
|
|
41
|
+
:return: Dictionary representation of the model
|
|
42
|
+
:rtype: dict
|
|
43
|
+
"""
|
|
44
|
+
_map = super().to_dict()
|
|
45
|
+
if _map is not None:
|
|
46
|
+
return _map
|
|
47
|
+
result = dict()
|
|
48
|
+
if self.query_type is not None:
|
|
49
|
+
result['queryType'] = self.query_type
|
|
50
|
+
if self.columns is not None:
|
|
51
|
+
result['columns'] = self.columns
|
|
52
|
+
if self.column_types is not None:
|
|
53
|
+
result['columnTypes'] = self.column_types
|
|
54
|
+
if self.rows is not None:
|
|
55
|
+
result['rows'] = self.rows
|
|
56
|
+
return result
|
|
57
|
+
|
|
58
|
+
def from_dict(self, m):
|
|
59
|
+
"""
|
|
60
|
+
Populate the model instance from a dictionary.
|
|
61
|
+
|
|
62
|
+
Nested dictionaries are recursively converted to model objects.
|
|
63
|
+
|
|
64
|
+
:param m: Dictionary containing model data
|
|
65
|
+
:type m: dict
|
|
66
|
+
|
|
67
|
+
:return: Self reference for method chaining
|
|
68
|
+
:rtype: ResultSet
|
|
69
|
+
|
|
70
|
+
:raises TypeError: If input is not a dictionary type
|
|
71
|
+
:raises ValueError: If nested model conversion fails
|
|
72
|
+
"""
|
|
73
|
+
m = m or dict()
|
|
74
|
+
if m.get('queryType') is not None:
|
|
75
|
+
self.query_type = m.get('queryType')
|
|
76
|
+
if m.get('columns') is not None:
|
|
77
|
+
self.columns = m.get('columns')
|
|
78
|
+
if m.get('columnTypes') is not None:
|
|
79
|
+
self.column_types = m.get('columnTypes')
|
|
80
|
+
if m.get('rows') is not None:
|
|
81
|
+
self.rows = m.get('rows')
|
|
82
|
+
return self
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
SearchInfo information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SearchInfo(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
SearchInfo
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, query_type=None, took=None, hits=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize SearchInfo instance.
|
|
16
|
+
|
|
17
|
+
:param query_type: 返回语句类型,match:检索语句,sql:分析语句,match_and_sql:包含检索和分析语句
|
|
18
|
+
:type query_type: str (optional)
|
|
19
|
+
|
|
20
|
+
:param took: 统计耗时,单位毫秒
|
|
21
|
+
:type took: int (optional)
|
|
22
|
+
|
|
23
|
+
:param hits: 匹配上的总日志条数
|
|
24
|
+
:type hits: int (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.query_type = query_type
|
|
28
|
+
self.took = took
|
|
29
|
+
self.hits = hits
|
|
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
|
+
:return: Dictionary representation of the model
|
|
38
|
+
:rtype: dict
|
|
39
|
+
"""
|
|
40
|
+
_map = super().to_dict()
|
|
41
|
+
if _map is not None:
|
|
42
|
+
return _map
|
|
43
|
+
result = dict()
|
|
44
|
+
if self.query_type is not None:
|
|
45
|
+
result['queryType'] = self.query_type
|
|
46
|
+
if self.took is not None:
|
|
47
|
+
result['took'] = self.took
|
|
48
|
+
if self.hits is not None:
|
|
49
|
+
result['hits'] = self.hits
|
|
50
|
+
return result
|
|
51
|
+
|
|
52
|
+
def from_dict(self, m):
|
|
53
|
+
"""
|
|
54
|
+
Populate the model instance from a dictionary.
|
|
55
|
+
|
|
56
|
+
Nested dictionaries are recursively converted to model objects.
|
|
57
|
+
|
|
58
|
+
:param m: Dictionary containing model data
|
|
59
|
+
:type m: dict
|
|
60
|
+
|
|
61
|
+
:return: Self reference for method chaining
|
|
62
|
+
:rtype: SearchInfo
|
|
63
|
+
|
|
64
|
+
:raises TypeError: If input is not a dictionary type
|
|
65
|
+
:raises ValueError: If nested model conversion fails
|
|
66
|
+
"""
|
|
67
|
+
m = m or dict()
|
|
68
|
+
if m.get('queryType') is not None:
|
|
69
|
+
self.query_type = m.get('queryType')
|
|
70
|
+
if m.get('took') is not None:
|
|
71
|
+
self.took = m.get('took')
|
|
72
|
+
if m.get('hits') is not None:
|
|
73
|
+
self.hits = m.get('hits')
|
|
74
|
+
return self
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
SearchStatistic information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_bls.models.bucket import Bucket
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SearchStatistic(AbstractModel):
|
|
11
|
+
"""
|
|
12
|
+
SearchStatistic
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, interval=None, start_time=None, end_time=None, histogram=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize SearchStatistic instance.
|
|
18
|
+
|
|
19
|
+
:param interval: 直方图统计单个区间大小,统计区间的毫秒数
|
|
20
|
+
:type interval: int (optional)
|
|
21
|
+
|
|
22
|
+
:param start_time: 直方图统计的开始时间,是请求中的startDateTime
|
|
23
|
+
:type start_time: str (optional)
|
|
24
|
+
|
|
25
|
+
:param end_time: 直方图统计的结束时间,是请求中的endDateTime
|
|
26
|
+
:type end_time: str (optional)
|
|
27
|
+
|
|
28
|
+
:param histogram: 直方图统计区间的数据条数,直方图按区间大小,顺序分割排列,各个时间区间的日志数量
|
|
29
|
+
:type histogram: List[Bucket] (optional)
|
|
30
|
+
"""
|
|
31
|
+
super().__init__()
|
|
32
|
+
self.interval = interval
|
|
33
|
+
self.start_time = start_time
|
|
34
|
+
self.end_time = end_time
|
|
35
|
+
self.histogram = histogram
|
|
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.interval is not None:
|
|
51
|
+
result['interval'] = self.interval
|
|
52
|
+
if self.start_time is not None:
|
|
53
|
+
result['startTime'] = self.start_time
|
|
54
|
+
if self.end_time is not None:
|
|
55
|
+
result['endTime'] = self.end_time
|
|
56
|
+
if self.histogram is not None:
|
|
57
|
+
result['histogram'] = [i.to_dict() for i in self.histogram]
|
|
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: SearchStatistic
|
|
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('interval') is not None:
|
|
77
|
+
self.interval = m.get('interval')
|
|
78
|
+
if m.get('startTime') is not None:
|
|
79
|
+
self.start_time = m.get('startTime')
|
|
80
|
+
if m.get('endTime') is not None:
|
|
81
|
+
self.end_time = m.get('endTime')
|
|
82
|
+
if m.get('histogram') is not None:
|
|
83
|
+
self.histogram = [Bucket().from_dict(i) for i in m.get('histogram')]
|
|
84
|
+
return self
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Statistics information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Statistics(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Statistics
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, execution_time_in_ms=None, scan_count=None, scan_bytes=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize Statistics instance.
|
|
16
|
+
|
|
17
|
+
:param execution_time_in_ms: 执行耗时(毫秒)
|
|
18
|
+
:type execution_time_in_ms: int (optional)
|
|
19
|
+
|
|
20
|
+
:param scan_count: 扫描记录数
|
|
21
|
+
:type scan_count: int (optional)
|
|
22
|
+
|
|
23
|
+
:param scan_bytes: 扫描数据量(字节)
|
|
24
|
+
:type scan_bytes: int (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.execution_time_in_ms = execution_time_in_ms
|
|
28
|
+
self.scan_count = scan_count
|
|
29
|
+
self.scan_bytes = scan_bytes
|
|
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
|
+
:return: Dictionary representation of the model
|
|
38
|
+
:rtype: dict
|
|
39
|
+
"""
|
|
40
|
+
_map = super().to_dict()
|
|
41
|
+
if _map is not None:
|
|
42
|
+
return _map
|
|
43
|
+
result = dict()
|
|
44
|
+
if self.execution_time_in_ms is not None:
|
|
45
|
+
result['executionTimeInMs'] = self.execution_time_in_ms
|
|
46
|
+
if self.scan_count is not None:
|
|
47
|
+
result['scanCount'] = self.scan_count
|
|
48
|
+
if self.scan_bytes is not None:
|
|
49
|
+
result['scanBytes'] = self.scan_bytes
|
|
50
|
+
return result
|
|
51
|
+
|
|
52
|
+
def from_dict(self, m):
|
|
53
|
+
"""
|
|
54
|
+
Populate the model instance from a dictionary.
|
|
55
|
+
|
|
56
|
+
Nested dictionaries are recursively converted to model objects.
|
|
57
|
+
|
|
58
|
+
:param m: Dictionary containing model data
|
|
59
|
+
:type m: dict
|
|
60
|
+
|
|
61
|
+
:return: Self reference for method chaining
|
|
62
|
+
:rtype: Statistics
|
|
63
|
+
|
|
64
|
+
:raises TypeError: If input is not a dictionary type
|
|
65
|
+
:raises ValueError: If nested model conversion fails
|
|
66
|
+
"""
|
|
67
|
+
m = m or dict()
|
|
68
|
+
if m.get('executionTimeInMs') is not None:
|
|
69
|
+
self.execution_time_in_ms = m.get('executionTimeInMs')
|
|
70
|
+
if m.get('scanCount') is not None:
|
|
71
|
+
self.scan_count = m.get('scanCount')
|
|
72
|
+
if m.get('scanBytes') is not None:
|
|
73
|
+
self.scan_bytes = m.get('scanBytes')
|
|
74
|
+
return self
|