Updated on 2025-05-29 GMT+08:00

Querying Audit Logs (Operation Logs)

Function

Query the audit log list.

SLA Item

Definition

Request success rate

≥ 99%

Availability

Tier 2

Data consistency

Strongly consistent

Throughput

60 times/minute

TP50 request latency

200 ms

TP99.9 request latency

300 ms

Precautions

None

Calling Method

GET

URI

/rest/dataapi/homs/open-api/v1/cloudAuditlog

Path parameters

None

Query parameters

Parameter

Mandatory

Type

Value Range

Description

log_type

No

String

None

Log type. The value can be 0 (operation logs) or 1 (security logs).

begin_time

Yes

long

Millisecond timestamp.

Start time.

end_time

Yes

long

Millisecond timestamp.

End time.

page_size

Yes

int

0~1000

Page size.

offset_value

Yes

int

None

Start value for the query.

Request

  • Request header parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    X-APIG-Appcode

    Yes

    String

    None

    AppCode allocated by SRE

    x-auth-token

    Yes

    String

    None

    IAM authentication token for the calling party APIG

    x-hcso-domainid

    Yes (HCS Online scenario)

    No (other scenarios)

    String

    None

    ID of the accessed tenant.

    x-hcso-appcode

    Yes

    String

    None

    AppCode allocated by SRE

  • Request body parameters

    None

  • Sample request
    GET /rest/dataapi/homs/open-api/v1/cloudAuditlog HTTP/1.1 
    Host: example.com
    Content-Type: application/json 
    Accept: application/json
    X-APIG-Appcode: xxx 
    x-auth-token: xxx 
    x-hcso-domainid: xxx
    x-hcso-appcode: xxx

Response

  • Response parameters
    • Response status code 200: The Data object is returned. The Data object has the following attributes.

      Parameter

      Mandatory

      Type

      Value Range

      Description

      total

      Yes

      int32

      None

      Total number of data records.

      list

      Yes

      List<Item>

      None

      Process object information.

      The Item object has the following attributes.

      Parameter

      Mandatory

      Type

      Value Range

      Description

      id

      Yes

      String

      None

      Log ID.

      operating_name

      Yes

      String

      None

      Operation name.

      operating_source

      Yes

      int32

      None

      Operation source.

      operation_result

      Yes

      String

      None

      Operation result. If the value is 0, the operation succeeds. If the value is 1, the operation fails.

      operation_detail

      Yes

      String

      None

      Operation details.

      resource_name

      Yes

      String

      None

      Resource name.

      resource_type

      Yes

      String

      None

      Resource type.

      operating_user

      Yes

      String

      None

      Operator.

      department

      Yes

      String

      None

      Department.

      severity

      Yes

      String

      None

      Risk level. The value can be 4 (critical), 3 (major), 2 (minor), or 1 (warning).

      type

      Yes

      String

      None

      Log type. Value 0 indicates the operation log type. Value 1 indicates the security log type.

      start_time

      Yes

      String

      None

      Start time.

      end_time

      Yes

      String

      None

      End time.

      resource_id

      Yes

      String

      None

      Resource ID.

      resource_region

      Yes

      String

      None

      Region to which the resource belongs.

      source_addr

      Yes

      String

      None

      Resource IP address.

      region_id

      Yes

      String

      None

      Region ID.

      region_name

      Yes

      String

      None

      Region name.

      resource_region_name

      Yes

      String

      None

      Name of the region to which the resource belongs.

  • Sample response
    HTTP/1.1 200 OK 
    Date:Tue,18 Jul 2023 09:58:01 GMT
    Server: example.com
    Content-Type: application/json;charset=UTF8 
    { 
        "total": 33, 
        "list": [ 
                 { 
                 "id": "2030", 
                 "operating_name": "addScheduleSchedule", 
    "operating_source": " Operation source",
    "operation_result": "0 (success); 1 (failure)",
    "operation_detail": "Operation details",
                 "resource_name": "CloudCapacity", 
                 "resource_type": "schedule", 
                 "operating_user": "capacityApi", 
    "department": "Department",
    "severity": "Risk level. 4-critical, 3-major, 2-minor, 1-warning",
    "type": "Log type. 0: operation log; 1: security log.",
                 "start_time": "2020-11-01 01:13:59", 
                 "end_time": "2020-11-01 01:13:59", 
    "resource_id": "Resource ID",
    "resource_region": "Resource region name: cn-north-1",
    "source_addr": "Resource IP address obtained from regionIp: 10.0.25.204",
                 "region_id": "cn-north-1", 
                 "region_name": "xx-region", 
                 "resource_region_name": "xx-region" 
                  } 
                ] 
    }

Status Codes

Status Code

Description

200

Operation successful.

400

Parameter error.

401

Token authentication failed.

403

Authentication failed.

404

REST API not found.

Operation Severity

Minor