All Products
Search
Document Center

Log Service:ListConfig

Last Updated:Oct 26, 2023

Lists all Logtail configuration files of a project. You can paginate the configurations by specifying the related parameters.

Request syntax

GET /configs? offset=0&size=100 HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

Request parameters

  • Request headers

    The ListConfig operation does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Parameters
    Parameter Type Required Example Description
    offset integer No 0 The start position of entries to return. Default value: 0.
    size integer No 10 The maximum number of entries to return on each page. Default value: 500.

Response parameters

  • Response headers

    The ListConfig operation does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements
    The response body of the ListConfig operation contains a list of all Logtail configuration files of the project. The following table describes the parameters of the response body.
    Parameter Type Example Description
    count Integer 3 The number of Logtail configuration files that are returned on the current page.
    total Integer 3 The total number of Logtail configuration files on the server.
    configs String array logtail-config-sample,logtail-config-sample-2,logtail-config-sample-3 The name list of the Logtail configuration files that are returned.

Examples

  • Sample requests
    GET /configs? offset=0&size=10 HTTP/1.1
    Header :
    {
        "Content-Length": 0, 
        "x-log-signaturemethod": "hmac-sha1", 
        "x-log-bodyrawsize": 0, 
        "User-Agent": "log-python-sdk-v-0.6.0", 
        "Host": "ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com", 
        "Date": "Mon, 09 Nov 2015 09:19:13 GMT", 
        "x-log-apiversion": "0.6.0", 
        "Authorization": "LOG <yourAccessKeyId>:<yourSignature>"
    }
  • Sample success responses
    Header :
    {
        "content-length": "103", 
        "server": "nginx/1.6.1", 
        "connection": "close", 
        "date": "Mon, 09 Nov 2015 09:19:13 GMT", 
        "content-type": "application/json", 
        "x-log-requestid": "5640651199248CAA2300C2BA"
    }
    Body:
    {
        "count": 3, 
        "configs": 
        [
            "logtail-config-sample", 
            "logtail-config-sample-2", 
            "logtail-config-sample-3"
        ], 
        "total": 3
    }

Error codes

HTTP status code Error code Error message Description
404 ConfigNotExist config {Configname} does not exist. The error message returned because the specified Logtail configuration file does not exist.
500 InternalServerError internal server error. The error message returned because an internal server error has occurred.

For more information about the error codes, see Common error codes.