events

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEventsResponse

type CreateEventsResponse struct {
	// Specifies the event ID.
	EventId string `json:"event_id"`
	// Specifies the event name.
	// Start with a letter. Enter 1 to 64 characters. Only letters, digits, and underscores (_) are allowed.
	EventName string `json:"event_name"`
}

func CreateEvents

func CreateEvents(client *golangsdk.ServiceClient, opts []EventItem) ([]CreateEventsResponse, error)

type EventInfo

type EventInfo struct {
	// Specifies the event name.
	EventName string `json:"event_name,omitempty"`
	// Specifies the event type.
	EventType string `json:"event_type,omitempty"`
	// Specifies the number of occurrences of this event within the specified query time range.
	EventCount int `json:"event_count,omitempty"`
	// Specifies when the event last occurred.
	LatestOccurTime int64 `json:"latest_occur_time,omitempty"`
	// Specifies the event source. If the event is a system event, the value is the namespace of each service.
	// To view the namespace of each service, see A.1 Services Interconnected with Cloud Eye.
	// If the event is a custom event, the event source is defined by the user.
	LatestEventSource string `json:"latest_event_source,omitempty"`
}

type EventInfoDetail

type EventInfoDetail struct {
	// Specifies the event name. Start with a letter. Enter 1 to 64 characters. Only letters, digits, and underscores (_) are allowed.
	EventName string `json:"event_name"`
	// Specifies the event source in the format of service.item. service and item each must start with
	// a letter and contain 3 to 32 characters, including only letters, digits, and underscores (_).
	EventSource string `json:"event_source"`
	// Specifies when the event occurred, which is a UNIX timestamp (ms).
	// Since there is a latency between the client and the server, the data timestamp to be inserted should be within
	// the period that starts from one hour before the current time plus 20s to 10 minutes after the current time minus 20s.
	// In this way, the timestamp will be inserted to the database without being affected by the latency.
	Time int64 `json:"time"`
	// Specifies the event details.
	Detail EventItemDetail `json:"detail"`
	// Specifies the event ID.
	EventId string `json:"event_id,omitempty"`
}

type EventItem

type EventItem struct {
	// Specifies the event name.
	// Start with a letter. Enter 1 to 64 characters. Only letters, digits, and underscores (_) are allowed.
	EventName string `json:"event_name" required:"true"`
	// Specifies the event source.
	// The format is service.item. Set this parameter based on the site requirements.
	// service and item each must be a string that starts with a letter and contains 3 to 32 characters, including only letters, digits, and underscores (_).
	EventSource string `json:"event_source" required:"true"`
	// Specifies when the event occurred, which is a UNIX timestamp (ms).
	// NOTE
	// Since there is a latency between the client and the server, the data timestamp to be inserted should be within
	// the period that starts from one hour before the current time plus 20s to 10 minutes after the current time minus 20s.
	// In this way, the timestamp will be inserted to the database without being affected by the latency.
	// For example, if the current time is 2020.01.30 12:00:30, the timestamp inserted must be within the range
	// [2020.01.30 11:00:50, 2020.01.30 12:10:10]. The corresponding UNIX timestamp is [1580353250, 1580357410].
	Time   int64           `json:"time" required:"true"`
	Detail EventItemDetail `json:"detail" required:"true"`
}

type EventItemDetail

type EventItemDetail struct {
	// Specifies the event content. Enter up to 4096 characters.
	Content string `json:"content,omitempty"`
	// Specifies the resource ID. Enter up to 128 characters, including letters, digits, underscores (_), hyphens (-), and colon (:).
	// Example: 6a69bf28-ee62-49f3-9785-845dacd799ec
	// To query the resource ID, perform the following steps:
	// 1.	Log in to the management console.
	// 2.	Under Computing, select Elastic Cloud Server.
	// On the Resource Overview page, obtain the resource ID.
	ResourceId string `json:"resource_id,omitempty"`
	// Specifies the resource name. Enter up to 128 characters, including letters, digits, underscores (_), and hyphens (-).
	ResourceName string `json:"resource_name,omitempty"`
	// Specifies the event status.
	// Valid value can be normal, warning, or incident.
	EventState string `json:"event_state,omitempty"`
	// Specifies the event severity.
	// Its value can be Critical, Major, Minor, or Info.
	EventLevel string `json:"event_level,omitempty"`
	// Specifies the event user.
	// Enter up to 64 characters, including letters, digits, underscores (_), hyphens (-), slashes (/), and spaces.
	EventUser string `json:"event_user,omitempty"`

	GroupId   string `json:"group_id,omitempty"`
	EventType string `json:"event_type,omitempty"`
}

type ListEventDetailOpts

type ListEventDetailOpts struct {
	// Specifies the event name.
	EventName string
	// Specifies the event type. Possible types are EVENT.SYS (system event) and EVENT.CUSTOM (custom event).
	EventType string `q:"event_type" required:"true"`
	// Specifies the event name. The name can be a system event name or a custom event name.
	EventSource string `q:"event_source,omitempty"`
	// Specifies the event severity. Possible severities are Critical, Major, Minor, and Info.
	EventLevel string `q:"event_level,omitempty"`
	// Specifies the name of the user who reports the event monitoring data. It can also be a project ID.
	EventUser string `q:"event_user,omitempty"`
	// Specifies the event status. Possible statuses are normal, warning, or incident.
	EventState string `q:"event_state,omitempty"`
	// Specifies the start time of the query. The time is a UNIX timestamp and the unit is ms. Example: 1605952700911
	From int64 `q:"from,omitempty"`
	// No
	// Specifies the end time of the query. The time is a UNIX timestamp and the unit is ms. The from value must be smaller than the to value.
	To int64 `q:"to,omitempty"`
	// Specifies the start value of pagination. The value is an integer. The default value is 0.
	Start int `q:"start,omitempty"`
	// Specifies the maximum number of records that can be queried at a time. Supported range: 1 to 100 (default)
	Limit int `q:"limit,omitempty"`
}

type ListEventDetailResponse

type ListEventDetailResponse struct {
	// Specifies the event name. The name can be a system event name or a custom event name.
	EventName string `json:"event_name,omitempty"`
	// Specifies the event type. Possible types are EVENT.SYS (system event) and EVENT.CUSTOM (custom event).
	EventType string `json:"event_type,omitempty"`
	// Specifies the name of the user who reports the event. It can also be a project ID.
	EventUsers []string `json:"event_users,omitempty"`
	// Specifies the event source. If the event is a system event, the source is the namespace of each service.
	// To view the namespace of each service, see A.1 Services Interconnected with Cloud Eye. If the event is a custom event, the event source is defined by the user.
	EventSources []string `json:"event_sources,omitempty"`
	// Specifies details about one or more events.
	EventInfo []EventInfoDetail `json:"event_info,omitempty"`
	// Specifies the number of metadata records in the query result.
	MetaData TotalMetaData `json:"meta_data,omitempty"`
}

type ListEventsOpts

type ListEventsOpts struct {
	// Specifies the event type. Possible types are EVENT.SYS (system event) and EVENT.CUSTOM (custom event).
	EventType string `q:"event_type,omitempty"`
	// Specifies the event name. The name can be a system event name or a custom event name.
	EventName string `q:"event_name,omitempty"`
	// Specifies the start time of the query. The time is a UNIX timestamp and the unit is ms. Example: 1605952700911
	From int64 `q:"from,omitempty"`
	// Specifies the end time of the query. The time is a UNIX timestamp and the unit is ms.
	// from must be smaller than to. For example, set to 1606557500911.
	To int64 `q:"to,omitempty"`
	// Specifies the start value of pagination. The value is an integer. The default value is 0.
	Start int `q:"start,omitempty"`
	// Specifies the maximum number of events that can be queried at a time. Supported range: 1 to 100 (default)
	Limit int `q:"limit,omitempty"`
}

type ListEventsResponse

type ListEventsResponse struct {
	// Specifies one or more pieces of event data.
	Events []EventInfo `json:"events,omitempty"`
	// Specifies the number of metadata records in the query result.
	MetaData TotalMetaData `json:"meta_data,omitempty"`
}

func ListEvents

func ListEvents(client *golangsdk.ServiceClient, opts ListEventsOpts) (*ListEventsResponse, error)

type TotalMetaData

type TotalMetaData struct {
	// Specifies the total number of events.
	Total int `json:"total,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL