query_log

package
v7.25.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

审计日志查询

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogInfo

type LogInfo struct {
	EventId             string        // 日志 ID
	EventType           string        // 事件类型,仅支持 UNKNOWN 表示未知,CONSOLE 表示控制台事件,API 表示 API 事件
	EventTime           string        // 事件发生时间(UTC 格式)
	UserIdentity        UserIdentify  // 请求者的身份信息
	EventRw             string        // 读写类型,仅支持 UNKNOWN 表示未知,READ 表示读,WRITE 表示写
	ServiceName         string        // 服务名称
	EventName           string        // 事件名称
	SourceIp            string        // 源 IP 地址
	UserAgent           string        // 客户端代理
	ResourceNames       ResourceNames // 操作的资源名称列表
	RequestId           string        // 请求 ID
	RequestUrl          string        // 请求 URL
	RequestParams       string        // 请求的输入参数
	ResponseData        string        // 请求的返回数据
	ResponseCode        int64         // 请求的返回码
	ResponseMessage     string        // 请求的返回信息
	AdditionalEventData string        // 额外备注信息
}

返回的审计日志

func (*LogInfo) MarshalJSON

func (j *LogInfo) MarshalJSON() ([]byte, error)

func (*LogInfo) UnmarshalJSON

func (j *LogInfo) UnmarshalJSON(data []byte) error

type LogInfos

type LogInfos = []LogInfo

返回的审计日志列表

type QueryLogResp added in v7.24.0

type QueryLogResp = Response

type Request

type Request struct {
	StartTime   string                          // 检索日志的开始时间,日期格式按照 ISO8601 标准,并使用 UTC 时间
	EndTime     string                          // 检索日志的结束时间,日期格式按照 ISO8601 标准,并使用 UTC 时间
	ServiceName string                          // 服务名称,参考 https://developer.qiniu.com/af/12434/audit-log-events
	EventNames  []string                        // 事件名称集合,参考 https://developer.qiniu.com/af/12434/audit-log-events
	PrincipalId string                          // 请求者的 ID,参考 https://developer.qiniu.com/af/manual/12433/audit-log-object
	AccessKeyId string                          // 请求身份所属的 AccessKey ID
	Limit       int64                           // 允许返回的最大结果数目,取值范围:1~50,不传值默认为:20
	NextMark    string                          // 用于请求下一页检索的结果
	Credentials credentials.CredentialsProvider // 鉴权参数,用于生成鉴权凭证,如果为空,则使用 HTTPClientOptions 中的 CredentialsProvider
}

调用 API 所用的请求

type ResourceNames

type ResourceNames = []string

返回的操作的资源名称列表

type Response

type Response struct {
	NextMark      string   // 用于请求下一页检索的结果
	AuditLogInfos LogInfos // 日志集合
}

获取 API 所用的响应

func (*Response) MarshalJSON

func (j *Response) MarshalJSON() ([]byte, error)

func (*Response) UnmarshalJSON

func (j *Response) UnmarshalJSON(data []byte) error

type UserIdentify

type UserIdentify = UserIdentity

返回的请求者的身份信息

type UserIdentity

type UserIdentity struct {
	AccountId     string // 当前请求所属的七牛云账号 ID
	PrincipalId   string // 当前请求者的 ID,需结合 principal_type 来确认请求者身份
	PrincipalType string // 请求者身份类型,仅支持 UNKNOWN 表示未知,ROOT_USER 表示七牛云账户 ID,IAM_USER 表示 IAM 子账户 ID,QINIU_ACCOUNT 表示当七牛云账号跨账号操作时,记录七牛云账号 ID
	AccessKeyId   string // 当前请求身份所属的 AccessKey ID
}

请求者的身份信息

func (*UserIdentity) MarshalJSON

func (j *UserIdentity) MarshalJSON() ([]byte, error)

func (*UserIdentity) UnmarshalJSON

func (j *UserIdentity) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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