Documentation
¶
Index ¶
- func Create(client *golangsdk.ServiceClient, opts CreateOpts) (string, error)
- func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (err error)
- type CreateOpts
- type DeleteOpts
- type ListLogsOpts
- type ListLogsResponse
- type ListStreamsOpts
- type LogContents
- type LogStream
- type LogStreamUpdateResponse
- type UpdateLogStreamOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v0.9.4
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (string, error)
func Delete ¶ added in v0.9.4
func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (err error)
DeleteLogStream a log topic by id
Types ¶
type CreateOpts ¶
type CreateOpts struct {
// ID of a created log group
GroupId string `json:"-" required:"true"`
// Name of the log stream to be created.
// Minimum length: 1 character
// Maximum length: 64 characters
// Enumerated value:
// lts-stream-13ci
LogStreamName string `json:"log_stream_name" required:"true"`
// Tags - tags of a group.
Tags []tags.ResourceTag `json:"tags,omitempty"`
// Log stream alias.
Alias string `json:"log_stream_name_alias,omitempty"`
// Enterprise project name.
EnterpriseProjectName string `json:"enterprise_project_name,omitempty"`
}
type DeleteOpts ¶
type ListLogsOpts ¶
type ListLogsOpts struct {
GroupId string `json:"-" required:"true"`
StreamId string `json:"-" required:"true"`
// UTC start time of the search window (in milliseconds).
// NOTE:
// Maximum query time range: 30 days
StartTime string `json:"start_time" required:"true"`
// UTC end time of the search window (in milliseconds).
// NOTE:
// Maximum query time range: 30 days
EndTime string `json:"end_time" required:"true"`
// Filter criteria, which vary between log sources.
Labels map[string]string `json:"labels,omitempty"`
// Keyword used for search. A keyword is a word between two adjacent delimiters.
// Enumerated value:
// error
Keywords string `json:"keywords,omitempty"`
// Sequence number of a log event. This parameter is not required for the first query, but is required for subsequent pagination queries. The value can be obtained from the response of the last query. The value of line_num should be between the values of start_time and end_time.
// Value length: 19 characters
LineNum string `json:"line_num,omitempty"`
// Whether the search order is descending or ascending. The default value is false, indicating that search results are displayed in ascending order.
// Enumerated value:
// false
IsDesc *bool `json:"is_desc,omitempty"`
// The value is init (default value) for the first query, or forwards or backwards for a pagination query. This parameter is used together with is_desc for pagination queries.
// Enumerated value:
// forwards
SearchType string `json:"search_type,omitempty"`
// Number of logs to be queried each time. The value is 50 when this parameter is not set. You are advised to set this parameter to 100.
//
// Minimum value: 1
// Maximum value: 5000
Limit int32 `json:"limit,omitempty"`
}
type ListLogsResponse ¶
type ListLogsResponse struct {
Count int `json:"count,omitempty"`
Logs []LogContents `json:"logs,omitempty"`
}
func ListLogs ¶
func ListLogs(client *golangsdk.ServiceClient, opts ListLogsOpts) (*ListLogsResponse, error)
type ListStreamsOpts ¶ added in v0.9.4
type LogContents ¶
type LogContents struct {
// Raw log data.
// Minimum length: 1 character
// Maximum length: 10,000 characters
Content string `json:"content,omitempty"`
// Sequence number of a log event.
// Value length: 19 characters
LineNum string `json:"line_num,omitempty"`
// Labels contained in a log event. The labels vary depending on log events.
Labels map[string]string `json:"labels,omitempty"`
}
type LogStream ¶
type LogStream struct {
// Creation time.
// Minimum value: 1577808000000
// Maximum value: 4102416000000
CreationTime int64 `json:"creation_time"`
// Log stream name.
// Value length: 36 characters
LogStreamName string `json:"log_stream_name"`
// Log stream ID.
// Value length: 36 characters
LogStreamId string `json:"log_stream_id"`
// Number of filters.
// Minimum value: 0
// Maximum value: 5
FilterCount int32 `json:"filter_count"`
// Log stream tag.
Tag map[string]string `json:"tag,omitempty"`
// Whether to add a log stream to favorites.
IsFavorite bool `json:"is_favorite,omitempty"`
// Log retention duration, in days (fixed to 7 days).
TTLInDays int `json:"ttl_in_days"`
}
func List ¶ added in v0.9.4
func List(client *golangsdk.ServiceClient, groupId string) ([]LogStream, error)
func ListStreams ¶ added in v0.9.4
func ListStreams(client *golangsdk.ServiceClient, opts ListStreamsOpts) ([]LogStream, error)
type LogStreamUpdateResponse ¶ added in v0.9.4
type LogStreamUpdateResponse struct {
// Creation time.
// Minimum value: 1577808000000
// Maximum value: 4102416000000
CreationTime int64 `json:"creation_time"`
// Log stream name.
// Value length: 36 characters
LogStreamName string `json:"log_topic_name"`
// Log stream ID.
// Value length: 36 characters
LogStreamId string `json:"log_topic_id"`
// Log retention duration, in days.
TtlInDays int `json:"ttl_in_days"`
}
func Update ¶ added in v0.9.4
func Update(client *golangsdk.ServiceClient, opts UpdateLogStreamOpts) (*LogStreamUpdateResponse, error)
type UpdateLogStreamOpts ¶ added in v0.9.4
type UpdateLogStreamOpts struct {
GroupId string `json:"-" required:"true"`
StreamId string `json:"-" required:"true"`
// Log retention duration, in days (fixed to 7 days).
TTLInDays int `json:"ttl_in_days" required:"true"`
// Tags - tags of a group.
Tags []tags.ResourceTag `json:"tags,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.