# List the crons

> The crons in a VM (cron and the schedulers of its agents) and its next wake.

`GET /v1/tenants/{tenant}/vms/{name}/crons`

```bash curl
curl -X GET "https://api.shako.dev/v1/tenants/acme/vms/web1/crons" \
  -H "Authorization: Bearer $SHAKO_API_KEY"
```

```python Python
import os

import requests

response = requests.get(
    "https://api.shako.dev/v1/tenants/acme/vms/web1/crons",
    headers={"Authorization": f"Bearer {os.environ['SHAKO_API_KEY']}"},
)
response.raise_for_status()
print(response.json())
```

```javascript JavaScript
const response = await fetch("https://api.shako.dev/v1/tenants/acme/vms/web1/crons", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.SHAKO_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```json 200 (excerpt)
{
  "state": "awake",
  "live": true,
  "as_of": 1793494800,
  "next_wake": null,
  "crons": [
    {
      "source": "cron",
      "schedule": "0 9 * * *",
      "next_at": 1793523600,
      "hold_until": null
    }
  ],
  "truncated": false
}
```

Authenticate with `Authorization: Bearer <API key>` on `https://api.shako.dev`. Role: contributor or owner.

## Path parameters

**tenant** `string` *required*

The tenant's name, from GET /v1/tenants.

**name** `string` *required*

The VM's name.

## Response

200 with [the crons object](https://shako.dev/api/objects/vm-crons.md).

## Behavior

Shako asks an awake VM now. A sleeping VM does not wake: the list is the one of its last sleep.

The errors: https://shako.dev/api/errors.md. All the endpoints of VMs: https://shako.dev/api/vms.md.
