# at.happyproto.server.listDeployments

> The changes made to one of the caller's own instances, newest first, a page at a time. 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.listDeployments)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.listDeployments/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.listDeployments/analytics)

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

Type: query · GET

### Parameters (query string)

- `cursor` (string): The cursor a previous page returned.
- `id` (string, required): The instance's UUID.
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 100, default: 20

### Output (application/json)

- `cursor` (string): Pass as cursor for the next page. Absent on the last page.
- `deployments` (array, required)
  - `items` (ref)
    - Reference: `#deployment`

### Errors

- `AuthRequired`: This endpoint requires an authenticated caller.
- `Forbidden`: The caller is not a HappyProto customer, or the provisioner refused them.
- `InvalidRequest`: id is not a UUID, limit is outside 1 to 100, or cursor is not one this method returned.
- `NotFound`: No such instance, or it is not the caller's. The two are indistinguishable.
- `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.

## #change (`at.happyproto.server.listDeployments#change`)

Type: object

What the change was for.

### Properties

- `plan` (ref): The plan, for a resize.
  - Reference: `#fromTo`
- `reason` (string): Why an update ran, when it was not a plan or version change.
  - Constraints: knownValues: retry | drift | domains | primary | primary_forced
- `version` (ref): The HappyView release, for an upgrade.
  - Reference: `#fromTo`

## #deployment (`at.happyproto.server.listDeployments#deployment`)

Type: object

One change to an instance: a provisioner operation. Never carries the host, a staff member's identity, or an error message not written for the owner.

### Properties

- `change` (ref, required)
  - Reference: `#change`
- `createdAt` (string · datetime, required)
- `error` (ref)
  - Reference: `#error`
- `finishedAt` (string · datetime)
- `id` (string, required): The change's UUID.
- `isDeployment` (boolean, required): Whether the change started the instance's container. Stopping, deleting, and domain-only updates are not deployments.
- `kind` (string, required)
  - Constraints: knownValues: create | update | upgrade | stop | start | destroy
- `requestedBy` (string, required): Who asked: the instance's owner, HappyProto staff, or HappyProto's own reconciler.
  - Constraints: knownValues: owner | staff | system
- `startedAt` (string · datetime): When a worker last picked it up.
- `status` (string, required)
  - Constraints: knownValues: pending | running | succeeded | failed

## #error (`at.happyproto.server.listDeployments#error`)

Type: object

### Properties

- `code` (string, required): The provisioner's error code.
- `message` (string): Present only for codes whose message is written for the owner.

## #fromTo (`at.happyproto.server.listDeployments#fromTo`)

Type: object

A value before and after the change. Either side is absent when unknown.

### Properties

- `from` (string)
- `to` (string)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "change": {
      "description": "What the change was for.",
      "properties": {
        "plan": {
          "description": "The plan, for a resize.",
          "ref": "#fromTo",
          "type": "ref"
        },
        "reason": {
          "description": "Why an update ran, when it was not a plan or version change.",
          "knownValues": [
            "retry",
            "drift",
            "domains",
            "primary",
            "primary_forced"
          ],
          "type": "string"
        },
        "version": {
          "description": "The HappyView release, for an upgrade.",
          "ref": "#fromTo",
          "type": "ref"
        }
      },
      "type": "object"
    },
    "deployment": {
      "description": "One change to an instance: a provisioner operation. Never carries the host, a staff member's identity, or an error message not written for the owner.",
      "properties": {
        "change": {
          "ref": "#change",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "error": {
          "ref": "#error",
          "type": "ref"
        },
        "finishedAt": {
          "format": "datetime",
          "type": "string"
        },
        "id": {
          "description": "The change's UUID.",
          "type": "string"
        },
        "isDeployment": {
          "description": "Whether the change started the instance's container. Stopping, deleting, and domain-only updates are not deployments.",
          "type": "boolean"
        },
        "kind": {
          "knownValues": [
            "create",
            "update",
            "upgrade",
            "stop",
            "start",
            "destroy"
          ],
          "type": "string"
        },
        "requestedBy": {
          "description": "Who asked: the instance's owner, HappyProto staff, or HappyProto's own reconciler.",
          "knownValues": [
            "owner",
            "staff",
            "system"
          ],
          "type": "string"
        },
        "startedAt": {
          "description": "When a worker last picked it up.",
          "format": "datetime",
          "type": "string"
        },
        "status": {
          "knownValues": [
            "pending",
            "running",
            "succeeded",
            "failed"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "kind",
        "isDeployment",
        "change",
        "requestedBy",
        "status",
        "createdAt"
      ],
      "type": "object"
    },
    "error": {
      "properties": {
        "code": {
          "description": "The provisioner's error code.",
          "type": "string"
        },
        "message": {
          "description": "Present only for codes whose message is written for the owner.",
          "type": "string"
        }
      },
      "required": [
        "code"
      ],
      "type": "object"
    },
    "fromTo": {
      "description": "A value before and after the change. Either side is absent when unknown.",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "The changes made to one of the caller's own instances, newest first, a page at a time. Customers only.",
      "errors": [
        {
          "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": "id is not a UUID, limit is outside 1 to 100, or cursor is not one this method returned.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such instance, or it is not the caller's. The two are indistinguishable.",
          "name": "NotFound"
        },
        {
          "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 as cursor for the next page. Absent on the last page.",
              "type": "string"
            },
            "deployments": {
              "items": {
                "ref": "#deployment",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "deployments"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "The cursor a previous page returned.",
            "type": "string"
          },
          "id": {
            "description": "The instance's UUID.",
            "type": "string"
          },
          "limit": {
            "default": 20,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "id"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.server.listDeployments",
  "lexicon": 1
}
```
