Files
doc-exports/docs/lts/api-ref/lts_02_0003.html
liusiying77 fdbbe7547a LTS API 20240130 version.
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: liusiying77 <liusiying@huawei.com>
Co-committed-by: liusiying77 <liusiying@huawei.com>
2025-03-12 12:37:01 +00:00

11 KiB

Creating a Log Group

This API is used to create a log group. All API URLs described in this section must be case-sensitive.

Function

This function describes how to create a log group for log storage and query. You can create a maximum of 100 log groups.

URI

  • URI format

    POST /v2.0/{project_id}/log-groups

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Request

  • Request parameters
    Table 2 Parameter description

    Parameter

    Sub-Parameter

    Mandatory

    Type

    Description

    log_group_name

    N/A

    Yes

    String

    Log group name.

    The configuration rules are as follows:

    • Must be a string of 1 to 64 characters.
    • Only allows uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.). The name cannot start with a period or underscore, or end with a period.

    ttl_in_days

    N/A

    Yes

    Int

    Log retention duration. (default: 30 days)

    Minimum value: 1

    Maximum value: 365

  • Example request
    POST /v2.0/{project_id}/log-groups 
    { 
    "log_group_name":"test01",
    "ttl_in_days": 7
    }

Response

  • Response parameters
    Table 3 Parameter description

    Parameter

    Sub-Parameter

    Type

    Description

    log_group_id

    N/A

    String

    Log group ID

  • Example response
    { 
     "log_group_id":"56b4b31f-3024-11e9-9023-286ed488ce71"
    } 

Returned Value

  • Normal

    201