云服务器内容精选

  • URI GET /v2/{project_id}/user-events 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 start_time 否 String 查询起始时间(0时区)。 end_time 否 String 查询结束时间(0时区)。 username 否 String 用户名(精确搜索)。 event_type 否 String 事件类型。 event_trace_id 否 String 事件之间的关联id。 offset 否 Integer 用于分页查询,查询的起始记录序号,从0开始。 limit 否 Integer 用于分页查询,返回用户事件数量限制,取值范围0-1000。如果不指定,默认为100。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 count Integer 事件总数。 items Array of UserEventRsp objects 用户事件列表。 表5 UserEventRsp 参数 参数类型 描述 project_id String 项目id。 username String 用户名。 workspace_id String 企业id。 event_trace_id String 事件之间的关联id。 event_type String 事件类型。 event_time String 事件时间,UTC时间。 resource_type String 操作对象类型。 resource_id String 操作对象id。 resource_name String 操作对象名称。 client_type String 客户端类型。 client_ip String 客户端ip。 client_mac String 客户端mac地址。 source_ip String 操作用户源ip。 is_success Boolean 是否成功。 error_code String 错误码。 error_msg String 错误描述。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。
  • 响应示例 状态码: 200 响应成功。 { "count" : 0, "items" : [ { "project_id" : "xxx", "username" : "xxx", "workspace_id" : "xxx", "event_trace_id" : "407481bd-65b4-4de4-a553-67d858cbe29b", "event_type" : "loginByPassword", "event_time" : "1970-01-01T00:00:00Z", "resource_type" : "USER", "resource_id" : "407481bd-65b4-4de4-a553-67d858cbe29b", "resource_name" : "DESKTOP-01", "client_type" : "WINDOWS", "client_ip" : "127.0.0.1", "client_mac" : "xx.xx.xx.xx", "source_ip" : "127.0.0.1", "is_success" : true, "error_code" : "WKS.00000000", "error_msg" : "OK" } ]}