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.
Files changed (38) hide show
  1. baiducloud_python_sdk_bls/__init__.py +5 -0
  2. baiducloud_python_sdk_bls/api/__init__.py +0 -0
  3. baiducloud_python_sdk_bls/api/bls_client.py +378 -0
  4. baiducloud_python_sdk_bls/models/__init__.py +33 -0
  5. baiducloud_python_sdk_bls/models/bucket.py +66 -0
  6. baiducloud_python_sdk_bls/models/create_project_request.py +68 -0
  7. baiducloud_python_sdk_bls/models/create_project_response.py +78 -0
  8. baiducloud_python_sdk_bls/models/dataset_scan_info.py +68 -0
  9. baiducloud_python_sdk_bls/models/delete_project_request.py +58 -0
  10. baiducloud_python_sdk_bls/models/delete_project_response.py +77 -0
  11. baiducloud_python_sdk_bls/models/describe_project_request.py +58 -0
  12. baiducloud_python_sdk_bls/models/describe_project_response.py +86 -0
  13. baiducloud_python_sdk_bls/models/list_project_request.py +100 -0
  14. baiducloud_python_sdk_bls/models/list_project_response.py +86 -0
  15. baiducloud_python_sdk_bls/models/log_record.py +66 -0
  16. baiducloud_python_sdk_bls/models/log_tag.py +66 -0
  17. baiducloud_python_sdk_bls/models/project.py +115 -0
  18. baiducloud_python_sdk_bls/models/project_list_result.py +112 -0
  19. baiducloud_python_sdk_bls/models/project_result.py +60 -0
  20. baiducloud_python_sdk_bls/models/pull_log_record_request.py +96 -0
  21. baiducloud_python_sdk_bls/models/pull_log_record_response.py +86 -0
  22. baiducloud_python_sdk_bls/models/push_log_record_request.py +98 -0
  23. baiducloud_python_sdk_bls/models/push_log_record_response.py +69 -0
  24. baiducloud_python_sdk_bls/models/query_log_histogram_request.py +88 -0
  25. baiducloud_python_sdk_bls/models/query_log_histogram_response.py +71 -0
  26. baiducloud_python_sdk_bls/models/query_log_record_request.py +131 -0
  27. baiducloud_python_sdk_bls/models/query_log_record_response.py +79 -0
  28. baiducloud_python_sdk_bls/models/result_set.py +82 -0
  29. baiducloud_python_sdk_bls/models/search_info.py +74 -0
  30. baiducloud_python_sdk_bls/models/search_statistic.py +84 -0
  31. baiducloud_python_sdk_bls/models/statistics.py +74 -0
  32. baiducloud_python_sdk_bls/models/update_project_request.py +68 -0
  33. baiducloud_python_sdk_bls/models/update_project_response.py +77 -0
  34. baiducloud_python_sdk_bls-0.0.1.dist-info/LICENSE +177 -0
  35. baiducloud_python_sdk_bls-0.0.1.dist-info/METADATA +76 -0
  36. baiducloud_python_sdk_bls-0.0.1.dist-info/RECORD +38 -0
  37. baiducloud_python_sdk_bls-0.0.1.dist-info/WHEEL +5 -0
  38. baiducloud_python_sdk_bls-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,115 @@
1
+ """
2
+ Project information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Project(AbstractModel):
9
+ """
10
+ Project
11
+ """
12
+
13
+ def __init__(
14
+ self,
15
+ uuid=None,
16
+ name=None,
17
+ description=None,
18
+ top=None,
19
+ log_store_count=None,
20
+ created_time=None,
21
+ updated_time=None,
22
+ ):
23
+ """
24
+ Initialize Project instance.
25
+
26
+ :param uuid: 日志组UUID
27
+ :type uuid: str (optional)
28
+
29
+ :param name: 日志组名称
30
+ :type name: str (optional)
31
+
32
+ :param description: 日志组描述
33
+ :type description: str (optional)
34
+
35
+ :param top: 日志组是否置顶
36
+ :type top: bool (optional)
37
+
38
+ :param log_store_count: 日志组中日志集的个数
39
+ :type log_store_count: int (optional)
40
+
41
+ :param created_time: 日志组创建的日期时间
42
+ :type created_time: datetime (optional)
43
+
44
+ :param updated_time: 日志组最后修改的日期时间
45
+ :type updated_time: datetime (optional)
46
+ """
47
+ super().__init__()
48
+ self.uuid = uuid
49
+ self.name = name
50
+ self.description = description
51
+ self.top = top
52
+ self.log_store_count = log_store_count
53
+ self.created_time = created_time
54
+ self.updated_time = updated_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.uuid is not None:
70
+ result['uuid'] = self.uuid
71
+ if self.name is not None:
72
+ result['name'] = self.name
73
+ if self.description is not None:
74
+ result['description'] = self.description
75
+ if self.top is not None:
76
+ result['top'] = self.top
77
+ if self.log_store_count is not None:
78
+ result['logStoreCount'] = self.log_store_count
79
+ if self.created_time is not None:
80
+ result['createdTime'] = self.created_time
81
+ if self.updated_time is not None:
82
+ result['updatedTime'] = self.updated_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: Project
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('uuid') is not None:
102
+ self.uuid = m.get('uuid')
103
+ if m.get('name') is not None:
104
+ self.name = m.get('name')
105
+ if m.get('description') is not None:
106
+ self.description = m.get('description')
107
+ if m.get('top') is not None:
108
+ self.top = m.get('top')
109
+ if m.get('logStoreCount') is not None:
110
+ self.log_store_count = m.get('logStoreCount')
111
+ if m.get('createdTime') is not None:
112
+ self.created_time = m.get('createdTime')
113
+ if m.get('updatedTime') is not None:
114
+ self.updated_time = m.get('updatedTime')
115
+ return self
@@ -0,0 +1,112 @@
1
+ """
2
+ ProjectListResult information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_bls.models.project import Project
8
+
9
+ from baiducloud_python_sdk_bls.models.project import Project
10
+
11
+
12
+ class ProjectListResult(AbstractModel):
13
+ """
14
+ ProjectListResult
15
+ """
16
+
17
+ def __init__(
18
+ self, order=None, order_by=None, page_no=None, page_size=None, total=None, default=None, projects=None
19
+ ):
20
+ """
21
+ Initialize ProjectListResult instance.
22
+
23
+ :param order: 排序规则,desc为降序,asc为升序
24
+ :type order: str (optional)
25
+
26
+ :param order_by: 排序字段
27
+ :type order_by: str (optional)
28
+
29
+ :param page_no: 起始页码
30
+ :type page_no: int (optional)
31
+
32
+ :param page_size: 每页显示数据大小
33
+ :type page_size: int (optional)
34
+
35
+ :param total: 总数目
36
+ :type total: int (optional)
37
+
38
+ :param default: default attribute
39
+ :type default: Project (optional)
40
+
41
+ :param projects: 日志组列表
42
+ :type projects: List[Project] (optional)
43
+ """
44
+ super().__init__()
45
+ self.order = order
46
+ self.order_by = order_by
47
+ self.page_no = page_no
48
+ self.page_size = page_size
49
+ self.total = total
50
+ self.default = default
51
+ self.projects = projects
52
+
53
+ def to_dict(self):
54
+ """
55
+ Convert the model instance to a dictionary representation.
56
+
57
+ Nested model objects are recursively converted to dictionaries.
58
+
59
+ :return: Dictionary representation of the model
60
+ :rtype: dict
61
+ """
62
+ _map = super().to_dict()
63
+ if _map is not None:
64
+ return _map
65
+ result = dict()
66
+ if self.order is not None:
67
+ result['order'] = self.order
68
+ if self.order_by is not None:
69
+ result['orderBy'] = self.order_by
70
+ if self.page_no is not None:
71
+ result['pageNo'] = self.page_no
72
+ if self.page_size is not None:
73
+ result['pageSize'] = self.page_size
74
+ if self.total is not None:
75
+ result['total'] = self.total
76
+ if self.default is not None:
77
+ result['default'] = self.default.to_dict()
78
+ if self.projects is not None:
79
+ result['projects'] = [i.to_dict() for i in self.projects]
80
+ return result
81
+
82
+ def from_dict(self, m):
83
+ """
84
+ Populate the model instance from a dictionary.
85
+
86
+ Nested dictionaries are recursively converted to model objects.
87
+
88
+ :param m: Dictionary containing model data
89
+ :type m: dict
90
+
91
+ :return: Self reference for method chaining
92
+ :rtype: ProjectListResult
93
+
94
+ :raises TypeError: If input is not a dictionary type
95
+ :raises ValueError: If nested model conversion fails
96
+ """
97
+ m = m or dict()
98
+ if m.get('order') is not None:
99
+ self.order = m.get('order')
100
+ if m.get('orderBy') is not None:
101
+ self.order_by = m.get('orderBy')
102
+ if m.get('pageNo') is not None:
103
+ self.page_no = m.get('pageNo')
104
+ if m.get('pageSize') is not None:
105
+ self.page_size = m.get('pageSize')
106
+ if m.get('total') is not None:
107
+ self.total = m.get('total')
108
+ if m.get('default') is not None:
109
+ self.default = Project().from_dict(m.get('default'))
110
+ if m.get('projects') is not None:
111
+ self.projects = [Project().from_dict(i) for i in m.get('projects')]
112
+ return self
@@ -0,0 +1,60 @@
1
+ """
2
+ ProjectResult information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_bls.models.project import Project
8
+
9
+
10
+ class ProjectResult(AbstractModel):
11
+ """
12
+ ProjectResult
13
+ """
14
+
15
+ def __init__(self, project=None):
16
+ """
17
+ Initialize ProjectResult instance.
18
+
19
+ :param project: project attribute
20
+ :type project: Project (optional)
21
+ """
22
+ super().__init__()
23
+ self.project = project
24
+
25
+ def to_dict(self):
26
+ """
27
+ Convert the model instance to a dictionary representation.
28
+
29
+ Nested model objects are recursively converted to dictionaries.
30
+
31
+ :return: Dictionary representation of the model
32
+ :rtype: dict
33
+ """
34
+ _map = super().to_dict()
35
+ if _map is not None:
36
+ return _map
37
+ result = dict()
38
+ if self.project is not None:
39
+ result['project'] = self.project.to_dict()
40
+ return result
41
+
42
+ def from_dict(self, m):
43
+ """
44
+ Populate the model instance from a dictionary.
45
+
46
+ Nested dictionaries are recursively converted to model objects.
47
+
48
+ :param m: Dictionary containing model data
49
+ :type m: dict
50
+
51
+ :return: Self reference for method chaining
52
+ :rtype: ProjectResult
53
+
54
+ :raises TypeError: If input is not a dictionary type
55
+ :raises ValueError: If nested model conversion fails
56
+ """
57
+ m = m or dict()
58
+ if m.get('project') is not None:
59
+ self.project = Project().from_dict(m.get('project'))
60
+ return self
@@ -0,0 +1,96 @@
1
+ """
2
+ Request entity for PullLogRecordRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class PullLogRecordRequest(AbstractModel):
9
+ """
10
+ Request entity for PullLogRecordRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(
16
+ self, log_store_name, log_stream_name, start_date_time, end_date_time, project=None, limit=None, marker=None
17
+ ):
18
+ """
19
+ Initialize PullLogRecordRequest request entity.
20
+
21
+ :param log_store_name: log_store_name parameter
22
+ :type log_store_name: str (required)
23
+
24
+ :param project: project parameter
25
+ :type project: str (optional)
26
+
27
+ :param log_stream_name: log_stream_name parameter
28
+ :type log_stream_name: str (required)
29
+
30
+ :param start_date_time: start_date_time parameter
31
+ :type start_date_time: datetime (required)
32
+
33
+ :param end_date_time: end_date_time parameter
34
+ :type end_date_time: datetime (required)
35
+
36
+ :param limit: limit parameter
37
+ :type limit: int (optional)
38
+
39
+ :param marker: marker parameter
40
+ :type marker: str (optional)
41
+ """
42
+ super().__init__()
43
+ self.log_store_name = log_store_name
44
+ self.project = project
45
+ self.log_stream_name = log_stream_name
46
+ self.start_date_time = start_date_time
47
+ self.end_date_time = end_date_time
48
+ self.limit = limit
49
+ self.marker = marker
50
+
51
+ def to_dict(self):
52
+ """
53
+ Convert the request entity to a dictionary representation.
54
+
55
+ Nested model objects are recursively converted to dictionaries.
56
+
57
+ :return: Dictionary representation of the request
58
+ :rtype: dict
59
+ """
60
+ _map = super().to_dict()
61
+ if _map is not None:
62
+ return _map
63
+ result = dict()
64
+ return result
65
+
66
+ def from_dict(self, m):
67
+ """
68
+ Populate the request entity from a dictionary.
69
+
70
+ Nested dictionaries are recursively converted to model objects.
71
+
72
+ :param m: Dictionary containing request data
73
+ :type m: dict
74
+
75
+ :return: Self reference for method chaining
76
+ :rtype: PullLogRecordRequest
77
+
78
+ :raises TypeError: If input is not a dictionary or field type mismatch
79
+ :raises ValueError: If nested model conversion fails
80
+ """
81
+ m = m or dict()
82
+ if m.get('logStoreName') is not None:
83
+ self.log_store_name = m.get('logStoreName')
84
+ if m.get('project') is not None:
85
+ self.project = m.get('project')
86
+ if m.get('logStreamName') is not None:
87
+ self.log_stream_name = m.get('logStreamName')
88
+ if m.get('startDateTime') is not None:
89
+ self.start_date_time = m.get('startDateTime')
90
+ if m.get('endDateTime') is not None:
91
+ self.end_date_time = m.get('endDateTime')
92
+ if m.get('limit') is not None:
93
+ self.limit = m.get('limit')
94
+ if m.get('marker') is not None:
95
+ self.marker = m.get('marker')
96
+ return self
@@ -0,0 +1,86 @@
1
+ """
2
+ Request entity for PullLogRecordResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_bls.models.log_record import LogRecord
7
+
8
+
9
+ class PullLogRecordResponse(BceResponse):
10
+ """
11
+ PullLogRecordResponse
12
+ """
13
+
14
+ def __init__(self, result=None, marker=None, is_truncated=None, next_marker=None):
15
+ """
16
+ Initialize PullLogRecordResponse response.
17
+
18
+ :param result: 一组日志记录
19
+ :type result: List[LogRecord] (optional)
20
+
21
+ :param marker: 返回的位置标记
22
+ :type marker: str (optional)
23
+
24
+ :param is_truncated: true: 表示后面还有数据,false: 表示已经是最后一页
25
+ :type is_truncated: bool (optional)
26
+
27
+ :param next_marker: 下次查看的起始位置,可在翻页的时候作为 marker 在请求里携带
28
+ :type next_marker: str (optional)
29
+ """
30
+ super().__init__()
31
+ self.result = result
32
+ self.marker = marker
33
+ self.is_truncated = is_truncated
34
+ self.next_marker = next_marker
35
+
36
+ def to_dict(self):
37
+ """
38
+ Convert the response instance to a dictionary representation.
39
+
40
+ Includes metadata from the parent BceResponse class.
41
+ Nested model objects are recursively converted to dictionaries.
42
+
43
+ :return: Dictionary representation of the response
44
+ :rtype: dict
45
+ """
46
+ _map = super().to_dict()
47
+ if _map is not None:
48
+ return _map
49
+ result = dict()
50
+ if self.metadata is not None:
51
+ result['metadata'] = dict(self.metadata)
52
+ if self.result is not None:
53
+ result['result'] = [i.to_dict() for i in self.result]
54
+ if self.marker is not None:
55
+ result['marker'] = self.marker
56
+ if self.is_truncated is not None:
57
+ result['isTruncated'] = self.is_truncated
58
+ if self.next_marker is not None:
59
+ result['nextMarker'] = self.next_marker
60
+ return result
61
+
62
+ def from_dict(self, m):
63
+ """
64
+ Populate the response instance from a dictionary.
65
+
66
+ Nested dictionaries are recursively converted to model objects.
67
+
68
+ :param m: Dictionary containing response data
69
+ :type m: dict
70
+
71
+ :return: Self reference for method chaining
72
+ :rtype: PullLogRecordResponse
73
+
74
+ :raises TypeError: If input is not a dictionary or field type mismatch
75
+ :raises ValueError: If nested model conversion fails
76
+ """
77
+ m = m or dict()
78
+ if m.get('result') is not None:
79
+ self.result = [LogRecord().from_dict(i) for i in m.get('result')]
80
+ if m.get('marker') is not None:
81
+ self.marker = m.get('marker')
82
+ if m.get('isTruncated') is not None:
83
+ self.is_truncated = m.get('isTruncated')
84
+ if m.get('nextMarker') is not None:
85
+ self.next_marker = m.get('nextMarker')
86
+ return self
@@ -0,0 +1,98 @@
1
+ """
2
+ Request entity for PushLogRecordRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+ from baiducloud_python_sdk_bls.models.log_record import LogRecord
7
+ from baiducloud_python_sdk_bls.models.log_tag import LogTag
8
+
9
+
10
+ class PushLogRecordRequest(AbstractModel):
11
+ """
12
+ Request entity for PushLogRecordRequest operation.
13
+
14
+ This class encapsulates all parameters for the API request.
15
+ """
16
+
17
+ def __init__(self, log_store_name, log_records, project=None, log_stream_name=None, type=None, tags=None):
18
+ """
19
+ Initialize PushLogRecordRequest request entity.
20
+
21
+ :param log_store_name: log_store_name parameter
22
+ :type log_store_name: str (required)
23
+
24
+ :param project: project parameter
25
+ :type project: str (optional)
26
+
27
+ :param log_stream_name: log_stream_name parameter
28
+ :type log_stream_name: str (optional)
29
+
30
+ :param type: 数据类型,JSON/TEXT,默认为 TEXT
31
+ :type type: str (optional)
32
+
33
+ :param log_records: 日志记录
34
+ :type log_records: List[LogRecord] (required)
35
+
36
+ :param tags: 日志标签
37
+ :type tags: List[LogTag] (optional)
38
+ """
39
+ super().__init__()
40
+ self.log_store_name = log_store_name
41
+ self.project = project
42
+ self.log_stream_name = log_stream_name
43
+ self.type = type
44
+ self.log_records = log_records
45
+ self.tags = tags
46
+
47
+ def to_dict(self):
48
+ """
49
+ Convert the request entity to a dictionary representation.
50
+
51
+ Nested model objects are recursively converted to dictionaries.
52
+
53
+ :return: Dictionary representation of the request
54
+ :rtype: dict
55
+ """
56
+ _map = super().to_dict()
57
+ if _map is not None:
58
+ return _map
59
+ result = dict()
60
+ if self.log_stream_name is not None:
61
+ result['logStreamName'] = self.log_stream_name
62
+ if self.type is not None:
63
+ result['type'] = self.type
64
+ if self.log_records is not None:
65
+ result['logRecords'] = [i.to_dict() for i in self.log_records]
66
+ if self.tags is not None:
67
+ result['tags'] = [i.to_dict() for i in self.tags]
68
+ return result
69
+
70
+ def from_dict(self, m):
71
+ """
72
+ Populate the request entity from a dictionary.
73
+
74
+ Nested dictionaries are recursively converted to model objects.
75
+
76
+ :param m: Dictionary containing request data
77
+ :type m: dict
78
+
79
+ :return: Self reference for method chaining
80
+ :rtype: PushLogRecordRequest
81
+
82
+ :raises TypeError: If input is not a dictionary or field type mismatch
83
+ :raises ValueError: If nested model conversion fails
84
+ """
85
+ m = m or dict()
86
+ if m.get('logStoreName') is not None:
87
+ self.log_store_name = m.get('logStoreName')
88
+ if m.get('project') is not None:
89
+ self.project = m.get('project')
90
+ if m.get('logStreamName') is not None:
91
+ self.log_stream_name = m.get('logStreamName')
92
+ if m.get('type') is not None:
93
+ self.type = m.get('type')
94
+ if m.get('logRecords') is not None:
95
+ self.log_records = [LogRecord().from_dict(i) for i in m.get('logRecords')]
96
+ if m.get('tags') is not None:
97
+ self.tags = [LogTag().from_dict(i) for i in m.get('tags')]
98
+ return self
@@ -0,0 +1,69 @@
1
+ """
2
+ Request entity for PushLogRecordResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class PushLogRecordResponse(BceResponse):
9
+ """
10
+ PushLogRecordResponse
11
+ """
12
+
13
+ def __init__(self, success=None, code=None):
14
+ """
15
+ Initialize PushLogRecordResponse response.
16
+
17
+ :param success: 请求是否成功
18
+ :type success: bool (optional)
19
+
20
+ :param code: 请求码,成功为OK,错误为具体的错误码
21
+ :type code: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.success = success
25
+ self.code = code
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the response instance to a dictionary representation.
30
+
31
+ Includes metadata from the parent BceResponse class.
32
+ Nested model objects are recursively converted to dictionaries.
33
+
34
+ :return: Dictionary representation of the response
35
+ :rtype: dict
36
+ """
37
+ _map = super().to_dict()
38
+ if _map is not None:
39
+ return _map
40
+ result = dict()
41
+ if self.metadata is not None:
42
+ result['metadata'] = dict(self.metadata)
43
+ if self.success is not None:
44
+ result['success'] = self.success
45
+ if self.code is not None:
46
+ result['code'] = self.code
47
+ return result
48
+
49
+ def from_dict(self, m):
50
+ """
51
+ Populate the response instance from a dictionary.
52
+
53
+ Nested dictionaries are recursively converted to model objects.
54
+
55
+ :param m: Dictionary containing response data
56
+ :type m: dict
57
+
58
+ :return: Self reference for method chaining
59
+ :rtype: PushLogRecordResponse
60
+
61
+ :raises TypeError: If input is not a dictionary or field type mismatch
62
+ :raises ValueError: If nested model conversion fails
63
+ """
64
+ m = m or dict()
65
+ if m.get('success') is not None:
66
+ self.success = m.get('success')
67
+ if m.get('code') is not None:
68
+ self.code = m.get('code')
69
+ return self