Lists all projects.

Request syntax

GET /? offset={offset}&size={size} HTTP/1.1
Authorization: <AuthorizationString>
x-log-bodyrawsize: 0
User-Agent: <UserAgent>
x-log-apiversion: 0.6.0
Host: <Endpoint>
x-log-signaturemethod: hmac-sha1
Date: <GMT Date>
Content-Type: application/x-protobuf
Connection: Keep-Alive

Request parameters

  • Request headers

    The ListProject 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 the entries to return. Default value: 0.
    size integer No 2 The maximum number of the entries to return on each page. Default value: 500.

Response parameters

  • Response headers

    The ListProject 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

    If the ListProject request succeeds, the HTTP status code 200 is returned. The response body contains the information of the project list. The following table describes the parameters of the response body.

    Parameter Type Description
    count integer The number of the returned projects.
    total integer The total number of projects.
    projects array The list of all projects.

    The following table describes the parameters of the projects element.

    Parameter Type Description
    createTime string The time when the project was created.
    description string The description of the project.
    lastModifyTime string The time when the project was last modified.
    owner string The ID of the account that was used to create the project.
    projectName string The name of the project.
    status string The status of the project.
    region string The region to which the project belongs.

Examples

  • Sample requests
    GET /? offset=0&size=2&projectName= HTTP/1.1
    Authorization: LOG1 <yourAccessKeyId>:<yourSignature>
    x-log-bodyrawsize: 0
    User-Agent: sls-java-sdk-v-0.6.1
    x-log-apiversion: 0.6.0
    Host: cn-shanghai.log.aliyuncs.com
    x-log-signaturemethod: hmac-sha1
    Date: Sun, 27 May 2018 09:03:33 GMT
    Content-Type: application/x-protobuf
    Connection: Keep-Alive
  • Sample success responses
    HTTP/1.1 200
    Server: nginx
    Content-Type: application/json
    Content-Length: 345
    Connection: close
    Access-Control-Allow-Origin: *
    Date: Sun, 27 May 2018 09:03:33 GMT
    x-log-requestid: 5B0A7465AAEA20CA70DE3064
    {
      "count": 2,
      "total": 11,
      "projects": [
        {
          "projectName": "project1",
          "status": "Normal",
          "owner": "",
          "description": "",
          "region": "cn-shanghai",
          "createTime": "1524222931",
          "lastModifyTime": "1524539357"
        },
        {
          "projectName": "project123456",
          "status": "Normal",
          "owner": "",
          "description": "",
          "region": "cn-shanghai",
          "createTime": "1471963876",
          "lastModifyTime": "1524539357"
        }
      ]
    }

Error codes

HTTP status code Error code Error message Description
500 InternalServerError Specified Server Error Message. The error message returned because an internal server error has occurred.

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