# at.happyproto.server.getLogs

> A page of what one of the caller's own instances wrote, redacted on its host. Customers only.

- Kind: query
- Authority: server.happyproto.at
- Lexicon: 1
- Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getLogs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getLogs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getLogs/analytics)

## Query (`at.happyproto.server.getLogs`)

Type: query · GET

### Parameters (query string)

- `cursor` (string): The cursor a previous page returned, with the same direction.
- `deploymentId` (string): Bound the page to this deployment's window, read from the host it ran on.
- `direction` (string): backward: the newest lines before until or cursor. forward: the oldest after since or cursor.
  - Constraints: default: "backward", knownValues: backward | forward
- `id` (string, required): The instance's UUID.
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 1000, default: 200
- `since` (string · datetime): Narrows the window; never widens a deployment's.
- `until` (string · datetime): Narrows the window; never widens a deployment's.

### Output (application/json)

- `cursor` (string): Pass with the same direction for the next page. Absent when there are no lines.
- `lines` (array, required): Oldest first, whichever way the page was read.
  - `items` (ref)
    - Reference: `#line`
- `more` (boolean, required): Whether more lines lie beyond this page in its direction.
- `oldestAvailable` (string · datetime): The oldest line the host still holds, on a page read without a cursor.
- `window` (ref)
  - Reference: `#window`

### Errors

- `InvalidRequest`: An id is not a UUID, or a time, cursor, direction or limit is malformed or out of range.
- `NotFound`: No such instance or deployment, or either is not the caller's. These are indistinguishable.
- `NotADeployment`: The change started no container (a stop, a deletion or a domain-only update), so it has no logs of its own.
- `LogsUnavailable`: The host the logs are on is not answering, or no longer holds the instance.
- `LogsBusy`: Too many log reads are running for this instance or its host. Try again shortly.
- `LogsTimeout`: Reading the logs took too long. Narrow the time range.
- `AuthRequired`: This endpoint requires an authenticated caller.
- `Forbidden`: The caller is not a HappyProto customer, or the provisioner refused them.
- `InvalidSlug`: Passed through from the provisioner.
- `SlugTaken`: Passed through from the provisioner.
- `NotEntitled`: Passed through from the provisioner.
- `InstanceLimit`: Passed through from the provisioner.
- `NoCapacity`: Passed through from the provisioner.
- `OperationInProgress`: Passed through from the provisioner.
- `Upstream`: The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.

## #line (`at.happyproto.server.getLogs#line`)

Type: object

### Properties

- `at` (string · datetime, required)
- `level` (string): When the line says.
  - Constraints: knownValues: trace | debug | info | warn | error
- `message` (string, required): With the instance's secrets and anything shaped like a credential replaced by [redacted].
- `stream` (string, required)
  - Constraints: knownValues: stdout | stderr

## #window (`at.happyproto.server.getLogs#window`)

Type: object

The deployment's window, when deploymentId was given.

### Properties

- `since` (string · datetime, required)
- `until` (string · datetime): Absent while the deployment is the newest.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "line": {
      "properties": {
        "at": {
          "format": "datetime",
          "type": "string"
        },
        "level": {
          "description": "When the line says.",
          "knownValues": [
            "trace",
            "debug",
            "info",
            "warn",
            "error"
          ],
          "type": "string"
        },
        "message": {
          "description": "With the instance's secrets and anything shaped like a credential replaced by [redacted].",
          "type": "string"
        },
        "stream": {
          "knownValues": [
            "stdout",
            "stderr"
          ],
          "type": "string"
        }
      },
      "required": [
        "at",
        "stream",
        "message"
      ],
      "type": "object"
    },
    "main": {
      "description": "A page of what one of the caller's own instances wrote, redacted on its host. Customers only.",
      "errors": [
        {
          "description": "An id is not a UUID, or a time, cursor, direction or limit is malformed or out of range.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such instance or deployment, or either is not the caller's. These are indistinguishable.",
          "name": "NotFound"
        },
        {
          "description": "The change started no container (a stop, a deletion or a domain-only update), so it has no logs of its own.",
          "name": "NotADeployment"
        },
        {
          "description": "The host the logs are on is not answering, or no longer holds the instance.",
          "name": "LogsUnavailable"
        },
        {
          "description": "Too many log reads are running for this instance or its host. Try again shortly.",
          "name": "LogsBusy"
        },
        {
          "description": "Reading the logs took too long. Narrow the time range.",
          "name": "LogsTimeout"
        },
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto customer, or the provisioner refused them.",
          "name": "Forbidden"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InvalidSlug"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "SlugTaken"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NotEntitled"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InstanceLimit"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NoCapacity"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "OperationInProgress"
        },
        {
          "description": "The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "description": "Pass with the same direction for the next page. Absent when there are no lines.",
              "type": "string"
            },
            "lines": {
              "description": "Oldest first, whichever way the page was read.",
              "items": {
                "ref": "#line",
                "type": "ref"
              },
              "type": "array"
            },
            "more": {
              "description": "Whether more lines lie beyond this page in its direction.",
              "type": "boolean"
            },
            "oldestAvailable": {
              "description": "The oldest line the host still holds, on a page read without a cursor.",
              "format": "datetime",
              "type": "string"
            },
            "window": {
              "ref": "#window",
              "type": "ref"
            }
          },
          "required": [
            "lines",
            "more"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "The cursor a previous page returned, with the same direction.",
            "type": "string"
          },
          "deploymentId": {
            "description": "Bound the page to this deployment's window, read from the host it ran on.",
            "type": "string"
          },
          "direction": {
            "default": "backward",
            "description": "backward: the newest lines before until or cursor. forward: the oldest after since or cursor.",
            "knownValues": [
              "backward",
              "forward"
            ],
            "type": "string"
          },
          "id": {
            "description": "The instance's UUID.",
            "type": "string"
          },
          "limit": {
            "default": 200,
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "since": {
            "description": "Narrows the window; never widens a deployment's.",
            "format": "datetime",
            "type": "string"
          },
          "until": {
            "description": "Narrows the window; never widens a deployment's.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "window": {
      "description": "The deployment's window, when deploymentId was given.",
      "properties": {
        "since": {
          "format": "datetime",
          "type": "string"
        },
        "until": {
          "description": "Absent while the deployment is the newest.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "since"
      ],
      "type": "object"
    }
  },
  "id": "at.happyproto.server.getLogs",
  "lexicon": 1
}
```
