ListLogstore

Last Updated: Apr 19, 2017

On the ListLogstores interface, lists names of all LogStores under 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 or Not Description
offset(optional) integer No The starting position of a returned record, 1 by default.
size(optional) integer No The maximum number of entries returned per page, 500 by default (maximum).
logstoreName string No The LogStore name used to filter (partial matching supported).

Request header

No special request header is available. For details about public request headers of Log Service APIs, refer to Public Request Headers.

Response header

No special response header is available. For details about public response headers of Log Service APIs, refer to Public Response Headers.

Response element

When the ListLogStores request is successful, the response body will contain a list of names of all LogStores under a specified project. The format is as follows:

Name Type Description
count Integer The number of returned LogStores.
total Integer The total number of LogStores.
logstores String array The list of names of returned LogStores.

Error code

The CreateLogstore interface may return the following specific error codes in addition to Log Service API Common Error Codes:

HTTP status code ErrorCode ErrorMessage
404 ProjectNotExist Project {ProjectName} 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.