const { tlsOpenapi } = require('@volcengine/openapi');
const tlsOpenapiService = tlsOpenapi.defaultService;
const project = await tlsOpenapiService.CreateProject({
ProjectName: 'your project name',
Region: 'project belong to which region',
const topic = await tlsOpenapiService.CreateTopic({
ProjectId: 'your project id',
ShardCount: 'your shard count',
TopicName: 'your topic name',
const index = await tlsOpenapiService.CreateIndex({
TopicId: 'your topic id',
FullText: 'your full-text config',
KeyValue: 'your kv config',
const logBuffer = await tlsOpenapi.TlsService.objToProtoBuffer({
Contents: [{ Key: 'content key', Value: 'key value' }]
LogTags: [{ Key: 'tag key', Value: 'key value' }],
ContextFlow: 'context flow',
const putLogsResult = await tlsOpenapiService.PutLogs({
TopicId: 'your topic id',
CompressType: 'log compress type',
LogGroupList: logBuffer,
const searchLogsResult = await tlsOpenapiService.SearchLogs({
StartTime: 'log start time',
EndTime: 'log end time',
TopicId: 'your topic id',