Skip to content

Commit 6b462e7

Browse files
authored
sdk: rolling update for 0.11.92 (#306)
1 parent 578bc3f commit 6b462e7

4 files changed

Lines changed: 383 additions & 2 deletions

File tree

ucloud/services/ulogservice/client.py

Lines changed: 197 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,202 @@ def __init__(
1515
config, transport, middleware, logger
1616
)
1717

18+
def create_u_log_service_log_set(
19+
self, req: typing.Optional[dict] = None, **kwargs
20+
) -> dict:
21+
"""CreateULogServiceLogSet - 创建日志集
22+
23+
**Request**
24+
25+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
26+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
27+
- **LogSetName** (str) - (Required) 日志集名称 长度为1~64位
28+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
29+
- **LogSetRemark** (str) - 日志集备注 长度为0~255位
30+
31+
**Response**
32+
33+
- **LogSetId** (str) - 日志集资源ID
34+
35+
"""
36+
# build request
37+
d = {
38+
"ProjectId": self.config.project_id,
39+
"Region": self.config.region,
40+
}
41+
req and d.update(req)
42+
d = apis.CreateULogServiceLogSetRequestSchema().dumps(d)
43+
44+
# build options
45+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
46+
47+
resp = self.invoke("CreateULogServiceLogSet", d, **kwargs)
48+
return apis.CreateULogServiceLogSetResponseSchema().loads(resp)
49+
50+
def create_u_log_service_topic(
51+
self, req: typing.Optional[dict] = None, **kwargs
52+
) -> dict:
53+
"""CreateULogServiceTopic - 创建ULogService主题
54+
55+
**Request**
56+
57+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
58+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
59+
- **ReserveAge** (int) - (Required) 保存时间 1~360 天,-1表示永久保存
60+
- **TopicName** (str) - (Required) 主题名称,校验规则"^[\w]{1,23}$"
61+
- **LogSetId** (str) - 日志集ID
62+
- **TopicShardNum** (int) - 分区数量 数字1~20
63+
64+
**Response**
65+
66+
- **TopicId** (str) - 主题ID
67+
68+
"""
69+
# build request
70+
d = {
71+
"ProjectId": self.config.project_id,
72+
"Region": self.config.region,
73+
}
74+
req and d.update(req)
75+
d = apis.CreateULogServiceTopicRequestSchema().dumps(d)
76+
77+
# build options
78+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
79+
80+
resp = self.invoke("CreateULogServiceTopic", d, **kwargs)
81+
return apis.CreateULogServiceTopicResponseSchema().loads(resp)
82+
83+
def delete_u_log_service_log_set(
84+
self, req: typing.Optional[dict] = None, **kwargs
85+
) -> dict:
86+
"""DeleteULogServiceLogSet - 删除日志集
87+
88+
**Request**
89+
90+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
91+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
92+
- **LogSetId** (str) - (Required) 日志集ID
93+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
94+
95+
**Response**
96+
97+
98+
"""
99+
# build request
100+
d = {
101+
"ProjectId": self.config.project_id,
102+
"Region": self.config.region,
103+
}
104+
req and d.update(req)
105+
d = apis.DeleteULogServiceLogSetRequestSchema().dumps(d)
106+
107+
resp = self.invoke("DeleteULogServiceLogSet", d, **kwargs)
108+
return apis.DeleteULogServiceLogSetResponseSchema().loads(resp)
109+
110+
def delete_u_log_service_topic(
111+
self, req: typing.Optional[dict] = None, **kwargs
112+
) -> dict:
113+
"""DeleteULogServiceTopic - 删除ULogService主题
114+
115+
**Request**
116+
117+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
118+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
119+
- **TopicId** (str) - (Required) 主题Id
120+
121+
**Response**
122+
123+
- **Message** (str) - 错误信息,成功情况下为空字符串
124+
125+
"""
126+
# build request
127+
d = {
128+
"ProjectId": self.config.project_id,
129+
"Region": self.config.region,
130+
}
131+
req and d.update(req)
132+
d = apis.DeleteULogServiceTopicRequestSchema().dumps(d)
133+
134+
resp = self.invoke("DeleteULogServiceTopic", d, **kwargs)
135+
return apis.DeleteULogServiceTopicResponseSchema().loads(resp)
136+
137+
def list_u_log_service_log_set(
138+
self, req: typing.Optional[dict] = None, **kwargs
139+
) -> dict:
140+
"""ListULogServiceLogSet - 查询日志集列表
141+
142+
**Request**
143+
144+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
145+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
146+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
147+
148+
**Response**
149+
150+
- **Data** (list) - 见 **LogSetInfo** 模型定义
151+
152+
**Response Model**
153+
154+
**LogSetInfo**
155+
- **CreateTime** (int) - 创建时间
156+
- **LogSetName** (str) - 日志集名称
157+
- **LogSetRemark** (str) - 日志集备注
158+
- **TopicCount** (int) - 日志集下主题数量
159+
- **UpdateTime** (int) - 更新时间
160+
161+
162+
"""
163+
# build request
164+
d = {
165+
"ProjectId": self.config.project_id,
166+
"Region": self.config.region,
167+
}
168+
req and d.update(req)
169+
d = apis.ListULogServiceLogSetRequestSchema().dumps(d)
170+
171+
resp = self.invoke("ListULogServiceLogSet", d, **kwargs)
172+
return apis.ListULogServiceLogSetResponseSchema().loads(resp)
173+
174+
def list_u_log_service_topic(
175+
self, req: typing.Optional[dict] = None, **kwargs
176+
) -> dict:
177+
"""ListULogServiceTopic - 获取ULogService主题
178+
179+
**Request**
180+
181+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
182+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
183+
- **Limit** (int) - 分页限制数,默认为30
184+
- **Offset** (int) - 分页起始条目数, 默认为0
185+
186+
**Response**
187+
188+
- **Data** (list) - 见 **TopicInfo** 模型定义
189+
- **TotalCount** (int) - 主题总数
190+
191+
**Response Model**
192+
193+
**TopicInfo**
194+
- **IsReserved** (int) - 是否保留:0 - NORMAL, 1 - RESERVED
195+
- **ReserveAge** (int) - 保存时间 1~360 天,-1表示永久保存
196+
- **TopicDesc** (str) - 主题描述
197+
- **TopicId** (str) - 主题ID
198+
- **TopicName** (str) - 主题名称
199+
- **TopicShardNum** (int) - 分区数量 数字1~20
200+
201+
202+
"""
203+
# build request
204+
d = {
205+
"ProjectId": self.config.project_id,
206+
"Region": self.config.region,
207+
}
208+
req and d.update(req)
209+
d = apis.ListULogServiceTopicRequestSchema().dumps(d)
210+
211+
resp = self.invoke("ListULogServiceTopic", d, **kwargs)
212+
return apis.ListULogServiceTopicResponseSchema().loads(resp)
213+
18214
def query_u_log_service_log(
19215
self, req: typing.Optional[dict] = None, **kwargs
20216
) -> dict:
@@ -24,7 +220,7 @@ def query_u_log_service_log(
24220
25221
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
26222
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
27-
- **QueryCriteria** (str) - (Required) 查询条件Json格式,使用Base64编码
223+
- **QueryCriteria** (str) - (Required) 查询条件,使用Base64编码。目前只支持查询索引,多个索引查询使用AND。比如:index1:http AND index2:http2
28224
- **SortOrder** (str) - (Required) 日志时间排序;可选值ASC|DESC
29225
- **TopicId** (str) - (Required) 主题ID
30226
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_

ucloud/services/ulogservice/schemas/apis.py

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,166 @@
77
"""
88

99

10+
"""
11+
API: CreateULogServiceLogSet
12+
13+
创建日志集
14+
"""
15+
16+
17+
class CreateULogServiceLogSetRequestSchema(schema.RequestSchema):
18+
"""CreateULogServiceLogSet - 创建日志集"""
19+
20+
fields = {
21+
"LogSetName": fields.Str(required=True, dump_to="LogSetName"),
22+
"LogSetRemark": fields.Str(required=False, dump_to="LogSetRemark"),
23+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
24+
"Region": fields.Str(required=True, dump_to="Region"),
25+
"Zone": fields.Str(required=True, dump_to="Zone"),
26+
}
27+
28+
29+
class CreateULogServiceLogSetResponseSchema(schema.ResponseSchema):
30+
"""CreateULogServiceLogSet - 创建日志集"""
31+
32+
fields = {
33+
"LogSetId": fields.Str(required=False, load_from="LogSetId"),
34+
}
35+
36+
37+
"""
38+
API: CreateULogServiceTopic
39+
40+
创建ULogService主题
41+
"""
42+
43+
44+
class CreateULogServiceTopicRequestSchema(schema.RequestSchema):
45+
"""CreateULogServiceTopic - 创建ULogService主题"""
46+
47+
fields = {
48+
"LogSetId": fields.Str(required=False, dump_to="LogSetId"),
49+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
50+
"Region": fields.Str(required=True, dump_to="Region"),
51+
"ReserveAge": fields.Int(required=True, dump_to="ReserveAge"),
52+
"TopicName": fields.Str(required=True, dump_to="TopicName"),
53+
"TopicShardNum": fields.Int(required=False, dump_to="TopicShardNum"),
54+
}
55+
56+
57+
class CreateULogServiceTopicResponseSchema(schema.ResponseSchema):
58+
"""CreateULogServiceTopic - 创建ULogService主题"""
59+
60+
fields = {
61+
"TopicId": fields.Str(required=False, load_from="TopicId"),
62+
}
63+
64+
65+
"""
66+
API: DeleteULogServiceLogSet
67+
68+
删除日志集
69+
"""
70+
71+
72+
class DeleteULogServiceLogSetRequestSchema(schema.RequestSchema):
73+
"""DeleteULogServiceLogSet - 删除日志集"""
74+
75+
fields = {
76+
"LogSetId": fields.Str(required=True, dump_to="LogSetId"),
77+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
78+
"Region": fields.Str(required=True, dump_to="Region"),
79+
"Zone": fields.Str(required=True, dump_to="Zone"),
80+
}
81+
82+
83+
class DeleteULogServiceLogSetResponseSchema(schema.ResponseSchema):
84+
"""DeleteULogServiceLogSet - 删除日志集"""
85+
86+
fields = {}
87+
88+
89+
"""
90+
API: DeleteULogServiceTopic
91+
92+
删除ULogService主题
93+
"""
94+
95+
96+
class DeleteULogServiceTopicRequestSchema(schema.RequestSchema):
97+
"""DeleteULogServiceTopic - 删除ULogService主题"""
98+
99+
fields = {
100+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
101+
"Region": fields.Str(required=True, dump_to="Region"),
102+
"TopicId": fields.Str(required=True, dump_to="TopicId"),
103+
}
104+
105+
106+
class DeleteULogServiceTopicResponseSchema(schema.ResponseSchema):
107+
"""DeleteULogServiceTopic - 删除ULogService主题"""
108+
109+
fields = {
110+
"Message": fields.Str(required=False, load_from="Message"),
111+
}
112+
113+
114+
"""
115+
API: ListULogServiceLogSet
116+
117+
查询日志集列表
118+
"""
119+
120+
121+
class ListULogServiceLogSetRequestSchema(schema.RequestSchema):
122+
"""ListULogServiceLogSet - 查询日志集列表"""
123+
124+
fields = {
125+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
126+
"Region": fields.Str(required=True, dump_to="Region"),
127+
"Zone": fields.Str(required=True, dump_to="Zone"),
128+
}
129+
130+
131+
class ListULogServiceLogSetResponseSchema(schema.ResponseSchema):
132+
"""ListULogServiceLogSet - 查询日志集列表"""
133+
134+
fields = {
135+
"Data": fields.List(
136+
models.LogSetInfoSchema(), required=False, load_from="Data"
137+
),
138+
}
139+
140+
141+
"""
142+
API: ListULogServiceTopic
143+
144+
获取ULogService主题
145+
"""
146+
147+
148+
class ListULogServiceTopicRequestSchema(schema.RequestSchema):
149+
"""ListULogServiceTopic - 获取ULogService主题"""
150+
151+
fields = {
152+
"Limit": fields.Int(required=False, dump_to="Limit"),
153+
"Offset": fields.Int(required=False, dump_to="Offset"),
154+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
155+
"Region": fields.Str(required=True, dump_to="Region"),
156+
}
157+
158+
159+
class ListULogServiceTopicResponseSchema(schema.ResponseSchema):
160+
"""ListULogServiceTopic - 获取ULogService主题"""
161+
162+
fields = {
163+
"Data": fields.List(
164+
models.TopicInfoSchema(), required=True, load_from="Data"
165+
),
166+
"TotalCount": fields.Int(required=True, load_from="TotalCount"),
167+
}
168+
169+
10170
"""
11171
API: QueryULogServiceLog
12172

0 commit comments

Comments
 (0)