edit-icon download-icon

ListLogstore

Last Updated: Apr 12, 2018

List the names of all the Logstores in a specified project.

Request syntax

  1. GET /logstores HTTP/1.1
  2. Authorization: <AuthorizationString>
  3. Date: <GMT Date>
  4. Host: <Project Endpoint>
  5. x-log-apiversion: 0.6.0
  6. x-log-signaturemethod: hmac-sha1

Request parameters

Parameter name Type Required Description
offset(optional) integer No The starting position of a returned record. The default value is 1.
size(optional) integer No The maximum number of entries returned each page. The default value is 500 (the maximum value).
logstoreName string Yes The Logstore name used for the request (partial matching is supported).

Request header

The ListLogstore API does not have a special request header. For more information about the public request headers of Log Service APIs, see Public request header.

Response header

The ListLogstore API does not have a special response header. For more information about the public response headers of Log Service APIs, see Public response header.

Response element

After the ListLogstore request is successful, the response body includes the name list of all the Logstores in a specified project. The formats are as follows.

Name Type Description
count integer The number of returned Logstores.
total integer The total number of Logstores.
logstores string array The name list of returned Logstores.

Error code

Besides the common error codes of Log Service APIs, the ListLogstore API may return the following special error codes.

HTTP status code Error code Error message
404 ProjectNotExist Project {ProjectName} does not exist
500 InternalServerError Specified Server Error Message
400 ParameterInvalid Invalid parameter size, (0.6.0]
400 InvalidLogStoreQuery logstore Query is invalid

Example

Request example

  1. GET /logstores HTTP/1.1
  2. Header:
  3. {
  4. x-log-apiversion=0.6.0,
  5. Authorization=LOG 94to3z418yupi6ikawqqd370:we34Siz/SBVyVGMGmMDnvp0xSPo=,
  6. Host=ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com,
  7. Date=Wed, 11 Nov 2015 08:09:39 GMT,
  8. Content-Length=0,
  9. x-log-signaturemethod=hmac-sha1,
  10. User-Agent=sls-java-sdk-v-0.6.0,
  11. Content-Type=application/json
  12. }

Response example

  1. HTTP/1.1 200 OK
  2. Header:
  3. {
  4. Date=Wed, 11 Nov 2015 08:09:39 GMT,
  5. Content-Length=52,
  6. x-log-requestid=5642F7C399248C8D7B01342F,
  7. Connection=close,
  8. Content-Type=application/json,
  9. Server=nginx/1.6.1
  10. }
  11. Body:
  12. {
  13. "count":1,
  14. "logstores":["test-logstore"],
  15. "total":1
  16. }
Thank you! We've received your feedback.