List a Space's request logs - Spacefast Docs

List a Space's request logs

Returns HTTP access log entries for one Space, read live from the box serving it, restricted to the Space’s own hostnames and with share secrets stripped out of path. The window ends at the request and starts 24 hours before it unless since and until say otherwise, and it is raised to the plan’s access log retention when it reaches back further; a raised window is reported in warnings. The answer is a single page, so pagination.nextCursor is always null. A Space whose runtime is not provisioned yet has nothing to read and fails.

API Endpoint

GET /v1/spaces/{spaceId}/logs

Authorization

Path parameters

Query parameters

Responses

200 Response for status 200

# cURL Example
curl -X GET "https://api.spacefast.com/v1/spaces/string/logs?limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
// JavaScript Example
const response = await fetch("https://api.spacefast.com/v1/spaces/string/logs?limit=20", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});
# Python Example
import requests

response = requests.get(
    "https://api.spacefast.com/v1/spaces/string/logs?limit=20",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)

200 Default Response Example

{
  "$schema": "http://example.com",
  "data": [
    {
      "ts": "2019-08-24T14:15:22Z",
      "timestamp": "2019-08-24T14:15:22Z",
      "host": "string",
      "hostname": "string",
      "method": "string",
      "path": "string",
      "status": -9007199254740991,
      "bytes": 9007199254740991
    }
  ],
  "pagination": {
    "nextCursor": "string",
    "hasMore": true
  },
  "warnings": [
    {
      "code": "string",
      "severity": "info",
      "message": "string",
      "path": "string",
      "provider": "infra",
      "details": {
        "property1": null,
        "property2": null
      },
      "fix": "string",
      "retryable": true
    }
  ]
}

Error Response Example

{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}