New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example支持cls产品 #112
example支持cls产品 #112
Conversation
examples/cls/v20201016/cls_kv.proto
Outdated
message LogTag | ||
{ | ||
required string key = 1; | ||
required string value = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些未对齐,看起来是空格和tab混排造成的,麻烦统一一下吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
examples/cls/v20201016/cls_kv.proto
Outdated
optional string contextFlow= 2; | ||
optional string filename = 3; | ||
optional string source = 4; | ||
repeated LogTag logTags = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样的
@@ -0,0 +1,41 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createlogset.py =》 create_logset.py 或者 create_log_set.py ,我不太确定logset是否是cls的术语
from tencentcloud.common import credential | ||
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException | ||
# 导入对应产品模块的client models。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不必要的空行
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException | ||
# 导入对应产品模块的client models。 | ||
|
||
from tencentcloud.cls.v20201016 import cls_client, models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
分两行导入,不要两个模块逗号隔开
|
||
client = cls_client.ClsClient(cred, "ap-guangzhou", clientProfile) | ||
req = models.CreateTopicRequest() | ||
req.LogsetId = "xxx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
@@ -0,0 +1,41 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createtopic.py =》create_topic.py
examples/cls/v20201016/pb.py
Outdated
# -*- coding:utf-8 -*- | ||
import sys | ||
|
||
import cls_kv_pb2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
工程内的模块置于标准库之后
examples/cls/v20201016/pb.py
Outdated
import cls_kv_pb2 | ||
import time | ||
import json | ||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重复的导入
# 实例化一个client选项,可选的,没有特殊需求可以跳过。 | ||
clientProfile = ClientProfile() | ||
clientProfile.signMethod = "TC3-HMAC-SHA256" # 指定签名算法(默认为HmacSHA256) | ||
clientProfile.unsignedPayload = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这并非公开的字段,而且这种控制类的请求并不建议打开,
整个配置示例字段其实并无十分的必要。下同
No description provided.