GPU服务API文档
团队管理
查询团队操作日志

ListCompShareTeamOperateLog — 查询团队操作日志

接口说明

查询指定团队的操作日志列表,支持按操作类型、状态、时间范围筛选。

使用限制

  • 账户需完成实名认证。
  • 需要团队管理员权限。

请求参数

名称类型必填描述示例值
ActionString接口名称ListCompShareTeamOperateLog
RegionString地域cn-wlcb
TeamIdUint32团队 ID100001
LimitInt64每页数量,默认 25,最大 10025
OffsetInt64偏移量,默认 00
BeginTimeInt64起始时间(Unix 时间戳)1700000000
EndTimeInt64结束时间(Unix 时间戳)1700086400
OperateTypeArray操作类型筛选["InviteMember","RemoveMember"]
StatusArray状态筛选["Success","Failed"]
OrderByASCBoolean是否按时间正序排列,默认倒序false

响应参数

名称类型描述示例值
ActionString响应名称ListCompShareTeamOperateLogResponse
RetCodeInteger返回码,0 为成功0
LogsArray操作日志列表见下表
TotalUint32日志总数50
OperateTypeListMap操作类型枚举映射{"InviteMember":"邀请成员"}
StatusListMap状态枚举映射{"Success":"成功"}

Logs 元素

名称类型描述示例值
ContentString操作内容描述管理员邀请张三加入团队
OperateTypeString操作类型InviteMember
CreateTimeInteger创建时间(Unix 时间戳)1700000000
StatusString操作状态Success

请求示例

Python(使用 UCloud SDK)

安装 SDK:

pip install --upgrade ucloud-sdk-python3

示例代码:

from ucloud.core import exc
from ucloud.client import Client
 
 
def main():
    client = Client({
        "region": "cn-wlcb",
        "public_key": "my_public_key",    # 替换为你的公钥,从 https://console.compshare.cn/uaccount/api_manage 获取
        "private_key": "my_private_key",   # 替换为你的私钥
        "base_url": "https://api.compshare.cn",
    })
 
    try:
        resp = client.ucompshare().list_comp_share_team_operate_log({
            "TeamId": 100001,
            "Limit": 25,
            "Offset": 0,
        })
        print(f"总数: {resp['Total']}")
        for log in resp["Logs"]:
            print(f"{log['CreateTime']} - {log['OperateType']}: {log['Content']}")
    except exc.UCloudException as e:
        print(e)
 
 
if __name__ == "__main__":
    main()

Go(使用 UCloud SDK)

安装依赖:

go get github.com/ucloud/ucloud-sdk-go

示例代码:

package main
 
import (
	"fmt"
 
	"github.com/ucloud/ucloud-sdk-go/services/ucompshare"
	"github.com/ucloud/ucloud-sdk-go/ucloud"
	"github.com/ucloud/ucloud-sdk-go/ucloud/auth"
)
 
func main() {
	cfg := ucloud.NewConfig()
	cfg.Region = "cn-wlcb"
	cfg.BaseUrl = "https://api.compshare.cn"
 
	credential := auth.NewCredential()
	credential.PublicKey = "my_public_key"   // 替换为你的公钥,从 https://console.compshare.cn/uaccount/api_manage 获取
	credential.PrivateKey = "my_private_key" // 替换为你的私钥
	client := ucompshare.NewClient(&cfg, &credential)
 
	req := client.NewListCompShareTeamOperateLogRequest()
	req.TeamId = ucloud.Uint32(100001)
	req.Limit = ucloud.Int64(25)
	req.Offset = ucloud.Int64(0)
 
	resp, err := client.ListCompShareTeamOperateLog(req)
	if err != nil {
		fmt.Printf("查询失败: %s\n", err)
		return
	}
	fmt.Printf("总数: %d\n", resp.Total)
	for _, log := range resp.Logs {
		fmt.Printf("%d - %s: %s\n", log.CreateTime, log.OperateType, log.Content)
	}
}

响应示例

{
  "Action": "ListCompShareTeamOperateLogResponse",
  "RetCode": 0,
  "Total": 50,
  "Logs": [
    {
      "Content": "管理员邀请张三加入团队",
      "OperateType": "InviteMember",
      "CreateTime": 1700000000,
      "Status": "Success"
    }
  ],
  "OperateTypeList": {
    "InviteMember": "邀请成员",
    "RemoveMember": "移除成员"
  },
  "StatusList": {
    "Success": "成功",
    "Failed": "失败"
  }
}
Copyright © 2026 沪ICP备12020087号-61