1// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package v20190319 16 17import ( 18 "encoding/json" 19 "errors" 20 21 tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" 22) 23 24type AttributeKeyDetail struct { 25 26 // 输入框类型 27 LabelType *string `json:"LabelType,omitempty" name:"LabelType"` 28 29 // 初始化展示 30 Starter *string `json:"Starter,omitempty" name:"Starter"` 31 32 // 展示排序 33 Order *int64 `json:"Order,omitempty" name:"Order"` 34 35 // AttributeKey值 36 Value *string `json:"Value,omitempty" name:"Value"` 37 38 // 中文标签 39 Label *string `json:"Label,omitempty" name:"Label"` 40} 41 42type AuditSummary struct { 43 44 // 跟踪集状态,1:开启,0:关闭 45 AuditStatus *int64 `json:"AuditStatus,omitempty" name:"AuditStatus"` 46 47 // COS存储桶名称 48 CosBucketName *string `json:"CosBucketName,omitempty" name:"CosBucketName"` 49 50 // 跟踪集名称 51 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 52 53 // 日志前缀 54 LogFilePrefix *string `json:"LogFilePrefix,omitempty" name:"LogFilePrefix"` 55} 56 57type CmqRegionInfo struct { 58 59 // 地域描述 60 CmqRegionName *string `json:"CmqRegionName,omitempty" name:"CmqRegionName"` 61 62 // cmq地域 63 CmqRegion *string `json:"CmqRegion,omitempty" name:"CmqRegion"` 64} 65 66type CosRegionInfo struct { 67 68 // cos地域 69 CosRegion *string `json:"CosRegion,omitempty" name:"CosRegion"` 70 71 // 地域描述 72 CosRegionName *string `json:"CosRegionName,omitempty" name:"CosRegionName"` 73} 74 75type CreateAuditRequest struct { 76 *tchttp.BaseRequest 77 78 // 是否开启cmq消息通知。1:是,0:否。目前仅支持cmq的队列服务。如果开启cmq消息通知服务,云审计会将您的日志内容实时投递到您指定地域的指定队列中。 79 IsEnableCmqNotify *int64 `json:"IsEnableCmqNotify,omitempty" name:"IsEnableCmqNotify"` 80 81 // 管理事件的读写属性。1:只读,2:只写,3:全部。 82 ReadWriteAttribute *int64 `json:"ReadWriteAttribute,omitempty" name:"ReadWriteAttribute"` 83 84 // 跟踪集名称。3-128字符,只能包含 ASCII 编码字母 a-z,A-Z,数字 0-9,下划线 _。 85 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 86 87 // cos地域。目前支持的地域可以使用ListCosEnableRegion来获取。 88 CosRegion *string `json:"CosRegion,omitempty" name:"CosRegion"` 89 90 // 是否创建新的cos存储桶。1:是,0:否。 91 IsCreateNewBucket *int64 `json:"IsCreateNewBucket,omitempty" name:"IsCreateNewBucket"` 92 93 // cos的存储桶名称。仅支持小写英文字母和数字即[a-z,0-9]、中划线“-”及其组合。用户自定义的字符串支持1 - 40个字符。存储桶命名不能以“-”开头或结尾。如果不是新创建的存储桶,云审计不会去校验该存储桶是否真的存在,请谨慎填写,避免日志投递不成功,导致您的数据丢失。 94 CosBucketName *string `json:"CosBucketName,omitempty" name:"CosBucketName"` 95 96 // CMK的全局唯一标识符,如果不是新创建的kms,该值是必填值。可以通过ListKeyAliasByRegion来获取。云审计不会校验KeyId的合法性,请您谨慎填写,避免给您的数据造成损失。 97 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 98 99 // 队列名称。队列名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。如果IsEnableCmqNotify值是1的话,此值属于必填字段。如果不是新创建的队列,云审计不会去校验该队列是否真的存在,请谨慎填写,避免日志通知不成功,导致您的数据丢失。 100 CmqQueueName *string `json:"CmqQueueName,omitempty" name:"CmqQueueName"` 101 102 // kms地域。目前支持的地域可以使用ListKmsEnableRegion来获取。必须要和cos的地域保持一致。 103 KmsRegion *string `json:"KmsRegion,omitempty" name:"KmsRegion"` 104 105 // 是否开启kms加密。1:是,0:否。如果开启KMS加密,数据在投递到cos时,会将数据加密。 106 IsEnableKmsEncry *int64 `json:"IsEnableKmsEncry,omitempty" name:"IsEnableKmsEncry"` 107 108 // 队列所在的地域。可以通过ListCmqEnableRegion获取支持的cmq地域。如果IsEnableCmqNotify值是1的话,此值属于必填字段。 109 CmqRegion *string `json:"CmqRegion,omitempty" name:"CmqRegion"` 110 111 // 日志文件前缀。3-40个字符,只能包含 ASCII 编码字母 a-z,A-Z,数字 0-9。可以不填,默认以账号ID作为日志前缀。 112 LogFilePrefix *string `json:"LogFilePrefix,omitempty" name:"LogFilePrefix"` 113 114 // 是否创建新的队列。1:是,0:否。如果IsEnableCmqNotify值是1的话,此值属于必填字段。 115 IsCreateNewQueue *int64 `json:"IsCreateNewQueue,omitempty" name:"IsCreateNewQueue"` 116} 117 118func (r *CreateAuditRequest) ToJsonString() string { 119 b, _ := json.Marshal(r) 120 return string(b) 121} 122 123// It is highly **NOT** recommended to use this function 124// because it has no param check, nor strict type check 125func (r *CreateAuditRequest) FromJsonString(s string) error { 126 f := make(map[string]interface{}) 127 if err := json.Unmarshal([]byte(s), &f); err != nil { 128 return err 129 } 130 delete(f, "IsEnableCmqNotify") 131 delete(f, "ReadWriteAttribute") 132 delete(f, "AuditName") 133 delete(f, "CosRegion") 134 delete(f, "IsCreateNewBucket") 135 delete(f, "CosBucketName") 136 delete(f, "KeyId") 137 delete(f, "CmqQueueName") 138 delete(f, "KmsRegion") 139 delete(f, "IsEnableKmsEncry") 140 delete(f, "CmqRegion") 141 delete(f, "LogFilePrefix") 142 delete(f, "IsCreateNewQueue") 143 if len(f) > 0 { 144 return errors.New("CreateAuditRequest has unknown keys!") 145 } 146 return json.Unmarshal([]byte(s), &r) 147} 148 149type CreateAuditResponse struct { 150 *tchttp.BaseResponse 151 Response *struct { 152 153 // 是否创建成功。 154 IsSuccess *int64 `json:"IsSuccess,omitempty" name:"IsSuccess"` 155 156 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 157 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 158 } `json:"Response"` 159} 160 161func (r *CreateAuditResponse) ToJsonString() string { 162 b, _ := json.Marshal(r) 163 return string(b) 164} 165 166// It is highly **NOT** recommended to use this function 167// because it has no param check, nor strict type check 168func (r *CreateAuditResponse) FromJsonString(s string) error { 169 return json.Unmarshal([]byte(s), &r) 170} 171 172type DeleteAuditRequest struct { 173 *tchttp.BaseRequest 174 175 // 跟踪集名称 176 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 177} 178 179func (r *DeleteAuditRequest) ToJsonString() string { 180 b, _ := json.Marshal(r) 181 return string(b) 182} 183 184// It is highly **NOT** recommended to use this function 185// because it has no param check, nor strict type check 186func (r *DeleteAuditRequest) FromJsonString(s string) error { 187 f := make(map[string]interface{}) 188 if err := json.Unmarshal([]byte(s), &f); err != nil { 189 return err 190 } 191 delete(f, "AuditName") 192 if len(f) > 0 { 193 return errors.New("DeleteAuditRequest has unknown keys!") 194 } 195 return json.Unmarshal([]byte(s), &r) 196} 197 198type DeleteAuditResponse struct { 199 *tchttp.BaseResponse 200 Response *struct { 201 202 // 是否删除成功 203 IsSuccess *int64 `json:"IsSuccess,omitempty" name:"IsSuccess"` 204 205 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 206 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 207 } `json:"Response"` 208} 209 210func (r *DeleteAuditResponse) ToJsonString() string { 211 b, _ := json.Marshal(r) 212 return string(b) 213} 214 215// It is highly **NOT** recommended to use this function 216// because it has no param check, nor strict type check 217func (r *DeleteAuditResponse) FromJsonString(s string) error { 218 return json.Unmarshal([]byte(s), &r) 219} 220 221type DescribeAuditRequest struct { 222 *tchttp.BaseRequest 223 224 // 跟踪集名称 225 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 226} 227 228func (r *DescribeAuditRequest) ToJsonString() string { 229 b, _ := json.Marshal(r) 230 return string(b) 231} 232 233// It is highly **NOT** recommended to use this function 234// because it has no param check, nor strict type check 235func (r *DescribeAuditRequest) FromJsonString(s string) error { 236 f := make(map[string]interface{}) 237 if err := json.Unmarshal([]byte(s), &f); err != nil { 238 return err 239 } 240 delete(f, "AuditName") 241 if len(f) > 0 { 242 return errors.New("DescribeAuditRequest has unknown keys!") 243 } 244 return json.Unmarshal([]byte(s), &r) 245} 246 247type DescribeAuditResponse struct { 248 *tchttp.BaseResponse 249 Response *struct { 250 251 // 是否开启cmq消息通知。1:是,0:否。 252 IsEnableCmqNotify *int64 `json:"IsEnableCmqNotify,omitempty" name:"IsEnableCmqNotify"` 253 254 // 管理事件读写属性,1:只读,2:只写,3:全部 255 ReadWriteAttribute *int64 `json:"ReadWriteAttribute,omitempty" name:"ReadWriteAttribute"` 256 257 // CMK的全局唯一标识符。 258 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 259 260 // 跟踪集状态,1:开启,0:停止。 261 AuditStatus *int64 `json:"AuditStatus,omitempty" name:"AuditStatus"` 262 263 // 跟踪集名称。 264 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 265 266 // cos存储桶所在地域。 267 CosRegion *string `json:"CosRegion,omitempty" name:"CosRegion"` 268 269 // 队列名称。 270 CmqQueueName *string `json:"CmqQueueName,omitempty" name:"CmqQueueName"` 271 272 // CMK别名。 273 KmsAlias *string `json:"KmsAlias,omitempty" name:"KmsAlias"` 274 275 // kms地域。 276 KmsRegion *string `json:"KmsRegion,omitempty" name:"KmsRegion"` 277 278 // 是否开启kms加密。1:是,0:否。如果开启KMS加密,数据在投递到cos时,会将数据加密。 279 IsEnableKmsEncry *int64 `json:"IsEnableKmsEncry,omitempty" name:"IsEnableKmsEncry"` 280 281 // cos存储桶名称。 282 CosBucketName *string `json:"CosBucketName,omitempty" name:"CosBucketName"` 283 284 // 队列所在地域。 285 CmqRegion *string `json:"CmqRegion,omitempty" name:"CmqRegion"` 286 287 // 日志前缀。 288 LogFilePrefix *string `json:"LogFilePrefix,omitempty" name:"LogFilePrefix"` 289 290 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 291 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 292 } `json:"Response"` 293} 294 295func (r *DescribeAuditResponse) ToJsonString() string { 296 b, _ := json.Marshal(r) 297 return string(b) 298} 299 300// It is highly **NOT** recommended to use this function 301// because it has no param check, nor strict type check 302func (r *DescribeAuditResponse) FromJsonString(s string) error { 303 return json.Unmarshal([]byte(s), &r) 304} 305 306type DescribeEventsRequest struct { 307 *tchttp.BaseRequest 308 309 // 起始时间戳(单位秒,不超过当前时间 90 天) 310 StartTime *uint64 `json:"StartTime,omitempty" name:"StartTime"` 311 312 // 结束时间戳(单位秒,查询时间跨度小于 30 天) 313 EndTime *uint64 `json:"EndTime,omitempty" name:"EndTime"` 314 315 // 查看更多日志的凭证 316 NextToken *uint64 `json:"NextToken,omitempty" name:"NextToken"` 317 318 // 返回日志的最大条数(最大 50 条) 319 MaxResults *uint64 `json:"MaxResults,omitempty" name:"MaxResults"` 320 321 // 检索条件(目前支持 RequestId:请求 ID、EventName:事件名称、ActionType:操作类型(Write:写;Read:读)、PrincipalId:子账号、ResourceType:资源类型、ResourceName:资源名称、AccessKeyId:密钥 ID、SensitiveAction:是否敏感操作、ApiErrorCode:API 错误码、CamErrorCode:CAM 错误码) 322 LookupAttributes []*LookupAttribute `json:"LookupAttributes,omitempty" name:"LookupAttributes" list` 323} 324 325func (r *DescribeEventsRequest) ToJsonString() string { 326 b, _ := json.Marshal(r) 327 return string(b) 328} 329 330// It is highly **NOT** recommended to use this function 331// because it has no param check, nor strict type check 332func (r *DescribeEventsRequest) FromJsonString(s string) error { 333 f := make(map[string]interface{}) 334 if err := json.Unmarshal([]byte(s), &f); err != nil { 335 return err 336 } 337 delete(f, "StartTime") 338 delete(f, "EndTime") 339 delete(f, "NextToken") 340 delete(f, "MaxResults") 341 delete(f, "LookupAttributes") 342 if len(f) > 0 { 343 return errors.New("DescribeEventsRequest has unknown keys!") 344 } 345 return json.Unmarshal([]byte(s), &r) 346} 347 348type DescribeEventsResponse struct { 349 *tchttp.BaseResponse 350 Response *struct { 351 352 // 日志集合是否结束 353 ListOver *bool `json:"ListOver,omitempty" name:"ListOver"` 354 355 // 查看更多日志的凭证 356 NextToken *uint64 `json:"NextToken,omitempty" name:"NextToken"` 357 358 // 日志集合 359 // 注意:此字段可能返回 null,表示取不到有效值。 360 Events []*Event `json:"Events,omitempty" name:"Events" list` 361 362 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 363 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 364 } `json:"Response"` 365} 366 367func (r *DescribeEventsResponse) ToJsonString() string { 368 b, _ := json.Marshal(r) 369 return string(b) 370} 371 372// It is highly **NOT** recommended to use this function 373// because it has no param check, nor strict type check 374func (r *DescribeEventsResponse) FromJsonString(s string) error { 375 return json.Unmarshal([]byte(s), &r) 376} 377 378type Event struct { 379 380 // 日志ID 381 EventId *string `json:"EventId,omitempty" name:"EventId"` 382 383 // 用户名 384 Username *string `json:"Username,omitempty" name:"Username"` 385 386 // 事件时间 387 EventTime *string `json:"EventTime,omitempty" name:"EventTime"` 388 389 // 日志详情 390 CloudAuditEvent *string `json:"CloudAuditEvent,omitempty" name:"CloudAuditEvent"` 391 392 // 资源类型中文描述(此字段请按需使用,如果您是其他语言使用者,可以忽略该字段描述) 393 ResourceTypeCn *string `json:"ResourceTypeCn,omitempty" name:"ResourceTypeCn"` 394 395 // 鉴权错误码 396 ErrorCode *int64 `json:"ErrorCode,omitempty" name:"ErrorCode"` 397 398 // 事件名称 399 EventName *string `json:"EventName,omitempty" name:"EventName"` 400 401 // 证书ID 402 // 注意:此字段可能返回 null,表示取不到有效值。 403 SecretId *string `json:"SecretId,omitempty" name:"SecretId"` 404 405 // 请求来源 406 EventSource *string `json:"EventSource,omitempty" name:"EventSource"` 407 408 // 请求ID 409 RequestID *string `json:"RequestID,omitempty" name:"RequestID"` 410 411 // 资源地域 412 ResourceRegion *string `json:"ResourceRegion,omitempty" name:"ResourceRegion"` 413 414 // 主账号ID 415 AccountID *int64 `json:"AccountID,omitempty" name:"AccountID"` 416 417 // 源IP 418 // 注意:此字段可能返回 null,表示取不到有效值。 419 SourceIPAddress *string `json:"SourceIPAddress,omitempty" name:"SourceIPAddress"` 420 421 // 事件名称中文描述(此字段请按需使用,如果您是其他语言使用者,可以忽略该字段描述) 422 EventNameCn *string `json:"EventNameCn,omitempty" name:"EventNameCn"` 423 424 // 资源对 425 Resources *Resource `json:"Resources,omitempty" name:"Resources"` 426 427 // 事件地域 428 EventRegion *string `json:"EventRegion,omitempty" name:"EventRegion"` 429} 430 431type GetAttributeKeyRequest struct { 432 *tchttp.BaseRequest 433 434 // 网站类型,取值范围是zh和en。如果不传值默认zh 435 WebsiteType *string `json:"WebsiteType,omitempty" name:"WebsiteType"` 436} 437 438func (r *GetAttributeKeyRequest) ToJsonString() string { 439 b, _ := json.Marshal(r) 440 return string(b) 441} 442 443// It is highly **NOT** recommended to use this function 444// because it has no param check, nor strict type check 445func (r *GetAttributeKeyRequest) FromJsonString(s string) error { 446 f := make(map[string]interface{}) 447 if err := json.Unmarshal([]byte(s), &f); err != nil { 448 return err 449 } 450 delete(f, "WebsiteType") 451 if len(f) > 0 { 452 return errors.New("GetAttributeKeyRequest has unknown keys!") 453 } 454 return json.Unmarshal([]byte(s), &r) 455} 456 457type GetAttributeKeyResponse struct { 458 *tchttp.BaseResponse 459 Response *struct { 460 461 // AttributeKey的有效取值范围 462 AttributeKeyDetails []*AttributeKeyDetail `json:"AttributeKeyDetails,omitempty" name:"AttributeKeyDetails" list` 463 464 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 465 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 466 } `json:"Response"` 467} 468 469func (r *GetAttributeKeyResponse) ToJsonString() string { 470 b, _ := json.Marshal(r) 471 return string(b) 472} 473 474// It is highly **NOT** recommended to use this function 475// because it has no param check, nor strict type check 476func (r *GetAttributeKeyResponse) FromJsonString(s string) error { 477 return json.Unmarshal([]byte(s), &r) 478} 479 480type InquireAuditCreditRequest struct { 481 *tchttp.BaseRequest 482} 483 484func (r *InquireAuditCreditRequest) ToJsonString() string { 485 b, _ := json.Marshal(r) 486 return string(b) 487} 488 489// It is highly **NOT** recommended to use this function 490// because it has no param check, nor strict type check 491func (r *InquireAuditCreditRequest) FromJsonString(s string) error { 492 f := make(map[string]interface{}) 493 if err := json.Unmarshal([]byte(s), &f); err != nil { 494 return err 495 } 496 if len(f) > 0 { 497 return errors.New("InquireAuditCreditRequest has unknown keys!") 498 } 499 return json.Unmarshal([]byte(s), &r) 500} 501 502type InquireAuditCreditResponse struct { 503 *tchttp.BaseResponse 504 Response *struct { 505 506 // 可创建跟踪集的数量 507 AuditAmount *int64 `json:"AuditAmount,omitempty" name:"AuditAmount"` 508 509 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 510 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 511 } `json:"Response"` 512} 513 514func (r *InquireAuditCreditResponse) ToJsonString() string { 515 b, _ := json.Marshal(r) 516 return string(b) 517} 518 519// It is highly **NOT** recommended to use this function 520// because it has no param check, nor strict type check 521func (r *InquireAuditCreditResponse) FromJsonString(s string) error { 522 return json.Unmarshal([]byte(s), &r) 523} 524 525type KeyMetadata struct { 526 527 // 作为密钥更容易辨识,更容易被人看懂的别名 528 Alias *string `json:"Alias,omitempty" name:"Alias"` 529 530 // CMK的全局唯一标识 531 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 532} 533 534type ListAuditsRequest struct { 535 *tchttp.BaseRequest 536} 537 538func (r *ListAuditsRequest) ToJsonString() string { 539 b, _ := json.Marshal(r) 540 return string(b) 541} 542 543// It is highly **NOT** recommended to use this function 544// because it has no param check, nor strict type check 545func (r *ListAuditsRequest) FromJsonString(s string) error { 546 f := make(map[string]interface{}) 547 if err := json.Unmarshal([]byte(s), &f); err != nil { 548 return err 549 } 550 if len(f) > 0 { 551 return errors.New("ListAuditsRequest has unknown keys!") 552 } 553 return json.Unmarshal([]byte(s), &r) 554} 555 556type ListAuditsResponse struct { 557 *tchttp.BaseResponse 558 Response *struct { 559 560 // 查询跟踪集概要集合 561 // 注意:此字段可能返回 null,表示取不到有效值。 562 AuditSummarys []*AuditSummary `json:"AuditSummarys,omitempty" name:"AuditSummarys" list` 563 564 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 565 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 566 } `json:"Response"` 567} 568 569func (r *ListAuditsResponse) ToJsonString() string { 570 b, _ := json.Marshal(r) 571 return string(b) 572} 573 574// It is highly **NOT** recommended to use this function 575// because it has no param check, nor strict type check 576func (r *ListAuditsResponse) FromJsonString(s string) error { 577 return json.Unmarshal([]byte(s), &r) 578} 579 580type ListCmqEnableRegionRequest struct { 581 *tchttp.BaseRequest 582 583 // 站点类型。zh表示中国区,en表示国际区。默认中国区。 584 WebsiteType *string `json:"WebsiteType,omitempty" name:"WebsiteType"` 585} 586 587func (r *ListCmqEnableRegionRequest) ToJsonString() string { 588 b, _ := json.Marshal(r) 589 return string(b) 590} 591 592// It is highly **NOT** recommended to use this function 593// because it has no param check, nor strict type check 594func (r *ListCmqEnableRegionRequest) FromJsonString(s string) error { 595 f := make(map[string]interface{}) 596 if err := json.Unmarshal([]byte(s), &f); err != nil { 597 return err 598 } 599 delete(f, "WebsiteType") 600 if len(f) > 0 { 601 return errors.New("ListCmqEnableRegionRequest has unknown keys!") 602 } 603 return json.Unmarshal([]byte(s), &r) 604} 605 606type ListCmqEnableRegionResponse struct { 607 *tchttp.BaseResponse 608 Response *struct { 609 610 // 云审计支持的cmq的可用区 611 EnableRegions []*CmqRegionInfo `json:"EnableRegions,omitempty" name:"EnableRegions" list` 612 613 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 614 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 615 } `json:"Response"` 616} 617 618func (r *ListCmqEnableRegionResponse) ToJsonString() string { 619 b, _ := json.Marshal(r) 620 return string(b) 621} 622 623// It is highly **NOT** recommended to use this function 624// because it has no param check, nor strict type check 625func (r *ListCmqEnableRegionResponse) FromJsonString(s string) error { 626 return json.Unmarshal([]byte(s), &r) 627} 628 629type ListCosEnableRegionRequest struct { 630 *tchttp.BaseRequest 631 632 // 站点类型。zh表示中国区,en表示国际区。默认中国区。 633 WebsiteType *string `json:"WebsiteType,omitempty" name:"WebsiteType"` 634} 635 636func (r *ListCosEnableRegionRequest) ToJsonString() string { 637 b, _ := json.Marshal(r) 638 return string(b) 639} 640 641// It is highly **NOT** recommended to use this function 642// because it has no param check, nor strict type check 643func (r *ListCosEnableRegionRequest) FromJsonString(s string) error { 644 f := make(map[string]interface{}) 645 if err := json.Unmarshal([]byte(s), &f); err != nil { 646 return err 647 } 648 delete(f, "WebsiteType") 649 if len(f) > 0 { 650 return errors.New("ListCosEnableRegionRequest has unknown keys!") 651 } 652 return json.Unmarshal([]byte(s), &r) 653} 654 655type ListCosEnableRegionResponse struct { 656 *tchttp.BaseResponse 657 Response *struct { 658 659 // 云审计支持的cos可用区 660 EnableRegions []*CosRegionInfo `json:"EnableRegions,omitempty" name:"EnableRegions" list` 661 662 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 663 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 664 } `json:"Response"` 665} 666 667func (r *ListCosEnableRegionResponse) ToJsonString() string { 668 b, _ := json.Marshal(r) 669 return string(b) 670} 671 672// It is highly **NOT** recommended to use this function 673// because it has no param check, nor strict type check 674func (r *ListCosEnableRegionResponse) FromJsonString(s string) error { 675 return json.Unmarshal([]byte(s), &r) 676} 677 678type ListKeyAliasByRegionRequest struct { 679 *tchttp.BaseRequest 680 681 // Kms地域 682 KmsRegion *string `json:"KmsRegion,omitempty" name:"KmsRegion"` 683 684 // 含义跟 SQL 查询的 Limit 一致,表示本次获最多获取 Limit 个元素。缺省值为10,最大值为200 685 Limit *int64 `json:"Limit,omitempty" name:"Limit"` 686 687 // 含义跟 SQL 查询的 Offset 一致,表示本次获取从按一定顺序排列数组的第 Offset 个元素开始,缺省为0 688 Offset *int64 `json:"Offset,omitempty" name:"Offset"` 689} 690 691func (r *ListKeyAliasByRegionRequest) ToJsonString() string { 692 b, _ := json.Marshal(r) 693 return string(b) 694} 695 696// It is highly **NOT** recommended to use this function 697// because it has no param check, nor strict type check 698func (r *ListKeyAliasByRegionRequest) FromJsonString(s string) error { 699 f := make(map[string]interface{}) 700 if err := json.Unmarshal([]byte(s), &f); err != nil { 701 return err 702 } 703 delete(f, "KmsRegion") 704 delete(f, "Limit") 705 delete(f, "Offset") 706 if len(f) > 0 { 707 return errors.New("ListKeyAliasByRegionRequest has unknown keys!") 708 } 709 return json.Unmarshal([]byte(s), &r) 710} 711 712type ListKeyAliasByRegionResponse struct { 713 *tchttp.BaseResponse 714 Response *struct { 715 716 // CMK的总数量 717 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` 718 719 // 密钥别名 720 KeyMetadatas []*KeyMetadata `json:"KeyMetadatas,omitempty" name:"KeyMetadatas" list` 721 722 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 723 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 724 } `json:"Response"` 725} 726 727func (r *ListKeyAliasByRegionResponse) ToJsonString() string { 728 b, _ := json.Marshal(r) 729 return string(b) 730} 731 732// It is highly **NOT** recommended to use this function 733// because it has no param check, nor strict type check 734func (r *ListKeyAliasByRegionResponse) FromJsonString(s string) error { 735 return json.Unmarshal([]byte(s), &r) 736} 737 738type LookUpEventsRequest struct { 739 *tchttp.BaseRequest 740 741 // 开始时间 742 StartTime *int64 `json:"StartTime,omitempty" name:"StartTime"` 743 744 // 结束时间 745 EndTime *int64 `json:"EndTime,omitempty" name:"EndTime"` 746 747 // 检索条件 748 LookupAttributes []*LookupAttribute `json:"LookupAttributes,omitempty" name:"LookupAttributes" list` 749 750 // 查看更多日志的凭证 751 NextToken *string `json:"NextToken,omitempty" name:"NextToken"` 752 753 // 返回日志的最大条数 754 MaxResults *int64 `json:"MaxResults,omitempty" name:"MaxResults"` 755 756 // 云审计模式,有效值:standard | quick,其中standard是标准模式,quick是极速模式。默认为标准模式 757 Mode *string `json:"Mode,omitempty" name:"Mode"` 758} 759 760func (r *LookUpEventsRequest) ToJsonString() string { 761 b, _ := json.Marshal(r) 762 return string(b) 763} 764 765// It is highly **NOT** recommended to use this function 766// because it has no param check, nor strict type check 767func (r *LookUpEventsRequest) FromJsonString(s string) error { 768 f := make(map[string]interface{}) 769 if err := json.Unmarshal([]byte(s), &f); err != nil { 770 return err 771 } 772 delete(f, "StartTime") 773 delete(f, "EndTime") 774 delete(f, "LookupAttributes") 775 delete(f, "NextToken") 776 delete(f, "MaxResults") 777 delete(f, "Mode") 778 if len(f) > 0 { 779 return errors.New("LookUpEventsRequest has unknown keys!") 780 } 781 return json.Unmarshal([]byte(s), &r) 782} 783 784type LookUpEventsResponse struct { 785 *tchttp.BaseResponse 786 Response *struct { 787 788 // 查看更多日志的凭证 789 // 注意:此字段可能返回 null,表示取不到有效值。 790 NextToken *string `json:"NextToken,omitempty" name:"NextToken"` 791 792 // 日志集合 793 // 注意:此字段可能返回 null,表示取不到有效值。 794 Events []*Event `json:"Events,omitempty" name:"Events" list` 795 796 // 日志集合是否结束 797 // 注意:此字段可能返回 null,表示取不到有效值。 798 ListOver *bool `json:"ListOver,omitempty" name:"ListOver"` 799 800 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 801 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 802 } `json:"Response"` 803} 804 805func (r *LookUpEventsResponse) ToJsonString() string { 806 b, _ := json.Marshal(r) 807 return string(b) 808} 809 810// It is highly **NOT** recommended to use this function 811// because it has no param check, nor strict type check 812func (r *LookUpEventsResponse) FromJsonString(s string) error { 813 return json.Unmarshal([]byte(s), &r) 814} 815 816type LookupAttribute struct { 817 818 // AttributeKey的有效取值范围是:RequestId、EventName、ReadOnly、Username、ResourceType、ResourceName和AccessKeyId,EventId 819 // 注意:此字段可能返回 null,表示取不到有效值。 820 AttributeKey *string `json:"AttributeKey,omitempty" name:"AttributeKey"` 821 822 // AttributeValue的值 823 // 注意:此字段可能返回 null,表示取不到有效值。 824 AttributeValue *string `json:"AttributeValue,omitempty" name:"AttributeValue"` 825} 826 827type Resource struct { 828 829 // 资源类型 830 ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` 831 832 // 资源名称 833 // 注意:此字段可能返回 null,表示取不到有效值。 834 ResourceName *string `json:"ResourceName,omitempty" name:"ResourceName"` 835} 836 837type StartLoggingRequest struct { 838 *tchttp.BaseRequest 839 840 // 跟踪集名称 841 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 842} 843 844func (r *StartLoggingRequest) ToJsonString() string { 845 b, _ := json.Marshal(r) 846 return string(b) 847} 848 849// It is highly **NOT** recommended to use this function 850// because it has no param check, nor strict type check 851func (r *StartLoggingRequest) FromJsonString(s string) error { 852 f := make(map[string]interface{}) 853 if err := json.Unmarshal([]byte(s), &f); err != nil { 854 return err 855 } 856 delete(f, "AuditName") 857 if len(f) > 0 { 858 return errors.New("StartLoggingRequest has unknown keys!") 859 } 860 return json.Unmarshal([]byte(s), &r) 861} 862 863type StartLoggingResponse struct { 864 *tchttp.BaseResponse 865 Response *struct { 866 867 // 是否开启成功 868 IsSuccess *int64 `json:"IsSuccess,omitempty" name:"IsSuccess"` 869 870 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 871 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 872 } `json:"Response"` 873} 874 875func (r *StartLoggingResponse) ToJsonString() string { 876 b, _ := json.Marshal(r) 877 return string(b) 878} 879 880// It is highly **NOT** recommended to use this function 881// because it has no param check, nor strict type check 882func (r *StartLoggingResponse) FromJsonString(s string) error { 883 return json.Unmarshal([]byte(s), &r) 884} 885 886type StopLoggingRequest struct { 887 *tchttp.BaseRequest 888 889 // 跟踪集名称 890 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 891} 892 893func (r *StopLoggingRequest) ToJsonString() string { 894 b, _ := json.Marshal(r) 895 return string(b) 896} 897 898// It is highly **NOT** recommended to use this function 899// because it has no param check, nor strict type check 900func (r *StopLoggingRequest) FromJsonString(s string) error { 901 f := make(map[string]interface{}) 902 if err := json.Unmarshal([]byte(s), &f); err != nil { 903 return err 904 } 905 delete(f, "AuditName") 906 if len(f) > 0 { 907 return errors.New("StopLoggingRequest has unknown keys!") 908 } 909 return json.Unmarshal([]byte(s), &r) 910} 911 912type StopLoggingResponse struct { 913 *tchttp.BaseResponse 914 Response *struct { 915 916 // 是否关闭成功 917 IsSuccess *int64 `json:"IsSuccess,omitempty" name:"IsSuccess"` 918 919 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 920 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 921 } `json:"Response"` 922} 923 924func (r *StopLoggingResponse) ToJsonString() string { 925 b, _ := json.Marshal(r) 926 return string(b) 927} 928 929// It is highly **NOT** recommended to use this function 930// because it has no param check, nor strict type check 931func (r *StopLoggingResponse) FromJsonString(s string) error { 932 return json.Unmarshal([]byte(s), &r) 933} 934 935type UpdateAuditRequest struct { 936 *tchttp.BaseRequest 937 938 // 跟踪集名称 939 AuditName *string `json:"AuditName,omitempty" name:"AuditName"` 940 941 // 是否开启cmq消息通知。1:是,0:否。目前仅支持cmq的队列服务。如果开启cmq消息通知服务,云审计会将您的日志内容实时投递到您指定地域的指定队列中。 942 IsEnableCmqNotify *int64 `json:"IsEnableCmqNotify,omitempty" name:"IsEnableCmqNotify"` 943 944 // 管理事件的读写属性。1:只读,2:只写,3:全部。 945 ReadWriteAttribute *int64 `json:"ReadWriteAttribute,omitempty" name:"ReadWriteAttribute"` 946 947 // CMK的全局唯一标识符,如果不是新创建的kms,该值是必填值。可以通过ListKeyAliasByRegion来获取。云审计不会校验KeyId的合法性,请您谨慎填写,避免给您的数据造成损失。 948 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 949 950 // cos地域。目前支持的地域可以使用ListCosEnableRegion来获取。 951 CosRegion *string `json:"CosRegion,omitempty" name:"CosRegion"` 952 953 // 队列名称。队列名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。如果IsEnableCmqNotify值是1的话,此值属于必填字段。如果不是新创建的队列,云审计不会去校验该队列是否真的存在,请谨慎填写,避免日志通知不成功,导致您的数据丢失。 954 CmqQueueName *string `json:"CmqQueueName,omitempty" name:"CmqQueueName"` 955 956 // 是否创建新的cos存储桶。1:是,0:否。 957 IsCreateNewBucket *int64 `json:"IsCreateNewBucket,omitempty" name:"IsCreateNewBucket"` 958 959 // kms地域。目前支持的地域可以使用ListKmsEnableRegion来获取。必须要和cos的地域保持一致。 960 KmsRegion *string `json:"KmsRegion,omitempty" name:"KmsRegion"` 961 962 // 是否开启kms加密。1:是,0:否。如果开启KMS加密,数据在投递到cos时,会将数据加密。 963 IsEnableKmsEncry *int64 `json:"IsEnableKmsEncry,omitempty" name:"IsEnableKmsEncry"` 964 965 // cos的存储桶名称。仅支持小写英文字母和数字即[a-z,0-9]、中划线“-”及其组合。用户自定义的字符串支持1 - 40个字符。存储桶命名不能以“-”开头或结尾。如果不是新创建的存储桶,云审计不会去校验该存储桶是否真的存在,请谨慎填写,避免日志投递不成功,导致您的数据丢失。 966 CosBucketName *string `json:"CosBucketName,omitempty" name:"CosBucketName"` 967 968 // 队列所在的地域。可以通过ListCmqEnableRegion获取支持的cmq地域。如果IsEnableCmqNotify值是1的话,此值属于必填字段。 969 CmqRegion *string `json:"CmqRegion,omitempty" name:"CmqRegion"` 970 971 // 日志文件前缀。3-40个字符,只能包含 ASCII 编码字母 a-z,A-Z,数字 0-9。 972 LogFilePrefix *string `json:"LogFilePrefix,omitempty" name:"LogFilePrefix"` 973 974 // 是否创建新的队列。1:是,0:否。如果IsEnableCmqNotify值是1的话,此值属于必填字段。 975 IsCreateNewQueue *int64 `json:"IsCreateNewQueue,omitempty" name:"IsCreateNewQueue"` 976} 977 978func (r *UpdateAuditRequest) ToJsonString() string { 979 b, _ := json.Marshal(r) 980 return string(b) 981} 982 983// It is highly **NOT** recommended to use this function 984// because it has no param check, nor strict type check 985func (r *UpdateAuditRequest) FromJsonString(s string) error { 986 f := make(map[string]interface{}) 987 if err := json.Unmarshal([]byte(s), &f); err != nil { 988 return err 989 } 990 delete(f, "AuditName") 991 delete(f, "IsEnableCmqNotify") 992 delete(f, "ReadWriteAttribute") 993 delete(f, "KeyId") 994 delete(f, "CosRegion") 995 delete(f, "CmqQueueName") 996 delete(f, "IsCreateNewBucket") 997 delete(f, "KmsRegion") 998 delete(f, "IsEnableKmsEncry") 999 delete(f, "CosBucketName") 1000 delete(f, "CmqRegion") 1001 delete(f, "LogFilePrefix") 1002 delete(f, "IsCreateNewQueue") 1003 if len(f) > 0 { 1004 return errors.New("UpdateAuditRequest has unknown keys!") 1005 } 1006 return json.Unmarshal([]byte(s), &r) 1007} 1008 1009type UpdateAuditResponse struct { 1010 *tchttp.BaseResponse 1011 Response *struct { 1012 1013 // 是否更新成功 1014 IsSuccess *int64 `json:"IsSuccess,omitempty" name:"IsSuccess"` 1015 1016 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1017 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1018 } `json:"Response"` 1019} 1020 1021func (r *UpdateAuditResponse) ToJsonString() string { 1022 b, _ := json.Marshal(r) 1023 return string(b) 1024} 1025 1026// It is highly **NOT** recommended to use this function 1027// because it has no param check, nor strict type check 1028func (r *UpdateAuditResponse) FromJsonString(s string) error { 1029 return json.Unmarshal([]byte(s), &r) 1030} 1031