diff --git a/.github/workflows/sdk-ci.yml b/.github/workflows/sdk-ci.yml index 6086fbb..ccb600f 100644 --- a/.github/workflows/sdk-ci.yml +++ b/.github/workflows/sdk-ci.yml @@ -25,5 +25,10 @@ jobs: # Verification only, never auto-fix: the SDK is generated formatted, so a diff here means # either hand-edited custom code or a regenerate that was not committed. ruff is pinned to # the release that produced these bytes, since a formatter minor can change them. - - run: python -m pip install "ruff==0.16.8" + - run: python -m pip install "ruff==0.17.4" - run: ruff format --check . + # The smoke tests skip unless TEST_API_BASE_URL is set, so this only proves every test module + # imports against the installed SDK; it never calls the API. + - run: python -m pip install --upgrade pip + - run: python -m pip install . --group dev + - run: python -m pytest diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b77f50..6538ca9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.0" + ".": "0.8.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8567a32..1b17cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [0.8.0](https://github.com/dedalus-labs/dedalus-python/compare/v0.7.0...v0.8.0) (2026-11-20) + + +### ⚠ BREAKING CHANGES + +* **api:** 3 breaking changes to the SDK surface. + - response-shape GET v1/images→.image_ids — field only in before (breaking: removed; items appeared in its place, likely a rename) + - types-files types/autoresizing_switch.py — type file only in before (1 member: 0 matched by name and kind elsewhere in after, 1 not found) (breaking: the new snapshot no longer has it) + - types-classes types/__init__.py:AutoresizingSwitch — reexport only in before (breaking: the new snapshot no longer has it) +* **api:** 4 breaking changes to the SDK surface. + - Property `policy.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. + - Property `policy.memory` type changed from `enum(on | off)` to `autoresizing_switch`. + - Property `autoresizing_update.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. + - Property `autoresizing_update.memory` type changed from `enum(on | off)` to `autoresizing_switch`. + +### Features + +* **api:** share autoresizing switch type ([3a15ddf](https://github.com/dedalus-labs/dedalus-python/commit/3a15ddf961720e90a49aa5eb4a8f417d56e0f17d)) +* **api:** update property policy.cpu (+4 more changes) ([eb49ee9](https://github.com/dedalus-labs/dedalus-python/commit/eb49ee968e265f7ecadaa263f376049dc7048ec6)) +* **api:** update SDK surface (31 changes) ([614dadd](https://github.com/dedalus-labs/dedalus-python/commit/614dadde6ca66c3e745a0f8618f5c04a1f39701e)) + + +### Chores + +* **api:** update generated SDK content ([947b94c](https://github.com/dedalus-labs/dedalus-python/commit/947b94cdb9da7800aa5fea9c117e49616bc966a4)) +* **api:** update generated SDK content ([584e0fd](https://github.com/dedalus-labs/dedalus-python/commit/584e0fdd70741545f8a92bc173095ea8df43f3c2)) +* **contract:** pin the contract with machine ports ([99abe5c](https://github.com/dedalus-labs/dedalus-python/commit/99abe5ca92f2e5c42ca8257cb149aef6f538554b)) +* **contract:** pin the contract with machine ports ([#21](https://github.com/dedalus-labs/dedalus-python/issues/21)) ([ba707f6](https://github.com/dedalus-labs/dedalus-python/commit/ba707f64166425a4e842dee52b3c31fad42d8924)) + ## [0.7.0](https://github.com/dedalus-labs/dedalus-python/compare/v0.6.0...v0.7.0) (2026-11-06) diff --git a/api-contract.json b/api-contract.json index c7418c4..8b18b73 100644 --- a/api-contract.json +++ b/api-contract.json @@ -1,6 +1,6 @@ { - "source_sha": "9f8d54f123e81b8bc7252f855c52ecbf7cc8ae42", - "spec_sha256": "c0b2db893e3017c5c83c14375e6085581584641f617ee7ea1305ab80e9b50421", + "source_sha": "33b1723ceb008dfddf66ed9939c1c69aef73fd91", + "spec_sha256": "bb5bd464c8160621397668abdcd19834cbae34629865d4fd98c588f3c083d122", "operations": [ { "method": "GET", @@ -138,6 +138,62 @@ "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", "bodyParams": [] }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports", + "bodyParams": [ + "expires", + "port", + "protocol", + "visibility" + ] + }, + { + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": [] + }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": [] + }, + { + "method": "PATCH", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": [ + "visibility" + ] + }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + "bodyParams": [ + "expires_in" + ] + }, + { + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", + "bodyParams": [ + "expires_in" + ] + }, { "method": "POST", "path": "/v1/machines/{machine_id}/reboot", diff --git a/api.md b/api.md index 6d0e06f..59d7c5e 100644 --- a/api.md +++ b/api.md @@ -32,12 +32,23 @@ Complete reference of every operation, grouped by resource. See [the README](./R - [`Machines Autoresizing`](#machines-autoresizing) - [Read this machine's autoresizing settings](#read-this-machines-autoresizing-settings) - [Set this machine's autoresizing settings](#set-this-machines-autoresizing-settings) + - [`Machines Ports`](#machines-ports) + - [List ports](#list-ports) + - [Create port](#create-port) + - [Get port](#get-port) + - [Update port](#update-port) + - [Delete port](#delete-port) + - [`Machines Ports AccessKeys`](#machines-ports-accesskeys) + - [List port access keys](#list-port-access-keys) + - [Mint port access key](#mint-port-access-key) + - [Revoke port access key](#revoke-port-access-key) + - [Rotate port access key](#rotate-port-access-key) - [`Organization`](#organization) - [`Organization Autoresizing`](#organization-autoresizing) - [Read organization autoresizing policy](#read-organization-autoresizing-policy) - [Set organization autoresizing policy](#set-organization-autoresizing-policy) - [`Images`](#images) - - [List image IDs owned by the authenticated organization](#list-image-ids-owned-by-the-authenticated-organization) + - [List images owned by the authenticated organization](#list-images-owned-by-the-authenticated-organization) - [Register an immutable OCI image for preparation](#register-an-immutable-oci-image-for-preparation) - [Read preparation status for an organization-owned image](#read-preparation-status-for-an-organization-owned-image) - [Rename an organization-owned image](#rename-an-organization-owned-image) @@ -383,6 +394,144 @@ autoresizing = client.machines.autoresizing.update( ) ``` +### `Machines Ports` + +#### List ports + +| Direction | Type | +| --- | --- | +| Request | [`PortListParams`](./src/dedalus_sdk/types/machines/port_list_params.py) | + +```python +page = client.machines.ports.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", +) +``` + +#### Create port + +| Direction | Type | +| --- | --- | +| Request | [`PortCreateParams`](./src/dedalus_sdk/types/machines/port_create_params.py) | +| Response | [`Port`](./src/dedalus_sdk/types/machines/port.py) | + +```python +port = client.machines.ports.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port=0, + protocol="http", + visibility="private", + idempotency_key="", +) +``` + +#### Get port + +| Direction | Type | +| --- | --- | +| Response | [`Port`](./src/dedalus_sdk/types/machines/port.py) | + +```python +port = client.machines.ports.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", +) +``` + +#### Update port + +| Direction | Type | +| --- | --- | +| Request | [`PortUpdateParams`](./src/dedalus_sdk/types/machines/port_update_params.py) | +| Response | [`Port`](./src/dedalus_sdk/types/machines/port.py) | + +```python +port = client.machines.ports.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + visibility="public", + idempotency_key="", +) +``` + +#### Delete port + +| Direction | Type | +| --- | --- | +| Response | [`Port`](./src/dedalus_sdk/types/machines/port.py) | + +```python +port = client.machines.ports.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + idempotency_key="", +) +``` + +#### `Machines Ports AccessKeys` + +##### List port access keys + +| Direction | Type | +| --- | --- | +| Request | [`AccessKeyListParams`](./src/dedalus_sdk/types/machines/ports/access_key_list_params.py) | +| Response | [`AccessKeyListResponse`](./src/dedalus_sdk/types/machines/ports/access_key_list_response.py) | + +```python +access_key = client.machines.ports.access_keys.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", +) +``` + +##### Mint port access key + +| Direction | Type | +| --- | --- | +| Request | [`AccessKeyMintParams`](./src/dedalus_sdk/types/machines/ports/access_key_mint_params.py) | +| Response | [`AccessKeyMintResponse`](./src/dedalus_sdk/types/machines/ports/access_key_mint_response.py) | + +```python +access_key = client.machines.ports.access_keys.mint( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + expires_in=1, + idempotency_key="", +) +``` + +##### Revoke port access key + +| Direction | Type | +| --- | --- | +| Response | [`AccessKeyRevokeResponse`](./src/dedalus_sdk/types/machines/ports/access_key_revoke_response.py) | + +```python +access_key = client.machines.ports.access_keys.revoke( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + idempotency_key="", +) +``` + +##### Rotate port access key + +| Direction | Type | +| --- | --- | +| Request | [`AccessKeyRotateParams`](./src/dedalus_sdk/types/machines/ports/access_key_rotate_params.py) | +| Response | [`AccessKeyRotateResponse`](./src/dedalus_sdk/types/machines/ports/access_key_rotate_response.py) | + +```python +access_key = client.machines.ports.access_keys.rotate( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + expires_in=1, + idempotency_key="", +) +``` + ## `Organization` ### `Organization Autoresizing` @@ -414,9 +563,9 @@ autoresizing = client.organization.autoresizing.update( ## `Images` -### List image IDs owned by the authenticated organization +### List images owned by the authenticated organization -Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. +Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. | Direction | Type | | --- | --- | @@ -424,7 +573,7 @@ Pages through the organization's images in ID order. A deleted image is left out | Response | [`ImageList`](./src/dedalus_sdk/types/image_list.py) | ```python -image = client.images.list( +images = client.images.list( limit=100, ) ``` diff --git a/generation-provenance.json b/generation-provenance.json index 0d44c1f..bb83127 100644 --- a/generation-provenance.json +++ b/generation-provenance.json @@ -1,11 +1,11 @@ { - "source_spec_sha": "9f8d54f123e81b8bc7252f855c52ecbf7cc8ae42", - "source_spec_sha256": "c0b2db893e3017c5c83c14375e6085581584641f617ee7ea1305ab80e9b50421", + "source_spec_sha": "f5b640b324aafb001a8da6facd807f13197630bb", + "source_spec_sha256": "a717ed108ea8bbb6b9c0b70255a07da7e9a01224c6941546089084e02097a632", "generator_version": "0.38.0", - "build_version": "0.1.16", - "configuration_sha256": "10d2f59b8a69dce627060e1104eac425cec104dd90d3177c08a29a902cb48875", + "build_version": "0.1.19", + "configuration_sha256": "477d944077da8e1163423c505fe3f773cce14eda953aa934fe91582d04e4e915", "operation_count": 31, - "generated_commit": "bc3e12c4dd8d4d0557b5e2847049a2ecc7df21df", + "generated_commit": "947b94cdb9da7800aa5fea9c117e49616bc966a4", "download_sha256": null, "integration_base": "scalar-next", "published_package": false diff --git a/pyproject.toml b/pyproject.toml index f8c9e64..1186a95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dedalus-sdk" -version = "0.7.0" # x-release-please-version +version = "0.8.0" # x-release-please-version description = "Create, run, and manage Dedalus Machines." readme = "README.md" license = "Apache-2.0" @@ -24,6 +24,9 @@ Changelog = "https://github.com/dedalus-labs/dedalus-python/blob/main/CHANGELOG. [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] +[dependency-groups] +dev = ["pytest>=8.3.4"] + [build-system] requires = ["hatchling>=1.18.0"] build-backend = "hatchling.build" @@ -33,3 +36,6 @@ packages = ["src/dedalus_sdk"] [tool.ruff] line-length = 120 + +[tool.pytest.ini_options] +testpaths = ["tests"] diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index 6896011..527416a 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,7 +1,7 @@ { "name": "Dedalus", "slug": "dedalus", - "generatorVersion": "0.38.0", + "generatorVersion": "0.45.0", "servers": [ "https://dcs.dedaluslabs.ai" ], @@ -615,21 +615,79 @@ } }, { - "name": "ssh_session_create_params", - "source": "ssh_session_create_params", + "name": "port_create_params", + "source": "port_create_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "public_key", - "publicName": "public_key", + "name": "expires", + "publicName": "expires", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int32", + "validation": { + "minimum": 1, + "maximum": 2147483647 + } + } + }, + { + "name": "port", + "publicName": "port", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "protocol", + "publicName": "protocol", + "required": false, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "http" + ], + "names": [ + "HTTP" + ], + "deprecations": [ + false + ] + } + }, + { + "name": "visibility", + "publicName": "visibility", + "required": false, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -637,41 +695,22 @@ } }, { - "name": "error_detail", - "source": "error_detail", + "name": "ssh_session_create_params", + "source": "ssh_session_create_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "location", - "publicName": "location", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "message", - "publicName": "message", - "required": false, + "name": "public_key", + "publicName": "public_key", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - }, - { - "name": "value", - "publicName": "value", - "required": false, - "deprecated": false, - "type": { - "kind": "unknown" - } } ], "additionalProperties": false @@ -747,122 +786,6 @@ "additionalProperties": false } }, - { - "name": "error_model", - "source": "error_model", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "detail", - "publicName": "detail", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Property foo is required but is missing." - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "errors", - "publicName": "errors", - "required": false, - "deprecated": false, - "type": { - "kind": "union", - "variants": [ - { - "kind": "array", - "items": { - "kind": "ref", - "name": "error_detail" - } - }, - { - "kind": "null" - } - ] - } - }, - { - "name": "instance", - "publicName": "instance", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://example.com/error-log/abc123" - }, - "type": { - "kind": "primitive", - "type": "string", - "format": "uri" - } - }, - { - "name": "status", - "publicName": "status", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 400 - }, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "publicName": "title", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Bad Request" - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "type", - "publicName": "type", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://example.com/errors/example" - }, - "type": { - "kind": "primitive", - "type": "string", - "format": "uri" - } - } - ], - "additionalProperties": false - } - }, { "name": "execution_event", "source": "execution_event", @@ -1656,8 +1579,8 @@ "kind": "object", "properties": [ { - "name": "image_ids", - "publicName": "image_ids", + "name": "items", + "publicName": "items", "required": true, "deprecated": false, "type": { @@ -1666,8 +1589,8 @@ { "kind": "array", "items": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "image" } }, { @@ -2426,69 +2349,140 @@ } }, { - "name": "preparation_context", - "source": "preparation_context", + "name": "mint_port_access_key_request", + "source": "mint_port_access_key_request", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "percent", - "publicName": "percent", + "name": "expires_in", + "publicName": "expires_in", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "integer", - "format": "int64" + "format": "int32", + "validation": { + "minimum": 1, + "maximum": 2147483647 + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "mint_port_access_key_response", + "source": "mint_port_access_key_response", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "access_key", + "publicName": "access_key", + "required": true, + "deprecated": false, + "access": "readOnly", + "type": { + "kind": "primitive", + "type": "string" } }, { - "name": "progress", - "publicName": "progress", + "name": "access_key_id", + "publicName": "access_key_id", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "created_at", + "publicName": "created_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "expires_at", + "publicName": "expires_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "last_used_at", + "publicName": "last_used_at", "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "execution_progress" + "kind": "primitive", + "type": "string", + "format": "date-time" } }, { - "name": "stage", - "publicName": "stage", + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } + }, + { + "name": "revoked_at", + "publicName": "revoked_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } } ], "additionalProperties": false } }, { - "name": "public_image_rename_input_body", - "source": "public_image_rename_input_body", + "name": "port_access_key_list_response", + "source": "port_access_key_list_response", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "name", - "publicName": "name", + "name": "items", + "publicName": "items", "required": true, "deprecated": false, "type": { "kind": "union", "variants": [ { - "kind": "primitive", - "type": "string", - "validation": { - "maxLength": 128 + "kind": "array", + "items": { + "kind": "ref", + "name": "port_access_key_response" } }, { @@ -2496,23 +2490,33 @@ } ] } + }, + { + "name": "next_cursor", + "publicName": "next_cursor", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } } ], "additionalProperties": false } }, { - "name": "public_image_submit_input_body", - "source": "public_image_submit_input_body", + "name": "port_access_key_response", + "source": "port_access_key_response", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "credential_ref", - "publicName": "credential_ref", - "required": false, + "name": "access_key_id", + "publicName": "access_key_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -2520,99 +2524,41 @@ } }, { - "name": "name", - "publicName": "name", - "required": false, + "name": "created_at", + "publicName": "created_at", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string", - "validation": { - "maxLength": 128 - } - } - }, - { - "name": "platform", - "publicName": "platform", - "required": true, - "deprecated": false, - "type": { - "kind": "enum", - "values": [ - "linux/amd64", - "linux/arm64" - ], - "names": [ - "LinuxAmd64", - "LinuxArm64" - ], - "deprecations": [ - false, - false - ] + "format": "date-time" } }, { - "name": "source", - "publicName": "source", - "required": true, - "deprecated": false, - "type": { - "kind": "ref", - "name": "source" - } - } - ], - "additionalProperties": false - } - }, - { - "name": "public_path_segment", - "source": "public_path_segment", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string", - "validation": { - "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", - "minLength": 1, - "maxLength": 253 - } - } - }, - { - "name": "read_token", - "source": "read_token", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "access_token", - "publicName": "access_token", + "name": "expires_at", + "publicName": "expires_at", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "base_url", - "publicName": "base_url", - "required": true, + "name": "last_used_at", + "publicName": "last_used_at", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "execution_id", - "publicName": "execution_id", + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, "type": { @@ -2621,30 +2567,53 @@ } }, { - "name": "expires_at", - "publicName": "expires_at", - "required": true, + "name": "revoked_at", + "publicName": "revoked_at", + "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string", "format": "date-time" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "port_list", + "source": "port_list", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "stream_id", - "publicName": "stream_id", + "name": "items", + "publicName": "items", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "ref", + "name": "port" + } + }, + { + "kind": "null" + } + ] } }, { - "name": "token_type", - "publicName": "token_type", - "required": true, + "name": "next_cursor", + "publicName": "next_cursor", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2656,21 +2625,21 @@ } }, { - "name": "image", - "source": "image", + "name": "port", + "source": "port", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "context", - "publicName": "context", - "required": false, + "name": "application_url", + "publicName": "application_url", + "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "preparation_context" + "kind": "primitive", + "type": "string" } }, { @@ -2685,19 +2654,19 @@ } }, { - "name": "error", - "publicName": "error", + "name": "error_code", + "publicName": "error_code", "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "error" + "kind": "primitive", + "type": "string" } }, { - "name": "image_id", - "publicName": "image_id", - "required": true, + "name": "error_message", + "publicName": "error_message", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2705,110 +2674,91 @@ } }, { - "name": "name", - "publicName": "name", - "required": true, + "name": "expires_at", + "publicName": "expires_at", + "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string", + "format": "date-time" } }, { - "name": "platform", - "publicName": "platform", - "required": true, + "name": "initial_access_key", + "publicName": "initial_access_key", + "required": false, "deprecated": false, + "access": "readOnly", "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "mint_port_access_key_response" } }, { - "name": "reason", - "publicName": "reason", - "required": false, + "name": "machine_id", + "publicName": "machine_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "uuid" } }, { - "name": "source", - "publicName": "source", + "name": "port", + "publicName": "port", "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "source" + "kind": "primitive", + "type": "integer", + "format": "int64" } }, { - "name": "state", - "publicName": "state", + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "reservation", - "source": "reservation", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "source", - "publicName": "source", - "required": true, + "name": "protocol", + "publicName": "protocol", + "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "source" + "kind": "enum", + "values": [ + "http" + ], + "names": [ + "HTTP" + ], + "deprecations": [ + false + ] } }, { - "name": "upload", - "publicName": "upload", - "required": true, + "name": "ready_at", + "publicName": "ready_at", + "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "execution_upload" + "kind": "primitive", + "type": "string", + "format": "date-time" } - } - ], - "additionalProperties": false - } - }, - { - "name": "resize_machine_request", - "source": "resize_machine_request", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "memory_mib", - "publicName": "memory_mib", + "name": "retry_after_ms", + "publicName": "retry_after_ms", "required": false, "deprecated": false, "type": { @@ -2818,14 +2768,70 @@ } }, { - "name": "vcpu", - "publicName": "vcpu", - "required": false, - "deprecated": false, - "type": { + "name": "status", + "publicName": "status", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "wake_in_progress", + "ready", + "unavailable", + "closed", + "expired", + "failed" + ], + "names": [ + "WakeInProgress", + "Ready", + "Unavailable", + "Closed", + "Expired", + "Failed" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false + ] + } + }, + { + "name": "url", + "publicName": "url", + "required": false, + "deprecated": false, + "type": { "kind": "primitive", - "type": "number", - "format": "double" + "type": "string" + } + }, + { + "name": "visibility", + "publicName": "visibility", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -2833,62 +2839,75 @@ } }, { - "name": "ssh_connection", - "source": "ssh_connection", + "name": "preparation_context", + "source": "preparation_context", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "endpoint", - "publicName": "endpoint", + "name": "percent", + "publicName": "percent", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" } }, { - "name": "host_trust", - "publicName": "host_trust", + "name": "progress", + "publicName": "progress", "required": false, "deprecated": false, "type": { "kind": "ref", - "name": "ssh_host_trust" - } - }, - { - "name": "port", - "publicName": "port", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" + "name": "execution_progress" } }, { - "name": "ssh_username", - "publicName": "ssh_username", + "name": "stage", + "publicName": "stage", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "public_image_rename_input_body", + "source": "public_image_rename_input_body", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "user_certificate", - "publicName": "user_certificate", - "required": false, + "name": "name", + "publicName": "name", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 128 + } + }, + { + "kind": "null" + } + ] } } ], @@ -2896,17 +2915,17 @@ } }, { - "name": "ssh_host_trust", - "source": "ssh_host_trust", + "name": "public_image_submit_input_body", + "source": "public_image_submit_input_body", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "host_pattern", - "publicName": "host_pattern", - "required": true, + "name": "credential_ref", + "publicName": "credential_ref", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2914,31 +2933,47 @@ } }, { - "name": "kind", - "publicName": "kind", + "name": "name", + "publicName": "name", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 128 + } + } + }, + { + "name": "platform", + "publicName": "platform", "required": true, "deprecated": false, "type": { "kind": "enum", "values": [ - "cert_authority" + "linux/amd64", + "linux/arm64" ], "names": [ - "CertAuthority" + "LinuxAmd64", + "LinuxArm64" ], "deprecations": [ + false, false ] } }, { - "name": "public_key", - "publicName": "public_key", + "name": "source", + "publicName": "source", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "source" } } ], @@ -2946,81 +2981,42 @@ } }, { - "name": "ssh_session_list", - "source": "ssh_session_list", + "name": "public_path_segment", + "source": "public_path_segment", "publicAliases": [], "deprecated": false, "type": { - "kind": "object", - "properties": [ - { - "name": "items", - "publicName": "items", - "required": true, - "deprecated": false, - "type": { - "kind": "union", - "variants": [ - { - "kind": "array", - "items": { - "kind": "ref", - "name": "ssh_session" - } - }, - { - "kind": "null" - } - ] - } - }, - { - "name": "next_cursor", - "publicName": "next_cursor", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } - } - ], - "additionalProperties": false + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", + "minLength": 1, + "maxLength": 253 + } } }, { - "name": "ssh_session", - "source": "ssh_session", + "name": "read_token", + "source": "read_token", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "connection", - "publicName": "connection", - "required": false, - "deprecated": false, - "type": { - "kind": "ref", - "name": "ssh_connection" - } - }, - { - "name": "created_at", - "publicName": "created_at", + "name": "access_token", + "publicName": "access_token", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string", - "format": "date-time" + "type": "string" } }, { - "name": "error_code", - "publicName": "error_code", - "required": false, + "name": "base_url", + "publicName": "base_url", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3028,9 +3024,9 @@ } }, { - "name": "error_message", - "publicName": "error_message", - "required": false, + "name": "execution_id", + "publicName": "execution_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3040,7 +3036,7 @@ { "name": "expires_at", "publicName": "expires_at", - "required": false, + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3049,21 +3045,52 @@ } }, { - "name": "machine_id", - "publicName": "machine_id", + "name": "stream_id", + "publicName": "stream_id", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string", - "format": "uuid" + "type": "string" } }, { - "name": "ready_at", - "publicName": "ready_at", - "required": false, - "deprecated": false, + "name": "token_type", + "publicName": "token_type", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "image", + "source": "image", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "context", + "publicName": "context", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "preparation_context" + } + }, + { + "name": "created_at", + "publicName": "created_at", + "required": true, + "deprecated": false, "type": { "kind": "primitive", "type": "string", @@ -3071,19 +3098,18 @@ } }, { - "name": "retry_after_ms", - "publicName": "retry_after_ms", + "name": "error", + "publicName": "error", "required": false, "deprecated": false, "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" + "kind": "ref", + "name": "error" } }, { - "name": "session_id", - "publicName": "session_id", + "name": "image_id", + "publicName": "image_id", "required": true, "deprecated": false, "type": { @@ -3092,53 +3118,26 @@ } }, { - "name": "status", - "publicName": "status", + "name": "name", + "publicName": "name", "required": true, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "wake_in_progress", - "ssh_in_progress", - "ready", - "closed", - "expired", - "failed" - ], - "names": [ - "WakeInProgress", - "SshInProgress", - "Ready", - "Closed", - "Expired", - "Failed" - ], - "deprecations": [ - false, - false, - false, - false, - false, - false + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } ] } - } - ], - "additionalProperties": false - } - }, - { - "name": "source", - "source": "source", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "kind", - "publicName": "kind", + "name": "platform", + "publicName": "platform", "required": true, "deprecated": false, "type": { @@ -3147,8 +3146,8 @@ } }, { - "name": "reference", - "publicName": "reference", + "name": "reason", + "publicName": "reason", "required": false, "deprecated": false, "type": { @@ -3157,19 +3156,19 @@ } }, { - "name": "sha256", - "publicName": "sha256", - "required": false, + "name": "source", + "publicName": "source", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "source" } }, { - "name": "upload_id", - "publicName": "upload_id", - "required": false, + "name": "state", + "publicName": "state", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3181,59 +3180,65 @@ } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "reservation", + "source": "reservation", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", - "required": false, + "name": "source", + "publicName": "source", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "source" } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "upload", + "publicName": "upload", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "execution_upload" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "resize_machine_request", + "source": "resize_machine_request", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "Location", - "publicName": "Location", + "name": "memory_mib", + "publicName": "memory_mib", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", + "name": "vcpu", + "publicName": "vcpu", "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "number", + "format": "double" } } ], @@ -3241,17 +3246,17 @@ } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "ssh_connection", + "source": "ssh_connection", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", - "required": false, + "name": "endpoint", + "publicName": "endpoint", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3259,19 +3264,30 @@ } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "host_trust", + "publicName": "host_trust", "required": false, "deprecated": false, + "type": { + "kind": "ref", + "name": "ssh_host_trust" + } + }, + { + "name": "port", + "publicName": "port", + "required": true, + "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" } }, { - "name": "Location", - "publicName": "Location", - "required": false, + "name": "ssh_username", + "publicName": "ssh_username", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3279,21 +3295,13 @@ } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", + "name": "user_certificate", + "publicName": "user_certificate", "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } } ], @@ -3301,39 +3309,45 @@ } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "ssh_host_trust", + "source": "ssh_host_trust", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "host_pattern", + "publicName": "host_pattern", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "kind", + "publicName": "kind", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "cert_authority" + ], + "names": [ + "CertAuthority" + ], + "deprecations": [ + false + ] + } + }, + { + "name": "public_key", + "publicName": "public_key", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3345,16 +3359,37 @@ } }, { - "name": "CreateStatus409ResponseHeaders", - "source": "CreateStatus409ResponseHeaders", + "name": "ssh_session_list", + "source": "ssh_session_list", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "items", + "publicName": "items", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "ref", + "name": "ssh_session" + } + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "next_cursor", + "publicName": "next_cursor", "required": false, "deprecated": false, "type": { @@ -3367,60 +3402,186 @@ } }, { - "name": "CreateStatus429ResponseHeaders", - "source": "CreateStatus429ResponseHeaders", + "name": "ssh_session", + "source": "ssh_session", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "connection", + "publicName": "connection", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "ssh_connection" + } + }, + { + "name": "created_at", + "publicName": "created_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "error_code", + "publicName": "error_code", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "CreateStatus503ResponseHeaders", - "source": "CreateStatus503ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "error_message", + "publicName": "error_message", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "expires_at", + "publicName": "expires_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "machine_id", + "publicName": "machine_id", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "uuid" + } + }, + { + "name": "ready_at", + "publicName": "ready_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "retry_after_ms", + "publicName": "retry_after_ms", "required": false, "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "session_id", + "publicName": "session_id", + "required": true, + "deprecated": false, "type": { "kind": "primitive", "type": "string" } + }, + { + "name": "status", + "publicName": "status", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "wake_in_progress", + "ssh_in_progress", + "ready", + "closed", + "expired", + "failed" + ], + "names": [ + "WakeInProgress", + "SshInProgress", + "Ready", + "Closed", + "Expired", + "Failed" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false + ] + } } ], "additionalProperties": false } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "source", + "source": "source", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "kind", + "publicName": "kind", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "reference", + "publicName": "reference", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "sha256", + "publicName": "sha256", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "upload_id", + "publicName": "upload_id", "required": false, "deprecated": false, "type": { @@ -3433,21 +3594,35 @@ } }, { - "name": "RetrieveResponseHeaders", - "source": "RetrieveResponseHeaders", + "name": "port_update_params", + "source": "port_update_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", - "required": false, + "name": "visibility", + "publicName": "visibility", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -3455,8 +3630,8 @@ } }, { - "name": "UpdateResponseHeaders", - "source": "UpdateResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3515,8 +3690,8 @@ } }, { - "name": "UpdateResponseHeaders", - "source": "UpdateResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3575,8 +3750,8 @@ } }, { - "name": "UpdateStatus401ResponseHeaders", - "source": "UpdateStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3597,8 +3772,8 @@ } }, { - "name": "UpdateStatus403ResponseHeaders", - "source": "UpdateStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3619,8 +3794,8 @@ } }, { - "name": "UpdateStatus409ResponseHeaders", - "source": "UpdateStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3641,8 +3816,8 @@ } }, { - "name": "UpdateStatus429ResponseHeaders", - "source": "UpdateStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3663,8 +3838,8 @@ } }, { - "name": "UpdateStatus503ResponseHeaders", - "source": "UpdateStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3685,8 +3860,8 @@ } }, { - "name": "UpdateStatusdefaultResponseHeaders", - "source": "UpdateStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3707,8 +3882,30 @@ } }, { - "name": "DeleteResponseHeaders", - "source": "DeleteResponseHeaders", + "name": "RetrieveResponseHeaders", + "source": "RetrieveResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "UpdateResponseHeaders", + "source": "UpdateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3767,8 +3964,8 @@ } }, { - "name": "DeleteResponseHeaders", - "source": "DeleteResponseHeaders", + "name": "UpdateResponseHeaders", + "source": "UpdateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3827,8 +4024,8 @@ } }, { - "name": "DeleteStatus401ResponseHeaders", - "source": "DeleteStatus401ResponseHeaders", + "name": "UpdateStatus401ResponseHeaders", + "source": "UpdateStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3849,8 +4046,8 @@ } }, { - "name": "DeleteStatus403ResponseHeaders", - "source": "DeleteStatus403ResponseHeaders", + "name": "UpdateStatus403ResponseHeaders", + "source": "UpdateStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3871,8 +4068,8 @@ } }, { - "name": "DeleteStatus409ResponseHeaders", - "source": "DeleteStatus409ResponseHeaders", + "name": "UpdateStatus409ResponseHeaders", + "source": "UpdateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3893,8 +4090,8 @@ } }, { - "name": "DeleteStatus429ResponseHeaders", - "source": "DeleteStatus429ResponseHeaders", + "name": "UpdateStatus429ResponseHeaders", + "source": "UpdateStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3915,8 +4112,8 @@ } }, { - "name": "DeleteStatus503ResponseHeaders", - "source": "DeleteStatus503ResponseHeaders", + "name": "UpdateStatus503ResponseHeaders", + "source": "UpdateStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3937,8 +4134,8 @@ } }, { - "name": "DeleteStatusdefaultResponseHeaders", - "source": "DeleteStatusdefaultResponseHeaders", + "name": "UpdateStatusdefaultResponseHeaders", + "source": "UpdateStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3959,8 +4156,8 @@ } }, { - "name": "SleepResponseHeaders", - "source": "SleepResponseHeaders", + "name": "DeleteResponseHeaders", + "source": "DeleteResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4019,8 +4216,8 @@ } }, { - "name": "SleepResponseHeaders", - "source": "SleepResponseHeaders", + "name": "DeleteResponseHeaders", + "source": "DeleteResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4079,8 +4276,8 @@ } }, { - "name": "SleepStatus401ResponseHeaders", - "source": "SleepStatus401ResponseHeaders", + "name": "DeleteStatus401ResponseHeaders", + "source": "DeleteStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4101,8 +4298,8 @@ } }, { - "name": "SleepStatus403ResponseHeaders", - "source": "SleepStatus403ResponseHeaders", + "name": "DeleteStatus403ResponseHeaders", + "source": "DeleteStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4123,8 +4320,8 @@ } }, { - "name": "SleepStatus409ResponseHeaders", - "source": "SleepStatus409ResponseHeaders", + "name": "DeleteStatus409ResponseHeaders", + "source": "DeleteStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4145,8 +4342,8 @@ } }, { - "name": "SleepStatus429ResponseHeaders", - "source": "SleepStatus429ResponseHeaders", + "name": "DeleteStatus429ResponseHeaders", + "source": "DeleteStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4167,8 +4364,8 @@ } }, { - "name": "SleepStatus503ResponseHeaders", - "source": "SleepStatus503ResponseHeaders", + "name": "DeleteStatus503ResponseHeaders", + "source": "DeleteStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4189,8 +4386,8 @@ } }, { - "name": "SleepStatusdefaultResponseHeaders", - "source": "SleepStatusdefaultResponseHeaders", + "name": "DeleteStatusdefaultResponseHeaders", + "source": "DeleteStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4211,8 +4408,8 @@ } }, { - "name": "WakeResponseHeaders", - "source": "WakeResponseHeaders", + "name": "SleepResponseHeaders", + "source": "SleepResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4271,8 +4468,8 @@ } }, { - "name": "WakeResponseHeaders", - "source": "WakeResponseHeaders", + "name": "SleepResponseHeaders", + "source": "SleepResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4331,8 +4528,8 @@ } }, { - "name": "WakeStatus401ResponseHeaders", - "source": "WakeStatus401ResponseHeaders", + "name": "SleepStatus401ResponseHeaders", + "source": "SleepStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4353,8 +4550,8 @@ } }, { - "name": "WakeStatus403ResponseHeaders", - "source": "WakeStatus403ResponseHeaders", + "name": "SleepStatus403ResponseHeaders", + "source": "SleepStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4375,8 +4572,8 @@ } }, { - "name": "WakeStatus409ResponseHeaders", - "source": "WakeStatus409ResponseHeaders", + "name": "SleepStatus409ResponseHeaders", + "source": "SleepStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4397,8 +4594,8 @@ } }, { - "name": "WakeStatus429ResponseHeaders", - "source": "WakeStatus429ResponseHeaders", + "name": "SleepStatus429ResponseHeaders", + "source": "SleepStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4419,8 +4616,8 @@ } }, { - "name": "WakeStatus503ResponseHeaders", - "source": "WakeStatus503ResponseHeaders", + "name": "SleepStatus503ResponseHeaders", + "source": "SleepStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4441,8 +4638,8 @@ } }, { - "name": "WakeStatusdefaultResponseHeaders", - "source": "WakeStatusdefaultResponseHeaders", + "name": "SleepStatusdefaultResponseHeaders", + "source": "SleepStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4463,8 +4660,8 @@ } }, { - "name": "RebootResponseHeaders", - "source": "RebootResponseHeaders", + "name": "WakeResponseHeaders", + "source": "WakeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4523,8 +4720,8 @@ } }, { - "name": "RebootResponseHeaders", - "source": "RebootResponseHeaders", + "name": "WakeResponseHeaders", + "source": "WakeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4583,8 +4780,8 @@ } }, { - "name": "RebootStatus401ResponseHeaders", - "source": "RebootStatus401ResponseHeaders", + "name": "WakeStatus401ResponseHeaders", + "source": "WakeStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4605,8 +4802,8 @@ } }, { - "name": "RebootStatus403ResponseHeaders", - "source": "RebootStatus403ResponseHeaders", + "name": "WakeStatus403ResponseHeaders", + "source": "WakeStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4627,8 +4824,8 @@ } }, { - "name": "RebootStatus409ResponseHeaders", - "source": "RebootStatus409ResponseHeaders", + "name": "WakeStatus409ResponseHeaders", + "source": "WakeStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4649,8 +4846,8 @@ } }, { - "name": "RebootStatus429ResponseHeaders", - "source": "RebootStatus429ResponseHeaders", + "name": "WakeStatus429ResponseHeaders", + "source": "WakeStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4671,8 +4868,8 @@ } }, { - "name": "RebootStatus503ResponseHeaders", - "source": "RebootStatus503ResponseHeaders", + "name": "WakeStatus503ResponseHeaders", + "source": "WakeStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4693,8 +4890,8 @@ } }, { - "name": "RebootStatusdefaultResponseHeaders", - "source": "RebootStatusdefaultResponseHeaders", + "name": "WakeStatusdefaultResponseHeaders", + "source": "WakeStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4715,8 +4912,8 @@ } }, { - "name": "ResizeResponseHeaders", - "source": "ResizeResponseHeaders", + "name": "RebootResponseHeaders", + "source": "RebootResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4775,13 +4972,23 @@ } }, { - "name": "ResizeStatus400ResponseHeaders", - "source": "ResizeStatus400ResponseHeaders", + "name": "RebootResponseHeaders", + "source": "RebootResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { "name": "Idempotency-Key", "publicName": "Idempotency-Key", @@ -4791,14 +4998,42 @@ "kind": "primitive", "type": "string" } + }, + { + "name": "Location", + "publicName": "Location", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "ResizeStatus401ResponseHeaders", - "source": "ResizeStatus401ResponseHeaders", + "name": "RebootStatus401ResponseHeaders", + "source": "RebootStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4819,8 +5054,8 @@ } }, { - "name": "ResizeStatus402ResponseHeaders", - "source": "ResizeStatus402ResponseHeaders", + "name": "RebootStatus403ResponseHeaders", + "source": "RebootStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4841,8 +5076,8 @@ } }, { - "name": "ResizeStatus403ResponseHeaders", - "source": "ResizeStatus403ResponseHeaders", + "name": "RebootStatus409ResponseHeaders", + "source": "RebootStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4863,8 +5098,8 @@ } }, { - "name": "ResizeStatus404ResponseHeaders", - "source": "ResizeStatus404ResponseHeaders", + "name": "RebootStatus429ResponseHeaders", + "source": "RebootStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4885,8 +5120,8 @@ } }, { - "name": "ResizeStatus409ResponseHeaders", - "source": "ResizeStatus409ResponseHeaders", + "name": "RebootStatus503ResponseHeaders", + "source": "RebootStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4907,8 +5142,8 @@ } }, { - "name": "ResizeStatus422ResponseHeaders", - "source": "ResizeStatus422ResponseHeaders", + "name": "RebootStatusdefaultResponseHeaders", + "source": "RebootStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4929,8 +5164,222 @@ } }, { - "name": "ResizeStatus429ResponseHeaders", - "source": "ResizeStatus429ResponseHeaders", + "name": "ResizeResponseHeaders", + "source": "ResizeResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "Location", + "publicName": "Location", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus400ResponseHeaders", + "source": "ResizeStatus400ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus401ResponseHeaders", + "source": "ResizeStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus402ResponseHeaders", + "source": "ResizeStatus402ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus403ResponseHeaders", + "source": "ResizeStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus404ResponseHeaders", + "source": "ResizeStatus404ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus409ResponseHeaders", + "source": "ResizeStatus409ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus422ResponseHeaders", + "source": "ResizeStatus422ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus429ResponseHeaders", + "source": "ResizeStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5477,8 +5926,8 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5499,8 +5948,8 @@ } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5521,8 +5970,8 @@ } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5543,8 +5992,8 @@ } }, { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5565,8 +6014,8 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5585,38 +6034,196 @@ ], "additionalProperties": false } - } - ], - "resources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing", - "images", - "images.uploads" - ], - "publicResources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing", - "images", - "images.uploads" - ], - "operations": [ + }, { - "resource": "machines", - "publicResource": "machines", - "operation": "list", - "publicOperation": "list", - "deprecated": false, - "method": "GET", + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + } + ], + "resources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "machines.ports", + "machines.ports.accessKeys", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "publicResources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "machines.ports", + "machines.ports.accessKeys", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "operations": [ + { + "resource": "machines", + "publicResource": "machines", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", "path": "/v1/machines", "pathParams": [], "publicPathParams": [], @@ -5641,9 +6248,1177 @@ "required": false, "style": "form", "explode": false - }, + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineListParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_list", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "machine_list_item", + "publicAliases": [] + } + }, + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/machines", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "publicBodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "image_id", + "required": false + }, + { + "name": "memory_mib", + "required": false + }, + { + "name": "storage_gib", + "required": false + }, + { + "name": "vcpu", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_detail_response", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RetrieveResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "storage_gib" + ], + "publicBodyParams": [ + "autosleep", + "storage_gib" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "storage_gib", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "UpdateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ + { + "name": "force", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "DeleteResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "sleep", + "publicOperation": "sleep", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/sleep", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineSleepParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "SleepResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "wake", + "publicOperation": "wake", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/wake", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineWakeParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "WakeResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "reboot", + "publicOperation": "reboot", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/reboot", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ { - "name": "cursor", + "name": "force", "required": false, "style": "form", "explode": false @@ -5654,7 +7429,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineListParams" + "publicName": "MachineRebootParams" }, "response": { "status": "200", @@ -5668,7 +7443,11 @@ ] }, "responseModel": { - "name": "machine_list", + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RebootResponseHeaders", "publicAliases": [] }, "result": { @@ -5676,6 +7455,7 @@ "errorStatuses": [ "401", "403", + "409", "429", "503", "default" @@ -5691,7 +7471,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -5702,7 +7486,26 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus409ResponseHeaders", + "publicAliases": [] + } }, { "status": "429", @@ -5713,7 +7516,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus429ResponseHeaders", + "publicAliases": [] + } }, { "status": "503", @@ -5724,7 +7531,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus503ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", @@ -5736,92 +7547,67 @@ "encoding": "json" } ], - "model": { - "name": "error_model", + "headersModel": { + "name": "RebootStatusdefaultResponseHeaders", "publicAliases": [] } } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "machine_list_item", - "publicAliases": [] - } - }, "transport": "http" }, { "resource": "machines", "publicResource": "machines", - "operation": "create", - "publicOperation": "create", + "operation": "resize", + "publicOperation": "resize", "deprecated": false, "method": "POST", - "path": "/v1/machines", - "pathParams": [], - "publicPathParams": [], + "path": "/v1/machines/{machine_id}/resize", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "autosleep", - "image_id", "memory_mib", - "storage_gib", "vcpu" ], "publicBodyParams": [ - "autosleep", - "image_id", "memory_mib", - "storage_gib", "vcpu" ], "bodyParamDetails": [ - { - "name": "autosleep", - "required": false - }, - { - "name": "image_id", - "required": false - }, { "name": "memory_mib", "required": false }, - { - "name": "storage_gib", - "required": false - }, { "name": "vcpu", "required": false } ], "publicPositionalParams": [], - "pathParamDetails": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineCreateParams" + "publicName": "MachineResizeParams" }, "requestBody": { "contentType": "application/json", @@ -5848,25 +7634,46 @@ ] }, "responseModel": { - "name": "machine", + "name": "machine_detail_response", "publicAliases": [] }, "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "ResizeResponseHeaders", "publicAliases": [] }, "result": { "successStatus": "200", "errorStatuses": [ + "400", "401", + "402", "403", + "404", "409", + "422", "429", + "500", "503", + "504", "default" ] }, "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus400ResponseHeaders", + "publicAliases": [] + } + }, { "status": "401", "contentType": "application/json", @@ -5878,7 +7685,22 @@ } ], "headersModel": { - "name": "CreateStatus401ResponseHeaders", + "name": "ResizeStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "402", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus402ResponseHeaders", "publicAliases": [] } }, @@ -5893,7 +7715,22 @@ } ], "headersModel": { - "name": "CreateStatus403ResponseHeaders", + "name": "ResizeStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus404ResponseHeaders", "publicAliases": [] } }, @@ -5908,7 +7745,22 @@ } ], "headersModel": { - "name": "CreateStatus409ResponseHeaders", + "name": "ResizeStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus422ResponseHeaders", "publicAliases": [] } }, @@ -5923,7 +7775,22 @@ } ], "headersModel": { - "name": "CreateStatus429ResponseHeaders", + "name": "ResizeStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus500ResponseHeaders", "publicAliases": [] } }, @@ -5938,26 +7805,41 @@ } ], "headersModel": { - "name": "CreateStatus503ResponseHeaders", + "name": "ResizeStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "504", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus504ResponseHeaders", "publicAliases": [] } }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] }, "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", + "name": "ResizeStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -5966,21 +7848,27 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "list", + "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}", + "path": "/v1/machines/{machine_id}/ssh", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [], - "publicQueryParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -5995,13 +7883,26 @@ "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRetrieveParams" + "publicName": "SshListParams" }, "response": { "status": "200", @@ -6015,11 +7916,7 @@ ] }, "responseModel": { - "name": "machine_detail_response", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "ssh_session_list", "publicAliases": [] }, "result": { @@ -6086,24 +7983,38 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "ssh_session", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "update", - "publicOperation": "update", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "create", + "publicOperation": "create", "deprecated": false, - "method": "PATCH", - "path": "/v1/machines/{machine_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/ssh", "pathParams": [ "machine_id" ], @@ -6115,21 +8026,15 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "autosleep", - "storage_gib" + "public_key" ], "publicBodyParams": [ - "autosleep", - "storage_gib" + "public_key" ], "bodyParamDetails": [ { - "name": "autosleep", - "required": false - }, - { - "name": "storage_gib", - "required": false + "name": "public_key", + "required": true } ], "publicPositionalParams": [], @@ -6147,7 +8052,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineUpdateParams" + "publicName": "SshCreateParams" }, "requestBody": { "contentType": "application/json", @@ -6174,11 +8079,11 @@ ] }, "responseModel": { - "name": "machine", + "name": "ssh_session", "publicAliases": [] }, "responseHeadersModel": { - "name": "UpdateResponseHeaders", + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -6204,7 +8109,7 @@ } ], "headersModel": { - "name": "UpdateStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", "publicAliases": [] } }, @@ -6219,7 +8124,7 @@ } ], "headersModel": { - "name": "UpdateStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", "publicAliases": [] } }, @@ -6234,7 +8139,7 @@ } ], "headersModel": { - "name": "UpdateStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", "publicAliases": [] } }, @@ -6249,7 +8154,7 @@ } ], "headersModel": { - "name": "UpdateStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", "publicAliases": [] } }, @@ -6264,7 +8169,7 @@ } ], "headersModel": { - "name": "UpdateStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", "publicAliases": [] } }, @@ -6278,12 +8183,8 @@ "encoding": "json" } ], - "model": { - "name": "error_model", - "publicAliases": [] - }, "headersModel": { - "name": "UpdateStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -6292,25 +8193,154 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "pathParams": [ + "machine_id", + "session_id" + ], + "publicPathParams": [ + "machine_id", + "session_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "session_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SshRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ssh_session", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.ssh", + "publicResource": "machines.ssh", "operation": "delete", "publicOperation": "delete", "deprecated": false, "method": "DELETE", - "path": "/v1/machines/{machine_id}", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", "pathParams": [ - "machine_id" + "machine_id", + "session_id" ], "publicPathParams": [ - "machine_id" - ], - "queryParams": [ - "force" - ], - "publicQueryParams": [ - "force" + "machine_id", + "session_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -6323,22 +8353,21 @@ "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ + }, { - "name": "force", - "required": false, - "style": "form", + "name": "session_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineDeleteParams" + "publicName": "SshDeleteParams" }, "response": { "status": "200", @@ -6352,11 +8381,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "DeleteResponseHeaders", + "name": "ssh_session", "publicAliases": [] }, "result": { @@ -6364,7 +8389,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6380,11 +8404,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6395,26 +8415,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "DeleteStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6425,11 +8426,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6440,11 +8437,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6455,36 +8448,34 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "DeleteStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "sleep", - "publicOperation": "sleep", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "list", + "publicOperation": "list", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/sleep", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [], - "publicQueryParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -6499,13 +8490,26 @@ "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineSleepParams" + "publicName": "ExecutionListParams" }, "response": { "status": "200", @@ -6519,11 +8523,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "SleepResponseHeaders", + "name": "execution_list", "publicAliases": [] }, "result": { @@ -6531,7 +8531,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6547,11 +8546,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6562,26 +8557,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "SleepStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6592,11 +8568,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6607,11 +8579,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6622,28 +8590,38 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "SleepStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "execution", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "wake", - "publicOperation": "wake", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "create", + "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/wake", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], @@ -6654,9 +8632,42 @@ "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "command", + "cwd", + "env", + "stdin", + "timeout_ms" + ], + "publicBodyParams": [ + "command", + "cwd", + "env", + "stdin", + "timeout_ms" + ], + "bodyParamDetails": [ + { + "name": "command", + "required": true + }, + { + "name": "cwd", + "required": false + }, + { + "name": "env", + "required": false + }, + { + "name": "stdin", + "required": false + }, + { + "name": "timeout_ms", + "required": false + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -6672,7 +8683,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineWakeParams" + "publicName": "ExecutionCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -6686,11 +8710,11 @@ ] }, "responseModel": { - "name": "machine", + "name": "execution", "publicAliases": [] }, "responseHeadersModel": { - "name": "WakeResponseHeaders", + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -6716,7 +8740,7 @@ } ], "headersModel": { - "name": "WakeStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", "publicAliases": [] } }, @@ -6731,7 +8755,7 @@ } ], "headersModel": { - "name": "WakeStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", "publicAliases": [] } }, @@ -6746,7 +8770,7 @@ } ], "headersModel": { - "name": "WakeStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", "publicAliases": [] } }, @@ -6761,7 +8785,7 @@ } ], "headersModel": { - "name": "WakeStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", "publicAliases": [] } }, @@ -6776,7 +8800,7 @@ } ], "headersModel": { - "name": "WakeStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", "publicAliases": [] } }, @@ -6790,12 +8814,8 @@ "encoding": "json" } ], - "model": { - "name": "error_model", - "publicAliases": [] - }, "headersModel": { - "name": "WakeStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -6803,26 +8823,24 @@ "responseLinks": [], "transport": "http" }, - { - "resource": "machines", - "publicResource": "machines", - "operation": "reboot", - "publicOperation": "reboot", + { + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/reboot", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" - ], - "queryParams": [ - "force" - ], - "publicQueryParams": [ - "force" + "machine_id", + "execution_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -6835,22 +8853,21 @@ "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ + }, { - "name": "force", - "required": false, - "style": "form", + "name": "execution_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRebootParams" + "publicName": "ExecutionRetrieveParams" }, "response": { "status": "200", @@ -6864,11 +8881,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RebootResponseHeaders", + "name": "execution", "publicAliases": [] }, "result": { @@ -6876,7 +8889,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6892,11 +8904,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6907,26 +8915,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "RebootStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6937,11 +8926,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6952,11 +8937,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6967,56 +8948,35 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "RebootStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "resize", - "publicOperation": "resize", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/resize", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "memory_mib", - "vcpu" - ], - "publicBodyParams": [ - "memory_mib", - "vcpu" - ], - "bodyParamDetails": [ - { - "name": "memory_mib", - "required": false - }, - { - "name": "vcpu", - "required": false - } - ], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], "publicPositionalParams": [], "pathParamDetails": [ { @@ -7024,6 +8984,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -7032,20 +8998,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineResizeParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "ExecutionDeleteParams" }, "response": { "status": "200", @@ -7059,46 +9012,20 @@ ] }, "responseModel": { - "name": "machine_detail_response", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "ResizeResponseHeaders", + "name": "execution", "publicAliases": [] }, "result": { "successStatus": "200", "errorStatuses": [ - "400", "401", - "402", "403", - "404", - "409", - "422", "429", - "500", "503", - "504", "default" ] }, "errorResponses": [ - { - "status": "400", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus400ResponseHeaders", - "publicAliases": [] - } - }, { "status": "401", "contentType": "application/json", @@ -7108,14 +9035,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "402", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7123,14 +9046,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus402ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "403", + "status": "429", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7138,14 +9057,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus403ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "404", + "status": "503", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7153,44 +9068,97 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus404ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "409", - "contentType": "application/json", + "status": "default", + "contentType": "application/problem+json", "encoding": "json", "contents": [ { - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus409ResponseHeaders", - "publicAliases": [] - } + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "output", + "publicOperation": "output", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", + "pathParams": [ + "machine_id", + "execution_id" + ], + "publicPathParams": [ + "machine_id", + "execution_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false }, { - "status": "422", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus422ResponseHeaders", - "publicAliases": [] + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ExecutionOutputParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" } - }, + ] + }, + "responseModel": { + "name": "execution_output", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ { - "status": "429", + "status": "401", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7198,14 +9166,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "500", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7213,14 +9177,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus500ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "503", + "status": "429", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7228,14 +9188,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "504", + "status": "503", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7243,48 +9199,38 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus504ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json", "contents": [ { - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error", - "publicAliases": [] - }, - "headersModel": { - "name": "ResizeStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "list", - "publicOperation": "list", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "events", + "publicOperation": "events", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [ "limit", @@ -7306,6 +9252,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [ @@ -7327,7 +9279,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshListParams" + "publicName": "ExecutionEventsParams" }, "response": { "status": "200", @@ -7341,7 +9293,7 @@ ] }, "responseModel": { - "name": "ssh_session_list", + "name": "execution_events", "publicAliases": [] }, "result": { @@ -7408,64 +9360,164 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] + ] + } + ], + "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "execution_event", + "publicAliases": [] + } + }, + "transport": "http" + }, + { + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", + "pathParams": [ + "machine_id", + "execution_id" + ], + "publicPathParams": [ + "machine_id", + "execution_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LogRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" } + ] + }, + "responseModel": { + "name": "status", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RetrieveResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "ssh_session", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "create", - "publicOperation": "create", + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "createToken", + "publicOperation": "createToken", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/ssh", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "public_key" - ], - "publicBodyParams": [ - "public_key" - ], - "bodyParamDetails": [ - { - "name": "public_key", - "required": true - } - ], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], "publicPositionalParams": [], "pathParamDetails": [ { @@ -7473,6 +9525,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -7481,20 +9539,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshCreateParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "LogCreateTokenParams" }, "response": { "status": "200", @@ -7508,11 +9553,11 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "read_token", "publicAliases": [] }, "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "CreateTokenResponseHeaders", "publicAliases": [] }, "result": { @@ -7520,9 +9565,6 @@ "errorStatuses": [ "401", "403", - "409", - "429", - "503", "default" ] }, @@ -7536,11 +9578,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -7551,56 +9589,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus409ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus429ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -7611,35 +9600,25 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ - "machine_id", - "session_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "session_id" + "machine_id" ], "queryParams": [], "publicQueryParams": [], @@ -7655,12 +9634,6 @@ "required": true, "style": "simple", "explode": false - }, - { - "name": "session_id", - "required": true, - "style": "simple", - "explode": false } ], "queryParamDetails": [], @@ -7669,7 +9642,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshRetrieveParams" + "publicName": "AutoresizingRetrieveParams" }, "response": { "status": "200", @@ -7683,7 +9656,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "policy", "publicAliases": [] }, "result": { @@ -7691,8 +9664,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -7719,28 +9690,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -7750,39 +9699,60 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "method": "PATCH", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ - "machine_id", - "session_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "session_id" + "machine_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "publicBodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "bodyParamDetails": [ + { + "name": "cpu", + "required": false + }, + { + "name": "cpu_max_vcpu", + "required": false + }, + { + "name": "memory", + "required": false + }, + { + "name": "memory_max_mib", + "required": false + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -7790,12 +9760,6 @@ "required": true, "style": "simple", "explode": false - }, - { - "name": "session_id", - "required": true, - "style": "simple", - "explode": false } ], "queryParamDetails": [], @@ -7804,7 +9768,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshDeleteParams" + "publicName": "AutoresizingUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -7818,7 +9795,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "policy", "publicAliases": [] }, "result": { @@ -7826,8 +9803,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -7854,28 +9829,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -7885,24 +9838,20 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", + "resource": "machines.ports", + "publicResource": "machines.ports", "operation": "list", "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions", + "path": "/v1/machines/{machine_id}/ports", "pathParams": [ "machine_id" ], @@ -7950,7 +9899,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionListParams" + "publicName": "PortListParams" }, "response": { "status": "200", @@ -7964,7 +9913,7 @@ ] }, "responseModel": { - "name": "execution_list", + "name": "port_list", "publicAliases": [] }, "result": { @@ -8031,11 +9980,7 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], @@ -8053,20 +9998,20 @@ "requestLocation": "query", "responseLocation": "body", "itemModel": { - "name": "execution", + "name": "port", "publicAliases": [] } }, "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", + "resource": "machines.ports", + "publicResource": "machines.ports", "operation": "create", "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/executions", + "path": "/v1/machines/{machine_id}/ports", "pathParams": [ "machine_id" ], @@ -8078,38 +10023,32 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" + "expires", + "port", + "protocol", + "visibility" ], "publicBodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" + "expires", + "port", + "protocol", + "visibility" ], "bodyParamDetails": [ { - "name": "command", - "required": true - }, - { - "name": "cwd", + "name": "expires", "required": false }, { - "name": "env", - "required": false + "name": "port", + "required": true }, { - "name": "stdin", + "name": "protocol", "required": false }, { - "name": "timeout_ms", + "name": "visibility", "required": false } ], @@ -8128,7 +10067,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionCreateParams" + "publicName": "PortCreateParams" }, "requestBody": { "contentType": "application/json", @@ -8155,7 +10094,7 @@ ] }, "responseModel": { - "name": "execution", + "name": "port", "publicAliases": [] }, "responseHeadersModel": { @@ -8259,10 +10198,6 @@ "encoding": "json" } ], - "model": { - "name": "error_model", - "publicAliases": [] - }, "headersModel": { "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] @@ -8273,20 +10208,20 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", + "resource": "machines.ports", + "publicResource": "machines.ports", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" ], "queryParams": [], "publicQueryParams": [], @@ -8304,7 +10239,7 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false @@ -8316,7 +10251,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionRetrieveParams" + "publicName": "PortRetrieveParams" }, "response": { "status": "200", @@ -8330,7 +10265,7 @@ ] }, "responseModel": { - "name": "execution", + "name": "port", "publicAliases": [] }, "result": { @@ -8397,39 +10332,44 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "method": "PATCH", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "visibility" + ], + "publicBodyParams": [ + "visibility" + ], + "bodyParamDetails": [ + { + "name": "visibility", + "required": true + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -8439,7 +10379,7 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false @@ -8451,10 +10391,9 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionDeleteParams" + "publicName": "PortUpdateParams" }, - "response": { - "status": "200", + "requestBody": { "contentType": "application/json", "encoding": "json", "contents": [ @@ -8462,131 +10401,10 @@ "contentType": "application/json", "encoding": "json" } - ] - }, - "responseModel": { - "name": "execution", - "publicAliases": [] - }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "429", - "503", - "default" - ] - }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "default", - "contentType": "application/problem+json", - "encoding": "json", - "contents": [ - { - "contentType": "application/problem+json", - "encoding": "json" - } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } - } - ], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "output", - "publicOperation": "output", - "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false - }, - { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "ExecutionOutputParams" + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -8600,7 +10418,7 @@ ] }, "responseModel": { - "name": "execution_output", + "name": "port", "publicAliases": [] }, "result": { @@ -8608,6 +10426,7 @@ "errorStatuses": [ "401", "403", + "409", "429", "503", "default" @@ -8615,7 +10434,18 @@ }, "errorResponses": [ { - "status": "401", + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -8626,7 +10456,7 @@ ] }, { - "status": "403", + "status": "409", "contentType": "application/json", "encoding": "json", "contents": [ @@ -8667,40 +10497,30 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "events", - "publicOperation": "events", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" - ], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" + "port_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -8715,32 +10535,19 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false } ], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false - }, - { - "name": "cursor", - "required": false, - "style": "form", - "explode": false - } - ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionEventsParams" + "publicName": "PortDeleteParams" }, "response": { "status": "200", @@ -8754,7 +10561,7 @@ ] }, "responseModel": { - "name": "execution_events", + "name": "port", "publicAliases": [] }, "result": { @@ -8821,52 +10628,36 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "execution_event", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "list", + "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" + ], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" ], - "queryParams": [], - "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -8881,19 +10672,32 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogRetrieveParams" + "publicName": "AccessKeyListParams" }, "response": { "status": "200", @@ -8907,11 +10711,7 @@ ] }, "responseModel": { - "name": "status", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "port_access_key_list_response", "publicAliases": [] }, "result": { @@ -8954,39 +10754,44 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "createToken", - "publicOperation": "createToken", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "mint", + "publicOperation": "mint", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "expires_in" + ], + "publicBodyParams": [ + "expires_in" + ], + "bodyParamDetails": [ + { + "name": "expires_in", + "required": true + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -8996,7 +10801,7 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false @@ -9008,7 +10813,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogCreateTokenParams" + "publicName": "AccessKeyMintParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -9022,11 +10840,7 @@ ] }, "responseModel": { - "name": "read_token", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "CreateTokenResponseHeaders", + "name": "mint_port_access_key_response", "publicAliases": [] }, "result": { @@ -9069,29 +10883,29 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "revoke", + "publicOperation": "revoke", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/autoresizing", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", "pathParams": [ - "machine_id" + "machine_id", + "port_id", + "access_key_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "port_id", + "access_key_id" ], "queryParams": [], "publicQueryParams": [], @@ -9107,6 +10921,18 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "port_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "access_key_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -9115,7 +10941,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingRetrieveParams" + "publicName": "AccessKeyRevokeParams" }, "response": { "status": "200", @@ -9129,7 +10955,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "port_access_key_response", "publicAliases": [] }, "result": { @@ -9172,62 +10998,44 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", - "operation": "update", - "publicOperation": "update", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "rotate", + "publicOperation": "rotate", "deprecated": false, - "method": "PATCH", - "path": "/v1/machines/{machine_id}/autoresizing", + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", "pathParams": [ - "machine_id" + "machine_id", + "port_id", + "access_key_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "port_id", + "access_key_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "expires_in" ], "publicBodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "expires_in" ], "bodyParamDetails": [ { - "name": "cpu", - "required": false - }, - { - "name": "cpu_max_vcpu", - "required": false - }, - { - "name": "memory", - "required": false - }, - { - "name": "memory_max_mib", - "required": false + "name": "expires_in", + "required": true } ], "publicPositionalParams": [], @@ -9237,6 +11045,18 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "port_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "access_key_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -9245,7 +11065,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingUpdateParams" + "publicName": "AccessKeyRotateParams" }, "requestBody": { "contentType": "application/json", @@ -9272,7 +11092,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "mint_port_access_key_response", "publicAliases": [] }, "result": { @@ -9315,11 +11135,7 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], @@ -9404,11 +11220,7 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], @@ -9536,11 +11348,7 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], diff --git a/src/dedalus_sdk/_base_client.py b/src/dedalus_sdk/_base_client.py index 15f5274..debbd1a 100644 --- a/src/dedalus_sdk/_base_client.py +++ b/src/dedalus_sdk/_base_client.py @@ -3,7 +3,6 @@ import sys import json import time -import uuid import zlib import email import asyncio @@ -12,6 +11,7 @@ import platform import warnings import email.utils +from urllib.parse import urlencode from types import TracebackType from random import random from dataclasses import field, dataclass @@ -44,7 +44,7 @@ from . import _exceptions from ._qs import Querystring from ._decoding import CodingRefused, BoundedDecoder, decoding_error -from ._files import to_httpx_files, async_to_httpx_files +from ._files import to_httpx_files, read_form_files, async_to_httpx_files, async_read_form_files from ._types import ( Body, Omit, @@ -320,6 +320,59 @@ def _merge_set_cookies(headers: httpx.Headers, response: httpx.Response, target: headers["Cookie"] = "; ".join(pairs.values()) +_FORM_URLENCODED = "application/x-www-form-urlencoded" + + +def _is_form_urlencoded(content_type: object) -> bool: + """Whether a `Content-Type` names the form media type, in any casing and with any parameters.""" + return isinstance(content_type, str) and content_type.split(";", 1)[0].strip().lower() == _FORM_URLENCODED + + +def _options_content_type(options: FinalRequestOptions) -> str | None: + """The `Content-Type` a request's own headers set, matched case-insensitively, if any. + + The last match wins, as it does when `_build_request` collapses duplicate entries, so both agree + on whether a request is a form. + """ + if not is_given(options.headers): + return None + content_type: str | None = None + for name, value in options.headers.items(): + if name.lower() == "content-type" and isinstance(value, str): + content_type = value + return content_type + + +def _form_text(value: object, array_format: str) -> object: + """A form body prepared for the query encoder. + + Each bytes value is decoded with `surrogateescape`: `Querystring` renders a leaf with `str()`, + which spells bytes as `b'...'`, and encoding the pairs back with the same error handler keeps + every byte as it was. An empty list is dropped, since `comma` would otherwise send `key=`, which a + server reads as one empty element. Under `comma` a list holding objects or lists is refused: the + format joins items with `str()`, so they would go out as Python repr. + """ + if isinstance(value, (bytes, bytearray)): + return bytes(value).decode("utf-8", "surrogateescape") + if is_mapping(value): + return { + key: _form_text(item, array_format) + for key, item in value.items() + if not ((is_list(item) or isinstance(item, tuple)) and len(cast("list[object]", item)) == 0) + } + if is_list(value) or isinstance(value, tuple): + items = cast("list[object]", value) + if array_format == "comma" and any( + is_mapping(item) or is_list(item) or isinstance(item, tuple) for item in items + ): + raise TypeError( + "A list of objects or lists cannot be sent in a form body under `arrayFormat: comma`;" + " use `brackets`, `indices` or `repeat`." + ) + return [_form_text(item, array_format) for item in items] + return value + + def _describe_body(value: object) -> str: """A request body as the debug log shows it: its shape and size, never its values. @@ -1151,9 +1204,33 @@ def _build_request( params = _merge_mappings({**self._auth_query(options.security), **self.default_query}, options.params) cookies = self._auth_cookies(options.security) headers = self._build_headers(options, retries_taken=retries_taken, params=params, cookies=cookies) + content_types = headers.get_list("Content-Type") + if len(content_types) > 1: + # A `Content-Type` spelled in another casing than an earlier one is a second entry rather + # than a replacement, and two entries would join into a value neither encoder recognizes. + # The request's own headers (the method's, then the caller's `extra_headers`) win over a + # client-wide default, the same value `request()` read file fields for. + own_content_type = _options_content_type(options) + headers["Content-Type"] = own_content_type if own_content_type is not None else content_types[-1] content_type = headers.get("Content-Type") files = options.files + # A body under the form media type, in any casing, goes out encoded the way the query string + # is, through the client's own `qs`. A string or bytes body is a form already encoded and is + # sent as it is. + if _is_form_urlencoded(content_type) and json_data is not None and is_given(json_data): + if files: + # httpx sends `content` and drops `files` silently, so file parts would never arrive + raise TypeError("A form-urlencoded request body cannot carry multipart files") + if isinstance(json_data, str): + json_data = json_data.encode("utf-8") + elif not isinstance(json_data, bytes): + if not is_mapping(json_data): + raise TypeError( + f"Expected a mapping for a form-urlencoded request body but got {type(json_data)} instead." + ) + json_data = self._serialize_form_urlencoded(json_data) + # If the given Content-Type header is multipart/form-data then it # has to be removed so that httpx can generate the header with # additional information for us as it has to be in this form @@ -1227,12 +1304,29 @@ def _build_request( **kwargs, ) + def _serialize_form_urlencoded(self, data: Mapping[str, object]) -> bytes: + """Encodes a form-urlencoded body exactly as the query string is encoded. + + Lists follow the client's `array_format` and object keys its `nested_format`, and a boolean + goes out as `true` / `false`, all from `self.qs`. A space is written `+`, the form convention. + An empty string goes out as `key=`, which the query string drops, so a field can be cleared; + only `None` is left out. + A bytes value (a file field's contents, by now) is decoded with `surrogateescape` and encoded + back the same way, so bytes that are not UTF-8 reach the wire unchanged rather than as the + `b'...'` spelling `str()` would give them. + """ + qs = self.qs + items = qs.stringify_items(cast(Mapping[str, Any], _form_text(data, qs.array_format)), keep_empty=True) + return urlencode(items, encoding="utf-8", errors="surrogateescape").encode("ascii") + def _serialize_multipartform(self, data: Mapping[object, object]) -> dict[str, object]: items = self.qs.stringify_items( # TODO: type ignore is required as stringify_items is well typed but we can't be # well typed without heavy validation. data, # type: ignore array_format="brackets", + # multipart part names keep their bracketed form whatever the query string's nesting is + nested_format="brackets", ) serialized: dict[str, object] = {} for key, value in items: @@ -1348,7 +1442,9 @@ def _validate_headers( @property def user_agent(self) -> str: - return f"{self.__class__.__name__}/Python {self._version}" + # A literal rather than `self.__class__.__name__`, so the sync and async clients send the + # same product and a subclass cannot change it. + return f"Dedalus/Python {self._version}" @property def base_url(self) -> URL: @@ -1458,10 +1554,9 @@ def _should_retry(self, response: httpx.Response) -> bool: return False def _idempotency_key(self) -> str: - # @custom start - # The API requires a compact UUIDv7; retries reuse this generated key. - return f"{time.time_ns() // 1_000_000:012x}7{uuid.uuid4().hex[13:]}" - # @custom end + from ._uuid7 import uuid7 + + return uuid7().hex class _DefaultHttpxClient(httpx.Client): @@ -1679,6 +1774,10 @@ def request( if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests input_options.idempotency_key = self._idempotency_key() + if _is_form_urlencoded(_options_content_type(input_options)): + # read file fields once, so every attempt sends the same contents + input_options.json_data = read_form_files(input_options.json_data) + input_options.extra_json = read_form_files(input_options.extra_json) response: httpx.Response | None = None max_retries = input_options.get_max_retries(self.max_retries) @@ -2318,6 +2417,10 @@ async def request( if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests input_options.idempotency_key = self._idempotency_key() + if _is_form_urlencoded(_options_content_type(input_options)): + # read file fields once, so every attempt sends the same contents + input_options.json_data = await async_read_form_files(input_options.json_data) + input_options.extra_json = await async_read_form_files(input_options.extra_json) response: httpx.Response | None = None max_retries = input_options.get_max_retries(self.max_retries) diff --git a/src/dedalus_sdk/_files.py b/src/dedalus_sdk/_files.py index 76da9e0..78be667 100644 --- a/src/dedalus_sdk/_files.py +++ b/src/dedalus_sdk/_files.py @@ -2,6 +2,7 @@ import io import os +import inspect import pathlib from typing import Sequence, cast, overload from typing_extensions import TypeVar, TypeGuard @@ -125,6 +126,100 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent: return file +def _is_form_file(obj: object) -> bool: + """Whether a value in a form-urlencoded body is a file whose contents the field carries. + + Bytes, a file object and a path are files. A file object is anything with a callable `read`, not + only an `io.IOBase`: `IO[bytes]` admits wrappers that are not one (`SpooledTemporaryFile` before + Python 3.11, framework upload objects, whose `read()` may be async), and an unrecognized one + would reach the query encoder's `str()` and go out as its repr. A tuple is one only in the `(filename, content, ...)` shape + `FileTypes` allows, so a tuple of strings stays the list the query encoder reads it as. + """ + if _is_form_file_content(obj): + return True + return ( + isinstance(obj, tuple) + and 2 <= len(cast("tuple[object, ...]", obj)) <= 4 + and (obj[0] is None or isinstance(obj[0], str)) + and _is_form_file_content(obj[1]) + ) + + +def _is_form_file_content(obj: object) -> bool: + """Whether a value is file content: bytes, a path, or an object with a callable `read`.""" + return isinstance(obj, (bytes, bytearray, os.PathLike)) or callable(getattr(obj, "read", None)) + + +def _form_file_source(obj: object) -> object: + """The content half of a form file value: the tuple's second item, or the value itself.""" + return cast("tuple[object, ...]", obj)[1] if isinstance(obj, tuple) else obj + + +def _checked_form_contents(source: object, contents: object) -> object: + """A file object's `read()` result, refused unless it is bytes or text. + + Anything else would reach the query encoder's `str()` and go out as its repr. + """ + if isinstance(contents, (bytes, bytearray, str)): + return contents + raise TypeError(f"Expected {type(source).__name__}.read() to return bytes or str but got {type(contents)} instead.") + + +def read_form_files(data: _T) -> _T: + """Returns a form-urlencoded body with every file value replaced by its contents. + + A form has no file parts, so a file field goes out as its contents, the way a string field would. + A file object is read whole from its current position and a path from the start, with no size + bound, which suits form fields but not large files; those belong in a multipart body. It runs + once per call rather than per attempt, so a retry resends the same bytes instead of an exhausted + file object's empty read. Every container is copied, so the caller's own body is left as it was. + """ + if _is_form_file(data): + source = _form_file_source(data) + if isinstance(source, os.PathLike): + return cast(_T, pathlib.Path(cast("os.PathLike[str]", source)).read_bytes()) + if isinstance(source, (bytes, bytearray)): + return cast(_T, bytes(source)) + contents: object = cast("io.BufferedIOBase", source).read() + if inspect.isawaitable(contents): + # an async `read()` (an ASGI upload object) cannot be awaited here; close it unawaited + # rather than leave a warning, and point the caller at the client that can + if inspect.iscoroutine(contents): + contents.close() + raise TypeError( + f"{type(source).__name__}.read() is asynchronous; send it through the async client, or pass its bytes" + ) + return cast(_T, _checked_form_contents(source, contents)) + if is_mapping(data): + return cast(_T, {key: read_form_files(value) for key, value in data.items()}) + if is_list(data) or isinstance(data, tuple): + return cast(_T, [read_form_files(item) for item in cast("Sequence[object]", data)]) + return data + + +async def async_read_form_files(data: _T) -> _T: + """`read_form_files` for an async client. + + It reads a path without blocking the event loop, and awaits a file object whose `read()` is + asynchronous, as an ASGI framework's upload object's is. + """ + if _is_form_file(data): + source = _form_file_source(data) + if isinstance(source, os.PathLike): + return cast(_T, await anyio.Path(cast("os.PathLike[str]", source)).read_bytes()) + if isinstance(source, (bytes, bytearray)): + return cast(_T, bytes(source)) + contents: object = cast("io.BufferedIOBase", source).read() + if inspect.isawaitable(contents): + contents = await contents + return cast(_T, _checked_form_contents(source, contents)) + if is_mapping(data): + return cast(_T, {key: await async_read_form_files(value) for key, value in data.items()}) + if is_list(data) or isinstance(data, tuple): + return cast(_T, [await async_read_form_files(item) for item in cast("Sequence[object]", data)]) + return data + + def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T: """Copy only the containers along the given paths. diff --git a/src/dedalus_sdk/_qs.py b/src/dedalus_sdk/_qs.py index 7ab0802..ab59278 100644 --- a/src/dedalus_sdk/_qs.py +++ b/src/dedalus_sdk/_qs.py @@ -54,11 +54,19 @@ def stringify_items( *, array_format: ArrayFormat | NotGiven = not_given, nested_format: NestedFormat | NotGiven = not_given, + keep_empty: bool = False, ) -> list[tuple[str, str]]: + """Flattens params into `(key, value)` pairs. + + An empty-string value is dropped unless `keep_empty` is set: a query string has always left + it out, while a form body sends it as `key=` so a field can be cleared. `None` is always + dropped. + """ opts = Options( qs=self, array_format=array_format, nested_format=nested_format, + keep_empty=keep_empty, ) return flatten([self._stringify_item(key, value, opts) for key, value in params.items()]) @@ -113,7 +121,7 @@ def _stringify_item( ) serialised = self._primitive_value_to_str(value) - if not serialised: + if not serialised and (value is None or not opts.keep_empty): return [] return [(key, serialised)] @@ -135,6 +143,7 @@ def _primitive_value_to_str(self, value: PrimitiveData) -> str: class Options: array_format: ArrayFormat nested_format: NestedFormat + keep_empty: bool def __init__( self, @@ -142,6 +151,8 @@ def __init__( *, array_format: ArrayFormat | NotGiven = not_given, nested_format: NestedFormat | NotGiven = not_given, + keep_empty: bool = False, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format + self.keep_empty = keep_empty diff --git a/src/dedalus_sdk/_utils/__init__.py b/src/dedalus_sdk/_utils/__init__.py index 1c090e5..6c85837 100644 --- a/src/dedalus_sdk/_utils/__init__.py +++ b/src/dedalus_sdk/_utils/__init__.py @@ -29,6 +29,7 @@ get_required_header as get_required_header, maybe_coerce_boolean as maybe_coerce_boolean, maybe_coerce_integer as maybe_coerce_integer, + merge_default_headers as merge_default_headers, ) from ._compat import ( get_args as get_args, diff --git a/src/dedalus_sdk/_utils/_utils.py b/src/dedalus_sdk/_utils/_utils.py index 1af7aca..f16ce76 100644 --- a/src/dedalus_sdk/_utils/_utils.py +++ b/src/dedalus_sdk/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike +from .._types import Omit, Headers, NotGiven, FileTypes, ArrayFormat, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -320,6 +320,20 @@ def strip_not_given(obj: object | None) -> object: return {key: value for key, value in obj.items() if not isinstance(value, NotGiven)} +def merge_default_headers(defaults: Mapping[str, str], headers: Headers | None) -> dict[str, str | Omit]: + """Merge an operation's configured default headers under `headers`, which win per header name. + + Header names are case-insensitive, and `httpx.Headers` keeps every spelling it is handed, so a + default is dropped whenever `headers` already names that header in any casing. A plain dict merge + would send both `x-beta: ` and the caller's `X-Beta: `. + """ + named = {name.lower() for name in headers} if headers else set() + merged: dict[str, str | Omit] = {name: value for name, value in defaults.items() if name.lower() not in named} + if headers: + merged.update(headers) + return merged + + def coerce_integer(val: str) -> int: return int(val, base=10) diff --git a/src/dedalus_sdk/_uuid7.py b/src/dedalus_sdk/_uuid7.py new file mode 100644 index 0000000..494be86 --- /dev/null +++ b/src/dedalus_sdk/_uuid7.py @@ -0,0 +1,21 @@ +"""Time-ordered (version 7) UUIDs for idempotency keys. + +The standard library gains `uuid.uuid7` only in Python 3.14, and the SDK supports older versions +without a third-party dependency, so this module builds one by hand per RFC 9562. +""" + +from __future__ import annotations + +import os +import time +import uuid + + +def uuid7() -> uuid.UUID: + """A version 7 UUID: a 48-bit Unix millisecond timestamp, then version and variant bits, the rest random.""" + value = bytearray(os.urandom(16)) + # Clamped, because `to_bytes` rejects a negative int: a clock set before 1970 writes a zero timestamp. + value[0:6] = max(0, time.time_ns() // 1_000_000).to_bytes(6, "big") + value[6] = (value[6] & 0x0F) | 0x70 + value[8] = (value[8] & 0x3F) | 0x80 + return uuid.UUID(bytes=bytes(value)) diff --git a/src/dedalus_sdk/_version.py b/src/dedalus_sdk/_version.py index 7f9557a..9544f24 100644 --- a/src/dedalus_sdk/_version.py +++ b/src/dedalus_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Scalar. See README.md for details. __title__ = "dedalus" -__version__ = "0.7.0" # x-release-please-version +__version__ = "0.8.0" # x-release-please-version diff --git a/src/dedalus_sdk/resources/images/images.py b/src/dedalus_sdk/resources/images/images.py index 0bc5072..b6b6c41 100644 --- a/src/dedalus_sdk/resources/images/images.py +++ b/src/dedalus_sdk/resources/images/images.py @@ -60,7 +60,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImageList: """ - Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. + Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. Args: limit: Query parameter. @@ -75,7 +75,7 @@ def list( Example: ```python - image = client.images.list( + images = client.images.list( limit=100, ) ``` @@ -325,7 +325,7 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImageList: """ - Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. + Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. Args: limit: Query parameter. @@ -340,7 +340,7 @@ async def list( Example: ```python - image = await client.images.list( + images = await client.images.list( limit=100, ) ``` diff --git a/src/dedalus_sdk/resources/machines/__init__.py b/src/dedalus_sdk/resources/machines/__init__.py index ec0b2de..f0e6b57 100644 --- a/src/dedalus_sdk/resources/machines/__init__.py +++ b/src/dedalus_sdk/resources/machines/__init__.py @@ -32,6 +32,14 @@ AutoresizingResourceWithStreamingResponse, AsyncAutoresizingResourceWithStreamingResponse, ) +from .ports import ( + PortsResource, + AsyncPortsResource, + PortsResourceWithRawResponse, + AsyncPortsResourceWithRawResponse, + PortsResourceWithStreamingResponse, + AsyncPortsResourceWithStreamingResponse, +) __all__ = [ "MachinesResource", @@ -58,4 +66,10 @@ "AsyncAutoresizingResourceWithRawResponse", "AutoresizingResourceWithStreamingResponse", "AsyncAutoresizingResourceWithStreamingResponse", + "PortsResource", + "AsyncPortsResource", + "PortsResourceWithRawResponse", + "AsyncPortsResourceWithRawResponse", + "PortsResourceWithStreamingResponse", + "AsyncPortsResourceWithStreamingResponse", ] diff --git a/src/dedalus_sdk/resources/machines/executions/executions.py b/src/dedalus_sdk/resources/machines/executions/executions.py index 6cd4a28..cf82187 100644 --- a/src/dedalus_sdk/resources/machines/executions/executions.py +++ b/src/dedalus_sdk/resources/machines/executions/executions.py @@ -121,7 +121,7 @@ def create( Args: machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. - command: Body parameter. + command: Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""]. cwd: Body parameter. env: Body parameter. stdin: Body parameter. @@ -470,7 +470,7 @@ async def create( Args: machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. - command: Body parameter. + command: Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""]. cwd: Body parameter. env: Body parameter. stdin: Body parameter. diff --git a/src/dedalus_sdk/resources/machines/machines.py b/src/dedalus_sdk/resources/machines/machines.py index 98b7e4c..9ff9d76 100644 --- a/src/dedalus_sdk/resources/machines/machines.py +++ b/src/dedalus_sdk/resources/machines/machines.py @@ -40,6 +40,14 @@ AutoresizingResourceWithStreamingResponse, AsyncAutoresizingResourceWithStreamingResponse, ) +from .ports import ( + PortsResource, + AsyncPortsResource, + PortsResourceWithRawResponse, + AsyncPortsResourceWithRawResponse, + PortsResourceWithStreamingResponse, + AsyncPortsResourceWithStreamingResponse, +) from ...types import ( machine_list_params, machine_create_params, @@ -69,6 +77,10 @@ def executions(self) -> ExecutionsResource: def autoresizing(self) -> AutoresizingResource: return AutoresizingResource(self._client) + @cached_property + def ports(self) -> PortsResource: + return PortsResource(self._client) + @cached_property def with_raw_response(self) -> MachinesResourceWithRawResponse: return MachinesResourceWithRawResponse(self) @@ -560,6 +572,10 @@ def executions(self) -> AsyncExecutionsResource: def autoresizing(self) -> AsyncAutoresizingResource: return AsyncAutoresizingResource(self._client) + @cached_property + def ports(self) -> AsyncPortsResource: + return AsyncPortsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncMachinesResourceWithRawResponse: return AsyncMachinesResourceWithRawResponse(self) @@ -1082,6 +1098,10 @@ def executions(self) -> ExecutionsResourceWithRawResponse: def autoresizing(self) -> AutoresizingResourceWithRawResponse: return AutoresizingResourceWithRawResponse(self._machines.autoresizing) + @cached_property + def ports(self) -> PortsResourceWithRawResponse: + return PortsResourceWithRawResponse(self._machines.ports) + class AsyncMachinesResourceWithRawResponse: def __init__(self, machines: AsyncMachinesResource) -> None: @@ -1127,6 +1147,10 @@ def executions(self) -> AsyncExecutionsResourceWithRawResponse: def autoresizing(self) -> AsyncAutoresizingResourceWithRawResponse: return AsyncAutoresizingResourceWithRawResponse(self._machines.autoresizing) + @cached_property + def ports(self) -> AsyncPortsResourceWithRawResponse: + return AsyncPortsResourceWithRawResponse(self._machines.ports) + class MachinesResourceWithStreamingResponse: def __init__(self, machines: MachinesResource) -> None: @@ -1172,6 +1196,10 @@ def executions(self) -> ExecutionsResourceWithStreamingResponse: def autoresizing(self) -> AutoresizingResourceWithStreamingResponse: return AutoresizingResourceWithStreamingResponse(self._machines.autoresizing) + @cached_property + def ports(self) -> PortsResourceWithStreamingResponse: + return PortsResourceWithStreamingResponse(self._machines.ports) + class AsyncMachinesResourceWithStreamingResponse: def __init__(self, machines: AsyncMachinesResource) -> None: @@ -1216,3 +1244,7 @@ def executions(self) -> AsyncExecutionsResourceWithStreamingResponse: @cached_property def autoresizing(self) -> AsyncAutoresizingResourceWithStreamingResponse: return AsyncAutoresizingResourceWithStreamingResponse(self._machines.autoresizing) + + @cached_property + def ports(self) -> AsyncPortsResourceWithStreamingResponse: + return AsyncPortsResourceWithStreamingResponse(self._machines.ports) diff --git a/src/dedalus_sdk/resources/machines/ports/__init__.py b/src/dedalus_sdk/resources/machines/ports/__init__.py new file mode 100644 index 0000000..09fd995 --- /dev/null +++ b/src/dedalus_sdk/resources/machines/ports/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from .ports import ( + PortsResource, + AsyncPortsResource, + PortsResourceWithRawResponse, + AsyncPortsResourceWithRawResponse, + PortsResourceWithStreamingResponse, + AsyncPortsResourceWithStreamingResponse, +) +from .access_keys import ( + AccessKeysResource, + AsyncAccessKeysResource, + AccessKeysResourceWithRawResponse, + AsyncAccessKeysResourceWithRawResponse, + AccessKeysResourceWithStreamingResponse, + AsyncAccessKeysResourceWithStreamingResponse, +) + +__all__ = [ + "PortsResource", + "AsyncPortsResource", + "PortsResourceWithRawResponse", + "AsyncPortsResourceWithRawResponse", + "PortsResourceWithStreamingResponse", + "AsyncPortsResourceWithStreamingResponse", + "AccessKeysResource", + "AsyncAccessKeysResource", + "AccessKeysResourceWithRawResponse", + "AsyncAccessKeysResourceWithRawResponse", + "AccessKeysResourceWithStreamingResponse", + "AsyncAccessKeysResourceWithStreamingResponse", +] diff --git a/src/dedalus_sdk/resources/machines/ports/access_keys.py b/src/dedalus_sdk/resources/machines/ports/access_keys.py new file mode 100644 index 0000000..15f2d1a --- /dev/null +++ b/src/dedalus_sdk/resources/machines/ports/access_keys.py @@ -0,0 +1,616 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from ....types.machines.ports.access_key_list_response import AccessKeyListResponse +from ....types.machines.ports import access_key_list_params, access_key_mint_params, access_key_rotate_params +from ....types.machines.ports.access_key_mint_response import AccessKeyMintResponse +from ....types.machines.ports.access_key_revoke_response import AccessKeyRevokeResponse +from ....types.machines.ports.access_key_rotate_response import AccessKeyRotateResponse + +__all__ = ["AccessKeysResource", "AsyncAccessKeysResource"] + + +class AccessKeysResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AccessKeysResourceWithRawResponse: + return AccessKeysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AccessKeysResourceWithStreamingResponse: + return AccessKeysResourceWithStreamingResponse(self) + + def list( + self, + *, + machine_id: str, + port_id: str, + limit: int | Omit = omit, + cursor: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AccessKeyListResponse: + """ + List port access keys + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + limit: Query parameter. + cursor: Query parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + AccessKeyListResponse: OK + + Example: + ```python + access_key = client.machines.ports.access_keys.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return self._get( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + **{"machine_id": machine_id, "port_id": port_id}, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"limit": limit, "cursor": cursor}, access_key_list_params.AccessKeyListParams), + ), + cast_to=AccessKeyListResponse, + ) + + def mint( + self, + *, + machine_id: str, + port_id: str, + expires_in: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyMintResponse: + """ + Mint port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + expires_in: Lifetime in integer seconds. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyMintResponse: OK + + Example: + ```python + access_key = client.machines.ports.access_keys.mint( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + expires_in=1, + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return self._post( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + **{"machine_id": machine_id, "port_id": port_id}, + ), + body=maybe_transform( + {"expires_in": expires_in}, + access_key_mint_params.AccessKeyMintParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyMintResponse, + ) + + def revoke( + self, + *, + machine_id: str, + port_id: str, + access_key_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyRevokeResponse: + """ + Revoke port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + access_key_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyRevokeResponse: OK + + Example: + ```python + access_key = client.machines.ports.access_keys.revoke( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + if access_key_id is None or (isinstance(access_key_id, str) and not access_key_id): + raise ValueError(f"Expected a non-empty value for `access_key_id` but received {access_key_id!r}") + return self._delete( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", + **{"machine_id": machine_id, "port_id": port_id, "access_key_id": access_key_id}, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyRevokeResponse, + ) + + def rotate( + self, + *, + machine_id: str, + port_id: str, + access_key_id: str, + expires_in: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyRotateResponse: + """ + Rotate port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + access_key_id: Path parameter. + expires_in: Lifetime in integer seconds. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyRotateResponse: OK + + Example: + ```python + access_key = client.machines.ports.access_keys.rotate( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + expires_in=1, + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + if access_key_id is None or (isinstance(access_key_id, str) and not access_key_id): + raise ValueError(f"Expected a non-empty value for `access_key_id` but received {access_key_id!r}") + return self._post( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", + **{"machine_id": machine_id, "port_id": port_id, "access_key_id": access_key_id}, + ), + body=maybe_transform( + {"expires_in": expires_in}, + access_key_rotate_params.AccessKeyRotateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyRotateResponse, + ) + + +class AsyncAccessKeysResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAccessKeysResourceWithRawResponse: + return AsyncAccessKeysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAccessKeysResourceWithStreamingResponse: + return AsyncAccessKeysResourceWithStreamingResponse(self) + + async def list( + self, + *, + machine_id: str, + port_id: str, + limit: int | Omit = omit, + cursor: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AccessKeyListResponse: + """ + List port access keys + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + limit: Query parameter. + cursor: Query parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + AccessKeyListResponse: OK + + Example: + ```python + access_key = await client.machines.ports.access_keys.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return await self._get( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + **{"machine_id": machine_id, "port_id": port_id}, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"limit": limit, "cursor": cursor}, access_key_list_params.AccessKeyListParams + ), + ), + cast_to=AccessKeyListResponse, + ) + + async def mint( + self, + *, + machine_id: str, + port_id: str, + expires_in: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyMintResponse: + """ + Mint port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + expires_in: Lifetime in integer seconds. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyMintResponse: OK + + Example: + ```python + access_key = await client.machines.ports.access_keys.mint( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + expires_in=1, + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return await self._post( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + **{"machine_id": machine_id, "port_id": port_id}, + ), + body=await async_maybe_transform( + {"expires_in": expires_in}, + access_key_mint_params.AccessKeyMintParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyMintResponse, + ) + + async def revoke( + self, + *, + machine_id: str, + port_id: str, + access_key_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyRevokeResponse: + """ + Revoke port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + access_key_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyRevokeResponse: OK + + Example: + ```python + access_key = await client.machines.ports.access_keys.revoke( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + if access_key_id is None or (isinstance(access_key_id, str) and not access_key_id): + raise ValueError(f"Expected a non-empty value for `access_key_id` but received {access_key_id!r}") + return await self._delete( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", + **{"machine_id": machine_id, "port_id": port_id, "access_key_id": access_key_id}, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyRevokeResponse, + ) + + async def rotate( + self, + *, + machine_id: str, + port_id: str, + access_key_id: str, + expires_in: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AccessKeyRotateResponse: + """ + Rotate port access key + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + access_key_id: Path parameter. + expires_in: Lifetime in integer seconds. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + AccessKeyRotateResponse: OK + + Example: + ```python + access_key = await client.machines.ports.access_keys.rotate( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + expires_in=1, + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + if access_key_id is None or (isinstance(access_key_id, str) and not access_key_id): + raise ValueError(f"Expected a non-empty value for `access_key_id` but received {access_key_id!r}") + return await self._post( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", + **{"machine_id": machine_id, "port_id": port_id, "access_key_id": access_key_id}, + ), + body=await async_maybe_transform( + {"expires_in": expires_in}, + access_key_rotate_params.AccessKeyRotateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AccessKeyRotateResponse, + ) + + +class AccessKeysResourceWithRawResponse: + def __init__(self, access_keys: AccessKeysResource) -> None: + self._access_keys = access_keys + + self.list = to_raw_response_wrapper( + access_keys.list, + ) + self.mint = to_raw_response_wrapper( + access_keys.mint, + ) + self.revoke = to_raw_response_wrapper( + access_keys.revoke, + ) + self.rotate = to_raw_response_wrapper( + access_keys.rotate, + ) + + +class AsyncAccessKeysResourceWithRawResponse: + def __init__(self, access_keys: AsyncAccessKeysResource) -> None: + self._access_keys = access_keys + + self.list = async_to_raw_response_wrapper( + access_keys.list, + ) + self.mint = async_to_raw_response_wrapper( + access_keys.mint, + ) + self.revoke = async_to_raw_response_wrapper( + access_keys.revoke, + ) + self.rotate = async_to_raw_response_wrapper( + access_keys.rotate, + ) + + +class AccessKeysResourceWithStreamingResponse: + def __init__(self, access_keys: AccessKeysResource) -> None: + self._access_keys = access_keys + + self.list = to_streamed_response_wrapper( + access_keys.list, + ) + self.mint = to_streamed_response_wrapper( + access_keys.mint, + ) + self.revoke = to_streamed_response_wrapper( + access_keys.revoke, + ) + self.rotate = to_streamed_response_wrapper( + access_keys.rotate, + ) + + +class AsyncAccessKeysResourceWithStreamingResponse: + def __init__(self, access_keys: AsyncAccessKeysResource) -> None: + self._access_keys = access_keys + + self.list = async_to_streamed_response_wrapper( + access_keys.list, + ) + self.mint = async_to_streamed_response_wrapper( + access_keys.mint, + ) + self.revoke = async_to_streamed_response_wrapper( + access_keys.revoke, + ) + self.rotate = async_to_streamed_response_wrapper( + access_keys.rotate, + ) diff --git a/src/dedalus_sdk/resources/machines/ports/ports.py b/src/dedalus_sdk/resources/machines/ports/ports.py new file mode 100644 index 0000000..c378e25 --- /dev/null +++ b/src/dedalus_sdk/resources/machines/ports/ports.py @@ -0,0 +1,728 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +import httpx + +from typing_extensions import Literal + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncCursorPage, AsyncCursorPage +from ...._base_client import AsyncPaginator, make_request_options +from .access_keys import ( + AccessKeysResource, + AsyncAccessKeysResource, + AccessKeysResourceWithRawResponse, + AsyncAccessKeysResourceWithRawResponse, + AccessKeysResourceWithStreamingResponse, + AsyncAccessKeysResourceWithStreamingResponse, +) +from ....types.machines import port_list_params, port_create_params, port_update_params +from ....types.machines.port import Port + +__all__ = ["PortsResource", "AsyncPortsResource"] + + +class PortsResource(SyncAPIResource): + @cached_property + def access_keys(self) -> AccessKeysResource: + return AccessKeysResource(self._client) + + @cached_property + def with_raw_response(self) -> PortsResourceWithRawResponse: + return PortsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PortsResourceWithStreamingResponse: + return PortsResourceWithStreamingResponse(self) + + def list( + self, + *, + machine_id: str, + limit: int | Omit = omit, + cursor: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPage[Port]: + """ + List ports + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + limit: Query parameter. + cursor: Query parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + SyncCursorPage[Port]: OK + + Example: + ```python + page = client.machines.ports.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + return self._get_api_list( + path_template("/v1/machines/{machine_id}/ports", **{"machine_id": machine_id}), + page=SyncCursorPage[Port], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"limit": limit, "cursor": cursor}, port_list_params.PortListParams), + ), + model=Port, + method="get", + ) + + def create( + self, + *, + machine_id: str, + expires: int | Omit = omit, + port: int, + protocol: Literal["http"] | Omit = omit, + visibility: Literal["public", "key_required", "private"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Create port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + expires: Port lifetime in integer seconds. Omit for no expiry. + port: Body parameter. + protocol: Body parameter. + visibility: Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = client.machines.ports.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port=0, + protocol="http", + visibility="private", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + return self._post( + path_template("/v1/machines/{machine_id}/ports", **{"machine_id": machine_id}), + body=maybe_transform( + { + "expires": expires, + "port": port, + "protocol": protocol, + "visibility": visibility, + }, + port_create_params.PortCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + def retrieve( + self, + *, + machine_id: str, + port_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Port: + """ + Get port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + Port: OK + + Example: + ```python + port = client.machines.ports.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return self._get( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Port, + ) + + def update( + self, + *, + machine_id: str, + port_id: str, + visibility: Literal["public", "key_required", "private"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Update port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + visibility: Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = client.machines.ports.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + visibility="public", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return self._patch( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + body=maybe_transform( + {"visibility": visibility}, + port_update_params.PortUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + def delete( + self, + *, + machine_id: str, + port_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Delete port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = client.machines.ports.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return self._delete( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + +class AsyncPortsResource(AsyncAPIResource): + @cached_property + def access_keys(self) -> AsyncAccessKeysResource: + return AsyncAccessKeysResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncPortsResourceWithRawResponse: + return AsyncPortsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPortsResourceWithStreamingResponse: + return AsyncPortsResourceWithStreamingResponse(self) + + def list( + self, + *, + machine_id: str, + limit: int | Omit = omit, + cursor: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Port, AsyncCursorPage[Port]]: + """ + List ports + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + limit: Query parameter. + cursor: Query parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + AsyncPaginator[Port, AsyncCursorPage[Port]]: OK + + Example: + ```python + page = client.machines.ports.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + return self._get_api_list( + path_template("/v1/machines/{machine_id}/ports", **{"machine_id": machine_id}), + page=AsyncCursorPage[Port], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"limit": limit, "cursor": cursor}, port_list_params.PortListParams), + ), + model=Port, + method="get", + ) + + async def create( + self, + *, + machine_id: str, + expires: int | Omit = omit, + port: int, + protocol: Literal["http"] | Omit = omit, + visibility: Literal["public", "key_required", "private"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Create port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + expires: Port lifetime in integer seconds. Omit for no expiry. + port: Body parameter. + protocol: Body parameter. + visibility: Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = await client.machines.ports.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port=0, + protocol="http", + visibility="private", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + return await self._post( + path_template("/v1/machines/{machine_id}/ports", **{"machine_id": machine_id}), + body=await async_maybe_transform( + { + "expires": expires, + "port": port, + "protocol": protocol, + "visibility": visibility, + }, + port_create_params.PortCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + async def retrieve( + self, + *, + machine_id: str, + port_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Port: + """ + Get port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + + Returns: + Port: OK + + Example: + ```python + port = await client.machines.ports.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return await self._get( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Port, + ) + + async def update( + self, + *, + machine_id: str, + port_id: str, + visibility: Literal["public", "key_required", "private"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Update port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + visibility: Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = await client.machines.ports.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + visibility="public", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return await self._patch( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + body=await async_maybe_transform( + {"visibility": visibility}, + port_update_params.PortUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + async def delete( + self, + *, + machine_id: str, + port_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Port: + """ + Delete port + + Args: + machine_id: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + port_id: Path parameter. + extra_headers: Send extra headers with the request. + extra_query: Send extra query parameters with the request. + extra_body: Send extra JSON properties with the request. + timeout: Override the client-level default timeout for this request, in seconds. + idempotency_key: Override or provide the idempotency key for this request. + + Returns: + Port: OK + + Example: + ```python + port = await client.machines.ports.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + idempotency_key="", + ) + ``` + """ + if machine_id is None or (isinstance(machine_id, str) and not machine_id): + raise ValueError(f"Expected a non-empty value for `machine_id` but received {machine_id!r}") + if port_id is None or (isinstance(port_id, str) and not port_id): + raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}") + return await self._delete( + path_template( + "/v1/machines/{machine_id}/ports/{port_id}", **{"machine_id": machine_id, "port_id": port_id} + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Port, + ) + + +class PortsResourceWithRawResponse: + def __init__(self, ports: PortsResource) -> None: + self._ports = ports + + self.list = to_raw_response_wrapper( + ports.list, + ) + self.create = to_raw_response_wrapper( + ports.create, + ) + self.retrieve = to_raw_response_wrapper( + ports.retrieve, + ) + self.update = to_raw_response_wrapper( + ports.update, + ) + self.delete = to_raw_response_wrapper( + ports.delete, + ) + + @cached_property + def access_keys(self) -> AccessKeysResourceWithRawResponse: + return AccessKeysResourceWithRawResponse(self._ports.access_keys) + + +class AsyncPortsResourceWithRawResponse: + def __init__(self, ports: AsyncPortsResource) -> None: + self._ports = ports + + self.list = async_to_raw_response_wrapper( + ports.list, + ) + self.create = async_to_raw_response_wrapper( + ports.create, + ) + self.retrieve = async_to_raw_response_wrapper( + ports.retrieve, + ) + self.update = async_to_raw_response_wrapper( + ports.update, + ) + self.delete = async_to_raw_response_wrapper( + ports.delete, + ) + + @cached_property + def access_keys(self) -> AsyncAccessKeysResourceWithRawResponse: + return AsyncAccessKeysResourceWithRawResponse(self._ports.access_keys) + + +class PortsResourceWithStreamingResponse: + def __init__(self, ports: PortsResource) -> None: + self._ports = ports + + self.list = to_streamed_response_wrapper( + ports.list, + ) + self.create = to_streamed_response_wrapper( + ports.create, + ) + self.retrieve = to_streamed_response_wrapper( + ports.retrieve, + ) + self.update = to_streamed_response_wrapper( + ports.update, + ) + self.delete = to_streamed_response_wrapper( + ports.delete, + ) + + @cached_property + def access_keys(self) -> AccessKeysResourceWithStreamingResponse: + return AccessKeysResourceWithStreamingResponse(self._ports.access_keys) + + +class AsyncPortsResourceWithStreamingResponse: + def __init__(self, ports: AsyncPortsResource) -> None: + self._ports = ports + + self.list = async_to_streamed_response_wrapper( + ports.list, + ) + self.create = async_to_streamed_response_wrapper( + ports.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + ports.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + ports.update, + ) + self.delete = async_to_streamed_response_wrapper( + ports.delete, + ) + + @cached_property + def access_keys(self) -> AsyncAccessKeysResourceWithStreamingResponse: + return AsyncAccessKeysResourceWithStreamingResponse(self._ports.access_keys) diff --git a/src/dedalus_sdk/types/image_list.py b/src/dedalus_sdk/types/image_list.py index eb7ce7a..d082f86 100644 --- a/src/dedalus_sdk/types/image_list.py +++ b/src/dedalus_sdk/types/image_list.py @@ -4,10 +4,12 @@ from .._models import BaseModel +from .image import Image + __all__ = ["ImageList"] class ImageList(BaseModel): - image_ids: Optional[List[str]] = None + items: Optional[List[Image]] = None next_cursor: Optional[str] = None diff --git a/src/dedalus_sdk/types/machines/__init__.py b/src/dedalus_sdk/types/machines/__init__.py index 34e1e9e..544e2b2 100644 --- a/src/dedalus_sdk/types/machines/__init__.py +++ b/src/dedalus_sdk/types/machines/__init__.py @@ -9,6 +9,8 @@ from .execution_list import ExecutionList as ExecutionList from .execution_output import ExecutionOutput as ExecutionOutput from .execution import Execution as Execution +from .port_list import PortList as PortList +from .port import Port as Port from .ssh_connection import SSHConnection as SSHConnection from .ssh_host_trust import SSHHostTrust as SSHHostTrust from .ssh_session_list import SSHSessionList as SSHSessionList @@ -19,3 +21,6 @@ from .execution_create_params import ExecutionCreateParams as ExecutionCreateParams from .execution_events_params import ExecutionEventsParams as ExecutionEventsParams from .autoresizing_update_params import AutoresizingUpdateParams as AutoresizingUpdateParams +from .port_list_params import PortListParams as PortListParams +from .port_create_params import PortCreateParams as PortCreateParams +from .port_update_params import PortUpdateParams as PortUpdateParams diff --git a/src/dedalus_sdk/types/machines/execution_create_params.py b/src/dedalus_sdk/types/machines/execution_create_params.py index ca4a4f0..ac37f88 100644 --- a/src/dedalus_sdk/types/machines/execution_create_params.py +++ b/src/dedalus_sdk/types/machines/execution_create_params.py @@ -14,6 +14,7 @@ class ExecutionCreateParams(TypedDict, total=False): """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" command: Required[Optional[SequenceNotStr[str]]] + """Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""].""" cwd: str diff --git a/src/dedalus_sdk/types/machines/port.py b/src/dedalus_sdk/types/machines/port.py new file mode 100644 index 0000000..06649cd --- /dev/null +++ b/src/dedalus_sdk/types/machines/port.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Port", "InitialAccessKey"] + + +class InitialAccessKey(BaseModel): + access_key: str + + access_key_id: str + + created_at: datetime + + expires_at: datetime + + last_used_at: Optional[datetime] = None + """Most recent durably recorded use, coalesced to five-minute resolution.""" + + port_id: str + + revoked_at: Optional[datetime] = None + + +class Port(BaseModel): + application_url: str + """Isolated guest application origin. Direct clients preserve their HTTP method and body and send any required Dedalus credential in headers.""" + + created_at: datetime + + error_code: Optional[str] = None + + error_message: Optional[str] = None + + expires_at: Optional[datetime] = None + + initial_access_key: Optional[InitialAccessKey] = None + """Initial key for a newly created key_required port. Plaintext is returned once and omitted on replay.""" + + machine_id: str + + port: int + + port_id: str + + protocol: Optional[Literal["http"]] = None + + ready_at: Optional[datetime] = None + + retry_after_ms: Optional[int] = None + + status: Literal["wake_in_progress", "ready", "unavailable", "closed", "expired", "failed"] + """Unavailable is a recoverable failure reaching the guest service. See error_code and error_message for the diagnosis.""" + + url: Optional[str] = None + """Stable browser share URL. Browser navigation only; use application_url for APIs, webhooks, and WebSockets.""" + + visibility: Literal["public", "key_required", "private"] diff --git a/src/dedalus_sdk/types/machines/port_create_params.py b/src/dedalus_sdk/types/machines/port_create_params.py new file mode 100644 index 0000000..bd07d4c --- /dev/null +++ b/src/dedalus_sdk/types/machines/port_create_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["PortCreateParams"] + + +class PortCreateParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + expires: int + """Port lifetime in integer seconds. Omit for no expiry.""" + + port: Required[int] + + protocol: Literal["http"] + + visibility: Literal["public", "key_required", "private"] + """Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges.""" diff --git a/src/dedalus_sdk/types/machines/port_list.py b/src/dedalus_sdk/types/machines/port_list.py new file mode 100644 index 0000000..7fc5b82 --- /dev/null +++ b/src/dedalus_sdk/types/machines/port_list.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +from .port import Port + +__all__ = ["PortList"] + + +class PortList(BaseModel): + items: Optional[List[Port]] = None + + next_cursor: Optional[str] = None diff --git a/src/dedalus_sdk/types/machines/port_list_params.py b/src/dedalus_sdk/types/machines/port_list_params.py new file mode 100644 index 0000000..b5838f5 --- /dev/null +++ b/src/dedalus_sdk/types/machines/port_list_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PortListParams"] + + +class PortListParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + limit: int + + cursor: str diff --git a/src/dedalus_sdk/types/machines/port_update_params.py b/src/dedalus_sdk/types/machines/port_update_params.py new file mode 100644 index 0000000..6410e22 --- /dev/null +++ b/src/dedalus_sdk/types/machines/port_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["PortUpdateParams"] + + +class PortUpdateParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + port_id: Required[str] + + visibility: Required[Literal["public", "key_required", "private"]] + """Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges.""" diff --git a/src/dedalus_sdk/types/machines/ports/__init__.py b/src/dedalus_sdk/types/machines/ports/__init__.py new file mode 100644 index 0000000..c88fe3c --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/__init__.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from .access_key_list_response import AccessKeyListResponse as AccessKeyListResponse +from .access_key_list_params import AccessKeyListParams as AccessKeyListParams +from .access_key_mint_response import AccessKeyMintResponse as AccessKeyMintResponse +from .access_key_mint_params import AccessKeyMintParams as AccessKeyMintParams +from .access_key_revoke_response import AccessKeyRevokeResponse as AccessKeyRevokeResponse +from .access_key_rotate_response import AccessKeyRotateResponse as AccessKeyRotateResponse +from .access_key_rotate_params import AccessKeyRotateParams as AccessKeyRotateParams diff --git a/src/dedalus_sdk/types/machines/ports/access_key_list_params.py b/src/dedalus_sdk/types/machines/ports/access_key_list_params.py new file mode 100644 index 0000000..7aea577 --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AccessKeyListParams"] + + +class AccessKeyListParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + port_id: Required[str] + + limit: int + + cursor: str diff --git a/src/dedalus_sdk/types/machines/ports/access_key_list_response.py b/src/dedalus_sdk/types/machines/ports/access_key_list_response.py new file mode 100644 index 0000000..ada6093 --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_list_response.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["AccessKeyListResponse", "Item"] + + +class Item(BaseModel): + access_key_id: str + + created_at: datetime + + expires_at: datetime + + last_used_at: Optional[datetime] = None + """Most recent durably recorded use, coalesced to five-minute resolution.""" + + port_id: str + + revoked_at: Optional[datetime] = None + + +class AccessKeyListResponse(BaseModel): + items: Optional[List[Item]] = None + + next_cursor: Optional[str] = None diff --git a/src/dedalus_sdk/types/machines/ports/access_key_mint_params.py b/src/dedalus_sdk/types/machines/ports/access_key_mint_params.py new file mode 100644 index 0000000..346f66a --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_mint_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AccessKeyMintParams"] + + +class AccessKeyMintParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + port_id: Required[str] + + expires_in: Required[int] + """Lifetime in integer seconds.""" diff --git a/src/dedalus_sdk/types/machines/ports/access_key_mint_response.py b/src/dedalus_sdk/types/machines/ports/access_key_mint_response.py new file mode 100644 index 0000000..7f65340 --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_mint_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["AccessKeyMintResponse"] + + +class AccessKeyMintResponse(BaseModel): + access_key: str + + access_key_id: str + + created_at: datetime + + expires_at: datetime + + last_used_at: Optional[datetime] = None + """Most recent durably recorded use, coalesced to five-minute resolution.""" + + port_id: str + + revoked_at: Optional[datetime] = None diff --git a/src/dedalus_sdk/types/machines/ports/access_key_revoke_response.py b/src/dedalus_sdk/types/machines/ports/access_key_revoke_response.py new file mode 100644 index 0000000..dbf67d9 --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_revoke_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["AccessKeyRevokeResponse"] + + +class AccessKeyRevokeResponse(BaseModel): + access_key_id: str + + created_at: datetime + + expires_at: datetime + + last_used_at: Optional[datetime] = None + """Most recent durably recorded use, coalesced to five-minute resolution.""" + + port_id: str + + revoked_at: Optional[datetime] = None diff --git a/src/dedalus_sdk/types/machines/ports/access_key_rotate_params.py b/src/dedalus_sdk/types/machines/ports/access_key_rotate_params.py new file mode 100644 index 0000000..1c22e4b --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_rotate_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AccessKeyRotateParams"] + + +class AccessKeyRotateParams(TypedDict, total=False): + machine_id: Required[str] + """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" + + port_id: Required[str] + + access_key_id: Required[str] + + expires_in: Required[int] + """Lifetime in integer seconds.""" diff --git a/src/dedalus_sdk/types/machines/ports/access_key_rotate_response.py b/src/dedalus_sdk/types/machines/ports/access_key_rotate_response.py new file mode 100644 index 0000000..9a00c1e --- /dev/null +++ b/src/dedalus_sdk/types/machines/ports/access_key_rotate_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["AccessKeyRotateResponse"] + + +class AccessKeyRotateResponse(BaseModel): + access_key: str + + access_key_id: str + + created_at: datetime + + expires_at: datetime + + last_used_at: Optional[datetime] = None + """Most recent durably recorded use, coalesced to five-minute resolution.""" + + port_id: str + + revoked_at: Optional[datetime] = None diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/images/__init__.py b/tests/api_resources/images/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/images/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/images/test_images.py b/tests/api_resources/images/test_images.py new file mode 100644 index 0000000..4232115 --- /dev/null +++ b/tests/api_resources/images/test_images.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestImages: + @smoke_case("images.list:required", operation="list", path="/v1/images") + def test_method_list(self) -> None: + images = client.images.list( + limit=100, + ) + + @smoke_case("images.list:all", operation="list", path="/v1/images") + def test_method_list_with_all_params(self) -> None: + images = client.images.list( + limit=100, + cursor="cursor", + ) + + @smoke_case("images.create:required", operation="create", path="/v1/images") + def test_method_create(self) -> None: + image = client.images.create( + platform="linux/amd64", + source={"kind": ""}, + idempotency_key="", + ) + + @smoke_case("images.create:all", operation="create", path="/v1/images") + def test_method_create_with_all_params(self) -> None: + image = client.images.create( + credential_ref="", + name="", + platform="linux/amd64", + source={"kind": "", "reference": "", "sha256": "", "upload_id": ""}, + idempotency_key="", + ) + + @smoke_case("images.retrieve:single", operation="retrieve", path="/v1/images/{image_id}") + def test_method_retrieve(self) -> None: + image = client.images.retrieve( + image_id="imageID", + ) + + @smoke_case("images.update:single", operation="update", path="/v1/images/{image_id}") + def test_method_update(self) -> None: + image = client.images.update( + image_id="imageID", + name="", + idempotency_key="", + ) + + @smoke_case("images.delete:single", operation="delete", path="/v1/images/{image_id}") + def test_method_delete(self) -> None: + image = client.images.delete( + image_id="imageID", + idempotency_key="", + ) diff --git a/tests/api_resources/images/test_uploads.py b/tests/api_resources/images/test_uploads.py new file mode 100644 index 0000000..25b240f --- /dev/null +++ b/tests/api_resources/images/test_uploads.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestUploads: + @smoke_case("images.uploads.create:single", operation="create", path="/v1/images/uploads") + def test_method_create(self) -> None: + upload = client.images.uploads.create( + platform="", + sha256="", + size_bytes=0, + idempotency_key="", + ) diff --git a/tests/api_resources/machines/__init__.py b/tests/api_resources/machines/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/machines/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/machines/executions/__init__.py b/tests/api_resources/machines/executions/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/machines/executions/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/machines/executions/test_executions.py b/tests/api_resources/machines/executions/test_executions.py new file mode 100644 index 0000000..1be1fda --- /dev/null +++ b/tests/api_resources/machines/executions/test_executions.py @@ -0,0 +1,79 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestExecutions: + @smoke_case("machines.executions.list:single", operation="list", path="/v1/machines/{machine_id}/executions") + def test_method_list(self) -> None: + page = client.machines.executions.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + + @smoke_case("machines.executions.create:required", operation="create", path="/v1/machines/{machine_id}/executions") + def test_method_create(self) -> None: + execution = client.machines.executions.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + command=[""], + idempotency_key="", + ) + + @smoke_case("machines.executions.create:all", operation="create", path="/v1/machines/{machine_id}/executions") + def test_method_create_with_all_params(self) -> None: + execution = client.machines.executions.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + command=[""], + cwd="", + env={}, + stdin="", + timeout_ms=0, + idempotency_key="", + ) + + @smoke_case( + "machines.executions.retrieve:single", + operation="retrieve", + path="/v1/machines/{machine_id}/executions/{execution_id}", + ) + def test_method_retrieve(self) -> None: + execution = client.machines.executions.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + ) + + @smoke_case( + "machines.executions.delete:single", + operation="delete", + path="/v1/machines/{machine_id}/executions/{execution_id}", + ) + def test_method_delete(self) -> None: + execution = client.machines.executions.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + idempotency_key="", + ) + + @smoke_case( + "machines.executions.output:single", + operation="output", + path="/v1/machines/{machine_id}/executions/{execution_id}/output", + ) + def test_method_output(self) -> None: + execution = client.machines.executions.output( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + ) + + @smoke_case( + "machines.executions.events:single", + operation="events", + path="/v1/machines/{machine_id}/executions/{execution_id}/events", + ) + def test_method_events(self) -> None: + page = client.machines.executions.events( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + ) diff --git a/tests/api_resources/machines/executions/test_logs.py b/tests/api_resources/machines/executions/test_logs.py new file mode 100644 index 0000000..54dab11 --- /dev/null +++ b/tests/api_resources/machines/executions/test_logs.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestLogs: + @smoke_case( + "machines.executions.logs.retrieve:single", + operation="retrieve", + path="/v1/machines/{machine_id}/executions/{execution_id}/logs", + ) + def test_method_retrieve(self) -> None: + log = client.machines.executions.logs.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + ) + + @smoke_case( + "machines.executions.logs.createToken:single", + operation="createToken", + path="/v1/machines/{machine_id}/executions/{execution_id}/logs/token", + ) + def test_method_create_token(self) -> None: + log = client.machines.executions.logs.create_token( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + execution_id="executionID", + idempotency_key="", + ) diff --git a/tests/api_resources/machines/ports/__init__.py b/tests/api_resources/machines/ports/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/machines/ports/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/machines/ports/test_access_keys.py b/tests/api_resources/machines/ports/test_access_keys.py new file mode 100644 index 0000000..750e5d5 --- /dev/null +++ b/tests/api_resources/machines/ports/test_access_keys.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestAccessKeys: + @smoke_case( + "machines.ports.accessKeys.list:required", + operation="list", + path="/v1/machines/{machine_id}/ports/{port_id}/access-keys", + ) + def test_method_list(self) -> None: + access_key = client.machines.ports.access_keys.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + + @smoke_case( + "machines.ports.accessKeys.list:all", + operation="list", + path="/v1/machines/{machine_id}/ports/{port_id}/access-keys", + ) + def test_method_list_with_all_params(self) -> None: + access_key = client.machines.ports.access_keys.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + limit=1, + cursor="cursor", + ) + + @smoke_case( + "machines.ports.accessKeys.mint:single", + operation="mint", + path="/v1/machines/{machine_id}/ports/{port_id}/access-keys", + ) + def test_method_mint(self) -> None: + access_key = client.machines.ports.access_keys.mint( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + expires_in=1, + idempotency_key="", + ) + + @smoke_case( + "machines.ports.accessKeys.revoke:single", + operation="revoke", + path="/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", + ) + def test_method_revoke(self) -> None: + access_key = client.machines.ports.access_keys.revoke( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + idempotency_key="", + ) + + @smoke_case( + "machines.ports.accessKeys.rotate:single", + operation="rotate", + path="/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", + ) + def test_method_rotate(self) -> None: + access_key = client.machines.ports.access_keys.rotate( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + access_key_id="accessKeyID", + expires_in=1, + idempotency_key="", + ) diff --git a/tests/api_resources/machines/ports/test_ports.py b/tests/api_resources/machines/ports/test_ports.py new file mode 100644 index 0000000..56270fd --- /dev/null +++ b/tests/api_resources/machines/ports/test_ports.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestPorts: + @smoke_case("machines.ports.list:single", operation="list", path="/v1/machines/{machine_id}/ports") + def test_method_list(self) -> None: + page = client.machines.ports.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + + @smoke_case("machines.ports.create:required", operation="create", path="/v1/machines/{machine_id}/ports") + def test_method_create(self) -> None: + port = client.machines.ports.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port=0, + protocol="http", + visibility="private", + idempotency_key="", + ) + + @smoke_case("machines.ports.create:all", operation="create", path="/v1/machines/{machine_id}/ports") + def test_method_create_with_all_params(self) -> None: + port = client.machines.ports.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + expires=1, + port=0, + protocol="http", + visibility="private", + idempotency_key="", + ) + + @smoke_case( + "machines.ports.retrieve:single", operation="retrieve", path="/v1/machines/{machine_id}/ports/{port_id}" + ) + def test_method_retrieve(self) -> None: + port = client.machines.ports.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + ) + + @smoke_case("machines.ports.update:single", operation="update", path="/v1/machines/{machine_id}/ports/{port_id}") + def test_method_update(self) -> None: + port = client.machines.ports.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + visibility="public", + idempotency_key="", + ) + + @smoke_case("machines.ports.delete:single", operation="delete", path="/v1/machines/{machine_id}/ports/{port_id}") + def test_method_delete(self) -> None: + port = client.machines.ports.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + port_id="portID", + idempotency_key="", + ) diff --git a/tests/api_resources/machines/test_autoresizing.py b/tests/api_resources/machines/test_autoresizing.py new file mode 100644 index 0000000..fb03115 --- /dev/null +++ b/tests/api_resources/machines/test_autoresizing.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestAutoresizing: + @smoke_case( + "machines.autoresizing.retrieve:single", operation="retrieve", path="/v1/machines/{machine_id}/autoresizing" + ) + def test_method_retrieve(self) -> None: + autoresizing = client.machines.autoresizing.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + + @smoke_case( + "machines.autoresizing.update:required", operation="update", path="/v1/machines/{machine_id}/autoresizing" + ) + def test_method_update(self) -> None: + autoresizing = client.machines.autoresizing.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.autoresizing.update:all", operation="update", path="/v1/machines/{machine_id}/autoresizing") + def test_method_update_with_all_params(self) -> None: + autoresizing = client.machines.autoresizing.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + cpu="on", + cpu_max_vcpu=0.25, + memory="on", + memory_max_mib=256, + idempotency_key="", + ) diff --git a/tests/api_resources/machines/test_machines.py b/tests/api_resources/machines/test_machines.py new file mode 100644 index 0000000..c3691b4 --- /dev/null +++ b/tests/api_resources/machines/test_machines.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestMachines: + @smoke_case("machines.list:single", operation="list", path="/v1/machines") + def test_method_list(self) -> None: + page = client.machines.list() + + @smoke_case("machines.create:required", operation="create", path="/v1/machines") + def test_method_create(self) -> None: + machine = client.machines.create( + autosleep="300s", + memory_mib=4096, + storage_gib=10, + vcpu=1, + idempotency_key="", + ) + + @smoke_case("machines.create:all", operation="create", path="/v1/machines") + def test_method_create_with_all_params(self) -> None: + machine = client.machines.create( + autosleep="300s", + image_id="x", + memory_mib=4096, + storage_gib=10, + vcpu=1, + idempotency_key="", + ) + + @smoke_case("machines.retrieve:single", operation="retrieve", path="/v1/machines/{machine_id}") + def test_method_retrieve(self) -> None: + machine = client.machines.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + + @smoke_case("machines.update:required", operation="update", path="/v1/machines/{machine_id}") + def test_method_update(self) -> None: + machine = client.machines.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.update:all", operation="update", path="/v1/machines/{machine_id}") + def test_method_update_with_all_params(self) -> None: + machine = client.machines.update( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + autosleep="", + storage_gib=0, + idempotency_key="", + ) + + @smoke_case("machines.delete:required", operation="delete", path="/v1/machines/{machine_id}") + def test_method_delete(self) -> None: + machine = client.machines.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.delete:all", operation="delete", path="/v1/machines/{machine_id}") + def test_method_delete_with_all_params(self) -> None: + machine = client.machines.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + force=True, + idempotency_key="", + ) + + @smoke_case("machines.sleep:single", operation="sleep", path="/v1/machines/{machine_id}/sleep") + def test_method_sleep(self) -> None: + machine = client.machines.sleep( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.wake:single", operation="wake", path="/v1/machines/{machine_id}/wake") + def test_method_wake(self) -> None: + machine = client.machines.wake( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.reboot:required", operation="reboot", path="/v1/machines/{machine_id}/reboot") + def test_method_reboot(self) -> None: + machine = client.machines.reboot( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.reboot:all", operation="reboot", path="/v1/machines/{machine_id}/reboot") + def test_method_reboot_with_all_params(self) -> None: + machine = client.machines.reboot( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + force=True, + idempotency_key="", + ) + + @smoke_case("machines.resize:required", operation="resize", path="/v1/machines/{machine_id}/resize") + def test_method_resize(self) -> None: + machine = client.machines.resize( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + idempotency_key="", + ) + + @smoke_case("machines.resize:all", operation="resize", path="/v1/machines/{machine_id}/resize") + def test_method_resize_with_all_params(self) -> None: + machine = client.machines.resize( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + memory_mib=0, + vcpu=0, + idempotency_key="", + ) diff --git a/tests/api_resources/machines/test_ssh.py b/tests/api_resources/machines/test_ssh.py new file mode 100644 index 0000000..5614e5b --- /dev/null +++ b/tests/api_resources/machines/test_ssh.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestSSH: + @smoke_case("machines.ssh.list:single", operation="list", path="/v1/machines/{machine_id}/ssh") + def test_method_list(self) -> None: + page = client.machines.ssh.list( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + ) + + @smoke_case("machines.ssh.create:single", operation="create", path="/v1/machines/{machine_id}/ssh") + def test_method_create(self) -> None: + ssh = client.machines.ssh.create( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + public_key="", + idempotency_key="", + ) + + @smoke_case("machines.ssh.retrieve:single", operation="retrieve", path="/v1/machines/{machine_id}/ssh/{session_id}") + def test_method_retrieve(self) -> None: + ssh = client.machines.ssh.retrieve( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + session_id="sessionID", + ) + + @smoke_case("machines.ssh.delete:single", operation="delete", path="/v1/machines/{machine_id}/ssh/{session_id}") + def test_method_delete(self) -> None: + ssh = client.machines.ssh.delete( + machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", + session_id="sessionID", + idempotency_key="", + ) diff --git a/tests/api_resources/organization/__init__.py b/tests/api_resources/organization/__init__.py new file mode 100644 index 0000000..eb09f03 --- /dev/null +++ b/tests/api_resources/organization/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. diff --git a/tests/api_resources/organization/test_autoresizing.py b/tests/api_resources/organization/test_autoresizing.py new file mode 100644 index 0000000..5e54d7a --- /dev/null +++ b/tests/api_resources/organization/test_autoresizing.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Smoke tests for one part of the client; see tests/smoke_support.py for how to run them. +from __future__ import annotations + +from tests.smoke_support import client, smoke_case + + +class TestAutoresizing: + @smoke_case("organization.autoresizing.retrieve:single", operation="retrieve", path="/v1/organization/autoresizing") + def test_method_retrieve(self) -> None: + autoresizing = client.organization.autoresizing.retrieve() + + @smoke_case("organization.autoresizing.update:required", operation="update", path="/v1/organization/autoresizing") + def test_method_update(self) -> None: + autoresizing = client.organization.autoresizing.update( + idempotency_key="", + ) + + @smoke_case("organization.autoresizing.update:all", operation="update", path="/v1/organization/autoresizing") + def test_method_update_with_all_params(self) -> None: + autoresizing = client.organization.autoresizing.update( + cpu="on", + cpu_max_vcpu=0.25, + memory="on", + memory_max_mib=256, + idempotency_key="", + ) diff --git a/tests/smoke-test.py b/tests/smoke-test.py deleted file mode 100644 index 448d470..0000000 --- a/tests/smoke-test.py +++ /dev/null @@ -1,722 +0,0 @@ -# File generated from our OpenAPI spec by Scalar. See README.md for details. - -# Smoke test: calls every generated operation once to confirm the SDK can reach each endpoint. -# Run it from this repo with `python tests/smoke-test.py`. The generator also runs this file -# against a mock server and reads the JSON report produced via SCALAR_SMOKE_REPORT. -from __future__ import annotations - -import json -import os -import sys -import time -import traceback -from concurrent.futures import ThreadPoolExecutor -from pathlib import Path -from typing import Any, Callable, TypedDict - -from dedalus_sdk import Dedalus - -# The shared smoke-test runner injects base URL and credentials through the same -# environment variables the generated client reads in normal use. -client = Dedalus(max_retries=2, timeout=10) - - -class SmokeResult(TypedDict, total=False): - operation: str - method: str - path: str - label: str - status: str - durationMs: int - error: str - - -class _SmokeCaseBase(TypedDict): - operation: str - method: str - path: str - run: Callable[[], Any] - - -# `label` says which of an operation's two calls this is — "required params" or "all params". -# It sits in a total=False extension because it is absent when the operation contributed a -# single case, while the fields above are always present. -class SmokeCase(_SmokeCaseBase, total=False): - label: str - - -def _smoke_case_0() -> None: - page = client.machines.list() - - -def _smoke_case_1() -> None: - machine = client.machines.create( - autosleep="300s", - memory_mib=4096, - storage_gib=10, - vcpu=1, - idempotency_key="", - ) - - -def _smoke_case_2() -> None: - machine = client.machines.create( - autosleep="300s", - image_id="x", - memory_mib=4096, - storage_gib=10, - vcpu=1, - idempotency_key="", - ) - - -def _smoke_case_3() -> None: - machine = client.machines.retrieve( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - ) - - -def _smoke_case_4() -> None: - machine = client.machines.update( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_5() -> None: - machine = client.machines.update( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - autosleep="", - storage_gib=0, - idempotency_key="", - ) - - -def _smoke_case_6() -> None: - machine = client.machines.delete( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_7() -> None: - machine = client.machines.delete( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - force=True, - idempotency_key="", - ) - - -def _smoke_case_8() -> None: - machine = client.machines.sleep( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_9() -> None: - machine = client.machines.wake( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_10() -> None: - machine = client.machines.reboot( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_11() -> None: - machine = client.machines.reboot( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - force=True, - idempotency_key="", - ) - - -def _smoke_case_12() -> None: - machine = client.machines.resize( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_13() -> None: - machine = client.machines.resize( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - memory_mib=0, - vcpu=0, - idempotency_key="", - ) - - -def _smoke_case_14() -> None: - page = client.machines.ssh.list( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - ) - - -def _smoke_case_15() -> None: - ssh = client.machines.ssh.create( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - public_key="", - idempotency_key="", - ) - - -def _smoke_case_16() -> None: - ssh = client.machines.ssh.retrieve( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - session_id="sessionID", - ) - - -def _smoke_case_17() -> None: - ssh = client.machines.ssh.delete( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - session_id="sessionID", - idempotency_key="", - ) - - -def _smoke_case_18() -> None: - page = client.machines.executions.list( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - ) - - -def _smoke_case_19() -> None: - execution = client.machines.executions.create( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - command=[""], - idempotency_key="", - ) - - -def _smoke_case_20() -> None: - execution = client.machines.executions.create( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - command=[""], - cwd="", - env={}, - stdin="", - timeout_ms=0, - idempotency_key="", - ) - - -def _smoke_case_21() -> None: - execution = client.machines.executions.retrieve( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - ) - - -def _smoke_case_22() -> None: - execution = client.machines.executions.delete( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - idempotency_key="", - ) - - -def _smoke_case_23() -> None: - execution = client.machines.executions.output( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - ) - - -def _smoke_case_24() -> None: - page = client.machines.executions.events( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - ) - - -def _smoke_case_25() -> None: - log = client.machines.executions.logs.retrieve( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - ) - - -def _smoke_case_26() -> None: - log = client.machines.executions.logs.create_token( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - execution_id="executionID", - idempotency_key="", - ) - - -def _smoke_case_27() -> None: - autoresizing = client.machines.autoresizing.retrieve( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - ) - - -def _smoke_case_28() -> None: - autoresizing = client.machines.autoresizing.update( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - idempotency_key="", - ) - - -def _smoke_case_29() -> None: - autoresizing = client.machines.autoresizing.update( - machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f", - cpu="on", - cpu_max_vcpu=0.25, - memory="on", - memory_max_mib=256, - idempotency_key="", - ) - - -def _smoke_case_30() -> None: - autoresizing = client.organization.autoresizing.retrieve() - - -def _smoke_case_31() -> None: - autoresizing = client.organization.autoresizing.update( - idempotency_key="", - ) - - -def _smoke_case_32() -> None: - autoresizing = client.organization.autoresizing.update( - cpu="on", - cpu_max_vcpu=0.25, - memory="on", - memory_max_mib=256, - idempotency_key="", - ) - - -def _smoke_case_33() -> None: - image = client.images.list( - limit=100, - ) - - -def _smoke_case_34() -> None: - image = client.images.list( - limit=100, - cursor="cursor", - ) - - -def _smoke_case_35() -> None: - image = client.images.create( - platform="linux/amd64", - source={"kind": ""}, - idempotency_key="", - ) - - -def _smoke_case_36() -> None: - image = client.images.create( - credential_ref="", - name="", - platform="linux/amd64", - source={"kind": "", "reference": "", "sha256": "", "upload_id": ""}, - idempotency_key="", - ) - - -def _smoke_case_37() -> None: - image = client.images.retrieve( - image_id="imageID", - ) - - -def _smoke_case_38() -> None: - image = client.images.update( - image_id="imageID", - name="", - idempotency_key="", - ) - - -def _smoke_case_39() -> None: - image = client.images.delete( - image_id="imageID", - idempotency_key="", - ) - - -def _smoke_case_40() -> None: - upload = client.images.uploads.create( - platform="", - sha256="", - size_bytes=0, - idempotency_key="", - ) - - -cases: list[SmokeCase] = [ - { - "operation": "list", - "method": "GET", - "path": "/v1/machines", - "run": _smoke_case_0, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/machines", - "label": "required params", - "run": _smoke_case_1, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/machines", - "label": "all params", - "run": _smoke_case_2, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/machines/{machine_id}", - "run": _smoke_case_3, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/machines/{machine_id}", - "label": "required params", - "run": _smoke_case_4, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/machines/{machine_id}", - "label": "all params", - "run": _smoke_case_5, - }, - { - "operation": "delete", - "method": "DELETE", - "path": "/v1/machines/{machine_id}", - "label": "required params", - "run": _smoke_case_6, - }, - { - "operation": "delete", - "method": "DELETE", - "path": "/v1/machines/{machine_id}", - "label": "all params", - "run": _smoke_case_7, - }, - { - "operation": "sleep", - "method": "POST", - "path": "/v1/machines/{machine_id}/sleep", - "run": _smoke_case_8, - }, - { - "operation": "wake", - "method": "POST", - "path": "/v1/machines/{machine_id}/wake", - "run": _smoke_case_9, - }, - { - "operation": "reboot", - "method": "POST", - "path": "/v1/machines/{machine_id}/reboot", - "label": "required params", - "run": _smoke_case_10, - }, - { - "operation": "reboot", - "method": "POST", - "path": "/v1/machines/{machine_id}/reboot", - "label": "all params", - "run": _smoke_case_11, - }, - { - "operation": "resize", - "method": "POST", - "path": "/v1/machines/{machine_id}/resize", - "label": "required params", - "run": _smoke_case_12, - }, - { - "operation": "resize", - "method": "POST", - "path": "/v1/machines/{machine_id}/resize", - "label": "all params", - "run": _smoke_case_13, - }, - { - "operation": "list", - "method": "GET", - "path": "/v1/machines/{machine_id}/ssh", - "run": _smoke_case_14, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/machines/{machine_id}/ssh", - "run": _smoke_case_15, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", - "run": _smoke_case_16, - }, - { - "operation": "delete", - "method": "DELETE", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", - "run": _smoke_case_17, - }, - { - "operation": "list", - "method": "GET", - "path": "/v1/machines/{machine_id}/executions", - "run": _smoke_case_18, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/machines/{machine_id}/executions", - "label": "required params", - "run": _smoke_case_19, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/machines/{machine_id}/executions", - "label": "all params", - "run": _smoke_case_20, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", - "run": _smoke_case_21, - }, - { - "operation": "delete", - "method": "DELETE", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", - "run": _smoke_case_22, - }, - { - "operation": "output", - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", - "run": _smoke_case_23, - }, - { - "operation": "events", - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", - "run": _smoke_case_24, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", - "run": _smoke_case_25, - }, - { - "operation": "createToken", - "method": "POST", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", - "run": _smoke_case_26, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/machines/{machine_id}/autoresizing", - "run": _smoke_case_27, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/machines/{machine_id}/autoresizing", - "label": "required params", - "run": _smoke_case_28, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/machines/{machine_id}/autoresizing", - "label": "all params", - "run": _smoke_case_29, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/organization/autoresizing", - "run": _smoke_case_30, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/organization/autoresizing", - "label": "required params", - "run": _smoke_case_31, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/organization/autoresizing", - "label": "all params", - "run": _smoke_case_32, - }, - { - "operation": "list", - "method": "GET", - "path": "/v1/images", - "label": "required params", - "run": _smoke_case_33, - }, - { - "operation": "list", - "method": "GET", - "path": "/v1/images", - "label": "all params", - "run": _smoke_case_34, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/images", - "label": "required params", - "run": _smoke_case_35, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/images", - "label": "all params", - "run": _smoke_case_36, - }, - { - "operation": "retrieve", - "method": "GET", - "path": "/v1/images/{image_id}", - "run": _smoke_case_37, - }, - { - "operation": "update", - "method": "PATCH", - "path": "/v1/images/{image_id}", - "run": _smoke_case_38, - }, - { - "operation": "delete", - "method": "DELETE", - "path": "/v1/images/{image_id}", - "run": _smoke_case_39, - }, - { - "operation": "create", - "method": "POST", - "path": "/v1/images/uploads", - "run": _smoke_case_40, - }, -] - -DEFAULT_SMOKE_CONCURRENCY = 32 - - -def _selected_cases() -> list[SmokeCase]: - filter_value = os.environ.get("SCALAR_SMOKE_FILTER") - needles = [needle.strip() for needle in filter_value.split(",") if needle.strip()] if filter_value else [] - if not needles: - return cases - return [case for case in cases if any(needle in case["operation"] or needle in case["path"] for needle in needles)] - - -def _smoke_concurrency(case_count: int) -> int: - override = os.environ.get("SCALAR_SMOKE_CONCURRENCY") - if override: - try: - parsed = int(override) - if parsed > 0: - return min(parsed, case_count) - except ValueError: - pass - return min(DEFAULT_SMOKE_CONCURRENCY, case_count) - - -def _case_identity(case: SmokeCase) -> SmokeResult: - # `label` is carried through only when the operation contributed both of its calls, so a - # single-case operation reports exactly as it did before there were two. - identity: SmokeResult = { - "operation": case["operation"], - "method": case["method"], - "path": case["path"], - } - label = case.get("label") - if label: - identity["label"] = label - return identity - - -def _run_case(case: SmokeCase) -> SmokeResult: - started_at = time.monotonic() - identity = _case_identity(case) - try: - case["run"]() - return { - **identity, - "status": "passed", - "durationMs": int((time.monotonic() - started_at) * 1000), - } - except Exception: - return { - **identity, - "status": "failed", - "durationMs": int((time.monotonic() - started_at) * 1000), - "error": traceback.format_exc(), - } - - -def main() -> None: - selected = _selected_cases() - if selected: - # Keep enough parallelism to catch generated SDK concurrency bugs without overwhelming - # CI runners or the in-process mock server for large SDKs. - with ThreadPoolExecutor(max_workers=_smoke_concurrency(len(selected))) as executor: - results = list(executor.map(_run_case, selected)) - else: - results = [] - failed = [result for result in results if result["status"] == "failed"] - - report_path = os.environ.get("SCALAR_SMOKE_REPORT") - if report_path: - Path(report_path).write_text( - json.dumps({"total": len(results), "failed": len(failed), "results": results}), encoding="utf-8" - ) - else: - for result in results: - suffix = f" [{result['label']}]" if result.get("label") else "" - if result["status"] == "passed": - print( - f"PASS {result['operation']}{suffix} ({result['method']} {result['path']}) {result['durationMs']}ms" - ) - else: - print( - f"FAIL {result['operation']}{suffix} ({result['method']} {result['path']})\n{result.get('error', '')}", - file=sys.stderr, - ) - if not results: - print("No code samples ran (empty SDK or a SCALAR_SMOKE_FILTER that matched nothing).", file=sys.stderr) - else: - print(f"\n{len(results) - len(failed)}/{len(results)} samples passed") - - if failed or not results: - sys.exit(1) - - -if __name__ == "__main__": - main() diff --git a/tests/smoke_support.py b/tests/smoke_support.py new file mode 100644 index 0000000..67ea3ad --- /dev/null +++ b/tests/smoke_support.py @@ -0,0 +1,122 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +# Shared by every smoke test under `tests/`. Each test calls one SDK method the way the SDK +# exposes it, against the server named by TEST_API_BASE_URL: +# +# TEST_API_BASE_URL=http://localhost:4010 python -m pytest +# +# Environment variables: +# - TEST_API_BASE_URL: the server to call. Unset, every smoke test skips, so a plain `pytest` +# never calls the real API. Credentials come from the variables the client itself reads. +# - SCALAR_SMOKE_FILTER: comma-separated needles; only cases whose operation name or path +# contains one of them run. Empty means no filter. +# - SCALAR_SMOKE_REPORT_DIR: a directory; each test process appends one JSON line per case it +# ran to its own file there. The generator uses this to collect per-case results. +# +# Regeneration does not yet delete a test module whose resource was renamed or removed. Delete a +# stale module under `tests/api_resources/` by hand, or `pytest` keeps running it. +from __future__ import annotations + +import functools +import json +import os +import secrets +import threading +import time +import traceback +from typing import Any, Callable, TypeVar, cast + +import pytest + +from dedalus_sdk import Dedalus + +# Fingerprint of the case list the generator's smoke runner checks this suite against (written only +# for generator tooling). The runner refuses a list whose digest differs, so a list left by an +# earlier generation is never trusted. +SMOKE_CASE_LIST_DIGEST = "ba9877f69295ef0d" + +_BASE_URL = os.environ.get("TEST_API_BASE_URL") or None + +# The client every smoke test calls through. It is built only for a smoke run: the constructor +# raises when a credential the client requires is missing, and a plain `pytest` without +# credentials must still import every test module, where each case then skips before touching it. +# Retries and the per-attempt timeout are stated rather than inherited, because the client +# defaults are config-derived and can be zero retries; three 10s attempts plus backoff fit inside +# the 35s case bound below. +client: Dedalus = Dedalus(base_url=_BASE_URL, max_retries=2, timeout=10) if _BASE_URL else cast("Dedalus", None) + +_NEEDLES = [needle.strip() for needle in os.environ.get("SCALAR_SMOKE_FILTER", "").split(",") if needle.strip()] + +_REPORT_DIR = os.environ.get("SCALAR_SMOKE_REPORT_DIR") or None +# One file per process: no two writers ever share a file, and the lock below keeps the appends of +# one process from interleaving, so nothing relies on append atomicity. +_REPORT_FILE = os.path.join(_REPORT_DIR, f"{os.getpid()}-{secrets.token_hex(8)}.jsonl") if _REPORT_DIR else None +_REPORT_LOCK = threading.Lock() + +# How long one case may take, all retries included, before it is recorded as failed. pytest has +# no per-test timeout of its own, so this is the case's only bound. +CASE_BOUND_SECONDS = 35.0 + +_Test = TypeVar("_Test", bound=Callable[..., None]) + + +def _is_selected(operation: str, path: str) -> bool: + """Whether the filter selects a case: no needles, or one contained in its operation or path.""" + return not _NEEDLES or any(needle in operation or needle in path for needle in _NEEDLES) + + +def _record(line: dict[str, Any]) -> None: + """Appends one result line to this process's report file, when the generator asked for one.""" + if _REPORT_FILE is None: + return + with _REPORT_LOCK, open(_REPORT_FILE, "a", encoding="utf-8") as report: + report.write(json.dumps(line) + "\n") + + +def _run_bounded(body: Callable[[], None]) -> None: + """Runs a case body, raising once it has run longer than the case bound.""" + # A daemon thread, so a call that never returns (an unanswered WebSocket read) can neither block + # the next case nor keep the process alive at exit. + outcome: list[BaseException] = [] + + def target() -> None: + try: + body() + except BaseException as error: # handed back to the test thread below + outcome.append(error) + + worker = threading.Thread(target=target, daemon=True) + worker.start() + worker.join(CASE_BOUND_SECONDS) + if worker.is_alive(): + raise TimeoutError(f"The case did not finish within {CASE_BOUND_SECONDS:g} s.") + if outcome: + raise outcome[0] + + +def smoke_case(case_id: str, *, operation: str, path: str) -> Callable[[_Test], _Test]: + """Marks a test method as one smoke case. + + `case_id` is the stable id the result is recorded under, and `operation` and `path` are the + fields the filter matches. A failure is recorded and then re-raised, so pytest sees it too. + """ + + def decorate(test: _Test) -> _Test: + @functools.wraps(test) + def wrapper(*args: Any, **kwargs: Any) -> None: + if not _BASE_URL: + pytest.skip("TEST_API_BASE_URL is not set") + if not _is_selected(operation, path): + pytest.skip("not selected by SCALAR_SMOKE_FILTER") + started_at = time.monotonic() + try: + _run_bounded(lambda: test(*args, **kwargs)) + except Exception: + duration_ms = int((time.monotonic() - started_at) * 1000) + _record({"id": case_id, "status": "failed", "durationMs": duration_ms, "error": traceback.format_exc()}) + raise + _record({"id": case_id, "status": "passed", "durationMs": int((time.monotonic() - started_at) * 1000)}) + + return cast("_Test", wrapper) + + return decorate