@krovacloud/sdk 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +6 -4
- package/dist/{client-B5wNdRL0.d.cts → client-DVViSyTA.d.cts} +172 -27
- package/dist/{client-B5wNdRL0.d.ts → client-DVViSyTA.d.ts} +172 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ssh.d.cts +1 -1
- package/dist/ssh.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,10 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
|
|
|
9
9
|
|
|
10
10
|
The sections below are grouped by the release that first shipped each change, taken from the `@krovacloud/sdk@<version>` git tags. Versions up to 0.5.5 are published to npm.
|
|
11
11
|
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `Webhook.description` and the `description` field of the `webhooks.create()` body now come from the generated OpenAPI types, because krova-cloud declares them in its spec. The `Webhook` and `CreateWebhookInput` types keep the same shape, with `description` optional.
|
|
15
|
+
|
|
12
16
|
### Documentation
|
|
13
17
|
|
|
14
18
|
- README: Node.js 22 or later; `code` and `requestId` on `KrovaError` come from response headers the Krova API does not send today, so they are normally `undefined` (only `TerminationProtectedError` carries a code); `DnsRecord`, `DnsRecordStatus` and the webhook types are reached through `components["schemas"]`, not exported by name; the full `Cube` shape, `imports.cancel`, TCP mapping `label` and `udpEnabled`, the other custom-domain settings, the 600 requests per minute per key limit and the per-plan hourly cap on Cube creates (a `429` with `Retry-After`); `cubes.update` is the SSH port only and RAM is in whole GB. Comment-only changes in the source.
|
package/README.md
CHANGED
|
@@ -406,11 +406,13 @@ try {
|
|
|
406
406
|
|
|
407
407
|
### Rate limits
|
|
408
408
|
|
|
409
|
-
-
|
|
410
|
-
-
|
|
411
|
-
-
|
|
409
|
+
- Every authenticated request, reads included: 600 requests per minute per API key.
|
|
410
|
+
- Start and stop: per space, per minute, 10 on Free and Lite, 30 on Hobby, 150 on Scale and 500 on Fleet (higher if your Running Cubes limit is raised for you).
|
|
411
|
+
- Other changes, such as snapshots, resizing, domains, backups and webhooks, have their own count at the same per-space figure as start and stop.
|
|
412
|
+
- Creating a Cube (`cubes.create` and `imports.create`) follows the plan's create limits, per minute and per month. Deleted Cubes count toward them, so deleting a Cube does not free a slot.
|
|
413
|
+
- Over a limit the API answers `429` with a `Retry-After` header.
|
|
412
414
|
|
|
413
|
-
The client automatically retries `429` and `503` up to `maxRetries` times, honoring `Retry-After`, but never waits more than 10 seconds between attempts. A `Retry-After`
|
|
415
|
+
The client automatically retries `429` and `503` up to `maxRetries` times, honoring `Retry-After`, but never waits more than 10 seconds between attempts. A `Retry-After` longer than that, such as one from a create limit that is still in force, therefore ends in a thrown `KrovaError` with `status` 429, and the header is on `err.response?.headers.get("retry-after")`.
|
|
414
416
|
|
|
415
417
|
## Run commands and move files
|
|
416
418
|
|
|
@@ -208,6 +208,8 @@ interface paths {
|
|
|
208
208
|
"application/json": {
|
|
209
209
|
currency: string;
|
|
210
210
|
note: string;
|
|
211
|
+
/** @description The Cube plans. A plan sets limits and a usage credit, and doesn't include any servers. Free has no plan fee and a one-time $5 welcome credit. Lite, Hobby, Scale and Fleet add a usage credit each month. Maximum disk is 100 GB per Cube on every plan; ask support to raise it for a space. The Free plan has no snapshots and doesn't keep backups of deleted Cubes. Cubes are billed by the second, with a 60-second minimum each time a Cube starts. Empty until the plans are available. The `tiers` above are unchanged. */
|
|
212
|
+
plans: components["schemas"]["PricingPlan"][];
|
|
211
213
|
rates: {
|
|
212
214
|
diskGbPerHour: number;
|
|
213
215
|
ramGbPerHour: number;
|
|
@@ -274,7 +276,7 @@ interface paths {
|
|
|
274
276
|
};
|
|
275
277
|
/**
|
|
276
278
|
* Resolve the space this API key is scoped to
|
|
277
|
-
* @description Returns the single space the API key belongs to. Lets a client auto-resolve the space id from the key alone (no spaceId in the URL). `apiKey` carries the name and expiry of the key that made the request.
|
|
279
|
+
* @description Returns the single space the API key belongs to. Lets a client auto-resolve the space id from the key alone (no spaceId in the URL). `apiKey` carries the name and expiry of the key that made the request. `tier` is the plan slug; `plan` is the Cube plan (null when the space is not on one) with its term, period end and included usage left.
|
|
278
280
|
*/
|
|
279
281
|
get: {
|
|
280
282
|
parameters: {
|
|
@@ -359,7 +361,7 @@ interface paths {
|
|
|
359
361
|
put?: never;
|
|
360
362
|
/**
|
|
361
363
|
* Accept a backup share offered to this space
|
|
362
|
-
* @description Requires an API key of this space's owner, or of a member with `backup.manage`. Creates this space's own copy of the backup, billed for storage from now. Refused with 422 when the space cannot take it (no card, unverified owner, open abuse notice
|
|
364
|
+
* @description Requires an API key of this space's owner, or of a member with `backup.manage`. Creates this space's own copy of the backup, billed for storage from now. Refused with 422 when the space cannot take it (no card, unverified owner, open abuse notice or no credit).
|
|
363
365
|
*/
|
|
364
366
|
post: {
|
|
365
367
|
parameters: {
|
|
@@ -725,7 +727,10 @@ interface paths {
|
|
|
725
727
|
/** List Cubes in a Space */
|
|
726
728
|
get: {
|
|
727
729
|
parameters: {
|
|
728
|
-
query?:
|
|
730
|
+
query?: {
|
|
731
|
+
/** @description Filter by a label with label=key=value. Repeat the parameter to add terms, up to 10. A Cube is returned only if it matches every term exactly. */
|
|
732
|
+
label?: string[];
|
|
733
|
+
};
|
|
729
734
|
header?: never;
|
|
730
735
|
path: {
|
|
731
736
|
spaceId: string;
|
|
@@ -746,8 +751,20 @@ interface paths {
|
|
|
746
751
|
};
|
|
747
752
|
};
|
|
748
753
|
};
|
|
754
|
+
400: components["responses"]["BadRequest"];
|
|
749
755
|
401: components["responses"]["Unauthorized"];
|
|
750
756
|
403: components["responses"]["Forbidden"];
|
|
757
|
+
/** @description A label filter was sent while Krova is still applying an update that adds labels. Try again in a minute; the list is never returned unfiltered. */
|
|
758
|
+
503: {
|
|
759
|
+
headers: {
|
|
760
|
+
/** @description Seconds to wait before retrying. */
|
|
761
|
+
"Retry-After"?: number;
|
|
762
|
+
[name: string]: unknown;
|
|
763
|
+
};
|
|
764
|
+
content: {
|
|
765
|
+
"application/json": components["schemas"]["Error"];
|
|
766
|
+
};
|
|
767
|
+
};
|
|
751
768
|
};
|
|
752
769
|
};
|
|
753
770
|
put?: never;
|
|
@@ -767,9 +784,33 @@ interface paths {
|
|
|
767
784
|
requestBody: {
|
|
768
785
|
content: {
|
|
769
786
|
"application/json": {
|
|
770
|
-
/**
|
|
787
|
+
/**
|
|
788
|
+
* @description Take automatic snapshots of the Cube on your plan's schedule. Defaults to true.
|
|
789
|
+
* @default true
|
|
790
|
+
*/
|
|
791
|
+
autoSnapshots?: boolean;
|
|
792
|
+
/**
|
|
793
|
+
* @description Keep a backup of the Cube when Krova deletes it for you (deleteAfter, deleteWhenStopped or idle delete). Defaults to true. Backups are billed by stored size.
|
|
794
|
+
* @default true
|
|
795
|
+
*/
|
|
796
|
+
backupOnDelete?: boolean;
|
|
797
|
+
/** @description Delete the Cube this many whole minutes from now, from 5 to 43200 (30 days). On a PATCH, the new deadline is that many minutes from the moment of the request; it is not added to the old one. null removes the deadline. The response returns the deadline as deleteAt. */
|
|
798
|
+
deleteAfter?: number | null;
|
|
799
|
+
/** @description Delete the Cube when it stops, instead of keeping it stopped. Not allowed on a Cube with termination protection. */
|
|
800
|
+
deleteWhenStopped?: boolean;
|
|
801
|
+
/**
|
|
802
|
+
* @description What happens when the Cube has been idle for idleTimeoutMinutes: "stop" (the default) powers it off, "delete" deletes it. "delete" needs idleTimeoutMinutes to be set on the Cube, and is not allowed on a Cube with termination protection.
|
|
803
|
+
* @default stop
|
|
804
|
+
* @enum {string}
|
|
805
|
+
*/
|
|
806
|
+
idleAction?: "stop" | "delete";
|
|
807
|
+
/** @description Minutes without activity after which Krova powers the Cube off, or deletes it when idleAction is "delete". Null (the default) turns it off, which isn't allowed while idleAction is "delete". A Cube counts as idle when no web terminal or SSH session is open and its CPU stays under 5% busy with a 5-minute load average under 0.1. Termination protection does not stop the power-off, but a Cube with termination protection can't use idleAction "delete". Optional; an integer from 10 to 10080 (7 days) or null, anything else is rejected with 400. */
|
|
771
808
|
idleTimeoutMinutes?: number | null;
|
|
772
809
|
image: string;
|
|
810
|
+
/** @description Key/value labels, up to 32 per Cube. Keys use lowercase letters, digits, dots, underscores and hyphens, 1 to 63 characters, start and end with a letter or digit, and can't start with "krova.". Values use letters, digits, dots, underscores and hyphens, up to 63 characters, and can be empty. Sending labels replaces all existing labels, and {} clears them. */
|
|
811
|
+
labels?: {
|
|
812
|
+
[key: string]: string;
|
|
813
|
+
};
|
|
773
814
|
name: string;
|
|
774
815
|
/** @description Region slug from /v1/regions (optional). */
|
|
775
816
|
region?: string;
|
|
@@ -778,6 +819,8 @@ interface paths {
|
|
|
778
819
|
ramGb: number;
|
|
779
820
|
vcpu: number;
|
|
780
821
|
};
|
|
822
|
+
/** @description Shortcut for a disposable Cube. It deletes itself after 24 hours, and automatic snapshots and the backup kept on delete are off. Anything else you send in the same request wins over the shortcut, but a sandbox must still delete itself: keep the 24-hour deadline, or send deleteWhenStopped true or idleAction "delete" in place of it. On a PATCH, false makes the Cube permanent: the auto-delete is removed and automatic snapshots and the backup kept on delete are turned back on. false can't be sent with deleteAfter, deleteWhenStopped true or idleAction "delete". A response shows true when the Cube will delete itself in any of those ways. */
|
|
823
|
+
sandbox?: boolean;
|
|
781
824
|
/** @description SSH public key written to the Cube login user's authorized_keys at boot (~/.ssh/authorized_keys for the ubuntu or debian user; /root/.ssh/authorized_keys on Cubes created before the default-user change). GET /cubes/{cubeId}/ssh reports the login user for a given Cube. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
|
|
782
825
|
sshPublicKey: string;
|
|
783
826
|
/**
|
|
@@ -805,7 +848,7 @@ interface paths {
|
|
|
805
848
|
400: components["responses"]["BadRequest"];
|
|
806
849
|
401: components["responses"]["Unauthorized"];
|
|
807
850
|
403: components["responses"]["Forbidden"];
|
|
808
|
-
/** @description
|
|
851
|
+
/** @description The create rate limit was reached. It is set per minute and per month by the space's plan, and deleted Cubes count. `Retry-After` gives the seconds until you can create again. */
|
|
809
852
|
429: {
|
|
810
853
|
headers: {
|
|
811
854
|
/** @description Seconds to wait before retrying. */
|
|
@@ -904,7 +947,7 @@ interface paths {
|
|
|
904
947
|
};
|
|
905
948
|
content?: never;
|
|
906
949
|
};
|
|
907
|
-
/** @description
|
|
950
|
+
/** @description The create rate limit was reached. It is set per minute and per month by the space's plan, and deleted Cubes count. `Retry-After` gives the seconds until you can create again. */
|
|
908
951
|
429: {
|
|
909
952
|
headers: {
|
|
910
953
|
/** @description Seconds to wait before retrying. */
|
|
@@ -1086,7 +1129,7 @@ interface paths {
|
|
|
1086
1129
|
};
|
|
1087
1130
|
content?: never;
|
|
1088
1131
|
};
|
|
1089
|
-
/** @description
|
|
1132
|
+
/** @description The create rate limit was reached. It is set per minute and per month by the space's plan, and deleted Cubes count. `Retry-After` gives the seconds until you can create again. */
|
|
1090
1133
|
429: {
|
|
1091
1134
|
headers: {
|
|
1092
1135
|
/** @description Seconds to wait before retrying. */
|
|
@@ -1205,8 +1248,8 @@ interface paths {
|
|
|
1205
1248
|
options?: never;
|
|
1206
1249
|
head?: never;
|
|
1207
1250
|
/**
|
|
1208
|
-
* Update a Cube (rename, termination protection, idle auto-stop)
|
|
1209
|
-
* @description
|
|
1251
|
+
* Update a Cube (rename, termination protection, idle auto-stop, sandbox options)
|
|
1252
|
+
* @description Sending a value a field already has returns the Cube unchanged and writes no audit row, with two exceptions that move the deadline every time they are sent: `deleteAfter` sets it to that many minutes from now, and `sandbox: true` sets it to 24 hours from now unless you send `deleteAfter` with it. `sandbox: true` also turns automatic snapshots and the backup kept on delete off again unless you send them too, so repeating either option keeps a Cube alive. The PATCHable fields are `name`, `terminationProtection`, `idleTimeoutMinutes` and the sandbox options `sandbox`, `deleteAfter`, `deleteWhenStopped`, `idleAction`, `autoSnapshots`, `backupOnDelete` and `labels`; send any combination. Sending none of them is a 400 rather than a no-op, so a typo in a field name cannot look like success. Renaming, changing the idle auto-stop timeout and changing any sandbox option need the `cube.manage` permission, and changing termination protection needs `cube.termination_protection`; a request with several fields needs every matching permission. A Cube with termination protection can't have an auto-delete: turning protection on while the Cube has a deadline, `deleteWhenStopped` true or `idleAction` "delete" is a 400, and so is setting any of those on a protected Cube. The check is made on the Cube as it would be after your request, so change protection and the auto-delete settings in the same request. A Cube that is already being deleted answers 409 to a sandbox option. Every supplied field is validated before any is applied. Names are not unique within a space. Renaming is metadata only: the hostname inside a running Cube changes on its next cold restart. To change vCPU, RAM or disk use `POST .../resize`.
|
|
1210
1253
|
*/
|
|
1211
1254
|
patch: {
|
|
1212
1255
|
parameters: {
|
|
@@ -1221,10 +1264,29 @@ interface paths {
|
|
|
1221
1264
|
requestBody: {
|
|
1222
1265
|
content: {
|
|
1223
1266
|
"application/json": {
|
|
1224
|
-
/** @description
|
|
1267
|
+
/** @description Take automatic snapshots of the Cube on your plan's schedule. Defaults to true. */
|
|
1268
|
+
autoSnapshots?: boolean;
|
|
1269
|
+
/** @description Keep a backup of the Cube when Krova deletes it for you (deleteAfter, deleteWhenStopped or idle delete). Defaults to true. Backups are billed by stored size. */
|
|
1270
|
+
backupOnDelete?: boolean;
|
|
1271
|
+
/** @description Delete the Cube this many whole minutes from now, from 5 to 43200 (30 days). On a PATCH, the new deadline is that many minutes from the moment of the request; it is not added to the old one. null removes the deadline. The response returns the deadline as deleteAt. */
|
|
1272
|
+
deleteAfter?: number | null;
|
|
1273
|
+
/** @description Delete the Cube when it stops, instead of keeping it stopped. Not allowed on a Cube with termination protection. */
|
|
1274
|
+
deleteWhenStopped?: boolean;
|
|
1275
|
+
/**
|
|
1276
|
+
* @description What happens when the Cube has been idle for idleTimeoutMinutes: "stop" (the default) powers it off, "delete" deletes it. "delete" needs idleTimeoutMinutes to be set on the Cube, and is not allowed on a Cube with termination protection.
|
|
1277
|
+
* @enum {string}
|
|
1278
|
+
*/
|
|
1279
|
+
idleAction?: "stop" | "delete";
|
|
1280
|
+
/** @description Minutes without activity after which Krova powers the Cube off, or deletes it when idleAction is "delete". Null (the default) turns it off, which isn't allowed while idleAction is "delete". A Cube counts as idle when no web terminal or SSH session is open and its CPU stays under 5% busy with a 5-minute load average under 0.1. Termination protection does not stop the power-off, but a Cube with termination protection can't use idleAction "delete". Send null to turn it off; anything other than an integer from 10 to 10080 (7 days) or null is rejected with 400. */
|
|
1225
1281
|
idleTimeoutMinutes?: number | null;
|
|
1282
|
+
/** @description Key/value labels, up to 32 per Cube. Keys use lowercase letters, digits, dots, underscores and hyphens, 1 to 63 characters, start and end with a letter or digit, and can't start with "krova.". Values use letters, digits, dots, underscores and hyphens, up to 63 characters, and can be empty. Sending labels replaces all existing labels, and {} clears them. */
|
|
1283
|
+
labels?: {
|
|
1284
|
+
[key: string]: string;
|
|
1285
|
+
};
|
|
1226
1286
|
/** @description New display name. 1–64 printable characters after trimming, the same rule as Cube creation. */
|
|
1227
1287
|
name?: string;
|
|
1288
|
+
/** @description Shortcut for a disposable Cube. It deletes itself after 24 hours, and automatic snapshots and the backup kept on delete are off. Anything else you send in the same request wins over the shortcut, but a sandbox must still delete itself: keep the 24-hour deadline, or send deleteWhenStopped true or idleAction "delete" in place of it. On a PATCH, false makes the Cube permanent: the auto-delete is removed and automatic snapshots and the backup kept on delete are turned back on. false can't be sent with deleteAfter, deleteWhenStopped true or idleAction "delete". A response shows true when the Cube will delete itself in any of those ways. */
|
|
1289
|
+
sandbox?: boolean;
|
|
1228
1290
|
/** @description Turn protection on or off. Turning it on stamps `terminationProtectionChangedAt` and `terminationProtectionChangedBy`; turning it off clears both. */
|
|
1229
1291
|
terminationProtection?: boolean;
|
|
1230
1292
|
};
|
|
@@ -1244,6 +1306,15 @@ interface paths {
|
|
|
1244
1306
|
};
|
|
1245
1307
|
400: components["responses"]["BadRequest"];
|
|
1246
1308
|
404: components["responses"]["NotFound"];
|
|
1309
|
+
/** @description A sandbox option was sent for a Cube that is already being deleted. */
|
|
1310
|
+
409: {
|
|
1311
|
+
headers: {
|
|
1312
|
+
[name: string]: unknown;
|
|
1313
|
+
};
|
|
1314
|
+
content: {
|
|
1315
|
+
"application/json": components["schemas"]["Error"];
|
|
1316
|
+
};
|
|
1317
|
+
};
|
|
1247
1318
|
429: components["responses"]["RateLimited"];
|
|
1248
1319
|
};
|
|
1249
1320
|
};
|
|
@@ -2300,7 +2371,9 @@ interface paths {
|
|
|
2300
2371
|
requestBody: {
|
|
2301
2372
|
content: {
|
|
2302
2373
|
"application/json": {
|
|
2303
|
-
|
|
2374
|
+
/** @description Optional label. Trimmed; an empty or non-string value is stored as null. */
|
|
2375
|
+
description?: string;
|
|
2376
|
+
events: ("cube.created" | "cube.running" | "cube.stopped" | "cube.error" | "cube.deleted" | "cube.expiring" | "cube.cold_restarted" | "cube.transfer.started" | "cube.transfer.completed" | "cube.transfer.failed" | "cube.resize.started" | "cube.resize.completed" | "cube.resize.failed" | "resource.alert.memory" | "resource.alert.cpu" | "resource.alert.disk" | "domain.alert.error_4xx" | "domain.alert.error_5xx" | "cube.space_transferred" | "cube.space_transfer.requested" | "cube.space_transfer.accepted" | "cube.space_transfer.declined" | "cube.space_transfer.cancelled" | "cube.space_transfer.expired" | "snapshot.created" | "snapshot.restored" | "snapshot.deleted" | "snapshot.pinned" | "snapshot.promoted_to_backup" | "snapshot.exported" | "backup.created" | "backup.deleted" | "backup.redeployed" | "backup.share.requested" | "backup.share.accepted" | "backup.share.declined" | "backup.share.canceled" | "backup.share.expired" | "domain.added" | "domain.active" | "domain.removed" | "tcp_mapping.added" | "tcp_mapping.removed" | "tcp_mapping.updated" | "hosting.provisioned" | "hosting.suspended" | "hosting.unsuspended" | "hosting.deleted" | "hosting.plan_changed" | "hosting.renewed" | "hosting.cancellation_scheduled" | "hosting.suspended_for_non_payment" | "hosting.deleted_after_recovery" | "member.invited" | "member.joined" | "member.removed" | "member.role_changed")[];
|
|
2304
2377
|
/** Format: uri */
|
|
2305
2378
|
url: string;
|
|
2306
2379
|
};
|
|
@@ -2478,13 +2551,35 @@ interface components {
|
|
|
2478
2551
|
status: "pending" | "accepted" | "declined" | "canceled" | "expired";
|
|
2479
2552
|
};
|
|
2480
2553
|
Cube: {
|
|
2554
|
+
/** @description True when Krova takes automatic snapshots of the Cube on your plan's schedule. */
|
|
2555
|
+
autoSnapshots: boolean;
|
|
2556
|
+
/** @description True when Krova keeps a backup of the Cube when it deletes it for you (deleteAfter, deleteWhenStopped or idle delete). Backups are billed by stored size. */
|
|
2557
|
+
backupOnDelete: boolean;
|
|
2481
2558
|
costPerHour: number;
|
|
2482
2559
|
/** Format: date-time */
|
|
2483
2560
|
createdAt: string;
|
|
2561
|
+
/** @description The number of minutes the deadline was set to, counted from the moment it was set (1440 when sandbox: true set it). It doesn't count down: read deleteAt for the deadline. Null when the Cube has no deadline. */
|
|
2562
|
+
deleteAfter: number | null;
|
|
2563
|
+
/**
|
|
2564
|
+
* Format: date-time
|
|
2565
|
+
* @description ISO8601 timestamp (UTC) of when Krova deletes the Cube. Null when the Cube has no deadline. A Cube that is resizing, moving or taking a snapshot at that moment is deleted once it finishes. A PATCH that sets a new deadline moves it.
|
|
2566
|
+
*/
|
|
2567
|
+
deleteAt: string | null;
|
|
2568
|
+
/** @description True when Krova deletes the Cube when it stops, instead of keeping it stopped. */
|
|
2569
|
+
deleteWhenStopped: boolean;
|
|
2484
2570
|
id: string;
|
|
2485
|
-
/**
|
|
2571
|
+
/**
|
|
2572
|
+
* @description What Krova does when the Cube has been idle for idleTimeoutMinutes: "stop" powers it off and "delete" deletes it.
|
|
2573
|
+
* @enum {string}
|
|
2574
|
+
*/
|
|
2575
|
+
idleAction: "stop" | "delete";
|
|
2576
|
+
/** @description Minutes without activity after which Krova powers the Cube off, or deletes it when idleAction is "delete". Null (the default) turns it off, which isn't allowed while idleAction is "delete". A Cube counts as idle when no web terminal or SSH session is open and its CPU stays under 5% busy with a 5-minute load average under 0.1. Termination protection does not stop the power-off, but a Cube with termination protection can't use idleAction "delete". */
|
|
2486
2577
|
idleTimeoutMinutes: number | null;
|
|
2487
2578
|
image: string;
|
|
2579
|
+
/** @description The Cube's labels as key/value pairs. An empty object when it has none. */
|
|
2580
|
+
labels: {
|
|
2581
|
+
[key: string]: string;
|
|
2582
|
+
};
|
|
2488
2583
|
/**
|
|
2489
2584
|
* Format: date-time
|
|
2490
2585
|
* @description ISO8601 timestamp of the last time Krova saw the Cube active (a web terminal or SSH session open, or CPU at or above 5% busy, or a 5-minute load average at or above 0.1). Null until the idle check has recorded one.
|
|
@@ -2497,6 +2592,8 @@ interface components {
|
|
|
2497
2592
|
ramGb: number;
|
|
2498
2593
|
vcpu: number;
|
|
2499
2594
|
};
|
|
2595
|
+
/** @description True when the Cube will delete itself: it has a deadline (deleteAt), deleteWhenStopped is true, or idleAction is "delete". It is worked out from those fields, so it always matches them. It doesn't say whether automatic snapshots or the delete backup are on: read autoSnapshots and backupOnDelete. To change it, send sandbox or those fields on a create or PATCH. */
|
|
2596
|
+
sandbox: boolean;
|
|
2500
2597
|
/** @description The hostname of the server currently hosting this Cube (e.g. `mango.krova.cloud`), shared by every Cube on that server. This is NOT the Cube's own SSH target — use `host` from GET .../ssh for that, which is the Cube's own stable hostname and survives migration to another server. Null when the Cube has no server assigned. Only present on the single-Cube GET; list and create responses omit it. */
|
|
2501
2598
|
serverDomain?: string | null;
|
|
2502
2599
|
/** @description The account to SSH in as: `ubuntu` or `debian` on Cubes created from images that ship a default user, `root` on Cubes created before that change or imported from a rootfs without one. The same value on create, GET and GET .../ssh (`user`). Recorded while the Cube provisions; the create response reports the image's default user, which is what the recorded value will be. */
|
|
@@ -2612,6 +2709,23 @@ interface components {
|
|
|
2612
2709
|
total: number;
|
|
2613
2710
|
totalPages: number;
|
|
2614
2711
|
};
|
|
2712
|
+
PricingPlan: {
|
|
2713
|
+
/** @description The monthly usage credit in USD. 0 on Free, which has a one-time welcome credit instead. It does not roll over. */
|
|
2714
|
+
includedUsageUsdPerMonth: number;
|
|
2715
|
+
/** @description What the plan allows a space. `maxVcpus`, `maxRamMb` and `maxDiskGb` are the max size per Cube. A null limit has no cap. */
|
|
2716
|
+
limits: {
|
|
2717
|
+
autoSnapshotCadenceHours: number | null;
|
|
2718
|
+
maxConcurrentCubes: number | null;
|
|
2719
|
+
/** @description Maximum disk per Cube, in GB. 100 on every plan. Support can raise it for a space. */
|
|
2720
|
+
maxDiskGb: number;
|
|
2721
|
+
maxManualSnapshotsPerCube: number | null;
|
|
2722
|
+
maxRamMb: number;
|
|
2723
|
+
maxVcpus: number;
|
|
2724
|
+
};
|
|
2725
|
+
name: string;
|
|
2726
|
+
priceUsdPerMonth: number;
|
|
2727
|
+
slug: string;
|
|
2728
|
+
};
|
|
2615
2729
|
PricingTier: {
|
|
2616
2730
|
label: string;
|
|
2617
2731
|
maxVcpus: number | null;
|
|
@@ -2647,6 +2761,20 @@ interface components {
|
|
|
2647
2761
|
createdAt: string;
|
|
2648
2762
|
id: string;
|
|
2649
2763
|
name: string;
|
|
2764
|
+
/** @description The space's Cube plan, or null when it is not on one. `tier` is unchanged and still the plan slug. */
|
|
2765
|
+
plan?: {
|
|
2766
|
+
/**
|
|
2767
|
+
* Format: date-time
|
|
2768
|
+
* @description When the paid period ends. Null on Free, which has none.
|
|
2769
|
+
*/
|
|
2770
|
+
currentPeriodEnd: string | null;
|
|
2771
|
+
/** @description USD of included usage left to use now. Usage draws on it before the balance. Null unless the caller is an owner or holds billing.view, the same as the balance. */
|
|
2772
|
+
includedUsageRemainingUsd: number | null;
|
|
2773
|
+
/** @description USD of Cube usage the plan includes each month. It resets each month and does not roll over. */
|
|
2774
|
+
includedUsageUsd: number;
|
|
2775
|
+
/** @description The plan's slug. */
|
|
2776
|
+
slug: string;
|
|
2777
|
+
} | null;
|
|
2650
2778
|
tier: string;
|
|
2651
2779
|
};
|
|
2652
2780
|
TcpMapping: {
|
|
@@ -2673,6 +2801,8 @@ interface components {
|
|
|
2673
2801
|
Webhook: {
|
|
2674
2802
|
/** Format: date-time */
|
|
2675
2803
|
createdAt: string;
|
|
2804
|
+
/** @description Optional label for the endpoint. Returned by create and get-one; the list response omits it. */
|
|
2805
|
+
description?: string | null;
|
|
2676
2806
|
enabled: boolean;
|
|
2677
2807
|
events: string[];
|
|
2678
2808
|
id: string;
|
|
@@ -2722,7 +2852,7 @@ interface components {
|
|
|
2722
2852
|
"application/json": components["schemas"]["Error"];
|
|
2723
2853
|
};
|
|
2724
2854
|
};
|
|
2725
|
-
/** @description Rate limit exceeded (
|
|
2855
|
+
/** @description Rate limit exceeded for the Space (its Running Cubes limit of mutations a minute, never fewer than 10; start and stop are counted apart from the other mutations). `Retry-After` gives the seconds to wait. */
|
|
2726
2856
|
RateLimited: {
|
|
2727
2857
|
headers: {
|
|
2728
2858
|
[name: string]: unknown;
|
|
@@ -2848,28 +2978,19 @@ type ResizeCubeResult = paths["/spaces/{spaceId}/cubes/{cubeId}/resize"]["post"]
|
|
|
2848
2978
|
/**
|
|
2849
2979
|
* A webhook endpoint subscribed to Space events.
|
|
2850
2980
|
*
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
* it as `string | null`. The schema-derived type is extended here so callers
|
|
2854
|
-
* reading a single webhook see the field; it is optional so list responses
|
|
2855
|
-
* (which omit it) still typecheck.
|
|
2981
|
+
* `description` is the optional label. `GET /spaces/{spaceId}/webhooks/{endpointId}`
|
|
2982
|
+
* and the create response include it; the list response omits it.
|
|
2856
2983
|
*/
|
|
2857
|
-
type Webhook = components["schemas"]["Webhook"]
|
|
2858
|
-
description?: string | null;
|
|
2859
|
-
};
|
|
2984
|
+
type Webhook = components["schemas"]["Webhook"];
|
|
2860
2985
|
/** A recorded webhook delivery attempt (last 30 days of history). */
|
|
2861
2986
|
type WebhookDelivery = components["schemas"]["WebhookDelivery"];
|
|
2862
2987
|
/**
|
|
2863
2988
|
* Request body for creating a webhook endpoint.
|
|
2864
2989
|
*
|
|
2865
2990
|
* Derived from `paths["/spaces/{spaceId}/webhooks"]["post"]` exactly like
|
|
2866
|
-
* {@link CreateDomainInput}; `description` is
|
|
2867
|
-
* bundled spec omits it but the runtime accepts it.
|
|
2991
|
+
* {@link CreateDomainInput}; `description` is the optional human-readable label.
|
|
2868
2992
|
*/
|
|
2869
|
-
type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"]
|
|
2870
|
-
/** Optional human-readable label shown on the endpoint. */
|
|
2871
|
-
description?: string;
|
|
2872
|
-
};
|
|
2993
|
+
type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2873
2994
|
/** A webhook plus its signing secret. Returned ONLY by {@link KrovaClient.webhooks}.create. */
|
|
2874
2995
|
type WebhookWithSecret = Webhook & {
|
|
2875
2996
|
secret: string;
|
|
@@ -2942,11 +3063,20 @@ declare class KrovaClient {
|
|
|
2942
3063
|
/** List Cubes in a Space, with pagination metadata. */
|
|
2943
3064
|
list: (spaceId: string) => Promise<{
|
|
2944
3065
|
cubes: {
|
|
3066
|
+
autoSnapshots: boolean;
|
|
3067
|
+
backupOnDelete: boolean;
|
|
2945
3068
|
costPerHour: number;
|
|
2946
3069
|
createdAt: string;
|
|
3070
|
+
deleteAfter: number | null;
|
|
3071
|
+
deleteAt: string | null;
|
|
3072
|
+
deleteWhenStopped: boolean;
|
|
2947
3073
|
id: string;
|
|
3074
|
+
idleAction: "stop" | "delete";
|
|
2948
3075
|
idleTimeoutMinutes: number | null;
|
|
2949
3076
|
image: string;
|
|
3077
|
+
labels: {
|
|
3078
|
+
[x: string]: string;
|
|
3079
|
+
};
|
|
2950
3080
|
lastActiveAt: string | null;
|
|
2951
3081
|
name: string;
|
|
2952
3082
|
publicIpv4: string | null;
|
|
@@ -2955,6 +3085,7 @@ declare class KrovaClient {
|
|
|
2955
3085
|
ramGb: number;
|
|
2956
3086
|
vcpu: number;
|
|
2957
3087
|
};
|
|
3088
|
+
sandbox: boolean;
|
|
2958
3089
|
serverDomain?: string | null;
|
|
2959
3090
|
sshUser: string;
|
|
2960
3091
|
state: "pending" | "booting" | "running" | "stopped" | "stopping" | "resizing" | "error" | "deleted";
|
|
@@ -3355,6 +3486,20 @@ declare class KrovaClient {
|
|
|
3355
3486
|
pricing: () => Promise<{
|
|
3356
3487
|
currency: string;
|
|
3357
3488
|
note: string;
|
|
3489
|
+
plans: {
|
|
3490
|
+
includedUsageUsdPerMonth: number;
|
|
3491
|
+
limits: {
|
|
3492
|
+
autoSnapshotCadenceHours: number | null;
|
|
3493
|
+
maxConcurrentCubes: number | null;
|
|
3494
|
+
maxDiskGb: number;
|
|
3495
|
+
maxManualSnapshotsPerCube: number | null;
|
|
3496
|
+
maxRamMb: number;
|
|
3497
|
+
maxVcpus: number;
|
|
3498
|
+
};
|
|
3499
|
+
name: string;
|
|
3500
|
+
priceUsdPerMonth: number;
|
|
3501
|
+
slug: string;
|
|
3502
|
+
}[];
|
|
3358
3503
|
rates: {
|
|
3359
3504
|
diskGbPerHour: number;
|
|
3360
3505
|
ramGbPerHour: number;
|