From c33521edd82b7eb554067b98cffc62eb46249d4a Mon Sep 17 00:00:00 2001 From: nicoche <78445450+nicoche@users.noreply.github.com> Date: Fri, 26 Jun 2026 01:29:31 +0200 Subject: [PATCH 1/4] bump api --- koyeb/api/.openapi-generator/FILES | 33 + koyeb/api/.openapi-generator/VERSION | 2 +- koyeb/api/__init__.py | 22 + koyeb/api/api/__init__.py | 1 + koyeb/api/api/instance_snapshots_api.py | 1565 ++ koyeb/api/api_client.py | 40 +- koyeb/api/configuration.py | 6 +- koyeb/api/docs/CreateInstanceSnapshotReply.md | 29 + .../api/docs/CreateInstanceSnapshotRequest.md | 31 + koyeb/api/docs/CreateService.md | 2 + koyeb/api/docs/DeleteInstanceSnapshotReply.md | 29 + koyeb/api/docs/Deployment.md | 1 + koyeb/api/docs/DeploymentDefinition.md | 2 +- koyeb/api/docs/DeploymentListItem.md | 1 + koyeb/api/docs/GetInstanceSnapshotReply.md | 29 + koyeb/api/docs/InstanceSnapshot.md | 44 + koyeb/api/docs/InstanceSnapshotEvent.md | 35 + koyeb/api/docs/InstanceSnapshotStatus.md | 20 + koyeb/api/docs/InstanceSnapshotType.md | 14 + koyeb/api/docs/InstanceSnapshotsApi.md | 435 + .../docs/ListInstanceSnapshotEventsReply.md | 33 + koyeb/api/docs/ListInstanceSnapshotsReply.md | 33 + koyeb/api/docs/RegionalDeployment.md | 1 + koyeb/api/docs/RegionalDeploymentListItem.md | 1 + koyeb/api/docs/UpdateService.md | 1 + koyeb/api/models/__init__.py | 10 + .../models/create_instance_snapshot_reply.py | 92 + .../create_instance_snapshot_request.py | 93 + koyeb/api/models/create_service.py | 8 +- .../models/delete_instance_snapshot_reply.py | 92 + koyeb/api/models/deployment.py | 6 +- koyeb/api/models/deployment_definition.py | 4 +- koyeb/api/models/deployment_list_item.py | 4 +- koyeb/api/models/exec_command_io.py | 3 - .../api/models/get_instance_snapshot_reply.py | 92 + koyeb/api/models/instance_snapshot.py | 121 + koyeb/api/models/instance_snapshot_event.py | 101 + koyeb/api/models/instance_snapshot_status.py | 41 + koyeb/api/models/instance_snapshot_type.py | 38 + .../list_instance_snapshot_events_reply.py | 104 + .../models/list_instance_snapshots_reply.py | 104 + koyeb/api/models/regional_deployment.py | 4 +- .../models/regional_deployment_list_item.py | 6 +- koyeb/api/models/update_service.py | 8 +- .../test_create_instance_snapshot_reply.py | 69 + .../test_create_instance_snapshot_request.py | 53 + .../test_delete_instance_snapshot_reply.py | 69 + .../test/test_get_instance_snapshot_reply.py | 69 + koyeb/api/test/test_instance_snapshot.py | 68 + .../api/test/test_instance_snapshot_event.py | 57 + .../api/test/test_instance_snapshot_status.py | 33 + koyeb/api/test/test_instance_snapshot_type.py | 33 + koyeb/api/test/test_instance_snapshots_api.py | 61 + ...est_list_instance_snapshot_events_reply.py | 64 + .../test_list_instance_snapshots_reply.py | 75 + koyeb/api_README.md | 19 +- koyeb/api_async/.openapi-generator/FILES | 33 + koyeb/api_async/.openapi-generator/VERSION | 2 +- koyeb/api_async/__init__.py | 22 + koyeb/api_async/api/__init__.py | 1 + koyeb/api_async/api/instance_snapshots_api.py | 1565 ++ koyeb/api_async/api_client.py | 32 +- koyeb/api_async/configuration.py | 8 +- .../docs/CreateInstanceSnapshotReply.md | 29 + .../docs/CreateInstanceSnapshotRequest.md | 31 + koyeb/api_async/docs/CreateService.md | 2 + .../docs/DeleteInstanceSnapshotReply.md | 29 + koyeb/api_async/docs/Deployment.md | 1 + koyeb/api_async/docs/DeploymentDefinition.md | 2 +- koyeb/api_async/docs/DeploymentListItem.md | 1 + .../docs/GetInstanceSnapshotReply.md | 29 + koyeb/api_async/docs/InstanceSnapshot.md | 44 + koyeb/api_async/docs/InstanceSnapshotEvent.md | 35 + .../api_async/docs/InstanceSnapshotStatus.md | 20 + koyeb/api_async/docs/InstanceSnapshotType.md | 14 + koyeb/api_async/docs/InstanceSnapshotsApi.md | 435 + .../docs/ListInstanceSnapshotEventsReply.md | 33 + .../docs/ListInstanceSnapshotsReply.md | 33 + koyeb/api_async/docs/RegionalDeployment.md | 1 + .../docs/RegionalDeploymentListItem.md | 1 + koyeb/api_async/docs/UpdateService.md | 1 + koyeb/api_async/models/__init__.py | 10 + .../models/create_instance_snapshot_reply.py | 92 + .../create_instance_snapshot_request.py | 93 + koyeb/api_async/models/create_service.py | 8 +- .../models/delete_instance_snapshot_reply.py | 92 + koyeb/api_async/models/deployment.py | 6 +- .../api_async/models/deployment_definition.py | 4 +- .../api_async/models/deployment_list_item.py | 4 +- koyeb/api_async/models/exec_command_io.py | 3 - .../models/get_instance_snapshot_reply.py | 92 + koyeb/api_async/models/instance_snapshot.py | 121 + .../models/instance_snapshot_event.py | 101 + .../models/instance_snapshot_status.py | 41 + .../models/instance_snapshot_type.py | 38 + .../list_instance_snapshot_events_reply.py | 104 + .../models/list_instance_snapshots_reply.py | 104 + koyeb/api_async/models/regional_deployment.py | 4 +- .../models/regional_deployment_list_item.py | 6 +- koyeb/api_async/models/update_service.py | 8 +- koyeb/api_async/rest.py | 2 - .../test_create_instance_snapshot_reply.py | 69 + .../test_create_instance_snapshot_request.py | 53 + .../test_delete_instance_snapshot_reply.py | 69 + .../test/test_get_instance_snapshot_reply.py | 69 + .../api_async/test/test_instance_snapshot.py | 68 + .../test/test_instance_snapshot_event.py | 57 + .../test/test_instance_snapshot_status.py | 33 + .../test/test_instance_snapshot_type.py | 33 + .../test/test_instance_snapshots_api.py | 61 + ...est_list_instance_snapshot_events_reply.py | 64 + .../test_list_instance_snapshots_reply.py | 75 + koyeb/api_async_README.md | 19 +- spec/openapi.json | 17701 ++++++++-------- 114 files changed, 17103 insertions(+), 8616 deletions(-) create mode 100644 koyeb/api/api/instance_snapshots_api.py create mode 100644 koyeb/api/docs/CreateInstanceSnapshotReply.md create mode 100644 koyeb/api/docs/CreateInstanceSnapshotRequest.md create mode 100644 koyeb/api/docs/DeleteInstanceSnapshotReply.md create mode 100644 koyeb/api/docs/GetInstanceSnapshotReply.md create mode 100644 koyeb/api/docs/InstanceSnapshot.md create mode 100644 koyeb/api/docs/InstanceSnapshotEvent.md create mode 100644 koyeb/api/docs/InstanceSnapshotStatus.md create mode 100644 koyeb/api/docs/InstanceSnapshotType.md create mode 100644 koyeb/api/docs/InstanceSnapshotsApi.md create mode 100644 koyeb/api/docs/ListInstanceSnapshotEventsReply.md create mode 100644 koyeb/api/docs/ListInstanceSnapshotsReply.md create mode 100644 koyeb/api/models/create_instance_snapshot_reply.py create mode 100644 koyeb/api/models/create_instance_snapshot_request.py create mode 100644 koyeb/api/models/delete_instance_snapshot_reply.py create mode 100644 koyeb/api/models/get_instance_snapshot_reply.py create mode 100644 koyeb/api/models/instance_snapshot.py create mode 100644 koyeb/api/models/instance_snapshot_event.py create mode 100644 koyeb/api/models/instance_snapshot_status.py create mode 100644 koyeb/api/models/instance_snapshot_type.py create mode 100644 koyeb/api/models/list_instance_snapshot_events_reply.py create mode 100644 koyeb/api/models/list_instance_snapshots_reply.py create mode 100644 koyeb/api/test/test_create_instance_snapshot_reply.py create mode 100644 koyeb/api/test/test_create_instance_snapshot_request.py create mode 100644 koyeb/api/test/test_delete_instance_snapshot_reply.py create mode 100644 koyeb/api/test/test_get_instance_snapshot_reply.py create mode 100644 koyeb/api/test/test_instance_snapshot.py create mode 100644 koyeb/api/test/test_instance_snapshot_event.py create mode 100644 koyeb/api/test/test_instance_snapshot_status.py create mode 100644 koyeb/api/test/test_instance_snapshot_type.py create mode 100644 koyeb/api/test/test_instance_snapshots_api.py create mode 100644 koyeb/api/test/test_list_instance_snapshot_events_reply.py create mode 100644 koyeb/api/test/test_list_instance_snapshots_reply.py create mode 100644 koyeb/api_async/api/instance_snapshots_api.py create mode 100644 koyeb/api_async/docs/CreateInstanceSnapshotReply.md create mode 100644 koyeb/api_async/docs/CreateInstanceSnapshotRequest.md create mode 100644 koyeb/api_async/docs/DeleteInstanceSnapshotReply.md create mode 100644 koyeb/api_async/docs/GetInstanceSnapshotReply.md create mode 100644 koyeb/api_async/docs/InstanceSnapshot.md create mode 100644 koyeb/api_async/docs/InstanceSnapshotEvent.md create mode 100644 koyeb/api_async/docs/InstanceSnapshotStatus.md create mode 100644 koyeb/api_async/docs/InstanceSnapshotType.md create mode 100644 koyeb/api_async/docs/InstanceSnapshotsApi.md create mode 100644 koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md create mode 100644 koyeb/api_async/docs/ListInstanceSnapshotsReply.md create mode 100644 koyeb/api_async/models/create_instance_snapshot_reply.py create mode 100644 koyeb/api_async/models/create_instance_snapshot_request.py create mode 100644 koyeb/api_async/models/delete_instance_snapshot_reply.py create mode 100644 koyeb/api_async/models/get_instance_snapshot_reply.py create mode 100644 koyeb/api_async/models/instance_snapshot.py create mode 100644 koyeb/api_async/models/instance_snapshot_event.py create mode 100644 koyeb/api_async/models/instance_snapshot_status.py create mode 100644 koyeb/api_async/models/instance_snapshot_type.py create mode 100644 koyeb/api_async/models/list_instance_snapshot_events_reply.py create mode 100644 koyeb/api_async/models/list_instance_snapshots_reply.py create mode 100644 koyeb/api_async/test/test_create_instance_snapshot_reply.py create mode 100644 koyeb/api_async/test/test_create_instance_snapshot_request.py create mode 100644 koyeb/api_async/test/test_delete_instance_snapshot_reply.py create mode 100644 koyeb/api_async/test/test_get_instance_snapshot_reply.py create mode 100644 koyeb/api_async/test/test_instance_snapshot.py create mode 100644 koyeb/api_async/test/test_instance_snapshot_event.py create mode 100644 koyeb/api_async/test/test_instance_snapshot_status.py create mode 100644 koyeb/api_async/test/test_instance_snapshot_type.py create mode 100644 koyeb/api_async/test/test_instance_snapshots_api.py create mode 100644 koyeb/api_async/test/test_list_instance_snapshot_events_reply.py create mode 100644 koyeb/api_async/test/test_list_instance_snapshots_reply.py diff --git a/koyeb/api/.openapi-generator/FILES b/koyeb/api/.openapi-generator/FILES index 15f841aa..1fc59e86 100644 --- a/koyeb/api/.openapi-generator/FILES +++ b/koyeb/api/.openapi-generator/FILES @@ -15,6 +15,7 @@ koyeb/api/api/credentials_api.py koyeb/api/api/deployments_api.py koyeb/api/api/docker_helper_api.py koyeb/api/api/domains_api.py +koyeb/api/api/instance_snapshots_api.py koyeb/api/api/instances_api.py koyeb/api/api/intercom_api.py koyeb/api/api/invite_api.py @@ -103,6 +104,8 @@ koyeb/api/docs/CreateCredential.md koyeb/api/docs/CreateCredentialReply.md koyeb/api/docs/CreateDomain.md koyeb/api/docs/CreateDomainReply.md +koyeb/api/docs/CreateInstanceSnapshotReply.md +koyeb/api/docs/CreateInstanceSnapshotRequest.md koyeb/api/docs/CreateOrganizationInvitationReply.md koyeb/api/docs/CreateOrganizationInvitationRequest.md koyeb/api/docs/CreateOrganizationReply.md @@ -133,6 +136,7 @@ koyeb/api/docs/DeactivateOrganizationRequest.md koyeb/api/docs/DeclareStageProgressRequest.md koyeb/api/docs/DeclareStepProgressRequest.md koyeb/api/docs/DeclineOrganizationInvitationReply.md +koyeb/api/docs/DeleteInstanceSnapshotReply.md koyeb/api/docs/DeleteOrganizationReply.md koyeb/api/docs/DeletePersistentVolumeReply.md koyeb/api/docs/DeleteSnapshotReply.md @@ -210,6 +214,7 @@ koyeb/api/docs/GetDomainReply.md koyeb/api/docs/GetGithubInstallationReply.md koyeb/api/docs/GetIdenfyTokenReply.md koyeb/api/docs/GetInstanceReply.md +koyeb/api/docs/GetInstanceSnapshotReply.md koyeb/api/docs/GetIntercomProfileReply.md koyeb/api/docs/GetMetricsReply.md koyeb/api/docs/GetMetricsReplyMetric.md @@ -249,6 +254,11 @@ koyeb/api/docs/Instance.md koyeb/api/docs/InstanceAvailability.md koyeb/api/docs/InstanceEvent.md koyeb/api/docs/InstanceListItem.md +koyeb/api/docs/InstanceSnapshot.md +koyeb/api/docs/InstanceSnapshotEvent.md +koyeb/api/docs/InstanceSnapshotStatus.md +koyeb/api/docs/InstanceSnapshotType.md +koyeb/api/docs/InstanceSnapshotsApi.md koyeb/api/docs/InstanceStatus.md koyeb/api/docs/InstanceUsage.md koyeb/api/docs/InstancesApi.md @@ -284,6 +294,8 @@ koyeb/api/docs/ListDeploymentEventsReply.md koyeb/api/docs/ListDeploymentsReply.md koyeb/api/docs/ListDomainsReply.md koyeb/api/docs/ListInstanceEventsReply.md +koyeb/api/docs/ListInstanceSnapshotEventsReply.md +koyeb/api/docs/ListInstanceSnapshotsReply.md koyeb/api/docs/ListInstancesReply.md koyeb/api/docs/ListOrganizationInvitationsReply.md koyeb/api/docs/ListOrganizationMembersReply.md @@ -523,6 +535,8 @@ koyeb/api/models/create_credential.py koyeb/api/models/create_credential_reply.py koyeb/api/models/create_domain.py koyeb/api/models/create_domain_reply.py +koyeb/api/models/create_instance_snapshot_reply.py +koyeb/api/models/create_instance_snapshot_request.py koyeb/api/models/create_organization_invitation_reply.py koyeb/api/models/create_organization_invitation_request.py koyeb/api/models/create_organization_reply.py @@ -552,6 +566,7 @@ koyeb/api/models/deactivate_organization_request.py koyeb/api/models/declare_stage_progress_request.py koyeb/api/models/declare_step_progress_request.py koyeb/api/models/decline_organization_invitation_reply.py +koyeb/api/models/delete_instance_snapshot_reply.py koyeb/api/models/delete_organization_reply.py koyeb/api/models/delete_persistent_volume_reply.py koyeb/api/models/delete_snapshot_reply.py @@ -626,6 +641,7 @@ koyeb/api/models/get_domain_reply.py koyeb/api/models/get_github_installation_reply.py koyeb/api/models/get_idenfy_token_reply.py koyeb/api/models/get_instance_reply.py +koyeb/api/models/get_instance_snapshot_reply.py koyeb/api/models/get_intercom_profile_reply.py koyeb/api/models/get_metrics_reply.py koyeb/api/models/get_metrics_reply_metric.py @@ -665,6 +681,10 @@ koyeb/api/models/instance.py koyeb/api/models/instance_availability.py koyeb/api/models/instance_event.py koyeb/api/models/instance_list_item.py +koyeb/api/models/instance_snapshot.py +koyeb/api/models/instance_snapshot_event.py +koyeb/api/models/instance_snapshot_status.py +koyeb/api/models/instance_snapshot_type.py koyeb/api/models/instance_status.py koyeb/api/models/instance_usage.py koyeb/api/models/instances_summary.py @@ -697,6 +717,8 @@ koyeb/api/models/list_deployment_events_reply.py koyeb/api/models/list_deployments_reply.py koyeb/api/models/list_domains_reply.py koyeb/api/models/list_instance_events_reply.py +koyeb/api/models/list_instance_snapshot_events_reply.py +koyeb/api/models/list_instance_snapshots_reply.py koyeb/api/models/list_instances_reply.py koyeb/api/models/list_organization_invitations_reply.py koyeb/api/models/list_organization_members_reply.py @@ -864,4 +886,15 @@ koyeb/api/models/verify_docker_image_reply.py koyeb/api/models/verify_docker_image_reply_err_code.py koyeb/api/rest.py koyeb/api/test/__init__.py +koyeb/api/test/test_create_instance_snapshot_reply.py +koyeb/api/test/test_create_instance_snapshot_request.py +koyeb/api/test/test_delete_instance_snapshot_reply.py +koyeb/api/test/test_get_instance_snapshot_reply.py +koyeb/api/test/test_instance_snapshot.py +koyeb/api/test/test_instance_snapshot_event.py +koyeb/api/test/test_instance_snapshot_status.py +koyeb/api/test/test_instance_snapshot_type.py +koyeb/api/test/test_instance_snapshots_api.py +koyeb/api/test/test_list_instance_snapshot_events_reply.py +koyeb/api/test/test_list_instance_snapshots_reply.py koyeb/api_README.md diff --git a/koyeb/api/.openapi-generator/VERSION b/koyeb/api/.openapi-generator/VERSION index 186c33c9..f7962df3 100644 --- a/koyeb/api/.openapi-generator/VERSION +++ b/koyeb/api/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0-SNAPSHOT +7.22.0-SNAPSHOT diff --git a/koyeb/api/__init__.py b/koyeb/api/__init__.py index deb88fcc..5b130bea 100644 --- a/koyeb/api/__init__.py +++ b/koyeb/api/__init__.py @@ -30,6 +30,7 @@ "DeploymentsApi", "DockerHelperApi", "DomainsApi", + "InstanceSnapshotsApi", "InstancesApi", "IntercomApi", "LogsApi", @@ -116,6 +117,8 @@ "CreateCredentialReply", "CreateDomain", "CreateDomainReply", + "CreateInstanceSnapshotReply", + "CreateInstanceSnapshotRequest", "CreateOrganizationInvitationReply", "CreateOrganizationInvitationRequest", "CreateOrganizationReply", @@ -145,6 +148,7 @@ "DeclareStageProgressRequest", "DeclareStepProgressRequest", "DeclineOrganizationInvitationReply", + "DeleteInstanceSnapshotReply", "DeleteOrganizationReply", "DeletePersistentVolumeReply", "DeleteSnapshotReply", @@ -219,6 +223,7 @@ "GetGithubInstallationReply", "GetIdenfyTokenReply", "GetInstanceReply", + "GetInstanceSnapshotReply", "GetIntercomProfileReply", "GetMetricsReply", "GetMetricsReplyMetric", @@ -258,6 +263,10 @@ "InstanceAvailability", "InstanceEvent", "InstanceListItem", + "InstanceSnapshot", + "InstanceSnapshotEvent", + "InstanceSnapshotStatus", + "InstanceSnapshotType", "InstanceStatus", "InstanceUsage", "InstancesSummary", @@ -290,6 +299,8 @@ "ListDeploymentsReply", "ListDomainsReply", "ListInstanceEventsReply", + "ListInstanceSnapshotEventsReply", + "ListInstanceSnapshotsReply", "ListInstancesReply", "ListOrganizationInvitationsReply", "ListOrganizationMembersReply", @@ -470,6 +481,7 @@ from koyeb.api.api.deployments_api import DeploymentsApi as DeploymentsApi from koyeb.api.api.docker_helper_api import DockerHelperApi as DockerHelperApi from koyeb.api.api.domains_api import DomainsApi as DomainsApi +from koyeb.api.api.instance_snapshots_api import InstanceSnapshotsApi as InstanceSnapshotsApi from koyeb.api.api.instances_api import InstancesApi as InstancesApi from koyeb.api.api.intercom_api import IntercomApi as IntercomApi from koyeb.api.api.logs_api import LogsApi as LogsApi @@ -560,6 +572,8 @@ from koyeb.api.models.create_credential_reply import CreateCredentialReply as CreateCredentialReply from koyeb.api.models.create_domain import CreateDomain as CreateDomain from koyeb.api.models.create_domain_reply import CreateDomainReply as CreateDomainReply +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply as CreateInstanceSnapshotReply +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest as CreateInstanceSnapshotRequest from koyeb.api.models.create_organization_invitation_reply import CreateOrganizationInvitationReply as CreateOrganizationInvitationReply from koyeb.api.models.create_organization_invitation_request import CreateOrganizationInvitationRequest as CreateOrganizationInvitationRequest from koyeb.api.models.create_organization_reply import CreateOrganizationReply as CreateOrganizationReply @@ -589,6 +603,7 @@ from koyeb.api.models.declare_stage_progress_request import DeclareStageProgressRequest as DeclareStageProgressRequest from koyeb.api.models.declare_step_progress_request import DeclareStepProgressRequest as DeclareStepProgressRequest from koyeb.api.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply as DeclineOrganizationInvitationReply +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply as DeleteInstanceSnapshotReply from koyeb.api.models.delete_organization_reply import DeleteOrganizationReply as DeleteOrganizationReply from koyeb.api.models.delete_persistent_volume_reply import DeletePersistentVolumeReply as DeletePersistentVolumeReply from koyeb.api.models.delete_snapshot_reply import DeleteSnapshotReply as DeleteSnapshotReply @@ -663,6 +678,7 @@ from koyeb.api.models.get_github_installation_reply import GetGithubInstallationReply as GetGithubInstallationReply from koyeb.api.models.get_idenfy_token_reply import GetIdenfyTokenReply as GetIdenfyTokenReply from koyeb.api.models.get_instance_reply import GetInstanceReply as GetInstanceReply +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply as GetInstanceSnapshotReply from koyeb.api.models.get_intercom_profile_reply import GetIntercomProfileReply as GetIntercomProfileReply from koyeb.api.models.get_metrics_reply import GetMetricsReply as GetMetricsReply from koyeb.api.models.get_metrics_reply_metric import GetMetricsReplyMetric as GetMetricsReplyMetric @@ -702,6 +718,10 @@ from koyeb.api.models.instance_availability import InstanceAvailability as InstanceAvailability from koyeb.api.models.instance_event import InstanceEvent as InstanceEvent from koyeb.api.models.instance_list_item import InstanceListItem as InstanceListItem +from koyeb.api.models.instance_snapshot import InstanceSnapshot as InstanceSnapshot +from koyeb.api.models.instance_snapshot_event import InstanceSnapshotEvent as InstanceSnapshotEvent +from koyeb.api.models.instance_snapshot_status import InstanceSnapshotStatus as InstanceSnapshotStatus +from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType as InstanceSnapshotType from koyeb.api.models.instance_status import InstanceStatus as InstanceStatus from koyeb.api.models.instance_usage import InstanceUsage as InstanceUsage from koyeb.api.models.instances_summary import InstancesSummary as InstancesSummary @@ -734,6 +754,8 @@ from koyeb.api.models.list_deployments_reply import ListDeploymentsReply as ListDeploymentsReply from koyeb.api.models.list_domains_reply import ListDomainsReply as ListDomainsReply from koyeb.api.models.list_instance_events_reply import ListInstanceEventsReply as ListInstanceEventsReply +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply as ListInstanceSnapshotEventsReply +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply as ListInstanceSnapshotsReply from koyeb.api.models.list_instances_reply import ListInstancesReply as ListInstancesReply from koyeb.api.models.list_organization_invitations_reply import ListOrganizationInvitationsReply as ListOrganizationInvitationsReply from koyeb.api.models.list_organization_members_reply import ListOrganizationMembersReply as ListOrganizationMembersReply diff --git a/koyeb/api/api/__init__.py b/koyeb/api/api/__init__.py index 0265b8f9..f3cbebef 100644 --- a/koyeb/api/api/__init__.py +++ b/koyeb/api/api/__init__.py @@ -13,6 +13,7 @@ from koyeb.api.api.deployments_api import DeploymentsApi from koyeb.api.api.docker_helper_api import DockerHelperApi from koyeb.api.api.domains_api import DomainsApi +from koyeb.api.api.instance_snapshots_api import InstanceSnapshotsApi from koyeb.api.api.instances_api import InstancesApi from koyeb.api.api.intercom_api import IntercomApi from koyeb.api.api.logs_api import LogsApi diff --git a/koyeb/api/api/instance_snapshots_api.py b/koyeb/api/api/instance_snapshots_api.py new file mode 100644 index 00000000..e6c3fc76 --- /dev/null +++ b/koyeb/api/api/instance_snapshots_api.py @@ -0,0 +1,1565 @@ +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +from koyeb.api.api_client import ApiClient, RequestSerialized +from koyeb.api.api_response import ApiResponse +from koyeb.api.rest import RESTResponseType + + +class InstanceSnapshotsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_instance_snapshot( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateInstanceSnapshotReply: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_instance_snapshot_with_http_info( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateInstanceSnapshotReply]: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_instance_snapshot_without_preload_content( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_instance_snapshot_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/instance_snapshots', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_instance_snapshot( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeleteInstanceSnapshotReply: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_instance_snapshot_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeleteInstanceSnapshotReply]: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_instance_snapshot_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_instance_snapshot_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/instance_snapshots/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_instance_snapshot( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetInstanceSnapshotReply: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_instance_snapshot_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetInstanceSnapshotReply]: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_instance_snapshot_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_instance_snapshot_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshots/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_instance_snapshot_events( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstanceSnapshotEventsReply: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_instance_snapshot_events_with_http_info( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstanceSnapshotEventsReply]: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_instance_snapshot_events_without_preload_content( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_instance_snapshot_events_serialize( + self, + instance_snapshot_id, + types, + limit, + offset, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if instance_snapshot_id is not None: + + _query_params.append(('instance_snapshot_id', instance_snapshot_id)) + + if types is not None: + + _query_params.append(('types', types)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshot_events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_instance_snapshots( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstanceSnapshotsReply: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_instance_snapshots_with_http_info( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstanceSnapshotsReply]: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_instance_snapshots_without_preload_content( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_instance_snapshots_serialize( + self, + limit, + offset, + name, + statuses, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'statuses': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if name is not None: + + _query_params.append(('name', name)) + + if statuses is not None: + + _query_params.append(('statuses', statuses)) + + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshots', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/koyeb/api/api_client.py b/koyeb/api/api_client.py index b53392f4..131a9093 100644 --- a/koyeb/api/api_client.py +++ b/koyeb/api/api_client.py @@ -98,13 +98,7 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - if self.rest_client is not None and hasattr(self.rest_client, 'pool_manager'): - self.rest_client.pool_manager.clear() - - async def close(self): - """Close the underlying HTTP connection pool.""" - if self.rest_client is not None and hasattr(self.rest_client, 'pool_manager'): - self.rest_client.pool_manager.clear() + pass @property def user_agent(self): @@ -377,24 +371,28 @@ def sanitize_for_serialization(self, obj): return obj.isoformat() elif isinstance(obj, decimal.Decimal): return str(obj) + elif isinstance(obj, dict): - return { - key: self.sanitize_for_serialization(val) - for key, val in obj.items() - } - - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): - obj_dict = obj.to_dict() + obj_dict = obj else: - obj_dict = obj.__dict__ + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return self.sanitize_for_serialization(obj_dict) + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. diff --git a/koyeb/api/configuration.py b/koyeb/api/configuration.py index ff94daa9..a1cfceb0 100644 --- a/koyeb/api/configuration.py +++ b/koyeb/api/configuration.py @@ -216,7 +216,7 @@ def __init__( server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, ssl_ca_cert: Optional[str]=None, - retries: Optional[Union[int, urllib3.util.retry.Retry]] = None, + retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, @@ -380,9 +380,9 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> Self: setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) - # use setter to re-create the file handler (excluded from __dict__ copy) + # use setters to configure loggers result.logger_file = self.logger_file - + result.debug = self.debug return result def __setattr__(self, name: str, value: Any) -> None: diff --git a/koyeb/api/docs/CreateInstanceSnapshotReply.md b/koyeb/api/docs/CreateInstanceSnapshotReply.md new file mode 100644 index 00000000..bf86d2c0 --- /dev/null +++ b/koyeb/api/docs/CreateInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# CreateInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceSnapshotReply from a JSON string +create_instance_snapshot_reply_instance = CreateInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceSnapshotReply.to_json()) + +# convert the object into a dict +create_instance_snapshot_reply_dict = create_instance_snapshot_reply_instance.to_dict() +# create an instance of CreateInstanceSnapshotReply from a dict +create_instance_snapshot_reply_from_dict = CreateInstanceSnapshotReply.from_dict(create_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CreateInstanceSnapshotRequest.md b/koyeb/api/docs/CreateInstanceSnapshotRequest.md new file mode 100644 index 00000000..845d854a --- /dev/null +++ b/koyeb/api/docs/CreateInstanceSnapshotRequest.md @@ -0,0 +1,31 @@ +# CreateInstanceSnapshotRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_id** | **str** | | [optional] +**name** | **str** | | [optional] +**type** | [**InstanceSnapshotType**](InstanceSnapshotType.md) | | [optional] [default to InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID] + +## Example + +```python +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceSnapshotRequest from a JSON string +create_instance_snapshot_request_instance = CreateInstanceSnapshotRequest.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceSnapshotRequest.to_json()) + +# convert the object into a dict +create_instance_snapshot_request_dict = create_instance_snapshot_request_instance.to_dict() +# create an instance of CreateInstanceSnapshotRequest from a dict +create_instance_snapshot_request_from_dict = CreateInstanceSnapshotRequest.from_dict(create_instance_snapshot_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CreateService.md b/koyeb/api/docs/CreateService.md index fc96580c..52e62f02 100644 --- a/koyeb/api/docs/CreateService.md +++ b/koyeb/api/docs/CreateService.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **definition** | [**DeploymentDefinition**](DeploymentDefinition.md) | | [optional] **life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional] **project_id** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] +**name** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/DeleteInstanceSnapshotReply.md b/koyeb/api/docs/DeleteInstanceSnapshotReply.md new file mode 100644 index 00000000..57d1d409 --- /dev/null +++ b/koyeb/api/docs/DeleteInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# DeleteInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteInstanceSnapshotReply from a JSON string +delete_instance_snapshot_reply_instance = DeleteInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(DeleteInstanceSnapshotReply.to_json()) + +# convert the object into a dict +delete_instance_snapshot_reply_dict = delete_instance_snapshot_reply_instance.to_dict() +# create an instance of DeleteInstanceSnapshotReply from a dict +delete_instance_snapshot_reply_from_dict = DeleteInstanceSnapshotReply.from_dict(delete_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/Deployment.md b/koyeb/api/docs/Deployment.md index 65137e15..23e61f1d 100644 --- a/koyeb/api/docs/Deployment.md +++ b/koyeb/api/docs/Deployment.md @@ -27,6 +27,7 @@ Name | Type | Description | Notes **role** | [**DeploymentRole**](DeploymentRole.md) | | [optional] [default to DeploymentRole.INVALID] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/DeploymentDefinition.md b/koyeb/api/docs/DeploymentDefinition.md index 56eed0f3..bb563cf8 100644 --- a/koyeb/api/docs/DeploymentDefinition.md +++ b/koyeb/api/docs/DeploymentDefinition.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | | [optional] +**name** | **str** | Service name. Deprecated, set it directly in the Service when creating it. | [optional] **type** | [**DeploymentDefinitionType**](DeploymentDefinitionType.md) | | [optional] [default to DeploymentDefinitionType.INVALID] **strategy** | [**DeploymentStrategy**](DeploymentStrategy.md) | | [optional] **routes** | [**List[DeploymentRoute]**](DeploymentRoute.md) | | [optional] diff --git a/koyeb/api/docs/DeploymentListItem.md b/koyeb/api/docs/DeploymentListItem.md index bdd25f8b..48b3cc39 100644 --- a/koyeb/api/docs/DeploymentListItem.md +++ b/koyeb/api/docs/DeploymentListItem.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **messages** | **List[str]** | | [optional] **provisioning_info** | [**DeploymentProvisioningInfo**](DeploymentProvisioningInfo.md) | | [optional] **database_info** | [**DeploymentDatabaseInfo**](DeploymentDatabaseInfo.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] diff --git a/koyeb/api/docs/GetInstanceSnapshotReply.md b/koyeb/api/docs/GetInstanceSnapshotReply.md new file mode 100644 index 00000000..852f5734 --- /dev/null +++ b/koyeb/api/docs/GetInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# GetInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of GetInstanceSnapshotReply from a JSON string +get_instance_snapshot_reply_instance = GetInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(GetInstanceSnapshotReply.to_json()) + +# convert the object into a dict +get_instance_snapshot_reply_dict = get_instance_snapshot_reply_instance.to_dict() +# create an instance of GetInstanceSnapshotReply from a dict +get_instance_snapshot_reply_from_dict = GetInstanceSnapshotReply.from_dict(get_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstanceSnapshot.md b/koyeb/api/docs/InstanceSnapshot.md new file mode 100644 index 00000000..2fbbae9f --- /dev/null +++ b/koyeb/api/docs/InstanceSnapshot.md @@ -0,0 +1,44 @@ +# InstanceSnapshot + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**updated_at** | **datetime** | | [optional] +**available_at** | **datetime** | | [optional] +**deleted_at** | **datetime** | | [optional] +**organization_id** | **str** | | [optional] +**project_id** | **str** | | [optional] +**service_id** | **str** | | [optional] +**deployment_id** | **str** | | [optional] +**regional_deployment_id** | **str** | | [optional] +**instance_id** | **str** | | [optional] +**status** | [**InstanceSnapshotStatus**](InstanceSnapshotStatus.md) | | [optional] [default to InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID] +**type** | [**InstanceSnapshotType**](InstanceSnapshotType.md) | | [optional] [default to InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID] +**version** | **str** | | [optional] +**messages** | **List[str]** | | [optional] + +## Example + +```python +from koyeb.api.models.instance_snapshot import InstanceSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceSnapshot from a JSON string +instance_snapshot_instance = InstanceSnapshot.from_json(json) +# print the JSON string representation of the object +print(InstanceSnapshot.to_json()) + +# convert the object into a dict +instance_snapshot_dict = instance_snapshot_instance.to_dict() +# create an instance of InstanceSnapshot from a dict +instance_snapshot_from_dict = InstanceSnapshot.from_dict(instance_snapshot_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstanceSnapshotEvent.md b/koyeb/api/docs/InstanceSnapshotEvent.md new file mode 100644 index 00000000..9019dcf1 --- /dev/null +++ b/koyeb/api/docs/InstanceSnapshotEvent.md @@ -0,0 +1,35 @@ +# InstanceSnapshotEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**when** | **datetime** | | [optional] +**organization_id** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] +**metadata** | **object** | | [optional] + +## Example + +```python +from koyeb.api.models.instance_snapshot_event import InstanceSnapshotEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceSnapshotEvent from a JSON string +instance_snapshot_event_instance = InstanceSnapshotEvent.from_json(json) +# print the JSON string representation of the object +print(InstanceSnapshotEvent.to_json()) + +# convert the object into a dict +instance_snapshot_event_dict = instance_snapshot_event_instance.to_dict() +# create an instance of InstanceSnapshotEvent from a dict +instance_snapshot_event_from_dict = InstanceSnapshotEvent.from_dict(instance_snapshot_event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstanceSnapshotStatus.md b/koyeb/api/docs/InstanceSnapshotStatus.md new file mode 100644 index 00000000..5bdc7e04 --- /dev/null +++ b/koyeb/api/docs/InstanceSnapshotStatus.md @@ -0,0 +1,20 @@ +# InstanceSnapshotStatus + + +## Enum + +* `INSTANCE_SNAPSHOT_STATUS_INVALID` (value: `'INSTANCE_SNAPSHOT_STATUS_INVALID'`) + +* `INSTANCE_SNAPSHOT_STATUS_CREATING` (value: `'INSTANCE_SNAPSHOT_STATUS_CREATING'`) + +* `INSTANCE_SNAPSHOT_STATUS_AVAILABLE` (value: `'INSTANCE_SNAPSHOT_STATUS_AVAILABLE'`) + +* `INSTANCE_SNAPSHOT_STATUS_ERROR` (value: `'INSTANCE_SNAPSHOT_STATUS_ERROR'`) + +* `INSTANCE_SNAPSHOT_STATUS_DELETING` (value: `'INSTANCE_SNAPSHOT_STATUS_DELETING'`) + +* `INSTANCE_SNAPSHOT_STATUS_DELETED` (value: `'INSTANCE_SNAPSHOT_STATUS_DELETED'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstanceSnapshotType.md b/koyeb/api/docs/InstanceSnapshotType.md new file mode 100644 index 00000000..68da5c51 --- /dev/null +++ b/koyeb/api/docs/InstanceSnapshotType.md @@ -0,0 +1,14 @@ +# InstanceSnapshotType + + +## Enum + +* `INSTANCE_SNAPSHOT_TYPE_INVALID` (value: `'INSTANCE_SNAPSHOT_TYPE_INVALID'`) + +* `INSTANCE_SNAPSHOT_TYPE_FILESYSTEM` (value: `'INSTANCE_SNAPSHOT_TYPE_FILESYSTEM'`) + +* `INSTANCE_SNAPSHOT_TYPE_FULL` (value: `'INSTANCE_SNAPSHOT_TYPE_FULL'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstanceSnapshotsApi.md b/koyeb/api/docs/InstanceSnapshotsApi.md new file mode 100644 index 00000000..c01d2bb7 --- /dev/null +++ b/koyeb/api/docs/InstanceSnapshotsApi.md @@ -0,0 +1,435 @@ +# koyeb.api.InstanceSnapshotsApi + +All URIs are relative to *https://app.koyeb.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_instance_snapshot**](InstanceSnapshotsApi.md#create_instance_snapshot) | **POST** /v1/instance_snapshots | +[**delete_instance_snapshot**](InstanceSnapshotsApi.md#delete_instance_snapshot) | **DELETE** /v1/instance_snapshots/{id} | +[**get_instance_snapshot**](InstanceSnapshotsApi.md#get_instance_snapshot) | **GET** /v1/instance_snapshots/{id} | +[**list_instance_snapshot_events**](InstanceSnapshotsApi.md#list_instance_snapshot_events) | **GET** /v1/instance_snapshot_events | +[**list_instance_snapshots**](InstanceSnapshotsApi.md#list_instance_snapshots) | **GET** /v1/instance_snapshots | + + +# **create_instance_snapshot** +> CreateInstanceSnapshotReply create_instance_snapshot(body) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.InstanceSnapshotsApi(api_client) + body = koyeb.api.CreateInstanceSnapshotRequest() # CreateInstanceSnapshotRequest | + + try: + api_response = api_instance.create_instance_snapshot(body) + print("The response of InstanceSnapshotsApi->create_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->create_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateInstanceSnapshotRequest**](CreateInstanceSnapshotRequest.md)| | + +### Return type + +[**CreateInstanceSnapshotReply**](CreateInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_instance_snapshot** +> DeleteInstanceSnapshotReply delete_instance_snapshot(id) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.InstanceSnapshotsApi(api_client) + id = 'id_example' # str | + + try: + api_response = api_instance.delete_instance_snapshot(id) + print("The response of InstanceSnapshotsApi->delete_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->delete_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**DeleteInstanceSnapshotReply**](DeleteInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_instance_snapshot** +> GetInstanceSnapshotReply get_instance_snapshot(id) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.InstanceSnapshotsApi(api_client) + id = 'id_example' # str | + + try: + api_response = api_instance.get_instance_snapshot(id) + print("The response of InstanceSnapshotsApi->get_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->get_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**GetInstanceSnapshotReply**](GetInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_instance_snapshot_events** +> ListInstanceSnapshotEventsReply list_instance_snapshot_events(instance_snapshot_id=instance_snapshot_id, types=types, limit=limit, offset=offset, order=order) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.InstanceSnapshotsApi(api_client) + instance_snapshot_id = 'instance_snapshot_id_example' # str | (Optional) Filter on instance snapshot id (optional) + types = ['types_example'] # List[str] | (Optional) Filter on instance snapshot event types (optional) + limit = 'limit_example' # str | (Optional) The number of items to return (optional) + offset = 'offset_example' # str | (Optional) The offset in the list of item to return (optional) + order = 'order_example' # str | (Optional) Sorts the list in the ascending or the descending order (optional) + + try: + api_response = api_instance.list_instance_snapshot_events(instance_snapshot_id=instance_snapshot_id, types=types, limit=limit, offset=offset, order=order) + print("The response of InstanceSnapshotsApi->list_instance_snapshot_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->list_instance_snapshot_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance_snapshot_id** | **str**| (Optional) Filter on instance snapshot id | [optional] + **types** | [**List[str]**](str.md)| (Optional) Filter on instance snapshot event types | [optional] + **limit** | **str**| (Optional) The number of items to return | [optional] + **offset** | **str**| (Optional) The offset in the list of item to return | [optional] + **order** | **str**| (Optional) Sorts the list in the ascending or the descending order | [optional] + +### Return type + +[**ListInstanceSnapshotEventsReply**](ListInstanceSnapshotEventsReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_instance_snapshots** +> ListInstanceSnapshotsReply list_instance_snapshots(limit=limit, offset=offset, name=name, statuses=statuses, type=type) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.InstanceSnapshotsApi(api_client) + limit = 'limit_example' # str | (optional) + offset = 'offset_example' # str | (optional) + name = 'name_example' # str | (optional) + statuses = ['statuses_example'] # List[str] | (optional) + type = INSTANCE_SNAPSHOT_TYPE_INVALID # str | (optional) (default to INSTANCE_SNAPSHOT_TYPE_INVALID) + + try: + api_response = api_instance.list_instance_snapshots(limit=limit, offset=offset, name=name, statuses=statuses, type=type) + print("The response of InstanceSnapshotsApi->list_instance_snapshots:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->list_instance_snapshots: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **str**| | [optional] + **offset** | **str**| | [optional] + **name** | **str**| | [optional] + **statuses** | [**List[str]**](str.md)| | [optional] + **type** | **str**| | [optional] [default to INSTANCE_SNAPSHOT_TYPE_INVALID] + +### Return type + +[**ListInstanceSnapshotsReply**](ListInstanceSnapshotsReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/koyeb/api/docs/ListInstanceSnapshotEventsReply.md b/koyeb/api/docs/ListInstanceSnapshotEventsReply.md new file mode 100644 index 00000000..f06e245b --- /dev/null +++ b/koyeb/api/docs/ListInstanceSnapshotEventsReply.md @@ -0,0 +1,33 @@ +# ListInstanceSnapshotEventsReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List[InstanceSnapshotEvent]**](InstanceSnapshotEvent.md) | | [optional] +**limit** | **int** | | [optional] +**offset** | **int** | | [optional] +**order** | **str** | | [optional] +**has_next** | **bool** | | [optional] + +## Example + +```python +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstanceSnapshotEventsReply from a JSON string +list_instance_snapshot_events_reply_instance = ListInstanceSnapshotEventsReply.from_json(json) +# print the JSON string representation of the object +print(ListInstanceSnapshotEventsReply.to_json()) + +# convert the object into a dict +list_instance_snapshot_events_reply_dict = list_instance_snapshot_events_reply_instance.to_dict() +# create an instance of ListInstanceSnapshotEventsReply from a dict +list_instance_snapshot_events_reply_from_dict = ListInstanceSnapshotEventsReply.from_dict(list_instance_snapshot_events_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/ListInstanceSnapshotsReply.md b/koyeb/api/docs/ListInstanceSnapshotsReply.md new file mode 100644 index 00000000..8c9226de --- /dev/null +++ b/koyeb/api/docs/ListInstanceSnapshotsReply.md @@ -0,0 +1,33 @@ +# ListInstanceSnapshotsReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshots** | [**List[InstanceSnapshot]**](InstanceSnapshot.md) | | [optional] +**limit** | **int** | | [optional] +**offset** | **int** | | [optional] +**count** | **int** | | [optional] +**has_next** | **bool** | | [optional] + +## Example + +```python +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstanceSnapshotsReply from a JSON string +list_instance_snapshots_reply_instance = ListInstanceSnapshotsReply.from_json(json) +# print the JSON string representation of the object +print(ListInstanceSnapshotsReply.to_json()) + +# convert the object into a dict +list_instance_snapshots_reply_dict = list_instance_snapshots_reply_instance.to_dict() +# create an instance of ListInstanceSnapshotsReply from a dict +list_instance_snapshots_reply_from_dict = ListInstanceSnapshotsReply.from_dict(list_instance_snapshots_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/RegionalDeployment.md b/koyeb/api/docs/RegionalDeployment.md index c0bce291..73354ced 100644 --- a/koyeb/api/docs/RegionalDeployment.md +++ b/koyeb/api/docs/RegionalDeployment.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **metadata** | **object** | | [optional] **provisioning_info** | [**DeploymentProvisioningInfo**](DeploymentProvisioningInfo.md) | | [optional] **role** | [**RegionalDeploymentRole**](RegionalDeploymentRole.md) | | [optional] [default to RegionalDeploymentRole.INVALID] +**instance_snapshot_id** | **str** | | [optional] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] **deployment_id** | **str** | | [optional] diff --git a/koyeb/api/docs/RegionalDeploymentListItem.md b/koyeb/api/docs/RegionalDeploymentListItem.md index 78d2aabb..894f57e0 100644 --- a/koyeb/api/docs/RegionalDeploymentListItem.md +++ b/koyeb/api/docs/RegionalDeploymentListItem.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**RegionalDeploymentStatus**](RegionalDeploymentStatus.md) | | [optional] [default to RegionalDeploymentStatus.PENDING] **messages** | **List[str]** | | [optional] **definition** | [**RegionalDeploymentDefinition**](RegionalDeploymentDefinition.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/UpdateService.md b/koyeb/api/docs/UpdateService.md index f8183f40..512ea4f8 100644 --- a/koyeb/api/docs/UpdateService.md +++ b/koyeb/api/docs/UpdateService.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **skip_build** | **bool** | If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. | [optional] **save_only** | **bool** | | [optional] **life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/models/__init__.py b/koyeb/api/models/__init__.py index 07ccfda1..1e3349de 100644 --- a/koyeb/api/models/__init__.py +++ b/koyeb/api/models/__init__.py @@ -59,6 +59,8 @@ from koyeb.api.models.create_credential_reply import CreateCredentialReply from koyeb.api.models.create_domain import CreateDomain from koyeb.api.models.create_domain_reply import CreateDomainReply +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest from koyeb.api.models.create_organization_invitation_reply import CreateOrganizationInvitationReply from koyeb.api.models.create_organization_invitation_request import CreateOrganizationInvitationRequest from koyeb.api.models.create_organization_reply import CreateOrganizationReply @@ -88,6 +90,7 @@ from koyeb.api.models.declare_stage_progress_request import DeclareStageProgressRequest from koyeb.api.models.declare_step_progress_request import DeclareStepProgressRequest from koyeb.api.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply from koyeb.api.models.delete_organization_reply import DeleteOrganizationReply from koyeb.api.models.delete_persistent_volume_reply import DeletePersistentVolumeReply from koyeb.api.models.delete_snapshot_reply import DeleteSnapshotReply @@ -162,6 +165,7 @@ from koyeb.api.models.get_github_installation_reply import GetGithubInstallationReply from koyeb.api.models.get_idenfy_token_reply import GetIdenfyTokenReply from koyeb.api.models.get_instance_reply import GetInstanceReply +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply from koyeb.api.models.get_intercom_profile_reply import GetIntercomProfileReply from koyeb.api.models.get_metrics_reply import GetMetricsReply from koyeb.api.models.get_metrics_reply_metric import GetMetricsReplyMetric @@ -201,6 +205,10 @@ from koyeb.api.models.instance_availability import InstanceAvailability from koyeb.api.models.instance_event import InstanceEvent from koyeb.api.models.instance_list_item import InstanceListItem +from koyeb.api.models.instance_snapshot import InstanceSnapshot +from koyeb.api.models.instance_snapshot_event import InstanceSnapshotEvent +from koyeb.api.models.instance_snapshot_status import InstanceSnapshotStatus +from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType from koyeb.api.models.instance_status import InstanceStatus from koyeb.api.models.instance_usage import InstanceUsage from koyeb.api.models.instances_summary import InstancesSummary @@ -233,6 +241,8 @@ from koyeb.api.models.list_deployments_reply import ListDeploymentsReply from koyeb.api.models.list_domains_reply import ListDomainsReply from koyeb.api.models.list_instance_events_reply import ListInstanceEventsReply +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply from koyeb.api.models.list_instances_reply import ListInstancesReply from koyeb.api.models.list_organization_invitations_reply import ListOrganizationInvitationsReply from koyeb.api.models.list_organization_members_reply import ListOrganizationMembersReply diff --git a/koyeb/api/models/create_instance_snapshot_reply.py b/koyeb/api/models/create_instance_snapshot_reply.py new file mode 100644 index 00000000..f7589938 --- /dev/null +++ b/koyeb/api/models/create_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateInstanceSnapshotReply(BaseModel): + """ + CreateInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/create_instance_snapshot_request.py b/koyeb/api/models/create_instance_snapshot_request.py new file mode 100644 index 00000000..126753cd --- /dev/null +++ b/koyeb/api/models/create_instance_snapshot_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateInstanceSnapshotRequest(BaseModel): + """ + CreateInstanceSnapshotRequest + """ # noqa: E501 + instance_id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + type: Optional[InstanceSnapshotType] = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + __properties: ClassVar[List[str]] = ["instance_id", "name", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_id": obj.get("instance_id"), + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + }) + return _obj + + diff --git a/koyeb/api/models/create_service.py b/koyeb/api/models/create_service.py index 04e5a9e7..399a4ce0 100644 --- a/koyeb/api/models/create_service.py +++ b/koyeb/api/models/create_service.py @@ -33,7 +33,9 @@ class CreateService(BaseModel): definition: Optional[DeploymentDefinition] = None life_cycle: Optional[ServiceLifeCycle] = None project_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle", "project_id"] + instance_snapshot_id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle", "project_id", "instance_snapshot_id", "name"] model_config = ConfigDict( validate_by_name=True, @@ -95,7 +97,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "app_id": obj.get("app_id"), "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, - "project_id": obj.get("project_id") + "project_id": obj.get("project_id"), + "instance_snapshot_id": obj.get("instance_snapshot_id"), + "name": obj.get("name") }) return _obj diff --git a/koyeb/api/models/delete_instance_snapshot_reply.py b/koyeb/api/models/delete_instance_snapshot_reply.py new file mode 100644 index 00000000..d7fbc380 --- /dev/null +++ b/koyeb/api/models/delete_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DeleteInstanceSnapshotReply(BaseModel): + """ + DeleteInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeleteInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeleteInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/deployment.py b/koyeb/api/models/deployment.py index f5814a35..bf803745 100644 --- a/koyeb/api/models/deployment.py +++ b/koyeb/api/models/deployment.py @@ -56,7 +56,8 @@ class Deployment(BaseModel): role: Optional[DeploymentRole] = DeploymentRole.INVALID version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "skip_build", "role", "version", "deployment_group"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "skip_build", "role", "version", "deployment_group", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -142,7 +143,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "skip_build": obj.get("skip_build"), "role": obj.get("role") if obj.get("role") is not None else DeploymentRole.INVALID, "version": obj.get("version"), - "deployment_group": obj.get("deployment_group") + "deployment_group": obj.get("deployment_group"), + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api/models/deployment_definition.py b/koyeb/api/models/deployment_definition.py index 8b23825a..10150611 100644 --- a/koyeb/api/models/deployment_definition.py +++ b/koyeb/api/models/deployment_definition.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.archive_source import ArchiveSource from koyeb.api.models.config_file import ConfigFile @@ -43,7 +43,7 @@ class DeploymentDefinition(BaseModel): """ DeploymentDefinition """ # noqa: E501 - name: Optional[StrictStr] = None + name: Optional[StrictStr] = Field(default=None, description="Service name. Deprecated, set it directly in the Service when creating it.") type: Optional[DeploymentDefinitionType] = DeploymentDefinitionType.INVALID strategy: Optional[DeploymentStrategy] = None routes: Optional[List[DeploymentRoute]] = None diff --git a/koyeb/api/models/deployment_list_item.py b/koyeb/api/models/deployment_list_item.py index 854d04fc..6f153d54 100644 --- a/koyeb/api/models/deployment_list_item.py +++ b/koyeb/api/models/deployment_list_item.py @@ -51,9 +51,10 @@ class DeploymentListItem(BaseModel): messages: Optional[List[StrictStr]] = None provisioning_info: Optional[DeploymentProvisioningInfo] = None database_info: Optional[DeploymentDatabaseInfo] = None + instance_snapshot_id: Optional[StrictStr] = None version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "version", "deployment_group"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "instance_snapshot_id", "version", "deployment_group"] model_config = ConfigDict( validate_by_name=True, @@ -136,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "messages": obj.get("messages"), "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, "database_info": DeploymentDatabaseInfo.from_dict(obj["database_info"]) if obj.get("database_info") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id"), "version": obj.get("version"), "deployment_group": obj.get("deployment_group") }) diff --git a/koyeb/api/models/exec_command_io.py b/koyeb/api/models/exec_command_io.py index eb3d337c..56e374f7 100644 --- a/koyeb/api/models/exec_command_io.py +++ b/koyeb/api/models/exec_command_io.py @@ -38,9 +38,6 @@ def data_validate_regular_expression(cls, value): if value is None: return value - if not isinstance(value, str): - value = str(value) - if not re.match(r"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", value): raise ValueError(r"must validate the regular expression /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/") return value diff --git a/koyeb/api/models/get_instance_snapshot_reply.py b/koyeb/api/models/get_instance_snapshot_reply.py new file mode 100644 index 00000000..f90ff55e --- /dev/null +++ b/koyeb/api/models/get_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetInstanceSnapshotReply(BaseModel): + """ + GetInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/instance_snapshot.py b/koyeb/api/models/instance_snapshot.py new file mode 100644 index 00000000..249ff387 --- /dev/null +++ b/koyeb/api/models/instance_snapshot.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot_status import InstanceSnapshotStatus +from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InstanceSnapshot(BaseModel): + """ + InstanceSnapshot + """ # noqa: E501 + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + available_at: Optional[datetime] = None + deleted_at: Optional[datetime] = None + organization_id: Optional[StrictStr] = None + project_id: Optional[StrictStr] = None + service_id: Optional[StrictStr] = None + deployment_id: Optional[StrictStr] = None + regional_deployment_id: Optional[StrictStr] = None + instance_id: Optional[StrictStr] = None + status: Optional[InstanceSnapshotStatus] = InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID + type: Optional[InstanceSnapshotType] = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + version: Optional[StrictStr] = None + messages: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["id", "name", "created_at", "updated_at", "available_at", "deleted_at", "organization_id", "project_id", "service_id", "deployment_id", "regional_deployment_id", "instance_id", "status", "type", "version", "messages"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceSnapshot from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "available_at": obj.get("available_at"), + "deleted_at": obj.get("deleted_at"), + "organization_id": obj.get("organization_id"), + "project_id": obj.get("project_id"), + "service_id": obj.get("service_id"), + "deployment_id": obj.get("deployment_id"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "instance_id": obj.get("instance_id"), + "status": obj.get("status") if obj.get("status") is not None else InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID, + "type": obj.get("type") if obj.get("type") is not None else InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID, + "version": obj.get("version"), + "messages": obj.get("messages") + }) + return _obj + + diff --git a/koyeb/api/models/instance_snapshot_event.py b/koyeb/api/models/instance_snapshot_event.py new file mode 100644 index 00000000..98076760 --- /dev/null +++ b/koyeb/api/models/instance_snapshot_event.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InstanceSnapshotEvent(BaseModel): + """ + InstanceSnapshotEvent + """ # noqa: E501 + id: Optional[StrictStr] = None + when: Optional[datetime] = None + organization_id: Optional[StrictStr] = None + instance_snapshot_id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + message: Optional[StrictStr] = None + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "instance_snapshot_id", "type", "message", "metadata"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceSnapshotEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceSnapshotEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "instance_snapshot_id": obj.get("instance_snapshot_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/koyeb/api/models/instance_snapshot_status.py b/koyeb/api/models/instance_snapshot_status.py new file mode 100644 index 00000000..a824eb6b --- /dev/null +++ b/koyeb/api/models/instance_snapshot_status.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class InstanceSnapshotStatus(str, Enum): + """ + InstanceSnapshotStatus + """ + + """ + allowed enum values + """ + INSTANCE_SNAPSHOT_STATUS_INVALID = 'INSTANCE_SNAPSHOT_STATUS_INVALID' + INSTANCE_SNAPSHOT_STATUS_CREATING = 'INSTANCE_SNAPSHOT_STATUS_CREATING' + INSTANCE_SNAPSHOT_STATUS_AVAILABLE = 'INSTANCE_SNAPSHOT_STATUS_AVAILABLE' + INSTANCE_SNAPSHOT_STATUS_ERROR = 'INSTANCE_SNAPSHOT_STATUS_ERROR' + INSTANCE_SNAPSHOT_STATUS_DELETING = 'INSTANCE_SNAPSHOT_STATUS_DELETING' + INSTANCE_SNAPSHOT_STATUS_DELETED = 'INSTANCE_SNAPSHOT_STATUS_DELETED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceSnapshotStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/instance_snapshot_type.py b/koyeb/api/models/instance_snapshot_type.py new file mode 100644 index 00000000..a83a50fb --- /dev/null +++ b/koyeb/api/models/instance_snapshot_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class InstanceSnapshotType(str, Enum): + """ + InstanceSnapshotType + """ + + """ + allowed enum values + """ + INSTANCE_SNAPSHOT_TYPE_INVALID = 'INSTANCE_SNAPSHOT_TYPE_INVALID' + INSTANCE_SNAPSHOT_TYPE_FILESYSTEM = 'INSTANCE_SNAPSHOT_TYPE_FILESYSTEM' + INSTANCE_SNAPSHOT_TYPE_FULL = 'INSTANCE_SNAPSHOT_TYPE_FULL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceSnapshotType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/list_instance_snapshot_events_reply.py b/koyeb/api/models/list_instance_snapshot_events_reply.py new file mode 100644 index 00000000..4420a81a --- /dev/null +++ b/koyeb/api/models/list_instance_snapshot_events_reply.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot_event import InstanceSnapshotEvent +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListInstanceSnapshotEventsReply(BaseModel): + """ + ListInstanceSnapshotEventsReply + """ # noqa: E501 + events: Optional[List[InstanceSnapshotEvent]] = None + limit: Optional[StrictInt] = None + offset: Optional[StrictInt] = None + order: Optional[StrictStr] = None + has_next: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotEventsReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in events (list) + _items = [] + if self.events: + for _item_events in self.events: + if _item_events: + _items.append(_item_events.to_dict()) + _dict['events'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotEventsReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": [InstanceSnapshotEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) + return _obj + + diff --git a/koyeb/api/models/list_instance_snapshots_reply.py b/koyeb/api/models/list_instance_snapshots_reply.py new file mode 100644 index 00000000..ea00c1a1 --- /dev/null +++ b/koyeb/api/models/list_instance_snapshots_reply.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListInstanceSnapshotsReply(BaseModel): + """ + ListInstanceSnapshotsReply + """ # noqa: E501 + instance_snapshots: Optional[List[InstanceSnapshot]] = None + limit: Optional[StrictInt] = None + offset: Optional[StrictInt] = None + count: Optional[StrictInt] = None + has_next: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["instance_snapshots", "limit", "offset", "count", "has_next"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotsReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instance_snapshots (list) + _items = [] + if self.instance_snapshots: + for _item_instance_snapshots in self.instance_snapshots: + if _item_instance_snapshots: + _items.append(_item_instance_snapshots.to_dict()) + _dict['instance_snapshots'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotsReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshots": [InstanceSnapshot.from_dict(_item) for _item in obj["instance_snapshots"]] if obj.get("instance_snapshots") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) + return _obj + + diff --git a/koyeb/api/models/regional_deployment.py b/koyeb/api/models/regional_deployment.py index 50f7a034..78c58023 100644 --- a/koyeb/api/models/regional_deployment.py +++ b/koyeb/api/models/regional_deployment.py @@ -53,10 +53,11 @@ class RegionalDeployment(BaseModel): metadata: Optional[Dict[str, Any]] = None provisioning_info: Optional[DeploymentProvisioningInfo] = None role: Optional[RegionalDeploymentRole] = RegionalDeploymentRole.INVALID + instance_snapshot_id: Optional[StrictStr] = None version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None deployment_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "scheduled_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "region", "parent_id", "child_id", "status", "messages", "definition", "datacenters", "metadata", "provisioning_info", "role", "version", "deployment_group", "deployment_id"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "scheduled_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "region", "parent_id", "child_id", "status", "messages", "definition", "datacenters", "metadata", "provisioning_info", "role", "instance_snapshot_id", "version", "deployment_group", "deployment_id"] model_config = ConfigDict( validate_by_name=True, @@ -136,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metadata": obj.get("metadata"), "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, "role": obj.get("role") if obj.get("role") is not None else RegionalDeploymentRole.INVALID, + "instance_snapshot_id": obj.get("instance_snapshot_id"), "version": obj.get("version"), "deployment_group": obj.get("deployment_group"), "deployment_id": obj.get("deployment_id") diff --git a/koyeb/api/models/regional_deployment_list_item.py b/koyeb/api/models/regional_deployment_list_item.py index f3619e59..5d8c0799 100644 --- a/koyeb/api/models/regional_deployment_list_item.py +++ b/koyeb/api/models/regional_deployment_list_item.py @@ -37,7 +37,8 @@ class RegionalDeploymentListItem(BaseModel): status: Optional[RegionalDeploymentStatus] = RegionalDeploymentStatus.PENDING messages: Optional[List[StrictStr]] = None definition: Optional[RegionalDeploymentDefinition] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "region", "status", "messages", "definition"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "region", "status", "messages", "definition", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -99,7 +100,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "region": obj.get("region"), "status": obj.get("status") if obj.get("status") is not None else RegionalDeploymentStatus.PENDING, "messages": obj.get("messages"), - "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None + "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api/models/update_service.py b/koyeb/api/models/update_service.py index 89c2394f..44737cd5 100644 --- a/koyeb/api/models/update_service.py +++ b/koyeb/api/models/update_service.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.deployment_definition import DeploymentDefinition from koyeb.api.models.deployment_metadata import DeploymentMetadata @@ -35,7 +35,8 @@ class UpdateService(BaseModel): skip_build: Optional[StrictBool] = Field(default=None, description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.") save_only: Optional[StrictBool] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = ["definition", "metadata", "skip_build", "save_only", "life_cycle"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["definition", "metadata", "skip_build", "save_only", "life_cycle", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -101,7 +102,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metadata": DeploymentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "skip_build": obj.get("skip_build"), "save_only": obj.get("save_only"), - "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api/test/test_create_instance_snapshot_reply.py b/koyeb/api/test/test_create_instance_snapshot_reply.py new file mode 100644 index 00000000..a66050a9 --- /dev/null +++ b/koyeb/api/test/test_create_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply + +class TestCreateInstanceSnapshotReply(unittest.TestCase): + """CreateInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateInstanceSnapshotReply: + """Test CreateInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateInstanceSnapshotReply` + """ + model = CreateInstanceSnapshotReply() + if include_optional: + return CreateInstanceSnapshotReply( + instance_snapshot = koyeb.api.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return CreateInstanceSnapshotReply( + ) + """ + + def testCreateInstanceSnapshotReply(self): + """Test CreateInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_create_instance_snapshot_request.py b/koyeb/api/test/test_create_instance_snapshot_request.py new file mode 100644 index 00000000..ca7c6a9c --- /dev/null +++ b/koyeb/api/test/test_create_instance_snapshot_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + +class TestCreateInstanceSnapshotRequest(unittest.TestCase): + """CreateInstanceSnapshotRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateInstanceSnapshotRequest: + """Test CreateInstanceSnapshotRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateInstanceSnapshotRequest` + """ + model = CreateInstanceSnapshotRequest() + if include_optional: + return CreateInstanceSnapshotRequest( + instance_id = '', + name = '', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID' + ) + else: + return CreateInstanceSnapshotRequest( + ) + """ + + def testCreateInstanceSnapshotRequest(self): + """Test CreateInstanceSnapshotRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_delete_instance_snapshot_reply.py b/koyeb/api/test/test_delete_instance_snapshot_reply.py new file mode 100644 index 00000000..ac3aa346 --- /dev/null +++ b/koyeb/api/test/test_delete_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply + +class TestDeleteInstanceSnapshotReply(unittest.TestCase): + """DeleteInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeleteInstanceSnapshotReply: + """Test DeleteInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeleteInstanceSnapshotReply` + """ + model = DeleteInstanceSnapshotReply() + if include_optional: + return DeleteInstanceSnapshotReply( + instance_snapshot = koyeb.api.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return DeleteInstanceSnapshotReply( + ) + """ + + def testDeleteInstanceSnapshotReply(self): + """Test DeleteInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_get_instance_snapshot_reply.py b/koyeb/api/test/test_get_instance_snapshot_reply.py new file mode 100644 index 00000000..f8756dd3 --- /dev/null +++ b/koyeb/api/test/test_get_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.get_instance_snapshot_reply import GetInstanceSnapshotReply + +class TestGetInstanceSnapshotReply(unittest.TestCase): + """GetInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetInstanceSnapshotReply: + """Test GetInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetInstanceSnapshotReply` + """ + model = GetInstanceSnapshotReply() + if include_optional: + return GetInstanceSnapshotReply( + instance_snapshot = koyeb.api.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return GetInstanceSnapshotReply( + ) + """ + + def testGetInstanceSnapshotReply(self): + """Test GetInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_instance_snapshot.py b/koyeb/api/test/test_instance_snapshot.py new file mode 100644 index 00000000..5e9268cb --- /dev/null +++ b/koyeb/api/test/test_instance_snapshot.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.instance_snapshot import InstanceSnapshot + +class TestInstanceSnapshot(unittest.TestCase): + """InstanceSnapshot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstanceSnapshot: + """Test InstanceSnapshot + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstanceSnapshot` + """ + model = InstanceSnapshot() + if include_optional: + return InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ] + ) + else: + return InstanceSnapshot( + ) + """ + + def testInstanceSnapshot(self): + """Test InstanceSnapshot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_instance_snapshot_event.py b/koyeb/api/test/test_instance_snapshot_event.py new file mode 100644 index 00000000..d38168ac --- /dev/null +++ b/koyeb/api/test/test_instance_snapshot_event.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.instance_snapshot_event import InstanceSnapshotEvent + +class TestInstanceSnapshotEvent(unittest.TestCase): + """InstanceSnapshotEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstanceSnapshotEvent: + """Test InstanceSnapshotEvent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstanceSnapshotEvent` + """ + model = InstanceSnapshotEvent() + if include_optional: + return InstanceSnapshotEvent( + id = '', + when = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + instance_snapshot_id = '', + type = '', + message = '', + metadata = None + ) + else: + return InstanceSnapshotEvent( + ) + """ + + def testInstanceSnapshotEvent(self): + """Test InstanceSnapshotEvent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_instance_snapshot_status.py b/koyeb/api/test/test_instance_snapshot_status.py new file mode 100644 index 00000000..62d85c83 --- /dev/null +++ b/koyeb/api/test/test_instance_snapshot_status.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.instance_snapshot_status import InstanceSnapshotStatus + +class TestInstanceSnapshotStatus(unittest.TestCase): + """InstanceSnapshotStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInstanceSnapshotStatus(self): + """Test InstanceSnapshotStatus""" + # inst = InstanceSnapshotStatus() + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_instance_snapshot_type.py b/koyeb/api/test/test_instance_snapshot_type.py new file mode 100644 index 00000000..69bc8cc2 --- /dev/null +++ b/koyeb/api/test/test_instance_snapshot_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType + +class TestInstanceSnapshotType(unittest.TestCase): + """InstanceSnapshotType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInstanceSnapshotType(self): + """Test InstanceSnapshotType""" + # inst = InstanceSnapshotType() + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_instance_snapshots_api.py b/koyeb/api/test/test_instance_snapshots_api.py new file mode 100644 index 00000000..c873c375 --- /dev/null +++ b/koyeb/api/test/test_instance_snapshots_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.api.instance_snapshots_api import InstanceSnapshotsApi + + +class TestInstanceSnapshotsApi(unittest.TestCase): + """InstanceSnapshotsApi unit test stubs""" + + def setUp(self) -> None: + self.api = InstanceSnapshotsApi() + + def tearDown(self) -> None: + pass + + def test_create_instance_snapshot(self) -> None: + """Test case for create_instance_snapshot + + """ + pass + + def test_delete_instance_snapshot(self) -> None: + """Test case for delete_instance_snapshot + + """ + pass + + def test_get_instance_snapshot(self) -> None: + """Test case for get_instance_snapshot + + """ + pass + + def test_list_instance_snapshot_events(self) -> None: + """Test case for list_instance_snapshot_events + + """ + pass + + def test_list_instance_snapshots(self) -> None: + """Test case for list_instance_snapshots + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_list_instance_snapshot_events_reply.py b/koyeb/api/test/test_list_instance_snapshot_events_reply.py new file mode 100644 index 00000000..d15c993a --- /dev/null +++ b/koyeb/api/test/test_list_instance_snapshot_events_reply.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply + +class TestListInstanceSnapshotEventsReply(unittest.TestCase): + """ListInstanceSnapshotEventsReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListInstanceSnapshotEventsReply: + """Test ListInstanceSnapshotEventsReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListInstanceSnapshotEventsReply` + """ + model = ListInstanceSnapshotEventsReply() + if include_optional: + return ListInstanceSnapshotEventsReply( + events = [ + koyeb.api.models.instance_snapshot_event.InstanceSnapshotEvent( + id = '', + when = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + instance_snapshot_id = '', + type = '', + message = '', + metadata = koyeb.api.models.metadata.metadata(), ) + ], + limit = 56, + offset = 56, + order = '', + has_next = True + ) + else: + return ListInstanceSnapshotEventsReply( + ) + """ + + def testListInstanceSnapshotEventsReply(self): + """Test ListInstanceSnapshotEventsReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_list_instance_snapshots_reply.py b/koyeb/api/test/test_list_instance_snapshots_reply.py new file mode 100644 index 00000000..5207afff --- /dev/null +++ b/koyeb/api/test/test_list_instance_snapshots_reply.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +class TestListInstanceSnapshotsReply(unittest.TestCase): + """ListInstanceSnapshotsReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListInstanceSnapshotsReply: + """Test ListInstanceSnapshotsReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListInstanceSnapshotsReply` + """ + model = ListInstanceSnapshotsReply() + if include_optional: + return ListInstanceSnapshotsReply( + instance_snapshots = [ + koyeb.api.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ], + limit = 56, + offset = 56, + count = 56, + has_next = True + ) + else: + return ListInstanceSnapshotsReply( + ) + """ + + def testListInstanceSnapshotsReply(self): + """Test ListInstanceSnapshotsReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_README.md b/koyeb/api_README.md index c3dd07d7..bfbcd59d 100644 --- a/koyeb/api_README.md +++ b/koyeb/api_README.md @@ -5,12 +5,12 @@ The `koyeb.api` package is automatically generated by the [OpenAPI Generator](ht - API version: 1.0.0 - Package version: 1.5.1 -- Generator version: 7.24.0-SNAPSHOT +- Generator version: 7.22.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.10+ +Python 3.9+ ## Installation & Usage @@ -111,6 +111,11 @@ Class | Method | HTTP request | Description *DomainsApi* | [**list_domains**](koyeb/api/docs/DomainsApi.md#list_domains) | **GET** /v1/domains | List Domains *DomainsApi* | [**refresh_domain_status**](koyeb/api/docs/DomainsApi.md#refresh_domain_status) | **POST** /v1/domains/{id}/refresh | Refresh Domain Status *DomainsApi* | [**update_domain**](koyeb/api/docs/DomainsApi.md#update_domain) | **PATCH** /v1/domains/{id} | Update Domain +*InstanceSnapshotsApi* | [**create_instance_snapshot**](koyeb/api/docs/InstanceSnapshotsApi.md#create_instance_snapshot) | **POST** /v1/instance_snapshots | +*InstanceSnapshotsApi* | [**delete_instance_snapshot**](koyeb/api/docs/InstanceSnapshotsApi.md#delete_instance_snapshot) | **DELETE** /v1/instance_snapshots/{id} | +*InstanceSnapshotsApi* | [**get_instance_snapshot**](koyeb/api/docs/InstanceSnapshotsApi.md#get_instance_snapshot) | **GET** /v1/instance_snapshots/{id} | +*InstanceSnapshotsApi* | [**list_instance_snapshot_events**](koyeb/api/docs/InstanceSnapshotsApi.md#list_instance_snapshot_events) | **GET** /v1/instance_snapshot_events | +*InstanceSnapshotsApi* | [**list_instance_snapshots**](koyeb/api/docs/InstanceSnapshotsApi.md#list_instance_snapshots) | **GET** /v1/instance_snapshots | *InstancesApi* | [**exec_command**](koyeb/api/docs/InstancesApi.md#exec_command) | **GET** /v1/streams/instances/exec | Exec Command *InstancesApi* | [**get_instance**](koyeb/api/docs/InstancesApi.md#get_instance) | **GET** /v1/instances/{id} | Get Instance *InstancesApi* | [**list_instance_events**](koyeb/api/docs/InstancesApi.md#list_instance_events) | **GET** /v1/instance_events | List Instance events @@ -296,6 +301,8 @@ Class | Method | HTTP request | Description - [CreateCredentialReply](koyeb/api/docs/CreateCredentialReply.md) - [CreateDomain](koyeb/api/docs/CreateDomain.md) - [CreateDomainReply](koyeb/api/docs/CreateDomainReply.md) + - [CreateInstanceSnapshotReply](koyeb/api/docs/CreateInstanceSnapshotReply.md) + - [CreateInstanceSnapshotRequest](koyeb/api/docs/CreateInstanceSnapshotRequest.md) - [CreateOrganizationInvitationReply](koyeb/api/docs/CreateOrganizationInvitationReply.md) - [CreateOrganizationInvitationRequest](koyeb/api/docs/CreateOrganizationInvitationRequest.md) - [CreateOrganizationReply](koyeb/api/docs/CreateOrganizationReply.md) @@ -325,6 +332,7 @@ Class | Method | HTTP request | Description - [DeclareStageProgressRequest](koyeb/api/docs/DeclareStageProgressRequest.md) - [DeclareStepProgressRequest](koyeb/api/docs/DeclareStepProgressRequest.md) - [DeclineOrganizationInvitationReply](koyeb/api/docs/DeclineOrganizationInvitationReply.md) + - [DeleteInstanceSnapshotReply](koyeb/api/docs/DeleteInstanceSnapshotReply.md) - [DeleteOrganizationReply](koyeb/api/docs/DeleteOrganizationReply.md) - [DeletePersistentVolumeReply](koyeb/api/docs/DeletePersistentVolumeReply.md) - [DeleteSnapshotReply](koyeb/api/docs/DeleteSnapshotReply.md) @@ -399,6 +407,7 @@ Class | Method | HTTP request | Description - [GetGithubInstallationReply](koyeb/api/docs/GetGithubInstallationReply.md) - [GetIdenfyTokenReply](koyeb/api/docs/GetIdenfyTokenReply.md) - [GetInstanceReply](koyeb/api/docs/GetInstanceReply.md) + - [GetInstanceSnapshotReply](koyeb/api/docs/GetInstanceSnapshotReply.md) - [GetIntercomProfileReply](koyeb/api/docs/GetIntercomProfileReply.md) - [GetMetricsReply](koyeb/api/docs/GetMetricsReply.md) - [GetMetricsReplyMetric](koyeb/api/docs/GetMetricsReplyMetric.md) @@ -438,6 +447,10 @@ Class | Method | HTTP request | Description - [InstanceAvailability](koyeb/api/docs/InstanceAvailability.md) - [InstanceEvent](koyeb/api/docs/InstanceEvent.md) - [InstanceListItem](koyeb/api/docs/InstanceListItem.md) + - [InstanceSnapshot](koyeb/api/docs/InstanceSnapshot.md) + - [InstanceSnapshotEvent](koyeb/api/docs/InstanceSnapshotEvent.md) + - [InstanceSnapshotStatus](koyeb/api/docs/InstanceSnapshotStatus.md) + - [InstanceSnapshotType](koyeb/api/docs/InstanceSnapshotType.md) - [InstanceStatus](koyeb/api/docs/InstanceStatus.md) - [InstanceUsage](koyeb/api/docs/InstanceUsage.md) - [InstancesSummary](koyeb/api/docs/InstancesSummary.md) @@ -470,6 +483,8 @@ Class | Method | HTTP request | Description - [ListDeploymentsReply](koyeb/api/docs/ListDeploymentsReply.md) - [ListDomainsReply](koyeb/api/docs/ListDomainsReply.md) - [ListInstanceEventsReply](koyeb/api/docs/ListInstanceEventsReply.md) + - [ListInstanceSnapshotEventsReply](koyeb/api/docs/ListInstanceSnapshotEventsReply.md) + - [ListInstanceSnapshotsReply](koyeb/api/docs/ListInstanceSnapshotsReply.md) - [ListInstancesReply](koyeb/api/docs/ListInstancesReply.md) - [ListOrganizationInvitationsReply](koyeb/api/docs/ListOrganizationInvitationsReply.md) - [ListOrganizationMembersReply](koyeb/api/docs/ListOrganizationMembersReply.md) diff --git a/koyeb/api_async/.openapi-generator/FILES b/koyeb/api_async/.openapi-generator/FILES index 98b25f2e..67fda01d 100644 --- a/koyeb/api_async/.openapi-generator/FILES +++ b/koyeb/api_async/.openapi-generator/FILES @@ -15,6 +15,7 @@ koyeb/api_async/api/credentials_api.py koyeb/api_async/api/deployments_api.py koyeb/api_async/api/docker_helper_api.py koyeb/api_async/api/domains_api.py +koyeb/api_async/api/instance_snapshots_api.py koyeb/api_async/api/instances_api.py koyeb/api_async/api/intercom_api.py koyeb/api_async/api/invite_api.py @@ -103,6 +104,8 @@ koyeb/api_async/docs/CreateCredential.md koyeb/api_async/docs/CreateCredentialReply.md koyeb/api_async/docs/CreateDomain.md koyeb/api_async/docs/CreateDomainReply.md +koyeb/api_async/docs/CreateInstanceSnapshotReply.md +koyeb/api_async/docs/CreateInstanceSnapshotRequest.md koyeb/api_async/docs/CreateOrganizationInvitationReply.md koyeb/api_async/docs/CreateOrganizationInvitationRequest.md koyeb/api_async/docs/CreateOrganizationReply.md @@ -133,6 +136,7 @@ koyeb/api_async/docs/DeactivateOrganizationRequest.md koyeb/api_async/docs/DeclareStageProgressRequest.md koyeb/api_async/docs/DeclareStepProgressRequest.md koyeb/api_async/docs/DeclineOrganizationInvitationReply.md +koyeb/api_async/docs/DeleteInstanceSnapshotReply.md koyeb/api_async/docs/DeleteOrganizationReply.md koyeb/api_async/docs/DeletePersistentVolumeReply.md koyeb/api_async/docs/DeleteSnapshotReply.md @@ -210,6 +214,7 @@ koyeb/api_async/docs/GetDomainReply.md koyeb/api_async/docs/GetGithubInstallationReply.md koyeb/api_async/docs/GetIdenfyTokenReply.md koyeb/api_async/docs/GetInstanceReply.md +koyeb/api_async/docs/GetInstanceSnapshotReply.md koyeb/api_async/docs/GetIntercomProfileReply.md koyeb/api_async/docs/GetMetricsReply.md koyeb/api_async/docs/GetMetricsReplyMetric.md @@ -249,6 +254,11 @@ koyeb/api_async/docs/Instance.md koyeb/api_async/docs/InstanceAvailability.md koyeb/api_async/docs/InstanceEvent.md koyeb/api_async/docs/InstanceListItem.md +koyeb/api_async/docs/InstanceSnapshot.md +koyeb/api_async/docs/InstanceSnapshotEvent.md +koyeb/api_async/docs/InstanceSnapshotStatus.md +koyeb/api_async/docs/InstanceSnapshotType.md +koyeb/api_async/docs/InstanceSnapshotsApi.md koyeb/api_async/docs/InstanceStatus.md koyeb/api_async/docs/InstanceUsage.md koyeb/api_async/docs/InstancesApi.md @@ -284,6 +294,8 @@ koyeb/api_async/docs/ListDeploymentEventsReply.md koyeb/api_async/docs/ListDeploymentsReply.md koyeb/api_async/docs/ListDomainsReply.md koyeb/api_async/docs/ListInstanceEventsReply.md +koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md +koyeb/api_async/docs/ListInstanceSnapshotsReply.md koyeb/api_async/docs/ListInstancesReply.md koyeb/api_async/docs/ListOrganizationInvitationsReply.md koyeb/api_async/docs/ListOrganizationMembersReply.md @@ -523,6 +535,8 @@ koyeb/api_async/models/create_credential.py koyeb/api_async/models/create_credential_reply.py koyeb/api_async/models/create_domain.py koyeb/api_async/models/create_domain_reply.py +koyeb/api_async/models/create_instance_snapshot_reply.py +koyeb/api_async/models/create_instance_snapshot_request.py koyeb/api_async/models/create_organization_invitation_reply.py koyeb/api_async/models/create_organization_invitation_request.py koyeb/api_async/models/create_organization_reply.py @@ -552,6 +566,7 @@ koyeb/api_async/models/deactivate_organization_request.py koyeb/api_async/models/declare_stage_progress_request.py koyeb/api_async/models/declare_step_progress_request.py koyeb/api_async/models/decline_organization_invitation_reply.py +koyeb/api_async/models/delete_instance_snapshot_reply.py koyeb/api_async/models/delete_organization_reply.py koyeb/api_async/models/delete_persistent_volume_reply.py koyeb/api_async/models/delete_snapshot_reply.py @@ -626,6 +641,7 @@ koyeb/api_async/models/get_domain_reply.py koyeb/api_async/models/get_github_installation_reply.py koyeb/api_async/models/get_idenfy_token_reply.py koyeb/api_async/models/get_instance_reply.py +koyeb/api_async/models/get_instance_snapshot_reply.py koyeb/api_async/models/get_intercom_profile_reply.py koyeb/api_async/models/get_metrics_reply.py koyeb/api_async/models/get_metrics_reply_metric.py @@ -665,6 +681,10 @@ koyeb/api_async/models/instance.py koyeb/api_async/models/instance_availability.py koyeb/api_async/models/instance_event.py koyeb/api_async/models/instance_list_item.py +koyeb/api_async/models/instance_snapshot.py +koyeb/api_async/models/instance_snapshot_event.py +koyeb/api_async/models/instance_snapshot_status.py +koyeb/api_async/models/instance_snapshot_type.py koyeb/api_async/models/instance_status.py koyeb/api_async/models/instance_usage.py koyeb/api_async/models/instances_summary.py @@ -697,6 +717,8 @@ koyeb/api_async/models/list_deployment_events_reply.py koyeb/api_async/models/list_deployments_reply.py koyeb/api_async/models/list_domains_reply.py koyeb/api_async/models/list_instance_events_reply.py +koyeb/api_async/models/list_instance_snapshot_events_reply.py +koyeb/api_async/models/list_instance_snapshots_reply.py koyeb/api_async/models/list_instances_reply.py koyeb/api_async/models/list_organization_invitations_reply.py koyeb/api_async/models/list_organization_members_reply.py @@ -864,4 +886,15 @@ koyeb/api_async/models/verify_docker_image_reply.py koyeb/api_async/models/verify_docker_image_reply_err_code.py koyeb/api_async/rest.py koyeb/api_async/test/__init__.py +koyeb/api_async/test/test_create_instance_snapshot_reply.py +koyeb/api_async/test/test_create_instance_snapshot_request.py +koyeb/api_async/test/test_delete_instance_snapshot_reply.py +koyeb/api_async/test/test_get_instance_snapshot_reply.py +koyeb/api_async/test/test_instance_snapshot.py +koyeb/api_async/test/test_instance_snapshot_event.py +koyeb/api_async/test/test_instance_snapshot_status.py +koyeb/api_async/test/test_instance_snapshot_type.py +koyeb/api_async/test/test_instance_snapshots_api.py +koyeb/api_async/test/test_list_instance_snapshot_events_reply.py +koyeb/api_async/test/test_list_instance_snapshots_reply.py koyeb/api_async_README.md diff --git a/koyeb/api_async/.openapi-generator/VERSION b/koyeb/api_async/.openapi-generator/VERSION index 186c33c9..f7962df3 100644 --- a/koyeb/api_async/.openapi-generator/VERSION +++ b/koyeb/api_async/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0-SNAPSHOT +7.22.0-SNAPSHOT diff --git a/koyeb/api_async/__init__.py b/koyeb/api_async/__init__.py index 93e0aece..27857813 100644 --- a/koyeb/api_async/__init__.py +++ b/koyeb/api_async/__init__.py @@ -30,6 +30,7 @@ "DeploymentsApi", "DockerHelperApi", "DomainsApi", + "InstanceSnapshotsApi", "InstancesApi", "IntercomApi", "LogsApi", @@ -116,6 +117,8 @@ "CreateCredentialReply", "CreateDomain", "CreateDomainReply", + "CreateInstanceSnapshotReply", + "CreateInstanceSnapshotRequest", "CreateOrganizationInvitationReply", "CreateOrganizationInvitationRequest", "CreateOrganizationReply", @@ -145,6 +148,7 @@ "DeclareStageProgressRequest", "DeclareStepProgressRequest", "DeclineOrganizationInvitationReply", + "DeleteInstanceSnapshotReply", "DeleteOrganizationReply", "DeletePersistentVolumeReply", "DeleteSnapshotReply", @@ -219,6 +223,7 @@ "GetGithubInstallationReply", "GetIdenfyTokenReply", "GetInstanceReply", + "GetInstanceSnapshotReply", "GetIntercomProfileReply", "GetMetricsReply", "GetMetricsReplyMetric", @@ -258,6 +263,10 @@ "InstanceAvailability", "InstanceEvent", "InstanceListItem", + "InstanceSnapshot", + "InstanceSnapshotEvent", + "InstanceSnapshotStatus", + "InstanceSnapshotType", "InstanceStatus", "InstanceUsage", "InstancesSummary", @@ -290,6 +299,8 @@ "ListDeploymentsReply", "ListDomainsReply", "ListInstanceEventsReply", + "ListInstanceSnapshotEventsReply", + "ListInstanceSnapshotsReply", "ListInstancesReply", "ListOrganizationInvitationsReply", "ListOrganizationMembersReply", @@ -470,6 +481,7 @@ from koyeb.api_async.api.deployments_api import DeploymentsApi as DeploymentsApi from koyeb.api_async.api.docker_helper_api import DockerHelperApi as DockerHelperApi from koyeb.api_async.api.domains_api import DomainsApi as DomainsApi +from koyeb.api_async.api.instance_snapshots_api import InstanceSnapshotsApi as InstanceSnapshotsApi from koyeb.api_async.api.instances_api import InstancesApi as InstancesApi from koyeb.api_async.api.intercom_api import IntercomApi as IntercomApi from koyeb.api_async.api.logs_api import LogsApi as LogsApi @@ -560,6 +572,8 @@ from koyeb.api_async.models.create_credential_reply import CreateCredentialReply as CreateCredentialReply from koyeb.api_async.models.create_domain import CreateDomain as CreateDomain from koyeb.api_async.models.create_domain_reply import CreateDomainReply as CreateDomainReply +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply as CreateInstanceSnapshotReply +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest as CreateInstanceSnapshotRequest from koyeb.api_async.models.create_organization_invitation_reply import CreateOrganizationInvitationReply as CreateOrganizationInvitationReply from koyeb.api_async.models.create_organization_invitation_request import CreateOrganizationInvitationRequest as CreateOrganizationInvitationRequest from koyeb.api_async.models.create_organization_reply import CreateOrganizationReply as CreateOrganizationReply @@ -589,6 +603,7 @@ from koyeb.api_async.models.declare_stage_progress_request import DeclareStageProgressRequest as DeclareStageProgressRequest from koyeb.api_async.models.declare_step_progress_request import DeclareStepProgressRequest as DeclareStepProgressRequest from koyeb.api_async.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply as DeclineOrganizationInvitationReply +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply as DeleteInstanceSnapshotReply from koyeb.api_async.models.delete_organization_reply import DeleteOrganizationReply as DeleteOrganizationReply from koyeb.api_async.models.delete_persistent_volume_reply import DeletePersistentVolumeReply as DeletePersistentVolumeReply from koyeb.api_async.models.delete_snapshot_reply import DeleteSnapshotReply as DeleteSnapshotReply @@ -663,6 +678,7 @@ from koyeb.api_async.models.get_github_installation_reply import GetGithubInstallationReply as GetGithubInstallationReply from koyeb.api_async.models.get_idenfy_token_reply import GetIdenfyTokenReply as GetIdenfyTokenReply from koyeb.api_async.models.get_instance_reply import GetInstanceReply as GetInstanceReply +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply as GetInstanceSnapshotReply from koyeb.api_async.models.get_intercom_profile_reply import GetIntercomProfileReply as GetIntercomProfileReply from koyeb.api_async.models.get_metrics_reply import GetMetricsReply as GetMetricsReply from koyeb.api_async.models.get_metrics_reply_metric import GetMetricsReplyMetric as GetMetricsReplyMetric @@ -702,6 +718,10 @@ from koyeb.api_async.models.instance_availability import InstanceAvailability as InstanceAvailability from koyeb.api_async.models.instance_event import InstanceEvent as InstanceEvent from koyeb.api_async.models.instance_list_item import InstanceListItem as InstanceListItem +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot as InstanceSnapshot +from koyeb.api_async.models.instance_snapshot_event import InstanceSnapshotEvent as InstanceSnapshotEvent +from koyeb.api_async.models.instance_snapshot_status import InstanceSnapshotStatus as InstanceSnapshotStatus +from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType as InstanceSnapshotType from koyeb.api_async.models.instance_status import InstanceStatus as InstanceStatus from koyeb.api_async.models.instance_usage import InstanceUsage as InstanceUsage from koyeb.api_async.models.instances_summary import InstancesSummary as InstancesSummary @@ -734,6 +754,8 @@ from koyeb.api_async.models.list_deployments_reply import ListDeploymentsReply as ListDeploymentsReply from koyeb.api_async.models.list_domains_reply import ListDomainsReply as ListDomainsReply from koyeb.api_async.models.list_instance_events_reply import ListInstanceEventsReply as ListInstanceEventsReply +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply as ListInstanceSnapshotEventsReply +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply as ListInstanceSnapshotsReply from koyeb.api_async.models.list_instances_reply import ListInstancesReply as ListInstancesReply from koyeb.api_async.models.list_organization_invitations_reply import ListOrganizationInvitationsReply as ListOrganizationInvitationsReply from koyeb.api_async.models.list_organization_members_reply import ListOrganizationMembersReply as ListOrganizationMembersReply diff --git a/koyeb/api_async/api/__init__.py b/koyeb/api_async/api/__init__.py index 54a7ce1e..0d1e28ff 100644 --- a/koyeb/api_async/api/__init__.py +++ b/koyeb/api_async/api/__init__.py @@ -13,6 +13,7 @@ from koyeb.api_async.api.deployments_api import DeploymentsApi from koyeb.api_async.api.docker_helper_api import DockerHelperApi from koyeb.api_async.api.domains_api import DomainsApi +from koyeb.api_async.api.instance_snapshots_api import InstanceSnapshotsApi from koyeb.api_async.api.instances_api import InstancesApi from koyeb.api_async.api.intercom_api import IntercomApi from koyeb.api_async.api.logs_api import LogsApi diff --git a/koyeb/api_async/api/instance_snapshots_api.py b/koyeb/api_async/api/instance_snapshots_api.py new file mode 100644 index 00000000..ce4f6680 --- /dev/null +++ b/koyeb/api_async/api/instance_snapshots_api.py @@ -0,0 +1,1565 @@ +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +from koyeb.api_async.api_client import ApiClient, RequestSerialized +from koyeb.api_async.api_response import ApiResponse +from koyeb.api_async.rest import RESTResponseType + + +class InstanceSnapshotsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def create_instance_snapshot( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateInstanceSnapshotReply: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_instance_snapshot_with_http_info( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateInstanceSnapshotReply]: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_instance_snapshot_without_preload_content( + self, + body: CreateInstanceSnapshotRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_instance_snapshot + + + :param body: (required) + :type body: CreateInstanceSnapshotRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_snapshot_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_instance_snapshot_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/instance_snapshots', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_instance_snapshot( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeleteInstanceSnapshotReply: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_instance_snapshot_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeleteInstanceSnapshotReply]: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_instance_snapshot_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_instance_snapshot_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/instance_snapshots/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_instance_snapshot( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetInstanceSnapshotReply: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_instance_snapshot_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetInstanceSnapshotReply]: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_instance_snapshot_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_instance_snapshot + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_snapshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetInstanceSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_instance_snapshot_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshots/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_instance_snapshot_events( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstanceSnapshotEventsReply: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_instance_snapshot_events_with_http_info( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstanceSnapshotEventsReply]: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_instance_snapshot_events_without_preload_content( + self, + instance_snapshot_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on instance snapshot id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance snapshot event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instance_snapshot_events + + + :param instance_snapshot_id: (Optional) Filter on instance snapshot id + :type instance_snapshot_id: str + :param types: (Optional) Filter on instance snapshot event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshot_events_serialize( + instance_snapshot_id=instance_snapshot_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_instance_snapshot_events_serialize( + self, + instance_snapshot_id, + types, + limit, + offset, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if instance_snapshot_id is not None: + + _query_params.append(('instance_snapshot_id', instance_snapshot_id)) + + if types is not None: + + _query_params.append(('types', types)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshot_events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_instance_snapshots( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstanceSnapshotsReply: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_instance_snapshots_with_http_info( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstanceSnapshotsReply]: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_instance_snapshots_without_preload_content( + self, + limit: Optional[StrictStr] = None, + offset: Optional[StrictStr] = None, + name: Optional[StrictStr] = None, + statuses: Optional[List[StrictStr]] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instance_snapshots + + + :param limit: + :type limit: str + :param offset: + :type offset: str + :param name: + :type name: str + :param statuses: + :type statuses: List[str] + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instance_snapshots_serialize( + limit=limit, + offset=offset, + name=name, + statuses=statuses, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstanceSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_instance_snapshots_serialize( + self, + limit, + offset, + name, + statuses, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'statuses': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if name is not None: + + _query_params.append(('name', name)) + + if statuses is not None: + + _query_params.append(('statuses', statuses)) + + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/instance_snapshots', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/koyeb/api_async/api_client.py b/koyeb/api_async/api_client.py index 572a2ce9..c7167af3 100644 --- a/koyeb/api_async/api_client.py +++ b/koyeb/api_async/api_client.py @@ -374,24 +374,28 @@ def sanitize_for_serialization(self, obj): return obj.isoformat() elif isinstance(obj, decimal.Decimal): return str(obj) + elif isinstance(obj, dict): - return { - key: self.sanitize_for_serialization(val) - for key, val in obj.items() - } - - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): - obj_dict = obj.to_dict() + obj_dict = obj else: - obj_dict = obj.__dict__ + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return self.sanitize_for_serialization(obj_dict) + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. diff --git a/koyeb/api_async/configuration.py b/koyeb/api_async/configuration.py index e3f22ad9..24c18b07 100644 --- a/koyeb/api_async/configuration.py +++ b/koyeb/api_async/configuration.py @@ -161,7 +161,7 @@ class Configuration: when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: int - Retry configuration. + :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. :param ca_cert_data: verify the peer using concatenated CA certificate data in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. @@ -215,7 +215,7 @@ def __init__( server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, ssl_ca_cert: Optional[str]=None, - retries: Optional[int] = None, + retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, @@ -378,9 +378,9 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> Self: setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) - # use setter to re-create the file handler (excluded from __dict__ copy) + # use setters to configure loggers result.logger_file = self.logger_file - + result.debug = self.debug return result def __setattr__(self, name: str, value: Any) -> None: diff --git a/koyeb/api_async/docs/CreateInstanceSnapshotReply.md b/koyeb/api_async/docs/CreateInstanceSnapshotReply.md new file mode 100644 index 00000000..23a8d86d --- /dev/null +++ b/koyeb/api_async/docs/CreateInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# CreateInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceSnapshotReply from a JSON string +create_instance_snapshot_reply_instance = CreateInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceSnapshotReply.to_json()) + +# convert the object into a dict +create_instance_snapshot_reply_dict = create_instance_snapshot_reply_instance.to_dict() +# create an instance of CreateInstanceSnapshotReply from a dict +create_instance_snapshot_reply_from_dict = CreateInstanceSnapshotReply.from_dict(create_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/CreateInstanceSnapshotRequest.md b/koyeb/api_async/docs/CreateInstanceSnapshotRequest.md new file mode 100644 index 00000000..52fa4444 --- /dev/null +++ b/koyeb/api_async/docs/CreateInstanceSnapshotRequest.md @@ -0,0 +1,31 @@ +# CreateInstanceSnapshotRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_id** | **str** | | [optional] +**name** | **str** | | [optional] +**type** | [**InstanceSnapshotType**](InstanceSnapshotType.md) | | [optional] [default to InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID] + +## Example + +```python +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceSnapshotRequest from a JSON string +create_instance_snapshot_request_instance = CreateInstanceSnapshotRequest.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceSnapshotRequest.to_json()) + +# convert the object into a dict +create_instance_snapshot_request_dict = create_instance_snapshot_request_instance.to_dict() +# create an instance of CreateInstanceSnapshotRequest from a dict +create_instance_snapshot_request_from_dict = CreateInstanceSnapshotRequest.from_dict(create_instance_snapshot_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/CreateService.md b/koyeb/api_async/docs/CreateService.md index 63f1f302..ecf4951c 100644 --- a/koyeb/api_async/docs/CreateService.md +++ b/koyeb/api_async/docs/CreateService.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **definition** | [**DeploymentDefinition**](DeploymentDefinition.md) | | [optional] **life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional] **project_id** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] +**name** | **str** | | [optional] ## Example diff --git a/koyeb/api_async/docs/DeleteInstanceSnapshotReply.md b/koyeb/api_async/docs/DeleteInstanceSnapshotReply.md new file mode 100644 index 00000000..9694861e --- /dev/null +++ b/koyeb/api_async/docs/DeleteInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# DeleteInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteInstanceSnapshotReply from a JSON string +delete_instance_snapshot_reply_instance = DeleteInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(DeleteInstanceSnapshotReply.to_json()) + +# convert the object into a dict +delete_instance_snapshot_reply_dict = delete_instance_snapshot_reply_instance.to_dict() +# create an instance of DeleteInstanceSnapshotReply from a dict +delete_instance_snapshot_reply_from_dict = DeleteInstanceSnapshotReply.from_dict(delete_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/Deployment.md b/koyeb/api_async/docs/Deployment.md index 5f184e0c..07493e02 100644 --- a/koyeb/api_async/docs/Deployment.md +++ b/koyeb/api_async/docs/Deployment.md @@ -27,6 +27,7 @@ Name | Type | Description | Notes **role** | [**DeploymentRole**](DeploymentRole.md) | | [optional] [default to DeploymentRole.INVALID] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api_async/docs/DeploymentDefinition.md b/koyeb/api_async/docs/DeploymentDefinition.md index b4424473..a2e56aa1 100644 --- a/koyeb/api_async/docs/DeploymentDefinition.md +++ b/koyeb/api_async/docs/DeploymentDefinition.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | | [optional] +**name** | **str** | Service name. Deprecated, set it directly in the Service when creating it. | [optional] **type** | [**DeploymentDefinitionType**](DeploymentDefinitionType.md) | | [optional] [default to DeploymentDefinitionType.INVALID] **strategy** | [**DeploymentStrategy**](DeploymentStrategy.md) | | [optional] **routes** | [**List[DeploymentRoute]**](DeploymentRoute.md) | | [optional] diff --git a/koyeb/api_async/docs/DeploymentListItem.md b/koyeb/api_async/docs/DeploymentListItem.md index e587d5ef..62642dde 100644 --- a/koyeb/api_async/docs/DeploymentListItem.md +++ b/koyeb/api_async/docs/DeploymentListItem.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **messages** | **List[str]** | | [optional] **provisioning_info** | [**DeploymentProvisioningInfo**](DeploymentProvisioningInfo.md) | | [optional] **database_info** | [**DeploymentDatabaseInfo**](DeploymentDatabaseInfo.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] diff --git a/koyeb/api_async/docs/GetInstanceSnapshotReply.md b/koyeb/api_async/docs/GetInstanceSnapshotReply.md new file mode 100644 index 00000000..e1a1de80 --- /dev/null +++ b/koyeb/api_async/docs/GetInstanceSnapshotReply.md @@ -0,0 +1,29 @@ +# GetInstanceSnapshotReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshot** | [**InstanceSnapshot**](InstanceSnapshot.md) | | [optional] + +## Example + +```python +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply + +# TODO update the JSON string below +json = "{}" +# create an instance of GetInstanceSnapshotReply from a JSON string +get_instance_snapshot_reply_instance = GetInstanceSnapshotReply.from_json(json) +# print the JSON string representation of the object +print(GetInstanceSnapshotReply.to_json()) + +# convert the object into a dict +get_instance_snapshot_reply_dict = get_instance_snapshot_reply_instance.to_dict() +# create an instance of GetInstanceSnapshotReply from a dict +get_instance_snapshot_reply_from_dict = GetInstanceSnapshotReply.from_dict(get_instance_snapshot_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/InstanceSnapshot.md b/koyeb/api_async/docs/InstanceSnapshot.md new file mode 100644 index 00000000..ff13eae2 --- /dev/null +++ b/koyeb/api_async/docs/InstanceSnapshot.md @@ -0,0 +1,44 @@ +# InstanceSnapshot + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**updated_at** | **datetime** | | [optional] +**available_at** | **datetime** | | [optional] +**deleted_at** | **datetime** | | [optional] +**organization_id** | **str** | | [optional] +**project_id** | **str** | | [optional] +**service_id** | **str** | | [optional] +**deployment_id** | **str** | | [optional] +**regional_deployment_id** | **str** | | [optional] +**instance_id** | **str** | | [optional] +**status** | [**InstanceSnapshotStatus**](InstanceSnapshotStatus.md) | | [optional] [default to InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID] +**type** | [**InstanceSnapshotType**](InstanceSnapshotType.md) | | [optional] [default to InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID] +**version** | **str** | | [optional] +**messages** | **List[str]** | | [optional] + +## Example + +```python +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceSnapshot from a JSON string +instance_snapshot_instance = InstanceSnapshot.from_json(json) +# print the JSON string representation of the object +print(InstanceSnapshot.to_json()) + +# convert the object into a dict +instance_snapshot_dict = instance_snapshot_instance.to_dict() +# create an instance of InstanceSnapshot from a dict +instance_snapshot_from_dict = InstanceSnapshot.from_dict(instance_snapshot_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/InstanceSnapshotEvent.md b/koyeb/api_async/docs/InstanceSnapshotEvent.md new file mode 100644 index 00000000..381a8a70 --- /dev/null +++ b/koyeb/api_async/docs/InstanceSnapshotEvent.md @@ -0,0 +1,35 @@ +# InstanceSnapshotEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**when** | **datetime** | | [optional] +**organization_id** | **str** | | [optional] +**instance_snapshot_id** | **str** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] +**metadata** | **object** | | [optional] + +## Example + +```python +from koyeb.api_async.models.instance_snapshot_event import InstanceSnapshotEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceSnapshotEvent from a JSON string +instance_snapshot_event_instance = InstanceSnapshotEvent.from_json(json) +# print the JSON string representation of the object +print(InstanceSnapshotEvent.to_json()) + +# convert the object into a dict +instance_snapshot_event_dict = instance_snapshot_event_instance.to_dict() +# create an instance of InstanceSnapshotEvent from a dict +instance_snapshot_event_from_dict = InstanceSnapshotEvent.from_dict(instance_snapshot_event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/InstanceSnapshotStatus.md b/koyeb/api_async/docs/InstanceSnapshotStatus.md new file mode 100644 index 00000000..5bdc7e04 --- /dev/null +++ b/koyeb/api_async/docs/InstanceSnapshotStatus.md @@ -0,0 +1,20 @@ +# InstanceSnapshotStatus + + +## Enum + +* `INSTANCE_SNAPSHOT_STATUS_INVALID` (value: `'INSTANCE_SNAPSHOT_STATUS_INVALID'`) + +* `INSTANCE_SNAPSHOT_STATUS_CREATING` (value: `'INSTANCE_SNAPSHOT_STATUS_CREATING'`) + +* `INSTANCE_SNAPSHOT_STATUS_AVAILABLE` (value: `'INSTANCE_SNAPSHOT_STATUS_AVAILABLE'`) + +* `INSTANCE_SNAPSHOT_STATUS_ERROR` (value: `'INSTANCE_SNAPSHOT_STATUS_ERROR'`) + +* `INSTANCE_SNAPSHOT_STATUS_DELETING` (value: `'INSTANCE_SNAPSHOT_STATUS_DELETING'`) + +* `INSTANCE_SNAPSHOT_STATUS_DELETED` (value: `'INSTANCE_SNAPSHOT_STATUS_DELETED'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/InstanceSnapshotType.md b/koyeb/api_async/docs/InstanceSnapshotType.md new file mode 100644 index 00000000..68da5c51 --- /dev/null +++ b/koyeb/api_async/docs/InstanceSnapshotType.md @@ -0,0 +1,14 @@ +# InstanceSnapshotType + + +## Enum + +* `INSTANCE_SNAPSHOT_TYPE_INVALID` (value: `'INSTANCE_SNAPSHOT_TYPE_INVALID'`) + +* `INSTANCE_SNAPSHOT_TYPE_FILESYSTEM` (value: `'INSTANCE_SNAPSHOT_TYPE_FILESYSTEM'`) + +* `INSTANCE_SNAPSHOT_TYPE_FULL` (value: `'INSTANCE_SNAPSHOT_TYPE_FULL'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/InstanceSnapshotsApi.md b/koyeb/api_async/docs/InstanceSnapshotsApi.md new file mode 100644 index 00000000..0d692e4c --- /dev/null +++ b/koyeb/api_async/docs/InstanceSnapshotsApi.md @@ -0,0 +1,435 @@ +# koyeb.api_async.InstanceSnapshotsApi + +All URIs are relative to *https://app.koyeb.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_instance_snapshot**](InstanceSnapshotsApi.md#create_instance_snapshot) | **POST** /v1/instance_snapshots | +[**delete_instance_snapshot**](InstanceSnapshotsApi.md#delete_instance_snapshot) | **DELETE** /v1/instance_snapshots/{id} | +[**get_instance_snapshot**](InstanceSnapshotsApi.md#get_instance_snapshot) | **GET** /v1/instance_snapshots/{id} | +[**list_instance_snapshot_events**](InstanceSnapshotsApi.md#list_instance_snapshot_events) | **GET** /v1/instance_snapshot_events | +[**list_instance_snapshots**](InstanceSnapshotsApi.md#list_instance_snapshots) | **GET** /v1/instance_snapshots | + + +# **create_instance_snapshot** +> CreateInstanceSnapshotReply create_instance_snapshot(body) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api_async +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest +from koyeb.api_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api_async.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with koyeb.api_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api_async.InstanceSnapshotsApi(api_client) + body = koyeb.api_async.CreateInstanceSnapshotRequest() # CreateInstanceSnapshotRequest | + + try: + api_response = await api_instance.create_instance_snapshot(body) + print("The response of InstanceSnapshotsApi->create_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->create_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateInstanceSnapshotRequest**](CreateInstanceSnapshotRequest.md)| | + +### Return type + +[**CreateInstanceSnapshotReply**](CreateInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_instance_snapshot** +> DeleteInstanceSnapshotReply delete_instance_snapshot(id) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api_async +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply +from koyeb.api_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api_async.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with koyeb.api_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api_async.InstanceSnapshotsApi(api_client) + id = 'id_example' # str | + + try: + api_response = await api_instance.delete_instance_snapshot(id) + print("The response of InstanceSnapshotsApi->delete_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->delete_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**DeleteInstanceSnapshotReply**](DeleteInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_instance_snapshot** +> GetInstanceSnapshotReply get_instance_snapshot(id) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api_async +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply +from koyeb.api_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api_async.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with koyeb.api_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api_async.InstanceSnapshotsApi(api_client) + id = 'id_example' # str | + + try: + api_response = await api_instance.get_instance_snapshot(id) + print("The response of InstanceSnapshotsApi->get_instance_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->get_instance_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**GetInstanceSnapshotReply**](GetInstanceSnapshotReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_instance_snapshot_events** +> ListInstanceSnapshotEventsReply list_instance_snapshot_events(instance_snapshot_id=instance_snapshot_id, types=types, limit=limit, offset=offset, order=order) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api_async +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api_async.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with koyeb.api_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api_async.InstanceSnapshotsApi(api_client) + instance_snapshot_id = 'instance_snapshot_id_example' # str | (Optional) Filter on instance snapshot id (optional) + types = ['types_example'] # List[str] | (Optional) Filter on instance snapshot event types (optional) + limit = 'limit_example' # str | (Optional) The number of items to return (optional) + offset = 'offset_example' # str | (Optional) The offset in the list of item to return (optional) + order = 'order_example' # str | (Optional) Sorts the list in the ascending or the descending order (optional) + + try: + api_response = await api_instance.list_instance_snapshot_events(instance_snapshot_id=instance_snapshot_id, types=types, limit=limit, offset=offset, order=order) + print("The response of InstanceSnapshotsApi->list_instance_snapshot_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->list_instance_snapshot_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance_snapshot_id** | **str**| (Optional) Filter on instance snapshot id | [optional] + **types** | [**List[str]**](str.md)| (Optional) Filter on instance snapshot event types | [optional] + **limit** | **str**| (Optional) The number of items to return | [optional] + **offset** | **str**| (Optional) The offset in the list of item to return | [optional] + **order** | **str**| (Optional) Sorts the list in the ascending or the descending order | [optional] + +### Return type + +[**ListInstanceSnapshotEventsReply**](ListInstanceSnapshotEventsReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_instance_snapshots** +> ListInstanceSnapshotsReply list_instance_snapshots(limit=limit, offset=offset, name=name, statuses=statuses, type=type) + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api_async +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply +from koyeb.api_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api_async.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with koyeb.api_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api_async.InstanceSnapshotsApi(api_client) + limit = 'limit_example' # str | (optional) + offset = 'offset_example' # str | (optional) + name = 'name_example' # str | (optional) + statuses = ['statuses_example'] # List[str] | (optional) + type = INSTANCE_SNAPSHOT_TYPE_INVALID # str | (optional) (default to INSTANCE_SNAPSHOT_TYPE_INVALID) + + try: + api_response = await api_instance.list_instance_snapshots(limit=limit, offset=offset, name=name, statuses=statuses, type=type) + print("The response of InstanceSnapshotsApi->list_instance_snapshots:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InstanceSnapshotsApi->list_instance_snapshots: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **str**| | [optional] + **offset** | **str**| | [optional] + **name** | **str**| | [optional] + **statuses** | [**List[str]**](str.md)| | [optional] + **type** | **str**| | [optional] [default to INSTANCE_SNAPSHOT_TYPE_INVALID] + +### Return type + +[**ListInstanceSnapshotsReply**](ListInstanceSnapshotsReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md b/koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md new file mode 100644 index 00000000..8c857359 --- /dev/null +++ b/koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md @@ -0,0 +1,33 @@ +# ListInstanceSnapshotEventsReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List[InstanceSnapshotEvent]**](InstanceSnapshotEvent.md) | | [optional] +**limit** | **int** | | [optional] +**offset** | **int** | | [optional] +**order** | **str** | | [optional] +**has_next** | **bool** | | [optional] + +## Example + +```python +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstanceSnapshotEventsReply from a JSON string +list_instance_snapshot_events_reply_instance = ListInstanceSnapshotEventsReply.from_json(json) +# print the JSON string representation of the object +print(ListInstanceSnapshotEventsReply.to_json()) + +# convert the object into a dict +list_instance_snapshot_events_reply_dict = list_instance_snapshot_events_reply_instance.to_dict() +# create an instance of ListInstanceSnapshotEventsReply from a dict +list_instance_snapshot_events_reply_from_dict = ListInstanceSnapshotEventsReply.from_dict(list_instance_snapshot_events_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/ListInstanceSnapshotsReply.md b/koyeb/api_async/docs/ListInstanceSnapshotsReply.md new file mode 100644 index 00000000..0e6d0f41 --- /dev/null +++ b/koyeb/api_async/docs/ListInstanceSnapshotsReply.md @@ -0,0 +1,33 @@ +# ListInstanceSnapshotsReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_snapshots** | [**List[InstanceSnapshot]**](InstanceSnapshot.md) | | [optional] +**limit** | **int** | | [optional] +**offset** | **int** | | [optional] +**count** | **int** | | [optional] +**has_next** | **bool** | | [optional] + +## Example + +```python +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstanceSnapshotsReply from a JSON string +list_instance_snapshots_reply_instance = ListInstanceSnapshotsReply.from_json(json) +# print the JSON string representation of the object +print(ListInstanceSnapshotsReply.to_json()) + +# convert the object into a dict +list_instance_snapshots_reply_dict = list_instance_snapshots_reply_instance.to_dict() +# create an instance of ListInstanceSnapshotsReply from a dict +list_instance_snapshots_reply_from_dict = ListInstanceSnapshotsReply.from_dict(list_instance_snapshots_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api_async/docs/RegionalDeployment.md b/koyeb/api_async/docs/RegionalDeployment.md index c6da357b..bb04383c 100644 --- a/koyeb/api_async/docs/RegionalDeployment.md +++ b/koyeb/api_async/docs/RegionalDeployment.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **metadata** | **object** | | [optional] **provisioning_info** | [**DeploymentProvisioningInfo**](DeploymentProvisioningInfo.md) | | [optional] **role** | [**RegionalDeploymentRole**](RegionalDeploymentRole.md) | | [optional] [default to RegionalDeploymentRole.INVALID] +**instance_snapshot_id** | **str** | | [optional] **version** | **str** | | [optional] **deployment_group** | **str** | | [optional] **deployment_id** | **str** | | [optional] diff --git a/koyeb/api_async/docs/RegionalDeploymentListItem.md b/koyeb/api_async/docs/RegionalDeploymentListItem.md index 620d46a3..75af0e05 100644 --- a/koyeb/api_async/docs/RegionalDeploymentListItem.md +++ b/koyeb/api_async/docs/RegionalDeploymentListItem.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**RegionalDeploymentStatus**](RegionalDeploymentStatus.md) | | [optional] [default to RegionalDeploymentStatus.PENDING] **messages** | **List[str]** | | [optional] **definition** | [**RegionalDeploymentDefinition**](RegionalDeploymentDefinition.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api_async/docs/UpdateService.md b/koyeb/api_async/docs/UpdateService.md index bb3aa9cd..b2802edf 100644 --- a/koyeb/api_async/docs/UpdateService.md +++ b/koyeb/api_async/docs/UpdateService.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **skip_build** | **bool** | If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. | [optional] **save_only** | **bool** | | [optional] **life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional] +**instance_snapshot_id** | **str** | | [optional] ## Example diff --git a/koyeb/api_async/models/__init__.py b/koyeb/api_async/models/__init__.py index b08cbf6f..06a480d2 100644 --- a/koyeb/api_async/models/__init__.py +++ b/koyeb/api_async/models/__init__.py @@ -59,6 +59,8 @@ from koyeb.api_async.models.create_credential_reply import CreateCredentialReply from koyeb.api_async.models.create_domain import CreateDomain from koyeb.api_async.models.create_domain_reply import CreateDomainReply +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest from koyeb.api_async.models.create_organization_invitation_reply import CreateOrganizationInvitationReply from koyeb.api_async.models.create_organization_invitation_request import CreateOrganizationInvitationRequest from koyeb.api_async.models.create_organization_reply import CreateOrganizationReply @@ -88,6 +90,7 @@ from koyeb.api_async.models.declare_stage_progress_request import DeclareStageProgressRequest from koyeb.api_async.models.declare_step_progress_request import DeclareStepProgressRequest from koyeb.api_async.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply from koyeb.api_async.models.delete_organization_reply import DeleteOrganizationReply from koyeb.api_async.models.delete_persistent_volume_reply import DeletePersistentVolumeReply from koyeb.api_async.models.delete_snapshot_reply import DeleteSnapshotReply @@ -162,6 +165,7 @@ from koyeb.api_async.models.get_github_installation_reply import GetGithubInstallationReply from koyeb.api_async.models.get_idenfy_token_reply import GetIdenfyTokenReply from koyeb.api_async.models.get_instance_reply import GetInstanceReply +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply from koyeb.api_async.models.get_intercom_profile_reply import GetIntercomProfileReply from koyeb.api_async.models.get_metrics_reply import GetMetricsReply from koyeb.api_async.models.get_metrics_reply_metric import GetMetricsReplyMetric @@ -201,6 +205,10 @@ from koyeb.api_async.models.instance_availability import InstanceAvailability from koyeb.api_async.models.instance_event import InstanceEvent from koyeb.api_async.models.instance_list_item import InstanceListItem +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot +from koyeb.api_async.models.instance_snapshot_event import InstanceSnapshotEvent +from koyeb.api_async.models.instance_snapshot_status import InstanceSnapshotStatus +from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType from koyeb.api_async.models.instance_status import InstanceStatus from koyeb.api_async.models.instance_usage import InstanceUsage from koyeb.api_async.models.instances_summary import InstancesSummary @@ -233,6 +241,8 @@ from koyeb.api_async.models.list_deployments_reply import ListDeploymentsReply from koyeb.api_async.models.list_domains_reply import ListDomainsReply from koyeb.api_async.models.list_instance_events_reply import ListInstanceEventsReply +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply from koyeb.api_async.models.list_instances_reply import ListInstancesReply from koyeb.api_async.models.list_organization_invitations_reply import ListOrganizationInvitationsReply from koyeb.api_async.models.list_organization_members_reply import ListOrganizationMembersReply diff --git a/koyeb/api_async/models/create_instance_snapshot_reply.py b/koyeb/api_async/models/create_instance_snapshot_reply.py new file mode 100644 index 00000000..80e055f5 --- /dev/null +++ b/koyeb/api_async/models/create_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateInstanceSnapshotReply(BaseModel): + """ + CreateInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api_async/models/create_instance_snapshot_request.py b/koyeb/api_async/models/create_instance_snapshot_request.py new file mode 100644 index 00000000..a6eb8343 --- /dev/null +++ b/koyeb/api_async/models/create_instance_snapshot_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateInstanceSnapshotRequest(BaseModel): + """ + CreateInstanceSnapshotRequest + """ # noqa: E501 + instance_id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + type: Optional[InstanceSnapshotType] = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + __properties: ClassVar[List[str]] = ["instance_id", "name", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceSnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_id": obj.get("instance_id"), + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + }) + return _obj + + diff --git a/koyeb/api_async/models/create_service.py b/koyeb/api_async/models/create_service.py index ed9b3ae7..1673442d 100644 --- a/koyeb/api_async/models/create_service.py +++ b/koyeb/api_async/models/create_service.py @@ -33,7 +33,9 @@ class CreateService(BaseModel): definition: Optional[DeploymentDefinition] = None life_cycle: Optional[ServiceLifeCycle] = None project_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle", "project_id"] + instance_snapshot_id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle", "project_id", "instance_snapshot_id", "name"] model_config = ConfigDict( validate_by_name=True, @@ -95,7 +97,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "app_id": obj.get("app_id"), "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, - "project_id": obj.get("project_id") + "project_id": obj.get("project_id"), + "instance_snapshot_id": obj.get("instance_snapshot_id"), + "name": obj.get("name") }) return _obj diff --git a/koyeb/api_async/models/delete_instance_snapshot_reply.py b/koyeb/api_async/models/delete_instance_snapshot_reply.py new file mode 100644 index 00000000..16141524 --- /dev/null +++ b/koyeb/api_async/models/delete_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DeleteInstanceSnapshotReply(BaseModel): + """ + DeleteInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeleteInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeleteInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api_async/models/deployment.py b/koyeb/api_async/models/deployment.py index e0a8410b..19498f28 100644 --- a/koyeb/api_async/models/deployment.py +++ b/koyeb/api_async/models/deployment.py @@ -56,7 +56,8 @@ class Deployment(BaseModel): role: Optional[DeploymentRole] = DeploymentRole.INVALID version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "skip_build", "role", "version", "deployment_group"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "skip_build", "role", "version", "deployment_group", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -142,7 +143,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "skip_build": obj.get("skip_build"), "role": obj.get("role") if obj.get("role") is not None else DeploymentRole.INVALID, "version": obj.get("version"), - "deployment_group": obj.get("deployment_group") + "deployment_group": obj.get("deployment_group"), + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api_async/models/deployment_definition.py b/koyeb/api_async/models/deployment_definition.py index 687573d1..39f6af31 100644 --- a/koyeb/api_async/models/deployment_definition.py +++ b/koyeb/api_async/models/deployment_definition.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api_async.models.archive_source import ArchiveSource from koyeb.api_async.models.config_file import ConfigFile @@ -43,7 +43,7 @@ class DeploymentDefinition(BaseModel): """ DeploymentDefinition """ # noqa: E501 - name: Optional[StrictStr] = None + name: Optional[StrictStr] = Field(default=None, description="Service name. Deprecated, set it directly in the Service when creating it.") type: Optional[DeploymentDefinitionType] = DeploymentDefinitionType.INVALID strategy: Optional[DeploymentStrategy] = None routes: Optional[List[DeploymentRoute]] = None diff --git a/koyeb/api_async/models/deployment_list_item.py b/koyeb/api_async/models/deployment_list_item.py index b12ae858..525fac10 100644 --- a/koyeb/api_async/models/deployment_list_item.py +++ b/koyeb/api_async/models/deployment_list_item.py @@ -51,9 +51,10 @@ class DeploymentListItem(BaseModel): messages: Optional[List[StrictStr]] = None provisioning_info: Optional[DeploymentProvisioningInfo] = None database_info: Optional[DeploymentDatabaseInfo] = None + instance_snapshot_id: Optional[StrictStr] = None version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "version", "deployment_group"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "instance_snapshot_id", "version", "deployment_group"] model_config = ConfigDict( validate_by_name=True, @@ -136,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "messages": obj.get("messages"), "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, "database_info": DeploymentDatabaseInfo.from_dict(obj["database_info"]) if obj.get("database_info") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id"), "version": obj.get("version"), "deployment_group": obj.get("deployment_group") }) diff --git a/koyeb/api_async/models/exec_command_io.py b/koyeb/api_async/models/exec_command_io.py index eb3d337c..56e374f7 100644 --- a/koyeb/api_async/models/exec_command_io.py +++ b/koyeb/api_async/models/exec_command_io.py @@ -38,9 +38,6 @@ def data_validate_regular_expression(cls, value): if value is None: return value - if not isinstance(value, str): - value = str(value) - if not re.match(r"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", value): raise ValueError(r"must validate the regular expression /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/") return value diff --git a/koyeb/api_async/models/get_instance_snapshot_reply.py b/koyeb/api_async/models/get_instance_snapshot_reply.py new file mode 100644 index 00000000..2d0980c6 --- /dev/null +++ b/koyeb/api_async/models/get_instance_snapshot_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetInstanceSnapshotReply(BaseModel): + """ + GetInstanceSnapshotReply + """ # noqa: E501 + instance_snapshot: Optional[InstanceSnapshot] = None + __properties: ClassVar[List[str]] = ["instance_snapshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetInstanceSnapshotReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_snapshot + if self.instance_snapshot: + _dict['instance_snapshot'] = self.instance_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetInstanceSnapshotReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshot": InstanceSnapshot.from_dict(obj["instance_snapshot"]) if obj.get("instance_snapshot") is not None else None + }) + return _obj + + diff --git a/koyeb/api_async/models/instance_snapshot.py b/koyeb/api_async/models/instance_snapshot.py new file mode 100644 index 00000000..4338a877 --- /dev/null +++ b/koyeb/api_async/models/instance_snapshot.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot_status import InstanceSnapshotStatus +from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InstanceSnapshot(BaseModel): + """ + InstanceSnapshot + """ # noqa: E501 + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + available_at: Optional[datetime] = None + deleted_at: Optional[datetime] = None + organization_id: Optional[StrictStr] = None + project_id: Optional[StrictStr] = None + service_id: Optional[StrictStr] = None + deployment_id: Optional[StrictStr] = None + regional_deployment_id: Optional[StrictStr] = None + instance_id: Optional[StrictStr] = None + status: Optional[InstanceSnapshotStatus] = InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID + type: Optional[InstanceSnapshotType] = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID + version: Optional[StrictStr] = None + messages: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["id", "name", "created_at", "updated_at", "available_at", "deleted_at", "organization_id", "project_id", "service_id", "deployment_id", "regional_deployment_id", "instance_id", "status", "type", "version", "messages"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceSnapshot from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "available_at": obj.get("available_at"), + "deleted_at": obj.get("deleted_at"), + "organization_id": obj.get("organization_id"), + "project_id": obj.get("project_id"), + "service_id": obj.get("service_id"), + "deployment_id": obj.get("deployment_id"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "instance_id": obj.get("instance_id"), + "status": obj.get("status") if obj.get("status") is not None else InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_INVALID, + "type": obj.get("type") if obj.get("type") is not None else InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_INVALID, + "version": obj.get("version"), + "messages": obj.get("messages") + }) + return _obj + + diff --git a/koyeb/api_async/models/instance_snapshot_event.py b/koyeb/api_async/models/instance_snapshot_event.py new file mode 100644 index 00000000..98076760 --- /dev/null +++ b/koyeb/api_async/models/instance_snapshot_event.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InstanceSnapshotEvent(BaseModel): + """ + InstanceSnapshotEvent + """ # noqa: E501 + id: Optional[StrictStr] = None + when: Optional[datetime] = None + organization_id: Optional[StrictStr] = None + instance_snapshot_id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + message: Optional[StrictStr] = None + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "instance_snapshot_id", "type", "message", "metadata"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceSnapshotEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceSnapshotEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "instance_snapshot_id": obj.get("instance_snapshot_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/koyeb/api_async/models/instance_snapshot_status.py b/koyeb/api_async/models/instance_snapshot_status.py new file mode 100644 index 00000000..a824eb6b --- /dev/null +++ b/koyeb/api_async/models/instance_snapshot_status.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class InstanceSnapshotStatus(str, Enum): + """ + InstanceSnapshotStatus + """ + + """ + allowed enum values + """ + INSTANCE_SNAPSHOT_STATUS_INVALID = 'INSTANCE_SNAPSHOT_STATUS_INVALID' + INSTANCE_SNAPSHOT_STATUS_CREATING = 'INSTANCE_SNAPSHOT_STATUS_CREATING' + INSTANCE_SNAPSHOT_STATUS_AVAILABLE = 'INSTANCE_SNAPSHOT_STATUS_AVAILABLE' + INSTANCE_SNAPSHOT_STATUS_ERROR = 'INSTANCE_SNAPSHOT_STATUS_ERROR' + INSTANCE_SNAPSHOT_STATUS_DELETING = 'INSTANCE_SNAPSHOT_STATUS_DELETING' + INSTANCE_SNAPSHOT_STATUS_DELETED = 'INSTANCE_SNAPSHOT_STATUS_DELETED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceSnapshotStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/koyeb/api_async/models/instance_snapshot_type.py b/koyeb/api_async/models/instance_snapshot_type.py new file mode 100644 index 00000000..a83a50fb --- /dev/null +++ b/koyeb/api_async/models/instance_snapshot_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class InstanceSnapshotType(str, Enum): + """ + InstanceSnapshotType + """ + + """ + allowed enum values + """ + INSTANCE_SNAPSHOT_TYPE_INVALID = 'INSTANCE_SNAPSHOT_TYPE_INVALID' + INSTANCE_SNAPSHOT_TYPE_FILESYSTEM = 'INSTANCE_SNAPSHOT_TYPE_FILESYSTEM' + INSTANCE_SNAPSHOT_TYPE_FULL = 'INSTANCE_SNAPSHOT_TYPE_FULL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceSnapshotType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/koyeb/api_async/models/list_instance_snapshot_events_reply.py b/koyeb/api_async/models/list_instance_snapshot_events_reply.py new file mode 100644 index 00000000..404178db --- /dev/null +++ b/koyeb/api_async/models/list_instance_snapshot_events_reply.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot_event import InstanceSnapshotEvent +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListInstanceSnapshotEventsReply(BaseModel): + """ + ListInstanceSnapshotEventsReply + """ # noqa: E501 + events: Optional[List[InstanceSnapshotEvent]] = None + limit: Optional[StrictInt] = None + offset: Optional[StrictInt] = None + order: Optional[StrictStr] = None + has_next: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotEventsReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in events (list) + _items = [] + if self.events: + for _item_events in self.events: + if _item_events: + _items.append(_item_events.to_dict()) + _dict['events'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotEventsReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": [InstanceSnapshotEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) + return _obj + + diff --git a/koyeb/api_async/models/list_instance_snapshots_reply.py b/koyeb/api_async/models/list_instance_snapshots_reply.py new file mode 100644 index 00000000..fe7eca60 --- /dev/null +++ b/koyeb/api_async/models/list_instance_snapshots_reply.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListInstanceSnapshotsReply(BaseModel): + """ + ListInstanceSnapshotsReply + """ # noqa: E501 + instance_snapshots: Optional[List[InstanceSnapshot]] = None + limit: Optional[StrictInt] = None + offset: Optional[StrictInt] = None + count: Optional[StrictInt] = None + has_next: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["instance_snapshots", "limit", "offset", "count", "has_next"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotsReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instance_snapshots (list) + _items = [] + if self.instance_snapshots: + for _item_instance_snapshots in self.instance_snapshots: + if _item_instance_snapshots: + _items.append(_item_instance_snapshots.to_dict()) + _dict['instance_snapshots'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstanceSnapshotsReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance_snapshots": [InstanceSnapshot.from_dict(_item) for _item in obj["instance_snapshots"]] if obj.get("instance_snapshots") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) + return _obj + + diff --git a/koyeb/api_async/models/regional_deployment.py b/koyeb/api_async/models/regional_deployment.py index 28b9a811..183bd6da 100644 --- a/koyeb/api_async/models/regional_deployment.py +++ b/koyeb/api_async/models/regional_deployment.py @@ -53,10 +53,11 @@ class RegionalDeployment(BaseModel): metadata: Optional[Dict[str, Any]] = None provisioning_info: Optional[DeploymentProvisioningInfo] = None role: Optional[RegionalDeploymentRole] = RegionalDeploymentRole.INVALID + instance_snapshot_id: Optional[StrictStr] = None version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None deployment_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "scheduled_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "region", "parent_id", "child_id", "status", "messages", "definition", "datacenters", "metadata", "provisioning_info", "role", "version", "deployment_group", "deployment_id"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "scheduled_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "region", "parent_id", "child_id", "status", "messages", "definition", "datacenters", "metadata", "provisioning_info", "role", "instance_snapshot_id", "version", "deployment_group", "deployment_id"] model_config = ConfigDict( validate_by_name=True, @@ -136,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metadata": obj.get("metadata"), "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, "role": obj.get("role") if obj.get("role") is not None else RegionalDeploymentRole.INVALID, + "instance_snapshot_id": obj.get("instance_snapshot_id"), "version": obj.get("version"), "deployment_group": obj.get("deployment_group"), "deployment_id": obj.get("deployment_id") diff --git a/koyeb/api_async/models/regional_deployment_list_item.py b/koyeb/api_async/models/regional_deployment_list_item.py index 8943ee24..3a6a3a96 100644 --- a/koyeb/api_async/models/regional_deployment_list_item.py +++ b/koyeb/api_async/models/regional_deployment_list_item.py @@ -37,7 +37,8 @@ class RegionalDeploymentListItem(BaseModel): status: Optional[RegionalDeploymentStatus] = RegionalDeploymentStatus.PENDING messages: Optional[List[StrictStr]] = None definition: Optional[RegionalDeploymentDefinition] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "region", "status", "messages", "definition"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "region", "status", "messages", "definition", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -99,7 +100,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "region": obj.get("region"), "status": obj.get("status") if obj.get("status") is not None else RegionalDeploymentStatus.PENDING, "messages": obj.get("messages"), - "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None + "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api_async/models/update_service.py b/koyeb/api_async/models/update_service.py index e8f7bad4..ef64dd45 100644 --- a/koyeb/api_async/models/update_service.py +++ b/koyeb/api_async/models/update_service.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api_async.models.deployment_definition import DeploymentDefinition from koyeb.api_async.models.deployment_metadata import DeploymentMetadata @@ -35,7 +35,8 @@ class UpdateService(BaseModel): skip_build: Optional[StrictBool] = Field(default=None, description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.") save_only: Optional[StrictBool] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = ["definition", "metadata", "skip_build", "save_only", "life_cycle"] + instance_snapshot_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["definition", "metadata", "skip_build", "save_only", "life_cycle", "instance_snapshot_id"] model_config = ConfigDict( validate_by_name=True, @@ -101,7 +102,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metadata": DeploymentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "skip_build": obj.get("skip_build"), "save_only": obj.get("save_only"), - "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, + "instance_snapshot_id": obj.get("instance_snapshot_id") }) return _obj diff --git a/koyeb/api_async/rest.py b/koyeb/api_async/rest.py index 46365f8f..31f58536 100644 --- a/koyeb/api_async/rest.py +++ b/koyeb/api_async/rest.py @@ -137,8 +137,6 @@ async def request( if re.search('json', headers['Content-Type'], re.IGNORECASE): if body is not None: args["json"] = body - if body is None and post_params: - args["json"] = dict(post_params) elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 args["data"] = dict(post_params) elif headers['Content-Type'] == 'multipart/form-data': diff --git a/koyeb/api_async/test/test_create_instance_snapshot_reply.py b/koyeb/api_async/test/test_create_instance_snapshot_reply.py new file mode 100644 index 00000000..ad439231 --- /dev/null +++ b/koyeb/api_async/test/test_create_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.create_instance_snapshot_reply import CreateInstanceSnapshotReply + +class TestCreateInstanceSnapshotReply(unittest.TestCase): + """CreateInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateInstanceSnapshotReply: + """Test CreateInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateInstanceSnapshotReply` + """ + model = CreateInstanceSnapshotReply() + if include_optional: + return CreateInstanceSnapshotReply( + instance_snapshot = koyeb.api_async.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return CreateInstanceSnapshotReply( + ) + """ + + def testCreateInstanceSnapshotReply(self): + """Test CreateInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_create_instance_snapshot_request.py b/koyeb/api_async/test/test_create_instance_snapshot_request.py new file mode 100644 index 00000000..21e98fba --- /dev/null +++ b/koyeb/api_async/test/test_create_instance_snapshot_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + +class TestCreateInstanceSnapshotRequest(unittest.TestCase): + """CreateInstanceSnapshotRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateInstanceSnapshotRequest: + """Test CreateInstanceSnapshotRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateInstanceSnapshotRequest` + """ + model = CreateInstanceSnapshotRequest() + if include_optional: + return CreateInstanceSnapshotRequest( + instance_id = '', + name = '', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID' + ) + else: + return CreateInstanceSnapshotRequest( + ) + """ + + def testCreateInstanceSnapshotRequest(self): + """Test CreateInstanceSnapshotRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_delete_instance_snapshot_reply.py b/koyeb/api_async/test/test_delete_instance_snapshot_reply.py new file mode 100644 index 00000000..e18b57b8 --- /dev/null +++ b/koyeb/api_async/test/test_delete_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.delete_instance_snapshot_reply import DeleteInstanceSnapshotReply + +class TestDeleteInstanceSnapshotReply(unittest.TestCase): + """DeleteInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeleteInstanceSnapshotReply: + """Test DeleteInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeleteInstanceSnapshotReply` + """ + model = DeleteInstanceSnapshotReply() + if include_optional: + return DeleteInstanceSnapshotReply( + instance_snapshot = koyeb.api_async.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return DeleteInstanceSnapshotReply( + ) + """ + + def testDeleteInstanceSnapshotReply(self): + """Test DeleteInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_get_instance_snapshot_reply.py b/koyeb/api_async/test/test_get_instance_snapshot_reply.py new file mode 100644 index 00000000..eb1fc54e --- /dev/null +++ b/koyeb/api_async/test/test_get_instance_snapshot_reply.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.get_instance_snapshot_reply import GetInstanceSnapshotReply + +class TestGetInstanceSnapshotReply(unittest.TestCase): + """GetInstanceSnapshotReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetInstanceSnapshotReply: + """Test GetInstanceSnapshotReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetInstanceSnapshotReply` + """ + model = GetInstanceSnapshotReply() + if include_optional: + return GetInstanceSnapshotReply( + instance_snapshot = koyeb.api_async.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ) + else: + return GetInstanceSnapshotReply( + ) + """ + + def testGetInstanceSnapshotReply(self): + """Test GetInstanceSnapshotReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_instance_snapshot.py b/koyeb/api_async/test/test_instance_snapshot.py new file mode 100644 index 00000000..327e3794 --- /dev/null +++ b/koyeb/api_async/test/test_instance_snapshot.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.instance_snapshot import InstanceSnapshot + +class TestInstanceSnapshot(unittest.TestCase): + """InstanceSnapshot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstanceSnapshot: + """Test InstanceSnapshot + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstanceSnapshot` + """ + model = InstanceSnapshot() + if include_optional: + return InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ] + ) + else: + return InstanceSnapshot( + ) + """ + + def testInstanceSnapshot(self): + """Test InstanceSnapshot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_instance_snapshot_event.py b/koyeb/api_async/test/test_instance_snapshot_event.py new file mode 100644 index 00000000..fb9229c2 --- /dev/null +++ b/koyeb/api_async/test/test_instance_snapshot_event.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.instance_snapshot_event import InstanceSnapshotEvent + +class TestInstanceSnapshotEvent(unittest.TestCase): + """InstanceSnapshotEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstanceSnapshotEvent: + """Test InstanceSnapshotEvent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstanceSnapshotEvent` + """ + model = InstanceSnapshotEvent() + if include_optional: + return InstanceSnapshotEvent( + id = '', + when = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + instance_snapshot_id = '', + type = '', + message = '', + metadata = None + ) + else: + return InstanceSnapshotEvent( + ) + """ + + def testInstanceSnapshotEvent(self): + """Test InstanceSnapshotEvent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_instance_snapshot_status.py b/koyeb/api_async/test/test_instance_snapshot_status.py new file mode 100644 index 00000000..745776fb --- /dev/null +++ b/koyeb/api_async/test/test_instance_snapshot_status.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.instance_snapshot_status import InstanceSnapshotStatus + +class TestInstanceSnapshotStatus(unittest.TestCase): + """InstanceSnapshotStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInstanceSnapshotStatus(self): + """Test InstanceSnapshotStatus""" + # inst = InstanceSnapshotStatus() + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_instance_snapshot_type.py b/koyeb/api_async/test/test_instance_snapshot_type.py new file mode 100644 index 00000000..ada2c0f6 --- /dev/null +++ b/koyeb/api_async/test/test_instance_snapshot_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType + +class TestInstanceSnapshotType(unittest.TestCase): + """InstanceSnapshotType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInstanceSnapshotType(self): + """Test InstanceSnapshotType""" + # inst = InstanceSnapshotType() + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_instance_snapshots_api.py b/koyeb/api_async/test/test_instance_snapshots_api.py new file mode 100644 index 00000000..8da2f5c7 --- /dev/null +++ b/koyeb/api_async/test/test_instance_snapshots_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.api.instance_snapshots_api import InstanceSnapshotsApi + + +class TestInstanceSnapshotsApi(unittest.IsolatedAsyncioTestCase): + """InstanceSnapshotsApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = InstanceSnapshotsApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_create_instance_snapshot(self) -> None: + """Test case for create_instance_snapshot + + """ + pass + + async def test_delete_instance_snapshot(self) -> None: + """Test case for delete_instance_snapshot + + """ + pass + + async def test_get_instance_snapshot(self) -> None: + """Test case for get_instance_snapshot + + """ + pass + + async def test_list_instance_snapshot_events(self) -> None: + """Test case for list_instance_snapshot_events + + """ + pass + + async def test_list_instance_snapshots(self) -> None: + """Test case for list_instance_snapshots + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_list_instance_snapshot_events_reply.py b/koyeb/api_async/test/test_list_instance_snapshot_events_reply.py new file mode 100644 index 00000000..082d1745 --- /dev/null +++ b/koyeb/api_async/test/test_list_instance_snapshot_events_reply.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.list_instance_snapshot_events_reply import ListInstanceSnapshotEventsReply + +class TestListInstanceSnapshotEventsReply(unittest.TestCase): + """ListInstanceSnapshotEventsReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListInstanceSnapshotEventsReply: + """Test ListInstanceSnapshotEventsReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListInstanceSnapshotEventsReply` + """ + model = ListInstanceSnapshotEventsReply() + if include_optional: + return ListInstanceSnapshotEventsReply( + events = [ + koyeb.api_async.models.instance_snapshot_event.InstanceSnapshotEvent( + id = '', + when = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + instance_snapshot_id = '', + type = '', + message = '', + metadata = koyeb.api_async.models.metadata.metadata(), ) + ], + limit = 56, + offset = 56, + order = '', + has_next = True + ) + else: + return ListInstanceSnapshotEventsReply( + ) + """ + + def testListInstanceSnapshotEventsReply(self): + """Test ListInstanceSnapshotEventsReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async/test/test_list_instance_snapshots_reply.py b/koyeb/api_async/test/test_list_instance_snapshots_reply.py new file mode 100644 index 00000000..c0bd0f9a --- /dev/null +++ b/koyeb/api_async/test/test_list_instance_snapshots_reply.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api_async.models.list_instance_snapshots_reply import ListInstanceSnapshotsReply + +class TestListInstanceSnapshotsReply(unittest.TestCase): + """ListInstanceSnapshotsReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListInstanceSnapshotsReply: + """Test ListInstanceSnapshotsReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListInstanceSnapshotsReply` + """ + model = ListInstanceSnapshotsReply() + if include_optional: + return ListInstanceSnapshotsReply( + instance_snapshots = [ + koyeb.api_async.models.instance_snapshot.InstanceSnapshot( + id = '', + name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + available_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deleted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + organization_id = '', + project_id = '', + service_id = '', + deployment_id = '', + regional_deployment_id = '', + instance_id = '', + status = 'INSTANCE_SNAPSHOT_STATUS_INVALID', + type = 'INSTANCE_SNAPSHOT_TYPE_INVALID', + version = '', + messages = [ + '' + ], ) + ], + limit = 56, + offset = 56, + count = 56, + has_next = True + ) + else: + return ListInstanceSnapshotsReply( + ) + """ + + def testListInstanceSnapshotsReply(self): + """Test ListInstanceSnapshotsReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_async_README.md b/koyeb/api_async_README.md index 3e7ee571..4e0e0a62 100644 --- a/koyeb/api_async_README.md +++ b/koyeb/api_async_README.md @@ -5,12 +5,12 @@ The `koyeb.api_async` package is automatically generated by the [OpenAPI Generat - API version: 1.0.0 - Package version: 1.5.1 -- Generator version: 7.24.0-SNAPSHOT +- Generator version: 7.22.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.10+ +Python 3.9+ ## Installation & Usage @@ -113,6 +113,11 @@ Class | Method | HTTP request | Description *DomainsApi* | [**list_domains**](koyeb/api_async/docs/DomainsApi.md#list_domains) | **GET** /v1/domains | List Domains *DomainsApi* | [**refresh_domain_status**](koyeb/api_async/docs/DomainsApi.md#refresh_domain_status) | **POST** /v1/domains/{id}/refresh | Refresh Domain Status *DomainsApi* | [**update_domain**](koyeb/api_async/docs/DomainsApi.md#update_domain) | **PATCH** /v1/domains/{id} | Update Domain +*InstanceSnapshotsApi* | [**create_instance_snapshot**](koyeb/api_async/docs/InstanceSnapshotsApi.md#create_instance_snapshot) | **POST** /v1/instance_snapshots | +*InstanceSnapshotsApi* | [**delete_instance_snapshot**](koyeb/api_async/docs/InstanceSnapshotsApi.md#delete_instance_snapshot) | **DELETE** /v1/instance_snapshots/{id} | +*InstanceSnapshotsApi* | [**get_instance_snapshot**](koyeb/api_async/docs/InstanceSnapshotsApi.md#get_instance_snapshot) | **GET** /v1/instance_snapshots/{id} | +*InstanceSnapshotsApi* | [**list_instance_snapshot_events**](koyeb/api_async/docs/InstanceSnapshotsApi.md#list_instance_snapshot_events) | **GET** /v1/instance_snapshot_events | +*InstanceSnapshotsApi* | [**list_instance_snapshots**](koyeb/api_async/docs/InstanceSnapshotsApi.md#list_instance_snapshots) | **GET** /v1/instance_snapshots | *InstancesApi* | [**exec_command**](koyeb/api_async/docs/InstancesApi.md#exec_command) | **GET** /v1/streams/instances/exec | Exec Command *InstancesApi* | [**get_instance**](koyeb/api_async/docs/InstancesApi.md#get_instance) | **GET** /v1/instances/{id} | Get Instance *InstancesApi* | [**list_instance_events**](koyeb/api_async/docs/InstancesApi.md#list_instance_events) | **GET** /v1/instance_events | List Instance events @@ -298,6 +303,8 @@ Class | Method | HTTP request | Description - [CreateCredentialReply](koyeb/api_async/docs/CreateCredentialReply.md) - [CreateDomain](koyeb/api_async/docs/CreateDomain.md) - [CreateDomainReply](koyeb/api_async/docs/CreateDomainReply.md) + - [CreateInstanceSnapshotReply](koyeb/api_async/docs/CreateInstanceSnapshotReply.md) + - [CreateInstanceSnapshotRequest](koyeb/api_async/docs/CreateInstanceSnapshotRequest.md) - [CreateOrganizationInvitationReply](koyeb/api_async/docs/CreateOrganizationInvitationReply.md) - [CreateOrganizationInvitationRequest](koyeb/api_async/docs/CreateOrganizationInvitationRequest.md) - [CreateOrganizationReply](koyeb/api_async/docs/CreateOrganizationReply.md) @@ -327,6 +334,7 @@ Class | Method | HTTP request | Description - [DeclareStageProgressRequest](koyeb/api_async/docs/DeclareStageProgressRequest.md) - [DeclareStepProgressRequest](koyeb/api_async/docs/DeclareStepProgressRequest.md) - [DeclineOrganizationInvitationReply](koyeb/api_async/docs/DeclineOrganizationInvitationReply.md) + - [DeleteInstanceSnapshotReply](koyeb/api_async/docs/DeleteInstanceSnapshotReply.md) - [DeleteOrganizationReply](koyeb/api_async/docs/DeleteOrganizationReply.md) - [DeletePersistentVolumeReply](koyeb/api_async/docs/DeletePersistentVolumeReply.md) - [DeleteSnapshotReply](koyeb/api_async/docs/DeleteSnapshotReply.md) @@ -401,6 +409,7 @@ Class | Method | HTTP request | Description - [GetGithubInstallationReply](koyeb/api_async/docs/GetGithubInstallationReply.md) - [GetIdenfyTokenReply](koyeb/api_async/docs/GetIdenfyTokenReply.md) - [GetInstanceReply](koyeb/api_async/docs/GetInstanceReply.md) + - [GetInstanceSnapshotReply](koyeb/api_async/docs/GetInstanceSnapshotReply.md) - [GetIntercomProfileReply](koyeb/api_async/docs/GetIntercomProfileReply.md) - [GetMetricsReply](koyeb/api_async/docs/GetMetricsReply.md) - [GetMetricsReplyMetric](koyeb/api_async/docs/GetMetricsReplyMetric.md) @@ -440,6 +449,10 @@ Class | Method | HTTP request | Description - [InstanceAvailability](koyeb/api_async/docs/InstanceAvailability.md) - [InstanceEvent](koyeb/api_async/docs/InstanceEvent.md) - [InstanceListItem](koyeb/api_async/docs/InstanceListItem.md) + - [InstanceSnapshot](koyeb/api_async/docs/InstanceSnapshot.md) + - [InstanceSnapshotEvent](koyeb/api_async/docs/InstanceSnapshotEvent.md) + - [InstanceSnapshotStatus](koyeb/api_async/docs/InstanceSnapshotStatus.md) + - [InstanceSnapshotType](koyeb/api_async/docs/InstanceSnapshotType.md) - [InstanceStatus](koyeb/api_async/docs/InstanceStatus.md) - [InstanceUsage](koyeb/api_async/docs/InstanceUsage.md) - [InstancesSummary](koyeb/api_async/docs/InstancesSummary.md) @@ -472,6 +485,8 @@ Class | Method | HTTP request | Description - [ListDeploymentsReply](koyeb/api_async/docs/ListDeploymentsReply.md) - [ListDomainsReply](koyeb/api_async/docs/ListDomainsReply.md) - [ListInstanceEventsReply](koyeb/api_async/docs/ListInstanceEventsReply.md) + - [ListInstanceSnapshotEventsReply](koyeb/api_async/docs/ListInstanceSnapshotEventsReply.md) + - [ListInstanceSnapshotsReply](koyeb/api_async/docs/ListInstanceSnapshotsReply.md) - [ListInstancesReply](koyeb/api_async/docs/ListInstancesReply.md) - [ListOrganizationInvitationsReply](koyeb/api_async/docs/ListOrganizationInvitationsReply.md) - [ListOrganizationMembersReply](koyeb/api_async/docs/ListOrganizationMembersReply.md) diff --git a/spec/openapi.json b/spec/openapi.json index ddbfa5e9..c6e51d53 100644 --- a/spec/openapi.json +++ b/spec/openapi.json @@ -68,146 +68,51 @@ } ], "paths": { - "/v1/catalog/datacenters": { + "/v1/search": { "get": { - "summary": "List datacenters", - "operationId": "ListDatacenters", + "summary": "Search", + "operationId": "Search", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDatacentersReply" + "$ref": "#/definitions/ksearch.SearchReply" } }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "tags": [ - "CatalogDatacenters" - ] - } - }, - "/v1/catalog/instances": { - "get": { - "summary": "List Instances", - "operationId": "ListCatalogInstances", - "responses": { - "200": { - "description": "A successful response.", + "400": { + "description": "Validation error", "schema": { - "$ref": "#/definitions/ListCatalogInstancesReply" + "$ref": "#/definitions/ErrorWithFields" } }, - "default": { - "description": "An unexpected error response.", + "401": { + "description": "Returned when the token is not valid.", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/Error" } - } - }, - "parameters": [ - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" }, - { - "name": "id", - "description": "(Optional) A filter for instances", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "CatalogInstances" - ] - } - }, - "/v1/catalog/instances/{id}": { - "get": { - "summary": "Get Instance", - "operationId": "GetCatalogInstance", - "responses": { - "200": { - "description": "A successful response.", + "403": { + "description": "Returned when the user does not have permission to access the resource.", "schema": { - "$ref": "#/definitions/GetCatalogInstanceReply" + "$ref": "#/definitions/Error" } }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "The name of the instance", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "CatalogInstances" - ] - } - }, - "/v1/catalog/usage": { - "get": { - "operationId": "ListUsage", - "responses": { - "200": { - "description": "A successful response.", + "404": { + "description": "Returned when the resource does not exist.", "schema": { - "$ref": "#/definitions/ListUsageReply" + "$ref": "#/definitions/Error" } }, - "default": { - "description": "An unexpected error response.", + "500": { + "description": "Returned in case of server error.", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/Error" } - } - }, - "parameters": [ - { - "name": "region", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "CatalogInstanceUsage" - ] - } - }, - "/v1/catalog/regions": { - "get": { - "summary": "List Region", - "operationId": "ListRegions", - "responses": { - "200": { - "description": "A successful response.", + }, + "503": { + "description": "Service is unavailable.", "schema": { - "$ref": "#/definitions/ListRegionsReply" + "$ref": "#/definitions/Error" } }, "default": { @@ -219,73 +124,27 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "id", - "description": "(Optional) A filter for regions", + "name": "query", + "description": "(Optional) Search query", "in": "query", "required": false, "type": "string" } ], "tags": [ - "CatalogRegions" - ] - } - }, - "/v1/catalog/regions/{id}": { - "get": { - "summary": "Get Region", - "operationId": "GetRegion", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/GetRegionReply" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "The name of the region", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "CatalogRegions" + "Search" ] } }, - "/v1/organization_members": { + "/v1/git/branches": { "get": { - "summary": "List organization members", - "operationId": "ListOrganizationMembers", + "summary": "List Branches", + "operationId": "ListBranches", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListOrganizationMembersReply" + "$ref": "#/definitions/kgitproxy.ListBranchesReply" } }, "400": { @@ -333,68 +192,48 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "repository_id", + "description": "(Optional) Filter on one repository.", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "name", + "description": "(Optional) Filter on branch name using a fuzzy search.\nRepository filter is required to enable this filter.", "in": "query", "required": false, "type": "string" }, { - "name": "organization_id", - "description": "(Optional) Filter for an organization", + "name": "limit", + "description": "(Optional) The number of items to return.", "in": "query", "required": false, "type": "string" }, { - "name": "user_id", - "description": "(Optional) Filter for an user", + "name": "offset", + "description": "(Optional) The offset in the list of item to return.", "in": "query", "required": false, "type": "string" - }, - { - "name": "organization_statuses", - "description": "(Optional) Filter for organization statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", - "DELETING", - "DELETED" - ] - }, - "collectionFormat": "multi" } ], "tags": [ - "OrganizationMembers" + "Repositories" ] } }, - "/v1/organization_members/{id}": { - "delete": { - "summary": "Remove an organization member", - "operationId": "RemoveOrganizationMember", + "/v1/git/repositories": { + "get": { + "summary": "List Repositories", + "operationId": "ListRepositories", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RemoveOrganizationMemberReply" + "$ref": "#/definitions/kgitproxy.ListRepositoriesReply" } }, "400": { @@ -442,119 +281,48 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "name", + "description": "(Optional) Filter on repository name using a fuzzy search.", + "in": "query", + "required": false, "type": "string" - } - ], - "tags": [ - "OrganizationMembers" - ] - } - }, - "/v1/payment_methods": { - "get": { - "summary": "List payment methods", - "operationId": "ListPaymentMethods", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ListPaymentMethodsReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } - }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "name_search_op", + "description": "(Optional) Define search operation for repository name. Accept either \"fuzzy\" or \"equality\", use \"fuzzy\" by default.", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "limit", + "description": "(Optional) The number of items to return.", "in": "query", "required": false, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Filter on payment method statuses", + "name": "offset", + "description": "(Optional) The offset in the list of item to return.", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID", - "CREATED", - "AUTHORIZED", - "DECLINED", - "CANCELED", - "EXPIRED", - "UNCHECKED" - ] - }, - "collectionFormat": "multi" + "type": "string" } ], "tags": [ - "PaymentMethods" + "Repositories" ] - }, + } + }, + "/v1/git/sync/organization/{organization_id}": { "post": { - "summary": "Create payment authorization", - "operationId": "CreatePaymentAuthorization", + "summary": "Resync Organization", + "operationId": "ResyncOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreatePaymentAuthorizationReply" + "$ref": "#/definitions/kgitproxy.ResyncOrganizationReply" } }, "400": { @@ -602,28 +370,26 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "organization_id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreatePaymentAuthorizationRequest" - } + "type": "string" } ], "tags": [ - "PaymentMethods" + "Repositories" ] } }, - "/v1/payment_methods/{id}": { - "get": { - "summary": "Get payment method", - "operationId": "GetPaymentMethod", + "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}": { + "post": { + "summary": "Create an attempt for a stage", + "operationId": "CreateStageAttempt", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetPaymentMethodReply" + "$ref": "#/definitions/CreateStageAttemptReply" } }, "400": { @@ -671,24 +437,68 @@ }, "parameters": [ { - "name": "id", + "name": "deployment_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "stage", "in": "path", "required": true, "type": "string" + }, + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "type": "string" + } + } + } + } } ], "tags": [ - "PaymentMethods" + "Provisioning" ] }, - "delete": { - "summary": "Delete payment method", - "operationId": "DeletePaymentMethod", + "patch": { + "summary": "Declare stage progress", + "operationId": "DeclareStageProgress", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeletePaymentMethodReply" + "$ref": "#/definitions/DeclareStageProgressReply" } }, "400": { @@ -736,26 +546,73 @@ }, "parameters": [ { - "name": "id", + "name": "deployment_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "stage", "in": "path", "required": true, "type": "string" + }, + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "finished_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "image_pushed": { + "type": "boolean" + }, + "internal_failure": { + "type": "boolean" + }, + "retryable_failure": { + "type": "boolean" + } + } + } } ], "tags": [ - "PaymentMethods" + "Provisioning" ] } }, - "/v1/payment_methods/{id}/confirm": { - "post": { - "summary": "Confirm payment authorization", - "operationId": "ConfirmPaymentAuthorization", + "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}": { + "patch": { + "summary": "Declare step progress", + "operationId": "DeclareStepProgress", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ConfirmPaymentAuthorizationReply" + "$ref": "#/definitions/DeclareStepProgressReply" } }, "400": { @@ -803,70 +660,115 @@ }, "parameters": [ { - "name": "id", + "name": "deployment_id", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "stage", + "in": "path", "required": true, - "schema": { - "type": "object" - } - } - ], - "tags": [ - "PaymentMethods" - ] - } - }, - "/v1/users/{id}": { - "delete": { - "summary": "Delete user", - "operationId": "DeleteUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DeleteUserReply" - } + "type": "string" }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "step", + "in": "path", + "required": true, + "type": "string" }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", + { + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/Error" + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "finished_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + } + } } - }, - "404": { - "description": "Returned when the resource does not exist.", + } + ], + "tags": [ + "Provisioning" + ] + } + }, + "/v1/usages": { + "get": { + "summary": "Get organization usage", + "operationId": "GetOrganizationUsage", + "responses": { + "200": { + "description": "A successful response.", "schema": { - "$ref": "#/definitions/Error" + "$ref": "#/definitions/GetOrganizationUsageReply" } }, - "500": { - "description": "Returned in case of server error.", + "default": { + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/Error" + "$ref": "#/definitions/google.rpc.Status" } + } + }, + "parameters": [ + { + "name": "starting_time", + "description": "The starting time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" }, - "503": { - "description": "Service is unavailable.", + { + "name": "ending_time", + "description": "The ending time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "Usages" + ] + } + }, + "/v1/usages/details": { + "get": { + "summary": "Get organization usage details", + "operationId": "GetOrganizationUsageDetails", + "responses": { + "200": { + "description": "A successful response.", "schema": { - "$ref": "#/definitions/Error" + "$ref": "#/definitions/GetOrganizationUsageDetailsReply" } }, "default": { @@ -878,27 +780,64 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the user", - "in": "path", - "required": true, + "name": "starting_time", + "description": "The starting time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "ending_time", + "description": "The ending time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "Accept", + "description": "If defined with the value 'text/csv', a csv file is returned", + "in": "header", + "required": false, "type": "string" } ], "tags": [ - "Users" + "Usages" ] } }, - "/v2/users/{id}": { - "delete": { - "summary": "V2 Delete user", - "operationId": "DeleteUserV2", + "/v1/service_events": { + "get": { + "summary": "List Service events", + "operationId": "ListServiceEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteUserReply" + "$ref": "#/definitions/ListServiceEventsReply" } }, "400": { @@ -946,27 +885,59 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the user", - "in": "path", - "required": true, + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on service event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "Users" + "Services" ] } }, - "/v1/intercom/profile": { + "/v1/services": { "get": { - "summary": "Get intercom profile", - "operationId": "GetIntercomProfile", + "summary": "List Services", + "operationId": "ListServices", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetIntercomProfileReply" + "$ref": "#/definitions/ListServicesReply" } }, "400": { @@ -1012,87 +983,106 @@ } } }, - "tags": [ - "Intercom" - ] - } - }, - "/v1/subscriptions/{id}": { - "get": { - "summary": "Get Subscription", - "operationId": "GetSubscription", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/GetSubscriptionReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } + "parameters": [ + { + "name": "app_id", + "description": "(Optional) The id of the app", + "in": "query", + "required": false, + "type": "string" }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "types", + "description": "(Optional) Filter on service types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID_TYPE", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" + ] + }, + "collectionFormat": "multi" }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "statuses", + "description": "(Optional) Filter on service statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "DELETING", + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" + ] + }, + "collectionFormat": "multi" }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ { - "name": "id", - "description": "The id of the instance", - "in": "path", - "required": true, + "name": "regions", + "description": "(Optional) Filter on regions", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "Subscriptions" + "Services" ] - } - }, - "/v1/account/activities": { - "get": { - "operationId": "GetAccountActivities", + }, + "post": { + "summary": "Create Service", + "operationId": "CreateService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ActivityList" + "$ref": "#/definitions/CreateServiceReply" } }, "400": { @@ -1140,32 +1130,36 @@ }, "parameters": [ { - "name": "limit", - "in": "query", - "required": false, - "type": "string" + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateService" + } }, { - "name": "offset", + "name": "dry_run", + "description": "If set only run validation", "in": "query", "required": false, - "type": "string" + "type": "boolean" } ], "tags": [ - "activity" + "Services" ] } }, - "/v1/account/idenfy": { - "get": { - "summary": "Begin a session with iDenfy, emit an authToken", - "operationId": "GetIdenfyToken", + "/v1/services-autocomplete": { + "post": { + "summary": "Autocomplete definition", + "description": "Generate autocomplete definition for a service", + "operationId": "Autocomplete", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetIdenfyTokenReply" + "$ref": "#/definitions/AutocompleteReply" } }, "400": { @@ -1211,18 +1205,30 @@ } } }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AutocompleteRequest" + } + } + ], "tags": [ - "Profile" + "Services" ] - }, - "post": { - "summary": "ClearIdenfyVerificationResult marks the current result for idenfy as\nsuperseded", - "operationId": "ClearIdenfyVerificationResult", + } + }, + "/v1/services/{id}": { + "get": { + "summary": "Get Service", + "operationId": "GetService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ClearIdenfyVerificationResultReply" + "$ref": "#/definitions/GetServiceReply" } }, "400": { @@ -1270,28 +1276,26 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the Service", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/ClearIdenfyVerificationResultRequest" - } + "type": "string" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/invite": { - "post": { - "summary": "DEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "CreateInvite", + }, + "delete": { + "summary": "Delete Service", + "description": "Service deletion is allowed for all status.", + "operationId": "DeleteService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Empty" + "$ref": "#/definitions/DeleteServiceReply" } }, "400": { @@ -1339,28 +1343,25 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the entity to delete", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/InviteUserRequest" - } + "type": "string" } ], "tags": [ - "invite" + "Services" ] - } - }, - "/v1/account/login_method": { - "get": { - "summary": "Get the login method for an email address\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "LoginMethod", + }, + "put": { + "summary": "Update Service", + "operationId": "UpdateService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginMethodReply" + "$ref": "#/definitions/UpdateServiceReply" } }, "400": { @@ -1408,26 +1409,46 @@ }, "parameters": [ { - "name": "email", + "name": "id", + "description": "The id of the entity to update", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateService" + } + }, + { + "name": "update_mask", "in": "query", "required": false, "type": "string" + }, + { + "name": "dry_run", + "description": "If set, run validation and check that the service exists", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/oauth": { - "get": { - "summary": "Get OAuth Providers", - "operationId": "GetOAuthOptions", + }, + "patch": { + "summary": "Update Service", + "operationId": "UpdateService2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOAuthOptionsReply" + "$ref": "#/definitions/UpdateServiceReply" } }, "400": { @@ -1475,38 +1496,49 @@ }, "parameters": [ { - "name": "action", - "description": "Which authentication flow is being initiated", + "name": "id", + "description": "The id of the entity to update", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateService" + } + }, + { + "name": "update_mask", "in": "query", "required": false, - "type": "string", - "enum": [ - "signin", - "signup", - "register" - ], - "default": "signin" + "type": "string" }, { - "name": "metadata", - "description": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state", + "name": "dry_run", + "description": "If set, run validation and check that the service exists", "in": "query", "required": false, - "type": "string" + "type": "boolean" } ], "tags": [ - "Profile" + "Services" ] - }, + } + }, + "/v1/services/{id}/pause": { "post": { - "summary": "Authenticate using OAuth", - "operationId": "OAuthCallback", + "summary": "Pause Service", + "description": "Service pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", + "operationId": "PauseService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/OAuthCallbackReply" + "$ref": "#/definitions/PauseServiceReply" } }, "400": { @@ -1554,35 +1586,27 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the service to pause.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/OAuthCallbackRequest" - } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization": { - "get": { - "summary": "Get Current Organization", - "operationId": "GetCurrentOrganization", + "/v1/services/{id}/redeploy": { + "post": { + "summary": "ReDeploy Service", + "operationId": "ReDeploy", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationReply" + "$ref": "#/definitions/RedeployReply" } }, "400": { @@ -1628,20 +1652,37 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "info", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RedeployRequest.Info" + } + } + ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization_invitations": { - "get": { - "summary": "List User Organization Invitations\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "ListUserOrganizationInvitations", + "/v1/services/{id}/resume": { + "post": { + "summary": "Resume Service", + "description": "Service resume action is allowed for the following status:\n - paused", + "operationId": "ResumeService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListUserOrganizationInvitationsReply" + "$ref": "#/definitions/ResumeServiceReply" } }, "400": { @@ -1689,52 +1730,41 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the service to pause.", + "in": "path", + "required": true, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "skip_build", + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened.", "in": "query", "required": false, - "type": "string" + "type": "boolean" }, { - "name": "statuses", - "description": "(Optional) Filter on organization invitation statuses", + "name": "use_cache", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID", - "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" - ] - }, - "collectionFormat": "multi" + "type": "boolean" } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization_invitations/{id}": { + "/v1/services/{id}/scale": { "get": { - "summary": "Get User Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "GetUserOrganizationInvitation", + "summary": "Get Service Scaling", + "description": "Returns the current scaling configuration for a service", + "operationId": "GetServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetUserOrganizationInvitationReply" + "$ref": "#/definitions/GetServiceScalingReply" } }, "400": { @@ -1783,26 +1813,25 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to get", + "description": "The id of the service", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/organization_invitations/{id}/accept": { - "post": { - "summary": "Accept Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "AcceptOrganizationInvitation", + }, + "delete": { + "summary": "Delete Service Scaling", + "description": "Deletes the manual scaling configuration for a service, reverting to \nthe scaling defined in the deployment definition.", + "operationId": "DeleteServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/AcceptOrganizationInvitationReply" + "$ref": "#/definitions/DeleteServiceScalingReply" } }, "400": { @@ -1851,34 +1880,25 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to accept", + "description": "The id of the service", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/organization_invitations/{id}/decline": { - "post": { - "summary": "Decline Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "DeclineOrganizationInvitation", + }, + "put": { + "summary": "Update Service Scaling", + "description": "Stores or updates the scaling configuration for a service to use manual scaling", + "operationId": "UpdateServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclineOrganizationInvitationReply" + "$ref": "#/definitions/UpdateServiceScalingReply" } }, "400": { @@ -1927,7 +1947,7 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to decline", + "description": "The id of the service to scale", "in": "path", "required": true, "type": "string" @@ -1937,25 +1957,33 @@ "in": "body", "required": true, "schema": { - "type": "object" + "type": "object", + "properties": { + "scalings": { + "type": "array", + "items": { + "$ref": "#/definitions/ManualServiceScaling" + }, + "title": "The new scaling configuration" + } + } } } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organizations": { + "/v1/app_events": { "get": { - "summary": "List User Organizations", - "description": "List all organizations that the current user is a member of.", - "operationId": "ListUserOrganizations", + "summary": "List App events", + "operationId": "ListAppEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListUserOrganizationsReply" + "$ref": "#/definitions/ListAppEventsReply" } }, "400": { @@ -2003,68 +2031,59 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) Define pagination limit", + "name": "app_id", + "description": "(Optional) Filter on app id", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) Define pagination offset", + "name": "types", + "description": "(Optional) Filter on app event types", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "search", - "description": "(Optional) Fuzzy case-insensitive search based on organization name or\norganization id", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Only return organizations which status match one in the list", + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", - "DELETING", - "DELETED" - ] - }, - "collectionFormat": "multi" + "type": "string" } ], "tags": [ - "Profile" + "Apps" ] } }, - "/v1/account/profile": { + "/v1/apps": { "get": { - "summary": "Get Current User", - "operationId": "GetCurrentUser", + "summary": "List App", + "operationId": "ListApps", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/ListAppsReply" } }, "400": { @@ -2112,25 +2131,46 @@ }, "parameters": [ { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", "required": false, "type": "string" } ], "tags": [ - "Profile" + "Apps" ] }, - "put": { - "summary": "Update User", - "operationId": "UpdateUser", + "post": { + "summary": "Create App", + "operationId": "CreateApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/CreateAppReply" } }, "400": { @@ -2178,32 +2218,28 @@ }, "parameters": [ { - "name": "user", + "name": "app", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + "$ref": "#/definitions/CreateApp" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Profile" + "Apps" ] - }, - "patch": { - "summary": "Update User", - "operationId": "UpdateUser2", + } + }, + "/v1/apps/{id}": { + "get": { + "summary": "Get App", + "operationId": "GetApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/GetAppReply" } }, "400": { @@ -2251,34 +2287,26 @@ }, "parameters": [ { - "name": "user", - "in": "body", + "name": "id", + "description": "The id of the App", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Apps" ] - } - }, - "/v1/account/resend_validation": { - "post": { - "summary": "Resend Email Verification\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "ResendEmailValidation", + }, + "delete": { + "summary": "Delete App", + "description": "App deletion is allowed for all status.", + "operationId": "DeleteApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResendEmailValidationReply" + "$ref": "#/definitions/DeleteAppReply" } }, "400": { @@ -2326,28 +2354,25 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the App to delete", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/ResendEmailValidationRequest" - } + "type": "string" } ], "tags": [ - "Profile" + "Apps" ] - } - }, - "/v1/account/reset_password": { - "post": { - "summary": "Reset Password\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "ResetPassword", + }, + "put": { + "summary": "Update App", + "operationId": "UpdateApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResetPasswordReply" + "$ref": "#/definitions/UpdateAppReply" } }, "400": { @@ -2395,27 +2420,39 @@ }, "parameters": [ { - "name": "body", + "name": "id", + "description": "The id of the app to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "app", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ResetPasswordRequest" + "$ref": "#/definitions/UpdateApp" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Profile" + "Apps" ] - } - }, - "/v1/account/settings": { - "get": { - "operationId": "GetUserSettings", + }, + "patch": { + "summary": "Update App", + "operationId": "UpdateApp2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetUserSettingsReply" + "$ref": "#/definitions/UpdateAppReply" } }, "400": { @@ -2461,17 +2498,44 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "The id of the app to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "app", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateApp" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "Profile" + "Apps" ] - }, - "patch": { - "operationId": "UpdateUserSettings", + } + }, + "/v1/apps/{id}/pause": { + "post": { + "summary": "Pause App", + "description": "App pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", + "operationId": "PauseApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateUserSettingsReply" + "$ref": "#/definitions/PauseAppReply" } }, "400": { @@ -2519,28 +2583,28 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the app to pause.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserSettingsRequest" - } + "type": "string" } ], "tags": [ - "Profile" + "Apps" ] } }, - "/v1/account/signup": { + "/v1/apps/{id}/resume": { "post": { - "summary": "Signup\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "Signup", + "summary": "Resume App", + "description": "App resume action is allowed for the following status:\n - paused", + "operationId": "ResumeApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ResumeAppReply" } }, "400": { @@ -2588,36 +2652,27 @@ }, "parameters": [ { - "name": "body", - "description": "Create new account", - "in": "body", + "name": "id", + "description": "The id of the app to resume.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateAccountRequest" - } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Apps" ] } }, - "/v1/account/update_password": { - "post": { - "summary": "Update Password\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "UpdatePassword", + "/v1/deployment/{id}/scaling": { + "get": { + "summary": "Get Deployment Scaling", + "operationId": "GetDeploymentScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/GetDeploymentScalingReply" } }, "400": { @@ -2665,35 +2720,41 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdatePasswordRequest" - } + "type": "string" }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "region", + "description": "(Optional) Filter on region", + "in": "query", "required": false, "type": "string" + }, + { + "name": "replica_index", + "description": "(Optional) Filter on replica_index", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" } ], "tags": [ - "Profile" + "Deployments" ] } }, - "/v1/account/validate/{id}": { - "post": { - "summary": "Validate\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "Validate", - "responses": { + "/v1/deployment_events": { + "get": { + "summary": "List Deployment events", + "operationId": "ListDeploymentEvents", + "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ListDeploymentEventsReply" } }, "400": { @@ -2741,34 +2802,59 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", + "in": "query", + "required": false, "type": "string" }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "types", + "description": "(Optional) Filter on deployment event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", "required": false, "type": "string" } ], "tags": [ - "Profile" + "Deployments" ] } }, - "/v1/billing/has_unpaid_invoices": { + "/v1/deployments": { "get": { - "summary": "Experimental: Has unpaid invoices", - "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", - "operationId": "HasUnpaidInvoices", + "summary": "List Deployments", + "operationId": "ListDeployments", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/HasUnpaidInvoicesReply" + "$ref": "#/definitions/ListDeploymentsReply" } }, "400": { @@ -2814,19 +2900,79 @@ } } }, + "parameters": [ + { + "name": "app_id", + "description": "(Optional) Filter on application id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "STASHED", + "SLEEPING" + ] + }, + "collectionFormat": "multi" + } + ], "tags": [ - "billing" + "Deployments" ] } }, - "/v1/billing/manage": { + "/v1/deployments/{id}": { "get": { - "operationId": "Manage", + "summary": "Get Deployment", + "operationId": "GetDeployment", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ManageReply" + "$ref": "#/definitions/GetDeploymentReply" } }, "400": { @@ -2872,21 +3018,30 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "The id of the deployment", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "billing" + "Deployments" ] } }, - "/v1/billing/next_invoice": { - "get": { - "summary": "Experimental: Fetch next invoice", - "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", - "operationId": "NextInvoice", + "/v1/deployments/{id}/cancel": { + "post": { + "summary": "Cancel Deployment", + "description": "Deployment cancellation is allowed for the following status:\n - pending\n - provisioning\n - scheduled", + "operationId": "CancelDeployment", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/NextInvoiceReply" + "$ref": "#/definitions/CancelDeploymentReply" } }, "400": { @@ -2932,20 +3087,29 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "The id of the deployment to cancel.", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "billing" + "Deployments" ] } }, - "/v1/github/installation": { + "/v1/regional_deployment_events": { "get": { - "summary": "Fetch Github Installation configuration", - "operationId": "GetGithubInstallation", + "summary": "List Regional Deployment events", + "operationId": "ListRegionalDeploymentEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetGithubInstallationReply" + "$ref": "#/definitions/ListRegionalDeploymentEventsReply" } }, "400": { @@ -2991,18 +3155,62 @@ } } }, + "parameters": [ + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on regional deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on regional deployment event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "organization" + "RegionalDeployments" ] - }, - "post": { - "summary": "Start Github Installation", - "operationId": "GithubInstallation", + } + }, + "/v1/regional_deployments": { + "get": { + "summary": "List Regional Deployments", + "description": "Experimental: use at your own risk", + "operationId": "ListRegionalDeployments", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GithubInstallationReply" + "$ref": "#/definitions/ListRegionalDeploymentsReply" } }, "400": { @@ -3050,28 +3258,42 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GithubInstallationRequest" - } + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "RegionalDeployments" ] } }, - "/v1/organizations": { - "post": { - "summary": "Create Organization", - "operationId": "CreateOrganization", - "responses": { - "200": { - "description": "A successful response.", + "/v1/regional_deployments/{id}": { + "get": { + "summary": "Get Regional Deployment", + "description": "Experimental: use at your own risk", + "operationId": "GetRegionalDeployment", + "responses": { + "200": { + "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateOrganizationReply" + "$ref": "#/definitions/GetRegionalDeploymentReply" } }, "400": { @@ -3119,28 +3341,28 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the regional deployment", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateOrganizationRequest" - } + "type": "string" } ], "tags": [ - "organization" + "RegionalDeployments" ] } }, - "/v1/organizations/{id}": { + "/v1/docker-helper/verify": { "get": { - "summary": "Get Organization", - "operationId": "GetOrganization", + "summary": "Verify Docker Image", + "description": "Verify if a docker image is reachable", + "operationId": "VerifyDockerImage", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationReply" + "$ref": "#/definitions/VerifyDockerImageReply" } }, "400": { @@ -3188,24 +3410,34 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "image", + "description": "The full image uri to be verified", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "secret_id", + "description": "(Optional) the id of the secret to use to authenticate to the registry", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "organization" + "DockerHelper" ] - }, - "delete": { - "summary": "Delete an Organization", - "operationId": "DeleteOrganization", + } + }, + "/v1/volume_events": { + "get": { + "summary": "List Persistent Volume events", + "operationId": "ListPersistentVolumeEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteOrganizationReply" + "$ref": "#/definitions/ListPersistentVolumeEventsReply" } }, "400": { @@ -3253,24 +3485,59 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "persistent_volume_id", + "description": "(Optional) Filter on persistent volume id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on persistent volume event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] - }, - "put": { - "summary": "Update Organization", - "operationId": "UpdateOrganization", + } + }, + "/v1/volumes": { + "get": { + "summary": "List all PersistentVolumes", + "operationId": "ListPersistentVolumes", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationReply" + "$ref": "#/definitions/ListPersistentVolumesReply" } }, "400": { @@ -3318,38 +3585,60 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, "type": "string" }, { - "name": "organization", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Organization" - } + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" }, { - "name": "update_mask", + "name": "service_id", + "description": "(Optional) A filter for the service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "region", + "description": "(Optional) A filter for the region", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "(Optional) A filter for the name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", "in": "query", "required": false, "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] }, - "patch": { - "summary": "Update Organization", - "operationId": "UpdateOrganization2", + "post": { + "summary": "Create a PersistentVolume", + "operationId": "CreatePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationReply" + "$ref": "#/definitions/CreatePersistentVolumeReply" } }, "400": { @@ -3397,41 +3686,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "organization", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Organization" + "$ref": "#/definitions/CreatePersistentVolumeRequest" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] } }, - "/v1/organizations/{id}/access_token": { - "post": { - "summary": "CreateAccessToken", - "description": "CreateAccessToken creates a short-lived access token in the scope of the\nspecified organization, provided the user making the request is part of\nsaid organization.\n\nIt's possible to specify a validity for the token, which defaults to 1h\nand must be no more than 24h. The format is `s`, where ``\nis a floating point in seconds (so `123.456789012s` means 123 seconds and\n456789012 nanoseconds). See:\nhttps://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration.html.", - "operationId": "CreateAccessToken", + "/v1/volumes/{id}": { + "get": { + "summary": "Get a PersistentVolume", + "operationId": "GetPersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateAccessTokenReply" + "$ref": "#/definitions/GetPersistentVolumeReply" } }, "400": { @@ -3480,40 +3756,23 @@ "parameters": [ { "name": "id", - "description": "Organization id for ephemeral credential", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "validity": { - "type": "string", - "title": "Validity of the credential" - } - } - } } ], "tags": [ - "organization" + "PersistentVolumes" ] - } - }, - "/v1/organizations/{id}/deactivate": { - "post": { - "summary": "Deactivate an Organization", - "operationId": "DeactivateOrganization", + }, + "delete": { + "summary": "Delete a PersistentVolume", + "operationId": "DeletePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeactivateOrganizationReply" + "$ref": "#/definitions/DeletePersistentVolumeReply" } }, "400": { @@ -3565,36 +3824,20 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "skip_confirmation": { - "type": "boolean", - "description": "if set to true, skip_confirmation will directly start the deactivation\nprocess, without sending a confirmation email beforehand." - } - } - } } ], "tags": [ - "organization" + "PersistentVolumes" ] - } - }, - "/v1/organizations/{id}/default_project": { - "put": { - "summary": "Update Organization's default project", - "operationId": "UpdateOrganizationDefaultProject", + }, + "post": { + "summary": "Update a PersistentVolume", + "operationId": "UpdatePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationDefaultProjectReply" + "$ref": "#/definitions/UpdatePersistentVolumeReply" } }, "400": { @@ -3654,27 +3897,34 @@ "schema": { "type": "object", "properties": { - "default_project_id": { - "type": "string" - } - } - } - } - ], + "name": { + "type": "string", + "title": "(Optional) change the name of the volume" + }, + "max_size": { + "type": "integer", + "format": "int64", + "title": "(Optional) increase the volume size (in Gigabyte / GB)" + } + } + } + } + ], "tags": [ - "organization" + "PersistentVolumes" ] } }, - "/v1/organizations/{id}/name": { - "put": { - "summary": "Update Organization Name", - "operationId": "UpdateOrganizationName", + "/v1/archives": { + "post": { + "summary": "Create Archive", + "description": "Create a signed URL to upload an archive.", + "operationId": "CreateArchive", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationNameReply" + "$ref": "#/definitions/CreateArchiveReply" } }, "400": { @@ -3722,39 +3972,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", + "name": "archive", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } + "$ref": "#/definitions/CreateArchive" } } ], "tags": [ - "organization" + "Archives" ] } }, - "/v1/organizations/{id}/plan": { - "post": { - "summary": "Update Organization plan", - "operationId": "UpdateOrganizationPlan", + "/v1/instance_events": { + "get": { + "summary": "List Instance events", + "operationId": "ListInstanceEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationPlanReply" + "$ref": "#/definitions/ListInstanceEventsReply" } }, "400": { @@ -3802,42 +4041,63 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "instance_ids", + "description": "(Optional) Filter on list of instance id", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "types", + "description": "(Optional) Filter on instance event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "plan": { - "$ref": "#/definitions/Plan" - }, - "coupon_code": { - "type": "string" - } - } - } + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "Instances" ] } }, - "/v1/organizations/{id}/reactivate": { - "post": { - "summary": "Reactivate an Organization", - "operationId": "ReactivateOrganization", + "/v1/instances": { + "get": { + "summary": "List Instances", + "operationId": "ListInstances", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ReactivateOrganizationReply" + "$ref": "#/definitions/ListInstancesReply" } }, "400": { @@ -3885,34 +4145,120 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "app_id", + "description": "(Optional) Filter on application id", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on regional deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "allocation_id", + "description": "(Optional) Filter on allocation id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "replica_index", + "description": "(Optional) Filter on replica index", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on instance statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "ALLOCATING", + "STARTING", + "HEALTHY", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERROR", + "SLEEPING" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "starting_time", + "description": "(Optional) The starting time of the period of running instance", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "ending_time", + "description": "(Optional) The ending time of the period of running instance", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" } ], "tags": [ - "organization" + "Instances" ] } }, - "/v1/organizations/{id}/signup_qualification": { - "post": { - "summary": "Upsert Organization's signup qualification", - "operationId": "UpsertSignupQualification", + "/v1/instances/{id}": { + "get": { + "summary": "Get Instance", + "operationId": "GetInstance", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpsertSignupQualificationReply" + "$ref": "#/definitions/GetInstanceReply" } }, "400": { @@ -3961,38 +4307,26 @@ "parameters": [ { "name": "id", + "description": "The id of the instance", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "signup_qualification": { - "type": "object" - } - } - } } ], "tags": [ - "organization" + "Instances" ] } }, - "/v1/organizations/{id}/switch": { - "post": { - "summary": "Switch Organization context\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "SwitchOrganization", + "/v1/snapshots": { + "get": { + "summary": "List all Snapshots", + "operationId": "ListSnapshots", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ListSnapshotsReply" } }, "400": { @@ -4040,41 +4374,65 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "organization_id", + "description": "(Optional) Filter by organization_id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter by status\n\n - SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "SNAPSHOT_STATUS_INVALID", + "SNAPSHOT_STATUS_CREATING", + "SNAPSHOT_STATUS_AVAILABLE", + "SNAPSHOT_STATUS_MIGRATING", + "SNAPSHOT_STATUS_DELETING", + "SNAPSHOT_STATUS_DELETED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "region", + "description": "(Optional) A filter for the region", + "in": "query", "required": false, "type": "string" } ], "tags": [ - "organization" + "Snapshots" ] - } - }, - "/v1/organizations/{organization_id}/budget": { - "get": { - "summary": "Get Budget", - "operationId": "GetBudget", + }, + "post": { + "summary": "Create a Snapshot", + "operationId": "CreateSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetBudgetReply" + "$ref": "#/definitions/CreateSnapshotReply" } }, "400": { @@ -4122,24 +4480,28 @@ }, "parameters": [ { - "name": "organization_id", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreateSnapshotRequest" + } } ], "tags": [ - "organization" + "Snapshots" ] - }, - "delete": { - "summary": "Delete Budget", - "operationId": "DeleteBudget", + } + }, + "/v1/snapshots/{id}": { + "get": { + "summary": "Get a Snapshot", + "operationId": "GetSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteBudgetReply" + "$ref": "#/definitions/GetSnapshotReply" } }, "400": { @@ -4187,24 +4549,24 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", "in": "path", "required": true, "type": "string" } ], "tags": [ - "organization" + "Snapshots" ] }, - "post": { - "summary": "Create Budget", - "operationId": "CreateBudget", + "delete": { + "summary": "Delete a Snapshot", + "operationId": "DeleteSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateBudgetReply" + "$ref": "#/definitions/DeleteSnapshotReply" } }, "400": { @@ -4252,39 +4614,24 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "amount": { - "type": "string", - "format": "int64", - "description": "In cents." - } - } - } } ], "tags": [ - "organization" + "Snapshots" ] }, - "put": { - "summary": "Update Budget", - "operationId": "UpdateBudget", + "post": { + "summary": "Update a Snapshot", + "operationId": "UpdateSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateBudgetReply" + "$ref": "#/definitions/UpdateSnapshotReply" } }, "400": { @@ -4332,7 +4679,8 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", + "description": "The id of the snapshot", "in": "path", "required": true, "type": "string" @@ -4344,28 +4692,28 @@ "schema": { "type": "object", "properties": { - "amount": { + "name": { "type": "string", - "format": "int64", - "description": "In cents." + "title": "Change the name of the snapshot" } } } } ], "tags": [ - "organization" + "Snapshots" ] } }, - "/v1/sso/canny": { - "post": { - "operationId": "CannyAuth", + "/v1/secrets": { + "get": { + "summary": "List Secrets", + "operationId": "ListSecrets", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CannyAuthReply" + "$ref": "#/definitions/ListSecretsReply" } }, "400": { @@ -4413,27 +4761,59 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CannyAuthRequest" - } + "name": "name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "Filter by secret types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "SIMPLE", + "REGISTRY", + "MANAGED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "sso" + "Secrets" ] - } - }, - "/v1/sso/discourse": { + }, "post": { - "operationId": "DiscourseAuth", + "summary": "Create Secret", + "operationId": "CreateSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DiscourseAuthReply" + "$ref": "#/definitions/CreateSecretReply" } }, "400": { @@ -4481,29 +4861,28 @@ }, "parameters": [ { - "name": "body", + "name": "secret", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DiscourseAuthRequest" + "$ref": "#/definitions/CreateSecret" } } ], "tags": [ - "sso" + "Secrets" ] } }, - "/v1/unscope_organization_token": { - "post": { - "summary": "Unscope Organization Token", - "description": "UnscopeOrganizationToken removes the organization scope from a token. This\nendpoint is useful when a user wants to remove an organization: by\nunscoping the token first, the user can then delete the organization\nwithout invalidating his token.", - "operationId": "UnscopeOrganizationToken", + "/v1/secrets/{id}": { + "get": { + "summary": "Get Secret", + "operationId": "GetSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/GetSecretReply" } }, "400": { @@ -4551,35 +4930,24 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UnscopeOrganizationTokenRequest" - } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, "type": "string" } ], "tags": [ - "organization" + "Secrets" ] - } - }, - "/v2/account/profile": { - "put": { - "summary": "Update User V2", - "operationId": "UpdateUserV2", + }, + "delete": { + "summary": "Delete Secret", + "operationId": "DeleteSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/DeleteSecretReply" } }, "400": { @@ -4627,32 +4995,24 @@ }, "parameters": [ { - "name": "user", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Secrets" ] }, - "patch": { - "summary": "Update User V2", - "operationId": "UpdateUserV22", + "put": { + "summary": "Update Secret", + "operationId": "UpdateSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/UpdateSecretReply" } }, "400": { @@ -4700,11 +5060,17 @@ }, "parameters": [ { - "name": "user", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "secret", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + "$ref": "#/definitions/Secret" } }, { @@ -4715,20 +5081,17 @@ } ], "tags": [ - "Profile" + "Secrets" ] - } - }, - "/v1/coupons": { - "post": { - "summary": "Redeem Coupon", - "description": "This API allows to redeem a coupon. Pass the code you received in the body.", - "operationId": "RedeemCoupon", + }, + "patch": { + "summary": "Update Secret", + "operationId": "UpdateSecret2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RedeemCouponReply" + "$ref": "#/definitions/UpdateSecretReply" } }, "400": { @@ -4776,29 +5139,40 @@ }, "parameters": [ { - "name": "body", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "secret", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RedeemCouponRequest" + "$ref": "#/definitions/Secret" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Coupons" + "Secrets" ] } }, - "/v1/coupons/{code}": { - "get": { - "summary": "Check Coupon", - "description": "This API allows to check if a given coupon is valid. It is heavily rate-limited.", - "operationId": "CheckCoupon", + "/v1/secrets/{id}/reveal": { + "post": { + "summary": "Reveal Secret", + "operationId": "RevealSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CheckCouponReply" + "$ref": "#/definitions/RevealSecretReply" } }, "400": { @@ -4846,26 +5220,34 @@ }, "parameters": [ { - "name": "code", + "name": "id", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "tags": [ - "Coupons" + "Secrets" ] } }, - "/v1/organization_invitations": { + "/v1/domains": { "get": { - "summary": "List Organization Invitations", - "operationId": "ListOrganizationInvitations", + "summary": "List Domains", + "operationId": "ListDomains", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListOrganizationInvitationsReply" + "$ref": "#/definitions/ListDomainsReply" } }, "400": { @@ -4926,44 +5308,77 @@ "required": false, "type": "string" }, + { + "name": "types", + "description": "(Optional) A filter for types\n\n - AUTOASSIGNED: Domain like -.koyeb.app", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "AUTOASSIGNED", + "CUSTOM" + ] + }, + "collectionFormat": "multi" + }, { "name": "statuses", - "description": "(Optional) Filter on organization invitation statuses", + "description": "(Optional) A filter for statuses", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ - "INVALID", "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" + "ACTIVE", + "ERROR", + "DELETING", + "DELETED" ] }, "collectionFormat": "multi" }, { - "name": "user_id", - "description": "(Optional) Filter on invitee ID. Will match both invitations sent to\nthat user_id and invitations sent to the email of that user_id.\nThe only valid value is the requester's user_id", + "name": "app_ids", + "description": "(Optional) A filter for apps", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", "in": "query", "required": false, "type": "string" } ], "tags": [ - "OrganizationInvitations" + "Domains" ] }, "post": { - "summary": "Create Organization Invitation", - "operationId": "CreateOrganizationInvitation", + "summary": "Create Domain", + "operationId": "CreateDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateOrganizationInvitationReply" + "$ref": "#/definitions/CreateDomainReply" } }, "400": { @@ -5011,28 +5426,28 @@ }, "parameters": [ { - "name": "body", + "name": "domain", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrganizationInvitationRequest" + "$ref": "#/definitions/CreateDomain" } } ], "tags": [ - "OrganizationInvitations" + "Domains" ] } }, - "/v1/organization_invitations/{id}": { + "/v1/domains/{id}": { "get": { - "summary": "Get Organization Invitation", - "operationId": "GetOrganizationInvitation", + "summary": "Get Domain", + "operationId": "GetDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationInvitationReply" + "$ref": "#/definitions/GetDomainReply" } }, "400": { @@ -5081,24 +5496,23 @@ "parameters": [ { "name": "id", - "description": "The id of the invitation to get", "in": "path", "required": true, "type": "string" } ], "tags": [ - "OrganizationInvitations" + "Domains" ] }, "delete": { - "summary": "Delete Organization Invitation", - "operationId": "DeleteOrganizationInvitation", + "summary": "Delete Domain", + "operationId": "DeleteDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteOrganizationInvitationReply" + "$ref": "#/definitions/DeleteDomainReply" } }, "400": { @@ -5147,26 +5561,23 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to delete", "in": "path", "required": true, "type": "string" } ], "tags": [ - "OrganizationInvitations" + "Domains" ] - } - }, - "/v1/organization_invitations/{id}/resend": { - "post": { - "summary": "Resend Organization Invitation", - "operationId": "ResendOrganizationInvitation", + }, + "patch": { + "summary": "Update Domain", + "operationId": "UpdateDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResendOrganizationInvitationReply" + "$ref": "#/definitions/UpdateDomainReply" } }, "400": { @@ -5215,34 +5626,46 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to resend", "in": "path", "required": true, "type": "string" }, { - "name": "body", + "name": "domain", "in": "body", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/UpdateDomain" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "dry_run", + "description": "If set, run validation and check that the domain is available.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "OrganizationInvitations" + "Domains" ] } }, - "/v1/organization_confirmations/{id}": { + "/v1/domains/{id}/refresh": { "post": { - "summary": "Confirm organization action", - "operationId": "ConfirmOrganizationAction", + "summary": "Refresh Domain Status", + "operationId": "RefreshDomainStatus", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ConfirmOrganizationActionReply" + "$ref": "#/definitions/RefreshDomainStatusReply" } }, "400": { @@ -5297,19 +5720,19 @@ } ], "tags": [ - "OrganizationConfirmations" + "Domains" ] } }, - "/v1/credentials": { - "get": { - "summary": "List credentials", - "operationId": "ListCredentials", + "/v1/quotas/capacity": { + "post": { + "summary": "DEPRECATED: Review Organization Capacity", + "operationId": "ReviewOrganizationCapacity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListCredentialsReply" + "$ref": "#/definitions/ReviewOrganizationCapacityReply" } }, "400": { @@ -5357,66 +5780,28 @@ }, "parameters": [ { - "name": "type", - "description": "(Optional) A filter for type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "INVALID", - "USER", - "ORGANIZATION" - ], - "default": "INVALID" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "organization_id", - "description": "(Optional) Filter for an organization", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "user_id", - "description": "(Optional) Filter for an user", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReviewOrganizationCapacityRequest" + } } ], "tags": [ - "Credentials" + "Quotas" ] - }, + } + }, + "/v1/compose": { "post": { - "summary": "Create credential", - "operationId": "CreateCredential", + "summary": "Create resources from compose.", + "operationId": "Compose", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateCredentialReply" + "$ref": "#/definitions/ComposeReply" } }, "400": { @@ -5464,28 +5849,27 @@ }, "parameters": [ { - "name": "credential", + "name": "compose", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateCredential" + "$ref": "#/definitions/CreateCompose" } } ], "tags": [ - "Credentials" + "Compose" ] } }, - "/v1/credentials/{id}": { + "/v1/instance_snapshot_events": { "get": { - "summary": "Get credential", - "operationId": "GetCredential", + "operationId": "ListInstanceSnapshotEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetCredentialReply" + "$ref": "#/definitions/ListInstanceSnapshotEventsReply" } }, "400": { @@ -5533,24 +5917,58 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "instance_snapshot_id", + "description": "(Optional) Filter on instance snapshot id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on instance snapshot event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "Credentials" + "InstanceSnapshots" ] - }, - "delete": { - "summary": "Delete credential", - "operationId": "DeleteCredential", + } + }, + "/v1/instance_snapshots": { + "get": { + "operationId": "ListInstanceSnapshots", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteCredentialReply" + "$ref": "#/definitions/ListInstanceSnapshotsReply" } }, "400": { @@ -5598,24 +6016,65 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "required": false, "type": "string" + }, + { + "name": "statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "INSTANCE_SNAPSHOT_STATUS_INVALID", + "INSTANCE_SNAPSHOT_STATUS_CREATING", + "INSTANCE_SNAPSHOT_STATUS_AVAILABLE", + "INSTANCE_SNAPSHOT_STATUS_ERROR", + "INSTANCE_SNAPSHOT_STATUS_DELETING", + "INSTANCE_SNAPSHOT_STATUS_DELETED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "type", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "INSTANCE_SNAPSHOT_TYPE_INVALID", + "INSTANCE_SNAPSHOT_TYPE_FILESYSTEM", + "INSTANCE_SNAPSHOT_TYPE_FULL" + ], + "default": "INSTANCE_SNAPSHOT_TYPE_INVALID" } ], "tags": [ - "Credentials" + "InstanceSnapshots" ] }, - "put": { - "summary": "Update credential", - "operationId": "UpdateCredential", + "post": { + "operationId": "CreateInstanceSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateCredentialReply" + "$ref": "#/definitions/CreateInstanceSnapshotReply" } }, "400": { @@ -5663,38 +6122,27 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "credential", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Credential" + "$ref": "#/definitions/CreateInstanceSnapshotRequest" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Credentials" + "InstanceSnapshots" ] - }, - "patch": { - "summary": "Update credential", - "operationId": "UpdateCredential2", + } + }, + "/v1/instance_snapshots/{id}": { + "get": { + "operationId": "GetInstanceSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateCredentialReply" + "$ref": "#/definitions/GetInstanceSnapshotReply" } }, "400": { @@ -5746,36 +6194,19 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "credential", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Credential" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Credentials" + "InstanceSnapshots" ] - } - }, - "/v1/projects": { - "get": { - "summary": "List projects", - "operationId": "ListProjects", + }, + "delete": { + "operationId": "DeleteInstanceSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListProjectsReply" + "$ref": "#/definitions/DeleteInstanceSnapshotReply" } }, "400": { @@ -5823,39 +6254,26 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) Filter by project name", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "Projects" + "InstanceSnapshots" ] - }, - "post": { - "summary": "Create project", - "operationId": "CreateProject", + } + }, + "/v1/test/anon": { + "get": { + "summary": "Test anonymous call", + "operationId": "TestAnon", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateProjectReply" + "$ref": "#/definitions/ktest.TestAnonReply" } }, "400": { @@ -5901,30 +6319,20 @@ } } }, - "parameters": [ - { - "name": "project", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateProject" - } - } - ], "tags": [ - "Projects" + "Test" ] } }, - "/v1/projects/{id}": { - "get": { - "summary": "Get project", - "operationId": "GetProject", + "/v1/test/auth": { + "post": { + "summary": "Test authenticated call", + "operationId": "TestAuth", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetProjectReply" + "$ref": "#/definitions/ktest.TestAuthReply" } }, "400": { @@ -5972,24 +6380,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/ktest.TestAuthRequest" + } } ], "tags": [ - "Projects" + "Test" ] - }, - "delete": { - "summary": "Delete project", - "operationId": "DeleteProject", + } + }, + "/v1/streams/logs/query": { + "get": { + "summary": "Query logs", + "operationId": "QueryLogs", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteProjectReply" + "$ref": "#/definitions/QueryLogsReply" } }, "400": { @@ -6037,184 +6449,156 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "type", + "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", + "in": "query", + "required": false, "type": "string" - } - ], - "tags": [ - "Projects" - ] - }, - "put": { - "summary": "Update project", - "operationId": "UpdateProject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/UpdateProjectReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } - }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "app_id", + "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "service_id", + "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "deployment_id", + "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "instance_id", + "description": "Deprecated, prefer using instance_ids instead.", + "in": "query", + "required": false, "type": "string" }, { - "name": "project", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Project" - } + "name": "instance_ids", + "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" }, { - "name": "update_mask", + "name": "stream", + "description": "Deprecated, prefer using streams instead.", "in": "query", "required": false, "type": "string" - } - ], - "tags": [ - "Projects" - ] - }, - "patch": { - "summary": "Update project", - "operationId": "UpdateProject2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/UpdateProjectReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "streams", + "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "start", + "description": "(Optional) Must always be before `end`. Defaults to 15 minutes ago.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "end", + "description": "(Optional) Must always be after `start`. Defaults to now.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "order", + "description": "(Optional) `asc` or `desc`. Defaults to `desc`.", + "in": "query", + "required": false, + "type": "string" }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "limit", + "description": "(Optional) Defaults to 100. Maximum of 1000.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "regex", + "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "in": "query", + "required": false, "type": "string" }, { - "name": "project", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Project" - } + "name": "text", + "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "in": "query", + "required": false, + "type": "string" }, { - "name": "update_mask", + "name": "regions", + "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" } ], "tags": [ - "Projects" + "Logs" ] } }, - "/v1/organizations/{organization_id}/summary": { + "/v1/streams/logs/tail": { "get": { - "summary": "Get organization usage summary", - "operationId": "GetOrganizationSummary", + "summary": "Tails logs", + "operationId": "TailLogs", "responses": { "200": { - "description": "A successful response.", + "description": "A successful response.(streaming responses)", "schema": { - "$ref": "#/definitions/GetOrganizationSummaryReply" + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/LogEntry" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of LogEntry" } }, "400": { @@ -6262,103 +6646,132 @@ }, "parameters": [ { - "name": "organization_id", - "description": "Organization ID", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Summary" - ] - } - }, - "/v1/account/login": { - "post": { - "summary": "Login user\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "Login", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/LoginReply" - } + "name": "type", + "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", + "in": "query", + "required": false, + "type": "string" }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } + { + "name": "app_id", + "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "service_id", + "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "deployment_id", + "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "instance_id", + "description": "Deprecated, prefer using instance_ids instead.", + "in": "query", + "required": false, + "type": "string" }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } + { + "name": "instance_ids", + "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LoginRequest" - } + "name": "stream", + "description": "Deprecated, prefer using streams instead.", + "in": "query", + "required": false, + "type": "string" }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "streams", + "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "start", + "description": "(Optional) Defaults to 24 hours ago.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "limit", + "description": "(Optional) Defaults to 1000. Maximum of 1000.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "regex", + "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "text", + "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "in": "query", "required": false, "type": "string" + }, + { + "name": "regions", + "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" } ], "tags": [ - "Sessions" + "Logs" ] } }, - "/v1/account/logout": { - "delete": { - "summary": "Logout user\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "Logout", + "/v1/streams/metrics": { + "get": { + "summary": "Get Metrics", + "operationId": "GetMetrics", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LogoutReply" + "$ref": "#/definitions/GetMetricsReply" } }, "400": { @@ -6404,20 +6817,89 @@ } } }, + "parameters": [ + { + "name": "service_id", + "description": "ID of the service to query instances metrics for. Ignored if instance_id is set.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "instance_id", + "description": "ID of the instance to query metrics for.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "Metric to query.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "UNKNOWN", + "CPU_TOTAL_PERCENT", + "MEM_RSS", + "HTTP_THROUGHPUT", + "HTTP_RESPONSE_TIME_50P", + "HTTP_RESPONSE_TIME_90P", + "HTTP_RESPONSE_TIME_99P", + "HTTP_RESPONSE_TIME_MAX", + "PUBLIC_DATA_TRANSFER_IN", + "PUBLIC_DATA_TRANSFER_OUT" + ], + "default": "UNKNOWN" + }, + { + "name": "start", + "description": "(Optional) Defaults to an hour prior to end.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "end", + "description": "(Optional) Defaults to now.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "step", + "description": "(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "Sessions" + "Metrics" ] } }, - "/v1/account/refresh": { - "put": { - "summary": "Refresh token\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "RefreshToken", + "/v1/streams/instances/exec": { + "get": { + "summary": "Exec Command", + "description": "This endpoint opens a websocket. Once open, all frames going through the websocket should be formatted in JSON. Input frames should match the format specified below. Output frames will match the response schema.", + "operationId": "ExecCommand", "responses": { "200": { - "description": "A successful response.", + "description": "A successful response.(streaming responses)", "schema": { - "$ref": "#/definitions/LoginReply" + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/ExecCommandReply" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of ExecCommandReply" } }, "400": { @@ -6463,21 +6945,88 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "ID of the resource to exec on.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "body.command", + "description": "Command to exec. Mandatory in the first frame sent", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "body.tty_size.height", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "body.tty_size.width", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "body.stdin.data", + "description": "Data is base64 encoded", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "body.stdin.close", + "description": "Indicate last data frame", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "body.disableTty", + "description": "Disable TTY. It's enough to specify it in the first frame", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "id_type", + "description": "When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "INVALID", + "INSTANCE_ID", + "SERVICE_ID" + ], + "default": "INVALID" + } + ], "tags": [ - "Sessions" + "Instances" ] } }, - "/v1/account/session": { - "post": { - "summary": "New session", - "description": "Creates a new session without an organization for current user.\nNOTE: If you want a session linked to another organization, please use \"Switch organization\".\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", - "operationId": "NewSession", + "/v1/account/activities": { + "get": { + "operationId": "GetAccountActivities", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ActivityList" } }, "400": { @@ -6523,19 +7072,34 @@ } } }, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "Sessions" + "activity" ] } }, - "/v1/organizations/{organization_id}/quotas": { + "/v1/account/idenfy": { "get": { - "operationId": "GetQuotas", + "summary": "Begin a session with iDenfy, emit an authToken", + "operationId": "GetIdenfyToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetQuotasReply" + "$ref": "#/definitions/GetIdenfyTokenReply" } }, "400": { @@ -6581,28 +7145,18 @@ } } }, - "parameters": [ - { - "name": "organization_id", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "OrganizationQuotas" + "Profile" ] - } - }, - "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}": { + }, "post": { - "summary": "Create an attempt for a stage", - "operationId": "CreateStageAttempt", + "summary": "ClearIdenfyVerificationResult marks the current result for idenfy as\nsuperseded", + "operationId": "ClearIdenfyVerificationResult", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateStageAttemptReply" + "$ref": "#/definitions/ClearIdenfyVerificationResultReply" } }, "400": { @@ -6649,69 +7203,29 @@ } }, "parameters": [ - { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "attempt", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "steps": { - "type": "array", - "items": { - "type": "string" - } - } - } + "$ref": "#/definitions/ClearIdenfyVerificationResultRequest" } } ], "tags": [ - "Provisioning" + "Profile" ] - }, - "patch": { - "summary": "Declare stage progress", - "operationId": "DeclareStageProgress", + } + }, + "/v1/account/invite": { + "post": { + "summary": "DEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "CreateInvite", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclareStageProgressReply" + "$ref": "#/definitions/Empty" } }, "400": { @@ -6758,74 +7272,29 @@ } }, "parameters": [ - { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "attempt", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "finished_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "image_pushed": { - "type": "boolean" - }, - "internal_failure": { - "type": "boolean" - }, - "retryable_failure": { - "type": "boolean" - } - } + "$ref": "#/definitions/InviteUserRequest" } } ], "tags": [ - "Provisioning" + "invite" ] } }, - "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}": { - "patch": { - "summary": "Declare step progress", - "operationId": "DeclareStepProgress", + "/v1/account/login_method": { + "get": { + "summary": "Get the login method for an email address\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "LoginMethod", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclareStepProgressReply" + "$ref": "#/definitions/LoginMethodReply" } }, "400": { @@ -6873,74 +7342,26 @@ }, "parameters": [ { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, + "name": "email", + "in": "query", + "required": false, "type": "string" - }, - { - "name": "attempt", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "step", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "finished_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - } - } - } } ], "tags": [ - "Provisioning" + "Profile" ] } }, - "/v1/compose": { - "post": { - "summary": "Create resources from compose.", - "operationId": "Compose", + "/v1/account/oauth": { + "get": { + "summary": "Get OAuth Providers", + "operationId": "GetOAuthOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ComposeReply" + "$ref": "#/definitions/GetOAuthOptionsReply" } }, "400": { @@ -6988,28 +7409,38 @@ }, "parameters": [ { - "name": "compose", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCompose" - } + "name": "action", + "description": "Which authentication flow is being initiated", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "signin", + "signup", + "register" + ], + "default": "signin" + }, + { + "name": "metadata", + "description": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Compose" + "Profile" ] - } - }, - "/v1/domains": { - "get": { - "summary": "List Domains", - "operationId": "ListDomains", + }, + "post": { + "summary": "Authenticate using OAuth", + "operationId": "OAuthCallback", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDomainsReply" + "$ref": "#/definitions/OAuthCallbackReply" } }, "400": { @@ -7057,90 +7488,35 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) A filter for types\n\n - AUTOASSIGNED: Domain like -.koyeb.app", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "AUTOASSIGNED", - "CUSTOM" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "statuses", - "description": "(Optional) A filter for statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "PENDING", - "ACTIVE", - "ERROR", - "DELETING", - "DELETED" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "app_ids", - "description": "(Optional) A filter for apps", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OAuthCallbackRequest" + } }, { - "name": "project_id", - "description": "(Optional) A filter for the project ID", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "Domains" + "Profile" ] - }, - "post": { - "summary": "Create Domain", - "operationId": "CreateDomain", + } + }, + "/v1/account/organization": { + "get": { + "summary": "Get Current Organization", + "operationId": "GetCurrentOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateDomainReply" + "$ref": "#/definitions/GetOrganizationReply" } }, "400": { @@ -7186,30 +7562,20 @@ } } }, - "parameters": [ - { - "name": "domain", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateDomain" - } - } - ], "tags": [ - "Domains" + "Profile" ] } }, - "/v1/domains/{id}": { + "/v1/account/organization_invitations": { "get": { - "summary": "Get Domain", - "operationId": "GetDomain", + "summary": "List User Organization Invitations\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "ListUserOrganizationInvitations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDomainReply" + "$ref": "#/definitions/ListUserOrganizationInvitationsReply" } }, "400": { @@ -7257,24 +7623,52 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on organization invitation statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID", + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Domains" + "Profile" ] - }, - "delete": { - "summary": "Delete Domain", - "operationId": "DeleteDomain", + } + }, + "/v1/account/organization_invitations/{id}": { + "get": { + "summary": "Get User Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "GetUserOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteDomainReply" + "$ref": "#/definitions/GetUserOrganizationInvitationReply" } }, "400": { @@ -7323,23 +7717,26 @@ "parameters": [ { "name": "id", + "description": "The id of the organization invitation to get", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Domains" + "Profile" ] - }, - "patch": { - "summary": "Update Domain", - "operationId": "UpdateDomain", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/UpdateDomainReply" + } + }, + "/v1/account/organization_invitations/{id}/accept": { + "post": { + "summary": "Accept Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "AcceptOrganizationInvitation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/AcceptOrganizationInvitationReply" } }, "400": { @@ -7388,46 +7785,34 @@ "parameters": [ { "name": "id", + "description": "The id of the organization invitation to accept", "in": "path", "required": true, "type": "string" }, { - "name": "domain", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDomain" + "type": "object" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the domain is available.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Domains" + "Profile" ] } }, - "/v1/domains/{id}/refresh": { + "/v1/account/organization_invitations/{id}/decline": { "post": { - "summary": "Refresh Domain Status", - "operationId": "RefreshDomainStatus", + "summary": "Decline Organization Invitation\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "DeclineOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RefreshDomainStatusReply" + "$ref": "#/definitions/DeclineOrganizationInvitationReply" } }, "400": { @@ -7476,25 +7861,35 @@ "parameters": [ { "name": "id", + "description": "The id of the organization invitation to decline", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "tags": [ - "Domains" + "Profile" ] } }, - "/v1/app_events": { + "/v1/account/organizations": { "get": { - "summary": "List App events", - "operationId": "ListAppEvents", + "summary": "List User Organizations", + "description": "List all organizations that the current user is a member of.", + "operationId": "ListUserOrganizations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListAppEventsReply" + "$ref": "#/definitions/ListUserOrganizationsReply" } }, "400": { @@ -7542,59 +7937,68 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) Filter on app id", + "name": "limit", + "description": "(Optional) Define pagination limit", "in": "query", "required": false, "type": "string" }, { - "name": "types", - "description": "(Optional) Filter on app event types", + "name": "offset", + "description": "(Optional) Define pagination offset", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "type": "string" }, { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "search", + "description": "(Optional) Fuzzy case-insensitive search based on organization name or\norganization id", "in": "query", "required": false, "type": "string" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "statuses", + "description": "(Optional) Only return organizations which status match one in the list", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Apps" + "Profile" ] } }, - "/v1/apps": { + "/v1/account/profile": { "get": { - "summary": "List App", - "operationId": "ListApps", + "summary": "Get Current User", + "operationId": "GetCurrentUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListAppsReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -7642,46 +8046,25 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "project_id", - "description": "(Optional) A filter for the project ID", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "Apps" + "Profile" ] }, - "post": { - "summary": "Create App", - "operationId": "CreateApp", + "put": { + "summary": "Update User", + "operationId": "UpdateUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateAppReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -7729,28 +8112,32 @@ }, "parameters": [ { - "name": "app", + "name": "user", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateApp" + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Apps" + "Profile" ] - } - }, - "/v1/apps/{id}": { - "get": { - "summary": "Get App", - "operationId": "GetApp", + }, + "patch": { + "summary": "Update User", + "operationId": "UpdateUser2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetAppReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -7798,26 +8185,34 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the App", - "in": "path", + "name": "user", + "in": "body", "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "Apps" + "Profile" ] - }, - "delete": { - "summary": "Delete App", - "description": "App deletion is allowed for all status.", - "operationId": "DeleteApp", + } + }, + "/v1/account/resend_validation": { + "post": { + "summary": "Resend Email Verification\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "ResendEmailValidation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteAppReply" + "$ref": "#/definitions/ResendEmailValidationReply" } }, "400": { @@ -7865,25 +8260,28 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the App to delete", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/ResendEmailValidationRequest" + } } ], "tags": [ - "Apps" + "Profile" ] - }, - "put": { - "summary": "Update App", - "operationId": "UpdateApp", + } + }, + "/v1/account/reset_password": { + "post": { + "summary": "Reset Password\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "ResetPassword", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateAppReply" + "$ref": "#/definitions/ResetPasswordReply" } }, "400": { @@ -7931,39 +8329,27 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the app to update.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "app", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateApp" + "$ref": "#/definitions/ResetPasswordRequest" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Apps" + "Profile" ] - }, - "patch": { - "summary": "Update App", - "operationId": "UpdateApp2", + } + }, + "/v1/account/settings": { + "get": { + "operationId": "GetUserSettings", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateAppReply" + "$ref": "#/definitions/GetUserSettingsReply" } }, "400": { @@ -8009,44 +8395,17 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the app to update.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "app", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateApp" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" - } - ], "tags": [ - "Apps" + "Profile" ] - } - }, - "/v1/apps/{id}/pause": { - "post": { - "summary": "Pause App", - "description": "App pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", - "operationId": "PauseApp", + }, + "patch": { + "operationId": "UpdateUserSettings", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/PauseAppReply" + "$ref": "#/definitions/UpdateUserSettingsReply" } }, "400": { @@ -8094,28 +8453,28 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the app to pause.", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/UpdateUserSettingsRequest" + } } ], "tags": [ - "Apps" + "Profile" ] } }, - "/v1/apps/{id}/resume": { + "/v1/account/signup": { "post": { - "summary": "Resume App", - "description": "App resume action is allowed for the following status:\n - paused", - "operationId": "ResumeApp", + "summary": "Signup\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "Signup", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResumeAppReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -8163,27 +8522,36 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the app to resume.", - "in": "path", + "name": "body", + "description": "Create new account", + "in": "body", "required": true, + "schema": { + "$ref": "#/definitions/CreateAccountRequest" + } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, "type": "string" } ], "tags": [ - "Apps" + "Profile" ] } }, - "/v1/service_events": { - "get": { - "summary": "List Service events", - "operationId": "ListServiceEvents", + "/v1/account/update_password": { + "post": { + "summary": "Update Password\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "UpdatePassword", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListServiceEventsReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -8231,59 +8599,35 @@ }, "parameters": [ { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on service event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePasswordRequest" + } }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "Services" + "Profile" ] } }, - "/v1/services": { - "get": { - "summary": "List Services", - "operationId": "ListServices", + "/v1/account/validate/{id}": { + "post": { + "summary": "Validate\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "Validate", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListServicesReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -8331,104 +8675,34 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) The id of the app", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "types", - "description": "(Optional) Filter on service types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID_TYPE", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "statuses", - "description": "(Optional) Filter on service statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "regions", - "description": "(Optional) Filter on regions", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "project_id", - "description": "(Optional) A filter for the project ID", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "Services" + "Profile" ] - }, - "post": { - "summary": "Create Service", - "operationId": "CreateService", + } + }, + "/v1/billing/has_unpaid_invoices": { + "get": { + "summary": "Experimental: Has unpaid invoices", + "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", + "operationId": "HasUnpaidInvoices", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateServiceReply" + "$ref": "#/definitions/HasUnpaidInvoicesReply" } }, "400": { @@ -8474,38 +8748,19 @@ } } }, - "parameters": [ - { - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateService" - } - }, - { - "name": "dry_run", - "description": "If set only run validation", - "in": "query", - "required": false, - "type": "boolean" - } - ], "tags": [ - "Services" + "billing" ] } }, - "/v1/services-autocomplete": { - "post": { - "summary": "Autocomplete definition", - "description": "Generate autocomplete definition for a service", - "operationId": "Autocomplete", + "/v1/billing/manage": { + "get": { + "operationId": "Manage", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/AutocompleteReply" + "$ref": "#/definitions/ManageReply" } }, "400": { @@ -8551,30 +8806,21 @@ } } }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AutocompleteRequest" - } - } - ], "tags": [ - "Services" + "billing" ] } }, - "/v1/services/{id}": { + "/v1/billing/next_invoice": { "get": { - "summary": "Get Service", - "operationId": "GetService", + "summary": "Experimental: Fetch next invoice", + "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", + "operationId": "NextInvoice", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetServiceReply" + "$ref": "#/definitions/NextInvoiceReply" } }, "400": { @@ -8620,28 +8866,20 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the Service", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Services" + "billing" ] - }, - "delete": { - "summary": "Delete Service", - "description": "Service deletion is allowed for all status.", - "operationId": "DeleteService", + } + }, + "/v1/github/installation": { + "get": { + "summary": "Fetch Github Installation configuration", + "operationId": "GetGithubInstallation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteServiceReply" + "$ref": "#/definitions/GetGithubInstallationReply" } }, "400": { @@ -8687,27 +8925,18 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the entity to delete", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Services" + "organization" ] }, - "put": { - "summary": "Update Service", - "operationId": "UpdateService", + "post": { + "summary": "Start Github Installation", + "operationId": "GithubInstallation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateServiceReply" + "$ref": "#/definitions/GithubInstallationReply" } }, "400": { @@ -8755,46 +8984,28 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the entity to update", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "service", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateService" + "$ref": "#/definitions/GithubInstallationRequest" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the service exists", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Services" + "organization" ] - }, - "patch": { - "summary": "Update Service", - "operationId": "UpdateService2", + } + }, + "/v1/organizations": { + "post": { + "summary": "Create Organization", + "operationId": "CreateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateServiceReply" + "$ref": "#/definitions/CreateOrganizationReply" } }, "400": { @@ -8842,49 +9053,28 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the entity to update", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "service", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateService" + "$ref": "#/definitions/CreateOrganizationRequest" } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the service exists", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Services" + "organization" ] } }, - "/v1/services/{id}/pause": { - "post": { - "summary": "Pause Service", - "description": "Service pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", - "operationId": "PauseService", + "/v1/organizations/{id}": { + "get": { + "summary": "Get Organization", + "operationId": "GetOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/PauseServiceReply" + "$ref": "#/definitions/GetOrganizationReply" } }, "400": { @@ -8933,26 +9123,23 @@ "parameters": [ { "name": "id", - "description": "The id of the service to pause.", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Services" + "organization" ] - } - }, - "/v1/services/{id}/redeploy": { - "post": { - "summary": "ReDeploy Service", - "operationId": "ReDeploy", + }, + "delete": { + "summary": "Delete an Organization", + "operationId": "DeleteOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RedeployReply" + "$ref": "#/definitions/DeleteOrganizationReply" } }, "400": { @@ -9004,31 +9191,20 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "info", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RedeployRequest.Info" - } } ], "tags": [ - "Services" + "organization" ] - } - }, - "/v1/services/{id}/resume": { - "post": { - "summary": "Resume Service", - "description": "Service resume action is allowed for the following status:\n - paused", - "operationId": "ResumeService", + }, + "put": { + "summary": "Update Organization", + "operationId": "UpdateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResumeServiceReply" + "$ref": "#/definitions/UpdateOrganizationReply" } }, "400": { @@ -9077,40 +9253,37 @@ "parameters": [ { "name": "id", - "description": "The id of the service to pause.", "in": "path", "required": true, "type": "string" }, { - "name": "skip_build", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened.", - "in": "query", - "required": false, - "type": "boolean" + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Organization" + } }, { - "name": "use_cache", + "name": "update_mask", "in": "query", "required": false, - "type": "boolean" + "type": "string" } ], "tags": [ - "Services" + "organization" ] - } - }, - "/v1/services/{id}/scale": { - "get": { - "summary": "Get Service Scaling", - "description": "Returns the current scaling configuration for a service", - "operationId": "GetServiceScaling", + }, + "patch": { + "summary": "Update Organization", + "operationId": "UpdateOrganization2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetServiceScalingReply" + "$ref": "#/definitions/UpdateOrganizationReply" } }, "400": { @@ -9159,25 +9332,40 @@ "parameters": [ { "name": "id", - "description": "The id of the service", "in": "path", "required": true, "type": "string" + }, + { + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Organization" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Services" + "organization" ] - }, - "delete": { - "summary": "Delete Service Scaling", - "description": "Deletes the manual scaling configuration for a service, reverting to \nthe scaling defined in the deployment definition.", - "operationId": "DeleteServiceScaling", + } + }, + "/v1/organizations/{id}/access_token": { + "post": { + "summary": "CreateAccessToken", + "description": "CreateAccessToken creates a short-lived access token in the scope of the\nspecified organization, provided the user making the request is part of\nsaid organization.\n\nIt's possible to specify a validity for the token, which defaults to 1h\nand must be no more than 24h. The format is `s`, where ``\nis a floating point in seconds (so `123.456789012s` means 123 seconds and\n456789012 nanoseconds). See:\nhttps://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration.html.", + "operationId": "CreateAccessToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteServiceScalingReply" + "$ref": "#/definitions/CreateAccessTokenReply" } }, "400": { @@ -9226,25 +9414,40 @@ "parameters": [ { "name": "id", - "description": "The id of the service", + "description": "Organization id for ephemeral credential", "in": "path", "required": true, "type": "string" - } - ], - "tags": [ - "Services" - ] - }, - "put": { - "summary": "Update Service Scaling", - "description": "Stores or updates the scaling configuration for a service to use manual scaling", - "operationId": "UpdateServiceScaling", + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "validity": { + "type": "string", + "title": "Validity of the credential" + } + } + } + } + ], + "tags": [ + "organization" + ] + } + }, + "/v1/organizations/{id}/deactivate": { + "post": { + "summary": "Deactivate an Organization", + "operationId": "DeactivateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateServiceScalingReply" + "$ref": "#/definitions/DeactivateOrganizationReply" } }, "400": { @@ -9293,7 +9496,6 @@ "parameters": [ { "name": "id", - "description": "The id of the service to scale", "in": "path", "required": true, "type": "string" @@ -9305,31 +9507,28 @@ "schema": { "type": "object", "properties": { - "scalings": { - "type": "array", - "items": { - "$ref": "#/definitions/ManualServiceScaling" - }, - "title": "The new scaling configuration" + "skip_confirmation": { + "type": "boolean", + "description": "if set to true, skip_confirmation will directly start the deactivation\nprocess, without sending a confirmation email beforehand." } } } } ], "tags": [ - "Services" + "organization" ] } }, - "/v1/deployment/{id}/scaling": { - "get": { - "summary": "Get Deployment Scaling", - "operationId": "GetDeploymentScaling", + "/v1/organizations/{id}/default_project": { + "put": { + "summary": "Update Organization's default project", + "operationId": "UpdateOrganizationDefaultProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDeploymentScalingReply" + "$ref": "#/definitions/UpdateOrganizationDefaultProjectReply" } }, "400": { @@ -9383,35 +9582,33 @@ "type": "string" }, { - "name": "region", - "description": "(Optional) Filter on region", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "replica_index", - "description": "(Optional) Filter on replica_index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "default_project_id": { + "type": "string" + } + } + } } ], "tags": [ - "Deployments" + "organization" ] } }, - "/v1/deployment_events": { - "get": { - "summary": "List Deployment events", - "operationId": "ListDeploymentEvents", + "/v1/organizations/{id}/name": { + "put": { + "summary": "Update Organization Name", + "operationId": "UpdateOrganizationName", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDeploymentEventsReply" + "$ref": "#/definitions/UpdateOrganizationNameReply" } }, "400": { @@ -9459,59 +9656,39 @@ }, "parameters": [ { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on deployment event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } } ], "tags": [ - "Deployments" + "organization" ] } }, - "/v1/deployments": { - "get": { - "summary": "List Deployments", - "operationId": "ListDeployments", + "/v1/organizations/{id}/plan": { + "post": { + "summary": "Update Organization plan", + "operationId": "UpdateOrganizationPlan", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDeploymentsReply" + "$ref": "#/definitions/UpdateOrganizationPlanReply" } }, "400": { @@ -9559,77 +9736,42 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) Filter on application id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Filter on statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "STASHED", - "SLEEPING" - ] - }, - "collectionFormat": "multi" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "plan": { + "$ref": "#/definitions/Plan" + }, + "coupon_code": { + "type": "string" + } + } + } } ], "tags": [ - "Deployments" + "organization" ] } }, - "/v1/deployments/{id}": { - "get": { - "summary": "Get Deployment", - "operationId": "GetDeployment", + "/v1/organizations/{id}/reactivate": { + "post": { + "summary": "Reactivate an Organization", + "operationId": "ReactivateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDeploymentReply" + "$ref": "#/definitions/ReactivateOrganizationReply" } }, "400": { @@ -9678,27 +9820,33 @@ "parameters": [ { "name": "id", - "description": "The id of the deployment", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "tags": [ - "Deployments" + "organization" ] } }, - "/v1/deployments/{id}/cancel": { + "/v1/organizations/{id}/signup_qualification": { "post": { - "summary": "Cancel Deployment", - "description": "Deployment cancellation is allowed for the following status:\n - pending\n - provisioning\n - scheduled", - "operationId": "CancelDeployment", + "summary": "Upsert Organization's signup qualification", + "operationId": "UpsertSignupQualification", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CancelDeploymentReply" + "$ref": "#/definitions/UpsertSignupQualificationReply" } }, "400": { @@ -9747,27 +9895,38 @@ "parameters": [ { "name": "id", - "description": "The id of the deployment to cancel.", "in": "path", "required": true, "type": "string" - } - ], - "tags": [ - "Deployments" - ] - } - }, - "/v1/archives": { + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "signup_qualification": { + "type": "object" + } + } + } + } + ], + "tags": [ + "organization" + ] + } + }, + "/v1/organizations/{id}/switch": { "post": { - "summary": "Create Archive", - "description": "Create a signed URL to upload an archive.", - "operationId": "CreateArchive", + "summary": "Switch Organization context\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "SwitchOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateArchiveReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -9815,28 +9974,41 @@ }, "parameters": [ { - "name": "archive", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateArchive" + "type": "object" } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, + "type": "string" } ], "tags": [ - "Archives" + "organization" ] } }, - "/v1/volume_events": { + "/v1/organizations/{organization_id}/budget": { "get": { - "summary": "List Persistent Volume events", - "operationId": "ListPersistentVolumeEvents", + "summary": "Get Budget", + "operationId": "GetBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListPersistentVolumeEventsReply" + "$ref": "#/definitions/GetBudgetReply" } }, "400": { @@ -9884,59 +10056,24 @@ }, "parameters": [ { - "name": "persistent_volume_id", - "description": "(Optional) Filter on persistent volume id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on persistent volume event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, + "name": "organization_id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "PersistentVolumes" + "organization" ] - } - }, - "/v1/volumes": { - "get": { - "summary": "List all PersistentVolumes", - "operationId": "ListPersistentVolumes", + }, + "delete": { + "summary": "Delete Budget", + "operationId": "DeleteBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListPersistentVolumesReply" + "$ref": "#/definitions/DeleteBudgetReply" } }, "400": { @@ -9984,60 +10121,24 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) A filter for the service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "region", - "description": "(Optional) A filter for the region", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for the name", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "project_id", - "description": "(Optional) A filter for the project ID", - "in": "query", - "required": false, + "name": "organization_id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "PersistentVolumes" + "organization" ] }, "post": { - "summary": "Create a PersistentVolume", - "operationId": "CreatePersistentVolume", + "summary": "Create Budget", + "operationId": "CreateBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreatePersistentVolumeReply" + "$ref": "#/definitions/CreateBudgetReply" } }, "400": { @@ -10084,29 +10185,40 @@ } }, "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreatePersistentVolumeRequest" + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "int64", + "description": "In cents." + } + } } } ], "tags": [ - "PersistentVolumes" + "organization" ] - } - }, - "/v1/volumes/{id}": { - "get": { - "summary": "Get a PersistentVolume", - "operationId": "GetPersistentVolume", + }, + "put": { + "summary": "Update Budget", + "operationId": "UpdateBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetPersistentVolumeReply" + "$ref": "#/definitions/UpdateBudgetReply" } }, "400": { @@ -10154,24 +10266,40 @@ }, "parameters": [ { - "name": "id", + "name": "organization_id", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "int64", + "description": "In cents." + } + } + } } ], "tags": [ - "PersistentVolumes" + "organization" ] - }, - "delete": { - "summary": "Delete a PersistentVolume", - "operationId": "DeletePersistentVolume", + } + }, + "/v1/sso/canny": { + "post": { + "operationId": "CannyAuth", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeletePersistentVolumeReply" + "$ref": "#/definitions/CannyAuthReply" } }, "400": { @@ -10219,24 +10347,27 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CannyAuthRequest" + } } ], "tags": [ - "PersistentVolumes" + "sso" ] - }, + } + }, + "/v1/sso/discourse": { "post": { - "summary": "Update a PersistentVolume", - "operationId": "UpdatePersistentVolume", + "operationId": "DiscourseAuth", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdatePersistentVolumeReply" + "$ref": "#/definitions/DiscourseAuthReply" } }, "400": { @@ -10283,47 +10414,30 @@ } }, "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "(Optional) change the name of the volume" - }, - "max_size": { - "type": "integer", - "format": "int64", - "title": "(Optional) increase the volume size (in Gigabyte / GB)" - } - } + "$ref": "#/definitions/DiscourseAuthRequest" } } ], "tags": [ - "PersistentVolumes" + "sso" ] } }, - "/v1/docker-helper/verify": { - "get": { - "summary": "Verify Docker Image", - "description": "Verify if a docker image is reachable", - "operationId": "VerifyDockerImage", + "/v1/unscope_organization_token": { + "post": { + "summary": "Unscope Organization Token", + "description": "UnscopeOrganizationToken removes the organization scope from a token. This\nendpoint is useful when a user wants to remove an organization: by\nunscoping the token first, the user can then delete the organization\nwithout invalidating his token.", + "operationId": "UnscopeOrganizationToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/VerifyDockerImageReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -10371,34 +10485,35 @@ }, "parameters": [ { - "name": "image", - "description": "The full image uri to be verified", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UnscopeOrganizationTokenRequest" + } }, { - "name": "secret_id", - "description": "(Optional) the id of the secret to use to authenticate to the registry", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "DockerHelper" + "organization" ] } }, - "/v1/secrets": { - "get": { - "summary": "List Secrets", - "operationId": "ListSecrets", + "/v2/account/profile": { + "put": { + "summary": "Update User V2", + "operationId": "UpdateUserV2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListSecretsReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -10446,59 +10561,32 @@ }, "parameters": [ { - "name": "name", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "Filter by secret types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "SIMPLE", - "REGISTRY", - "MANAGED" - ] - }, - "collectionFormat": "multi" + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + } }, { - "name": "project_id", - "description": "(Optional) A filter for the project ID", + "name": "update_mask", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Secrets" + "Profile" ] }, - "post": { - "summary": "Create Secret", - "operationId": "CreateSecret", + "patch": { + "summary": "Update User V2", + "operationId": "UpdateUserV22", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateSecretReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -10546,28 +10634,34 @@ }, "parameters": [ { - "name": "secret", + "name": "user", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateSecret" + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Secrets" + "Profile" ] } }, - "/v1/secrets/{id}": { + "/v1/organization_members": { "get": { - "summary": "Get Secret", - "operationId": "GetSecret", + "summary": "List organization members", + "operationId": "ListOrganizationMembers", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetSecretReply" + "$ref": "#/definitions/ListOrganizationMembersReply" } }, "400": { @@ -10615,24 +10709,68 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, "type": "string" + }, + { + "name": "organization_id", + "description": "(Optional) Filter for an organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "description": "(Optional) Filter for an user", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "organization_statuses", + "description": "(Optional) Filter for organization statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Secrets" + "OrganizationMembers" ] - }, + } + }, + "/v1/organization_members/{id}": { "delete": { - "summary": "Delete Secret", - "operationId": "DeleteSecret", + "summary": "Remove an organization member", + "operationId": "RemoveOrganizationMember", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteSecretReply" + "$ref": "#/definitions/RemoveOrganizationMemberReply" } }, "400": { @@ -10687,17 +10825,19 @@ } ], "tags": [ - "Secrets" + "OrganizationMembers" ] - }, - "put": { - "summary": "Update Secret", - "operationId": "UpdateSecret", + } + }, + "/v1/users/{id}": { + "delete": { + "summary": "Delete user", + "operationId": "DeleteUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSecretReply" + "$ref": "#/definitions/DeleteUserReply" } }, "400": { @@ -10746,37 +10886,26 @@ "parameters": [ { "name": "id", + "description": "The id of the user", "in": "path", "required": true, "type": "string" - }, - { - "name": "secret", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Secret" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Secrets" + "Users" ] - }, - "patch": { - "summary": "Update Secret", - "operationId": "UpdateSecret2", + } + }, + "/v2/users/{id}": { + "delete": { + "summary": "V2 Delete user", + "operationId": "DeleteUserV2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSecretReply" + "$ref": "#/definitions/DeleteUserReply" } }, "400": { @@ -10825,39 +10954,26 @@ "parameters": [ { "name": "id", + "description": "The id of the user", "in": "path", "required": true, "type": "string" - }, - { - "name": "secret", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Secret" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Secrets" + "Users" ] } }, - "/v1/secrets/{id}/reveal": { - "post": { - "summary": "Reveal Secret", - "operationId": "RevealSecret", + "/v1/credentials": { + "get": { + "summary": "List credentials", + "operationId": "ListCredentials", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RevealSecretReply" + "$ref": "#/definitions/ListCredentialsReply" } }, "400": { @@ -10905,34 +11021,66 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "name": "type", + "description": "(Optional) A filter for type", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "INVALID", + "USER", + "ORGANIZATION" + ], + "default": "INVALID" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "organization_id", + "description": "(Optional) Filter for an organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "description": "(Optional) Filter for an user", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Secrets" + "Credentials" ] - } - }, - "/v1/instance_events": { - "get": { - "summary": "List Instance events", - "operationId": "ListInstanceEvents", + }, + "post": { + "summary": "Create credential", + "operationId": "CreateCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListInstanceEventsReply" + "$ref": "#/definitions/CreateCredentialReply" } }, "400": { @@ -10980,63 +11128,28 @@ }, "parameters": [ { - "name": "instance_ids", - "description": "(Optional) Filter on list of instance id", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "types", - "description": "(Optional) Filter on instance event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" + "name": "credential", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCredential" + } } ], "tags": [ - "Instances" + "Credentials" ] } }, - "/v1/instances": { + "/v1/credentials/{id}": { "get": { - "summary": "List Instances", - "operationId": "ListInstances", + "summary": "Get credential", + "operationId": "GetCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListInstancesReply" + "$ref": "#/definitions/GetCredentialReply" } }, "400": { @@ -11084,120 +11197,24 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) Filter on application id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "regional_deployment_id", - "description": "(Optional) Filter on regional deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "allocation_id", - "description": "(Optional) Filter on allocation id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "replica_index", - "description": "(Optional) Filter on replica index", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "statuses", - "description": "(Optional) Filter on instance statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "ALLOCATING", - "STARTING", - "HEALTHY", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERROR", - "SLEEPING" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" - }, - { - "name": "starting_time", - "description": "(Optional) The starting time of the period of running instance", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "ending_time", - "description": "(Optional) The ending time of the period of running instance", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" } ], "tags": [ - "Instances" + "Credentials" ] - } - }, - "/v1/instances/{id}": { - "get": { - "summary": "Get Instance", - "operationId": "GetInstance", + }, + "delete": { + "summary": "Delete credential", + "operationId": "DeleteCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetInstanceReply" + "$ref": "#/definitions/DeleteCredentialReply" } }, "400": { @@ -11246,26 +11263,23 @@ "parameters": [ { "name": "id", - "description": "The id of the instance", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Instances" + "Credentials" ] - } - }, - "/v1/regional_deployment_events": { - "get": { - "summary": "List Regional Deployment events", - "operationId": "ListRegionalDeploymentEvents", + }, + "put": { + "summary": "Update credential", + "operationId": "UpdateCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListRegionalDeploymentEventsReply" + "$ref": "#/definitions/UpdateCredentialReply" } }, "400": { @@ -11313,60 +11327,38 @@ }, "parameters": [ { - "name": "regional_deployment_id", - "description": "(Optional) Filter on regional deployment id", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "types", - "description": "(Optional) Filter on regional deployment event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" + "name": "credential", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Credential" + } }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "update_mask", "in": "query", "required": false, "type": "string" } ], "tags": [ - "RegionalDeployments" + "Credentials" ] - } - }, - "/v1/regional_deployments": { - "get": { - "summary": "List Regional Deployments", - "description": "Experimental: use at your own risk", - "operationId": "ListRegionalDeployments", + }, + "patch": { + "summary": "Update credential", + "operationId": "UpdateCredential2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListRegionalDeploymentsReply" + "$ref": "#/definitions/UpdateCredentialReply" } }, "400": { @@ -11414,42 +11406,40 @@ }, "parameters": [ { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" + "name": "credential", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Credential" + } }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "update_mask", "in": "query", "required": false, "type": "string" } ], "tags": [ - "RegionalDeployments" + "Credentials" ] } }, - "/v1/regional_deployments/{id}": { + "/v1/projects": { "get": { - "summary": "Get Regional Deployment", - "description": "Experimental: use at your own risk", - "operationId": "GetRegionalDeployment", + "summary": "List projects", + "operationId": "ListProjects", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetRegionalDeploymentReply" + "$ref": "#/definitions/ListProjectsReply" } }, "400": { @@ -11496,95 +11486,6 @@ } }, "parameters": [ - { - "name": "id", - "description": "The id of the regional deployment", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "RegionalDeployments" - ] - } - }, - "/v1/usages": { - "get": { - "summary": "Get organization usage", - "operationId": "GetOrganizationUsage", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/GetOrganizationUsageReply" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "starting_time", - "description": "The starting time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "ending_time", - "description": "The ending time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "tags": [ - "Usages" - ] - } - }, - "/v1/usages/details": { - "get": { - "summary": "Get organization usage details", - "operationId": "GetOrganizationUsageDetails", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/GetOrganizationUsageDetailsReply" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "starting_time", - "description": "The starting time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "ending_time", - "description": "The ending time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, { "name": "limit", "description": "(Optional) The number of items to return", @@ -11600,34 +11501,25 @@ "type": "string" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "name", + "description": "(Optional) Filter by project name", "in": "query", "required": false, "type": "string" - }, - { - "name": "Accept", - "description": "If defined with the value 'text/csv', a csv file is returned", - "in": "header", - "required": false, - "type": "string" } ], "tags": [ - "Usages" + "Projects" ] - } - }, - "/v1/snapshots": { - "get": { - "summary": "List all Snapshots", - "operationId": "ListSnapshots", + }, + "post": { + "summary": "Create project", + "operationId": "CreateProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListSnapshotsReply" + "$ref": "#/definitions/CreateProjectReply" } }, "400": { @@ -11675,65 +11567,28 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "organization_id", - "description": "(Optional) Filter by organization_id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "statuses", - "description": "(Optional) Filter by status\n\n - SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "SNAPSHOT_STATUS_INVALID", - "SNAPSHOT_STATUS_CREATING", - "SNAPSHOT_STATUS_AVAILABLE", - "SNAPSHOT_STATUS_MIGRATING", - "SNAPSHOT_STATUS_DELETING", - "SNAPSHOT_STATUS_DELETED" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "region", - "description": "(Optional) A filter for the region", - "in": "query", - "required": false, - "type": "string" + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateProject" + } } ], "tags": [ - "Snapshots" + "Projects" ] - }, - "post": { - "summary": "Create a Snapshot", - "operationId": "CreateSnapshot", + } + }, + "/v1/projects/{id}": { + "get": { + "summary": "Get project", + "operationId": "GetProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateSnapshotReply" + "$ref": "#/definitions/GetProjectReply" } }, "400": { @@ -11781,28 +11636,24 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateSnapshotRequest" - } + "type": "string" } ], "tags": [ - "Snapshots" + "Projects" ] - } - }, - "/v1/snapshots/{id}": { - "get": { - "summary": "Get a Snapshot", - "operationId": "GetSnapshot", + }, + "delete": { + "summary": "Delete project", + "operationId": "DeleteProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetSnapshotReply" + "$ref": "#/definitions/DeleteProjectReply" } }, "400": { @@ -11857,17 +11708,17 @@ } ], "tags": [ - "Snapshots" + "Projects" ] }, - "delete": { - "summary": "Delete a Snapshot", - "operationId": "DeleteSnapshot", + "put": { + "summary": "Update project", + "operationId": "UpdateProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteSnapshotReply" + "$ref": "#/definitions/UpdateProjectReply" } }, "400": { @@ -11919,20 +11770,34 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Snapshots" + "Projects" ] }, - "post": { - "summary": "Update a Snapshot", - "operationId": "UpdateSnapshot", + "patch": { + "summary": "Update project", + "operationId": "UpdateProject2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSnapshotReply" + "$ref": "#/definitions/UpdateProjectReply" } }, "400": { @@ -11981,40 +11846,108 @@ "parameters": [ { "name": "id", - "description": "The id of the snapshot", "in": "path", "required": true, "type": "string" }, { - "name": "body", + "name": "project", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Change the name of the snapshot" - } - } + "$ref": "#/definitions/Project" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Snapshots" + "Projects" ] } }, - "/v1/quotas/capacity": { + "/v1/subscriptions/{id}": { + "get": { + "summary": "Get Subscription", + "operationId": "GetSubscription", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetSubscriptionReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "The id of the instance", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Subscriptions" + ] + } + }, + "/v1/coupons": { "post": { - "summary": "DEPRECATED: Review Organization Capacity", - "operationId": "ReviewOrganizationCapacity", + "summary": "Redeem Coupon", + "description": "This API allows to redeem a coupon. Pass the code you received in the body.", + "operationId": "RedeemCoupon", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ReviewOrganizationCapacityReply" + "$ref": "#/definitions/RedeemCouponReply" } }, "400": { @@ -12066,24 +11999,25 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReviewOrganizationCapacityRequest" + "$ref": "#/definitions/RedeemCouponRequest" } } ], "tags": [ - "Quotas" + "Coupons" ] } }, - "/v1/streams/logs/query": { + "/v1/coupons/{code}": { "get": { - "summary": "Query logs", - "operationId": "QueryLogs", + "summary": "Check Coupon", + "description": "This API allows to check if a given coupon is valid. It is heavily rate-limited.", + "operationId": "CheckCoupon", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/QueryLogsReply" + "$ref": "#/definitions/CheckCouponReply" } }, "400": { @@ -12131,156 +12065,93 @@ }, "parameters": [ { - "name": "type", - "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "app_id", - "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, + "name": "code", + "in": "path", + "required": true, "type": "string" + } + ], + "tags": [ + "Coupons" + ] + } + }, + "/v1/organization_confirmations/{id}": { + "post": { + "summary": "Confirm organization action", + "operationId": "ConfirmOrganizationAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ConfirmOrganizationActionReply" + } }, - { - "name": "service_id", - "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } }, - { - "name": "deployment_id", - "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "regional_deployment_id", - "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "instance_id", - "description": "Deprecated, prefer using instance_ids instead.", - "in": "query", - "required": false, - "type": "string" + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "instance_ids", - "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "stream", - "description": "Deprecated, prefer using streams instead.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "streams", - "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "start", - "description": "(Optional) Must always be before `end`. Defaults to 15 minutes ago.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "end", - "description": "(Optional) Must always be after `start`. Defaults to now.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "order", - "description": "(Optional) `asc` or `desc`. Defaults to `desc`.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) Defaults to 100. Maximum of 1000.", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "regex", - "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", - "in": "query", - "required": false, - "type": "string" + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ { - "name": "text", - "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" - }, - { - "name": "regions", - "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" } ], "tags": [ - "Logs" + "OrganizationConfirmations" ] } }, - "/v1/streams/logs/tail": { - "get": { - "summary": "Tails logs", - "operationId": "TailLogs", + "/v1/account/login": { + "post": { + "summary": "Login user\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "Login", "responses": { "200": { - "description": "A successful response.(streaming responses)", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "result": { - "$ref": "#/definitions/LogEntry" - }, - "error": { - "$ref": "#/definitions/google.rpc.Status" - } - }, - "title": "Stream result of LogEntry" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -12328,132 +12199,35 @@ }, "parameters": [ { - "name": "type", - "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "app_id", - "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "deployment_id", - "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "regional_deployment_id", - "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "instance_id", - "description": "Deprecated, prefer using instance_ids instead.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "instance_ids", - "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "stream", - "description": "Deprecated, prefer using streams instead.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "streams", - "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "start", - "description": "(Optional) Defaults to 24 hours ago.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "limit", - "description": "(Optional) Defaults to 1000. Maximum of 1000.", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "regex", - "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LoginRequest" + } }, { - "name": "text", - "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" - }, - { - "name": "regions", - "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" } ], "tags": [ - "Logs" + "Sessions" ] } }, - "/v1/streams/metrics": { - "get": { - "summary": "Get Metrics", - "operationId": "GetMetrics", + "/v1/account/logout": { + "delete": { + "summary": "Logout user\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "Logout", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetMetricsReply" + "$ref": "#/definitions/LogoutReply" } }, "400": { @@ -12499,90 +12273,21 @@ } } }, - "parameters": [ - { - "name": "service_id", - "description": "ID of the service to query instances metrics for. Ignored if instance_id is set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "instance_id", - "description": "ID of the instance to query metrics for.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "Metric to query.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "UNKNOWN", - "CPU_TOTAL_PERCENT", - "MEM_RSS", - "HTTP_THROUGHPUT", - "HTTP_RESPONSE_TIME_50P", - "HTTP_RESPONSE_TIME_90P", - "HTTP_RESPONSE_TIME_99P", - "HTTP_RESPONSE_TIME_MAX", - "PUBLIC_DATA_TRANSFER_IN", - "PUBLIC_DATA_TRANSFER_OUT" - ], - "default": "UNKNOWN" - }, - { - "name": "start", - "description": "(Optional) Defaults to an hour prior to end.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "end", - "description": "(Optional) Defaults to now.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "step", - "description": "(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "Metrics" - ] - } - }, - "/v1/streams/instances/exec": { - "get": { - "summary": "Exec Command", - "description": "This endpoint opens a websocket. Once open, all frames going through the websocket should be formatted in JSON. Input frames should match the format specified below. Output frames will match the response schema.", - "operationId": "ExecCommand", - "responses": { - "200": { - "description": "A successful response.(streaming responses)", - "schema": { - "type": "object", - "properties": { - "result": { - "$ref": "#/definitions/ExecCommandReply" - }, - "error": { - "$ref": "#/definitions/google.rpc.Status" - } - }, - "title": "Stream result of ExecCommandReply" - } + "tags": [ + "Sessions" + ] + } + }, + "/v1/account/refresh": { + "put": { + "summary": "Refresh token\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "RefreshToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/LoginReply" + } }, "400": { "description": "Validation error", @@ -12627,89 +12332,21 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "ID of the resource to exec on.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "body.command", - "description": "Command to exec. Mandatory in the first frame sent", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "body.tty_size.height", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "body.tty_size.width", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "body.stdin.data", - "description": "Data is base64 encoded", - "in": "query", - "required": false, - "type": "string", - "format": "byte" - }, - { - "name": "body.stdin.close", - "description": "Indicate last data frame", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "body.disableTty", - "description": "Disable TTY. It's enough to specify it in the first frame", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "id_type", - "description": "When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "INVALID", - "INSTANCE_ID", - "SERVICE_ID" - ], - "default": "INVALID" - } - ], "tags": [ - "Instances" + "Sessions" ] } }, - "/v1/activities": { - "get": { - "summary": "List Activities", - "operationId": "ListActivities", + "/v1/account/session": { + "post": { + "summary": "New session", + "description": "Creates a new session without an organization for current user.\nNOTE: If you want a session linked to another organization, please use \"Switch organization\".\nDEPRECATED: this has been replaced by WorkOS and will be dropped soon.", + "operationId": "NewSession", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ActivityList" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -12755,45 +12392,20 @@ } } }, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on object type", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - } - ], "tags": [ - "activity" + "Sessions" ] } }, - "/v1/notifications": { + "/v1/organization_invitations": { "get": { - "summary": "List Notifications", - "operationId": "ListNotifications", + "summary": "List Organization Invitations", + "operationId": "ListOrganizationInvitations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/NotificationList" + "$ref": "#/definitions/ListOrganizationInvitationsReply" } }, "400": { @@ -12842,55 +12454,56 @@ "parameters": [ { "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" }, { - "name": "mark_read", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mark_seen", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "unread", + "name": "statuses", + "description": "(Optional) Filter on organization invitation statuses", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID", + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" + ] + }, + "collectionFormat": "multi" }, { - "name": "unseen", + "name": "user_id", + "description": "(Optional) Filter on invitee ID. Will match both invitations sent to\nthat user_id and invitations sent to the email of that user_id.\nThe only valid value is the requester's user_id", "in": "query", "required": false, "type": "string" } ], "tags": [ - "activity" + "OrganizationInvitations" ] - } - }, - "/v1/test/anon": { - "get": { - "summary": "Test anonymous call", - "operationId": "TestAnon", + }, + "post": { + "summary": "Create Organization Invitation", + "operationId": "CreateOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ktest.TestAnonReply" + "$ref": "#/definitions/CreateOrganizationInvitationReply" } }, "400": { @@ -12936,20 +12549,30 @@ } } }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrganizationInvitationRequest" + } + } + ], "tags": [ - "Test" + "OrganizationInvitations" ] } }, - "/v1/test/auth": { - "post": { - "summary": "Test authenticated call", - "operationId": "TestAuth", + "/v1/organization_invitations/{id}": { + "get": { + "summary": "Get Organization Invitation", + "operationId": "GetOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ktest.TestAuthReply" + "$ref": "#/definitions/GetOrganizationInvitationReply" } }, "400": { @@ -12997,28 +12620,25 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the invitation to get", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/ktest.TestAuthRequest" - } + "type": "string" } ], "tags": [ - "Test" + "OrganizationInvitations" ] - } - }, - "/v1/git/branches": { - "get": { - "summary": "List Branches", - "operationId": "ListBranches", + }, + "delete": { + "summary": "Delete Organization Invitation", + "operationId": "DeleteOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/kgitproxy.ListBranchesReply" + "$ref": "#/definitions/DeleteOrganizationInvitationReply" } }, "400": { @@ -13066,48 +12686,103 @@ }, "parameters": [ { - "name": "repository_id", - "description": "(Optional) Filter on one repository.", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the organization invitation to delete", + "in": "path", + "required": true, "type": "string" + } + ], + "tags": [ + "OrganizationInvitations" + ] + } + }, + "/v1/organization_invitations/{id}/resend": { + "post": { + "summary": "Resend Organization Invitation", + "operationId": "ResendOrganizationInvitation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ResendOrganizationInvitationReply" + } }, - { - "name": "name", - "description": "(Optional) Filter on branch name using a fuzzy search.\nRepository filter is required to enable this filter.", - "in": "query", - "required": false, - "type": "string" + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return.", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the organization invitation to resend", + "in": "path", + "required": true, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "tags": [ - "Repositories" + "OrganizationInvitations" ] } }, - "/v1/git/repositories": { + "/v1/payment_methods": { "get": { - "summary": "List Repositories", - "operationId": "ListRepositories", + "summary": "List payment methods", + "operationId": "ListPaymentMethods", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/kgitproxy.ListRepositoriesReply" + "$ref": "#/definitions/ListPaymentMethodsReply" } }, "400": { @@ -13155,48 +12830,52 @@ }, "parameters": [ { - "name": "name", - "description": "(Optional) Filter on repository name using a fuzzy search.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name_search_op", - "description": "(Optional) Define search operation for repository name. Accept either \"fuzzy\" or \"equality\", use \"fuzzy\" by default.", + "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "limit", - "description": "(Optional) The number of items to return.", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return.", + "name": "statuses", + "description": "(Optional) Filter on payment method statuses", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID", + "CREATED", + "AUTHORIZED", + "DECLINED", + "CANCELED", + "EXPIRED", + "UNCHECKED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Repositories" + "PaymentMethods" ] - } - }, - "/v1/git/sync/organization/{organization_id}": { + }, "post": { - "summary": "Resync Organization", - "operationId": "ResyncOrganization", + "summary": "Create payment authorization", + "operationId": "CreatePaymentAuthorization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/kgitproxy.ResyncOrganizationReply" + "$ref": "#/definitions/CreatePaymentAuthorizationReply" } }, "400": { @@ -13244,26 +12923,28 @@ }, "parameters": [ { - "name": "organization_id", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreatePaymentAuthorizationRequest" + } } ], "tags": [ - "Repositories" + "PaymentMethods" ] } }, - "/v1/search": { + "/v1/payment_methods/{id}": { "get": { - "summary": "Search", - "operationId": "Search", + "summary": "Get payment method", + "operationId": "GetPaymentMethod", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ksearch.SearchReply" + "$ref": "#/definitions/GetPaymentMethodReply" } }, "400": { @@ -13311,1015 +12992,2037 @@ }, "parameters": [ { - "name": "query", - "description": "(Optional) Search query", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "Search" + "PaymentMethods" ] - } - } - }, - "definitions": { - "google.protobuf.Any": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } }, - "additionalProperties": {} - }, - "google.rpc.Status": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/google.protobuf.Any" - } - } - } - }, - "DatacenterListItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "e.g. \"par1\"" - }, - "region_id": { - "type": "string", - "title": "e.g. \"par\"" - }, - "domain": { - "type": "string", - "title": "e.g. \"all-par1.infra.prod.koyeb.com\"" - }, - "coordinates": { - "type": "array", - "items": { - "type": "string" - }, - "title": "e.g. \"8.856614\" ,\"2.352221\"?" + "delete": { + "summary": "Delete payment method", + "operationId": "DeletePaymentMethod", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/DeletePaymentMethodReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "PaymentMethods" + ] + } + }, + "/v1/payment_methods/{id}/confirm": { + "post": { + "summary": "Confirm payment authorization", + "operationId": "ConfirmPaymentAuthorization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ConfirmPaymentAuthorizationReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "tags": [ + "PaymentMethods" + ] + } + }, + "/v1/intercom/profile": { + "get": { + "summary": "Get intercom profile", + "operationId": "GetIntercomProfile", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetIntercomProfileReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "tags": [ + "Intercom" + ] + } + }, + "/v1/organizations/{organization_id}/quotas": { + "get": { + "operationId": "GetQuotas", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetQuotasReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "OrganizationQuotas" + ] + } + }, + "/v1/organizations/{organization_id}/summary": { + "get": { + "summary": "Get organization usage summary", + "operationId": "GetOrganizationSummary", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetOrganizationSummaryReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "organization_id", + "description": "Organization ID", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Summary" + ] + } + }, + "/v1/activities": { + "get": { + "summary": "List Activities", + "operationId": "ListActivities", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityList" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on object type", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + } + ], + "tags": [ + "activity" + ] + } + }, + "/v1/notifications": { + "get": { + "summary": "List Notifications", + "operationId": "ListNotifications", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/NotificationList" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "mark_read", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "mark_seen", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "unread", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "unseen", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "activity" + ] + } + }, + "/v1/catalog/regions": { + "get": { + "summary": "List Region", + "operationId": "ListRegions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListRegionsReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "id", + "description": "(Optional) A filter for regions", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "CatalogRegions" + ] + } + }, + "/v1/catalog/regions/{id}": { + "get": { + "summary": "Get Region", + "operationId": "GetRegion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetRegionReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "The name of the region", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "CatalogRegions" + ] + } + }, + "/v1/catalog/datacenters": { + "get": { + "summary": "List datacenters", + "operationId": "ListDatacenters", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListDatacentersReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "tags": [ + "CatalogDatacenters" + ] + } + }, + "/v1/catalog/usage": { + "get": { + "operationId": "ListUsage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListUsageReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "region", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "CatalogInstanceUsage" + ] + } + }, + "/v1/catalog/instances": { + "get": { + "summary": "List Instances", + "operationId": "ListCatalogInstances", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListCatalogInstancesReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "id", + "description": "(Optional) A filter for instances", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "CatalogInstances" + ] + } + }, + "/v1/catalog/instances/{id}": { + "get": { + "summary": "Get Instance", + "operationId": "GetCatalogInstance", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetCatalogInstanceReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "The name of the instance", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "CatalogInstances" + ] + } + } + }, + "definitions": { + "google.protobuf.Any": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "google.rpc.Status": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/google.protobuf.Any" + } + } + } + }, + "Error": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "ErrorField": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "ErrorWithFields": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorField" + } + } + } + }, + "ksearch.App": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ksearch.GlobalDeployment": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + } + } + }, + "ksearch.Instance": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "allocation_id": { + "type": "string" + } + } + }, + "ksearch.Organization": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ksearch.RegionalDeployment": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "region": { + "type": "string" + } + } + }, + "ksearch.SearchReply": { + "type": "object", + "properties": { + "organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Organization" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.User" + } + }, + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.App" + } + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Service" + } + }, + "global_deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.GlobalDeployment" + } + }, + "regional_deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.RegionalDeployment" + } + }, + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Instance" + } + } + } + }, + "ksearch.Service": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ksearch.User": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, + "github_user": { + "type": "string" + } + } + }, + "kgitproxy.Branch": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "repository_id": { + "type": "string" + }, + "name": { + "type": "string" }, - "use_gpu": { - "type": "boolean", - "title": "e.g. true" + "is_default": { + "type": "boolean" }, - "regions": { - "type": "array", - "items": { - "type": "string" - }, - "title": "e.g. \"par\", \"fra\"" + "is_protected": { + "type": "boolean" + }, + "provider": { + "$ref": "#/definitions/kgitproxy.RepositoryProvider" } } }, - "ListDatacentersReply": { + "kgitproxy.GitHubRepository": { "type": "object", "properties": { - "datacenters": { - "type": "array", - "items": { - "$ref": "#/definitions/DatacenterListItem" - } + "github_id": { + "type": "string" } } }, - "CatalogGPUDetails": { + "kgitproxy.ListBranchesReply": { "type": "object", "properties": { - "count": { + "branches": { + "type": "array", + "items": { + "$ref": "#/definitions/kgitproxy.Branch" + }, + "description": "The collection of branches." + }, + "limit": { "type": "integer", "format": "int64", - "title": "The number of GPUs" - }, - "brand": { - "type": "string", - "title": "The brand of GPU" + "description": "The limit in the request." }, - "memory": { - "type": "string", - "title": "GPU memory" + "offset": { + "type": "integer", + "format": "int64", + "description": "The offset in the request." }, - "name": { - "type": "string", - "title": "Name of GPU" + "count": { + "type": "integer", + "format": "int64", + "description": "The total number of items." } } }, - "CatalogInstance": { + "kgitproxy.ListRepositoriesReply": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The name of the instance" + "repositories": { + "type": "array", + "items": { + "$ref": "#/definitions/kgitproxy.Repository" + }, + "description": "The collection of repositories." }, - "description": { - "type": "string", - "title": "A short description of the instance" + "limit": { + "type": "integer", + "format": "int64", + "description": "The limit in the request." }, - "vcpu": { + "offset": { "type": "integer", "format": "int64", - "description": "The number of cpus. Deprecated. Use vcpu_shares instead." + "description": "The offset in the request." }, - "memory": { - "type": "string", - "title": "The memory in bytes in a format like 5MB" + "count": { + "type": "integer", + "format": "int64", + "description": "The total number of items." + } + } + }, + "kgitproxy.Repository": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "disk": { - "type": "string", - "title": "The size of the disk in bytes in a format like 5MB" + "organization_id": { + "type": "string" }, - "price_per_second": { - "type": "string", - "title": "The price to pay per second" + "name": { + "type": "string" }, - "price_hourly": { - "type": "string", - "title": "The price to pay per hour" + "url": { + "type": "string" }, - "price_monthly": { - "type": "string", - "title": "The price to pay per month" + "description": { + "type": "string" }, - "regions": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The regions where this instance type is available" + "is_private": { + "type": "boolean" }, - "status": { - "type": "string", - "title": "The status of the instance" + "is_disabled": { + "type": "boolean" }, - "require_plan": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The plan required to use instance" + "default_branch": { + "type": "string" }, - "vcpu_shares": { - "type": "number", - "format": "float", - "description": "The number of vcpu shares reserved for the instance." + "provider": { + "$ref": "#/definitions/kgitproxy.RepositoryProvider" }, - "display_name": { + "last_push_date": { "type": "string", - "title": "The display name of the instance" + "format": "date-time" }, - "aliases": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Aliases" + "github": { + "$ref": "#/definitions/kgitproxy.GitHubRepository" + } + } + }, + "kgitproxy.RepositoryProvider": { + "type": "string", + "enum": [ + "INVALID_PROVIDER", + "GITHUB" + ], + "default": "INVALID_PROVIDER" + }, + "kgitproxy.ResyncOrganizationReply": { + "type": "object" + }, + "CreateStageAttemptReply": { + "type": "object" + }, + "DeclareStageProgressReply": { + "type": "object" + }, + "DeclareStepProgressReply": { + "type": "object" + }, + "DeploymentProvisioningInfo.Stage.Status": { + "type": "string", + "enum": [ + "UNKNOWN", + "PENDING", + "RUNNING", + "FAILED", + "COMPLETED", + "ABORTED" + ], + "default": "UNKNOWN" + }, + "AppUsage": { + "type": "object", + "properties": { + "app_id": { + "type": "string" }, - "type": { - "type": "string", - "title": "The type of the instance (e.g. \"gpu\")" + "app_name": { + "type": "string" }, - "gpu": { - "$ref": "#/definitions/CatalogGPUDetails", - "title": "GPU details" + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceUsage" + } }, - "service_types": { + "databases": { "type": "array", "items": { - "type": "string" - }, - "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + "$ref": "#/definitions/DatabaseUsage" + } + } + } + }, + "DatabaseUsage": { + "type": "object", + "properties": { + "service_id": { + "type": "string" }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "service_name": { + "type": "string" }, - "light_sleep_enabled": { - "type": "boolean", - "title": "Is light sleep enabled for this instance type" + "compute_time_seconds": { + "type": "integer", + "format": "int64" + }, + "data_storage_megabytes_hours": { + "type": "integer", + "format": "int64" } } }, - "CatalogInstanceListItem": { + "DatabaseUsageDetails": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The name of the instance" + "organization_id": { + "type": "string" }, - "description": { - "type": "string", - "title": "A short description of the instance" + "app_id": { + "type": "string" }, - "vcpu": { - "type": "integer", - "format": "int64", - "description": "The number of cpus. Deprecated. Use vcpu_shares instead." + "app_name": { + "type": "string" + }, + "service_id": { + "type": "string" }, - "memory": { - "type": "string", - "title": "The memory in bytes in a format like 5MB" + "service_name": { + "type": "string" }, - "disk": { - "type": "string", - "title": "The size of the disk in bytes in a format like 5MB" + "compute_time_seconds": { + "type": "integer", + "format": "int64" }, - "price_per_second": { - "type": "string", - "title": "The price to pay per second" + "data_storage_megabytes_hour": { + "type": "integer", + "format": "int64" }, - "price_hourly": { + "started_at": { "type": "string", - "title": "The price to pay per hour" + "format": "date-time" }, - "price_monthly": { + "terminated_at": { "type": "string", - "title": "The price to pay per month" - }, - "regions": { + "format": "date-time" + } + } + }, + "GetOrganizationUsageDetailsReply": { + "type": "object", + "properties": { + "usage_details": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/UsageDetails" }, - "title": "The regions where this instance type is available" - }, - "status": { - "type": "string", - "title": "The status of the instance" + "title": "The collection of usage instances" }, - "require_plan": { + "database_details": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/DatabaseUsageDetails" }, - "title": "The plan required to use instance" + "title": "The collection of database deployments used during the month" }, - "vcpu_shares": { - "type": "number", - "format": "float", - "description": "The number of vcpu shares reserved for the instance." + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "display_name": { - "type": "string", - "title": "The display name of the instance" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "aliases": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Aliases" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" }, - "type": { + "order": { "type": "string", - "title": "The type of the instance (e.g. \"gpu\")" + "title": "The order in the request" + } + } + }, + "GetOrganizationUsageReply": { + "type": "object", + "properties": { + "usage": { + "$ref": "#/definitions/Usage", + "title": "The computed usage of instances per month" + } + } + }, + "InstanceUsage": { + "type": "object", + "properties": { + "duration_seconds": { + "type": "integer", + "format": "int64" + } + } + }, + "PeriodUsage": { + "type": "object", + "properties": { + "starting_time": { + "type": "string", + "format": "date-time" }, - "gpu": { - "$ref": "#/definitions/CatalogGPUDetails", - "title": "GPU details" + "ending_time": { + "type": "string", + "format": "date-time" }, - "service_types": { + "apps": { "type": "array", "items": { - "type": "string" - }, - "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + "$ref": "#/definitions/AppUsage" + } + } + } + }, + "RegionUsage": { + "type": "object", + "properties": { + "instances": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/InstanceUsage" + } + } + } + }, + "ServiceUsage": { + "type": "object", + "properties": { + "service_id": { + "type": "string" }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "service_name": { + "type": "string" }, - "light_sleep_enabled": { - "type": "boolean", - "title": "Is light sleep enabled for this instance type" + "regions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/RegionUsage" + } } } }, - "GetCatalogInstanceReply": { + "Usage": { "type": "object", "properties": { - "instance": { - "$ref": "#/definitions/CatalogInstance", - "title": "The instance retrieved" + "organization_id": { + "type": "string" + }, + "periods": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PeriodUsage" + } } } }, - "ListCatalogInstancesReply": { + "UsageDetails": { "type": "object", "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/CatalogInstanceListItem" - } + "organization_id": { + "type": "string" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "instance_id": { + "type": "string" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "app_id": { + "type": "string" }, - "count": { + "app_name": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "service_name": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "region": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "duration_seconds": { "type": "integer", - "format": "int64", - "title": "The total number of items" + "format": "int64" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" } } }, - "AvailabilityLevel": { + "google.protobuf.NullValue": { "type": "string", "enum": [ - "UNKNOWN", - "LOW", - "MEDIUM", - "HIGH" + "NULL_VALUE" ], - "default": "UNKNOWN" + "default": "NULL_VALUE", + "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." }, - "CatalogUsage": { + "BasicAuthPolicy": { "type": "object", "properties": { - "instances": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/InstanceAvailability" - } + "username": { + "type": "string" + }, + "password": { + "type": "string" } } }, - "InstanceAvailability": { + "SecurityPolicies": { "type": "object", "properties": { - "regions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/RegionAvailability" + "basic_auths": { + "type": "array", + "items": { + "$ref": "#/definitions/BasicAuthPolicy" } }, - "availability": { - "$ref": "#/definitions/AvailabilityLevel" + "api_keys": { + "type": "array", + "items": { + "type": "string" + } } } }, - "ListUsageReply": { + "ArchiveDeploymentMetadata": { "type": "object", "properties": { - "usage": { - "$ref": "#/definitions/CatalogUsage", - "title": "The Usage retrieved" + "last_provisioned_deployment_id": { + "type": "string" } } }, - "RegionAvailability": { + "ArchiveSource": { "type": "object", "properties": { - "availability": { - "$ref": "#/definitions/AvailabilityLevel" + "id": { + "type": "string", + "title": "The ID of the archive to deploy" + }, + "buildpack": { + "$ref": "#/definitions/BuildpackBuilder" + }, + "docker": { + "$ref": "#/definitions/DockerBuilder" } } }, - "GetRegionReply": { + "AutoRelease": { "type": "object", "properties": { - "region": { - "$ref": "#/definitions/Region", - "title": "The Region retrieved" + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/AutoRelease.Group" + } } } }, - "ListRegionsReply": { + "AutoRelease.Group": { "type": "object", "properties": { - "regions": { - "type": "array", - "items": { - "$ref": "#/definitions/RegionListItem" - } + "name": { + "type": "string" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "repository": { + "type": "string" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "git_ref": { + "type": "string", + "title": "A git ref to track (.e.g: refs/tags/ or refs/heads/" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "latest_sha": { + "type": "string", + "title": "The last hash that was resolved (used to avoid triggering releases when things haven't changed)" } - } + }, + "title": "Configuration extracted from the latest deployment in this deployment_group" }, - "Region": { + "AutocompleteReply": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The id of the region" - }, - "name": { - "type": "string", - "title": "The name of the region" - }, - "coordinates": { + "secrets": { "type": "array", "items": { "type": "string" }, - "title": "The coordinates of the region (lat/long)" - }, - "status": { - "type": "string", - "title": "The status of the region" + "title": "List of available secrets" }, - "instances": { + "user_env": { "type": "array", "items": { "type": "string" }, - "title": "A list of instances available in this region" + "title": "List of available user's environment variables" }, - "datacenters": { + "system_env": { "type": "array", "items": { "type": "string" }, - "title": "A list of datacenters available in this region" - }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "title": "List of available system's environment variables" + } + } + }, + "AutocompleteRequest": { + "type": "object", + "properties": { + "definition": { + "$ref": "#/definitions/DeploymentDefinition", + "title": "Deployment definition" + } + } + }, + "BuildpackBuilder": { + "type": "object", + "properties": { + "build_command": { + "type": "string", + "title": "A command used to override the build command, run after all build steps" }, - "scope": { + "run_command": { "type": "string", - "description": "The scope of the region, continent, metropolitan area, etc." + "title": "A command used to override the default run command" + }, + "privileged": { + "type": "boolean", + "title": "A flag to run the container in privileged mode" } } }, - "RegionListItem": { + "ConfigFile": { "type": "object", "properties": { - "id": { + "path": { "type": "string", - "title": "The id of the region" + "title": "the path where the file is copied" }, - "name": { + "permissions": { "type": "string", - "title": "The name of the region" - }, - "coordinates": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The coordinates of the region (lat/long)" + "title": "the permissions of the file in format 0644" }, - "status": { + "content": { "type": "string", - "title": "The status of the region" + "title": "the content of the file" + } + } + }, + "CreateService": { + "type": "object", + "properties": { + "app_id": { + "type": "string" }, - "instances": { - "type": "array", - "items": { - "type": "string" - }, - "title": "A list of instances available in this region" + "definition": { + "$ref": "#/definitions/DeploymentDefinition", + "title": "definition and instance_snapshot_id are mutually exclusive" }, - "datacenters": { - "type": "array", - "items": { - "type": "string" - }, - "title": "A list of datacenters available in this region" + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the service" }, - "scope": { + "instance_snapshot_id": { "type": "string", - "description": "The scope of the region, continent, metropolitan area, etc." + "title": "Instance Snapshot used to boot the Instances of this deployment" + }, + "name": { + "type": "string", + "title": "Service name, set at creation time only. If empty, fallback to definition.name" } } }, - "ListOrganizationMembersReply": { + "CreateServiceReply": { "type": "object", "properties": { - "members": { - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationMember" - }, - "title": "The collection of organization members" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "service": { + "$ref": "#/definitions/Service", + "title": "The entity created" } } }, - "Organization.Status": { - "type": "string", - "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", - "DELETING", - "DELETED" - ], - "default": "WARNING" + "DatabaseDeploymentMetadata": { + "type": "object", + "properties": { + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresDatabaseDeploymentMetadata" + } + } }, - "OrganizationMember": { + "DatabaseSource": { + "type": "object", + "properties": { + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresDatabase" + } + } + }, + "DeleteServiceReply": { + "type": "object" + }, + "DeleteServiceScalingReply": { + "type": "object", + "title": "Empty reply - success is indicated by no error" + }, + "Deployment": { "type": "object", "properties": { "id": { "type": "string" }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "allocated_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, "organization_id": { "type": "string" }, - "user_id": { + "app_id": { "type": "string" }, - "external_id": { + "service_id": { "type": "string" }, - "joined_at": { - "type": "string", - "format": "date-time" + "parent_id": { + "type": "string" }, - "role": { - "$ref": "#/definitions/UserRole.Role" + "child_id": { + "type": "string" }, "status": { - "$ref": "#/definitions/OrganizationMember.Status" + "$ref": "#/definitions/Deployment.Status" }, - "user": { - "$ref": "#/definitions/PublicUser" + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" }, - "organization": { - "$ref": "#/definitions/PublicOrganization" + "definition": { + "$ref": "#/definitions/DeploymentDefinition" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" + }, + "database_info": { + "$ref": "#/definitions/DeploymentDatabaseInfo" + }, + "skip_build": { + "type": "boolean" + }, + "role": { + "$ref": "#/definitions/Deployment.Role" + }, + "version": { + "type": "string", + "format": "uint64" + }, + "deployment_group": { + "type": "string" + }, + "instance_snapshot_id": { + "type": "string", + "title": "Instance Snapshot used to boot the Instances of this deployment" } } }, - "OrganizationMember.Status": { + "Deployment.Role": { "type": "string", "enum": [ "INVALID", "ACTIVE", - "DELETED" + "UPCOMING", + "CURRENT" ], "default": "INVALID" }, - "Plan": { + "Deployment.Status": { "type": "string", "enum": [ - "hobby", - "starter", - "startup", - "business", - "enterprise", - "internal", - "hobby23", - "no_plan", - "pro", - "scale", - "partner_csp", - "partner_csp_unit" + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "STASHED", + "SLEEPING" ], - "default": "hobby" + "default": "PENDING" }, - "PublicOrganization": { + "DeploymentDatabaseInfo": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "plan": { - "$ref": "#/definitions/Plan" - }, - "status": { - "$ref": "#/definitions/Organization.Status" - }, - "external_id": { - "type": "string" + "neon_postgres": { + "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfo" } } }, - "PublicUser": { + "DeploymentDefinition": { "type": "object", "properties": { - "id": { - "type": "string" + "name": { + "type": "string", + "description": "Service name. Deprecated, set it directly in the Service when creating it." }, - "email": { - "type": "string" + "type": { + "$ref": "#/definitions/DeploymentDefinition.Type" }, - "name": { - "type": "string" + "strategy": { + "$ref": "#/definitions/DeploymentStrategy" }, - "avatar_url": { - "type": "string" + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentRoute" + } }, - "github_id": { - "type": "string" + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentPort" + } }, - "github_user": { - "type": "string" - } - } - }, - "RemoveOrganizationMemberReply": { - "type": "object", - "properties": { - "member": { - "$ref": "#/definitions/OrganizationMember" - } - } - }, - "UserRole.Role": { - "type": "string", - "enum": [ - "INVALID", - "OWNER" - ], - "default": "INVALID" - }, - "Error": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32" + "proxy_ports": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProxyPort" + } }, - "code": { - "type": "string" + "env": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentEnv" + } }, - "message": { - "type": "string" - } - } - }, - "ErrorField": { - "type": "object", - "properties": { - "field": { - "type": "string" + "regions": { + "type": "array", + "items": { + "type": "string" + } }, - "description": { - "type": "string" - } - } - }, - "ErrorWithFields": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32" + "scalings": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentScaling" + } }, - "code": { - "type": "string" + "instance_types": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentInstanceType" + } }, - "message": { - "type": "string" + "health_checks": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentHealthCheck" + } }, - "fields": { + "volumes": { "type": "array", "items": { - "$ref": "#/definitions/ErrorField" + "$ref": "#/definitions/DeploymentVolume" } + }, + "config_files": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigFile" + } + }, + "skip_cache": { + "type": "boolean" + }, + "mesh": { + "$ref": "#/definitions/DeploymentMesh" + }, + "docker": { + "$ref": "#/definitions/DockerSource" + }, + "git": { + "$ref": "#/definitions/GitSource" + }, + "database": { + "$ref": "#/definitions/DatabaseSource" + }, + "archive": { + "$ref": "#/definitions/ArchiveSource" } } }, - "ConfirmPaymentAuthorizationReply": { - "type": "object", - "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" - } - } - }, - "CreatePaymentAuthorizationReply": { - "type": "object", - "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" - } - } - }, - "CreatePaymentAuthorizationRequest": { - "type": "object" - }, - "DeletePaymentMethodReply": { - "type": "object" + "DeploymentDefinition.Type": { + "type": "string", + "enum": [ + "INVALID", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" + ], + "default": "INVALID" }, - "GetPaymentMethodReply": { + "DeploymentEnv": { "type": "object", "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "secret": { + "type": "string" } } }, - "ListPaymentMethodsReply": { + "DeploymentHealthCheck": { "type": "object", "properties": { - "payment_methods": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentMethod" - }, - "title": "The collection of payment methods" + "grace_period": { + "type": "integer", + "format": "int64", + "title": "An optional initial period in seconds to wait for the instance to become healthy, default is 5s" }, - "limit": { + "interval": { "type": "integer", "format": "int64", - "title": "The limit in the request" + "title": "An optional period in seconds between two health checks, default is 60s" }, - "offset": { + "restart_limit": { "type": "integer", "format": "int64", - "title": "The offset in the request" + "title": "An optional number of consecutive failures before attempting to restart the service, default is 3" }, - "count": { + "timeout": { "type": "integer", "format": "int64", - "title": "The total number of items" + "title": "An optional maximum time to wait in seconds before considering the check as a failure, default is 5s" + }, + "tcp": { + "$ref": "#/definitions/TCPHealthCheck" + }, + "http": { + "$ref": "#/definitions/HTTPHealthCheck" } } }, - "PaymentMethod": { + "DeploymentInstanceType": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "version": { - "type": "string", - "format": "uint64" - }, - "organization_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/PaymentMethod.Status" - }, - "messages": { + "scopes": { "type": "array", "items": { "type": "string" } }, - "stripe_payment_method_id": { - "type": "string" - }, - "authorization_verified_at": { - "type": "string", - "format": "date-time" - }, - "authorization_canceled_at": { - "type": "string", - "format": "date-time" - }, - "authorization_stripe_payment_intent_id": { - "type": "string" - }, - "authorization_stripe_payment_intent_client_secret": { - "type": "string" - }, - "card_brand": { - "type": "string" - }, - "card_country": { - "type": "string" - }, - "card_funding": { - "type": "string" - }, - "card_fingerprint": { - "type": "string" - }, - "card_last_digits": { + "type": { "type": "string" - }, - "card_expiration_month": { - "type": "integer", - "format": "int64" - }, - "card_expiration_year": { - "type": "integer", - "format": "int64" } } }, - "PaymentMethod.Status": { + "DeploymentMesh": { "type": "string", "enum": [ - "INVALID", - "CREATED", - "AUTHORIZED", - "DECLINED", - "CANCELED", - "EXPIRED", - "UNCHECKED" + "DEPLOYMENT_MESH_AUTO", + "DEPLOYMENT_MESH_ENABLED", + "DEPLOYMENT_MESH_DISABLED" ], - "default": "INVALID" + "default": "DEPLOYMENT_MESH_AUTO" }, - "DeleteUserReply": { + "DeploymentMetadata": { "type": "object", "properties": { - "user": { - "$ref": "#/definitions/User" + "trigger": { + "$ref": "#/definitions/TriggerDeploymentMetadata" + }, + "database": { + "$ref": "#/definitions/DatabaseDeploymentMetadata" + }, + "git": { + "$ref": "#/definitions/GitDeploymentMetadata" + }, + "archive": { + "$ref": "#/definitions/ArchiveDeploymentMetadata" + }, + "proxy_ports": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProxyPortMetadata" + } + }, + "sandbox": { + "$ref": "#/definitions/SandboxMetadata" } } }, - "User": { + "DeploymentNeonPostgresDatabaseInfo": { "type": "object", - "example": { - "id": "78352123-a06f-4ec2-81ed-27a056725385", - "email": "john@snow.com", - "name": "John Snow", - "avatar_url": "https://www.gravatar.com/avatar/00000000000000000000000000000000", - "is_admin": false, - "is_test": true, - "two_factor_authentication": false, - "last_login": "0001-01-01T00:00:00Z", - "last_login_id": "10.1.1.1", - "updated_at": "0001-01-01T00:00:00Z", - "created_at": "0001-01-01T00:00:00Z", - "newsletter_subscribed": true, - "email_validated": true - }, "properties": { - "id": { - "type": "string" + "active_time_seconds": { + "type": "string", + "format": "int64" }, - "email": { - "type": "string" + "compute_time_seconds": { + "type": "string", + "format": "int64" }, - "avatar_url": { - "type": "string" + "written_data_bytes": { + "type": "string", + "format": "int64" }, - "two_factor_authentication": { - "type": "boolean" + "data_transfer_bytes": { + "type": "string", + "format": "int64" }, - "last_login": { + "data_storage_bytes_hour": { "type": "string", - "format": "date-time" + "format": "int64" }, - "last_login_ip": { + "server_host": { "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "server_port": { + "type": "integer", + "format": "int64" }, - "created_at": { + "endpoint_state": { + "type": "string" + }, + "endpoint_last_active": { "type": "string", "format": "date-time" }, - "newsletter_subscribed": { - "type": "boolean" - }, - "github_id": { + "default_branch_id": { "type": "string" }, - "github_user": { + "default_branch_name": { "type": "string" }, - "flags": { - "type": "array", - "items": { - "$ref": "#/definitions/UserFlags" - } - }, - "name": { + "default_branch_state": { "type": "string" }, - "email_validated": { - "type": "boolean" + "default_branch_logical_size": { + "type": "string", + "format": "int64" }, - "trialed": { - "type": "boolean" + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfoRole" + } } - }, - "title": "Represent a User" - }, - "UserFlags": { - "type": "string", - "enum": [ - "ADMIN", - "TEST", - "RESTRICTED", - "ACTIVE", - "BETA", - "MAX_ORGANIZATIONS_25", - "MAX_ORGANIZATIONS_100", - "MAX_ORGANIZATIONS_1000", - "MAX_ORGANIZATIONS_10000", - "MAX_ORGANIZATIONS_100000", - "MAX_ORGANIZATIONS_1000000", - "PARTNER_CSP", - "IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX" - ], - "default": "ADMIN", - "title": "- ADMIN: A user is an admin user\n - TEST: A user is a test user\n - RESTRICTED: Whether this account as restricted access\n - ACTIVE: Whether this account is active\n - BETA: Account in beta program\n - MAX_ORGANIZATIONS_25: User can create this much organizations, overriding the default amount\n - PARTNER_CSP: User can create sub-organizations\n - IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX: User can bypass organization name reservations rules" + } }, - "GetIntercomProfileReply": { + "DeploymentNeonPostgresDatabaseInfoRole": { "type": "object", "properties": { - "hash": { + "name": { + "type": "string" + }, + "secret_id": { "type": "string" } } }, - "GetSubscriptionReply": { + "DeploymentPort": { "type": "object", "properties": { - "subscription": { - "$ref": "#/definitions/Subscription" + "port": { + "type": "integer", + "format": "int64" + }, + "protocol": { + "type": "string", + "title": "One of http, http2, tcp" } } }, - "Subscription": { + "DeploymentProvisioningInfo": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { + "sha": { "type": "string", - "format": "date-time" + "description": "The git sha for this build (we resolve the reference at the start of the build)." }, - "version": { + "image": { "type": "string", - "format": "uint64" - }, - "organization_id": { - "type": "string" + "description": "The docker image built as a result of this build." }, - "stripe_subscription_id": { + "stages": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage" + }, + "description": "Some info about the build." + } + } + }, + "DeploymentProvisioningInfo.Stage": { + "type": "object", + "properties": { + "name": { "type": "string" }, "status": { - "$ref": "#/definitions/Subscription.Status" + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, "messages": { "type": "array", @@ -14327,460 +15030,527 @@ "type": "string" } }, - "has_pending_update": { - "type": "boolean" - }, - "stripe_pending_invoice_id": { - "type": "string" - }, - "terminate_at": { - "type": "string", - "format": "date-time" - }, - "canceled_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { + "started_at": { "type": "string", "format": "date-time" }, - "current_period_start": { + "finished_at": { "type": "string", "format": "date-time" }, - "current_period_end": { - "type": "string", - "format": "date-time" + "build_attempts": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt" + } + } + } + }, + "DeploymentProvisioningInfo.Stage.BuildAttempt": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" }, - "currency": { - "type": "string" + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, - "amount_payable": { - "type": "string", - "format": "int64" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "amount_paid": { + "started_at": { "type": "string", - "format": "int64" + "format": "date-time" }, - "amount_remaining": { + "finished_at": { "type": "string", - "format": "int64" + "format": "date-time" }, - "payment_failure": { - "$ref": "#/definitions/Subscription.PaymentFailure" + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep" + } }, - "trialing": { + "image_pushed": { "type": "boolean" }, - "trial_ends_at": { - "type": "string", - "format": "date-time" + "internal_failure": { + "type": "boolean" }, - "trial_max_spend": { - "type": "string", - "format": "int64" + "retryable_failure": { + "type": "boolean" }, - "current_spend": { - "type": "string", - "format": "int64" + "wait_completion": { + "type": "boolean", + "description": "This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure." } } }, - "Subscription.PaymentFailure": { + "DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep": { "type": "object", "properties": { - "failed_at": { - "type": "string", - "format": "date-time" - }, - "next_attempt": { - "type": "string", - "format": "date-time" - }, - "attempt_count": { - "type": "string", - "format": "int64" - }, - "error_code": { - "type": "string" - }, - "error_reason": { - "type": "string" - }, - "error_type": { + "name": { "type": "string" }, - "error_message": { - "type": "string" + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, - "payment_method_required": { - "type": "boolean" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "redirect_url": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "stripe_sdk": { - "$ref": "#/definitions/Subscription.PaymentFailure.StripeSDK" + "finished_at": { + "type": "string", + "format": "date-time" } } }, - "Subscription.PaymentFailure.StripeSDK": { + "DeploymentProxyPort": { "type": "object", "properties": { - "client_secret_key": { - "type": "string" + "port": { + "type": "integer", + "format": "int64" }, - "raw_json": { - "type": "string" + "protocol": { + "$ref": "#/definitions/ProxyPortProtocol" } } }, - "Subscription.Status": { - "type": "string", - "enum": [ - "INVALID", - "CREATED", - "ACTIVE", - "WARNING", - "URGENT", - "CANCELING", - "CANCELED", - "TERMINATING", - "TERMINATED" - ], - "default": "INVALID" - }, - "google.protobuf.NullValue": { - "type": "string", - "enum": [ - "NULL_VALUE" - ], - "default": "NULL_VALUE", - "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." - }, - "AcceptOrganizationInvitationReply": { + "DeploymentProxyPortMetadata": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation accepted" + "host": { + "type": "string" + }, + "public_port": { + "type": "integer", + "format": "int64" + }, + "port": { + "type": "integer", + "format": "int64" + }, + "protocol": { + "$ref": "#/definitions/ProxyPortProtocol" } } }, - "Action": { - "type": "string", - "enum": [ - "signin", - "signup", - "register" - ], - "default": "signin" - }, - "Budget": { + "DeploymentRoute": { "type": "object", "properties": { - "amount": { - "type": "string", + "port": { + "type": "integer", "format": "int64" }, - "thresholds": { - "type": "array", - "items": { - "type": "string", - "format": "int64" - } + "path": { + "type": "string" + }, + "security_policies": { + "$ref": "#/definitions/SecurityPolicies" } } }, - "CannyAuthReply": { + "DeploymentScaling": { "type": "object", "properties": { - "token": { - "type": "string" + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "min": { + "type": "integer", + "format": "int64" + }, + "max": { + "type": "integer", + "format": "int64" + }, + "targets": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentScalingTarget" + } } } }, - "CannyAuthRequest": { - "type": "object" - }, - "ClearIdenfyVerificationResultReply": { - "type": "object" - }, - "ClearIdenfyVerificationResultRequest": { + "DeploymentScalingTarget": { "type": "object", "properties": { - "user_id": { - "type": "string" + "average_cpu": { + "$ref": "#/definitions/DeploymentScalingTargetAverageCPU" }, - "organization_id": { - "type": "string" + "average_mem": { + "$ref": "#/definitions/DeploymentScalingTargetAverageMem" + }, + "requests_per_second": { + "$ref": "#/definitions/DeploymentScalingTargetRequestsPerSecond" + }, + "concurrent_requests": { + "$ref": "#/definitions/DeploymentScalingTargetConcurrentRequests" + }, + "requests_response_time": { + "$ref": "#/definitions/DeploymentScalingTargetRequestsResponseTime" + }, + "sleep_idle_delay": { + "$ref": "#/definitions/DeploymentScalingTargetSleepIdleDelay" } } }, - "CreateAccessTokenReply": { + "DeploymentScalingTargetAverageCPU": { "type": "object", "properties": { - "token": { - "type": "string" + "value": { + "type": "integer", + "format": "int64" } } }, - "CreateAccountRequest": { + "DeploymentScalingTargetAverageMem": { "type": "object", - "example": { - "email": "john@snow.com", - "password": "..." - }, "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "name": { - "type": "string" - }, - "captcha": { - "type": "string" + "value": { + "type": "integer", + "format": "int64" } - }, - "description": "Create new account", - "title": "Create new account", - "required": [ - "email", - "password" - ] + } }, - "CreateBudgetReply": { + "DeploymentScalingTargetConcurrentRequests": { "type": "object", "properties": { - "budget": { - "$ref": "#/definitions/Budget" + "value": { + "type": "integer", + "format": "int64" } } }, - "CreateOrganizationReply": { + "DeploymentScalingTargetRequestsPerSecond": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "value": { + "type": "integer", + "format": "int64" } } }, - "CreateOrganizationRequest": { + "DeploymentScalingTargetRequestsResponseTime": { "type": "object", "properties": { - "name": { - "type": "string" + "value": { + "type": "integer", + "format": "int64" + }, + "quantile": { + "type": "integer", + "format": "int64", + "description": "The quantile to use for autoscaling. For example, set to 95 to use the 95th\npercentile (p95) for autoscaling. Valid values are between 0 and 100." } } }, - "DeactivateOrganizationReply": { + "DeploymentScalingTargetSleepIdleDelay": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "value": { + "type": "integer", + "format": "int64", + "description": "DEPRECATED: use deep_sleep_value instead.\nDelay in seconds after which a service which received 0 request is put to deep sleep." + }, + "deep_sleep_value": { + "type": "integer", + "format": "int64", + "description": "Delay in seconds after which a service which received 0 request is put to deep sleep." + }, + "light_sleep_value": { + "type": "integer", + "format": "int64", + "description": "Delay in seconds after which a service which received 0 request is put to light sleep." } } }, - "DeclineOrganizationInvitationReply": { + "DeploymentStrategy": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation declined" + "type": { + "$ref": "#/definitions/DeploymentStrategyType", + "title": "Strategy type" } } }, - "DeleteBudgetReply": { - "type": "object" + "DeploymentStrategyType": { + "type": "string", + "enum": [ + "DEPLOYMENT_STRATEGY_TYPE_INVALID", + "DEPLOYMENT_STRATEGY_TYPE_DEFAULT", + "DEPLOYMENT_STRATEGY_TYPE_CANARY", + "DEPLOYMENT_STRATEGY_TYPE_ROLLING", + "DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN", + "DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE" + ], + "default": "DEPLOYMENT_STRATEGY_TYPE_INVALID", + "description": " - DEPLOYMENT_STRATEGY_TYPE_INVALID: DEPRECATED: Use DEPLOYMENT_STRATEGY_TYPE_DEFAULT instead.\n - DEPLOYMENT_STRATEGY_TYPE_DEFAULT: Default/unspecified strategy (resolves to platform default, currently ROLLING).\n - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy.\n - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy.\n - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy.\n - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy." }, - "DeleteOrganizationReply": { + "DeploymentVolume": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "id": { + "type": "string", + "title": "the id of the volume" + }, + "path": { + "type": "string", + "title": "the path where the volume is mounted to" + }, + "replica_index": { + "type": "integer", + "format": "int64", + "title": "optionally, explicitly choose the replica index to mount the volume to" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "title": "scope of the associated" } } }, - "DiscourseAuthReply": { + "DesiredDeployment": { "type": "object", "properties": { - "sso": { - "type": "string" - }, - "sig": { - "type": "string" + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/DesiredDeployment.Group" + } } } }, - "DiscourseAuthRequest": { + "DesiredDeployment.Group": { "type": "object", "properties": { - "payload": { + "name": { "type": "string" }, - "sig": { - "type": "string" + "deployment_ids": { + "type": "array", + "items": { + "type": "string" + } } } }, - "GetBudgetReply": { + "DockerBuilder": { "type": "object", "properties": { - "budget": { - "$ref": "#/definitions/Budget" + "dockerfile": { + "type": "string", + "title": "A path to the Dockerfile" + }, + "entrypoint": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The docker ENTRYPOINT" + }, + "command": { + "type": "string", + "title": "The docker CMD" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The docker CMD args" + }, + "target": { + "type": "string", + "title": "The target for multi-stage builds" + }, + "privileged": { + "type": "boolean", + "title": "A flag to run the container in privileged mode" } } }, - "GetGithubInstallationReply": { + "DockerSource": { "type": "object", "properties": { - "installation_id": { + "image": { "type": "string" }, - "installation_url": { + "command": { "type": "string" }, - "name": { - "type": "string" + "args": { + "type": "array", + "items": { + "type": "string" + } }, - "avatar_url": { + "image_registry_secret": { "type": "string" }, - "status": { - "$ref": "#/definitions/kgitproxy.GithubInstallation.Status" - }, - "installed_at": { - "type": "string", - "format": "date-time" - }, - "suspended_at": { - "type": "string", - "format": "date-time" - }, - "indexing_status": { - "$ref": "#/definitions/kgitproxy.IndexingStatus" - }, - "indexed_repositories": { - "type": "integer", - "format": "int64" + "entrypoint": { + "type": "array", + "items": { + "type": "string" + } }, - "total_repositories": { - "type": "integer", - "format": "int64" + "privileged": { + "type": "boolean", + "title": "A flag to run the container in privileged mode" } } }, - "GetIdenfyTokenReply": { + "GetServiceReply": { "type": "object", "properties": { - "auth_token": { - "type": "string" + "service": { + "$ref": "#/definitions/Service", + "title": "The Service retrieved" } } }, - "GetOAuthOptionsReply": { + "GetServiceScalingReply": { "type": "object", "properties": { - "oauth_providers": { + "scalings": { "type": "array", "items": { - "$ref": "#/definitions/OAuthProvider" - } - } - }, - "description": "A list of providers which you can use for single sign-on." - }, - "GetOrganizationReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "$ref": "#/definitions/ManualServiceScaling" + }, + "title": "The current manual scaling configuration" } } }, - "GetUserOrganizationInvitationReply": { + "GitDeploymentMetadata": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation" + "last_provisioned_deployment_id": { + "type": "string" + }, + "git_env": { + "$ref": "#/definitions/GitEnvDeploymentMetadata" } } }, - "GetUserSettingsReply": { + "GitEnvDeploymentMetadata": { "type": "object", "properties": { - "settings": { - "$ref": "#/definitions/UserSettings" + "sha": { + "type": "string" + }, + "commit_author": { + "type": "string" + }, + "commit_message": { + "type": "string" } } }, - "GithubInstallationReply": { + "GitSource": { "type": "object", "properties": { - "app_name": { + "repository": { "type": "string", - "title": "The github app name" + "description": "A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test." }, - "app_id": { + "branch": { "type": "string", - "format": "int64", - "title": "The github app id" + "title": "A git branch that will be tracked for new commits and deployments will be created" }, - "url": { + "tag": { "type": "string", - "title": "The url to start the installation flow" + "title": "A git tag that should be built" }, - "state": { + "sha": { "type": "string", - "title": "The state required by the protocol, it is only valid 10 minutes and encodes\ninformation about the type of flow" - } - } - }, - "GithubInstallationRequest": { - "type": "object", - "properties": { - "metadata": { + "title": "A git commit that should be built (useful for pinning to a commit, this will always be set when a deployment is created by a code push)" + }, + "build_command": { "type": "string", - "title": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state" + "title": "A command used to override the build command, run after all build steps \u2014 deprecated, use buildpack.build_command instead" + }, + "run_command": { + "type": "string", + "title": "A command used to override the default run command - deprecated, use buildpack.run_command instead" + }, + "no_deploy_on_push": { + "type": "boolean", + "title": "A flag to disable a new deployment when a push event is detected" + }, + "workdir": { + "type": "string", + "title": "A subdirectory to use as the build directory" + }, + "buildpack": { + "$ref": "#/definitions/BuildpackBuilder" + }, + "docker": { + "$ref": "#/definitions/DockerBuilder" } } }, - "HasUnpaidInvoicesReply": { + "HTTPHeader": { "type": "object", "properties": { - "has_unpaid_invoices": { - "type": "boolean" + "key": { + "type": "string" + }, + "value": { + "type": "string" } } }, - "InviteUserRequest": { + "HTTPHealthCheck": { "type": "object", "properties": { - "email": { - "type": "string" + "port": { + "type": "integer", + "format": "int64", + "title": "The port to use to perform the health check, must be declared in the ports section" }, - "name": { - "type": "string" + "path": { + "type": "string", + "title": "The path to use to perform the HTTP health check" }, - "message": { - "type": "string" + "method": { + "type": "string", + "title": "An optional HTTP method to use to perform the health check, default is GET" + }, + "headers": { + "type": "array", + "items": { + "$ref": "#/definitions/HTTPHeader" + }, + "title": "An optional list of HTTP headers to provide when performing the request, default is empty" } } }, - "ListUserOrganizationInvitationsReply": { + "ListServiceEventsReply": { "type": "object", "properties": { - "invitations": { + "events": { "type": "array", "items": { - "$ref": "#/definitions/OrganizationInvitation" + "$ref": "#/definitions/ServiceEvent" }, - "title": "The collection of organization invitations" + "title": "The collection of events" }, "limit": { "type": "integer", @@ -14792,22 +15562,24 @@ "format": "int64", "title": "The offset in the request" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "ListUserOrganizationsReply": { + "ListServicesReply": { "type": "object", "properties": { - "organizations": { + "services": { "type": "array", "items": { - "$ref": "#/definitions/Organization" - }, - "title": "The collection of organizations" + "$ref": "#/definitions/ServiceListItem" + } }, "limit": { "type": "integer", @@ -14819,1386 +15591,1478 @@ "format": "int64", "title": "The offset in the request" }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, "has_next": { "type": "boolean", "title": "If there is more items after in the collection" } } }, - "LoginMethodReply": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/LoginMethodReply.Method" - } - } - }, - "LoginMethodReply.Method": { - "type": "string", - "enum": [ - "KOYEB", - "WORKOS" - ], - "default": "KOYEB" - }, - "LoginReply": { + "ManualServiceScaling": { "type": "object", "properties": { - "token": { - "$ref": "#/definitions/Token" + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "instances": { + "type": "integer", + "format": "int64" } } }, - "ManageReply": { + "NeonPostgresDatabase": { "type": "object", "properties": { - "url": { + "pg_version": { + "type": "integer", + "format": "int64" + }, + "region": { "type": "string" - } - } - }, - "NextInvoiceReply": { - "type": "object", - "properties": { - "stripe_invoice": { - "type": "object" }, - "lines": { + "instance_type": { + "type": "string" + }, + "roles": { "type": "array", "items": { - "$ref": "#/definitions/NextInvoiceReply.Line" + "$ref": "#/definitions/NeonPostgresDatabase.NeonRole" } }, - "discounts": { + "databases": { "type": "array", "items": { - "$ref": "#/definitions/NextInvoiceReply.Discount" + "$ref": "#/definitions/NeonPostgresDatabase.NeonDatabase" } } } }, - "NextInvoiceReply.Discount": { + "NeonPostgresDatabase.NeonDatabase": { "type": "object", "properties": { - "type": { - "$ref": "#/definitions/NextInvoiceReply.Discount.Type" - }, "name": { "type": "string" }, - "amount": { - "type": "string", - "format": "int64" + "owner": { + "type": "string" } } }, - "NextInvoiceReply.Discount.Type": { - "type": "string", - "enum": [ - "PERCENT_OFF", - "AMOUNT_OFF" - ], - "default": "PERCENT_OFF" - }, - "NextInvoiceReply.Line": { + "NeonPostgresDatabase.NeonRole": { "type": "object", "properties": { - "amount_excluding_tax": { - "type": "integer", - "format": "int32" - }, - "period": { - "$ref": "#/definitions/NextInvoiceReply.Line.Period" - }, - "plan_nickname": { + "name": { "type": "string" }, - "price": { - "$ref": "#/definitions/NextInvoiceReply.Line.Price" - }, - "quantity": { - "type": "integer", - "format": "int32" + "secret": { + "type": "string" } } }, - "NextInvoiceReply.Line.Period": { + "NeonPostgresDatabaseDeploymentMetadata": { "type": "object", "properties": { - "start": { - "type": "string", - "format": "date-time" - }, - "end": { - "type": "string", - "format": "date-time" + "reset_role_passwords": { + "type": "array", + "items": { + "type": "string" + } } } }, - "NextInvoiceReply.Line.Price": { - "type": "object", - "properties": { - "unit_amount_decimal": { - "type": "number", - "format": "double" - } - } + "PauseServiceReply": { + "type": "object" }, - "OAuthCallbackReply": { + "ProxyPortProtocol": { + "type": "string", + "enum": [ + "tcp" + ], + "default": "tcp" + }, + "RedeployReply": { "type": "object", "properties": { - "token": { - "$ref": "#/definitions/Token", - "title": "A jwt token to be used for session" + "deployment": { + "$ref": "#/definitions/Deployment", + "title": "The entity updated" } } }, - "OAuthCallbackRequest": { + "RedeployRequest.Info": { "type": "object", "properties": { - "state": { - "type": "string", - "title": "The state created at the origin of the OAuth flow" + "deployment_group": { + "type": "string" }, - "code": { - "type": "string", - "title": "The code returned by the OAuth provider" + "sha": { + "type": "string" }, - "setup_action": { - "type": "string", - "description": "setup_action is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." + "use_cache": { + "type": "boolean" }, - "installation_id": { - "type": "string", - "description": "installation_id is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." + "skip_build": { + "type": "boolean", + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." } } }, - "OAuthProvider": { + "ResumeServiceReply": { + "type": "object" + }, + "SandboxMetadata": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The name of the provider (.e.g github, google)" - }, - "url": { - "type": "string", - "title": "The URL to call to initiate the OAuth flow" + "public_url": { + "type": "string" }, - "state": { - "type": "string", - "title": "The OAuth state required by the protocol, it is only valid 10 minutes and\nencodes information about the type of flow" + "routing_key": { + "type": "string" } } }, - "Organization": { + "Service": { "type": "object", "properties": { "id": { "type": "string" }, - "external_id": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time" }, - "provisioning": { - "type": "boolean" + "updated_at": { + "type": "string", + "format": "date-time" }, - "address1": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "address2": { - "type": "string" + "succeeded_at": { + "type": "string", + "format": "date-time" }, - "city": { - "type": "string" + "paused_at": { + "type": "string", + "format": "date-time" }, - "postal_code": { - "type": "string" + "resumed_at": { + "type": "string", + "format": "date-time" }, - "state": { - "type": "string" + "terminated_at": { + "type": "string", + "format": "date-time" }, - "country": { + "name": { "type": "string" }, - "company": { - "type": "boolean" - }, - "vat_number": { - "type": "string" + "type": { + "$ref": "#/definitions/Service.Type" }, - "billing_name": { + "organization_id": { "type": "string" }, - "billing_email": { + "app_id": { "type": "string" }, - "name": { - "type": "string" + "status": { + "$ref": "#/definitions/Service.Status" }, - "plan": { - "$ref": "#/definitions/Plan" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "plan_updated_at": { + "version": { "type": "string", - "format": "date-time" - }, - "has_payment_method": { - "type": "boolean" + "format": "uint64" }, - "subscription_id": { + "active_deployment_id": { "type": "string" }, - "current_subscription_id": { + "latest_deployment_id": { "type": "string" }, - "latest_subscription_id": { + "last_provisioned_deployment_id": { "type": "string" }, - "signup_qualification": { - "type": "object" - }, - "status": { - "$ref": "#/definitions/Organization.Status" - }, - "status_message": { - "$ref": "#/definitions/OrganizationDetailedStatus" - }, - "deactivation_reason": { - "$ref": "#/definitions/Organization.DeactivationReason" - }, - "verified": { - "type": "boolean" - }, - "qualifies_for_hobby23": { - "type": "boolean" - }, - "reprocess_after": { - "type": "string", - "format": "date-time" - }, - "trialing": { - "type": "boolean" - }, - "trial_starts_at": { - "type": "string", - "format": "date-time" - }, - "trial_ends_at": { - "type": "string", - "format": "date-time" - }, - "email_domain_allowlist": { - "type": "array", - "items": { - "type": "string" - } + "state": { + "$ref": "#/definitions/ServiceState", + "title": "Legacy stuff" }, - "default_project_id": { - "type": "string" + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" } - }, - "title": "Represent an Organization" + } }, - "Organization.DeactivationReason": { - "type": "string", - "enum": [ - "INVALID", - "REQUESTED_BY_OWNER", - "SUBSCRIPTION_TERMINATION", - "LOCKED_BY_ADMIN", - "VERIFICATION_FAILED", - "TRIAL_DID_NOT_CONVERT" + "Service.Status": { + "type": "string", + "enum": [ + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "DELETING", + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" ], - "default": "INVALID" + "default": "STARTING" }, - "OrganizationDetailedStatus": { + "Service.Type": { "type": "string", "enum": [ - "NEW", - "EMAIL_NOT_VALIDATED", - "BILLING_INFO_MISSING", - "LOCKED", - "PAYMENT_FAILURE", - "VALID", - "PENDING_VERIFICATION", - "VERIFICATION_FAILED", - "REVIEWING_ACCOUNT", - "PLAN_UPGRADE_REQUIRED" + "INVALID_TYPE", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" ], - "default": "NEW" + "default": "INVALID_TYPE" }, - "OrganizationInvitation": { + "ServiceEvent": { "type": "object", "properties": { "id": { "type": "string" }, - "email": { - "type": "string" - }, - "role": { - "$ref": "#/definitions/UserRole.Role" - }, - "status": { - "$ref": "#/definitions/OrganizationInvitation.Status" - }, - "expires_at": { + "when": { "type": "string", "format": "date-time" }, "organization_id": { "type": "string" }, - "organization": { - "$ref": "#/definitions/PublicOrganization" - }, - "invitee_id": { + "service_id": { "type": "string" }, - "invitee": { - "$ref": "#/definitions/PublicUser" + "type": { + "type": "string" }, - "inviter_id": { + "message": { "type": "string" }, - "inviter": { - "$ref": "#/definitions/PublicUser" - } - } - }, - "OrganizationInvitation.Status": { - "type": "string", - "enum": [ - "INVALID", - "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" - ], - "default": "INVALID" - }, - "ReactivateOrganizationReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "metadata": { + "type": "object" } } }, - "ResendEmailValidationReply": { - "type": "object" - }, - "ResendEmailValidationRequest": { - "type": "object" - }, - "ResetPasswordReply": { - "type": "object" - }, - "ResetPasswordRequest": { + "ServiceLifeCycle": { "type": "object", - "example": { - "email": "john@snow.com" - }, "properties": { - "email": { - "type": "string" + "delete_after_sleep": { + "type": "integer", + "format": "int64" + }, + "delete_after_create": { + "type": "integer", + "format": "int64" } } }, - "Token": { + "ServiceListItem": { "type": "object", - "example": { - "id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", - "expires": "2022-09-08T14:00:00Z", - "user_id": "996d7822-6b58-11e9-956f-32001b70f000", - "organization_id": "9f33b2c6-6b58-11e9-883c-32001b70f000" - }, "properties": { "id": { "type": "string" }, - "user_id": { + "name": { "type": "string" }, + "type": { + "$ref": "#/definitions/Service.Type" + }, "organization_id": { "type": "string" }, - "expires_at": { + "app_id": { + "type": "string" + }, + "updated_at": { "type": "string", "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/definitions/Service.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "format": "uint64", + "title": "A version updated whenever this state changes (useful for caching)" + }, + "state": { + "$ref": "#/definitions/ServiceState" + }, + "active_deployment_id": { + "type": "string" + }, + "latest_deployment_id": { + "type": "string" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" } } }, - "UnscopeOrganizationTokenRequest": { - "type": "object" - }, - "UpdateBudgetReply": { + "ServiceState": { "type": "object", "properties": { - "budget": { - "$ref": "#/definitions/Budget" + "desired_deployment": { + "$ref": "#/definitions/DesiredDeployment" + }, + "auto_release": { + "$ref": "#/definitions/AutoRelease" } } }, - "UpdateOrganizationDefaultProjectReply": { + "TCPHealthCheck": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "port": { + "type": "integer", + "format": "int64", + "title": "The port to use to perform the health check, must be declared in the ports section" } } }, - "UpdateOrganizationNameReply": { + "TriggerDeploymentMetadata": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "type": { + "$ref": "#/definitions/TriggerDeploymentMetadata.TriggerType" + }, + "actor": { + "$ref": "#/definitions/TriggerDeploymentMetadata.ActorType" + }, + "git": { + "$ref": "#/definitions/TriggerGitDeploymentMetadata" } } }, - "UpdateOrganizationPlanReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" - } - } + "TriggerDeploymentMetadata.ActorType": { + "type": "string", + "enum": [ + "UNKNOWN_ACTOR", + "USER", + "SYSTEM" + ], + "default": "UNKNOWN_ACTOR" }, - "UpdateOrganizationReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" - } - } + "TriggerDeploymentMetadata.TriggerType": { + "type": "string", + "enum": [ + "UNKNOWN_TYPE", + "GIT", + "RESUME", + "DATABASE_SYNC" + ], + "default": "UNKNOWN_TYPE" }, - "UpdatePasswordRequest": { + "TriggerGitDeploymentMetadata": { "type": "object", - "example": { - "id": "...", - "password": "..." - }, "properties": { - "id": { - "type": "string" + "provider": { + "$ref": "#/definitions/TriggerGitDeploymentMetadata.Provider" }, - "password": { + "repository": { "type": "string" - } - } - }, - "UpdateUserRequest.UserUpdateBody": { - "type": "object", - "properties": { - "id": { + }, + "branch": { "type": "string" }, - "email": { + "sha": { "type": "string" }, - "current_password": { + "message": { "type": "string" }, - "password": { + "sender_username": { "type": "string" }, - "newsletter_subscribed": { - "type": "boolean" + "sender_avatar_url": { + "type": "string" }, - "name": { + "sender_profile_url": { "type": "string" } } }, - "UpdateUserSettingsReply": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/UserSettings" - } - } + "TriggerGitDeploymentMetadata.Provider": { + "type": "string", + "enum": [ + "UNKNOWN", + "GITHUB" + ], + "default": "UNKNOWN" }, - "UpdateUserSettingsRequest": { + "UpdateService": { "type": "object", "properties": { - "failed_deployment_email_notification": { + "definition": { + "$ref": "#/definitions/DeploymentDefinition", + "title": "definition and instance_snapshot_id are mutually exclusive" + }, + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" + }, + "skip_build": { "type": "boolean", - "description": "(Optional) Toggle failed deployment email notification." + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + }, + "save_only": { + "type": "boolean", + "title": "If set, do not trigger a deployment, only store the new settings" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" + }, + "instance_snapshot_id": { + "type": "string", + "title": "Instance Snapshot used to boot the Instances of this deployment" } } }, - "UpsertSignupQualificationReply": { + "UpdateServiceReply": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "service": { + "$ref": "#/definitions/Service", + "title": "The entity updated" } } }, - "UserReply": { + "UpdateServiceScalingReply": { "type": "object", - "properties": { - "user": { - "$ref": "#/definitions/User" - } - } + "title": "Empty reply - success is indicated by no error" }, - "UserSettings": { + "App": { "type": "object", "properties": { "id": { "type": "string" }, - "user_id": { + "name": { "type": "string" }, - "failed_deployment_email_notification": { - "type": "boolean" - } - } - }, - "Activity": { - "type": "object", - "properties": { - "id": { + "organization_id": { "type": "string" }, - "actor": { - "$ref": "#/definitions/Object" + "created_at": { + "type": "string", + "format": "date-time" }, - "object": { - "$ref": "#/definitions/Object" + "updated_at": { + "type": "string", + "format": "date-time" }, - "verb": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "metadata": { - "type": "object" + "succeeded_at": { + "type": "string", + "format": "date-time" }, - "created_at": { + "paused_at": { "type": "string", "format": "date-time" - } - } - }, - "ActivityList": { - "type": "object", - "properties": { - "activities": { - "type": "array", - "items": { - "$ref": "#/definitions/Activity" - } }, - "limit": { - "type": "integer", - "format": "int64" + "resumed_at": { + "type": "string", + "format": "date-time" }, - "offset": { - "type": "integer", - "format": "int64" + "terminated_at": { + "type": "string", + "format": "date-time" }, - "has_next": { - "type": "boolean" - } - } - }, - "Object": { - "type": "object", - "properties": { - "id": { - "type": "string" + "status": { + "$ref": "#/definitions/App.Status" }, - "name": { - "type": "string" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "type": { - "type": "string" + "version": { + "type": "string", + "format": "uint64" }, - "metadata": { - "type": "object" + "domains": { + "type": "array", + "items": { + "$ref": "#/definitions/Domain" + } }, - "deleted": { - "type": "boolean" + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" } } }, - "Empty": { - "type": "object" - }, - "kgitproxy.GithubInstallation.Status": { - "type": "string", - "enum": [ - "INVALID", - "INSTALLED", - "SUSPENDED", - "DELETED" - ], - "default": "INVALID" - }, - "kgitproxy.IndexingStatus": { + "App.Status": { "type": "string", "enum": [ - "INVALID_INDEXING_STATUS", - "NOT_STARTED", - "IN_PROGRESS", - "COMPLETED" + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "DELETING", + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" ], - "default": "INVALID_INDEXING_STATUS" + "default": "STARTING" }, - "CheckCouponReply": { + "AppEvent": { "type": "object", "properties": { - "name": { + "id": { "type": "string" }, - "percent_off": { - "type": "number", - "format": "float" - }, - "amount_off": { + "when": { "type": "string", - "format": "int64" + "format": "date-time" }, - "currency": { + "organization_id": { "type": "string" - } - } - }, - "RedeemCouponReply": { - "type": "object" - }, - "RedeemCouponRequest": { - "type": "object", - "properties": { - "code": { + }, + "app_id": { "type": "string" - } - } - }, - "CreateOrganizationInvitationReply": { - "type": "object", - "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation sent" - } - } - }, - "CreateOrganizationInvitationRequest": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "The email of the person to invite" - } - } - }, - "DeleteOrganizationInvitationReply": { - "type": "object" - }, - "GetOrganizationInvitationReply": { - "type": "object", - "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation" - } - } - }, - "ListOrganizationInvitationsReply": { - "type": "object", - "properties": { - "invitations": { - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationInvitation" - }, - "title": "The collection of organization invitations" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "type": { + "type": "string" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "message": { + "type": "string" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "metadata": { + "type": "object" } } }, - "ResendOrganizationInvitationReply": { + "AppLifeCycle": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation resent" + "delete_when_empty": { + "type": "boolean" } } }, - "ConfirmOrganizationActionReply": { - "type": "object" - }, - "CreateCredential": { + "AppListItem": { "type": "object", "properties": { + "id": { + "type": "string" + }, "name": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "updated_at": { "type": "string", - "title": "Credential name" + "format": "date-time" }, - "description": { + "created_at": { "type": "string", - "title": "Credential description" + "format": "date-time" }, - "type": { - "$ref": "#/definitions/Credential.Type", - "title": "Credential type" + "domains": { + "type": "array", + "items": { + "$ref": "#/definitions/Domain" + } }, - "organization_id": { + "status": { + "$ref": "#/definitions/App.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "CreateApp": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" + }, + "project_id": { "type": "string", - "title": "Organization id for user credential" + "title": "(Optional) The project ID to associate with the app" } } }, - "CreateCredentialReply": { + "CreateAppReply": { "type": "object", "properties": { - "credential": { - "$ref": "#/definitions/Credential" + "app": { + "$ref": "#/definitions/App", + "title": "The entity created" } } }, - "Credential": { + "DeleteAppReply": { + "type": "object" + }, + "Domain": { "type": "object", "properties": { "id": { "type": "string" }, - "type": { - "$ref": "#/definitions/Credential.Type" + "organization_id": { + "type": "string" }, "name": { "type": "string" }, - "token": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time" }, - "description": { - "type": "string" + "updated_at": { + "type": "string", + "format": "date-time" }, - "user_id": { + "status": { + "$ref": "#/definitions/Domain.Status" + }, + "type": { + "$ref": "#/definitions/Domain.Type" + }, + "app_id": { "type": "string" }, - "organization_id": { + "deployment_group": { "type": "string" }, - "updated_at": { + "verified_at": { "type": "string", "format": "date-time" }, - "created_at": { + "intended_cname": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { "type": "string", - "format": "date-time" + "format": "uint64" }, - "expires_at": { + "cloudflare": { + "$ref": "#/definitions/Domain.LoadBalancerCloudflare" + }, + "koyeb": { + "$ref": "#/definitions/Domain.LoadBalancerKoyeb" + }, + "project_id": { "type": "string", - "format": "date-time" + "description": "The project ID this domain belongs to. Empty if the domain is organization-level." } } }, - "Credential.Type": { + "Domain.LoadBalancerCloudflare": { + "type": "object" + }, + "Domain.LoadBalancerKoyeb": { + "type": "object", + "properties": { + "request_timeout_seconds": { + "type": "integer", + "format": "int64", + "title": "Between 100 and 900" + } + } + }, + "Domain.Status": { "type": "string", "enum": [ - "INVALID", - "USER", - "ORGANIZATION" + "PENDING", + "ACTIVE", + "ERROR", + "DELETING", + "DELETED" ], - "default": "INVALID" + "default": "PENDING" }, - "DeleteCredentialReply": { - "type": "object" + "Domain.Type": { + "type": "string", + "enum": [ + "AUTOASSIGNED", + "CUSTOM" + ], + "default": "AUTOASSIGNED", + "title": "- AUTOASSIGNED: Domain like -.koyeb.app" }, - "GetCredentialReply": { + "GetAppReply": { "type": "object", "properties": { - "credential": { - "$ref": "#/definitions/Credential" + "app": { + "$ref": "#/definitions/App", + "title": "The App retrieved" } } }, - "ListCredentialsReply": { + "ListAppEventsReply": { "type": "object", "properties": { - "credentials": { + "events": { "type": "array", "items": { - "$ref": "#/definitions/Credential" - } + "$ref": "#/definitions/AppEvent" + }, + "title": "The collection of events" }, "limit": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The limit in the request" }, "offset": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The offset in the request" }, - "count": { - "type": "integer", - "format": "int64" - } - } - }, - "UpdateCredentialReply": { - "type": "object", - "properties": { - "credential": { - "$ref": "#/definitions/Credential" - } - } - }, - "CreateProject": { - "type": "object", - "properties": { - "name": { + "order": { "type": "string", - "title": "Project name" + "title": "The order in the request" }, - "description": { - "type": "string", - "title": "Project description" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "CreateProjectReply": { + "ListAppsReply": { "type": "object", "properties": { - "project": { - "$ref": "#/definitions/Project" + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/AppListItem" + } + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "DeleteProjectReply": { + "PauseAppReply": { "type": "object" }, - "GetProjectReply": { + "ResumeAppReply": { + "type": "object" + }, + "UpdateApp": { "type": "object", "properties": { - "project": { - "$ref": "#/definitions/Project" + "name": { + "type": "string" + }, + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" } } }, - "ListProjectsReply": { - "type": "object", - "properties": { - "projects": { - "type": "array", - "items": { - "$ref": "#/definitions/Project" - } - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "offset": { - "type": "integer", - "format": "int64" + "UpdateAppReply": { + "type": "object", + "properties": { + "app": { + "$ref": "#/definitions/App", + "title": "The entity updated" } } }, - "Project": { + "CancelDeploymentReply": { + "type": "object" + }, + "DeploymentEvent": { "type": "object", "properties": { "id": { "type": "string" }, - "name": { + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { "type": "string" }, - "description": { + "deployment_id": { "type": "string" }, - "organization_id": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" + } + } + }, + "DeploymentListItem": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "created_at": { + "type": "string", + "format": "date-time" + }, "updated_at": { "type": "string", "format": "date-time" }, - "created_at": { + "allocated_at": { "type": "string", "format": "date-time" }, - "service_count": { + "started_at": { "type": "string", - "format": "int64", - "title": "Number of services in this project" - } - } - }, - "UpdateProjectReply": { - "type": "object", - "properties": { - "project": { - "$ref": "#/definitions/Project" - } - } - }, - "AppsSummary": { - "type": "object", - "properties": { - "total": { + "format": "date-time" + }, + "succeeded_at": { "type": "string", - "format": "int64", - "title": "Total number of apps" + "format": "date-time" }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of apps grouped by status" - } - } - }, - "DomainsSummary": { - "type": "object", - "properties": { - "total": { + "terminated_at": { "type": "string", - "format": "int64", - "title": "Total number of domains" + "format": "date-time" }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of domains grouped by status" + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "parent_id": { + "type": "string" + }, + "child_id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Deployment.Status" + }, + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" + }, + "definition": { + "$ref": "#/definitions/DeploymentDefinition" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" + }, + "database_info": { + "$ref": "#/definitions/DeploymentDatabaseInfo" + }, + "instance_snapshot_id": { + "type": "string", + "title": "Instance Snapshot used to boot the Instances of this deployment" + }, + "version": { + "type": "string", + "format": "uint64" + }, + "deployment_group": { + "type": "string" } } }, - "GetOrganizationSummaryReply": { + "GetDeploymentReply": { "type": "object", "properties": { - "summary": { - "$ref": "#/definitions/OrganizationSummary", - "title": "Organization usage summary" + "deployment": { + "$ref": "#/definitions/Deployment" } } }, - "InstancesSummary": { + "GetDeploymentScalingReply": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Total number of instances" - }, - "by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" + "replicas": { + "type": "array", + "items": { + "$ref": "#/definitions/GetDeploymentScalingReplyItem" }, - "title": "Number of instances grouped by type" + "title": "The replicas" } } }, - "MembersSummary": { + "GetDeploymentScalingReplyItem": { "type": "object", "properties": { - "total": { + "region": { "type": "string", - "format": "int64", - "title": "Number of members" + "title": "The replica region" }, - "invitations_by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" + "replica_index": { + "type": "integer", + "format": "int64" + }, + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/Instance" }, - "title": "Number of invitations grouped by status" + "description": "An array of `active` and `starting` instances.\n\nStatus of the active instance (and if none the most recent instance)\n string status = 4;\n Status message of the active instance (and if none the most recent instance)\n string message = 5;" } } }, - "NeonPostgresSummary": { + "Instance": { "type": "object", "properties": { - "total": { + "id": { + "type": "string" + }, + "created_at": { "type": "string", - "format": "int64", - "title": "Total number of databases" + "format": "date-time" }, - "by_instance_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of databases grouped by instance type" + "updated_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "allocation_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "replica_index": { + "type": "integer", + "format": "int64" + }, + "region": { + "type": "string" + }, + "datacenter": { + "type": "string" + }, + "hypervisor": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Instance.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "xyz_deployment_id": { + "type": "string", + "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." } } }, - "OrganizationSummary": { + "Instance.Status": { + "type": "string", + "enum": [ + "ALLOCATING", + "STARTING", + "HEALTHY", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERROR", + "SLEEPING" + ], + "default": "ALLOCATING" + }, + "ListDeploymentEventsReply": { "type": "object", "properties": { - "organization_id": { - "type": "string" - }, - "instances": { - "$ref": "#/definitions/InstancesSummary" - }, - "apps": { - "$ref": "#/definitions/AppsSummary" - }, - "services": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ServiceSummary" + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentEvent" }, - "title": "Number of services grouped by type" + "title": "The collection of events" }, - "domains": { - "$ref": "#/definitions/DomainsSummary" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "secrets": { - "$ref": "#/definitions/SecretsSummary" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresSummary" + "order": { + "type": "string", + "title": "The order in the request" }, - "members": { - "$ref": "#/definitions/MembersSummary" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "SecretsSummary": { + "ListDeploymentsReply": { "type": "object", "properties": { - "total": { - "type": "string", + "deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentListItem" + }, + "title": "The collection of deployments" + }, + "limit": { + "type": "integer", "format": "int64", - "title": "Total number of secrets" + "title": "The limit in the request" }, - "by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of secrets grouped by type" - } - } - }, - "ServiceSummary": { - "type": "object", - "properties": { - "total": { - "type": "string", + "offset": { + "type": "integer", "format": "int64", - "title": "Total number of services" + "title": "The offset in the request" }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of services grouped by status" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "LoginRequest": { + "Env": { "type": "object", - "example": { - "email": "john@snow.com", - "password": "..." - }, "properties": { - "email": { - "type": "string", - "title": "User email" + "key": { + "type": "string" }, - "password": { - "type": "string", - "title": "User password" + "value": { + "type": "string" }, - "organization_id": { - "type": "string", - "title": "(Optional) Login into this organization" + "secret": { + "type": "string" } } }, - "LogoutReply": { - "type": "object" - }, - "DomainLoadBalancerQuotas": { + "GetRegionalDeploymentReply": { "type": "object", "properties": { - "max_koyeb": { - "type": "integer", - "format": "int64" + "regional_deployment": { + "$ref": "#/definitions/RegionalDeployment" } } }, - "GetQuotasReply": { + "ListRegionalDeploymentEventsReply": { "type": "object", "properties": { - "quotas": { - "$ref": "#/definitions/Quotas" + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionalDeploymentEvent" + }, + "title": "The collection of events" + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "LifecycleQuotas": { + "ListRegionalDeploymentsReply": { "type": "object", "properties": { - "delete_after_sleep_min": { + "regional_deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionalDeploymentListItem" + }, + "title": "The collection of regional deployments" + }, + "limit": { "type": "integer", "format": "int64", - "title": "delete after sleep limits" + "title": "The limit in the request" }, - "delete_after_sleep_max": { + "offset": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The offset in the request" }, - "delete_after_create_min": { + "count": { "type": "integer", "format": "int64", - "title": "delete after create limits" + "title": "The total number of items" }, - "delete_after_create_max": { - "type": "integer", - "format": "int64" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "PersistentVolumeQuotas": { + "Port": { "type": "object", "properties": { - "max_total_size": { - "type": "integer", - "format": "int64", - "description": "MaxTotalSize for all volumes on a region (in Gigabyte / GB)." - }, - "max_volume_size": { + "port": { "type": "integer", - "format": "int64", - "description": "MaxVolumeSize for one volume (in Gigabyte / GB)." + "format": "int64" }, - "max_per_instance_size": { - "type": "integer", - "format": "int64", - "description": "MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB)." + "protocol": { + "type": "string" } } }, - "Quotas": { + "RegionalDeployment": { "type": "object", "properties": { - "apps": { + "id": { + "type": "string" + }, + "created_at": { "type": "string", - "format": "int64" + "format": "date-time" }, - "services": { + "updated_at": { "type": "string", - "format": "int64" + "format": "date-time" }, - "domains": { + "scheduled_at": { "type": "string", - "format": "int64", - "title": "Deprecated, use custom_domains instead" + "format": "date-time" + }, + "allocated_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "region": { + "type": "string" }, - "services_by_app": { - "type": "string", - "format": "int64" + "parent_id": { + "type": "string" }, - "service_provisioning_concurrency": { - "type": "string", - "format": "int64" + "child_id": { + "type": "string" }, - "memory_mb": { - "type": "string", - "format": "int64" + "status": { + "$ref": "#/definitions/RegionalDeployment.Status" }, - "instance_types": { + "messages": { "type": "array", "items": { "type": "string" } }, - "regions": { + "definition": { + "$ref": "#/definitions/RegionalDeploymentDefinition" + }, + "datacenters": { "type": "array", "items": { "type": "string" } }, - "max_organization_members": { - "type": "string", - "format": "int64" + "metadata": { + "$ref": "#/definitions/RegionalDeploymentMetadata" }, - "max_instances_by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - } + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" }, - "persistent_volumes_by_region": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/PersistentVolumeQuotas" - } + "role": { + "$ref": "#/definitions/RegionalDeployment.Role" }, - "custom_domains": { + "instance_snapshot_id": { "type": "string", - "format": "int64" + "title": "Instance Snapshot used to boot the Instances of this deployment" }, - "domains_load_balancer": { - "$ref": "#/definitions/DomainLoadBalancerQuotas" + "version": { + "type": "string", + "format": "uint64" }, - "metrics_retention": { - "type": "integer", - "format": "int32", - "title": "Time in days" + "deployment_group": { + "type": "string", + "title": "Legacy stuff" }, - "logs_retention": { - "type": "integer", - "format": "int32", - "title": "Time in days" + "deployment_id": { + "type": "string" + } + } + }, + "RegionalDeployment.Role": { + "type": "string", + "enum": [ + "INVALID", + "ACTIVE", + "UPCOMING", + "CURRENT" + ], + "default": "INVALID" + }, + "RegionalDeployment.Status": { + "type": "string", + "enum": [ + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "SLEEPING" + ], + "default": "PENDING" + }, + "RegionalDeploymentDefinition": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "access_reserved_subdomains": { + "type": { + "$ref": "#/definitions/RegionalDeploymentDefinition.Type" + }, + "strategy": { + "$ref": "#/definitions/DeploymentStrategy" + }, + "routes": { "type": "array", "items": { - "type": "string" - }, - "title": "The mapping between reserved_subdomain names and their value is in the code" + "$ref": "#/definitions/Route" + } }, - "proxy_ports": { - "type": "integer", - "format": "int64" + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/Port" + } }, - "scale_to_zero": { - "$ref": "#/definitions/ScaleToZeroQuotas" + "env": { + "type": "array", + "items": { + "$ref": "#/definitions/Env" + } }, - "archives": { - "type": "string", - "format": "int64" + "region": { + "type": "string" }, - "archive_max_size_mb": { - "type": "string", - "format": "int64" + "scaling": { + "$ref": "#/definitions/Scaling" }, - "lifecycle": { - "$ref": "#/definitions/LifecycleQuotas" + "instance_type": { + "type": "string" }, - "max_projects": { - "type": "string", - "format": "int64" - } - } - }, - "ScaleToZeroQuotas": { - "type": "object", - "properties": { - "is_deep_sleep_enabled": { - "type": "boolean", - "title": "deep sleep limits" + "deployment_group": { + "type": "string" }, - "deep_sleep_idle_delay_min": { - "type": "integer", - "format": "int64" + "health_checks": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentHealthCheck" + } }, - "deep_sleep_idle_delay_max": { - "type": "integer", - "format": "int64" + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionalDeploymentVolume" + } }, - "is_light_sleep_enabled": { - "type": "boolean", - "title": "light sleep limits" + "config_files": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigFile" + } }, - "light_sleep_idle_delay_min": { - "type": "integer", - "format": "int64" + "skip_cache": { + "type": "boolean" }, - "light_sleep_idle_delay_max": { - "type": "integer", - "format": "int64" + "mesh": { + "$ref": "#/definitions/RegionalDeploymentMesh" + }, + "docker": { + "$ref": "#/definitions/DockerSource" + }, + "git": { + "$ref": "#/definitions/GitSource" + }, + "archive": { + "$ref": "#/definitions/ArchiveSource" } } }, - "CreateStageAttemptReply": { - "type": "object" - }, - "DeclareStageProgressReply": { - "type": "object" - }, - "DeclareStepProgressReply": { - "type": "object" - }, - "DeploymentProvisioningInfo.Stage.Status": { + "RegionalDeploymentDefinition.Type": { "type": "string", "enum": [ - "UNKNOWN", - "PENDING", - "RUNNING", - "FAILED", - "COMPLETED", - "ABORTED" + "INVALID", + "WEB", + "WORKER", + "_", + "SANDBOX" ], - "default": "UNKNOWN" + "default": "INVALID", + "title": "- _: We match with DeploymentDefinition.Type, so we skip 3 which is DATABASE" }, - "BasicAuthPolicy": { + "RegionalDeploymentEvent": { "type": "object", "properties": { - "username": { + "id": { "type": "string" }, - "password": { + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { "type": "string" - } - } - }, - "SecurityPolicies": { - "type": "object", - "properties": { - "basic_auths": { - "type": "array", - "items": { - "$ref": "#/definitions/BasicAuthPolicy" - } }, - "api_keys": { - "type": "array", - "items": { - "type": "string" - } + "metadata": { + "type": "object" } } }, - "App": { + "RegionalDeploymentListItem": { "type": "object", "properties": { "id": { "type": "string" }, - "name": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, "created_at": { "type": "string", "format": "date-time" @@ -16207,28 +17071,11 @@ "type": "string", "format": "date-time" }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "paused_at": { - "type": "string", - "format": "date-time" - }, - "resumed_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" + "region": { + "type": "string" }, "status": { - "$ref": "#/definitions/App.Status" + "$ref": "#/definitions/RegionalDeployment.Status" }, "messages": { "type": "array", @@ -16236,1028 +17083,965 @@ "type": "string" } }, - "version": { - "type": "string", - "format": "uint64" - }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/Domain" - } + "definition": { + "$ref": "#/definitions/RegionalDeploymentDefinition" }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" + "instance_snapshot_id": { + "type": "string", + "title": "Instance Snapshot used to boot the Instances of this deployment" } } }, - "App.Status": { + "RegionalDeploymentMesh": { "type": "string", "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" + "REGIONAL_DEPLOYMENT_MESH_AUTO", + "REGIONAL_DEPLOYMENT_MESH_ENABLED", + "REGIONAL_DEPLOYMENT_MESH_DISABLED" ], - "default": "STARTING" + "default": "REGIONAL_DEPLOYMENT_MESH_AUTO" }, - "AppLifeCycle": { - "type": "object", - "properties": { - "delete_when_empty": { - "type": "boolean" - } - } + "RegionalDeploymentMetadata": { + "type": "object" }, - "ArchiveSource": { + "RegionalDeploymentVolume": { "type": "object", "properties": { "id": { "type": "string", - "title": "The ID of the archive to deploy" + "title": "the id of the volume" }, - "buildpack": { - "$ref": "#/definitions/BuildpackBuilder" + "path": { + "type": "string", + "title": "the path where the volume is mounted to" }, - "docker": { - "$ref": "#/definitions/DockerBuilder" + "replica_index": { + "type": "integer", + "format": "int64", + "title": "the replica index to mount the volume to" } } }, - "AutoRelease": { + "Route": { "type": "object", "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/AutoRelease.Group" - } + "port": { + "type": "integer", + "format": "int64" + }, + "path": { + "type": "string" + }, + "security_policies": { + "$ref": "#/definitions/SecurityPolicies" } } }, - "AutoRelease.Group": { + "Scaling": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "repository": { - "type": "string" + "min": { + "type": "integer", + "format": "int64" }, - "git_ref": { - "type": "string", - "title": "A git ref to track (.e.g: refs/tags/ or refs/heads/" + "max": { + "type": "integer", + "format": "int64" }, - "latest_sha": { - "type": "string", - "title": "The last hash that was resolved (used to avoid triggering releases when things haven't changed)" + "targets": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentScalingTarget" + } } - }, - "title": "Configuration extracted from the latest deployment in this deployment_group" + } }, - "BuildpackBuilder": { + "VerifyDockerImageReply": { "type": "object", "properties": { - "build_command": { - "type": "string", - "title": "A command used to override the build command, run after all build steps" + "success": { + "type": "boolean", + "title": "Whether the image is accessible or not" }, - "run_command": { + "reason": { "type": "string", - "title": "A command used to override the default run command" + "title": "(Optional) If the image is not accessible, the reason" }, - "privileged": { - "type": "boolean", - "title": "A flag to run the container in privileged mode" + "code": { + "$ref": "#/definitions/VerifyDockerImageReply.ErrCode", + "title": "(Optional) If the image is not accessible, return an error code" } } }, - "ComposeReply": { + "VerifyDockerImageReply.ErrCode": { + "type": "string", + "enum": [ + "UNKNOWN", + "AUTH_ACCESS_DENIED", + "ANON_ACCESS_DENIED", + "AUTH_NOT_FOUND", + "ANON_NOT_FOUND", + "REGISTRY_ERROR", + "TIMEOUT", + "DNS", + "MALFORMED", + "INVALID_OS", + "INVALID_ARCH", + "INVALID_SCHEME", + "GENERIC" + ], + "default": "UNKNOWN", + "description": "- UNKNOWN: Default value\n - AUTH_ACCESS_DENIED: The registry denied access to an authenticated request\n - ANON_ACCESS_DENIED: The registry denied access to an anonymous request\n - AUTH_NOT_FOUND: The image has not been found after an authenticated request\n - ANON_NOT_FOUND: The image has not been found after an anonymous request\n - REGISTRY_ERROR: The registry returned an error\n - TIMEOUT: The request to the registry timed out\n - DNS: There was an error trying to resolve the name of the registry\n - MALFORMED: The provided image name is malformed\n - INVALID_OS: The operating system is not supported\n - INVALID_ARCH: The architecture is not supported\n - INVALID_SCHEME: The scheme is not https\n - GENERIC: Generic catch-all error code", + "title": "The error code associated to each specific failure mode" + }, + "CreatePersistentVolumeReply": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App" - }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/Service" - } + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "ConfigFile": { + "CreatePersistentVolumeRequest": { "type": "object", "properties": { - "path": { - "type": "string", - "title": "the path where the file is copied" + "volume_type": { + "$ref": "#/definitions/PersistentVolumeBackingStore", + "title": "the volume backing store type" }, - "permissions": { + "name": { "type": "string", - "title": "the permissions of the file in format 0644" + "title": "the volume name" }, - "content": { + "region": { "type": "string", - "title": "the content of the file" - } - } - }, - "CreateApp": { - "type": "object", - "properties": { - "name": { - "type": "string" + "title": "the volume region" }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" + "read_only": { + "type": "boolean", + "title": "whether the volume must be set as read only" }, - "project_id": { + "max_size": { + "type": "integer", + "format": "int64", + "title": "the size of the volume (in Gigabyte / GB)" + }, + "snapshot_id": { "type": "string", - "title": "(Optional) The project ID to associate with the app" - } - } - }, - "CreateCompose": { - "type": "object", - "properties": { - "app": { - "$ref": "#/definitions/CreateApp" + "title": "(optional) the id of the snapshot whence the volume comes from" }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/CreateService" - } + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the volume" } } }, - "CreateService": { + "DeletePersistentVolumeReply": { "type": "object", "properties": { - "app_id": { - "type": "string" - }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" - }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" - }, - "project_id": { - "type": "string", - "title": "(Optional) The project ID to associate with the service" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "DatabaseSource": { + "GetPersistentVolumeReply": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresDatabase" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "DeploymentDefinition": { + "ListPersistentVolumeEventsReply": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/DeploymentDefinition.Type" - }, - "strategy": { - "$ref": "#/definitions/DeploymentStrategy" - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentRoute" - } - }, - "ports": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentPort" - } - }, - "proxy_ports": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProxyPort" - } - }, - "env": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentEnv" - } - }, - "regions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scalings": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScaling" - } - }, - "instance_types": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentInstanceType" - } - }, - "health_checks": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentHealthCheck" - } - }, - "volumes": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentVolume" - } - }, - "config_files": { + "events": { "type": "array", "items": { - "$ref": "#/definitions/ConfigFile" - } - }, - "skip_cache": { - "type": "boolean" - }, - "mesh": { - "$ref": "#/definitions/DeploymentMesh" + "$ref": "#/definitions/PersistentVolumeEvent" + }, + "title": "The collection of events" }, - "docker": { - "$ref": "#/definitions/DockerSource" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "git": { - "$ref": "#/definitions/GitSource" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "database": { - "$ref": "#/definitions/DatabaseSource" + "order": { + "type": "string", + "title": "The order in the request" }, - "archive": { - "$ref": "#/definitions/ArchiveSource" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "DeploymentDefinition.Type": { - "type": "string", - "enum": [ - "INVALID", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" - ], - "default": "INVALID" - }, - "DeploymentEnv": { + "ListPersistentVolumesReply": { "type": "object", "properties": { - "scopes": { + "volumes": { "type": "array", "items": { - "type": "string" - } + "$ref": "#/definitions/PersistentVolume" + }, + "title": "The collection of persistent volumes" }, - "key": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "value": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "secret": { - "type": "string" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "DeploymentHealthCheck": { + "PersistentVolume": { "type": "object", "properties": { - "grace_period": { - "type": "integer", - "format": "int64", - "title": "An optional initial period in seconds to wait for the instance to become healthy, default is 5s" + "id": { + "type": "string", + "title": "the identifier for the volume object" }, - "interval": { - "type": "integer", - "format": "int64", - "title": "An optional period in seconds between two health checks, default is 60s" + "name": { + "type": "string", + "title": "the volume name" }, - "restart_limit": { + "snapshot_id": { + "type": "string", + "title": "(optional) the id of the snapshot whence the volume comes from" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "creation timestamp" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "last change timestamp" + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "title": "deletion timestamp" + }, + "organization_id": { + "type": "string", + "title": "the organization to which the volume belongs to" + }, + "service_id": { + "type": "string", + "title": "the service_id to which the volume is eventually bound to" + }, + "region": { + "type": "string", + "title": "the region where the volume exists" + }, + "read_only": { + "type": "boolean", + "title": "whether to mount the volume in read-only mode" + }, + "max_size": { "type": "integer", "format": "int64", - "title": "An optional number of consecutive failures before attempting to restart the service, default is 3" + "title": "the maximum size of the volume (in Gigabyte / GB)" }, - "timeout": { + "cur_size": { "type": "integer", "format": "int64", - "title": "An optional maximum time to wait in seconds before considering the check as a failure, default is 5s" - }, - "tcp": { - "$ref": "#/definitions/TCPHealthCheck" + "title": "the used amount of space as measured the last time (in Gigabyte / GB)" }, - "http": { - "$ref": "#/definitions/HTTPHealthCheck" - } - } - }, - "DeploymentInstanceType": { - "type": "object", - "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } + "status": { + "$ref": "#/definitions/PersistentVolumeStatus", + "title": "the status of the volume" }, - "type": { - "type": "string" + "backing_store": { + "$ref": "#/definitions/PersistentVolumeBackingStore", + "title": "the backing store type" } - } + }, + "title": "The object that represent a volume to handle persistency for deployments" }, - "DeploymentMesh": { + "PersistentVolumeBackingStore": { "type": "string", "enum": [ - "DEPLOYMENT_MESH_AUTO", - "DEPLOYMENT_MESH_ENABLED", - "DEPLOYMENT_MESH_DISABLED" + "PERSISTENT_VOLUME_BACKING_STORE_INVALID", + "PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK" ], - "default": "DEPLOYMENT_MESH_AUTO" + "default": "PERSISTENT_VOLUME_BACKING_STORE_INVALID", + "title": "- PERSISTENT_VOLUME_BACKING_STORE_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK: the backing store is a locally reachable block device" }, - "DeploymentPort": { + "PersistentVolumeEvent": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" + "id": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "persistent_volume_id": { + "type": "string" }, - "protocol": { - "type": "string", - "title": "One of http, http2, tcp" + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "DeploymentProxyPort": { + "PersistentVolumeStatus": { + "type": "string", + "enum": [ + "PERSISTENT_VOLUME_STATUS_INVALID", + "PERSISTENT_VOLUME_STATUS_ATTACHED", + "PERSISTENT_VOLUME_STATUS_DETACHED", + "PERSISTENT_VOLUME_STATUS_DELETING", + "PERSISTENT_VOLUME_STATUS_DELETED", + "PERSISTENT_VOLUME_STATUS_ARCHIVING" + ], + "default": "PERSISTENT_VOLUME_STATUS_INVALID", + "title": "- PERSISTENT_VOLUME_STATUS_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_STATUS_ATTACHED: the volume is attached to an instance\n - PERSISTENT_VOLUME_STATUS_DETACHED: the volume is free to use\n - PERSISTENT_VOLUME_STATUS_DELETING: the volume will be deleted\n - PERSISTENT_VOLUME_STATUS_DELETED: the volume was deleted\n - PERSISTENT_VOLUME_STATUS_ARCHIVING: the volume is being archived (snapshot being created and migrated to remote storage)" + }, + "UpdatePersistentVolumeReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" - }, - "protocol": { - "$ref": "#/definitions/ProxyPortProtocol" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "DeploymentRoute": { + "Archive": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" + "id": { + "type": "string", + "description": "The archive id, that can be referenced when creating or updating a service." }, - "path": { - "type": "string" + "organization_id": { + "type": "string", + "description": "Organization owning the archive." }, - "security_policies": { - "$ref": "#/definitions/SecurityPolicies" - } - } - }, - "DeploymentScaling": { - "type": "object", - "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } + "upload_url": { + "type": "string", + "description": "The URL where to upload the archive. This URL is signed and can only be\nused to upload the archive until `valid_until`." }, - "min": { - "type": "integer", - "format": "int64" + "size": { + "type": "string", + "format": "uint64", + "description": "The provisioned space for the archive." }, - "max": { - "type": "integer", - "format": "int64" + "created_at": { + "type": "string", + "format": "date-time", + "description": "Date of creation of the archive." }, - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScalingTarget" - } + "deleted_at": { + "type": "string", + "format": "date-time", + "description": "This field is automatically set by Koyeb when the\narchive is garbage collected." } } }, - "DeploymentScalingTarget": { + "CreateArchive": { "type": "object", "properties": { - "average_cpu": { - "$ref": "#/definitions/DeploymentScalingTargetAverageCPU" - }, - "average_mem": { - "$ref": "#/definitions/DeploymentScalingTargetAverageMem" - }, - "requests_per_second": { - "$ref": "#/definitions/DeploymentScalingTargetRequestsPerSecond" - }, - "concurrent_requests": { - "$ref": "#/definitions/DeploymentScalingTargetConcurrentRequests" - }, - "requests_response_time": { - "$ref": "#/definitions/DeploymentScalingTargetRequestsResponseTime" + "size": { + "type": "string", + "format": "uint64", + "description": "How much space to provision for the archive, in bytes." }, - "sleep_idle_delay": { - "$ref": "#/definitions/DeploymentScalingTargetSleepIdleDelay" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the archive" } } }, - "DeploymentScalingTargetAverageCPU": { + "CreateArchiveReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "archive": { + "$ref": "#/definitions/Archive" } } }, - "DeploymentScalingTargetAverageMem": { + "GetInstanceReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "instance": { + "$ref": "#/definitions/Instance" } } }, - "DeploymentScalingTargetConcurrentRequests": { + "InstanceEvent": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "id": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "DeploymentScalingTargetRequestsPerSecond": { + "InstanceListItem": { "type": "object", "properties": { - "value": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "allocation_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "replica_index": { "type": "integer", "format": "int64" + }, + "region": { + "type": "string" + }, + "datacenter": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Instance.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "xyz_deployment_id": { + "type": "string", + "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." } } }, - "DeploymentScalingTargetRequestsResponseTime": { + "ListInstanceEventsReply": { "type": "object", "properties": { - "value": { + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceEvent" + }, + "title": "The collection of events" + }, + "limit": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The limit in the request" }, - "quantile": { + "offset": { "type": "integer", "format": "int64", - "description": "The quantile to use for autoscaling. For example, set to 95 to use the 95th\npercentile (p95) for autoscaling. Valid values are between 0 and 100." + "title": "The offset in the request" + }, + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "DeploymentScalingTargetSleepIdleDelay": { + "ListInstancesReply": { "type": "object", "properties": { - "value": { + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceListItem" + }, + "title": "The collection of instances" + }, + "limit": { "type": "integer", "format": "int64", - "description": "DEPRECATED: use deep_sleep_value instead.\nDelay in seconds after which a service which received 0 request is put to deep sleep." + "title": "The limit in the request" }, - "deep_sleep_value": { + "offset": { "type": "integer", "format": "int64", - "description": "Delay in seconds after which a service which received 0 request is put to deep sleep." + "title": "The offset in the request" }, - "light_sleep_value": { + "count": { "type": "integer", "format": "int64", - "description": "Delay in seconds after which a service which received 0 request is put to light sleep." + "title": "The total number of items" + }, + "order": { + "type": "string", + "title": "The order in the request" } } }, - "DeploymentStrategy": { + "CreateSnapshotReply": { "type": "object", "properties": { - "type": { - "$ref": "#/definitions/DeploymentStrategyType", - "title": "Strategy type" + "snapshot": { + "$ref": "#/definitions/Snapshot" } } }, - "DeploymentStrategyType": { - "type": "string", - "enum": [ - "DEPLOYMENT_STRATEGY_TYPE_INVALID", - "DEPLOYMENT_STRATEGY_TYPE_DEFAULT", - "DEPLOYMENT_STRATEGY_TYPE_CANARY", - "DEPLOYMENT_STRATEGY_TYPE_ROLLING", - "DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN", - "DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE" - ], - "default": "DEPLOYMENT_STRATEGY_TYPE_INVALID", - "description": " - DEPLOYMENT_STRATEGY_TYPE_INVALID: DEPRECATED: Use DEPLOYMENT_STRATEGY_TYPE_DEFAULT instead.\n - DEPLOYMENT_STRATEGY_TYPE_DEFAULT: Default/unspecified strategy (resolves to platform default, currently ROLLING).\n - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy.\n - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy.\n - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy.\n - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy." - }, - "DeploymentVolume": { + "CreateSnapshotRequest": { "type": "object", "properties": { - "id": { + "parent_volume_id": { "type": "string", - "title": "the id of the volume" + "title": "The id of the volume to snapshot" }, - "path": { + "name": { "type": "string", - "title": "the path where the volume is mounted to" - }, - "replica_index": { - "type": "integer", - "format": "int64", - "title": "optionally, explicitly choose the replica index to mount the volume to" + "title": "The name of the snapshot" }, - "scopes": { - "type": "array", - "items": { - "type": "string" - }, - "title": "scope of the associated" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the snapshot" } } }, - "DesiredDeployment": { + "DeleteSnapshotReply": { "type": "object", "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/DesiredDeployment.Group" - } + "snapshot": { + "$ref": "#/definitions/Snapshot" } } }, - "DesiredDeployment.Group": { + "GetSnapshotReply": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "deployment_ids": { - "type": "array", - "items": { - "type": "string" - } + "snapshot": { + "$ref": "#/definitions/Snapshot" } } }, - "DockerBuilder": { + "ListSnapshotsReply": { "type": "object", "properties": { - "dockerfile": { - "type": "string", - "title": "A path to the Dockerfile" - }, - "entrypoint": { + "snapshots": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/Snapshot" }, - "title": "The docker ENTRYPOINT" - }, - "command": { - "type": "string", - "title": "The docker CMD" + "title": "The collection of snapshots" }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The docker CMD args" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "target": { - "type": "string", - "title": "The target for multi-stage builds" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "privileged": { + "has_next": { "type": "boolean", - "title": "A flag to run the container in privileged mode" + "title": "If there is more items after in the collection" } } }, - "DockerSource": { + "Snapshot": { "type": "object", "properties": { - "image": { - "type": "string" + "id": { + "type": "string", + "title": "the identifier of the snapshot object" }, - "command": { - "type": "string" + "name": { + "type": "string", + "title": "the snapshot name" }, - "args": { - "type": "array", - "items": { - "type": "string" - } + "size": { + "type": "integer", + "format": "int64", + "title": "the original volume size" }, - "image_registry_secret": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time", + "title": "creation timestamp" }, - "entrypoint": { - "type": "array", - "items": { - "type": "string" - } + "updated_at": { + "type": "string", + "format": "date-time", + "title": "last change timestamp" }, - "privileged": { - "type": "boolean", - "title": "A flag to run the container in privileged mode" + "deleted_at": { + "type": "string", + "format": "date-time", + "title": "deletion timestamp" + }, + "organization_id": { + "type": "string", + "title": "the organization to which the snapshot belongs to" + }, + "parent_volume_id": { + "type": "string", + "title": "the volume from which the snapshot has been created" + }, + "region": { + "type": "string", + "title": "the region where the snapshot resides, if any" + }, + "status": { + "$ref": "#/definitions/SnapshotStatus", + "title": "the status of the snapshot" + }, + "type": { + "$ref": "#/definitions/SnapshotType", + "title": "the type of snapshot (can be local or remote)" + } + }, + "description": "The object that represents a snapshot. It can either be local, on a node, or remote, in a cold storage." + }, + "SnapshotStatus": { + "type": "string", + "enum": [ + "SNAPSHOT_STATUS_INVALID", + "SNAPSHOT_STATUS_CREATING", + "SNAPSHOT_STATUS_AVAILABLE", + "SNAPSHOT_STATUS_MIGRATING", + "SNAPSHOT_STATUS_DELETING", + "SNAPSHOT_STATUS_DELETED" + ], + "default": "SNAPSHOT_STATUS_INVALID", + "title": "- SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted" + }, + "SnapshotType": { + "type": "string", + "enum": [ + "SNAPSHOT_TYPE_INVALID", + "SNAPSHOT_TYPE_LOCAL", + "SNAPSHOT_TYPE_REMOTE" + ], + "default": "SNAPSHOT_TYPE_INVALID", + "title": "- SNAPSHOT_TYPE_INVALID: zero value, invalid\n - SNAPSHOT_TYPE_LOCAL: the snapshot is local to the machine\n - SNAPSHOT_TYPE_REMOTE: the snapshot is remote in a cold storage" + }, + "UpdateSnapshotReply": { + "type": "object", + "properties": { + "snapshot": { + "$ref": "#/definitions/Snapshot" } } }, - "Domain": { + "AzureContainerRegistryConfiguration": { "type": "object", "properties": { - "id": { + "registry_name": { "type": "string" }, - "organization_id": { + "username": { "type": "string" }, + "password": { + "type": "string" + } + } + }, + "CreateSecret": { + "type": "object", + "properties": { "name": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "status": { - "$ref": "#/definitions/Domain.Status" - }, "type": { - "$ref": "#/definitions/Domain.Type" + "$ref": "#/definitions/SecretType" }, - "app_id": { + "value": { "type": "string" }, - "deployment_group": { - "type": "string" + "docker_hub_registry": { + "$ref": "#/definitions/DockerHubRegistryConfiguration" }, - "verified_at": { - "type": "string", - "format": "date-time" + "private_registry": { + "$ref": "#/definitions/PrivateRegistryConfiguration" }, - "intended_cname": { - "type": "string" + "digital_ocean_registry": { + "$ref": "#/definitions/DigitalOceanRegistryConfiguration" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "github_registry": { + "$ref": "#/definitions/GitHubRegistryConfiguration" }, - "version": { - "type": "string", - "format": "uint64" + "gitlab_registry": { + "$ref": "#/definitions/GitLabRegistryConfiguration" }, - "cloudflare": { - "$ref": "#/definitions/Domain.LoadBalancerCloudflare" + "gcp_container_registry": { + "$ref": "#/definitions/GCPContainerRegistryConfiguration" }, - "koyeb": { - "$ref": "#/definitions/Domain.LoadBalancerKoyeb" + "azure_container_registry": { + "$ref": "#/definitions/AzureContainerRegistryConfiguration" }, "project_id": { "type": "string", - "description": "The project ID this domain belongs to. Empty if the domain is organization-level." + "title": "(Optional) The project ID to associate with the secret" } } }, - "Domain.LoadBalancerCloudflare": { - "type": "object" - }, - "Domain.LoadBalancerKoyeb": { + "CreateSecretReply": { "type": "object", "properties": { - "request_timeout_seconds": { - "type": "integer", - "format": "int64", - "title": "Between 100 and 900" + "secret": { + "$ref": "#/definitions/Secret" } } }, - "Domain.Status": { - "type": "string", - "enum": [ - "PENDING", - "ACTIVE", - "ERROR", - "DELETING", - "DELETED" - ], - "default": "PENDING" + "DatabaseRolePassword": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } }, - "Domain.Type": { - "type": "string", - "enum": [ - "AUTOASSIGNED", - "CUSTOM" - ], - "default": "AUTOASSIGNED", - "title": "- AUTOASSIGNED: Domain like -.koyeb.app" + "DeleteSecretReply": { + "type": "object" }, - "GitSource": { + "DigitalOceanRegistryConfiguration": { "type": "object", "properties": { - "repository": { - "type": "string", - "description": "A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test." - }, - "branch": { - "type": "string", - "title": "A git branch that will be tracked for new commits and deployments will be created" - }, - "tag": { - "type": "string", - "title": "A git tag that should be built" - }, - "sha": { - "type": "string", - "title": "A git commit that should be built (useful for pinning to a commit, this will always be set when a deployment is created by a code push)" - }, - "build_command": { - "type": "string", - "title": "A command used to override the build command, run after all build steps \u2014 deprecated, use buildpack.build_command instead" - }, - "run_command": { - "type": "string", - "title": "A command used to override the default run command - deprecated, use buildpack.run_command instead" - }, - "no_deploy_on_push": { - "type": "boolean", - "title": "A flag to disable a new deployment when a push event is detected" - }, - "workdir": { - "type": "string", - "title": "A subdirectory to use as the build directory" - }, - "buildpack": { - "$ref": "#/definitions/BuildpackBuilder" + "username": { + "type": "string" }, - "docker": { - "$ref": "#/definitions/DockerBuilder" + "password": { + "type": "string" } } }, - "HTTPHeader": { + "DockerHubRegistryConfiguration": { "type": "object", "properties": { - "key": { + "username": { "type": "string" }, - "value": { + "password": { "type": "string" } } }, - "HTTPHealthCheck": { + "GCPContainerRegistryConfiguration": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64", - "title": "The port to use to perform the health check, must be declared in the ports section" - }, - "path": { - "type": "string", - "title": "The path to use to perform the HTTP health check" - }, - "method": { - "type": "string", - "title": "An optional HTTP method to use to perform the health check, default is GET" + "keyfile_content": { + "type": "string" }, - "headers": { - "type": "array", - "items": { - "$ref": "#/definitions/HTTPHeader" - }, - "title": "An optional list of HTTP headers to provide when performing the request, default is empty" + "url": { + "type": "string" } } }, - "NeonPostgresDatabase": { + "GetSecretReply": { "type": "object", "properties": { - "pg_version": { - "type": "integer", - "format": "int64" - }, - "region": { + "secret": { + "$ref": "#/definitions/Secret" + } + } + }, + "GitHubRegistryConfiguration": { + "type": "object", + "properties": { + "username": { "type": "string" }, - "instance_type": { + "password": { "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/NeonPostgresDatabase.NeonRole" - } - }, - "databases": { - "type": "array", - "items": { - "$ref": "#/definitions/NeonPostgresDatabase.NeonDatabase" - } } } }, - "NeonPostgresDatabase.NeonDatabase": { + "GitLabRegistryConfiguration": { "type": "object", "properties": { - "name": { + "username": { "type": "string" }, - "owner": { + "password": { "type": "string" } } }, - "NeonPostgresDatabase.NeonRole": { + "ListSecretsReply": { "type": "object", "properties": { - "name": { + "secrets": { + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + } + }, + "limit": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "count": { + "type": "integer", + "format": "int64" + } + } + }, + "PrivateRegistryConfiguration": { + "type": "object", + "properties": { + "username": { "type": "string" }, - "secret": { + "password": { + "type": "string" + }, + "url": { "type": "string" } } }, - "ProxyPortProtocol": { - "type": "string", - "enum": [ - "tcp" - ], - "default": "tcp" + "RevealSecretReply": { + "type": "object", + "properties": { + "value": {} + } }, - "Service": { + "Secret": { "type": "object", "properties": { "id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" + "name": { + "type": "string" }, - "started_at": { - "type": "string", - "format": "date-time" + "organization_id": { + "type": "string" }, - "succeeded_at": { - "type": "string", - "format": "date-time" + "type": { + "$ref": "#/definitions/SecretType" }, - "paused_at": { + "updated_at": { "type": "string", "format": "date-time" }, - "resumed_at": { + "created_at": { "type": "string", "format": "date-time" }, - "terminated_at": { + "project_id": { "type": "string", - "format": "date-time" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/Service.Type" - }, - "organization_id": { - "type": "string" + "description": "The project ID this secret belongs to. Empty if the secret is organization-level." }, - "app_id": { + "value": { "type": "string" }, - "status": { - "$ref": "#/definitions/Service.Status" + "docker_hub_registry": { + "$ref": "#/definitions/DockerHubRegistryConfiguration" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "private_registry": { + "$ref": "#/definitions/PrivateRegistryConfiguration" }, - "version": { - "type": "string", - "format": "uint64" + "digital_ocean_registry": { + "$ref": "#/definitions/DigitalOceanRegistryConfiguration" }, - "active_deployment_id": { - "type": "string" + "github_registry": { + "$ref": "#/definitions/GitHubRegistryConfiguration" }, - "latest_deployment_id": { - "type": "string" + "gitlab_registry": { + "$ref": "#/definitions/GitLabRegistryConfiguration" }, - "last_provisioned_deployment_id": { - "type": "string" + "gcp_container_registry": { + "$ref": "#/definitions/GCPContainerRegistryConfiguration" }, - "state": { - "$ref": "#/definitions/ServiceState", - "title": "Legacy stuff" + "azure_container_registry": { + "$ref": "#/definitions/AzureContainerRegistryConfiguration" }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" + "database_role_password": { + "$ref": "#/definitions/DatabaseRolePassword" } } }, - "Service.Status": { - "type": "string", - "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" - ], - "default": "STARTING" - }, - "Service.Type": { + "SecretType": { "type": "string", "enum": [ - "INVALID_TYPE", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" + "SIMPLE", + "REGISTRY", + "MANAGED" ], - "default": "INVALID_TYPE" - }, - "ServiceLifeCycle": { - "type": "object", - "properties": { - "delete_after_sleep": { - "type": "integer", - "format": "int64" - }, - "delete_after_create": { - "type": "integer", - "format": "int64" - } - } - }, - "ServiceState": { - "type": "object", - "properties": { - "desired_deployment": { - "$ref": "#/definitions/DesiredDeployment" - }, - "auto_release": { - "$ref": "#/definitions/AutoRelease" - } - } + "default": "SIMPLE" }, - "TCPHealthCheck": { + "UpdateSecretReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64", - "title": "The port to use to perform the health check, must be declared in the ports section" + "secret": { + "$ref": "#/definitions/Secret" } } }, @@ -17356,34 +18140,92 @@ } } }, - "AppEvent": { + "ReviewOrganizationCapacityReply": { "type": "object", "properties": { - "id": { + "has_capacity": { + "type": "boolean" + } + } + }, + "ReviewOrganizationCapacityRequest": { + "type": "object", + "properties": { + "plan": { "type": "string" }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" + "trialing": { + "type": "boolean" + } + } + }, + "ComposeReply": { + "type": "object", + "properties": { + "app": { + "$ref": "#/definitions/App" }, - "app_id": { - "type": "string" + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/Service" + } + } + } + }, + "CreateCompose": { + "type": "object", + "properties": { + "app": { + "$ref": "#/definitions/CreateApp" }, - "type": { + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateService" + } + } + } + }, + "CreateInstanceSnapshotReply": { + "type": "object", + "properties": { + "instance_snapshot": { + "$ref": "#/definitions/InstanceSnapshot" + } + } + }, + "CreateInstanceSnapshotRequest": { + "type": "object", + "properties": { + "instance_id": { "type": "string" }, - "message": { + "name": { "type": "string" }, - "metadata": { - "type": "object" + "type": { + "$ref": "#/definitions/InstanceSnapshotType" } } }, - "AppListItem": { + "DeleteInstanceSnapshotReply": { + "type": "object", + "properties": { + "instance_snapshot": { + "$ref": "#/definitions/InstanceSnapshot" + } + } + }, + "GetInstanceSnapshotReply": { + "type": "object", + "properties": { + "instance_snapshot": { + "$ref": "#/definitions/InstanceSnapshot" + } + } + }, + "InstanceSnapshot": { "type": "object", "properties": { "id": { @@ -17392,25 +18234,49 @@ "name": { "type": "string" }, - "organization_id": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, - "created_at": { + "available_at": { "type": "string", "format": "date-time" }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/Domain" - } + "deleted_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "project_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "instance_id": { + "type": "string" }, "status": { - "$ref": "#/definitions/App.Status" + "$ref": "#/definitions/InstanceSnapshotStatus" + }, + "type": { + "$ref": "#/definitions/InstanceSnapshotType" + }, + "version": { + "type": "string", + "format": "uint64" }, "messages": { "type": "array", @@ -17420,34 +18286,61 @@ } } }, - "CreateAppReply": { + "InstanceSnapshotEvent": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The entity created" + "id": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "instance_snapshot_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "DeleteAppReply": { - "type": "object" + "InstanceSnapshotStatus": { + "type": "string", + "enum": [ + "INSTANCE_SNAPSHOT_STATUS_INVALID", + "INSTANCE_SNAPSHOT_STATUS_CREATING", + "INSTANCE_SNAPSHOT_STATUS_AVAILABLE", + "INSTANCE_SNAPSHOT_STATUS_ERROR", + "INSTANCE_SNAPSHOT_STATUS_DELETING", + "INSTANCE_SNAPSHOT_STATUS_DELETED" + ], + "default": "INSTANCE_SNAPSHOT_STATUS_INVALID" }, - "GetAppReply": { - "type": "object", - "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The App retrieved" - } - } + "InstanceSnapshotType": { + "type": "string", + "enum": [ + "INSTANCE_SNAPSHOT_TYPE_INVALID", + "INSTANCE_SNAPSHOT_TYPE_FILESYSTEM", + "INSTANCE_SNAPSHOT_TYPE_FULL" + ], + "default": "INSTANCE_SNAPSHOT_TYPE_INVALID" }, - "ListAppEventsReply": { + "ListInstanceSnapshotEventsReply": { "type": "object", "properties": { "events": { "type": "array", "items": { - "$ref": "#/definitions/AppEvent" + "$ref": "#/definitions/InstanceSnapshotEvent" }, "title": "The collection of events" }, @@ -17471,540 +18364,585 @@ } } }, - "ListAppsReply": { + "ListInstanceSnapshotsReply": { "type": "object", "properties": { - "apps": { + "instance_snapshots": { "type": "array", "items": { - "$ref": "#/definitions/AppListItem" + "$ref": "#/definitions/InstanceSnapshot" } }, "limit": { "type": "integer", - "format": "int64", - "title": "The limit in the request" + "format": "int64" }, "offset": { "type": "integer", - "format": "int64", - "title": "The offset in the request" + "format": "int64" }, "count": { "type": "integer", - "format": "int64", - "title": "The total number of items" + "format": "int64" }, "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "type": "boolean" } } }, - "PauseAppReply": { - "type": "object" - }, - "ResumeAppReply": { + "ktest.TestAnonReply": { "type": "object" }, - "UpdateApp": { + "ktest.TestAuthReply": { "type": "object", "properties": { - "name": { + "payload": { "type": "string" }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" + "user_id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "workspace_id": { + "type": "string" } } }, - "UpdateAppReply": { + "ktest.TestAuthRequest": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The entity updated" + "payload": { + "type": "string" } } }, - "ArchiveDeploymentMetadata": { + "LogEntry": { "type": "object", "properties": { - "last_provisioned_deployment_id": { + "msg": { "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "labels": { + "type": "object" } } }, - "AutocompleteReply": { + "QueryLogsReply": { "type": "object", "properties": { - "secrets": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of available secrets" - }, - "user_env": { + "data": { "type": "array", "items": { - "type": "string" - }, - "title": "List of available user's environment variables" + "$ref": "#/definitions/LogEntry" + } }, - "system_env": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of available system's environment variables" + "pagination": { + "$ref": "#/definitions/QueryLogsReplyPagination" } } }, - "AutocompleteRequest": { + "QueryLogsReplyPagination": { "type": "object", "properties": { - "definition": { - "$ref": "#/definitions/DeploymentDefinition", - "title": "Deployment definition" + "has_more": { + "type": "boolean" + }, + "next_start": { + "type": "string", + "format": "date-time" + }, + "next_end": { + "type": "string", + "format": "date-time" } } }, - "CreateServiceReply": { + "GetMetricsReply": { "type": "object", "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The entity created" + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/GetMetricsReply.Metric" + } } } }, - "DatabaseDeploymentMetadata": { + "GetMetricsReply.Metric": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresDatabaseDeploymentMetadata" + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "samples": { + "type": "array", + "items": { + "$ref": "#/definitions/Sample" + } } } }, - "DeleteServiceReply": { - "type": "object" - }, - "DeleteServiceScalingReply": { - "type": "object", - "title": "Empty reply - success is indicated by no error" + "MetricName": { + "type": "string", + "enum": [ + "UNKNOWN", + "CPU_TOTAL_PERCENT", + "MEM_RSS", + "HTTP_THROUGHPUT", + "HTTP_RESPONSE_TIME_50P", + "HTTP_RESPONSE_TIME_90P", + "HTTP_RESPONSE_TIME_99P", + "HTTP_RESPONSE_TIME_MAX", + "PUBLIC_DATA_TRANSFER_IN", + "PUBLIC_DATA_TRANSFER_OUT" + ], + "default": "UNKNOWN" }, - "Deployment": { + "Sample": { "type": "object", "properties": { - "id": { + "timestamp": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "allocated_at": { - "type": "string", - "format": "date-time" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { + "value": { + "type": "number", + "format": "double" + } + } + }, + "ExecCommandIO": { + "type": "object", + "properties": { + "data": { "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "parent_id": { - "type": "string" - }, - "child_id": { - "type": "string" + "format": "byte", + "description": "Data is base64 encoded" }, - "status": { - "$ref": "#/definitions/Deployment.Status" + "close": { + "type": "boolean", + "description": "Indicate last data frame" + } + } + }, + "ExecCommandReply": { + "type": "object", + "properties": { + "stdout": { + "$ref": "#/definitions/ExecCommandIO" }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" + "stderr": { + "$ref": "#/definitions/ExecCommandIO" }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" + "exited": { + "type": "boolean" }, - "messages": { + "exit_code": { + "type": "integer", + "format": "int32" + } + } + }, + "ExecCommandRequest.Body": { + "type": "object", + "properties": { + "command": { "type": "array", "items": { "type": "string" - } - }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" - }, - "database_info": { - "$ref": "#/definitions/DeploymentDatabaseInfo" - }, - "skip_build": { - "type": "boolean" + }, + "description": "Command to exec. Mandatory in the first frame sent" }, - "role": { - "$ref": "#/definitions/Deployment.Role" + "tty_size": { + "$ref": "#/definitions/ExecCommandRequest.TerminalSize" }, - "version": { - "type": "string", - "format": "uint64" + "stdin": { + "$ref": "#/definitions/ExecCommandIO" }, - "deployment_group": { - "type": "string" + "disableTty": { + "type": "boolean", + "description": "Disable TTY. It's enough to specify it in the first frame" } } }, - "Deployment.Role": { + "ExecCommandRequest.IdType": { "type": "string", "enum": [ "INVALID", - "ACTIVE", - "UPCOMING", - "CURRENT" + "INSTANCE_ID", + "SERVICE_ID" ], "default": "INVALID" }, - "Deployment.Status": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "STASHED", - "SLEEPING" - ], - "default": "PENDING" + "ExecCommandRequest.TerminalSize": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "width": { + "type": "integer", + "format": "int32" + } + } }, - "DeploymentDatabaseInfo": { + "AcceptOrganizationInvitationReply": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfo" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation accepted" } } }, - "DeploymentMetadata": { + "Action": { + "type": "string", + "enum": [ + "signin", + "signup", + "register" + ], + "default": "signin" + }, + "Budget": { "type": "object", "properties": { - "trigger": { - "$ref": "#/definitions/TriggerDeploymentMetadata" - }, - "database": { - "$ref": "#/definitions/DatabaseDeploymentMetadata" - }, - "git": { - "$ref": "#/definitions/GitDeploymentMetadata" - }, - "archive": { - "$ref": "#/definitions/ArchiveDeploymentMetadata" + "amount": { + "type": "string", + "format": "int64" }, - "proxy_ports": { + "thresholds": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentProxyPortMetadata" + "type": "string", + "format": "int64" } - }, - "sandbox": { - "$ref": "#/definitions/SandboxMetadata" } } }, - "DeploymentNeonPostgresDatabaseInfo": { + "CannyAuthReply": { "type": "object", "properties": { - "active_time_seconds": { - "type": "string", - "format": "int64" - }, - "compute_time_seconds": { - "type": "string", - "format": "int64" - }, - "written_data_bytes": { - "type": "string", - "format": "int64" - }, - "data_transfer_bytes": { - "type": "string", - "format": "int64" - }, - "data_storage_bytes_hour": { - "type": "string", - "format": "int64" - }, - "server_host": { + "token": { "type": "string" - }, - "server_port": { - "type": "integer", - "format": "int64" - }, - "endpoint_state": { + } + } + }, + "CannyAuthRequest": { + "type": "object" + }, + "ClearIdenfyVerificationResultReply": { + "type": "object" + }, + "ClearIdenfyVerificationResultRequest": { + "type": "object", + "properties": { + "user_id": { "type": "string" }, - "endpoint_last_active": { - "type": "string", - "format": "date-time" - }, - "default_branch_id": { + "organization_id": { "type": "string" - }, - "default_branch_name": { + } + } + }, + "CreateAccessTokenReply": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "CreateAccountRequest": { + "type": "object", + "example": { + "email": "john@snow.com", + "password": "..." + }, + "properties": { + "email": { "type": "string" }, - "default_branch_state": { + "password": { "type": "string" }, - "default_branch_logical_size": { - "type": "string", - "format": "int64" + "name": { + "type": "string" }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfoRole" - } + "captcha": { + "type": "string" + } + }, + "description": "Create new account", + "title": "Create new account", + "required": [ + "email", + "password" + ] + }, + "CreateBudgetReply": { + "type": "object", + "properties": { + "budget": { + "$ref": "#/definitions/Budget" } } }, - "DeploymentNeonPostgresDatabaseInfoRole": { + "CreateOrganizationReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" + } + } + }, + "CreateOrganizationRequest": { "type": "object", "properties": { "name": { "type": "string" - }, - "secret_id": { - "type": "string" } } }, - "DeploymentProvisioningInfo": { + "DeactivateOrganizationReply": { "type": "object", "properties": { - "sha": { - "type": "string", - "description": "The git sha for this build (we resolve the reference at the start of the build)." - }, - "image": { - "type": "string", - "description": "The docker image built as a result of this build." - }, - "stages": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage" - }, - "description": "Some info about the build." + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DeploymentProvisioningInfo.Stage": { + "DeclineOrganizationInvitationReply": { "type": "object", "properties": { - "name": { + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation declined" + } + } + }, + "DeleteBudgetReply": { + "type": "object" + }, + "DeleteOrganizationReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" + } + } + }, + "DiscourseAuthReply": { + "type": "object", + "properties": { + "sso": { "type": "string" }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "finished_at": { - "type": "string", - "format": "date-time" + "sig": { + "type": "string" + } + } + }, + "DiscourseAuthRequest": { + "type": "object", + "properties": { + "payload": { + "type": "string" }, - "build_attempts": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt" - } + "sig": { + "type": "string" } } }, - "DeploymentProvisioningInfo.Stage.BuildAttempt": { + "GetBudgetReply": { "type": "object", "properties": { - "id": { - "type": "integer", - "format": "int64" + "budget": { + "$ref": "#/definitions/Budget" + } + } + }, + "GetGithubInstallationReply": { + "type": "object", + "properties": { + "installation_id": { + "type": "string" + }, + "installation_url": { + "type": "string" + }, + "name": { + "type": "string" }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + "avatar_url": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "status": { + "$ref": "#/definitions/kgitproxy.GithubInstallation.Status" }, - "started_at": { + "installed_at": { "type": "string", "format": "date-time" }, - "finished_at": { + "suspended_at": { "type": "string", "format": "date-time" }, - "steps": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep" - } - }, - "image_pushed": { - "type": "boolean" - }, - "internal_failure": { - "type": "boolean" + "indexing_status": { + "$ref": "#/definitions/kgitproxy.IndexingStatus" }, - "retryable_failure": { - "type": "boolean" + "indexed_repositories": { + "type": "integer", + "format": "int64" }, - "wait_completion": { - "type": "boolean", - "description": "This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure." + "total_repositories": { + "type": "integer", + "format": "int64" } } }, - "DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep": { + "GetIdenfyTokenReply": { "type": "object", "properties": { - "name": { + "auth_token": { "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "messages": { + } + } + }, + "GetOAuthOptionsReply": { + "type": "object", + "properties": { + "oauth_providers": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/OAuthProvider" } - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "finished_at": { - "type": "string", - "format": "date-time" + } + }, + "description": "A list of providers which you can use for single sign-on." + }, + "GetOrganizationReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DeploymentProxyPortMetadata": { + "GetUserOrganizationInvitationReply": { "type": "object", "properties": { - "host": { - "type": "string" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation" + } + } + }, + "GetUserSettingsReply": { + "type": "object", + "properties": { + "settings": { + "$ref": "#/definitions/UserSettings" + } + } + }, + "GithubInstallationReply": { + "type": "object", + "properties": { + "app_name": { + "type": "string", + "title": "The github app name" }, - "public_port": { - "type": "integer", - "format": "int64" + "app_id": { + "type": "string", + "format": "int64", + "title": "The github app id" }, - "port": { - "type": "integer", - "format": "int64" + "url": { + "type": "string", + "title": "The url to start the installation flow" }, - "protocol": { - "$ref": "#/definitions/ProxyPortProtocol" + "state": { + "type": "string", + "title": "The state required by the protocol, it is only valid 10 minutes and encodes\ninformation about the type of flow" } } }, - "GetServiceReply": { + "GithubInstallationRequest": { "type": "object", "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The Service retrieved" + "metadata": { + "type": "string", + "title": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state" } } }, - "GetServiceScalingReply": { + "HasUnpaidInvoicesReply": { "type": "object", "properties": { - "scalings": { - "type": "array", - "items": { - "$ref": "#/definitions/ManualServiceScaling" - }, - "title": "The current manual scaling configuration" + "has_unpaid_invoices": { + "type": "boolean" } } }, - "GitDeploymentMetadata": { + "InviteUserRequest": { "type": "object", "properties": { - "last_provisioned_deployment_id": { + "email": { "type": "string" }, - "git_env": { - "$ref": "#/definitions/GitEnvDeploymentMetadata" + "name": { + "type": "string" + }, + "message": { + "type": "string" } } }, - "GitEnvDeploymentMetadata": { + "ListUserOrganizationInvitationsReply": { "type": "object", "properties": { - "sha": { - "type": "string" + "invitations": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationInvitation" + }, + "title": "The collection of organization invitations" }, - "commit_author": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "commit_message": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "ListServiceEventsReply": { + "ListUserOrganizationsReply": { "type": "object", "properties": { - "events": { + "organizations": { "type": "array", "items": { - "$ref": "#/definitions/ServiceEvent" + "$ref": "#/definitions/Organization" }, - "title": "The collection of events" + "title": "The collection of organizations" }, "limit": { "type": "integer", @@ -18016,1069 +18954,1050 @@ "format": "int64", "title": "The offset in the request" }, - "order": { - "type": "string", - "title": "The order in the request" - }, "has_next": { "type": "boolean", "title": "If there is more items after in the collection" } } }, - "ListServicesReply": { + "LoginMethodReply": { "type": "object", "properties": { - "services": { + "method": { + "$ref": "#/definitions/LoginMethodReply.Method" + } + } + }, + "LoginMethodReply.Method": { + "type": "string", + "enum": [ + "KOYEB", + "WORKOS" + ], + "default": "KOYEB" + }, + "LoginReply": { + "type": "object", + "properties": { + "token": { + "$ref": "#/definitions/Token" + } + } + }, + "ManageReply": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "NextInvoiceReply": { + "type": "object", + "properties": { + "stripe_invoice": { + "type": "object" + }, + "lines": { "type": "array", "items": { - "$ref": "#/definitions/ServiceListItem" + "$ref": "#/definitions/NextInvoiceReply.Line" } }, - "limit": { + "discounts": { + "type": "array", + "items": { + "$ref": "#/definitions/NextInvoiceReply.Discount" + } + } + } + }, + "NextInvoiceReply.Discount": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/NextInvoiceReply.Discount.Type" + }, + "name": { + "type": "string" + }, + "amount": { + "type": "string", + "format": "int64" + } + } + }, + "NextInvoiceReply.Discount.Type": { + "type": "string", + "enum": [ + "PERCENT_OFF", + "AMOUNT_OFF" + ], + "default": "PERCENT_OFF" + }, + "NextInvoiceReply.Line": { + "type": "object", + "properties": { + "amount_excluding_tax": { "type": "integer", - "format": "int64", - "title": "The limit in the request" + "format": "int32" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "period": { + "$ref": "#/definitions/NextInvoiceReply.Line.Period" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "plan_nickname": { + "type": "string" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "price": { + "$ref": "#/definitions/NextInvoiceReply.Line.Price" + }, + "quantity": { + "type": "integer", + "format": "int32" } } }, - "ManualServiceScaling": { + "NextInvoiceReply.Line.Period": { "type": "object", "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } + "start": { + "type": "string", + "format": "date-time" }, - "instances": { - "type": "integer", - "format": "int64" + "end": { + "type": "string", + "format": "date-time" } } }, - "NeonPostgresDatabaseDeploymentMetadata": { + "NextInvoiceReply.Line.Price": { "type": "object", "properties": { - "reset_role_passwords": { - "type": "array", - "items": { - "type": "string" - } + "unit_amount_decimal": { + "type": "number", + "format": "double" } } }, - "PauseServiceReply": { - "type": "object" - }, - "RedeployReply": { + "OAuthCallbackReply": { "type": "object", "properties": { - "deployment": { - "$ref": "#/definitions/Deployment", - "title": "The entity updated" + "token": { + "$ref": "#/definitions/Token", + "title": "A jwt token to be used for session" } } }, - "RedeployRequest.Info": { + "OAuthCallbackRequest": { "type": "object", "properties": { - "deployment_group": { - "type": "string" + "state": { + "type": "string", + "title": "The state created at the origin of the OAuth flow" }, - "sha": { - "type": "string" + "code": { + "type": "string", + "title": "The code returned by the OAuth provider" }, - "use_cache": { - "type": "boolean" + "setup_action": { + "type": "string", + "description": "setup_action is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." }, - "skip_build": { - "type": "boolean", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + "installation_id": { + "type": "string", + "description": "installation_id is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." } } }, - "ResumeServiceReply": { - "type": "object" - }, - "SandboxMetadata": { + "OAuthProvider": { "type": "object", "properties": { - "public_url": { - "type": "string" + "id": { + "type": "string", + "title": "The name of the provider (.e.g github, google)" }, - "routing_key": { - "type": "string" + "url": { + "type": "string", + "title": "The URL to call to initiate the OAuth flow" + }, + "state": { + "type": "string", + "title": "The OAuth state required by the protocol, it is only valid 10 minutes and\nencodes information about the type of flow" } } }, - "ServiceEvent": { + "Organization": { "type": "object", "properties": { "id": { "type": "string" }, - "when": { - "type": "string", - "format": "date-time" + "external_id": { + "type": "string" }, - "organization_id": { + "provisioning": { + "type": "boolean" + }, + "address1": { "type": "string" }, - "service_id": { + "address2": { "type": "string" }, - "type": { + "city": { "type": "string" }, - "message": { + "postal_code": { "type": "string" }, - "metadata": { - "type": "object" - } - } - }, - "ServiceListItem": { - "type": "object", - "properties": { - "id": { + "state": { + "type": "string" + }, + "country": { + "type": "string" + }, + "company": { + "type": "boolean" + }, + "vat_number": { + "type": "string" + }, + "billing_name": { + "type": "string" + }, + "billing_email": { "type": "string" }, "name": { "type": "string" }, - "type": { - "$ref": "#/definitions/Service.Type" + "plan": { + "$ref": "#/definitions/Plan" }, - "organization_id": { + "plan_updated_at": { + "type": "string", + "format": "date-time" + }, + "has_payment_method": { + "type": "boolean" + }, + "subscription_id": { "type": "string" }, - "app_id": { + "current_subscription_id": { "type": "string" }, - "updated_at": { + "latest_subscription_id": { + "type": "string" + }, + "signup_qualification": { + "type": "object" + }, + "status": { + "$ref": "#/definitions/Organization.Status" + }, + "status_message": { + "$ref": "#/definitions/OrganizationDetailedStatus" + }, + "deactivation_reason": { + "$ref": "#/definitions/Organization.DeactivationReason" + }, + "verified": { + "type": "boolean" + }, + "qualifies_for_hobby23": { + "type": "boolean" + }, + "reprocess_after": { "type": "string", "format": "date-time" }, - "created_at": { + "trialing": { + "type": "boolean" + }, + "trial_starts_at": { "type": "string", "format": "date-time" }, - "status": { - "$ref": "#/definitions/Service.Status" + "trial_ends_at": { + "type": "string", + "format": "date-time" }, - "messages": { + "email_domain_allowlist": { "type": "array", "items": { "type": "string" } }, - "version": { - "type": "string", - "format": "uint64", - "title": "A version updated whenever this state changes (useful for caching)" + "default_project_id": { + "type": "string" + } + }, + "title": "Represent an Organization" + }, + "Organization.DeactivationReason": { + "type": "string", + "enum": [ + "INVALID", + "REQUESTED_BY_OWNER", + "SUBSCRIPTION_TERMINATION", + "LOCKED_BY_ADMIN", + "VERIFICATION_FAILED", + "TRIAL_DID_NOT_CONVERT" + ], + "default": "INVALID" + }, + "Organization.Status": { + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ], + "default": "WARNING" + }, + "OrganizationDetailedStatus": { + "type": "string", + "enum": [ + "NEW", + "EMAIL_NOT_VALIDATED", + "BILLING_INFO_MISSING", + "LOCKED", + "PAYMENT_FAILURE", + "VALID", + "PENDING_VERIFICATION", + "VERIFICATION_FAILED", + "REVIEWING_ACCOUNT", + "PLAN_UPGRADE_REQUIRED" + ], + "default": "NEW" + }, + "OrganizationInvitation": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/UserRole.Role" }, - "state": { - "$ref": "#/definitions/ServiceState" + "status": { + "$ref": "#/definitions/OrganizationInvitation.Status" }, - "active_deployment_id": { + "expires_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { "type": "string" }, - "latest_deployment_id": { + "organization": { + "$ref": "#/definitions/PublicOrganization" + }, + "invitee_id": { "type": "string" }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" - } - } - }, - "TriggerDeploymentMetadata": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/TriggerDeploymentMetadata.TriggerType" + "invitee": { + "$ref": "#/definitions/PublicUser" }, - "actor": { - "$ref": "#/definitions/TriggerDeploymentMetadata.ActorType" + "inviter_id": { + "type": "string" }, - "git": { - "$ref": "#/definitions/TriggerGitDeploymentMetadata" + "inviter": { + "$ref": "#/definitions/PublicUser" } } }, - "TriggerDeploymentMetadata.ActorType": { + "OrganizationInvitation.Status": { "type": "string", "enum": [ - "UNKNOWN_ACTOR", - "USER", - "SYSTEM" + "INVALID", + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" ], - "default": "UNKNOWN_ACTOR" + "default": "INVALID" }, - "TriggerDeploymentMetadata.TriggerType": { + "Plan": { "type": "string", "enum": [ - "UNKNOWN_TYPE", - "GIT", - "RESUME", - "DATABASE_SYNC" + "hobby", + "starter", + "startup", + "business", + "enterprise", + "internal", + "hobby23", + "no_plan", + "pro", + "scale", + "partner_csp", + "partner_csp_unit" ], - "default": "UNKNOWN_TYPE" + "default": "hobby" }, - "TriggerGitDeploymentMetadata": { + "PublicOrganization": { "type": "object", "properties": { - "provider": { - "$ref": "#/definitions/TriggerGitDeploymentMetadata.Provider" - }, - "repository": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "sha": { + "id": { "type": "string" }, - "message": { + "name": { "type": "string" }, - "sender_username": { - "type": "string" + "plan": { + "$ref": "#/definitions/Plan" }, - "sender_avatar_url": { - "type": "string" + "status": { + "$ref": "#/definitions/Organization.Status" }, - "sender_profile_url": { + "external_id": { "type": "string" } } }, - "TriggerGitDeploymentMetadata.Provider": { - "type": "string", - "enum": [ - "UNKNOWN", - "GITHUB" - ], - "default": "UNKNOWN" - }, - "UpdateService": { + "PublicUser": { "type": "object", "properties": { - "definition": { - "$ref": "#/definitions/DeploymentDefinition" + "id": { + "type": "string" }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" + "email": { + "type": "string" }, - "skip_build": { - "type": "boolean", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + "name": { + "type": "string" }, - "save_only": { - "type": "boolean", - "title": "If set, do not trigger a deployment, only store the new settings" + "avatar_url": { + "type": "string" }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" + "github_id": { + "type": "string" + }, + "github_user": { + "type": "string" } } }, - "UpdateServiceReply": { + "ReactivateOrganizationReply": { "type": "object", "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The entity updated" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "UpdateServiceScalingReply": { - "type": "object", - "title": "Empty reply - success is indicated by no error" + "ResendEmailValidationReply": { + "type": "object" }, - "CancelDeploymentReply": { + "ResendEmailValidationRequest": { "type": "object" }, - "DeploymentEvent": { + "ResetPasswordReply": { + "type": "object" + }, + "ResetPasswordRequest": { "type": "object", + "example": { + "email": "john@snow.com" + }, "properties": { - "id": { - "type": "string" - }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "deployment_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "message": { + "email": { "type": "string" - }, - "metadata": { - "type": "object" } } }, - "DeploymentListItem": { + "Token": { "type": "object", + "example": { + "id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", + "expires": "2022-09-08T14:00:00Z", + "user_id": "996d7822-6b58-11e9-956f-32001b70f000", + "organization_id": "9f33b2c6-6b58-11e9-883c-32001b70f000" + }, "properties": { "id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "allocated_at": { - "type": "string", - "format": "date-time" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "parent_id": { + "user_id": { "type": "string" }, - "child_id": { + "organization_id": { "type": "string" }, - "status": { - "$ref": "#/definitions/Deployment.Status" - }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" - }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" - }, - "database_info": { - "$ref": "#/definitions/DeploymentDatabaseInfo" - }, - "version": { + "expires_at": { "type": "string", - "format": "uint64" - }, - "deployment_group": { - "type": "string" + "format": "date-time" } } }, - "GetDeploymentReply": { + "UnscopeOrganizationTokenRequest": { + "type": "object" + }, + "UpdateBudgetReply": { "type": "object", "properties": { - "deployment": { - "$ref": "#/definitions/Deployment" + "budget": { + "$ref": "#/definitions/Budget" } } }, - "GetDeploymentScalingReply": { + "UpdateOrganizationDefaultProjectReply": { "type": "object", "properties": { - "replicas": { - "type": "array", - "items": { - "$ref": "#/definitions/GetDeploymentScalingReplyItem" - }, - "title": "The replicas" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "GetDeploymentScalingReplyItem": { + "UpdateOrganizationNameReply": { "type": "object", "properties": { - "region": { - "type": "string", - "title": "The replica region" - }, - "replica_index": { - "type": "integer", - "format": "int64" - }, - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/Instance" - }, - "description": "An array of `active` and `starting` instances.\n\nStatus of the active instance (and if none the most recent instance)\n string status = 4;\n Status message of the active instance (and if none the most recent instance)\n string message = 5;" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "Instance": { + "UpdateOrganizationPlanReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "regional_deployment_id": { - "type": "string" - }, - "allocation_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "replica_index": { - "type": "integer", - "format": "int64" - }, - "region": { - "type": "string" - }, - "datacenter": { - "type": "string" - }, - "hypervisor": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/Instance.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" - }, - "xyz_deployment_id": { - "type": "string", - "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." + "organization": { + "$ref": "#/definitions/Organization" } } }, - "Instance.Status": { - "type": "string", - "enum": [ - "ALLOCATING", - "STARTING", - "HEALTHY", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERROR", - "SLEEPING" - ], - "default": "ALLOCATING" - }, - "ListDeploymentEventsReply": { + "UpdateOrganizationReply": { "type": "object", "properties": { - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentEvent" - }, - "title": "The collection of events" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "order": { - "type": "string", - "title": "The order in the request" - }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "ListDeploymentsReply": { + "UpdatePasswordRequest": { "type": "object", + "example": { + "id": "...", + "password": "..." + }, "properties": { - "deployments": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentListItem" - }, - "title": "The collection of deployments" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "id": { + "type": "string" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "password": { + "type": "string" } } }, - "Archive": { + "UpdateUserRequest.UserUpdateBody": { "type": "object", "properties": { "id": { - "type": "string", - "description": "The archive id, that can be referenced when creating or updating a service." + "type": "string" }, - "organization_id": { - "type": "string", - "description": "Organization owning the archive." + "email": { + "type": "string" }, - "upload_url": { - "type": "string", - "description": "The URL where to upload the archive. This URL is signed and can only be\nused to upload the archive until `valid_until`." + "current_password": { + "type": "string" }, - "size": { - "type": "string", - "format": "uint64", - "description": "The provisioned space for the archive." + "password": { + "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Date of creation of the archive." + "newsletter_subscribed": { + "type": "boolean" }, - "deleted_at": { - "type": "string", - "format": "date-time", - "description": "This field is automatically set by Koyeb when the\narchive is garbage collected." + "name": { + "type": "string" } } }, - "CreateArchive": { + "UpdateUserSettingsReply": { "type": "object", "properties": { - "size": { - "type": "string", - "format": "uint64", - "description": "How much space to provision for the archive, in bytes." - }, - "project_id": { - "type": "string", - "title": "(Optional) The project ID to associate with the archive" + "settings": { + "$ref": "#/definitions/UserSettings" } } }, - "CreateArchiveReply": { + "UpdateUserSettingsRequest": { "type": "object", "properties": { - "archive": { - "$ref": "#/definitions/Archive" + "failed_deployment_email_notification": { + "type": "boolean", + "description": "(Optional) Toggle failed deployment email notification." } } }, - "CreatePersistentVolumeReply": { + "UpsertSignupQualificationReply": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "CreatePersistentVolumeRequest": { + "User": { "type": "object", + "example": { + "id": "78352123-a06f-4ec2-81ed-27a056725385", + "email": "john@snow.com", + "name": "John Snow", + "avatar_url": "https://www.gravatar.com/avatar/00000000000000000000000000000000", + "is_admin": false, + "is_test": true, + "two_factor_authentication": false, + "last_login": "0001-01-01T00:00:00Z", + "last_login_id": "10.1.1.1", + "updated_at": "0001-01-01T00:00:00Z", + "created_at": "0001-01-01T00:00:00Z", + "newsletter_subscribed": true, + "email_validated": true + }, "properties": { - "volume_type": { - "$ref": "#/definitions/PersistentVolumeBackingStore", - "title": "the volume backing store type" + "id": { + "type": "string" }, - "name": { - "type": "string", - "title": "the volume name" + "email": { + "type": "string" }, - "region": { - "type": "string", - "title": "the volume region" + "avatar_url": { + "type": "string" }, - "read_only": { - "type": "boolean", - "title": "whether the volume must be set as read only" + "two_factor_authentication": { + "type": "boolean" }, - "max_size": { - "type": "integer", - "format": "int64", - "title": "the size of the volume (in Gigabyte / GB)" + "last_login": { + "type": "string", + "format": "date-time" }, - "snapshot_id": { + "last_login_ip": { + "type": "string" + }, + "updated_at": { "type": "string", - "title": "(optional) the id of the snapshot whence the volume comes from" + "format": "date-time" }, - "project_id": { + "created_at": { "type": "string", - "title": "(Optional) The project ID to associate with the volume" + "format": "date-time" + }, + "newsletter_subscribed": { + "type": "boolean" + }, + "github_id": { + "type": "string" + }, + "github_user": { + "type": "string" + }, + "flags": { + "type": "array", + "items": { + "$ref": "#/definitions/UserFlags" + } + }, + "name": { + "type": "string" + }, + "email_validated": { + "type": "boolean" + }, + "trialed": { + "type": "boolean" } - } + }, + "title": "Represent a User" }, - "DeletePersistentVolumeReply": { + "UserFlags": { + "type": "string", + "enum": [ + "ADMIN", + "TEST", + "RESTRICTED", + "ACTIVE", + "BETA", + "MAX_ORGANIZATIONS_25", + "MAX_ORGANIZATIONS_100", + "MAX_ORGANIZATIONS_1000", + "MAX_ORGANIZATIONS_10000", + "MAX_ORGANIZATIONS_100000", + "MAX_ORGANIZATIONS_1000000", + "PARTNER_CSP", + "IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX" + ], + "default": "ADMIN", + "title": "- ADMIN: A user is an admin user\n - TEST: A user is a test user\n - RESTRICTED: Whether this account as restricted access\n - ACTIVE: Whether this account is active\n - BETA: Account in beta program\n - MAX_ORGANIZATIONS_25: User can create this much organizations, overriding the default amount\n - PARTNER_CSP: User can create sub-organizations\n - IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX: User can bypass organization name reservations rules" + }, + "UserReply": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "user": { + "$ref": "#/definitions/User" } } }, - "GetPersistentVolumeReply": { + "UserRole.Role": { + "type": "string", + "enum": [ + "INVALID", + "OWNER" + ], + "default": "INVALID" + }, + "UserSettings": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "failed_deployment_email_notification": { + "type": "boolean" } } }, - "ListPersistentVolumeEventsReply": { + "Activity": { "type": "object", "properties": { - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/PersistentVolumeEvent" - }, - "title": "The collection of events" + "id": { + "type": "string" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "actor": { + "$ref": "#/definitions/Object" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "object": { + "$ref": "#/definitions/Object" }, - "order": { - "type": "string", - "title": "The order in the request" + "verb": { + "type": "string" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "metadata": { + "type": "object" + }, + "created_at": { + "type": "string", + "format": "date-time" } } }, - "ListPersistentVolumesReply": { + "ActivityList": { "type": "object", "properties": { - "volumes": { + "activities": { "type": "array", "items": { - "$ref": "#/definitions/PersistentVolume" - }, - "title": "The collection of persistent volumes" + "$ref": "#/definitions/Activity" + } }, "limit": { "type": "integer", - "format": "int64", - "title": "The limit in the request" + "format": "int64" }, "offset": { "type": "integer", - "format": "int64", - "title": "The offset in the request" + "format": "int64" }, "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "type": "boolean" } } }, - "PersistentVolume": { + "Object": { "type": "object", "properties": { "id": { - "type": "string", - "title": "the identifier for the volume object" + "type": "string" }, "name": { - "type": "string", - "title": "the volume name" - }, - "snapshot_id": { - "type": "string", - "title": "(optional) the id of the snapshot whence the volume comes from" - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "creation timestamp" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "title": "last change timestamp" - }, - "deleted_at": { - "type": "string", - "format": "date-time", - "title": "deletion timestamp" - }, - "organization_id": { - "type": "string", - "title": "the organization to which the volume belongs to" + "type": "string" }, - "service_id": { - "type": "string", - "title": "the service_id to which the volume is eventually bound to" + "type": { + "type": "string" }, - "region": { - "type": "string", - "title": "the region where the volume exists" + "metadata": { + "type": "object" }, - "read_only": { - "type": "boolean", - "title": "whether to mount the volume in read-only mode" + "deleted": { + "type": "boolean" + } + } + }, + "Empty": { + "type": "object" + }, + "kgitproxy.GithubInstallation.Status": { + "type": "string", + "enum": [ + "INVALID", + "INSTALLED", + "SUSPENDED", + "DELETED" + ], + "default": "INVALID" + }, + "kgitproxy.IndexingStatus": { + "type": "string", + "enum": [ + "INVALID_INDEXING_STATUS", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETED" + ], + "default": "INVALID_INDEXING_STATUS" + }, + "ListOrganizationMembersReply": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationMember" + }, + "title": "The collection of organization members" }, - "max_size": { + "limit": { "type": "integer", "format": "int64", - "title": "the maximum size of the volume (in Gigabyte / GB)" + "title": "The limit in the request" }, - "cur_size": { + "offset": { "type": "integer", "format": "int64", - "title": "the used amount of space as measured the last time (in Gigabyte / GB)" - }, - "status": { - "$ref": "#/definitions/PersistentVolumeStatus", - "title": "the status of the volume" + "title": "The offset in the request" }, - "backing_store": { - "$ref": "#/definitions/PersistentVolumeBackingStore", - "title": "the backing store type" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } - }, - "title": "The object that represent a volume to handle persistency for deployments" - }, - "PersistentVolumeBackingStore": { - "type": "string", - "enum": [ - "PERSISTENT_VOLUME_BACKING_STORE_INVALID", - "PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK" - ], - "default": "PERSISTENT_VOLUME_BACKING_STORE_INVALID", - "title": "- PERSISTENT_VOLUME_BACKING_STORE_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK: the backing store is a locally reachable block device" + } }, - "PersistentVolumeEvent": { + "OrganizationMember": { "type": "object", "properties": { "id": { "type": "string" }, - "when": { - "type": "string", - "format": "date-time" - }, "organization_id": { "type": "string" }, - "persistent_volume_id": { + "user_id": { "type": "string" }, - "type": { + "external_id": { "type": "string" }, - "message": { - "type": "string" + "joined_at": { + "type": "string", + "format": "date-time" }, - "metadata": { - "type": "object" + "role": { + "$ref": "#/definitions/UserRole.Role" + }, + "status": { + "$ref": "#/definitions/OrganizationMember.Status" + }, + "user": { + "$ref": "#/definitions/PublicUser" + }, + "organization": { + "$ref": "#/definitions/PublicOrganization" } } }, - "PersistentVolumeStatus": { + "OrganizationMember.Status": { "type": "string", "enum": [ - "PERSISTENT_VOLUME_STATUS_INVALID", - "PERSISTENT_VOLUME_STATUS_ATTACHED", - "PERSISTENT_VOLUME_STATUS_DETACHED", - "PERSISTENT_VOLUME_STATUS_DELETING", - "PERSISTENT_VOLUME_STATUS_DELETED", - "PERSISTENT_VOLUME_STATUS_ARCHIVING" + "INVALID", + "ACTIVE", + "DELETED" ], - "default": "PERSISTENT_VOLUME_STATUS_INVALID", - "title": "- PERSISTENT_VOLUME_STATUS_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_STATUS_ATTACHED: the volume is attached to an instance\n - PERSISTENT_VOLUME_STATUS_DETACHED: the volume is free to use\n - PERSISTENT_VOLUME_STATUS_DELETING: the volume will be deleted\n - PERSISTENT_VOLUME_STATUS_DELETED: the volume was deleted\n - PERSISTENT_VOLUME_STATUS_ARCHIVING: the volume is being archived (snapshot being created and migrated to remote storage)" + "default": "INVALID" }, - "UpdatePersistentVolumeReply": { + "RemoveOrganizationMemberReply": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "member": { + "$ref": "#/definitions/OrganizationMember" } } }, - "VerifyDockerImageReply": { + "DeleteUserReply": { "type": "object", "properties": { - "success": { - "type": "boolean", - "title": "Whether the image is accessible or not" + "user": { + "$ref": "#/definitions/User" + } + } + }, + "CreateCredential": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Credential name" }, - "reason": { + "description": { "type": "string", - "title": "(Optional) If the image is not accessible, the reason" + "title": "Credential description" }, - "code": { - "$ref": "#/definitions/VerifyDockerImageReply.ErrCode", - "title": "(Optional) If the image is not accessible, return an error code" + "type": { + "$ref": "#/definitions/Credential.Type", + "title": "Credential type" + }, + "organization_id": { + "type": "string", + "title": "Organization id for user credential" } } }, - "VerifyDockerImageReply.ErrCode": { - "type": "string", - "enum": [ - "UNKNOWN", - "AUTH_ACCESS_DENIED", - "ANON_ACCESS_DENIED", - "AUTH_NOT_FOUND", - "ANON_NOT_FOUND", - "REGISTRY_ERROR", - "TIMEOUT", - "DNS", - "MALFORMED", - "INVALID_OS", - "INVALID_ARCH", - "INVALID_SCHEME", - "GENERIC" - ], - "default": "UNKNOWN", - "description": "- UNKNOWN: Default value\n - AUTH_ACCESS_DENIED: The registry denied access to an authenticated request\n - ANON_ACCESS_DENIED: The registry denied access to an anonymous request\n - AUTH_NOT_FOUND: The image has not been found after an authenticated request\n - ANON_NOT_FOUND: The image has not been found after an anonymous request\n - REGISTRY_ERROR: The registry returned an error\n - TIMEOUT: The request to the registry timed out\n - DNS: There was an error trying to resolve the name of the registry\n - MALFORMED: The provided image name is malformed\n - INVALID_OS: The operating system is not supported\n - INVALID_ARCH: The architecture is not supported\n - INVALID_SCHEME: The scheme is not https\n - GENERIC: Generic catch-all error code", - "title": "The error code associated to each specific failure mode" - }, - "AzureContainerRegistryConfiguration": { + "CreateCredentialReply": { "type": "object", "properties": { - "registry_name": { - "type": "string" - }, - "username": { - "type": "string" - }, - "password": { - "type": "string" + "credential": { + "$ref": "#/definitions/Credential" } } }, - "CreateSecret": { + "Credential": { "type": "object", "properties": { - "name": { + "id": { "type": "string" }, "type": { - "$ref": "#/definitions/SecretType" + "$ref": "#/definitions/Credential.Type" }, - "value": { + "name": { "type": "string" }, - "docker_hub_registry": { - "$ref": "#/definitions/DockerHubRegistryConfiguration" - }, - "private_registry": { - "$ref": "#/definitions/PrivateRegistryConfiguration" + "token": { + "type": "string" }, - "digital_ocean_registry": { - "$ref": "#/definitions/DigitalOceanRegistryConfiguration" + "description": { + "type": "string" }, - "github_registry": { - "$ref": "#/definitions/GitHubRegistryConfiguration" + "user_id": { + "type": "string" }, - "gitlab_registry": { - "$ref": "#/definitions/GitLabRegistryConfiguration" + "organization_id": { + "type": "string" }, - "gcp_container_registry": { - "$ref": "#/definitions/GCPContainerRegistryConfiguration" + "updated_at": { + "type": "string", + "format": "date-time" }, - "azure_container_registry": { - "$ref": "#/definitions/AzureContainerRegistryConfiguration" + "created_at": { + "type": "string", + "format": "date-time" }, - "project_id": { + "expires_at": { "type": "string", - "title": "(Optional) The project ID to associate with the secret" - } - } - }, - "CreateSecretReply": { - "type": "object", - "properties": { - "secret": { - "$ref": "#/definitions/Secret" + "format": "date-time" } } }, - "DatabaseRolePassword": { - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - } - } + "Credential.Type": { + "type": "string", + "enum": [ + "INVALID", + "USER", + "ORGANIZATION" + ], + "default": "INVALID" }, - "DeleteSecretReply": { + "DeleteCredentialReply": { "type": "object" }, - "DigitalOceanRegistryConfiguration": { + "GetCredentialReply": { "type": "object", "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" + "credential": { + "$ref": "#/definitions/Credential" } } }, - "DockerHubRegistryConfiguration": { + "ListCredentialsReply": { "type": "object", "properties": { - "username": { - "type": "string" + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/Credential" + } }, - "password": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "count": { + "type": "integer", + "format": "int64" } } }, - "GCPContainerRegistryConfiguration": { + "UpdateCredentialReply": { "type": "object", "properties": { - "keyfile_content": { - "type": "string" - }, - "url": { - "type": "string" + "credential": { + "$ref": "#/definitions/Credential" } } }, - "GetSecretReply": { + "CreateProject": { "type": "object", "properties": { - "secret": { - "$ref": "#/definitions/Secret" + "name": { + "type": "string", + "title": "Project name" + }, + "description": { + "type": "string", + "title": "Project description" } } }, - "GitHubRegistryConfiguration": { - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" + "CreateProjectReply": { + "type": "object", + "properties": { + "project": { + "$ref": "#/definitions/Project" } } }, - "GitLabRegistryConfiguration": { + "DeleteProjectReply": { + "type": "object" + }, + "GetProjectReply": { "type": "object", "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" + "project": { + "$ref": "#/definitions/Project" } } }, - "ListSecretsReply": { + "ListProjectsReply": { "type": "object", "properties": { - "secrets": { + "projects": { "type": "array", "items": { - "$ref": "#/definitions/Secret" + "$ref": "#/definitions/Project" } }, "limit": { @@ -19088,34 +20007,10 @@ "offset": { "type": "integer", "format": "int64" - }, - "count": { - "type": "integer", - "format": "int64" - } - } - }, - "PrivateRegistryConfiguration": { - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - }, - "url": { - "type": "string" } } }, - "RevealSecretReply": { - "type": "object", - "properties": { - "value": {} - } - }, - "Secret": { + "Project": { "type": "object", "properties": { "id": { @@ -19124,11 +20019,11 @@ "name": { "type": "string" }, - "organization_id": { + "description": { "type": "string" }, - "type": { - "$ref": "#/definitions/SecretType" + "organization_id": { + "type": "string" }, "updated_at": { "type": "string", @@ -19138,270 +20033,282 @@ "type": "string", "format": "date-time" }, - "project_id": { + "service_count": { "type": "string", - "description": "The project ID this secret belongs to. Empty if the secret is organization-level." - }, - "value": { - "type": "string" - }, - "docker_hub_registry": { - "$ref": "#/definitions/DockerHubRegistryConfiguration" - }, - "private_registry": { - "$ref": "#/definitions/PrivateRegistryConfiguration" - }, - "digital_ocean_registry": { - "$ref": "#/definitions/DigitalOceanRegistryConfiguration" - }, - "github_registry": { - "$ref": "#/definitions/GitHubRegistryConfiguration" - }, - "gitlab_registry": { - "$ref": "#/definitions/GitLabRegistryConfiguration" - }, - "gcp_container_registry": { - "$ref": "#/definitions/GCPContainerRegistryConfiguration" - }, - "azure_container_registry": { - "$ref": "#/definitions/AzureContainerRegistryConfiguration" - }, - "database_role_password": { - "$ref": "#/definitions/DatabaseRolePassword" + "format": "int64", + "title": "Number of services in this project" } } }, - "SecretType": { - "type": "string", - "enum": [ - "SIMPLE", - "REGISTRY", - "MANAGED" - ], - "default": "SIMPLE" - }, - "UpdateSecretReply": { + "UpdateProjectReply": { "type": "object", "properties": { - "secret": { - "$ref": "#/definitions/Secret" + "project": { + "$ref": "#/definitions/Project" } } }, - "GetInstanceReply": { + "GetSubscriptionReply": { "type": "object", "properties": { - "instance": { - "$ref": "#/definitions/Instance" + "subscription": { + "$ref": "#/definitions/Subscription" } } }, - "InstanceEvent": { + "Subscription": { "type": "object", "properties": { "id": { "type": "string" }, - "when": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { "type": "string", "format": "date-time" }, + "version": { + "type": "string", + "format": "uint64" + }, "organization_id": { "type": "string" }, - "instance_id": { + "stripe_subscription_id": { "type": "string" }, - "type": { + "status": { + "$ref": "#/definitions/Subscription.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "has_pending_update": { + "type": "boolean" + }, + "stripe_pending_invoice_id": { "type": "string" }, - "message": { + "terminate_at": { + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "current_period_start": { + "type": "string", + "format": "date-time" + }, + "current_period_end": { + "type": "string", + "format": "date-time" + }, + "currency": { "type": "string" }, - "metadata": { - "type": "object" + "amount_payable": { + "type": "string", + "format": "int64" + }, + "amount_paid": { + "type": "string", + "format": "int64" + }, + "amount_remaining": { + "type": "string", + "format": "int64" + }, + "payment_failure": { + "$ref": "#/definitions/Subscription.PaymentFailure" + }, + "trialing": { + "type": "boolean" + }, + "trial_ends_at": { + "type": "string", + "format": "date-time" + }, + "trial_max_spend": { + "type": "string", + "format": "int64" + }, + "current_spend": { + "type": "string", + "format": "int64" } } }, - "InstanceListItem": { + "Subscription.PaymentFailure": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { + "failed_at": { "type": "string", "format": "date-time" }, - "updated_at": { + "next_attempt": { "type": "string", "format": "date-time" }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" + "attempt_count": { + "type": "string", + "format": "int64" }, - "service_id": { + "error_code": { "type": "string" }, - "regional_deployment_id": { + "error_reason": { "type": "string" }, - "allocation_id": { + "error_type": { "type": "string" }, - "type": { + "error_message": { "type": "string" }, - "replica_index": { - "type": "integer", - "format": "int64" + "payment_method_required": { + "type": "boolean" }, - "region": { + "redirect_url": { "type": "string" }, - "datacenter": { + "stripe_sdk": { + "$ref": "#/definitions/Subscription.PaymentFailure.StripeSDK" + } + } + }, + "Subscription.PaymentFailure.StripeSDK": { + "type": "object", + "properties": { + "client_secret_key": { "type": "string" }, - "status": { - "$ref": "#/definitions/Instance.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "xyz_deployment_id": { - "type": "string", - "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." + "raw_json": { + "type": "string" } } }, - "ListInstanceEventsReply": { + "Subscription.Status": { + "type": "string", + "enum": [ + "INVALID", + "CREATED", + "ACTIVE", + "WARNING", + "URGENT", + "CANCELING", + "CANCELED", + "TERMINATING", + "TERMINATED" + ], + "default": "INVALID" + }, + "CheckCouponReply": { "type": "object", "properties": { - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceEvent" - }, - "title": "The collection of events" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "name": { + "type": "string" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "percent_off": { + "type": "number", + "format": "float" }, - "order": { + "amount_off": { "type": "string", - "title": "The order in the request" + "format": "int64" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "currency": { + "type": "string" } } }, - "ListInstancesReply": { + "RedeemCouponReply": { + "type": "object" + }, + "RedeemCouponRequest": { "type": "object", "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceListItem" - }, - "title": "The collection of instances" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" - }, - "order": { - "type": "string", - "title": "The order in the request" + "code": { + "type": "string" } } }, - "Env": { + "ConfirmOrganizationActionReply": { + "type": "object" + }, + "LoginRequest": { "type": "object", + "example": { + "email": "john@snow.com", + "password": "..." + }, "properties": { - "key": { - "type": "string" + "email": { + "type": "string", + "title": "User email" }, - "value": { - "type": "string" + "password": { + "type": "string", + "title": "User password" }, - "secret": { - "type": "string" + "organization_id": { + "type": "string", + "title": "(Optional) Login into this organization" } } }, - "GetRegionalDeploymentReply": { + "LogoutReply": { + "type": "object" + }, + "CreateOrganizationInvitationReply": { "type": "object", "properties": { - "regional_deployment": { - "$ref": "#/definitions/RegionalDeployment" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation sent" } } }, - "ListRegionalDeploymentEventsReply": { + "CreateOrganizationInvitationRequest": { "type": "object", "properties": { - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/RegionalDeploymentEvent" - }, - "title": "The collection of events" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "order": { + "email": { "type": "string", - "title": "The order in the request" - }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "title": "The email of the person to invite" } } }, - "ListRegionalDeploymentsReply": { + "DeleteOrganizationInvitationReply": { + "type": "object" + }, + "GetOrganizationInvitationReply": { "type": "object", "properties": { - "regional_deployments": { + "invitation": { + "$ref": "#/definitions/OrganizationInvitation" + } + } + }, + "ListOrganizationInvitationsReply": { + "type": "object", + "properties": { + "invitations": { "type": "array", "items": { - "$ref": "#/definitions/RegionalDeploymentListItem" + "$ref": "#/definitions/OrganizationInvitation" }, - "title": "The collection of regional deployments" + "title": "The collection of organization invitations" }, "limit": { "type": "integer", @@ -19417,1333 +20324,1063 @@ "type": "integer", "format": "int64", "title": "The total number of items" - }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" } } }, - "Port": { + "ResendOrganizationInvitationReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" - }, - "protocol": { - "type": "string" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation resent" } } }, - "RegionalDeployment": { + "ConfirmPaymentAuthorizationReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "scheduled_at": { - "type": "string", - "format": "date-time" - }, - "allocated_at": { - "type": "string", - "format": "date-time" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "region": { - "type": "string" - }, - "parent_id": { - "type": "string" - }, - "child_id": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/RegionalDeployment.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "definition": { - "$ref": "#/definitions/RegionalDeploymentDefinition" - }, - "datacenters": { + "payment_method": { + "$ref": "#/definitions/PaymentMethod" + } + } + }, + "CreatePaymentAuthorizationReply": { + "type": "object", + "properties": { + "payment_method": { + "$ref": "#/definitions/PaymentMethod" + } + } + }, + "CreatePaymentAuthorizationRequest": { + "type": "object" + }, + "DeletePaymentMethodReply": { + "type": "object" + }, + "GetPaymentMethodReply": { + "type": "object", + "properties": { + "payment_method": { + "$ref": "#/definitions/PaymentMethod" + } + } + }, + "ListPaymentMethodsReply": { + "type": "object", + "properties": { + "payment_methods": { "type": "array", "items": { - "type": "string" - } - }, - "metadata": { - "$ref": "#/definitions/RegionalDeploymentMetadata" - }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" - }, - "role": { - "$ref": "#/definitions/RegionalDeployment.Role" + "$ref": "#/definitions/PaymentMethod" + }, + "title": "The collection of payment methods" }, - "version": { - "type": "string", - "format": "uint64" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "deployment_group": { - "type": "string", - "title": "Legacy stuff" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "deployment_id": { - "type": "string" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "RegionalDeployment.Role": { - "type": "string", - "enum": [ - "INVALID", - "ACTIVE", - "UPCOMING", - "CURRENT" - ], - "default": "INVALID" - }, - "RegionalDeployment.Status": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "SLEEPING" - ], - "default": "PENDING" - }, - "RegionalDeploymentDefinition": { + "PaymentMethod": { "type": "object", "properties": { - "name": { + "id": { "type": "string" }, - "type": { - "$ref": "#/definitions/RegionalDeploymentDefinition.Type" - }, - "strategy": { - "$ref": "#/definitions/DeploymentStrategy" - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/Route" - } + "created_at": { + "type": "string", + "format": "date-time" }, - "ports": { - "type": "array", - "items": { - "$ref": "#/definitions/Port" - } + "updated_at": { + "type": "string", + "format": "date-time" }, - "env": { - "type": "array", - "items": { - "$ref": "#/definitions/Env" - } + "version": { + "type": "string", + "format": "uint64" }, - "region": { + "organization_id": { "type": "string" }, - "scaling": { - "$ref": "#/definitions/Scaling" - }, - "instance_type": { + "type": { "type": "string" }, - "deployment_group": { + "provider": { "type": "string" }, - "health_checks": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentHealthCheck" - } - }, - "volumes": { - "type": "array", - "items": { - "$ref": "#/definitions/RegionalDeploymentVolume" - } + "status": { + "$ref": "#/definitions/PaymentMethod.Status" }, - "config_files": { + "messages": { "type": "array", "items": { - "$ref": "#/definitions/ConfigFile" + "type": "string" } }, - "skip_cache": { - "type": "boolean" - }, - "mesh": { - "$ref": "#/definitions/RegionalDeploymentMesh" - }, - "docker": { - "$ref": "#/definitions/DockerSource" - }, - "git": { - "$ref": "#/definitions/GitSource" - }, - "archive": { - "$ref": "#/definitions/ArchiveSource" - } - } - }, - "RegionalDeploymentDefinition.Type": { - "type": "string", - "enum": [ - "INVALID", - "WEB", - "WORKER", - "_", - "SANDBOX" - ], - "default": "INVALID", - "title": "- _: We match with DeploymentDefinition.Type, so we skip 3 which is DATABASE" - }, - "RegionalDeploymentEvent": { - "type": "object", - "properties": { - "id": { + "stripe_payment_method_id": { "type": "string" }, - "when": { + "authorization_verified_at": { "type": "string", "format": "date-time" }, - "organization_id": { - "type": "string" + "authorization_canceled_at": { + "type": "string", + "format": "date-time" }, - "regional_deployment_id": { + "authorization_stripe_payment_intent_id": { "type": "string" }, - "type": { + "authorization_stripe_payment_intent_client_secret": { "type": "string" }, - "message": { + "card_brand": { "type": "string" }, - "metadata": { - "type": "object" - } - } - }, - "RegionalDeploymentListItem": { - "type": "object", - "properties": { - "id": { + "card_country": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" + "card_funding": { + "type": "string" }, - "region": { + "card_fingerprint": { "type": "string" }, - "status": { - "$ref": "#/definitions/RegionalDeployment.Status" + "card_last_digits": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "card_expiration_month": { + "type": "integer", + "format": "int64" }, - "definition": { - "$ref": "#/definitions/RegionalDeploymentDefinition" + "card_expiration_year": { + "type": "integer", + "format": "int64" } } }, - "RegionalDeploymentMesh": { + "PaymentMethod.Status": { "type": "string", "enum": [ - "REGIONAL_DEPLOYMENT_MESH_AUTO", - "REGIONAL_DEPLOYMENT_MESH_ENABLED", - "REGIONAL_DEPLOYMENT_MESH_DISABLED" + "INVALID", + "CREATED", + "AUTHORIZED", + "DECLINED", + "CANCELED", + "EXPIRED", + "UNCHECKED" ], - "default": "REGIONAL_DEPLOYMENT_MESH_AUTO" - }, - "RegionalDeploymentMetadata": { - "type": "object" - }, - "RegionalDeploymentVolume": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "the id of the volume" - }, - "path": { - "type": "string", - "title": "the path where the volume is mounted to" - }, - "replica_index": { - "type": "integer", - "format": "int64", - "title": "the replica index to mount the volume to" - } - } + "default": "INVALID" }, - "Route": { + "GetIntercomProfileReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" - }, - "path": { + "hash": { "type": "string" - }, - "security_policies": { - "$ref": "#/definitions/SecurityPolicies" } } }, - "Scaling": { + "DomainLoadBalancerQuotas": { "type": "object", "properties": { - "min": { - "type": "integer", - "format": "int64" - }, - "max": { + "max_koyeb": { "type": "integer", "format": "int64" - }, - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScalingTarget" - } } } }, - "AppUsage": { + "GetQuotasReply": { "type": "object", "properties": { - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" - }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceUsage" - } - }, - "databases": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseUsage" - } + "quotas": { + "$ref": "#/definitions/Quotas" } } }, - "DatabaseUsage": { + "LifecycleQuotas": { "type": "object", "properties": { - "service_id": { - "type": "string" - }, - "service_name": { - "type": "string" - }, - "compute_time_seconds": { + "delete_after_sleep_min": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "delete after sleep limits" }, - "data_storage_megabytes_hours": { + "delete_after_sleep_max": { "type": "integer", "format": "int64" - } - } - }, - "DatabaseUsageDetails": { - "type": "object", - "properties": { - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" }, - "service_id": { - "type": "string" - }, - "service_name": { - "type": "string" - }, - "compute_time_seconds": { + "delete_after_create_min": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "delete after create limits" }, - "data_storage_megabytes_hour": { + "delete_after_create_max": { "type": "integer", "format": "int64" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" } } }, - "GetOrganizationUsageDetailsReply": { + "PersistentVolumeQuotas": { "type": "object", "properties": { - "usage_details": { - "type": "array", - "items": { - "$ref": "#/definitions/UsageDetails" - }, - "title": "The collection of usage instances" - }, - "database_details": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseUsageDetails" - }, - "title": "The collection of database deployments used during the month" - }, - "limit": { + "max_total_size": { "type": "integer", "format": "int64", - "title": "The limit in the request" + "description": "MaxTotalSize for all volumes on a region (in Gigabyte / GB)." }, - "offset": { + "max_volume_size": { "type": "integer", "format": "int64", - "title": "The offset in the request" + "description": "MaxVolumeSize for one volume (in Gigabyte / GB)." }, - "count": { + "max_per_instance_size": { "type": "integer", "format": "int64", - "title": "The total number of items" - }, - "order": { - "type": "string", - "title": "The order in the request" - } - } - }, - "GetOrganizationUsageReply": { - "type": "object", - "properties": { - "usage": { - "$ref": "#/definitions/Usage", - "title": "The computed usage of instances per month" + "description": "MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB)." } } }, - "InstanceUsage": { + "Quotas": { "type": "object", "properties": { - "duration_seconds": { - "type": "integer", + "apps": { + "type": "string", "format": "int64" - } - } - }, - "PeriodUsage": { - "type": "object", - "properties": { - "starting_time": { + }, + "services": { "type": "string", - "format": "date-time" + "format": "int64" }, - "ending_time": { + "domains": { "type": "string", - "format": "date-time" + "format": "int64", + "title": "Deprecated, use custom_domains instead" }, - "apps": { + "services_by_app": { + "type": "string", + "format": "int64" + }, + "service_provisioning_concurrency": { + "type": "string", + "format": "int64" + }, + "memory_mb": { + "type": "string", + "format": "int64" + }, + "instance_types": { "type": "array", "items": { - "$ref": "#/definitions/AppUsage" + "type": "string" } - } - } - }, - "RegionUsage": { - "type": "object", - "properties": { - "instances": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/InstanceUsage" + }, + "regions": { + "type": "array", + "items": { + "type": "string" } - } - } - }, - "ServiceUsage": { - "type": "object", - "properties": { - "service_id": { - "type": "string" }, - "service_name": { - "type": "string" + "max_organization_members": { + "type": "string", + "format": "int64" }, - "regions": { + "max_instances_by_type": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/RegionUsage" + "type": "string", + "format": "int64" } - } - } - }, - "Usage": { - "type": "object", - "properties": { - "organization_id": { - "type": "string" }, - "periods": { + "persistent_volumes_by_region": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/PeriodUsage" + "$ref": "#/definitions/PersistentVolumeQuotas" } - } - } - }, - "UsageDetails": { - "type": "object", - "properties": { - "organization_id": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" - }, - "service_id": { - "type": "string" }, - "service_name": { - "type": "string" + "custom_domains": { + "type": "string", + "format": "int64" }, - "regional_deployment_id": { - "type": "string" + "domains_load_balancer": { + "$ref": "#/definitions/DomainLoadBalancerQuotas" }, - "region": { - "type": "string" + "metrics_retention": { + "type": "integer", + "format": "int32", + "title": "Time in days" }, - "deployment_id": { - "type": "string" + "logs_retention": { + "type": "integer", + "format": "int32", + "title": "Time in days" }, - "instance_type": { - "type": "string" + "access_reserved_subdomains": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The mapping between reserved_subdomain names and their value is in the code" }, - "duration_seconds": { + "proxy_ports": { "type": "integer", "format": "int64" }, - "started_at": { + "scale_to_zero": { + "$ref": "#/definitions/ScaleToZeroQuotas" + }, + "archives": { "type": "string", - "format": "date-time" + "format": "int64" }, - "terminated_at": { + "archive_max_size_mb": { "type": "string", - "format": "date-time" + "format": "int64" + }, + "lifecycle": { + "$ref": "#/definitions/LifecycleQuotas" + }, + "max_projects": { + "type": "string", + "format": "int64" } } }, - "CreateSnapshotReply": { + "ScaleToZeroQuotas": { "type": "object", "properties": { - "snapshot": { - "$ref": "#/definitions/Snapshot" + "is_deep_sleep_enabled": { + "type": "boolean", + "title": "deep sleep limits" + }, + "deep_sleep_idle_delay_min": { + "type": "integer", + "format": "int64" + }, + "deep_sleep_idle_delay_max": { + "type": "integer", + "format": "int64" + }, + "is_light_sleep_enabled": { + "type": "boolean", + "title": "light sleep limits" + }, + "light_sleep_idle_delay_min": { + "type": "integer", + "format": "int64" + }, + "light_sleep_idle_delay_max": { + "type": "integer", + "format": "int64" } } }, - "CreateSnapshotRequest": { + "AppsSummary": { "type": "object", "properties": { - "parent_volume_id": { - "type": "string", - "title": "The id of the volume to snapshot" - }, - "name": { + "total": { "type": "string", - "title": "The name of the snapshot" + "format": "int64", + "title": "Total number of apps" }, - "project_id": { - "type": "string", - "title": "(Optional) The project ID to associate with the snapshot" + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of apps grouped by status" } } }, - "DeleteSnapshotReply": { + "DomainsSummary": { "type": "object", "properties": { - "snapshot": { - "$ref": "#/definitions/Snapshot" + "total": { + "type": "string", + "format": "int64", + "title": "Total number of domains" + }, + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of domains grouped by status" } } }, - "GetSnapshotReply": { + "GetOrganizationSummaryReply": { "type": "object", "properties": { - "snapshot": { - "$ref": "#/definitions/Snapshot" + "summary": { + "$ref": "#/definitions/OrganizationSummary", + "title": "Organization usage summary" } } }, - "ListSnapshotsReply": { + "InstancesSummary": { "type": "object", "properties": { - "snapshots": { - "type": "array", - "items": { - "$ref": "#/definitions/Snapshot" - }, - "title": "The collection of snapshots" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", + "total": { + "type": "string", "format": "int64", - "title": "The offset in the request" + "title": "Total number of instances" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "by_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of instances grouped by type" } } }, - "Snapshot": { + "MembersSummary": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "the identifier of the snapshot object" - }, - "name": { + "total": { "type": "string", - "title": "the snapshot name" - }, - "size": { - "type": "integer", "format": "int64", - "title": "the original volume size" - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "creation timestamp" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "title": "last change timestamp" - }, - "deleted_at": { - "type": "string", - "format": "date-time", - "title": "deletion timestamp" - }, - "organization_id": { - "type": "string", - "title": "the organization to which the snapshot belongs to" - }, - "parent_volume_id": { - "type": "string", - "title": "the volume from which the snapshot has been created" - }, - "region": { - "type": "string", - "title": "the region where the snapshot resides, if any" - }, - "status": { - "$ref": "#/definitions/SnapshotStatus", - "title": "the status of the snapshot" + "title": "Number of members" }, - "type": { - "$ref": "#/definitions/SnapshotType", - "title": "the type of snapshot (can be local or remote)" - } - }, - "description": "The object that represents a snapshot. It can either be local, on a node, or remote, in a cold storage." - }, - "SnapshotStatus": { - "type": "string", - "enum": [ - "SNAPSHOT_STATUS_INVALID", - "SNAPSHOT_STATUS_CREATING", - "SNAPSHOT_STATUS_AVAILABLE", - "SNAPSHOT_STATUS_MIGRATING", - "SNAPSHOT_STATUS_DELETING", - "SNAPSHOT_STATUS_DELETED" - ], - "default": "SNAPSHOT_STATUS_INVALID", - "title": "- SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted" - }, - "SnapshotType": { - "type": "string", - "enum": [ - "SNAPSHOT_TYPE_INVALID", - "SNAPSHOT_TYPE_LOCAL", - "SNAPSHOT_TYPE_REMOTE" - ], - "default": "SNAPSHOT_TYPE_INVALID", - "title": "- SNAPSHOT_TYPE_INVALID: zero value, invalid\n - SNAPSHOT_TYPE_LOCAL: the snapshot is local to the machine\n - SNAPSHOT_TYPE_REMOTE: the snapshot is remote in a cold storage" - }, - "UpdateSnapshotReply": { - "type": "object", - "properties": { - "snapshot": { - "$ref": "#/definitions/Snapshot" + "invitations_by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of invitations grouped by status" } } }, - "ReviewOrganizationCapacityReply": { + "NeonPostgresSummary": { "type": "object", "properties": { - "has_capacity": { - "type": "boolean" + "total": { + "type": "string", + "format": "int64", + "title": "Total number of databases" + }, + "by_instance_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of databases grouped by instance type" } } }, - "ReviewOrganizationCapacityRequest": { + "OrganizationSummary": { "type": "object", "properties": { - "plan": { + "organization_id": { "type": "string" }, - "trialing": { - "type": "boolean" + "instances": { + "$ref": "#/definitions/InstancesSummary" + }, + "apps": { + "$ref": "#/definitions/AppsSummary" + }, + "services": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServiceSummary" + }, + "title": "Number of services grouped by type" + }, + "domains": { + "$ref": "#/definitions/DomainsSummary" + }, + "secrets": { + "$ref": "#/definitions/SecretsSummary" + }, + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresSummary" + }, + "members": { + "$ref": "#/definitions/MembersSummary" } } }, - "LogEntry": { + "SecretsSummary": { "type": "object", "properties": { - "msg": { - "type": "string" - }, - "created_at": { + "total": { "type": "string", - "format": "date-time" + "format": "int64", + "title": "Total number of secrets" }, - "labels": { - "type": "object" + "by_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of secrets grouped by type" } } }, - "QueryLogsReply": { + "ServiceSummary": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/LogEntry" - } + "total": { + "type": "string", + "format": "int64", + "title": "Total number of services" }, - "pagination": { - "$ref": "#/definitions/QueryLogsReplyPagination" + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of services grouped by status" } } }, - "QueryLogsReplyPagination": { + "Notification": { "type": "object", "properties": { - "has_more": { + "id": { + "type": "string" + }, + "activity": { + "$ref": "#/definitions/Activity" + }, + "is_read": { "type": "boolean" }, - "next_start": { - "type": "string", - "format": "date-time" + "is_seen": { + "type": "boolean" }, - "next_end": { + "created_at": { "type": "string", "format": "date-time" } } }, - "GetMetricsReply": { + "NotificationList": { "type": "object", "properties": { - "metrics": { + "notifications": { "type": "array", "items": { - "$ref": "#/definitions/GetMetricsReply.Metric" - } - } - } - }, - "GetMetricsReply.Metric": { - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" + "$ref": "#/definitions/Notification" } }, - "samples": { - "type": "array", - "items": { - "$ref": "#/definitions/Sample" - } - } - } - }, - "MetricName": { - "type": "string", - "enum": [ - "UNKNOWN", - "CPU_TOTAL_PERCENT", - "MEM_RSS", - "HTTP_THROUGHPUT", - "HTTP_RESPONSE_TIME_50P", - "HTTP_RESPONSE_TIME_90P", - "HTTP_RESPONSE_TIME_99P", - "HTTP_RESPONSE_TIME_MAX", - "PUBLIC_DATA_TRANSFER_IN", - "PUBLIC_DATA_TRANSFER_OUT" - ], - "default": "UNKNOWN" - }, - "Sample": { - "type": "object", - "properties": { - "timestamp": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64" }, - "value": { - "type": "number", - "format": "double" + "offset": { + "type": "integer", + "format": "int64" + }, + "count": { + "type": "integer", + "format": "int64" + }, + "is_read": { + "type": "boolean" + }, + "is_seen": { + "type": "boolean" + }, + "unread": { + "type": "integer", + "format": "int64" + }, + "unseen": { + "type": "integer", + "format": "int64" } } }, - "ExecCommandIO": { + "GetRegionReply": { "type": "object", "properties": { - "data": { - "type": "string", - "format": "byte", - "description": "Data is base64 encoded" - }, - "close": { - "type": "boolean", - "description": "Indicate last data frame" + "region": { + "$ref": "#/definitions/Region", + "title": "The Region retrieved" } } }, - "ExecCommandReply": { + "ListRegionsReply": { "type": "object", "properties": { - "stdout": { - "$ref": "#/definitions/ExecCommandIO" + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionListItem" + } }, - "stderr": { - "$ref": "#/definitions/ExecCommandIO" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "exited": { - "type": "boolean" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "exit_code": { + "count": { "type": "integer", - "format": "int32" + "format": "int64", + "title": "The total number of items" } } }, - "ExecCommandRequest.Body": { + "Region": { "type": "object", "properties": { - "command": { + "id": { + "type": "string", + "title": "The id of the region" + }, + "name": { + "type": "string", + "title": "The name of the region" + }, + "coordinates": { "type": "array", "items": { "type": "string" }, - "description": "Command to exec. Mandatory in the first frame sent" + "title": "The coordinates of the region (lat/long)" }, - "tty_size": { - "$ref": "#/definitions/ExecCommandRequest.TerminalSize" + "status": { + "type": "string", + "title": "The status of the region" }, - "stdin": { - "$ref": "#/definitions/ExecCommandIO" + "instances": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of instances available in this region" }, - "disableTty": { + "datacenters": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of datacenters available in this region" + }, + "volumes_enabled": { "type": "boolean", - "description": "Disable TTY. It's enough to specify it in the first frame" + "title": "Are the volumes enabled for this instance type" + }, + "scope": { + "type": "string", + "description": "The scope of the region, continent, metropolitan area, etc." } } }, - "ExecCommandRequest.IdType": { - "type": "string", - "enum": [ - "INVALID", - "INSTANCE_ID", - "SERVICE_ID" - ], - "default": "INVALID" - }, - "ExecCommandRequest.TerminalSize": { + "RegionListItem": { "type": "object", "properties": { - "height": { - "type": "integer", - "format": "int32" + "id": { + "type": "string", + "title": "The id of the region" + }, + "name": { + "type": "string", + "title": "The name of the region" + }, + "coordinates": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The coordinates of the region (lat/long)" + }, + "status": { + "type": "string", + "title": "The status of the region" + }, + "instances": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of instances available in this region" + }, + "datacenters": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of datacenters available in this region" }, - "width": { - "type": "integer", - "format": "int32" + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" + }, + "scope": { + "type": "string", + "description": "The scope of the region, continent, metropolitan area, etc." } } }, - "Notification": { + "DatacenterListItem": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "title": "e.g. \"par1\"" }, - "activity": { - "$ref": "#/definitions/Activity" + "region_id": { + "type": "string", + "title": "e.g. \"par\"" }, - "is_read": { - "type": "boolean" + "domain": { + "type": "string", + "title": "e.g. \"all-par1.infra.prod.koyeb.com\"" }, - "is_seen": { - "type": "boolean" + "coordinates": { + "type": "array", + "items": { + "type": "string" + }, + "title": "e.g. \"8.856614\" ,\"2.352221\"?" }, - "created_at": { - "type": "string", - "format": "date-time" + "use_gpu": { + "type": "boolean", + "title": "e.g. true" + }, + "regions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "e.g. \"par\", \"fra\"" } } }, - "NotificationList": { + "ListDatacentersReply": { "type": "object", "properties": { - "notifications": { + "datacenters": { "type": "array", "items": { - "$ref": "#/definitions/Notification" + "$ref": "#/definitions/DatacenterListItem" } - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "offset": { - "type": "integer", - "format": "int64" - }, - "count": { - "type": "integer", - "format": "int64" - }, - "is_read": { - "type": "boolean" - }, - "is_seen": { - "type": "boolean" - }, - "unread": { - "type": "integer", - "format": "int64" - }, - "unseen": { - "type": "integer", - "format": "int64" } } }, - "ktest.TestAnonReply": { - "type": "object" + "AvailabilityLevel": { + "type": "string", + "enum": [ + "UNKNOWN", + "LOW", + "MEDIUM", + "HIGH" + ], + "default": "UNKNOWN" }, - "ktest.TestAuthReply": { + "CatalogUsage": { "type": "object", "properties": { - "payload": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "workspace_id": { - "type": "string" + "instances": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/InstanceAvailability" + } } } }, - "ktest.TestAuthRequest": { + "InstanceAvailability": { "type": "object", "properties": { - "payload": { - "type": "string" + "regions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/RegionAvailability" + } + }, + "availability": { + "$ref": "#/definitions/AvailabilityLevel" } } }, - "kgitproxy.Branch": { + "ListUsageReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "repository_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "is_protected": { - "type": "boolean" - }, - "provider": { - "$ref": "#/definitions/kgitproxy.RepositoryProvider" + "usage": { + "$ref": "#/definitions/CatalogUsage", + "title": "The Usage retrieved" } } }, - "kgitproxy.GitHubRepository": { + "RegionAvailability": { "type": "object", "properties": { - "github_id": { - "type": "string" + "availability": { + "$ref": "#/definitions/AvailabilityLevel" } } }, - "kgitproxy.ListBranchesReply": { + "CatalogGPUDetails": { "type": "object", "properties": { - "branches": { - "type": "array", - "items": { - "$ref": "#/definitions/kgitproxy.Branch" - }, - "description": "The collection of branches." - }, - "limit": { + "count": { "type": "integer", "format": "int64", - "description": "The limit in the request." + "title": "The number of GPUs" }, - "offset": { - "type": "integer", - "format": "int64", - "description": "The offset in the request." + "brand": { + "type": "string", + "title": "The brand of GPU" }, - "count": { - "type": "integer", - "format": "int64", - "description": "The total number of items." + "memory": { + "type": "string", + "title": "GPU memory" + }, + "name": { + "type": "string", + "title": "Name of GPU" } } }, - "kgitproxy.ListRepositoriesReply": { + "CatalogInstance": { "type": "object", "properties": { - "repositories": { - "type": "array", - "items": { - "$ref": "#/definitions/kgitproxy.Repository" - }, - "description": "The collection of repositories." + "id": { + "type": "string", + "title": "The name of the instance" }, - "limit": { - "type": "integer", - "format": "int64", - "description": "The limit in the request." + "description": { + "type": "string", + "title": "A short description of the instance" }, - "offset": { + "vcpu": { "type": "integer", "format": "int64", - "description": "The offset in the request." + "description": "The number of cpus. Deprecated. Use vcpu_shares instead." }, - "count": { - "type": "integer", - "format": "int64", - "description": "The total number of items." - } - } - }, - "kgitproxy.Repository": { - "type": "object", - "properties": { - "id": { - "type": "string" + "memory": { + "type": "string", + "title": "The memory in bytes in a format like 5MB" }, - "organization_id": { - "type": "string" + "disk": { + "type": "string", + "title": "The size of the disk in bytes in a format like 5MB" }, - "name": { - "type": "string" + "price_per_second": { + "type": "string", + "title": "The price to pay per second" }, - "url": { - "type": "string" + "price_hourly": { + "type": "string", + "title": "The price to pay per hour" }, - "description": { - "type": "string" + "price_monthly": { + "type": "string", + "title": "The price to pay per month" }, - "is_private": { - "type": "boolean" + "regions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The regions where this instance type is available" }, - "is_disabled": { - "type": "boolean" + "status": { + "type": "string", + "title": "The status of the instance" }, - "default_branch": { - "type": "string" + "require_plan": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The plan required to use instance" }, - "provider": { - "$ref": "#/definitions/kgitproxy.RepositoryProvider" + "vcpu_shares": { + "type": "number", + "format": "float", + "description": "The number of vcpu shares reserved for the instance." }, - "last_push_date": { + "display_name": { "type": "string", - "format": "date-time" + "title": "The display name of the instance" }, - "github": { - "$ref": "#/definitions/kgitproxy.GitHubRepository" - } - } - }, - "kgitproxy.RepositoryProvider": { - "type": "string", - "enum": [ - "INVALID_PROVIDER", - "GITHUB" - ], - "default": "INVALID_PROVIDER" - }, - "kgitproxy.ResyncOrganizationReply": { - "type": "object" - }, - "ksearch.App": { - "type": "object", - "properties": { - "id": { - "type": "string" + "aliases": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Aliases" }, - "organization_id": { - "type": "string" + "type": { + "type": "string", + "title": "The type of the instance (e.g. \"gpu\")" }, - "name": { - "type": "string" - } - } - }, - "ksearch.GlobalDeployment": { - "type": "object", - "properties": { - "id": { - "type": "string" + "gpu": { + "$ref": "#/definitions/CatalogGPUDetails", + "title": "GPU details" }, - "organization_id": { - "type": "string" + "service_types": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" }, - "app_id": { - "type": "string" + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" }, - "service_id": { - "type": "string" + "light_sleep_enabled": { + "type": "boolean", + "title": "Is light sleep enabled for this instance type" } } }, - "ksearch.Instance": { + "CatalogInstanceListItem": { "type": "object", "properties": { "id": { - "type": "string" - }, - "organization_id": { - "type": "string" + "type": "string", + "title": "The name of the instance" }, - "app_id": { - "type": "string" + "description": { + "type": "string", + "title": "A short description of the instance" }, - "service_id": { - "type": "string" + "vcpu": { + "type": "integer", + "format": "int64", + "description": "The number of cpus. Deprecated. Use vcpu_shares instead." }, - "allocation_id": { - "type": "string" - } - } - }, - "ksearch.Organization": { - "type": "object", - "properties": { - "id": { - "type": "string" + "memory": { + "type": "string", + "title": "The memory in bytes in a format like 5MB" }, - "name": { - "type": "string" - } - } - }, - "ksearch.RegionalDeployment": { - "type": "object", - "properties": { - "id": { - "type": "string" + "disk": { + "type": "string", + "title": "The size of the disk in bytes in a format like 5MB" }, - "organization_id": { - "type": "string" + "price_per_second": { + "type": "string", + "title": "The price to pay per second" }, - "app_id": { - "type": "string" + "price_hourly": { + "type": "string", + "title": "The price to pay per hour" }, - "service_id": { - "type": "string" + "price_monthly": { + "type": "string", + "title": "The price to pay per month" }, - "region": { - "type": "string" - } - } - }, - "ksearch.SearchReply": { - "type": "object", - "properties": { - "organizations": { + "regions": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.Organization" - } + "type": "string" + }, + "title": "The regions where this instance type is available" }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/ksearch.User" - } + "status": { + "type": "string", + "title": "The status of the instance" }, - "apps": { + "require_plan": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.App" - } + "type": "string" + }, + "title": "The plan required to use instance" }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/ksearch.Service" - } + "vcpu_shares": { + "type": "number", + "format": "float", + "description": "The number of vcpu shares reserved for the instance." }, - "global_deployments": { - "type": "array", - "items": { - "$ref": "#/definitions/ksearch.GlobalDeployment" - } + "display_name": { + "type": "string", + "title": "The display name of the instance" }, - "regional_deployments": { + "aliases": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.RegionalDeployment" - } + "type": "string" + }, + "title": "Aliases" }, - "instances": { + "type": { + "type": "string", + "title": "The type of the instance (e.g. \"gpu\")" + }, + "gpu": { + "$ref": "#/definitions/CatalogGPUDetails", + "title": "GPU details" + }, + "service_types": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.Instance" - } + "type": "string" + }, + "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + }, + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" + }, + "light_sleep_enabled": { + "type": "boolean", + "title": "Is light sleep enabled for this instance type" } } }, - "ksearch.Service": { + "GetCatalogInstanceReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "name": { - "type": "string" + "instance": { + "$ref": "#/definitions/CatalogInstance", + "title": "The instance retrieved" } } }, - "ksearch.User": { + "ListCatalogInstancesReply": { "type": "object", "properties": { - "id": { - "type": "string" + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/CatalogInstanceListItem" + } }, - "email": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "name": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "github_user": { - "type": "string" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } } From 14a7c474ec7f1f760c26e4b98da3cffe2988f4b7 Mon Sep 17 00:00:00 2001 From: nicoche <78445450+nicoche@users.noreply.github.com> Date: Fri, 26 Jun 2026 02:22:12 +0200 Subject: [PATCH 2/4] Add experimental snapshot support --- examples/21_snapshot_and_spawn.py | 76 +++ examples/22_declarative_snapshot_builder.py | 86 +++ examples/23_full_snapshot.py | 84 +++ koyeb/sandbox/__init__.py | 5 + koyeb/sandbox/api.md | 103 ++++ koyeb/sandbox/sandbox.py | 493 +++++++++++++++-- koyeb/sandbox/snapshot.py | 584 ++++++++++++++++++++ koyeb/sandbox/utils.py | 12 + 8 files changed, 1383 insertions(+), 60 deletions(-) create mode 100644 examples/21_snapshot_and_spawn.py create mode 100644 examples/22_declarative_snapshot_builder.py create mode 100644 examples/23_full_snapshot.py create mode 100644 koyeb/sandbox/api.md create mode 100644 koyeb/sandbox/snapshot.py diff --git a/examples/21_snapshot_and_spawn.py b/examples/21_snapshot_and_spawn.py new file mode 100644 index 00000000..fca63349 --- /dev/null +++ b/examples/21_snapshot_and_spawn.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +"""Create a sandbox, take a snapshot, and spawn a new sandbox from it""" + +import os +import sys +import random +import string + +from koyeb import Sandbox +from koyeb.sandbox import SnapshotType + + +def main(): + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + print("Error: KOYEB_API_TOKEN not set") + return 1 + + sbx = None + sbx2 = None + snapshot = None + suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) + try: + print("✓ Creating sandbox...") + sbx = Sandbox.create( + image="python:3.12", + name=f"snapshot-and-spawn-{suffix}", + wait_ready=True, + api_token=api_token, + ) + print(f" ✓ Sandbox created: {sbx.name}") + + # Install packages + print("✓ Installing packages...") + sbx.exec("pip3 install pytest requests") + print(" ✓ Packages installed") + + # Take a snapshot + print("✓ Creating snapshot...") + snapshot = sbx.snapshot( + name=f"python-with-deps-{suffix}", + snapshot_type=SnapshotType.FILESYSTEM, + ) + print(f" ✓ Snapshot created: {snapshot.name}") + + # Spawn a new sandbox from the snapshot + print("✓ Spawning sandbox from snapshot...") + sbx2 = snapshot.spawn( + name=f"test-runner-{suffix}", + wait_ready=False, + api_token=api_token, + ) + print(f" ✓ Sandbox spawned: {sbx2.name}") + + # Wait for the spawned sandbox to be ready + print("✓ Waiting for spawned sandbox to be ready...") + is_ready = sbx2.wait_ready(timeout=300) + print(" ✓ Sandbox is ready") + + # Verify packages are pre-installed from snapshot filesystem + print("✓ Verifying packages are pre-installed from snapshot filesystem...") + result = sbx2.exec("python3 -c \"import requests; print('OK')\"") + print(f" ✓ Result: {result.stdout.strip()}") + + return 0 + finally: + if sbx2: + sbx2.delete() + if snapshot: + snapshot.delete() + if sbx: + sbx.delete() + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/examples/22_declarative_snapshot_builder.py b/examples/22_declarative_snapshot_builder.py new file mode 100644 index 00000000..48751f7a --- /dev/null +++ b/examples/22_declarative_snapshot_builder.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Use the fluent builder API to create a reusable snapshot and spawn sandboxes from it""" + +import os +import sys +import random +import string + +from koyeb import Sandbox + + +def main(): + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + print("Error: KOYEB_API_TOKEN not set") + return 1 + + snapshot = None + runner1 = None + runner2 = None + suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) + try: + # Build a reusable snapshot declaratively + print("✓ Building declarative snapshot...") + snapshot = ( + Sandbox.template( + f"ci-environment-{suffix}", + image="python:3.12", + workdir="/workspace", + api_token=api_token, + ) + .file("requirements.txt", "pytest\nrequests\nnumpy") + .run("pip install -r requirements.txt") + .build(snapshot_name=f"python-ci-env-{suffix}") + ) + + # Print operations performed during build + if snapshot.operations: + for op in snapshot.operations: + print(f" - {op}") + print(f" ✓ Snapshot built: {snapshot.name}") + + # Spawn multiple sandboxes from the same snapshot in parallel + print("✓ Spawning sandboxes from snapshot...") + print(" - Spawning runner1...") + print(" - Spawning runner2...") + runner1 = snapshot.spawn( + name=f"test-suite-1-{suffix}", + wait_ready=False, + api_token=api_token, + ) + runner2 = snapshot.spawn( + name=f"test-suite-2-{suffix}", + wait_ready=False, + api_token=api_token, + ) + print(f" ✓ Runner1 spawned: {runner1.name}") + print(f" ✓ Runner2 spawned: {runner2.name}") + + # Wait for both sandboxes to be ready + print("✓ Waiting for sandboxes to be ready...") + for runner in [runner1, runner2]: + runner.wait_ready(timeout=300) + print(" ✓ All sandboxes are ready") + + # Verify the environment is pre-configured from snapshot filesystem + print("✓ Verifying runner1 has pre-installed packages from snapshot filesystem...") + result = runner1.exec("python3 -c \"import pytest, requests, numpy; print('All packages installed')\"") + print(f" ✓ Result: {result.stdout.strip()}") + + print("✓ Verifying runner2 has pre-installed packages from snapshot filesystem...") + result = runner2.exec("python3 -c \"import pytest, requests, numpy; print('All packages installed')\"") + print(f" ✓ Result: {result.stdout.strip()}") + + return 0 + finally: + if runner2: + runner2.delete() + if runner1: + runner1.delete() + if snapshot: + snapshot.delete() + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/examples/23_full_snapshot.py b/examples/23_full_snapshot.py new file mode 100644 index 00000000..8fdeee30 --- /dev/null +++ b/examples/23_full_snapshot.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Create a sandbox, take a FULL snapshot (including processes), and spawn from it""" + +import os +import sys +import random +import string + +from koyeb import Sandbox +from koyeb.sandbox import SnapshotType + + +def main(): + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + print("Error: KOYEB_API_TOKEN not set") + return 1 + + sbx = None + sbx2 = None + snapshot = None + suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) + try: + print("✓ Creating sandbox...") + sbx = Sandbox.create( + image="python:3.12", + name=f"full-snapshot-{suffix}", + wait_ready=True, + api_token=api_token, + ) + print(f" ✓ Sandbox created: {sbx.name}") + + # Install packages + print("✓ Installing packages...") + sbx.exec("pip3 install requests") + print(" ✓ Packages installed") + + # Take a FULL snapshot (includes both filesystem and running processes) + print("✓ Creating FULL snapshot...") + snapshot = sbx.snapshot( + name=f"python-full-{suffix}", + snapshot_type=SnapshotType.FULL, + ) + print(f" ✓ Full snapshot created: {snapshot.name}") + print(f" ✓ Snapshot type: {snapshot.snapshot_type.value}") + + # Print operations if any + if snapshot.operations: + print("\n Operations performed during snapshot:") + for op in snapshot.operations: + print(f" - {op}") + + # Spawn a new sandbox from the full snapshot + print("✓ Spawning sandbox from FULL snapshot...") + sbx2 = snapshot.spawn( + name=f"full-test-{suffix}", + wait_ready=True, + api_token=api_token, + ) + print(f" ✓ Sandbox spawned from full snapshot: {sbx2.name}") + + # Verify the sandbox is running and packages are pre-installed + print("✓ Verifying sandbox from full snapshot...") + result = sbx2.exec("python3 -c \"import requests; print('OK')\"") + print(f" ✓ Result: {result.stdout.strip()}") + + print("\n✓ All tests passed!") + return 0 + finally: + print("\nCleaning up resources...") + if sbx2: + sbx2.delete() + print(" ✓ Deleted spawned sandbox") + if snapshot: + snapshot.delete() + print(" ✓ Deleted snapshot") + if sbx: + sbx.delete() + print(" ✓ Deleted original sandbox") + print(" ✓ Cleanup complete") + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/koyeb/sandbox/__init__.py b/koyeb/sandbox/__init__.py index 4688c7c6..0bb6c09e 100644 --- a/koyeb/sandbox/__init__.py +++ b/koyeb/sandbox/__init__.py @@ -19,6 +19,7 @@ ) from .filesystem import FileInfo, SandboxFilesystem from .sandbox import AsyncSandbox, ExposedPort, ProcessInfo, Sandbox +from .snapshot import DeclarativeSnapshot, Snapshot, SnapshotStatus, SnapshotType from .utils import SandboxDeploymentError, SandboxError, SandboxServiceError, SandboxTimeoutError __all__ = [ @@ -40,4 +41,8 @@ "SandboxCommandError", "ExposedPort", "ProcessInfo", + "Snapshot", + "SnapshotType", + "SnapshotStatus", + "DeclarativeSnapshot", ] diff --git a/koyeb/sandbox/api.md b/koyeb/sandbox/api.md new file mode 100644 index 00000000..7cbe8081 --- /dev/null +++ b/koyeb/sandbox/api.md @@ -0,0 +1,103 @@ +# Sandbox Snapshot API + +## API Surface + +```python +# Snapshot +class Snapshot: + @classmethod + def get(snapshot_id, api_token=None, host=None) -> Snapshot + @classmethod + def list(service_id=None, snapshot_type=None, status=None, limit=50, offset=0, api_token=None, host=None) -> List[Snapshot] + def refresh() -> None + def wait_available(timeout=600, poll_interval=5.0) -> bool + def delete() -> bool + def spawn(name=None, wait_ready=True, timeout=300, **kwargs) -> Sandbox + +# DeclarativeSnapshot +class DeclarativeSnapshot: + def __init__(name, image, workdir=None, api_token=None, host=None, delete_builder=True) + # Declare build steps. + def file(path, content) -> DeclarativeSnapshot + def copy(src, dst) -> DeclarativeSnapshot + def run(command, cwd=None) -> DeclarativeSnapshot + # Run the build steps and generate a snapshot. + def build(snapshot_name=None) -> Snapshot + +# Sandbox extensions +class Sandbox: + def snapshot(name, snapshot_type=SnapshotType.FILESYSTEM, wait_available=True, timeout=600) -> Snapshot + @staticmethod + def template(name, image, workdir=None, api_token=None, host=None, delete_builder=True) -> DeclarativeSnapshot +``` + +## Enums + +**SnapshotType**: `FILESYSTEM` | `FULL` +**SnapshotStatus**: `INVALID` | `CREATING` | `UPLOADING` | `AVAILABLE` | `DELETING` | `DELETED` | `FAILED` + +## Snapshot + +### Fields +`id`, `name`, `service_id`, `snapshot_type`, `status`, `created_at`, `deployment_id`, `available_at`, `size`, `region`, `organization_id`, `project_id`, `messages`, `operations`, `api_token`, `host`, `sandbox_secret` + +### Methods +`get(snapshot_id, api_token, host) -> Snapshot` +`list(service_id, snapshot_type, status, limit, offset, api_token, host) -> List[Snapshot]` +`refresh()` +`wait_available(timeout=600, poll_interval=5.0) -> bool` +`delete() -> bool` +`spawn(name, wait_ready=True, timeout=300, **kwargs) -> Sandbox` + +## Sandbox + +`snapshot(name, snapshot_type=FILESYSTEM, wait_available=True, timeout=600) -> Snapshot` +`template(name, image, workdir=None, api_token=None, host=None, delete_builder=True) -> DeclarativeSnapshot` + +## DeclarativeSnapshot + +Builder for creating snapshots declaratively. + +`file(path, content) -> DeclarativeSnapshot` +`copy(src, dst) -> DeclarativeSnapshot` +`run(command, cwd=None) -> DeclarativeSnapshot` +`build(snapshot_name=None) -> Snapshot` - Returns snapshot with operations list +`get_operations() -> List[str]` + +## Examples + +### 1. Snapshot & Spawn +```python +from koyeb import Sandbox +sbx = Sandbox.create(image="python:3.12", wait_ready=True) +sbx.exec("pip3 install requests") +snapshot = sbx.snapshot(name="python-with-deps") +sbx2 = snapshot.spawn(name="test-runner", wait_ready=True) +``` + +### 2. Declarative Builder +```python +from koyeb import Sandbox +snapshot = ( + Sandbox.template("ci-env", image="python:3.12", workdir="/workspace") + .file("requirements.txt", "pytest\nrequests") + .run("pip install -r requirements.txt") + .build(snapshot_name="ci-snapshot") +) +for op in snapshot.operations: + print(f" - {op}") +``` + +### 3. Full Snapshot +```python +from koyeb.sandbox import SnapshotType +snapshot = sbx.snapshot(name="full", snapshot_type=SnapshotType.FULL) +``` + +### 4. Parallel Spawn +```python +runner1 = snapshot.spawn(name="runner1", wait_ready=False) +runner2 = snapshot.spawn(name="runner2", wait_ready=False) +for runner in [runner1, runner2]: + runner.wait_ready(timeout=300) +``` diff --git a/koyeb/sandbox/sandbox.py b/koyeb/sandbox/sandbox.py index 7c67bbbd..ff642903 100644 --- a/koyeb/sandbox/sandbox.py +++ b/koyeb/sandbox/sandbox.py @@ -11,6 +11,7 @@ import secrets import time from dataclasses import dataclass +from datetime import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple from koyeb.api.api.deployments_api import DeploymentsApi @@ -86,6 +87,7 @@ def __init__( sandbox_secret: Optional[str] = None, poll_interval: float = DEFAULT_POLL_INTERVAL, host: Optional[str] = None, + snapshot_id: Optional[str] = None, ): self.sandbox_id = sandbox_id self.app_id = app_id @@ -95,6 +97,7 @@ def __init__( self.sandbox_secret = sandbox_secret self.poll_interval = poll_interval self.host = host + self.snapshot_id = snapshot_id self._created_at = time.time() self._sandbox_url: Optional[Tuple[str, Optional[str]]] = None self._domain: Optional[str] = None @@ -137,6 +140,8 @@ def create( command: Optional[str] = None, args: Optional[List[str]] = None, host: Optional[str] = None, + snapshot_id: Optional[str] = None, + sandbox_secret: Optional[str] = None, ) -> Sandbox: """ Create a new sandbox instance. @@ -178,6 +183,8 @@ def create( entrypoint: Override the default entrypoint of the Docker image (e.g., ["/bin/sh", "-c"]) command: Override the default command of the Docker image (e.g., "python app.py") host: Koyeb API host URL. If not provided, will try to get from KOYEB_API_HOST env var (defaults to https://app.koyeb.com) + snapshot_id: Optional snapshot ID to create the sandbox from. If provided, the sandbox will be initialized from this snapshot. + sandbox_secret: Optional sandbox secret to use for executor authentication. If not provided, a new one will be generated. Returns: Sandbox: A new Sandbox instance @@ -228,6 +235,8 @@ def create( command=command, args=args, host=host, + snapshot_id=snapshot_id, + sandbox_secret=sandbox_secret, ) if wait_ready: @@ -268,6 +277,8 @@ def _create_sync( command: Optional[str] = None, args: Optional[List[str]] = None, host: Optional[str] = None, + snapshot_id: Optional[str] = None, + sandbox_secret: Optional[str] = None, ) -> Sandbox: """ Synchronous creation method that returns creation parameters. @@ -281,8 +292,9 @@ def _create_sync( # Always create routes (ports are always exposed, default to "http") routes = create_koyeb_sandbox_routes() - # Generate secure sandbox secret - sandbox_secret = secrets.token_urlsafe(32) + # Generate secure sandbox secret if not provided + if sandbox_secret is None: + sandbox_secret = secrets.token_urlsafe(32) # Add SANDBOX_SECRET to environment variables if env is None: @@ -299,38 +311,48 @@ def _create_sync( ) app_id = app_response.app.id - env_vars = build_env_vars(env) - config_file_objects = build_config_files(config_files) - docker_source = create_docker_source( - image, privileged=privileged, image_registry_secret=registry_secret, - entrypoint=entrypoint, command=command, args=args, - ) - - deployment_definition = create_deployment_definition( - name=name, - docker_source=docker_source, - env_vars=env_vars, - instance_type=instance_type, - exposed_port_protocol=exposed_port_protocol, - region=region, - routes=routes, - idle_timeout=idle_timeout, - enable_tcp_proxy=enable_tcp_proxy, - _experimental_enable_light_sleep=_experimental_enable_light_sleep, - _experimental_deep_sleep_value=_experimental_deep_sleep_value, - enable_mesh=enable_mesh, - config_files=config_file_objects if config_file_objects else None, - ) - service_life_cycle = ServiceLifeCycle( delete_after_create=delete_after_delay, delete_after_sleep=delete_after_inactivity_delay, ) - create_service = CreateService( - app_id=app_id, - definition=deployment_definition, - life_cycle=service_life_cycle, - ) + + # If using a snapshot, don't send definition + # The snapshot already contains all the configuration + if snapshot_id: + create_service = CreateService( + app_id=app_id, + life_cycle=service_life_cycle, + instance_snapshot_id=snapshot_id, + name=name, + ) + else: + env_vars = build_env_vars(env) + config_file_objects = build_config_files(config_files) + docker_source = create_docker_source( + image, privileged=privileged, image_registry_secret=registry_secret, + entrypoint=entrypoint, command=command, args=args, + ) + deployment_definition = create_deployment_definition( + name=name, + docker_source=docker_source, + env_vars=env_vars, + instance_type=instance_type, + exposed_port_protocol=exposed_port_protocol, + region=region, + routes=routes, + idle_timeout=idle_timeout, + enable_tcp_proxy=enable_tcp_proxy, + _experimental_enable_light_sleep=_experimental_enable_light_sleep, + _experimental_deep_sleep_value=_experimental_deep_sleep_value, + enable_mesh=enable_mesh, + config_files=config_file_objects if config_file_objects else None, + ) + create_service = CreateService( + app_id=app_id, + definition=deployment_definition, + life_cycle=service_life_cycle, + name=name, + ) service_response = services_api.create_service(service=create_service) service_id = service_response.service.id @@ -343,6 +365,7 @@ def _create_sync( sandbox_secret=sandbox_secret, poll_interval=poll_interval, host=host, + snapshot_id=snapshot_id, ) @classmethod @@ -448,6 +471,197 @@ def get_from_id( return sandbox + def snapshot( + self, + name: str, + snapshot_type: "SnapshotType" = None, + wait_available: bool = True, + timeout: int = 600, + ) -> "Snapshot": + """ + Create a snapshot of this sandbox. + + Captures the current state of the sandbox's filesystem (and optionally + running processes for FULL type) so it can be restored later. + + Args: + name: Name for the snapshot + snapshot_type: Type of snapshot to create (FILESYSTEM or FULL). + Defaults to FILESYSTEM. + wait_available: Whether to wait for snapshot to become available + timeout: Timeout in seconds for waiting + + Returns: + Snapshot: The created snapshot object + + Raises: + SandboxError: If snapshot creation fails + """ + from .snapshot import Snapshot, SnapshotType + + if snapshot_type is None: + snapshot_type = SnapshotType.FILESYSTEM + + try: + from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType + from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + from .snapshot import SnapshotStatus + + # Get API clients + clients = get_api_clients(self.api_token, self.host) + + from koyeb.api.models.instance_status import InstanceStatus + + # Get the first running instance for this service + instances_reply = clients.instances.list_instances( + service_id=self.service_id, + statuses=[InstanceStatus.HEALTHY, InstanceStatus.STARTING, InstanceStatus.ALLOCATING], + limit="1", + ) + + if not instances_reply.instances or len(instances_reply.instances) == 0: + raise SandboxError(f"No running instances found for service {self.service_id}") + + instance = instances_reply.instances[0] + instance_id = instance.id + + # Map SnapshotType to InstanceSnapshotType + if snapshot_type == SnapshotType.FILESYSTEM: + instance_snapshot_type = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FILESYSTEM + else: + instance_snapshot_type = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FULL + + # Create the snapshot via API + create_request = CreateInstanceSnapshotRequest( + instance_id=instance_id, + name=name, + type=instance_snapshot_type, + ) + + reply = clients.instance_snapshots.create_instance_snapshot(create_request) + + if not reply.instance_snapshot: + raise SandboxError("Failed to create snapshot: no snapshot returned from API") + + api_snapshot = reply.instance_snapshot + + # Convert API snapshot to our Snapshot object + # Include the sandbox_secret so spawned sandboxes can use the same executor + snapshot = Snapshot._from_instance_api_snapshot( + api_snapshot, self.api_token, self.host, sandbox_secret=self.sandbox_secret + ) + + # Wait for snapshot to become available if requested + if wait_available: + start_time = time.time() + while time.time() - start_time < timeout: + snapshot.refresh() + if snapshot.status == SnapshotStatus.AVAILABLE: + break + if snapshot.status == SnapshotStatus.FAILED: + raise SandboxError(f"Snapshot creation failed: {snapshot.messages}") + time.sleep(self.poll_interval) + else: + raise SandboxTimeoutError( + f"Snapshot did not become available within {timeout} seconds" + ) + + return snapshot + + except Exception as e: + raise SandboxError(f"Failed to create snapshot: {e}") from e + + @classmethod + def create_from_snapshot( + cls, + snapshot: Union["Snapshot", str], + name: Optional[str] = None, + wait_ready: bool = True, + timeout: int = 300, + **create_kwargs, + ) -> "Sandbox": + """ + Create a new sandbox from a snapshot. + + Args: + snapshot: Snapshot object or snapshot ID string + name: Name for the new sandbox + wait_ready: Whether to wait for sandbox to be ready + timeout: Timeout in seconds + **create_kwargs: Additional arguments to pass to create() + + Returns: + Sandbox: A new sandbox instance + """ + from .snapshot import Snapshot + + if isinstance(snapshot, str): + snapshot_id = snapshot + elif isinstance(snapshot, Snapshot): + snapshot_id = snapshot.id + else: + raise SandboxError(f"Invalid snapshot type: {type(snapshot)}") + + create_params = { + "snapshot_id": snapshot_id, + "wait_ready": wait_ready, + "timeout": timeout, + } + if name: + create_params["name"] = name + + create_params.update(create_kwargs) + return cls.create(**create_params) + + @classmethod + def template( + cls, + name: str, + image: str, + workdir: Optional[str] = None, + api_token: Optional[str] = None, + host: Optional[str] = None, + delete_builder: bool = True, + ) -> "DeclarativeSnapshot": + """ + Create a declarative snapshot builder. + + Use this to build a reusable snapshot by declaratively defining + the sandbox environment (files, packages, etc.) and then building + a snapshot that can be used to spawn pre-configured sandboxes. + + Args: + name: Name for the template + image: Docker image to use + workdir: Working directory in the sandbox + api_token: Koyeb API token + host: Koyeb API host + delete_builder: Whether to delete the builder sandbox after creating the snapshot (default: True) + + Returns: + DeclarativeSnapshot: Fluent builder for creating snapshots + + Example: + snapshot = ( + Sandbox.template("python-ci", image="python:3.12", workdir="/workspace") + .file("requirements.txt", "pytest\\nrequests") + .run("pip install -r requirements.txt") + .build(snapshot_name="python-ci-env") + ) + + sbx = snapshot.spawn(name="test-runner") + """ + from .snapshot import DeclarativeSnapshot + + return DeclarativeSnapshot( + name=name, + image=image, + workdir=workdir, + api_token=api_token, + host=host, + delete_builder=delete_builder, + ) + _DEPLOYMENT_ERROR_STATUSES = { DeploymentStatus.ERROR, DeploymentStatus.ERRORING, @@ -1265,6 +1479,8 @@ async def create( command: Optional[str] = None, args: Optional[List[str]] = None, host: Optional[str] = None, + snapshot_id: Optional[str] = None, + sandbox_secret: Optional[str] = None, ) -> AsyncSandbox: """ Create a new sandbox instance with async support. @@ -1308,6 +1524,8 @@ async def create( entrypoint: Override the default entrypoint of the Docker image (e.g., ["/bin/sh", "-c"]) command: Override the default command of the Docker image (e.g., "python app.py") host: Koyeb API host URL. If not provided, will try to get from KOYEB_API_HOST env var (defaults to https://app.koyeb.com) + snapshot_id: Optional snapshot ID to create the sandbox from. If provided, the sandbox will be initialized from this snapshot. + sandbox_secret: Optional sandbox secret to use for executor authentication. If not provided, a new one will be generated. Returns: AsyncSandbox: A new AsyncSandbox instance @@ -1334,8 +1552,9 @@ async def create( # Always create routes routes = create_koyeb_sandbox_routes() - # Generate secure sandbox secret - sandbox_secret = secrets.token_urlsafe(32) + # Generate secure sandbox secret if not provided + if sandbox_secret is None: + sandbox_secret = secrets.token_urlsafe(32) # Add SANDBOX_SECRET to environment variables if env is None: @@ -1352,40 +1571,50 @@ async def create( ) app_id = app_response.app.id - env_vars = build_env_vars(env) - config_file_objects = build_config_files(config_files) - docker_source = create_docker_source( - image, privileged=privileged, image_registry_secret=registry_secret, - entrypoint=entrypoint, command=command, args=args, - ) - - deployment_definition = create_deployment_definition( - name=name, - docker_source=docker_source, - env_vars=env_vars, - instance_type=instance_type, - exposed_port_protocol=exposed_port_protocol, - region=region, - routes=routes, - idle_timeout=idle_timeout, - enable_tcp_proxy=enable_tcp_proxy, - _experimental_enable_light_sleep=_experimental_enable_light_sleep, - _experimental_deep_sleep_value=_experimental_deep_sleep_value, - enable_mesh=enable_mesh, - config_files=config_file_objects if config_file_objects else None, - ) - service_life_cycle = AsyncServiceLifeCycle( delete_after_create=delete_after_delay, delete_after_sleep=delete_after_inactivity_delay, ) # Convert sync DeploymentDefinition to dict so the async Pydantic model # (which expects koyeb.api_async.models.DeploymentDefinition) can coerce it. - create_service = AsyncCreateService( - app_id=app_id, - definition=deployment_definition.to_dict(), - life_cycle=service_life_cycle, - ) + + # If using a snapshot, don't send definition + # The snapshot already contains all the configuration + if snapshot_id: + create_service = AsyncCreateService( + app_id=app_id, + life_cycle=service_life_cycle, + instance_snapshot_id=snapshot_id, + name=name, + ) + else: + env_vars = build_env_vars(env) + config_file_objects = build_config_files(config_files) + docker_source = create_docker_source( + image, privileged=privileged, image_registry_secret=registry_secret, + entrypoint=entrypoint, command=command, args=args, + ) + deployment_definition = create_deployment_definition( + name=name, + docker_source=docker_source, + env_vars=env_vars, + instance_type=instance_type, + exposed_port_protocol=exposed_port_protocol, + region=region, + routes=routes, + idle_timeout=idle_timeout, + enable_tcp_proxy=enable_tcp_proxy, + _experimental_enable_light_sleep=_experimental_enable_light_sleep, + _experimental_deep_sleep_value=_experimental_deep_sleep_value, + enable_mesh=enable_mesh, + config_files=config_file_objects if config_file_objects else None, + ) + create_service = AsyncCreateService( + app_id=app_id, + definition=deployment_definition.to_dict(), + life_cycle=service_life_cycle, + name=name, + ) service_response = await clients.services.create_service(service=create_service) service_id = service_response.service.id @@ -1398,6 +1627,7 @@ async def create( sandbox_secret=sandbox_secret, poll_interval=poll_interval, host=host, + snapshot_id=snapshot_id, ) if wait_ready: @@ -1567,6 +1797,149 @@ async def delete(self) -> None: clients = get_async_api_clients(self.api_token, self.host) await clients.apps.delete_app(self.app_id) + async def snapshot( + self, + name: str, + snapshot_type: "SnapshotType" = None, + wait_available: bool = True, + timeout: int = 600, + ) -> "Snapshot": + """ + Create a snapshot of this sandbox asynchronously. + + Captures the current state of the sandbox's filesystem (and optionally + running processes for FULL type) so it can be restored later. + + Args: + name: Name for the snapshot + snapshot_type: Type of snapshot to create (FILESYSTEM or FULL). + Defaults to FILESYSTEM. + wait_available: Whether to wait for snapshot to become available + timeout: Timeout in seconds for waiting + + Returns: + Snapshot: The created snapshot object + + Raises: + SandboxError: If snapshot creation fails + """ + from .snapshot import Snapshot, SnapshotType + + if snapshot_type is None: + snapshot_type = SnapshotType.FILESYSTEM + + try: + from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType + from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + from .utils import get_async_api_clients + from .snapshot import SnapshotStatus + + # Get async API clients + clients = get_async_api_clients(self.api_token, self.host) + + from koyeb.api.models.instance_status import InstanceStatus + + # Get the first running instance for this service + instances_reply = await clients.instances.list_instances( + service_id=self.service_id, + statuses=[InstanceStatus.HEALTHY, InstanceStatus.STARTING, InstanceStatus.ALLOCATING], + limit="1", + ) + + if not instances_reply.instances or len(instances_reply.instances) == 0: + raise SandboxError(f"No running instances found for service {self.service_id}") + + instance = instances_reply.instances[0] + instance_id = instance.id + + # Map SnapshotType to InstanceSnapshotType + if snapshot_type == SnapshotType.FILESYSTEM: + instance_snapshot_type = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FILESYSTEM + else: + instance_snapshot_type = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FULL + + # Create the snapshot via API + create_request = CreateInstanceSnapshotRequest( + instance_id=instance_id, + name=name, + type=instance_snapshot_type, + ) + + reply = await clients.instance_snapshots.create_instance_snapshot(create_request) + + if not reply.instance_snapshot: + raise SandboxError("Failed to create snapshot: no snapshot returned from API") + + api_snapshot = reply.instance_snapshot + + # Convert API snapshot to our Snapshot object + # Include the sandbox_secret so spawned sandboxes can use the same executor + snapshot = Snapshot._from_instance_api_snapshot( + api_snapshot, self.api_token, self.host, sandbox_secret=self.sandbox_secret + ) + + # Wait for snapshot to become available if requested + if wait_available: + start_time = time.time() + while time.time() - start_time < timeout: + snapshot.refresh() + if snapshot.status == SnapshotStatus.AVAILABLE: + break + if snapshot.status == SnapshotStatus.FAILED: + raise SandboxError(f"Snapshot creation failed: {snapshot.messages}") + await asyncio.sleep(self.poll_interval) + else: + raise SandboxTimeoutError( + f"Snapshot did not become available within {timeout} seconds" + ) + + return snapshot + + except Exception as e: + raise SandboxError(f"Failed to create snapshot: {e}") from e + + @classmethod + async def create_from_snapshot( + cls, + snapshot: Union["Snapshot", str], + name: Optional[str] = None, + wait_ready: bool = True, + timeout: int = 300, + **create_kwargs, + ) -> "AsyncSandbox": + """ + Create a new async sandbox from a snapshot. + + Args: + snapshot: Snapshot object or snapshot ID string + name: Name for the new sandbox + wait_ready: Whether to wait for sandbox to be ready + timeout: Timeout in seconds + **create_kwargs: Additional arguments to pass to create() + + Returns: + AsyncSandbox: A new async sandbox instance + """ + from .snapshot import Snapshot + + if isinstance(snapshot, str): + snapshot_id = snapshot + elif isinstance(snapshot, Snapshot): + snapshot_id = snapshot.id + else: + raise SandboxError(f"Invalid snapshot type: {type(snapshot)}") + + create_params = { + "snapshot_id": snapshot_id, + "wait_ready": wait_ready, + "timeout": timeout, + } + if name: + create_params["name"] = name + + create_params.update(create_kwargs) + return await cls.create(**create_params) + async def is_healthy(self) -> bool: """Check if sandbox is healthy and ready for operations asynchronously.""" if not await self._async_is_deployment_healthy(): diff --git a/koyeb/sandbox/snapshot.py b/koyeb/sandbox/snapshot.py new file mode 100644 index 00000000..64f55b93 --- /dev/null +++ b/koyeb/sandbox/snapshot.py @@ -0,0 +1,584 @@ +# coding: utf-8 + +""" +Koyeb Sandbox Snapshot - Snapshot functionality for Koyeb sandboxes +""" + +from __future__ import annotations + +import time +from dataclasses import dataclass, field +from datetime import datetime +from enum import Enum +from typing import Any, ClassVar, Dict, List, Optional, Union + +from .sandbox import Sandbox +from .utils import SandboxError, get_api_clients + + +class SnapshotType(Enum): + """Types of sandbox snapshots.""" + + FILESYSTEM = "filesystem" + FULL = "full" + + +class SnapshotStatus(Enum): + """Status of a sandbox snapshot.""" + + INVALID = "invalid" + CREATING = "creating" + UPLOADING = "uploading" + AVAILABLE = "available" + DELETING = "deleting" + DELETED = "deleted" + FAILED = "failed" + + +@dataclass +class Snapshot: + """ + Represents a sandbox snapshot resource. + + A snapshot captures the state of a sandbox at a specific point in time, + including its filesystem and optionally running processes. Sandboxes can + be spawned from snapshots to create pre-configured environments. + """ + + id: str + name: str + service_id: str + snapshot_type: SnapshotType + status: SnapshotStatus + created_at: datetime + deployment_id: Optional[str] = None + available_at: Optional[datetime] = None + size: Optional[int] = None + region: str = "" + organization_id: str = "" + project_id: Optional[str] = None + messages: List[str] = field(default_factory=list) + api_token: Optional[str] = None + host: Optional[str] = None + sandbox_secret: Optional[str] = None + operations: List[str] = field(default_factory=list) + + @classmethod + def get( + cls, + snapshot_id: str, + api_token: Optional[str] = None, + host: Optional[str] = None, + ) -> Snapshot: + """ + Get a snapshot by ID. + + Uses the InstanceSnapshots API which is for sandbox/service instance snapshots. + + Args: + snapshot_id: The ID of the snapshot to retrieve + api_token: Koyeb API token (falls back to KOYEB_API_TOKEN env var) + host: Koyeb API host + + Returns: + Snapshot: The snapshot object + + Raises: + SandboxError: If snapshot cannot be retrieved + """ + import os + + if not api_token: + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + raise SandboxError("API token is required. Set KOYEB_API_TOKEN environment variable.") + + try: + clients = get_api_clients(api_token, host) + reply = clients.instance_snapshots.get_instance_snapshot(snapshot_id) + + if not reply.instance_snapshot: + raise SandboxError(f"Snapshot {snapshot_id} not found") + + api_snapshot = reply.instance_snapshot + return cls._from_instance_api_snapshot(api_snapshot, api_token, host) + + except Exception as e: + raise SandboxError(f"Failed to get snapshot: {e}") from e + + @classmethod + def list( + cls, + service_id: Optional[str] = None, + snapshot_type: Optional[SnapshotType] = None, + status: Optional[SnapshotStatus] = None, + limit: int = 50, + offset: int = 0, + api_token: Optional[str] = None, + host: Optional[str] = None, + ) -> List[Snapshot]: + """ + List snapshots with optional filters. + + Uses the InstanceSnapshots API which is for sandbox/service instance snapshots. + + Args: + service_id: Filter by service ID + snapshot_type: Filter by snapshot type + status: Filter by snapshot status + limit: Maximum number of snapshots to return + offset: Offset for pagination + api_token: Koyeb API token + host: Koyeb API host + + Returns: + List of Snapshot objects + """ + import os + + if not api_token: + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + raise SandboxError("API token is required. Set KOYEB_API_TOKEN environment variable.") + + try: + from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType + from koyeb.api.models.instance_snapshot_status import InstanceSnapshotStatus + + clients = get_api_clients(api_token, host) + + # Map our SnapshotType to InstanceSnapshotType + type_param = None + if snapshot_type: + if snapshot_type == SnapshotType.FILESYSTEM: + type_param = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FILESYSTEM + elif snapshot_type == SnapshotType.FULL: + type_param = InstanceSnapshotType.INSTANCE_SNAPSHOT_TYPE_FULL + + # Map our SnapshotStatus to InstanceSnapshotStatus + status_param = None + if status: + status_map = { + SnapshotStatus.CREATING: InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_CREATING, + SnapshotStatus.UPLOADING: InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_UPLOADING, + SnapshotStatus.AVAILABLE: InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_AVAILABLE, + SnapshotStatus.FAILED: InstanceSnapshotStatus.INSTANCE_SNAPSHOT_STATUS_FAILED, + } + status_param = status_map.get(status) + + reply = clients.instance_snapshots.list_instance_snapshots( + limit=limit, + offset=offset, + service_id=service_id, + type=type_param, + status=status_param, + ) + + snapshots = [] + if reply.instance_snapshots: + for api_snapshot in reply.instance_snapshots: + snapshots.append(cls._from_instance_api_snapshot(api_snapshot, api_token, host)) + + return snapshots + + except Exception as e: + raise SandboxError(f"Failed to list snapshots: {e}") from e + + @classmethod + def _from_api_snapshot( + cls, + api_snapshot: Any, + api_token: Optional[str], + host: Optional[str], + ) -> Snapshot: + """Convert API snapshot model to Snapshot object.""" + snapshot_type = SnapshotType.FILESYSTEM + if api_snapshot.type and api_snapshot.type.value: + try: + snapshot_type = SnapshotType(api_snapshot.type.value) + except ValueError: + snapshot_type = SnapshotType.FILESYSTEM + + status = SnapshotStatus.INVALID + if api_snapshot.status and api_snapshot.status.value: + try: + status = SnapshotStatus(api_snapshot.status.value) + except ValueError: + status = SnapshotStatus.INVALID + + return cls( + id=api_snapshot.id or "", + name=api_snapshot.name or "", + service_id=api_snapshot.service_id or "", + snapshot_type=snapshot_type, + status=status, + created_at=api_snapshot.created_at or datetime.utcnow(), + deployment_id=api_snapshot.deployment_id, + available_at=api_snapshot.available_at, + size=api_snapshot.size, + region=api_snapshot.region or "", + organization_id=api_snapshot.organization_id or "", + project_id=api_snapshot.project_id, + messages=api_snapshot.messages or [], + api_token=api_token, + host=host, + ) + + @classmethod + def _from_instance_api_snapshot( + cls, + api_snapshot: Any, + api_token: Optional[str], + host: Optional[str], + sandbox_secret: Optional[str] = None, + ) -> Snapshot: + """Convert InstanceSnapshot API model to Snapshot object.""" + # Map InstanceSnapshotType to our SnapshotType + snapshot_type = SnapshotType.FILESYSTEM + if api_snapshot.type and api_snapshot.type.value: + type_map = { + "INSTANCE_SNAPSHOT_TYPE_FILESYSTEM": SnapshotType.FILESYSTEM, + "INSTANCE_SNAPSHOT_TYPE_FULL": SnapshotType.FULL, + } + snapshot_type = type_map.get(api_snapshot.type.value, SnapshotType.FILESYSTEM) + + # Map InstanceSnapshotStatus to our SnapshotStatus + status = SnapshotStatus.INVALID + if api_snapshot.status and api_snapshot.status.value: + status_map = { + "INSTANCE_SNAPSHOT_STATUS_INVALID": SnapshotStatus.INVALID, + "INSTANCE_SNAPSHOT_STATUS_CREATING": SnapshotStatus.CREATING, + "INSTANCE_SNAPSHOT_STATUS_UPLOADING": SnapshotStatus.UPLOADING, + "INSTANCE_SNAPSHOT_STATUS_AVAILABLE": SnapshotStatus.AVAILABLE, + "INSTANCE_SNAPSHOT_STATUS_DELETING": SnapshotStatus.DELETING, + "INSTANCE_SNAPSHOT_STATUS_DELETED": SnapshotStatus.DELETED, + "INSTANCE_SNAPSHOT_STATUS_FAILED": SnapshotStatus.FAILED, + } + status = status_map.get(api_snapshot.status.value, SnapshotStatus.INVALID) + + # Get region from regional_deployment_id if available, otherwise use empty string + region = "" + if api_snapshot.regional_deployment_id: + # regional_deployment_id typically contains region info, e.g., "region-service-id" + # For now, we'll leave it as empty since we don't have a direct mapping + region = "" + + return cls( + id=api_snapshot.id or "", + name=api_snapshot.name or "", + service_id=api_snapshot.service_id or "", + snapshot_type=snapshot_type, + status=status, + created_at=api_snapshot.created_at or datetime.utcnow(), + deployment_id=api_snapshot.deployment_id, + available_at=api_snapshot.available_at, + region=region, + organization_id=api_snapshot.organization_id or "", + project_id=api_snapshot.project_id, + messages=api_snapshot.messages or [], + api_token=api_token, + host=host, + sandbox_secret=sandbox_secret, + ) + + def refresh(self) -> None: + """Refresh snapshot state from the API.""" + if not self.id or not self.api_token: + raise SandboxError("Cannot refresh snapshot without ID and API token") + + updated = self.get(self.id, api_token=self.api_token, host=self.host) + # Preserve sandbox_secret, api_token, host, and operations - don't overwrite from API + for field in self.__dataclass_fields__: + if field not in ("api_token", "host", "sandbox_secret", "operations"): + setattr(self, field, getattr(updated, field)) + + def wait_available( + self, + timeout: int = 600, + poll_interval: float = 5.0, + ) -> bool: + """ + Wait for snapshot to become available. + + Args: + timeout: Maximum time to wait in seconds + poll_interval: Time between status checks in seconds + + Returns: + True if snapshot became available, False if timeout + """ + import time + + start_time = time.time() + while time.time() - start_time < timeout: + self.refresh() + if self.status == SnapshotStatus.AVAILABLE: + return True + if self.status == SnapshotStatus.FAILED: + return False + time.sleep(poll_interval) + return False + + def delete(self) -> bool: + """ + Delete this snapshot. + + Uses the InstanceSnapshots API which is for sandbox/service instance snapshots. + + Returns: + True if deletion was successful + """ + if not self.id or not self.api_token: + raise SandboxError("Cannot delete snapshot without ID and API token") + + try: + clients = get_api_clients(self.api_token, self.host) + reply = clients.instance_snapshots.delete_instance_snapshot(self.id) + return True + + except Exception as e: + raise SandboxError(f"Failed to delete snapshot: {e}") from e + + def spawn( + self, + name: Optional[str] = None, + wait_ready: bool = True, + timeout: int = 300, + **create_kwargs, + ) -> Sandbox: + """ + Spawn a new sandbox from this snapshot. + + Args: + name: Name for the new sandbox + wait_ready: Whether to wait for sandbox to be ready + timeout: Timeout for sandbox creation in seconds + **create_kwargs: Additional arguments to pass to Sandbox.create() + + Returns: + Sandbox: A new sandbox instance initialized from this snapshot + """ + if not self.id: + raise SandboxError("Cannot spawn from snapshot without ID") + + create_params = { + "snapshot_id": self.id, + "wait_ready": wait_ready, + "timeout": timeout, + } + if name: + create_params["name"] = name + if self.api_token: + create_params["api_token"] = self.api_token + if self.host: + create_params["host"] = self.host + if self.sandbox_secret: + create_params["sandbox_secret"] = self.sandbox_secret + + create_params.update(create_kwargs) + return Sandbox.create(**create_params) + + +class DeclarativeSnapshot: + """ + Fluent builder for creating sandbox snapshots declaratively. + + This builder allows you to define a sandbox environment by: + - Writing files + - Copying local files/directories + - Running setup commands + - Setting environment variables + + Then builds a snapshot that can be used to spawn pre-configured sandboxes. + """ + + def __init__( + self, + name: str, + image: str, + workdir: Optional[str] = None, + api_token: Optional[str] = None, + host: Optional[str] = None, + delete_builder: bool = True, + ): + """ + Initialize the declarative snapshot builder. + + Args: + name: Name for the template/builder + image: Docker image to use for the sandbox + workdir: Working directory in the sandbox + api_token: Koyeb API token + host: Koyeb API host + delete_builder: Whether to delete the builder sandbox after creating the snapshot (default: True) + """ + import os + + if not api_token: + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + raise SandboxError("API token is required. Set KOYEB_API_TOKEN environment variable.") + + self._name = name + self._image = image + self._workdir = workdir + self._api_token = api_token + self._host = host + self._delete_builder = delete_builder + self._files: Dict[str, str] = {} + self._copy_ops: List[Tuple[str, str]] = [] + self._commands: List[str] = [] + self._operations: List[str] = [] + self._builder_sandbox: Optional[Sandbox] = None + + def file(self, path: str, content: str) -> DeclarativeSnapshot: + """ + Write a file to the sandbox during build. + + Args: + path: Path in the sandbox (e.g., "/workspace/requirements.txt") + content: File content as string + + Returns: + self for method chaining + """ + self._files[path] = content + return self + + def copy(self, src: str, dst: str) -> DeclarativeSnapshot: + """ + Copy a local file or directory to the sandbox during build. + + Args: + src: Local source path (file or directory) + dst: Destination path in the sandbox + + Returns: + self for method chaining + """ + self._copy_ops.append((src, dst)) + return self + + def run(self, command: str, cwd: Optional[str] = None) -> DeclarativeSnapshot: + """ + Run a command during build. + + Args: + command: Command to execute + cwd: Working directory for the command + + Returns: + self for method chaining + """ + if cwd: + self._commands.append(f"cd {cwd} && {command}") + else: + self._commands.append(command) + return self + + def build( + self, + snapshot_name: Optional[str] = None, + ) -> Snapshot: + """ + Build the snapshot by creating a temporary sandbox, + applying all configurations, and creating a snapshot. + + The builder sandbox is automatically deleted after the snapshot is created. + + Args: + snapshot_name: Name for the snapshot (defaults to builder name) + + Returns: + Snapshot: The created snapshot + """ + import os + import shutil + + name = snapshot_name or self._name + + try: + # Create builder sandbox + self._builder_sandbox = Sandbox.create( + image=self._image, + name=f"builder-{self._name}", + wait_ready=True, + api_token=self._api_token, + host=self._host, + ) + + # Apply working directory + if self._workdir: + self._operations.append(f"set_workdir: {self._workdir}") + self._builder_sandbox.filesystem.mkdir(self._workdir) + + # Write files + for path, content in self._files.items(): + self._operations.append(f"create_file: {path}") + self._builder_sandbox.filesystem.write_file(path, content) + + # Copy local files/directories + for src, dst in self._copy_ops: + self._operations.append(f"copy: {src} -> {dst}") + if os.path.isdir(src): + # Copy directory recursively + self._copy_directory(src, dst) + else: + # Copy single file + with open(src, "r") as f: + content = f.read() + self._builder_sandbox.filesystem.write_file(dst, content) + + # Run commands + for command in self._commands: + self._operations.append(f"run: {command}") + self._builder_sandbox.exec(command) + + # Create snapshot + snapshot = self._builder_sandbox.snapshot( + name=name, + snapshot_type=SnapshotType.FILESYSTEM, + wait_available=True, + ) + + # Store operations in the snapshot + snapshot.operations = self._operations + + return snapshot + + except Exception as e: + raise SandboxError(f"Failed to build snapshot: {e}") from e + + finally: + # Delete the builder sandbox if requested + if self._delete_builder and self._builder_sandbox: + try: + self._builder_sandbox.delete() + except Exception: + pass + + def _copy_directory(self, src_dir: str, dst_dir: str) -> None: + """Recursively copy a local directory to the sandbox.""" + if not self._builder_sandbox: + return + + for root, dirs, files in os.walk(src_dir): + # Create directories + for d in dirs: + src_path = os.path.join(root, d) + rel_path = os.path.relpath(src_path, src_dir) + dst_path = os.path.join(dst_dir, rel_path) + self._builder_sandbox.filesystem.mkdir(dst_path) + + # Copy files + for f in files: + src_path = os.path.join(root, f) + rel_path = os.path.relpath(src_path, src_dir) + dst_path = os.path.join(dst_dir, rel_path) + with open(src_path, "r") as f: + content = f.read() + self._builder_sandbox.filesystem.write_file(dst_path, content) + + def get_operations(self) -> List[str]: + """Get list of operations recorded during build.""" + return self._operations diff --git a/koyeb/sandbox/utils.py b/koyeb/sandbox/utils.py index 4482386f..aa84794e 100644 --- a/koyeb/sandbox/utils.py +++ b/koyeb/sandbox/utils.py @@ -16,8 +16,10 @@ CatalogInstancesApi, DeploymentsApi, InstancesApi, + InstanceSnapshotsApi, SecretsApi, ServicesApi, + SnapshotsApi, ) from koyeb.api.models.config_file import ConfigFile from koyeb.api.models.deployment_definition import DeploymentDefinition @@ -101,6 +103,8 @@ class ApiClients: catalog_instances: CatalogInstancesApi deployments: DeploymentsApi secrets: SecretsApi + snapshots: Any + instance_snapshots: Any _api_clients_cache: Dict[Tuple[str, str], ApiClients] = {} @@ -150,6 +154,8 @@ def get_api_clients( catalog_instances=CatalogInstancesApi(api_client), deployments=DeploymentsApi(api_client), secrets=SecretsApi(api_client), + snapshots=SnapshotsApi(api_client), + instance_snapshots=InstanceSnapshotsApi(api_client), ) _api_clients_cache[cache_key] = clients return clients @@ -164,8 +170,10 @@ def get_api_clients( CatalogInstancesApi as AsyncCatalogInstancesApi, DeploymentsApi as AsyncDeploymentsApi, InstancesApi as AsyncInstancesApi, + InstanceSnapshotsApi as AsyncInstanceSnapshotsApi, SecretsApi as AsyncSecretsApi, ServicesApi as AsyncServicesApi, + SnapshotsApi as AsyncSnapshotsApi, ) @@ -179,6 +187,8 @@ class AsyncApiClients: catalog_instances: AsyncCatalogInstancesApi deployments: AsyncDeploymentsApi secrets: AsyncSecretsApi + snapshots: Any + instance_snapshots: Any _async_api_clients_cache: Dict[Tuple[str, str], AsyncApiClients] = {} @@ -228,6 +238,8 @@ def get_async_api_clients( catalog_instances=AsyncCatalogInstancesApi(api_client), deployments=AsyncDeploymentsApi(api_client), secrets=AsyncSecretsApi(api_client), + snapshots=AsyncSnapshotsApi(api_client), + instance_snapshots=AsyncInstanceSnapshotsApi(api_client), ) _async_api_clients_cache[cache_key] = clients return clients From ae7839dd390411a1a9bad22f712bd831f4c5620b Mon Sep 17 00:00:00 2001 From: nicoche <78445450+nicoche@users.noreply.github.com> Date: Sun, 28 Jun 2026 00:31:17 +0200 Subject: [PATCH 3/4] Add support for already existing snapshots --- examples/21_snapshot_and_spawn.py | 33 ++++- koyeb/sandbox/sandbox.py | 239 ++++++++++++++++++++++++------ koyeb/sandbox/snapshot.py | 22 ++- 3 files changed, 238 insertions(+), 56 deletions(-) diff --git a/examples/21_snapshot_and_spawn.py b/examples/21_snapshot_and_spawn.py index fca63349..83c6e48a 100644 --- a/examples/21_snapshot_and_spawn.py +++ b/examples/21_snapshot_and_spawn.py @@ -30,6 +30,13 @@ def main(): ) print(f" ✓ Sandbox created: {sbx.name}") + # Create some files to verify filesystem preservation + print("✓ Creating files...") + sbx.filesystem.mkdir("/workspace") + sbx.filesystem.write_file("/workspace/test_file.txt", "Hello from snapshot!") + sbx.filesystem.write_file("/workspace/requirements.txt", "requests\npytest\n") + print(" ✓ Files created") + # Install packages print("✓ Installing packages...") sbx.exec("pip3 install pytest requests") @@ -43,10 +50,13 @@ def main(): ) print(f" ✓ Snapshot created: {snapshot.name}") - # Spawn a new sandbox from the snapshot - print("✓ Spawning sandbox from snapshot...") + # Spawn a new sandbox from the snapshot with a different instance type + print("✓ Spawning sandbox from snapshot with different instance type...") sbx2 = snapshot.spawn( + image="python:3.12", name=f"test-runner-{suffix}", + instance_type="nano", + env={"SPAWNED_FROM_SNAPSHOT": "true"}, wait_ready=False, api_token=api_token, ) @@ -57,10 +67,23 @@ def main(): is_ready = sbx2.wait_ready(timeout=300) print(" ✓ Sandbox is ready") - # Verify packages are pre-installed from snapshot filesystem - print("✓ Verifying packages are pre-installed from snapshot filesystem...") + # Verify filesystem is preserved from snapshot + print("✓ Verifying filesystem is preserved from snapshot...") + + # Check that files exist + result = sbx2.exec("cat /workspace/test_file.txt") + assert result.stdout.strip() == "Hello from snapshot!", f"File content mismatch: {result.stdout}" + print(" ✓ Custom file preserved") + + # Check that packages are pre-installed result = sbx2.exec("python3 -c \"import requests; print('OK')\"") - print(f" ✓ Result: {result.stdout.strip()}") + assert result.stdout.strip() == "OK", f"Package not found: {result.stdout}" + print(" ✓ Packages preserved") + + # Verify env var is different from snapshot (new definition) + result = sbx2.exec("echo $SPAWNED_FROM_SNAPSHOT") + assert result.stdout.strip() == "true", f"Env var not set: {result.stdout}" + print(" ✓ New env vars applied (different from snapshot)") return 0 finally: diff --git a/koyeb/sandbox/sandbox.py b/koyeb/sandbox/sandbox.py index ff642903..10e572c0 100644 --- a/koyeb/sandbox/sandbox.py +++ b/koyeb/sandbox/sandbox.py @@ -12,7 +12,7 @@ import time from dataclasses import dataclass from datetime import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from koyeb.api.api.deployments_api import DeploymentsApi from koyeb.api.exceptions import ApiException, NotFoundException @@ -43,6 +43,7 @@ from .exec import AsyncSandboxExecutor, SandboxExecutor from .executor_client import AsyncSandboxClient, SandboxClient from .filesystem import AsyncSandboxFilesystem, SandboxFilesystem + from .snapshot import SnapshotType @dataclass @@ -140,7 +141,7 @@ def create( command: Optional[str] = None, args: Optional[List[str]] = None, host: Optional[str] = None, - snapshot_id: Optional[str] = None, + snapshot: Optional[Union[str, "Snapshot"]] = None, sandbox_secret: Optional[str] = None, ) -> Sandbox: """ @@ -183,7 +184,9 @@ def create( entrypoint: Override the default entrypoint of the Docker image (e.g., ["/bin/sh", "-c"]) command: Override the default command of the Docker image (e.g., "python app.py") host: Koyeb API host URL. If not provided, will try to get from KOYEB_API_HOST env var (defaults to https://app.koyeb.com) - snapshot_id: Optional snapshot ID to create the sandbox from. If provided, the sandbox will be initialized from this snapshot. + snapshot: Optional. A Snapshot object or snapshot name/ID string to create the sandbox from. + If provided, the sandbox will be initialized from this snapshot. + Can be either a Snapshot object (e.g., snapshot=my_snapshot) or a snapshot name/ID string (e.g., snapshot="my snapshot"). sandbox_secret: Optional sandbox secret to use for executor authentication. If not provided, a new one will be generated. Returns: @@ -202,6 +205,22 @@ def create( ... image="ghcr.io/myorg/myimage:latest", ... registry_secret="my-ghcr-secret" ... ) + + >>> # Create from a Snapshot object + >>> from koyeb.sandbox import Snapshot + >>> snapshot = Snapshot.get("my-snapshot-id") + >>> sandbox = Sandbox.create(snapshot=snapshot) + + >>> # Create from a snapshot ID string + >>> sandbox = Sandbox.create(snapshot="my-snapshot-id") + + >>> # Create from a snapshot with custom parameters + >>> sandbox = Sandbox.create( + ... snapshot="my-snapshot-id", + ... image="python:3.12", + ... instance_type="nano", + ... env={"MY_VAR": "value"} + ... ) """ if api_token is None: api_token = os.getenv("KOYEB_API_TOKEN") @@ -210,6 +229,43 @@ def create( "API token is required. Set KOYEB_API_TOKEN environment variable or pass api_token parameter" ) + # Handle snapshot parameter (can be Snapshot object or snapshot name/ID string) + actual_snapshot_id = None + actual_snapshot_type = None + + if snapshot is not None: + if isinstance(snapshot, str): + # snapshot is a snapshot ID or name string + from .snapshot import Snapshot + + # Try to get snapshot by ID first (fast path for UUIDs) + try: + snapshot_obj = Snapshot.get(snapshot, api_token=api_token, host=host) + actual_snapshot_id = snapshot_obj.id + actual_snapshot_type = snapshot_obj.snapshot_type + except Exception: + # If that fails, try to find by name + try: + snapshots = Snapshot.list(api_token=api_token, host=host, limit=100) + for s in snapshots: + if s.name == snapshot: + actual_snapshot_id = s.id + actual_snapshot_type = s.snapshot_type + break + except Exception: + pass + + # If we couldn't resolve it, use the string as-is + # Default to FILESYSTEM type if we couldn't determine it + if actual_snapshot_id is None: + actual_snapshot_id = snapshot + from .snapshot import SnapshotType + actual_snapshot_type = SnapshotType.FILESYSTEM + else: + # snapshot is a Snapshot object + actual_snapshot_id = snapshot.id + actual_snapshot_type = snapshot.snapshot_type + sandbox = cls._create_sync( name=name, image=image, @@ -235,7 +291,8 @@ def create( command=command, args=args, host=host, - snapshot_id=snapshot_id, + snapshot_id=actual_snapshot_id, + snapshot_type=actual_snapshot_type, sandbox_secret=sandbox_secret, ) @@ -278,6 +335,7 @@ def _create_sync( args: Optional[List[str]] = None, host: Optional[str] = None, snapshot_id: Optional[str] = None, + snapshot_type: Optional["SnapshotType"] = None, sandbox_secret: Optional[str] = None, ) -> Sandbox: """ @@ -316,16 +374,53 @@ def _create_sync( delete_after_sleep=delete_after_inactivity_delay, ) - # If using a snapshot, don't send definition - # The snapshot already contains all the configuration + # Handle snapshot creation based on snapshot type + # For FULL snapshots, don't provide definition (API will infer it) + # For FILESYSTEM snapshots, always provide definition with snapshot_id if snapshot_id: - create_service = CreateService( - app_id=app_id, - life_cycle=service_life_cycle, - instance_snapshot_id=snapshot_id, - name=name, - ) + # Import here to avoid circular import + from .snapshot import SnapshotType as ST + + # For FULL snapshots, create service without definition + if snapshot_type == ST.FULL and snapshot_type is not None: + create_service = CreateService( + app_id=app_id, + life_cycle=service_life_cycle, + instance_snapshot_id=snapshot_id, + name=name, + ) + else: + # For FILESYSTEM snapshots (or unknown), provide definition + env_vars = build_env_vars(env) + config_file_objects = build_config_files(config_files) + docker_source = create_docker_source( + image, privileged=privileged, image_registry_secret=registry_secret, + entrypoint=entrypoint, command=command, args=args, + ) + deployment_definition = create_deployment_definition( + name=name, + docker_source=docker_source, + env_vars=env_vars, + instance_type=instance_type, + exposed_port_protocol=exposed_port_protocol, + region=region, + routes=routes, + idle_timeout=idle_timeout, + enable_tcp_proxy=enable_tcp_proxy, + _experimental_enable_light_sleep=_experimental_enable_light_sleep, + _experimental_deep_sleep_value=_experimental_deep_sleep_value, + enable_mesh=enable_mesh, + config_files=config_file_objects if config_file_objects else None, + ) + create_service = CreateService( + app_id=app_id, + definition=deployment_definition, + life_cycle=service_life_cycle, + instance_snapshot_id=snapshot_id, + name=name, + ) else: + # No snapshot, create normally with definition env_vars = build_env_vars(env) config_file_objects = build_config_files(config_files) docker_source = create_docker_source( @@ -593,17 +688,8 @@ def create_from_snapshot( Returns: Sandbox: A new sandbox instance """ - from .snapshot import Snapshot - - if isinstance(snapshot, str): - snapshot_id = snapshot - elif isinstance(snapshot, Snapshot): - snapshot_id = snapshot.id - else: - raise SandboxError(f"Invalid snapshot type: {type(snapshot)}") - create_params = { - "snapshot_id": snapshot_id, + "snapshot": snapshot, "wait_ready": wait_ready, "timeout": timeout, } @@ -1479,7 +1565,7 @@ async def create( command: Optional[str] = None, args: Optional[List[str]] = None, host: Optional[str] = None, - snapshot_id: Optional[str] = None, + snapshot: Optional[Union[str, "Snapshot"]] = None, sandbox_secret: Optional[str] = None, ) -> AsyncSandbox: """ @@ -1524,7 +1610,9 @@ async def create( entrypoint: Override the default entrypoint of the Docker image (e.g., ["/bin/sh", "-c"]) command: Override the default command of the Docker image (e.g., "python app.py") host: Koyeb API host URL. If not provided, will try to get from KOYEB_API_HOST env var (defaults to https://app.koyeb.com) - snapshot_id: Optional snapshot ID to create the sandbox from. If provided, the sandbox will be initialized from this snapshot. + snapshot: Optional. A Snapshot object or snapshot name/ID string to create the sandbox from. + If provided, the sandbox will be initialized from this snapshot. + Can be either a Snapshot object (e.g., snapshot=my_snapshot) or a snapshot name/ID string (e.g., snapshot="my snapshot"). sandbox_secret: Optional sandbox secret to use for executor authentication. If not provided, a new one will be generated. Returns: @@ -1541,6 +1629,43 @@ async def create( "API token is required. Set KOYEB_API_TOKEN environment variable or pass api_token parameter" ) + # Handle snapshot parameter (can be Snapshot object or snapshot name/ID string) + actual_snapshot_id = None + actual_snapshot_type = None + + if snapshot is not None: + if isinstance(snapshot, str): + # snapshot is a snapshot ID or name string + from .snapshot import Snapshot + + # Try to get snapshot by ID first (fast path for UUIDs) + try: + snapshot_obj = Snapshot.get(snapshot, api_token=api_token, host=host) + actual_snapshot_id = snapshot_obj.id + actual_snapshot_type = snapshot_obj.snapshot_type + except Exception: + # If that fails, try to find by name + try: + snapshots = Snapshot.list(api_token=api_token, host=host, limit=100) + for s in snapshots: + if s.name == snapshot: + actual_snapshot_id = s.id + actual_snapshot_type = s.snapshot_type + break + except Exception: + pass + + # If we couldn't resolve it, use the string as-is + # Default to FILESYSTEM type if we couldn't determine it + if actual_snapshot_id is None: + actual_snapshot_id = snapshot + from .snapshot import SnapshotType + actual_snapshot_type = SnapshotType.FILESYSTEM + else: + # snapshot is a Snapshot object + actual_snapshot_id = snapshot.id + actual_snapshot_type = snapshot.snapshot_type + from .utils import get_async_api_clients from koyeb.api_async.models.create_app import CreateApp as AsyncCreateApp from koyeb.api_async.models.create_app import AppLifeCycle as AsyncAppLifeCycle @@ -1578,16 +1703,53 @@ async def create( # Convert sync DeploymentDefinition to dict so the async Pydantic model # (which expects koyeb.api_async.models.DeploymentDefinition) can coerce it. - # If using a snapshot, don't send definition - # The snapshot already contains all the configuration - if snapshot_id: - create_service = AsyncCreateService( - app_id=app_id, - life_cycle=service_life_cycle, - instance_snapshot_id=snapshot_id, - name=name, - ) + # Handle snapshot creation based on snapshot type + # For FULL snapshots, don't provide definition (API will infer it) + # For FILESYSTEM snapshots, always provide definition with snapshot_id + if actual_snapshot_id: + # Import here to avoid circular import + from .snapshot import SnapshotType as ST + + # For FULL snapshots, create service without definition + if actual_snapshot_type == ST.FULL: + create_service = AsyncCreateService( + app_id=app_id, + life_cycle=service_life_cycle, + instance_snapshot_id=actual_snapshot_id, + name=name, + ) + else: + # For FILESYSTEM snapshots (or unknown), provide definition + env_vars = build_env_vars(env) + config_file_objects = build_config_files(config_files) + docker_source = create_docker_source( + image, privileged=privileged, image_registry_secret=registry_secret, + entrypoint=entrypoint, command=command, args=args, + ) + deployment_definition = create_deployment_definition( + name=name, + docker_source=docker_source, + env_vars=env_vars, + instance_type=instance_type, + exposed_port_protocol=exposed_port_protocol, + region=region, + routes=routes, + idle_timeout=idle_timeout, + enable_tcp_proxy=enable_tcp_proxy, + _experimental_enable_light_sleep=_experimental_enable_light_sleep, + _experimental_deep_sleep_value=_experimental_deep_sleep_value, + enable_mesh=enable_mesh, + config_files=config_file_objects if config_file_objects else None, + ) + create_service = AsyncCreateService( + app_id=app_id, + definition=deployment_definition.to_dict(), + life_cycle=service_life_cycle, + instance_snapshot_id=actual_snapshot_id, + name=name, + ) else: + # No snapshot, create normally with definition env_vars = build_env_vars(env) config_file_objects = build_config_files(config_files) docker_source = create_docker_source( @@ -1920,17 +2082,8 @@ async def create_from_snapshot( Returns: AsyncSandbox: A new async sandbox instance """ - from .snapshot import Snapshot - - if isinstance(snapshot, str): - snapshot_id = snapshot - elif isinstance(snapshot, Snapshot): - snapshot_id = snapshot.id - else: - raise SandboxError(f"Invalid snapshot type: {type(snapshot)}") - create_params = { - "snapshot_id": snapshot_id, + "snapshot": snapshot, "wait_ready": wait_ready, "timeout": timeout, } diff --git a/koyeb/sandbox/snapshot.py b/koyeb/sandbox/snapshot.py index 64f55b93..533d26c1 100644 --- a/koyeb/sandbox/snapshot.py +++ b/koyeb/sandbox/snapshot.py @@ -166,13 +166,19 @@ def list( } status_param = status_map.get(status) - reply = clients.instance_snapshots.list_instance_snapshots( - limit=limit, - offset=offset, - service_id=service_id, - type=type_param, - status=status_param, - ) + # Build kwargs, omitting None values + list_kwargs = { + "limit": str(limit), + "offset": str(offset), + } + if service_id: + list_kwargs["service_id"] = service_id + if type_param: + list_kwargs["type"] = type_param + if status_param: + list_kwargs["status"] = status_param + + reply = clients.instance_snapshots.list_instance_snapshots(**list_kwargs) snapshots = [] if reply.instance_snapshots: @@ -362,7 +368,7 @@ def spawn( raise SandboxError("Cannot spawn from snapshot without ID") create_params = { - "snapshot_id": self.id, + "snapshot": self, "wait_ready": wait_ready, "timeout": timeout, } From 4dfc860ce85b4f8599abaeeef4ff91abe26a8643 Mon Sep 17 00:00:00 2001 From: nicoche <78445450+nicoche@users.noreply.github.com> Date: Sat, 4 Jul 2026 01:41:58 +0200 Subject: [PATCH 4/4] Add full snapshots --- examples/22_declarative_snapshot_builder.py | 12 ++- examples/23_full_snapshot.py | 84 --------------- examples/23_full_snapshot_and_spawn.py | 105 ++++++++++++++++++ examples/23_full_snapshot_and_spawn_async.py | 106 +++++++++++++++++++ examples/README.md | 3 + koyeb/sandbox/sandbox.py | 6 +- koyeb/sandbox/snapshot.py | 4 +- 7 files changed, 229 insertions(+), 91 deletions(-) delete mode 100644 examples/23_full_snapshot.py create mode 100644 examples/23_full_snapshot_and_spawn.py create mode 100644 examples/23_full_snapshot_and_spawn_async.py diff --git a/examples/22_declarative_snapshot_builder.py b/examples/22_declarative_snapshot_builder.py index 48751f7a..2f8a6c8d 100644 --- a/examples/22_declarative_snapshot_builder.py +++ b/examples/22_declarative_snapshot_builder.py @@ -29,7 +29,7 @@ def main(): workdir="/workspace", api_token=api_token, ) - .file("requirements.txt", "pytest\nrequests\nnumpy") + .file("requirements.txt", "requests") .run("pip install -r requirements.txt") .build(snapshot_name=f"python-ci-env-{suffix}") ) @@ -45,11 +45,13 @@ def main(): print(" - Spawning runner1...") print(" - Spawning runner2...") runner1 = snapshot.spawn( + image="python:3.12", name=f"test-suite-1-{suffix}", wait_ready=False, api_token=api_token, ) runner2 = snapshot.spawn( + image="python:3.12", name=f"test-suite-2-{suffix}", wait_ready=False, api_token=api_token, @@ -65,11 +67,15 @@ def main(): # Verify the environment is pre-configured from snapshot filesystem print("✓ Verifying runner1 has pre-installed packages from snapshot filesystem...") - result = runner1.exec("python3 -c \"import pytest, requests, numpy; print('All packages installed')\"") + result = runner1.exec("python3 -c \"import requests; print('All packages installed')\"") + print(f" stdout: '{result.stdout}', stderr: '{result.stderr}', exit_code: {result.exit_code}") + assert "All packages installed" in result.stdout, f"Expected packages to be installed, got stdout: '{result.stdout}', stderr: '{result.stderr}'" print(f" ✓ Result: {result.stdout.strip()}") print("✓ Verifying runner2 has pre-installed packages from snapshot filesystem...") - result = runner2.exec("python3 -c \"import pytest, requests, numpy; print('All packages installed')\"") + result = runner2.exec("python3 -c \"import requests; print('All packages installed')\"") + print(f" stdout: '{result.stdout}', stderr: '{result.stderr}', exit_code: {result.exit_code}") + assert "All packages installed" in result.stdout, f"Expected packages to be installed, got stdout: '{result.stdout}', stderr: '{result.stderr}'" print(f" ✓ Result: {result.stdout.strip()}") return 0 diff --git a/examples/23_full_snapshot.py b/examples/23_full_snapshot.py deleted file mode 100644 index 8fdeee30..00000000 --- a/examples/23_full_snapshot.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python3 -"""Create a sandbox, take a FULL snapshot (including processes), and spawn from it""" - -import os -import sys -import random -import string - -from koyeb import Sandbox -from koyeb.sandbox import SnapshotType - - -def main(): - api_token = os.getenv("KOYEB_API_TOKEN") - if not api_token: - print("Error: KOYEB_API_TOKEN not set") - return 1 - - sbx = None - sbx2 = None - snapshot = None - suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) - try: - print("✓ Creating sandbox...") - sbx = Sandbox.create( - image="python:3.12", - name=f"full-snapshot-{suffix}", - wait_ready=True, - api_token=api_token, - ) - print(f" ✓ Sandbox created: {sbx.name}") - - # Install packages - print("✓ Installing packages...") - sbx.exec("pip3 install requests") - print(" ✓ Packages installed") - - # Take a FULL snapshot (includes both filesystem and running processes) - print("✓ Creating FULL snapshot...") - snapshot = sbx.snapshot( - name=f"python-full-{suffix}", - snapshot_type=SnapshotType.FULL, - ) - print(f" ✓ Full snapshot created: {snapshot.name}") - print(f" ✓ Snapshot type: {snapshot.snapshot_type.value}") - - # Print operations if any - if snapshot.operations: - print("\n Operations performed during snapshot:") - for op in snapshot.operations: - print(f" - {op}") - - # Spawn a new sandbox from the full snapshot - print("✓ Spawning sandbox from FULL snapshot...") - sbx2 = snapshot.spawn( - name=f"full-test-{suffix}", - wait_ready=True, - api_token=api_token, - ) - print(f" ✓ Sandbox spawned from full snapshot: {sbx2.name}") - - # Verify the sandbox is running and packages are pre-installed - print("✓ Verifying sandbox from full snapshot...") - result = sbx2.exec("python3 -c \"import requests; print('OK')\"") - print(f" ✓ Result: {result.stdout.strip()}") - - print("\n✓ All tests passed!") - return 0 - finally: - print("\nCleaning up resources...") - if sbx2: - sbx2.delete() - print(" ✓ Deleted spawned sandbox") - if snapshot: - snapshot.delete() - print(" ✓ Deleted snapshot") - if sbx: - sbx.delete() - print(" ✓ Deleted original sandbox") - print(" ✓ Cleanup complete") - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/examples/23_full_snapshot_and_spawn.py b/examples/23_full_snapshot_and_spawn.py new file mode 100644 index 00000000..7e1dd6ab --- /dev/null +++ b/examples/23_full_snapshot_and_spawn.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +"""Create a sandbox, take a full snapshot, and spawn a new sandbox from it + +This example demonstrates creating a full snapshot (including both filesystem +and process state) as opposed to example 21 which uses filesystem-only snapshots. +""" + +import os +import sys +import random +import string + +from koyeb import Sandbox +from koyeb.sandbox import SnapshotType +from koyeb.sandbox.utils import SandboxTimeoutError + + +def main(): + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + print("Error: KOYEB_API_TOKEN not set") + return 1 + + sbx = None + sbx2 = None + snapshot = None + suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) + try: + print("✓ Creating sandbox...") + sbx = Sandbox.create( + image="python:3.12", + name=f"full-snapshot-and-spawn-{suffix}", + wait_ready=True, + api_token=api_token, + ) + print(f" ✓ Sandbox created: {sbx.name}") + + # Create some files to verify filesystem preservation + print("✓ Creating files...") + sbx.filesystem.mkdir("/workspace") + sbx.filesystem.write_file("/workspace/requirements.txt", "requests\n") + print(" ✓ Files created") + + # Install packages + print("✓ Installing packages...") + sbx.exec("pip3 install requests") + print(" ✓ Packages installed") + + # Start daemon http server in the background on port 8000 + print("✓ Running HTTP daemon server on port 8000...") + try: + sbx.exec("python3 -m http.server", timeout=2) + except SandboxTimeoutError: + pass + print(" ✓ Started HTTP daemon server on port 8000") + + # Take a FULL snapshot (includes both filesystem and process state) + print("✓ Creating full snapshot...") + snapshot = sbx.snapshot( + name=f"python-full-snapshot-{suffix}", + snapshot_type=SnapshotType.FULL, + ) + print(f" ✓ Full snapshot created: {snapshot.name}") + + # Spawn a new sandbox from the snapshot with a different instance type + print("✓ Spawning sandbox from full snapshot with different instance type...") + sbx2 = snapshot.spawn( + image="python:3.12", + name=f"test-runner-full-{suffix}", + instance_type="nano", + wait_ready=False, + api_token=api_token, + ) + print(f" ✓ Sandbox spawned: {sbx2.name}") + + # Wait for the spawned sandbox to be ready + print("✓ Waiting for spawned sandbox to be ready...") + is_ready = sbx2.wait_ready(timeout=300) + print(" ✓ Sandbox is ready") + + # Verify filesystem is preserved from snapshot + print("✓ Verifying full snapshot...") + + # Check that packages are pre-installed + result = sbx2.exec("python3 -c \"import requests; print('OK')\"") + assert result.stdout.strip() == "OK", f"Package not found: {result.stdout}" + print(" ✓ Python package installed preserved") + + # Verify processes are preserved + result = sbx2.exec("curl localhost:8000") + assert "Directory listing for /" in result.stdout.strip(), "HTTP server launched in original sandbox is not running anymore" + print(" ✓ Daemon HTTP server launched on initial sandbox is still running") + + return 0 + finally: + if sbx2: + sbx2.delete() + if snapshot: + snapshot.delete() + if sbx: + sbx.delete() + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/examples/23_full_snapshot_and_spawn_async.py b/examples/23_full_snapshot_and_spawn_async.py new file mode 100644 index 00000000..3e78fe78 --- /dev/null +++ b/examples/23_full_snapshot_and_spawn_async.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""Create a sandbox, take a full snapshot, and spawn a new sandbox from it (async version) + +This example demonstrates creating a full snapshot (including both filesystem +and process state) as opposed to example 21 which uses filesystem-only snapshots. +""" + +import os +import sys +import asyncio +import random +import string + +from koyeb import AsyncSandbox +from koyeb.sandbox import SnapshotType +from koyeb.sandbox.utils import SandboxTimeoutError + + +async def main(): + api_token = os.getenv("KOYEB_API_TOKEN") + if not api_token: + print("Error: KOYEB_API_TOKEN not set") + return 1 + + sbx = None + sbx2 = None + snapshot = None + suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=8)) + try: + print("✓ Creating sandbox...") + sbx = await AsyncSandbox.create( + image="python:3.12", + name=f"full-snapshot-and-spawn-{suffix}", + wait_ready=True, + api_token=api_token, + ) + print(f" ✓ Sandbox created: {sbx.name}") + + # Create some files to verify filesystem preservation + print("✓ Creating files...") + await sbx.filesystem.mkdir("/workspace") + await sbx.filesystem.write_file("/workspace/requirements.txt", "requests\n") + print(" ✓ Files created") + + # Install packages + print("✓ Installing packages...") + await sbx.exec("pip3 install requests") + print(" ✓ Packages installed") + + # Start daemon http server in the background on port 8000 + print("✓ Running HTTP daemon server on port 8000...") + try: + await sbx.exec("python3 -m http.server", timeout=2) + except SandboxTimeoutError: + pass + print(" ✓ Started HTTP daemon server on port 8000") + + # Take a FULL snapshot (includes both filesystem and process state) + print("✓ Creating full snapshot...") + snapshot = await sbx.snapshot( + name=f"python-full-snapshot-{suffix}", + snapshot_type=SnapshotType.FULL, + ) + print(f" ✓ Full snapshot created: {snapshot.name}") + + # Spawn a new sandbox from the snapshot with a different instance type + print("✓ Spawning sandbox from full snapshot with different instance type...") + sbx2 = snapshot.spawn( + image="python:3.12", + name=f"test-runner-full-{suffix}", + instance_type="nano", + wait_ready=False, + api_token=api_token, + ) + print(f" ✓ Sandbox spawned: {sbx2.name}") + + # Wait for the spawned sandbox to be ready + print("✓ Waiting for spawned sandbox to be ready...") + is_ready = sbx2.wait_ready(timeout=300) + print(" ✓ Sandbox is ready") + + # Verify filesystem is preserved from snapshot + print("✓ Verifying filesystem is preserved from full snapshot...") + + # Check that packages are pre-installed + result = sbx2.exec("python3 -c \"import requests; print('OK')\"") + assert result.stdout.strip() == "OK", f"Package not found: {result.stdout}" + print(" ✓ Packages preserved") + + # Verify processes are preserved + result = sbx2.exec("curl localhost:8000") + assert "Directory listing for /" in result.stdout.strip(), "HTTP server launched in original sandbox is not running anymore" + print(" ✓ Daemon HTTP server launched on initial sandbox is still running") + + return 0 + finally: + if sbx2: + sbx2.delete() + if snapshot: + snapshot.delete() + if sbx: + await sbx.delete() + + +if __name__ == "__main__": + sys.exit(asyncio.run(main())) \ No newline at end of file diff --git a/examples/README.md b/examples/README.md index c10b4eb7..ca5d7ea9 100644 --- a/examples/README.md +++ b/examples/README.md @@ -29,6 +29,9 @@ uv run python examples/01_create_sandbox.py - **13_background_processes.py** - Background process management (launch, list, kill) - **14_expose_port.py** - Port exposure via TCP proxy with HTTP verification - **15_get_sandbox.py** - Create a sandbox and then retrieve it by ID +- **21_snapshot_and_spawn.py** - Create a sandbox, take a filesystem snapshot, and spawn a new sandbox from it +- **22_declarative_snapshot_builder.py** - Use the fluent builder API to create reusable snapshots +- **23_full_snapshot_and_spawn.py** - Create a sandbox, take a full snapshot (filesystem + process state), and spawn a new sandbox from it ## Basic Usage diff --git a/koyeb/sandbox/sandbox.py b/koyeb/sandbox/sandbox.py index 10e572c0..14939e94 100644 --- a/koyeb/sandbox/sandbox.py +++ b/koyeb/sandbox/sandbox.py @@ -1789,7 +1789,7 @@ async def create( sandbox_secret=sandbox_secret, poll_interval=poll_interval, host=host, - snapshot_id=snapshot_id, + snapshot_id=actual_snapshot_id, ) if wait_ready: @@ -1991,8 +1991,8 @@ async def snapshot( snapshot_type = SnapshotType.FILESYSTEM try: - from koyeb.api.models.instance_snapshot_type import InstanceSnapshotType - from koyeb.api.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest + from koyeb.api_async.models.instance_snapshot_type import InstanceSnapshotType + from koyeb.api_async.models.create_instance_snapshot_request import CreateInstanceSnapshotRequest from .utils import get_async_api_clients from .snapshot import SnapshotStatus diff --git a/koyeb/sandbox/snapshot.py b/koyeb/sandbox/snapshot.py index 533d26c1..00160c5c 100644 --- a/koyeb/sandbox/snapshot.py +++ b/koyeb/sandbox/snapshot.py @@ -538,7 +538,9 @@ def build( # Run commands for command in self._commands: self._operations.append(f"run: {command}") - self._builder_sandbox.exec(command) + result = self._builder_sandbox.exec(command, timeout=300) + if not result.success: + raise SandboxError(f"Command failed: {command}\nstdout: {result.stdout}\nstderr: {result.stderr}") # Create snapshot snapshot = self._builder_sandbox.snapshot(