diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..c356890 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,37 @@ +# NOTE: Originally generated by OpenAPI Generator, now hand-maintained. +# Listed in .openapi-generator-ignore so `make generate` won't clobber it. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: saturn_api Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + # Exit code 5 = "no tests collected"; the generated client ships no + # tests, so treat that as success rather than a CI failure. + pytest --cov=saturn_api || [ $? -eq 5 ] diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 49bbcad..59e29c4 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -33,3 +33,6 @@ test/ git_push.sh .travis.yml .gitlab-ci.yml + +# Hand-maintained CI (pytest passes with no tests); don't let regen clobber it +.github/workflows/python.yml diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 76e9890..fa7220c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -12,6 +12,13 @@ docs/ApiTokenList.md docs/ApiTokenUpdate.md docs/ApiTokensApi.md docs/AppInfo.md +docs/Artifact.md +docs/ArtifactCreate.md +docs/ArtifactKind.md +docs/ArtifactList.md +docs/ArtifactStatus.md +docs/ArtifactUpdate.md +docs/ArtifactsApi.md docs/Auth0Info.md docs/AuthorizationApi.md docs/AuthorizationCodeGrant.md @@ -19,8 +26,15 @@ docs/AuthorizationGrant.md docs/AuthorizationRefreshGrant.md docs/AuthorizationTokenResponse.md docs/BuildData.md +docs/Cluster.md +docs/ClusterConnectionType.md +docs/ClusterCreate.md +docs/ClusterList.md +docs/ClusterUpdate.md +docs/ClustersApi.md docs/ConcurrencyPolicy.md docs/Condition.md +docs/ConfigFileEntry.md docs/ContainerRuntimeSummary.md docs/ContainerStatus.md docs/CronSchedule.md @@ -46,6 +60,12 @@ docs/DaskComponents.md docs/DaskWorkerRuntimeSummaryList.md docs/DaskWorkerSummary.md docs/DataPoint.md +docs/Dataset.md +docs/DatasetCreate.md +docs/DatasetImportCreate.md +docs/DatasetList.md +docs/DatasetLockCreate.md +docs/DatasetsApi.md docs/DefaultImages.md docs/DefaultSizes.md docs/Deployment.md @@ -60,6 +80,7 @@ docs/DeploymentStart.md docs/DeploymentStatus.md docs/DeploymentUpdate.md docs/DeploymentsApi.md +docs/DiskSpaceOption.md docs/ExternalRepo.md docs/ExternalRepoAttachment.md docs/ExternalRepoAttachmentCreate.md @@ -77,6 +98,11 @@ docs/ExtraPackagesRecipe.md docs/ExtraPackagesRecipeApt.md docs/ExtraPackagesRecipeConda.md docs/ExtraPackagesRecipePip.md +docs/FineTuneJobCreate.md +docs/FineTuneJobList.md +docs/FineTuneJobSummary.md +docs/FineTuneJobView.md +docs/FineTuningJobsApi.md docs/Group.md docs/GroupCreate.md docs/GroupList.md @@ -88,6 +114,8 @@ docs/GroupsApi.md docs/HardwareType.md docs/HistoricLog.md docs/HistoricLogList.md +docs/Hyperparameters.md +docs/Hyperparameters1.md docs/Identity.md docs/IdentityByGroupId.md docs/IdentityByUserId.md @@ -116,6 +144,11 @@ docs/ImageTagUpdate.md docs/ImageTagsApi.md docs/ImageUpdate.md docs/ImagesApi.md +docs/InferenceEndpointCreate.md +docs/InferenceEndpointList.md +docs/InferenceEndpointSummary.md +docs/InferenceEndpointView.md +docs/InferenceEndpointsApi.md docs/InfoApi.md docs/InstanceSize.md docs/Invitation.md @@ -223,6 +256,7 @@ docs/RouteBySubdomain.md docs/RouteCreate.md docs/RouteList.md docs/RouteReference.md +docs/RouteState.md docs/RouteUpdate.md docs/SSHPrivateKey.md docs/SSHPrivateKeyCreate.md @@ -316,15 +350,20 @@ saturn_api/api/__init__.py saturn_api/api/active_api.py saturn_api/api/api_status_api.py saturn_api/api/api_tokens_api.py +saturn_api/api/artifacts_api.py saturn_api/api/authorization_api.py +saturn_api/api/clusters_api.py saturn_api/api/current_user_api.py saturn_api/api/dask_clusters_api.py +saturn_api/api/datasets_api.py saturn_api/api/deployments_api.py saturn_api/api/external_repo_attachments_api.py saturn_api/api/external_repos_api.py +saturn_api/api/fine_tuning_jobs_api.py saturn_api/api/groups_api.py saturn_api/api/image_tags_api.py saturn_api/api/images_api.py +saturn_api/api/inference_endpoints_api.py saturn_api/api/info_api.py saturn_api/api/invitations_api.py saturn_api/api/jobs_api.py @@ -356,14 +395,26 @@ saturn_api/models/api_token_info.py saturn_api/models/api_token_list.py saturn_api/models/api_token_update.py saturn_api/models/app_info.py +saturn_api/models/artifact.py +saturn_api/models/artifact_create.py +saturn_api/models/artifact_kind.py +saturn_api/models/artifact_list.py +saturn_api/models/artifact_status.py +saturn_api/models/artifact_update.py saturn_api/models/auth0_info.py saturn_api/models/authorization_code_grant.py saturn_api/models/authorization_grant.py saturn_api/models/authorization_refresh_grant.py saturn_api/models/authorization_token_response.py saturn_api/models/build_data.py +saturn_api/models/cluster.py +saturn_api/models/cluster_connection_type.py +saturn_api/models/cluster_create.py +saturn_api/models/cluster_list.py +saturn_api/models/cluster_update.py saturn_api/models/concurrency_policy.py saturn_api/models/condition.py +saturn_api/models/config_file_entry.py saturn_api/models/container_runtime_summary.py saturn_api/models/container_status.py saturn_api/models/cron_schedule.py @@ -387,6 +438,11 @@ saturn_api/models/dask_components.py saturn_api/models/dask_worker_runtime_summary_list.py saturn_api/models/dask_worker_summary.py saturn_api/models/data_point.py +saturn_api/models/dataset.py +saturn_api/models/dataset_create.py +saturn_api/models/dataset_import_create.py +saturn_api/models/dataset_list.py +saturn_api/models/dataset_lock_create.py saturn_api/models/default_images.py saturn_api/models/default_sizes.py saturn_api/models/deployment.py @@ -400,6 +456,7 @@ saturn_api/models/deployment_spec.py saturn_api/models/deployment_start.py saturn_api/models/deployment_status.py saturn_api/models/deployment_update.py +saturn_api/models/disk_space_option.py saturn_api/models/external_repo.py saturn_api/models/external_repo_attachment.py saturn_api/models/external_repo_attachment_create.py @@ -415,6 +472,10 @@ saturn_api/models/extra_packages_recipe.py saturn_api/models/extra_packages_recipe_apt.py saturn_api/models/extra_packages_recipe_conda.py saturn_api/models/extra_packages_recipe_pip.py +saturn_api/models/fine_tune_job_create.py +saturn_api/models/fine_tune_job_list.py +saturn_api/models/fine_tune_job_summary.py +saturn_api/models/fine_tune_job_view.py saturn_api/models/group.py saturn_api/models/group_create.py saturn_api/models/group_list.py @@ -425,6 +486,8 @@ saturn_api/models/group_update.py saturn_api/models/hardware_type.py saturn_api/models/historic_log.py saturn_api/models/historic_log_list.py +saturn_api/models/hyperparameters.py +saturn_api/models/hyperparameters1.py saturn_api/models/identity.py saturn_api/models/identity_by_group_id.py saturn_api/models/identity_by_user_id.py @@ -451,6 +514,10 @@ saturn_api/models/image_tag_reference.py saturn_api/models/image_tag_state.py saturn_api/models/image_tag_update.py saturn_api/models/image_update.py +saturn_api/models/inference_endpoint_create.py +saturn_api/models/inference_endpoint_list.py +saturn_api/models/inference_endpoint_summary.py +saturn_api/models/inference_endpoint_view.py saturn_api/models/instance_size.py saturn_api/models/invitation.py saturn_api/models/invitation_create.py @@ -550,6 +617,7 @@ saturn_api/models/route_by_subdomain.py saturn_api/models/route_create.py saturn_api/models/route_list.py saturn_api/models/route_reference.py +saturn_api/models/route_state.py saturn_api/models/route_update.py saturn_api/models/secret.py saturn_api/models/secret_access_level.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 6328c54..696eaac 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.17.0 +7.22.0 diff --git a/Makefile b/Makefile index ef0fdf0..d6b27c3 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ update: copy-client-yaml generate format .PHONY: generate generate: openapi-generator-cli generate -g python -i client.yaml -c openapi-generator-config.yaml --remove-operation-id-prefix -t templates/python + @sed -i 's/^httpx = ">= \(.*\)"$$/httpx >= \1/' requirements.txt .PHONY: format format: diff --git a/README.md b/README.md index 7db6ead..e04935f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 2026.02.01 - Package version: 1.0.0 -- Generator version: 7.17.0 +- Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.9+ +Python 3.10+ ## Installation & Usage ### pip install @@ -105,10 +105,21 @@ Class | Method | HTTP request | Description *ApiTokensApi* | [**get**](docs/ApiTokensApi.md#get) | **GET** /api/tokens/{api_token_id} | Get api token *ApiTokensApi* | [**list**](docs/ApiTokensApi.md#list) | **GET** /api/tokens | List api tokens *ApiTokensApi* | [**update**](docs/ApiTokensApi.md#update) | **PATCH** /api/tokens/{api_token_id} | Update api token +*ArtifactsApi* | [**create**](docs/ArtifactsApi.md#create) | **POST** /api/orgs/{org_id}/artifacts | Create artifact +*ArtifactsApi* | [**delete**](docs/ArtifactsApi.md#delete) | **DELETE** /api/orgs/{org_id}/artifacts/{artifact_id} | Delete artifact +*ArtifactsApi* | [**get**](docs/ArtifactsApi.md#get) | **GET** /api/orgs/{org_id}/artifacts/{artifact_id} | Get artifact +*ArtifactsApi* | [**list**](docs/ArtifactsApi.md#list) | **GET** /api/orgs/{org_id}/artifacts | List artifacts +*ArtifactsApi* | [**update**](docs/ArtifactsApi.md#update) | **PATCH** /api/orgs/{org_id}/artifacts/{artifact_id} | Update artifact *AuthorizationApi* | [**create_oauth_token**](docs/AuthorizationApi.md#create_oauth_token) | **POST** /api/auth/token | Create OAuth token *AuthorizationApi* | [**get_oauth_init**](docs/AuthorizationApi.md#get_oauth_init) | **GET** /api/auth/token | Initialize oauth *AuthorizationApi* | [**login**](docs/AuthorizationApi.md#login) | **POST** /api/auth/login | Login *AuthorizationApi* | [**logout**](docs/AuthorizationApi.md#logout) | **GET** /api/auth/logout | Logout +*ClustersApi* | [**create**](docs/ClustersApi.md#create) | **POST** /api/clusters | Create cluster +*ClustersApi* | [**delete**](docs/ClustersApi.md#delete) | **DELETE** /api/clusters/{cluster_id} | Delete cluster +*ClustersApi* | [**get**](docs/ClustersApi.md#get) | **GET** /api/clusters/{cluster_id} | Get cluster +*ClustersApi* | [**list**](docs/ClustersApi.md#list) | **GET** /api/clusters | List clusters +*ClustersApi* | [**update**](docs/ClustersApi.md#update) | **PATCH** /api/clusters/{cluster_id} | Update cluster +*CurrentUserApi* | [**delete**](docs/CurrentUserApi.md#delete) | **DELETE** /api/user | Delete current user *CurrentUserApi* | [**get**](docs/CurrentUserApi.md#get) | **GET** /api/user | Get current user *CurrentUserApi* | [**get_aggregated_usage**](docs/CurrentUserApi.md#get_aggregated_usage) | **GET** /api/user/usage/aggregated | Get aggregated usage *CurrentUserApi* | [**get_preferences**](docs/CurrentUserApi.md#get_preferences) | **GET** /api/user/preferences | Get current user preferences @@ -140,6 +151,13 @@ Class | Method | HTTP request | Description *DaskClustersApi* | [**stop**](docs/DaskClustersApi.md#stop) | **POST** /api/dask_clusters/{dask_cluster_id}/stop | Stop dask cluster *DaskClustersApi* | [**update**](docs/DaskClustersApi.md#update) | **PATCH** /api/dask_clusters/{dask_cluster_id} | Update dask cluster *DaskClustersApi* | [**update_token**](docs/DaskClustersApi.md#update_token) | **PATCH** /api/dask_clusters/{dask_cluster_id}/token | Update dask cluster API token +*DatasetsApi* | [**call_import**](docs/DatasetsApi.md#call_import) | **POST** /api/orgs/{org_id}/token-factory/datasets/import | Import dataset +*DatasetsApi* | [**create**](docs/DatasetsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/datasets | Create dataset +*DatasetsApi* | [**delete**](docs/DatasetsApi.md#delete) | **DELETE** /api/orgs/{org_id}/token-factory/datasets/{dataset_id} | Delete dataset +*DatasetsApi* | [**get**](docs/DatasetsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/datasets/{dataset_id} | Get dataset +*DatasetsApi* | [**list**](docs/DatasetsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/datasets | List datasets +*DatasetsApi* | [**lock**](docs/DatasetsApi.md#lock) | **POST** /api/orgs/{org_id}/token-factory/datasets/lock | Lock shared folder as dataset +*DatasetsApi* | [**seal**](docs/DatasetsApi.md#seal) | **POST** /api/orgs/{org_id}/token-factory/datasets/{dataset_id}/seal | Seal dataset *DeploymentsApi* | [**create**](docs/DeploymentsApi.md#create) | **POST** /api/deployments | Create deployment *DeploymentsApi* | [**create_resource_template**](docs/DeploymentsApi.md#create_resource_template) | **POST** /api/deployments/{deployment_id}/template | Create deployment resource template *DeploymentsApi* | [**create_route**](docs/DeploymentsApi.md#create_route) | **POST** /api/deployments/{deployment_id}/routes | Create deployment route @@ -184,6 +202,11 @@ Class | Method | HTTP request | Description *ExternalReposApi* | [**get**](docs/ExternalReposApi.md#get) | **GET** /api/external_repos/{external_repo_id} | Get external repo *ExternalReposApi* | [**list**](docs/ExternalReposApi.md#list) | **GET** /api/external_repos | List external repos *ExternalReposApi* | [**update**](docs/ExternalReposApi.md#update) | **PATCH** /api/external_repos/{external_repo_id} | Update external repo +*FineTuningJobsApi* | [**create**](docs/FineTuningJobsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/fine-tuning/jobs | Create fine-tuning job +*FineTuningJobsApi* | [**get**](docs/FineTuningJobsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id} | Get fine-tuning job +*FineTuningJobsApi* | [**get_logs**](docs/FineTuningJobsApi.md#get_logs) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/logs | Get fine-tuning job historical logs +*FineTuningJobsApi* | [**jobs_cancel**](docs/FineTuningJobsApi.md#jobs_cancel) | **POST** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/cancel | Cancel fine-tuning job +*FineTuningJobsApi* | [**list**](docs/FineTuningJobsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs | List fine-tuning jobs *GroupsApi* | [**create**](docs/GroupsApi.md#create) | **POST** /api/groups | Create group *GroupsApi* | [**create_member**](docs/GroupsApi.md#create_member) | **POST** /api/groups/{group_id}/members | Create group member *GroupsApi* | [**delete**](docs/GroupsApi.md#delete) | **DELETE** /api/groups/{group_id} | Delete group @@ -207,6 +230,13 @@ Class | Method | HTTP request | Description *ImagesApi* | [**get**](docs/ImagesApi.md#get) | **GET** /api/images/{image_id} | Get image *ImagesApi* | [**list**](docs/ImagesApi.md#list) | **GET** /api/images | List images *ImagesApi* | [**update**](docs/ImagesApi.md#update) | **PATCH** /api/images/{image_id} | Update image +*InferenceEndpointsApi* | [**create**](docs/InferenceEndpointsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints | Create inference endpoint +*InferenceEndpointsApi* | [**delete**](docs/InferenceEndpointsApi.md#delete) | **DELETE** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id} | Delete inference endpoint +*InferenceEndpointsApi* | [**endpoints_start**](docs/InferenceEndpointsApi.md#endpoints_start) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/start | Start inference endpoint +*InferenceEndpointsApi* | [**endpoints_stop**](docs/InferenceEndpointsApi.md#endpoints_stop) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/stop | Stop inference endpoint +*InferenceEndpointsApi* | [**get**](docs/InferenceEndpointsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id} | Get inference endpoint +*InferenceEndpointsApi* | [**get_logs**](docs/InferenceEndpointsApi.md#get_logs) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/logs | Get inference endpoint historical logs +*InferenceEndpointsApi* | [**list**](docs/InferenceEndpointsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints | List inference endpoints *InfoApi* | [**get**](docs/InfoApi.md#get) | **GET** /api/info | Get app info *InfoApi* | [**get_server_options**](docs/InfoApi.md#get_server_options) | **GET** /api/info/servers | Get server options *InvitationsApi* | [**create**](docs/InvitationsApi.md#create) | **POST** /api/invitations | Create invitation @@ -384,14 +414,26 @@ Class | Method | HTTP request | Description - [ApiTokenList](docs/ApiTokenList.md) - [ApiTokenUpdate](docs/ApiTokenUpdate.md) - [AppInfo](docs/AppInfo.md) + - [Artifact](docs/Artifact.md) + - [ArtifactCreate](docs/ArtifactCreate.md) + - [ArtifactKind](docs/ArtifactKind.md) + - [ArtifactList](docs/ArtifactList.md) + - [ArtifactStatus](docs/ArtifactStatus.md) + - [ArtifactUpdate](docs/ArtifactUpdate.md) - [Auth0Info](docs/Auth0Info.md) - [AuthorizationCodeGrant](docs/AuthorizationCodeGrant.md) - [AuthorizationGrant](docs/AuthorizationGrant.md) - [AuthorizationRefreshGrant](docs/AuthorizationRefreshGrant.md) - [AuthorizationTokenResponse](docs/AuthorizationTokenResponse.md) - [BuildData](docs/BuildData.md) + - [Cluster](docs/Cluster.md) + - [ClusterConnectionType](docs/ClusterConnectionType.md) + - [ClusterCreate](docs/ClusterCreate.md) + - [ClusterList](docs/ClusterList.md) + - [ClusterUpdate](docs/ClusterUpdate.md) - [ConcurrencyPolicy](docs/ConcurrencyPolicy.md) - [Condition](docs/Condition.md) + - [ConfigFileEntry](docs/ConfigFileEntry.md) - [ContainerRuntimeSummary](docs/ContainerRuntimeSummary.md) - [ContainerStatus](docs/ContainerStatus.md) - [CronSchedule](docs/CronSchedule.md) @@ -415,6 +457,11 @@ Class | Method | HTTP request | Description - [DaskWorkerRuntimeSummaryList](docs/DaskWorkerRuntimeSummaryList.md) - [DaskWorkerSummary](docs/DaskWorkerSummary.md) - [DataPoint](docs/DataPoint.md) + - [Dataset](docs/Dataset.md) + - [DatasetCreate](docs/DatasetCreate.md) + - [DatasetImportCreate](docs/DatasetImportCreate.md) + - [DatasetList](docs/DatasetList.md) + - [DatasetLockCreate](docs/DatasetLockCreate.md) - [DefaultImages](docs/DefaultImages.md) - [DefaultSizes](docs/DefaultSizes.md) - [Deployment](docs/Deployment.md) @@ -428,6 +475,7 @@ Class | Method | HTTP request | Description - [DeploymentStart](docs/DeploymentStart.md) - [DeploymentStatus](docs/DeploymentStatus.md) - [DeploymentUpdate](docs/DeploymentUpdate.md) + - [DiskSpaceOption](docs/DiskSpaceOption.md) - [ExternalRepo](docs/ExternalRepo.md) - [ExternalRepoAttachment](docs/ExternalRepoAttachment.md) - [ExternalRepoAttachmentCreate](docs/ExternalRepoAttachmentCreate.md) @@ -443,6 +491,10 @@ Class | Method | HTTP request | Description - [ExtraPackagesRecipeApt](docs/ExtraPackagesRecipeApt.md) - [ExtraPackagesRecipeConda](docs/ExtraPackagesRecipeConda.md) - [ExtraPackagesRecipePip](docs/ExtraPackagesRecipePip.md) + - [FineTuneJobCreate](docs/FineTuneJobCreate.md) + - [FineTuneJobList](docs/FineTuneJobList.md) + - [FineTuneJobSummary](docs/FineTuneJobSummary.md) + - [FineTuneJobView](docs/FineTuneJobView.md) - [Group](docs/Group.md) - [GroupCreate](docs/GroupCreate.md) - [GroupList](docs/GroupList.md) @@ -453,6 +505,8 @@ Class | Method | HTTP request | Description - [HardwareType](docs/HardwareType.md) - [HistoricLog](docs/HistoricLog.md) - [HistoricLogList](docs/HistoricLogList.md) + - [Hyperparameters](docs/Hyperparameters.md) + - [Hyperparameters1](docs/Hyperparameters1.md) - [Identity](docs/Identity.md) - [IdentityByGroupId](docs/IdentityByGroupId.md) - [IdentityByUserId](docs/IdentityByUserId.md) @@ -479,6 +533,10 @@ Class | Method | HTTP request | Description - [ImageTagState](docs/ImageTagState.md) - [ImageTagUpdate](docs/ImageTagUpdate.md) - [ImageUpdate](docs/ImageUpdate.md) + - [InferenceEndpointCreate](docs/InferenceEndpointCreate.md) + - [InferenceEndpointList](docs/InferenceEndpointList.md) + - [InferenceEndpointSummary](docs/InferenceEndpointSummary.md) + - [InferenceEndpointView](docs/InferenceEndpointView.md) - [InstanceSize](docs/InstanceSize.md) - [Invitation](docs/Invitation.md) - [InvitationCreate](docs/InvitationCreate.md) @@ -578,6 +636,7 @@ Class | Method | HTTP request | Description - [RouteCreate](docs/RouteCreate.md) - [RouteList](docs/RouteList.md) - [RouteReference](docs/RouteReference.md) + - [RouteState](docs/RouteState.md) - [RouteUpdate](docs/RouteUpdate.md) - [SSHPrivateKey](docs/SSHPrivateKey.md) - [SSHPrivateKeyCreate](docs/SSHPrivateKeyCreate.md) diff --git a/client.yaml b/client.yaml index 3f4ca82..708dddd 100644 --- a/client.yaml +++ b/client.yaml @@ -308,6 +308,140 @@ paths: schema: $ref: '#/components/schemas/AuthorizationTokenResponse' description: Created + /api/clusters: + get: + summary: List clusters + description: Paginated list of clusters. + operationId: clusters_list + tags: + - clusters + parameters: + - in: query + name: org_id + description: Filter clusters by org ID. + schema: + type: string + required: false + - in: query + name: name + description: Substring search on cluster name. + schema: + type: string + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterList' + description: Ok + post: + summary: Create cluster + description: Create a new cluster. + operationId: clusters_create + tags: + - clusters + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + description: Created + /api/clusters/{cluster_id}: + delete: + summary: Delete cluster + description: Delete a cluster. + operationId: clusters_delete + tags: + - clusters + parameters: + - name: cluster_id + in: path + schema: + type: string + required: true + responses: + '204': + description: Deleted + get: + summary: Get cluster + description: Get a cluster. + operationId: clusters_get + tags: + - clusters + parameters: + - name: cluster_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + description: Ok + patch: + summary: Update cluster + description: Update a cluster. + operationId: clusters_update + tags: + - clusters + parameters: + - name: cluster_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + description: Updated /api/dask_clusters: get: summary: List dask clusters @@ -1014,7 +1148,14 @@ paths: required: false - in: query name: name - description: Prefix matched search string on deployment name. + description: Substring matched search string on deployment name. + schema: + type: string + required: false + - in: query + name: tags + description: Filter to deployments whose tags contain the given 'key:value' + pair, e.g. 'saturn.io/kind:finetune'. schema: type: string required: false @@ -1357,7 +1498,7 @@ paths: required: true - in: query name: subdomain - description: Prefix matched search string on route subdomain. + description: Substring matched search string on route subdomain. schema: type: string required: false @@ -1530,7 +1671,7 @@ paths: required: true - in: query name: location - description: Prefix matched search string on secret attachment location. + description: Substring matched search string on secret attachment location. schema: type: string required: false @@ -2135,7 +2276,7 @@ paths: required: false - in: query name: remote_url - description: Prefix matched search string on repository remote URL. + description: Substring matched search string on repository remote URL. schema: type: string required: false @@ -2263,7 +2404,7 @@ paths: parameters: - in: query name: name - description: Prefix matched search string on group name. + description: Substring matched search string on group name. schema: type: string required: false @@ -2430,7 +2571,7 @@ paths: required: true - in: query name: name - description: Prefix matched search string on group member username. + description: Substring matched search string on group member username. schema: type: string required: false @@ -2578,7 +2719,7 @@ paths: required: false - in: query name: name - description: Prefix matched search string on image name. + description: Substring matched search string on image name. schema: type: string required: false @@ -2736,13 +2877,13 @@ paths: required: true - in: query name: version - description: Prefix matched search string on image tag version. + description: Substring matched search string on image tag version. schema: type: string required: false - in: query name: image_uri - description: Prefix matched search string on image tag URI. + description: Substring matched search string on image tag URI. schema: type: string required: false @@ -3074,7 +3215,7 @@ paths: required: false - in: query name: email - description: Prefix matched search string on email. + description: Substring matched search string on email. schema: type: string required: false @@ -3251,7 +3392,14 @@ paths: required: false - in: query name: name - description: Prefix matched search string on job name. + description: Substring matched search string on job name. + schema: + type: string + required: false + - in: query + name: tags + description: Filter to jobs whose tags contain the given 'key:value' pair, + e.g. 'saturn.io/kind:finetune'. schema: type: string required: false @@ -3659,7 +3807,7 @@ paths: required: true - in: query name: location - description: Prefix matched search string on secret attachment location. + description: Substring matched search string on secret attachment location. schema: type: string required: false @@ -4087,7 +4235,7 @@ paths: parameters: - in: query name: name - description: Prefix matched search string on usage limit name. + description: Substring matched search string on usage limit name. schema: type: string required: false @@ -4842,7 +4990,7 @@ paths: parameters: - in: query name: name - description: Prefix matched search string on org name. + description: Substring matched search string on org name. schema: type: string required: false @@ -4967,6 +5115,160 @@ paths: schema: $ref: '#/components/schemas/Org' description: Updated + /api/orgs/{org_id}/artifacts: + get: + summary: List artifacts + description: Paginated list of artifacts. + operationId: artifacts_list + tags: + - artifacts + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - in: query + name: kind + description: Filter artifacts by kind. + schema: + $ref: '#/components/schemas/ArtifactKind' + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactList' + description: Ok + post: + summary: Create artifact + description: Create a new artifact. + operationId: artifacts_create + tags: + - artifacts + parameters: + - name: org_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Artifact' + description: Created + /api/orgs/{org_id}/artifacts/{artifact_id}: + delete: + summary: Delete artifact + description: Delete an artifact. + operationId: artifacts_delete + tags: + - artifacts + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: artifact_id + in: path + schema: + type: string + required: true + responses: + '204': + description: Deleted + get: + summary: Get artifact + description: Get an artifact. + operationId: artifacts_get + tags: + - artifacts + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: artifact_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Artifact' + description: Ok + patch: + summary: Update artifact + description: Update an artifact. + operationId: artifacts_update + tags: + - artifacts + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: artifact_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Artifact' + description: Updated /api/orgs/{org_id}/invitations: get: summary: List org invitations @@ -4987,7 +5289,7 @@ paths: required: false - in: query name: email - description: Prefix matched search string on email. + description: Substring matched search string on email. schema: type: string required: false @@ -5297,7 +5599,7 @@ paths: required: true - in: query name: name - description: Prefix matched search string by owner identity name. + description: Substring matched search string by owner identity name. schema: type: string required: false @@ -5366,13 +5668,13 @@ paths: - $ref: '#/components/schemas/OwnerList' - $ref: '#/components/schemas/OwnerDetailedList' description: Ok - /api/orgs/{org_id}/usage/aggregated: + /api/orgs/{org_id}/token-factory/datasets: get: - summary: Get org usage - description: Get total aggregated usage for the org. - operationId: orgs_getAggregatedUsage + summary: List datasets + description: Paginated list of datasets. + operationId: datasets_list tags: - - orgs + - datasets parameters: - name: org_id in: path @@ -5380,194 +5682,215 @@ paths: type: string required: true - in: query - name: start + name: status + description: Filter datasets by status. + schema: + $ref: '#/components/schemas/ArtifactStatus' + required: false + - in: query + name: prev_key + description: Previous page key. schema: type: string - format: date-time required: false - in: query - name: end + name: next_key + description: Next page key. schema: type: string - format: date-time required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AggregatedUsage' + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DatasetList' description: Ok - /api/orgs/{org_id}/usage/daily: - get: - summary: Get org daily usage - description: Get usage for the org aggregated by day. - operationId: orgs_getDailyUsage + post: + summary: Create dataset + description: Create a new dataset. + operationId: datasets_create tags: - - orgs + - datasets parameters: - name: org_id in: path schema: type: string required: true - - in: query - name: start + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatasetCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Dataset' + description: Created + /api/orgs/{org_id}/token-factory/datasets/{dataset_id}: + delete: + summary: Delete dataset + description: Delete a dataset. + operationId: datasets_delete + tags: + - datasets + parameters: + - name: org_id + in: path schema: type: string - format: date-time - required: false - - in: query - name: end + required: true + - name: dataset_id + in: path schema: type: string - format: date-time - required: false + required: true + responses: + '204': + description: Deleted + get: + summary: Get dataset + description: Get a dataset. + operationId: datasets_get + tags: + - datasets + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: dataset_id + in: path + schema: + type: string + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/DailyUsageList' + $ref: '#/components/schemas/Dataset' description: Ok - /api/orgs/{org_id}/usage/owners: - get: - summary: Get org owner usage - description: Get aggregated usage for users and groups in the org. - operationId: orgs_getOwnerUsage + /api/orgs/{org_id}/token-factory/datasets/{dataset_id}/seal: + post: + summary: Seal dataset + description: Transition a dataset from `assembling` to `ready`, making it immutable. + operationId: datasets_seal tags: - - orgs + - datasets parameters: - name: org_id in: path schema: type: string required: true - - in: query - name: start - schema: - type: string - format: date-time - required: false - - in: query - name: end + - name: dataset_id + in: path schema: type: string - format: date-time - required: false + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/OwnerUsageList' - description: Ok - /api/orgs/invitation/{token}/accept: + $ref: '#/components/schemas/Dataset' + description: Sealed + /api/orgs/{org_id}/token-factory/datasets/import: post: - summary: Accept org invitation - operationId: orgs_acceptInvitation - tags: - - orgs + summary: Import dataset + description: 'Create a dataset in `assembling` state and launch a CPU job that + downloads the given Hugging Face dataset, auto-detects its shape, normalises + it to the canonical conversational format, and writes it into the org''s tf-datasets + folder. The job marks the dataset `ready` on success or `error` if the source + format is not recognised. + + ' + operationId: datasets_import + tags: + - datasets parameters: - - in: path - name: token + - name: org_id + in: path schema: type: string required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatasetImportCreate' responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/OwnerDetailed' - description: Accepted - /api/orgs/invitation/{token}/decline: - delete: - summary: Decline org invitation - operationId: orgs_declineInvitation - tags: - - orgs + $ref: '#/components/schemas/Dataset' + description: Import started + /api/orgs/{org_id}/token-factory/datasets/lock: + post: + summary: Lock shared folder as dataset + description: 'Register an existing SharedFolder (that already holds dataset + bytes) as a dataset, zero-copy, by locking it to ReadOnlyMany. No job runs + and nothing is copied; the dataset is immediately `ready` and its location + points at the existing folder. The folder becomes read-only. + + ' + operationId: datasets_lock + tags: + - datasets parameters: - - in: path - name: token + - name: org_id + in: path schema: type: string required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatasetLockCreate' responses: - '204': - description: Declined - /api/recipes: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Dataset' + description: Locked and registered + /api/orgs/{org_id}/token-factory/fine-tuning/jobs: get: - summary: List recipes - description: Paginated list of recipes. - operationId: recipes_list + summary: List fine-tuning jobs + description: Paginated list of fine-tuning jobs. + operationId: fine-tuningjobs_list tags: - - recipes + - fine_tuning_jobs parameters: - - in: query - name: owner_name - description: Reference owner by name. - schema: - type: string - required: false - - in: query - name: owner_id - description: Reference owner by ID. - schema: - type: string - required: false - - in: query - name: user_id - description: Reference owner by user ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: group_id - description: Reference owner by group ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: org_id - description: Reference owner by org ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: owner - description: Reference owner by name. - schema: - type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ - required: false - - in: query - name: type - schema: - type: string - enum: - - workspace - - deployment - - job - - image - required: false - - in: query - name: name + - name: org_id + in: path schema: type: string - required: false - - in: query - name: as_template - schema: - type: boolean - default: false - required: false + required: true - in: query name: prev_key description: Previous page key. @@ -5601,180 +5924,154 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecipeList' + $ref: '#/components/schemas/FineTuneJobList' description: Ok post: - summary: Create recipe - description: Create a new recipe. - operationId: recipes_create + summary: Create fine-tuning job + description: Create a new fine-tuning job. + operationId: fine-tuningjobs_create tags: - - recipes + - fine_tuning_jobs + parameters: + - name: org_id + in: path + schema: + type: string + required: true requestBody: content: application/json: schema: - $ref: '#/components/schemas/Recipe' + $ref: '#/components/schemas/FineTuneJobCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/Recipe' + $ref: '#/components/schemas/FineTuneJobView' description: Created - put: - summary: Apply recipe - operationId: recipes_apply + /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}: + get: + summary: Get fine-tuning job + description: Get a fine-tuning job. + operationId: fine-tuningjobs_get tags: - - recipes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Recipe' + - fine_tuning_jobs + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: job_id + in: path + schema: + type: string + required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/Recipe' - description: Applied - /api/recipes/{recipe_type}/{name}: - get: - summary: Get recipe - operationId: recipes_get + $ref: '#/components/schemas/FineTuneJobView' + description: Ok + /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/cancel: + post: + summary: Cancel fine-tuning job + description: Stop the underlying intermittent deployment. + operationId: finetune_jobs_cancel tags: - - recipes + - fine-tuning jobs parameters: - - name: recipe_type + - name: org_id in: path - required: true schema: type: string - - name: name - in: path required: true + - name: job_id + in: path schema: type: string - - in: query - name: owner_name - description: Reference owner by name. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FineTuneJobView' + description: Cancelled + /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/logs: + get: + summary: Get fine-tuning job historical logs + description: Historical record of logs from the resource. + operationId: fine-tuningjobs_getLogs + tags: + - fine_tuning_jobs + parameters: + - name: org_id + in: path schema: type: string - required: false - - in: query - name: owner_id - description: Reference owner by ID. + required: true + - name: job_id + in: path schema: type: string - required: false + required: true - in: query - name: user_id - description: Reference owner by user ID. + name: pod_name + description: Name of the pod to retrieve logs from. schema: type: string - default: null - nullable: true required: false - in: query - name: group_id - description: Reference owner by group ID. + name: cluster + description: Name of the cluster the pod lives in. schema: type: string - default: null - nullable: true required: false - in: query - name: org_id - description: Reference owner by org ID. + name: prev_key + description: Previous page key. schema: type: string - default: null - nullable: true required: false - in: query - name: owner - description: Reference owner by name. + name: next_key + description: Next page key. schema: type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: as_template + name: page_size + description: Maximum number of results per page. schema: - type: boolean - default: false + type: integer + default: 100 + minimum: 1 + maximum: 1000 required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Recipe' - description: '200' - /api/secrets: + $ref: '#/components/schemas/HistoricLogList' + description: Ok + /api/orgs/{org_id}/token-factory/inference-endpoints: get: - summary: List secrets - description: Paginated list of secrets. - operationId: secrets_list + summary: List inference endpoints + description: Paginated list of inference endpoints. + operationId: inferenceendpoints_list tags: - - secrets + - inference_endpoints parameters: - - in: query - name: owner_name - description: Reference owner by name. - schema: - type: string - required: false - - in: query - name: owner_id - description: Reference owner by ID. - schema: - type: string - required: false - - in: query - name: user_id - description: Reference owner by user ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: group_id - description: Reference owner by group ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: org_id - description: Reference owner by org ID. - schema: - type: string - default: null - nullable: true - required: false - - in: query - name: owner - description: Reference owner by name. - schema: - type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ - required: false - - in: query - name: name - description: Prefix matched search string on secret name. + - name: org_id + in: path schema: type: string - required: false - - in: query - name: access - description: Filter secrets by access level. - schema: - $ref: '#/components/schemas/SecretAccessLevel' - required: false + required: true - in: query name: prev_key description: Previous page key. @@ -5808,36 +6105,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SecretList' + $ref: '#/components/schemas/InferenceEndpointList' description: Ok post: - summary: Create secret - description: Create a new secret. - operationId: secrets_create + summary: Create inference endpoint + description: Create a new inference endpoint. + operationId: inferenceendpoints_create tags: - - secrets + - inference_endpoints + parameters: + - name: org_id + in: path + schema: + type: string + required: true requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecretCreate' + $ref: '#/components/schemas/InferenceEndpointCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/Secret' + $ref: '#/components/schemas/InferenceEndpointView' description: Created - /api/secrets/{secret_id}: + /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}: delete: - summary: Delete secret - description: Delete a secret. - operationId: secrets_delete + summary: Delete inference endpoint + description: Delete an inference endpoint. + operationId: inferenceendpoints_delete tags: - - secrets + - inference_endpoints parameters: - - name: secret_id + - name: org_id + in: path + schema: + type: string + required: true + - name: endpoint_id in: path schema: type: string @@ -5846,79 +6154,56 @@ paths: '204': description: Deleted get: - summary: Get secret - description: Get a secret. - operationId: secrets_get + summary: Get inference endpoint + description: Get an inference endpoint. + operationId: inferenceendpoints_get tags: - - secrets + - inference_endpoints parameters: - - name: secret_id + - name: org_id in: path schema: type: string required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Secret' - description: Ok - patch: - summary: Update secret - description: Update a secret. - operationId: secrets_update - tags: - - secrets - parameters: - - name: secret_id + - name: endpoint_id in: path schema: type: string required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SecretUpdate' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Secret' - description: Updated - /api/service_account_entitlements: + $ref: '#/components/schemas/InferenceEndpointView' + description: Ok + /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/logs: get: - summary: List service account entitlements - description: Paginated list of service account entitlements. - operationId: serviceaccountentitlements_list + summary: Get inference endpoint historical logs + description: Historical record of logs from the resource. + operationId: inferenceendpoints_getLogs tags: - - service_account_entitlements + - inference_endpoints parameters: - - in: query - name: user_id - description: Identity reference by user ID + - name: org_id + in: path schema: type: string - required: false - - in: query - name: group_id - description: Identity reference by group ID + required: true + - name: endpoint_id + in: path schema: type: string - required: false + required: true - in: query - name: identity - description: Identity reference by name + name: pod_name + description: Name of the pod to retrieve logs from. schema: type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: name - description: Prefix matched search string on entitled service account name. + name: cluster + description: Name of the cluster the pod lives in. schema: type: string required: false @@ -5936,70 +6221,59 @@ paths: required: false - in: query name: page_size - description: Page size. + description: Maximum number of results per page. schema: type: integer default: 100 minimum: 1 maximum: 1000 required: false - - in: query - name: descending - description: List results in descending order. - schema: - type: boolean - default: false - required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountEntitlementList' + $ref: '#/components/schemas/HistoricLogList' description: Ok + /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/start: post: - summary: Create service account entitlement - description: Create a new service account entitlement. - operationId: serviceaccountentitlements_create + summary: Start inference endpoint + description: Bring up the underlying persistent deployment. + operationId: inference_endpoints_start tags: - - service_account_entitlements - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAccountEntitlementCreate' + - inference endpoints + parameters: + - name: org_id + in: path + schema: + type: string + required: true + - name: endpoint_id + in: path + schema: + type: string required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountEntitlement' - description: Created - /api/service_account_entitlements/{service_account_entitlement_id}: - delete: - summary: Delete service account entitlement - description: Delete a service account entitlement. - operationId: serviceaccountentitlements_delete + $ref: '#/components/schemas/InferenceEndpointView' + description: Started + /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/stop: + post: + summary: Stop inference endpoint + description: Tear down the pod but keep the DB row. + operationId: inference_endpoints_stop tags: - - service_account_entitlements + - inference endpoints parameters: - - name: service_account_entitlement_id + - name: org_id in: path schema: type: string required: true - responses: - '204': - description: Deleted - get: - summary: Get service account entitlement - description: Get a service account entitlement. - operationId: serviceaccountentitlements_get - tags: - - service_account_entitlements - parameters: - - name: service_account_entitlement_id + - name: endpoint_id in: path schema: type: string @@ -6009,162 +6283,210 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountEntitlement' - description: Ok - /api/service_accounts: - get: - summary: List service accounts - description: Paginated list of service accounts. - operationId: serviceaccounts_list + $ref: '#/components/schemas/InferenceEndpointView' + description: Stopped + /api/orgs/{org_id}/usage/aggregated: + get: + summary: Get org usage + description: Get total aggregated usage for the org. + operationId: orgs_getAggregatedUsage tags: - - service_accounts + - orgs parameters: - - in: query - name: name - description: Prefix matched search string on service account name. + - name: org_id + in: path schema: type: string - required: false + required: true - in: query - name: prev_key - description: Previous page key. + name: start schema: type: string + format: date-time required: false - in: query - name: next_key - description: Next page key. + name: end schema: type: string - required: false - - in: query - name: page_size - description: Page size. - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - required: false - - in: query - name: descending - description: List results in descending order. - schema: - type: boolean - default: false + format: date-time required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountList' + $ref: '#/components/schemas/AggregatedUsage' description: Ok - post: - summary: Create service account - description: Create a new service account. - operationId: serviceaccounts_create - tags: - - service_accounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAccountCreate' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAccount' - description: Created - /api/service_accounts/{service_account_id}: - delete: - summary: Delete service account - description: Delete a service account. - operationId: serviceaccounts_delete + /api/orgs/{org_id}/usage/daily: + get: + summary: Get org daily usage + description: Get usage for the org aggregated by day. + operationId: orgs_getDailyUsage tags: - - service_accounts + - orgs parameters: - - name: service_account_id + - name: org_id in: path schema: type: string required: true + - in: query + name: start + schema: + type: string + format: date-time + required: false + - in: query + name: end + schema: + type: string + format: date-time + required: false responses: - '204': - description: Deleted + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DailyUsageList' + description: Ok + /api/orgs/{org_id}/usage/owners: get: - summary: Get service account - description: Get a service account. - operationId: serviceaccounts_get + summary: Get org owner usage + description: Get aggregated usage for users and groups in the org. + operationId: orgs_getOwnerUsage tags: - - service_accounts + - orgs parameters: - - name: service_account_id + - name: org_id in: path schema: type: string required: true + - in: query + name: start + schema: + type: string + format: date-time + required: false + - in: query + name: end + schema: + type: string + format: date-time + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccount' + $ref: '#/components/schemas/OwnerUsageList' description: Ok - patch: - summary: Update service account - description: Update a service account. - operationId: serviceaccounts_update + /api/orgs/invitation/{token}/accept: + post: + summary: Accept org invitation + operationId: orgs_acceptInvitation tags: - - service_accounts + - orgs parameters: - - name: service_account_id - in: path + - in: path + name: token schema: type: string required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAccountUpdate' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccount' - description: Updated - /api/shared_folder_attachments: + $ref: '#/components/schemas/OwnerDetailed' + description: Accepted + /api/orgs/invitation/{token}/decline: + delete: + summary: Decline org invitation + operationId: orgs_declineInvitation + tags: + - orgs + parameters: + - in: path + name: token + schema: + type: string + required: true + responses: + '204': + description: Declined + /api/recipes: get: - summary: List shared folder attachments - description: Paginated list of shared folder attachments. - operationId: sharedfolderattachments_list + summary: List recipes + description: Paginated list of recipes. + operationId: recipes_list tags: - - shared_folder_attachments + - recipes parameters: - in: query - name: job_id - description: Reference by job ID. + name: owner_name + description: Reference owner by name. schema: type: string required: false - in: query - name: deployment_id - description: Reference by deployment ID. + name: owner_id + description: Reference owner by ID. schema: type: string required: false - in: query - name: workspace_id - description: Reference by workspace ID. + name: user_id + description: Reference owner by user ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: group_id + description: Reference owner by group ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: org_id + description: Reference owner by org ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: owner + description: Reference owner by name. + schema: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + required: false + - in: query + name: type + schema: + type: string + enum: + - workspace + - deployment + - job + - image + required: false + - in: query + name: name schema: type: string required: false + - in: query + name: as_template + schema: + type: boolean + default: false + required: false - in: query name: prev_key description: Previous page key. @@ -6198,94 +6520,124 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SharedFolderAttachmentList' + $ref: '#/components/schemas/RecipeList' description: Ok post: - summary: Create shared folder attachment - description: Create a new shared folder attachment. - operationId: sharedfolderattachments_create + summary: Create recipe + description: Create a new recipe. + operationId: recipes_create tags: - - shared_folder_attachments + - recipes requestBody: content: application/json: schema: - $ref: '#/components/schemas/SharedFolderAttachmentCreate' + $ref: '#/components/schemas/Recipe' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/SharedFolderAttachment' + $ref: '#/components/schemas/Recipe' description: Created - /api/shared_folder_attachments/{shared_folder_attachment_id}: - delete: - summary: Delete shared folder attachment - description: Delete a shared folder attachment. - operationId: sharedfolderattachments_delete + put: + summary: Apply recipe + operationId: recipes_apply tags: - - shared_folder_attachments - parameters: - - name: shared_folder_attachment_id - in: path - schema: - type: string - required: true - responses: - '204': - description: Deleted - get: - summary: Get shared folder attachment - description: Get a shared folder attachment. - operationId: sharedfolderattachments_get - tags: - - shared_folder_attachments - parameters: - - name: shared_folder_attachment_id - in: path - schema: - type: string - required: true + - recipes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Recipe' responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/SharedFolderAttachment' - description: Ok - patch: - summary: Update shared folder attachment - description: Update a shared folder attachment. - operationId: sharedfolderattachments_update + $ref: '#/components/schemas/Recipe' + description: Applied + /api/recipes/{recipe_type}/{name}: + get: + summary: Get recipe + operationId: recipes_get tags: - - shared_folder_attachments + - recipes parameters: - - name: shared_folder_attachment_id + - name: recipe_type in: path + required: true schema: type: string + - name: name + in: path required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SharedFolderAttachmentUpdate' - required: true + schema: + type: string + - in: query + name: owner_name + description: Reference owner by name. + schema: + type: string + required: false + - in: query + name: owner_id + description: Reference owner by ID. + schema: + type: string + required: false + - in: query + name: user_id + description: Reference owner by user ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: group_id + description: Reference owner by group ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: org_id + description: Reference owner by org ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: owner + description: Reference owner by name. + schema: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + required: false + - in: query + name: as_template + schema: + type: boolean + default: false + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SharedFolderAttachment' - description: Updated - /api/shared_folders: + $ref: '#/components/schemas/Recipe' + description: '200' + /api/secrets: get: - summary: List shared folders - description: Paginated list of shared folders. - operationId: sharedfolders_list + summary: List secrets + description: Paginated list of secrets. + operationId: secrets_list tags: - - shared_folders + - secrets parameters: - in: query name: owner_name @@ -6332,15 +6684,15 @@ paths: required: false - in: query name: name - description: Prefix matched search string on shared folder name. + description: Substring matched search string on secret name. schema: type: string required: false - in: query name: access - description: Filter shared folders by access level. + description: Filter secrets by access level. schema: - $ref: '#/components/schemas/SharedFolderAccessLevel' + $ref: '#/components/schemas/SecretAccessLevel' required: false - in: query name: prev_key @@ -6375,36 +6727,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SharedFolderList' + $ref: '#/components/schemas/SecretList' description: Ok post: - summary: Create shared folder - description: Create a new shared folder. - operationId: sharedfolders_create + summary: Create secret + description: Create a new secret. + operationId: secrets_create tags: - - shared_folders + - secrets requestBody: content: application/json: schema: - $ref: '#/components/schemas/SharedFolderCreate' + $ref: '#/components/schemas/SecretCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/SharedFolder' + $ref: '#/components/schemas/Secret' description: Created - /api/shared_folders/{shared_folder_id}: + /api/secrets/{secret_id}: delete: - summary: Delete shared folder - description: Delete a shared folder. - operationId: sharedfolders_delete + summary: Delete secret + description: Delete a secret. + operationId: secrets_delete tags: - - shared_folders + - secrets parameters: - - name: shared_folder_id + - name: secret_id in: path schema: type: string @@ -6413,13 +6765,13 @@ paths: '204': description: Deleted get: - summary: Get shared folder - description: Get a shared folder. - operationId: sharedfolders_get + summary: Get secret + description: Get a secret. + operationId: secrets_get tags: - - shared_folders + - secrets parameters: - - name: shared_folder_id + - name: secret_id in: path schema: type: string @@ -6429,16 +6781,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SharedFolder' + $ref: '#/components/schemas/Secret' description: Ok patch: - summary: Update shared folder - description: Update a shared folder. - operationId: sharedfolders_update + summary: Update secret + description: Update a secret. + operationId: secrets_update tags: - - shared_folders + - secrets parameters: - - name: shared_folder_id + - name: secret_id in: path schema: type: string @@ -6447,22 +6799,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SharedFolderUpdate' + $ref: '#/components/schemas/SecretUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SharedFolder' + $ref: '#/components/schemas/Secret' description: Updated - /api/ssh_private_keys: + /api/service_account_entitlements: get: - summary: List ssh private keys - description: Paginated list of ssh private keys. - operationId: sshprivatekeys_list + summary: List service account entitlements + description: Paginated list of service account entitlements. + operationId: serviceaccountentitlements_list tags: - - ssh_private_keys + - service_account_entitlements parameters: - in: query name: user_id @@ -6485,16 +6837,10 @@ paths: required: false - in: query name: name - description: Prefix matched search string on SSH private key name. + description: Substring matched search string on entitled service account name. schema: type: string required: false - - in: query - name: is_default - description: Filter SSH private keys by is_default. - schema: - type: boolean - required: false - in: query name: prev_key description: Previous page key. @@ -6528,36 +6874,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SSHPrivateKeyList' + $ref: '#/components/schemas/ServiceAccountEntitlementList' description: Ok post: - summary: Create ssh private key - description: Create a new ssh private key. - operationId: sshprivatekeys_create + summary: Create service account entitlement + description: Create a new service account entitlement. + operationId: serviceaccountentitlements_create tags: - - ssh_private_keys + - service_account_entitlements requestBody: content: application/json: schema: - $ref: '#/components/schemas/SSHPrivateKeyCreate' + $ref: '#/components/schemas/ServiceAccountEntitlementCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/SSHPrivateKey' + $ref: '#/components/schemas/ServiceAccountEntitlement' description: Created - /api/ssh_private_keys/{ssh_privatekey_id}: + /api/service_account_entitlements/{service_account_entitlement_id}: delete: - summary: Delete ssh private key - description: Delete a ssh private key. - operationId: sshprivatekeys_delete + summary: Delete service account entitlement + description: Delete a service account entitlement. + operationId: serviceaccountentitlements_delete tags: - - ssh_private_keys + - service_account_entitlements parameters: - - name: ssh_privatekey_id + - name: service_account_entitlement_id in: path schema: type: string @@ -6566,13 +6912,13 @@ paths: '204': description: Deleted get: - summary: Get ssh private key - description: Get a ssh private key. - operationId: sshprivatekeys_get + summary: Get service account entitlement + description: Get a service account entitlement. + operationId: serviceaccountentitlements_get tags: - - ssh_private_keys + - service_account_entitlements parameters: - - name: ssh_privatekey_id + - name: service_account_entitlement_id in: path schema: type: string @@ -6582,63 +6928,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SSHPrivateKey' + $ref: '#/components/schemas/ServiceAccountEntitlement' description: Ok - patch: - summary: Update ssh private key - description: Update a ssh private key. - operationId: sshprivatekeys_update + /api/service_accounts: + get: + summary: List service accounts + description: Paginated list of service accounts. + operationId: serviceaccounts_list tags: - - ssh_private_keys + - service_accounts parameters: - - name: ssh_privatekey_id - in: path - schema: - type: string - required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SSHPrivateKeyUpdate' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SSHPrivateKey' - description: Updated - /api/ssh_public_keys: - get: - summary: List ssh public keys - description: Paginated list of ssh public keys. - operationId: sshpublickeys_list - tags: - - ssh_public_keys - parameters: - - in: query - name: user_id - description: Identity reference by user ID - schema: - type: string - required: false - - in: query - name: group_id - description: Identity reference by group ID - schema: - type: string - required: false - - in: query - name: identity - description: Identity reference by name - schema: - type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ - required: false - - in: query - name: name - description: Prefix matched search string on SSH public key name. + - in: query + name: name + description: Substring matched search string on service account name. schema: type: string required: false @@ -6675,36 +6977,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKeyList' + $ref: '#/components/schemas/ServiceAccountList' description: Ok post: - summary: Create ssh public key - description: Create a new ssh public key. - operationId: sshpublickeys_create + summary: Create service account + description: Create a new service account. + operationId: serviceaccounts_create tags: - - ssh_public_keys + - service_accounts requestBody: content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKeyCreate' + $ref: '#/components/schemas/ServiceAccountCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKey' + $ref: '#/components/schemas/ServiceAccount' description: Created - /api/ssh_public_keys/{ssh_publickey_id}: + /api/service_accounts/{service_account_id}: delete: - summary: Delete ssh public key - description: Delete a ssh public key. - operationId: sshpublickeys_delete + summary: Delete service account + description: Delete a service account. + operationId: serviceaccounts_delete tags: - - ssh_public_keys + - service_accounts parameters: - - name: ssh_publickey_id + - name: service_account_id in: path schema: type: string @@ -6713,13 +7015,13 @@ paths: '204': description: Deleted get: - summary: Get ssh public key - description: Get a ssh public key. - operationId: sshpublickeys_get + summary: Get service account + description: Get a service account. + operationId: serviceaccounts_get tags: - - ssh_public_keys + - service_accounts parameters: - - name: ssh_publickey_id + - name: service_account_id in: path schema: type: string @@ -6729,16 +7031,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKey' + $ref: '#/components/schemas/ServiceAccount' description: Ok patch: - summary: Update ssh public key - description: Update a ssh public key. - operationId: sshpublickeys_update + summary: Update service account + description: Update a service account. + operationId: serviceaccounts_update tags: - - ssh_public_keys + - service_accounts parameters: - - name: ssh_publickey_id + - name: service_account_id in: path schema: type: string @@ -6747,54 +7049,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKeyUpdate' + $ref: '#/components/schemas/ServiceAccountUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SSHPublicKey' + $ref: '#/components/schemas/ServiceAccount' description: Updated - /api/status: - get: - summary: Get API status - operationId: apistatus_get - tags: - - api_status - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ApiStatus' - description: Ok - /api/tokens: + /api/shared_folder_attachments: get: - summary: List api tokens - description: Paginated list of api tokens. - operationId: apitokens_list + summary: List shared folder attachments + description: Paginated list of shared folder attachments. + operationId: sharedfolderattachments_list tags: - - api_tokens + - shared_folder_attachments parameters: - in: query - name: user_id - description: Identity reference by user ID + name: job_id + description: Reference by job ID. schema: type: string required: false - in: query - name: group_id - description: Identity reference by group ID + name: deployment_id + description: Reference by deployment ID. schema: type: string required: false - in: query - name: identity - description: Identity reference by name + name: workspace_id + description: Reference by workspace ID. schema: type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query name: prev_key @@ -6829,36 +7117,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiTokenList' + $ref: '#/components/schemas/SharedFolderAttachmentList' description: Ok post: - summary: Create api token - description: Create a new api token. - operationId: apitokens_create + summary: Create shared folder attachment + description: Create a new shared folder attachment. + operationId: sharedfolderattachments_create tags: - - api_tokens + - shared_folder_attachments requestBody: content: application/json: schema: - $ref: '#/components/schemas/ApiTokenCreate' + $ref: '#/components/schemas/SharedFolderAttachmentCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/ApiToken' + $ref: '#/components/schemas/SharedFolderAttachment' description: Created - /api/tokens/{api_token_id}: + /api/shared_folder_attachments/{shared_folder_attachment_id}: delete: - summary: Delete api token - description: Delete an api token. - operationId: apitokens_delete + summary: Delete shared folder attachment + description: Delete a shared folder attachment. + operationId: sharedfolderattachments_delete tags: - - api_tokens + - shared_folder_attachments parameters: - - name: api_token_id + - name: shared_folder_attachment_id in: path schema: type: string @@ -6867,13 +7155,13 @@ paths: '204': description: Deleted get: - summary: Get api token - description: Get an api token. - operationId: apitokens_get + summary: Get shared folder attachment + description: Get a shared folder attachment. + operationId: sharedfolderattachments_get tags: - - api_tokens + - shared_folder_attachments parameters: - - name: api_token_id + - name: shared_folder_attachment_id in: path schema: type: string @@ -6883,16 +7171,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiTokenInfo' + $ref: '#/components/schemas/SharedFolderAttachment' description: Ok patch: - summary: Update api token - description: Update an api token. - operationId: apitokens_update + summary: Update shared folder attachment + description: Update a shared folder attachment. + operationId: sharedfolderattachments_update tags: - - api_tokens + - shared_folder_attachments parameters: - - name: api_token_id + - name: shared_folder_attachment_id in: path schema: type: string @@ -6901,174 +7189,77 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiTokenUpdate' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ApiTokenInfo' - description: Updated - /api/user: - get: - summary: Get current user - operationId: currentuser_get - tags: - - current_user - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailed' - description: Ok - '204': - description: No authenticated user - patch: - summary: Update current user - operationId: currentuser_update - tags: - - current_user - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserUpdate' + $ref: '#/components/schemas/SharedFolderAttachmentUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/UserDetailed' + $ref: '#/components/schemas/SharedFolderAttachment' description: Updated - /api/user/owners: + /api/shared_folders: get: - summary: List current user owners across orgs - operationId: currentuser_listOwners + summary: List shared folders + description: Paginated list of shared folders. + operationId: sharedfolders_list tags: - - current_user + - shared_folders parameters: - in: query - name: prev_key - description: Previous page key. + name: owner_name + description: Reference owner by name. schema: type: string required: false - in: query - name: next_key - description: Next page key. + name: owner_id + description: Reference owner by ID. schema: type: string required: false - in: query - name: page_size - description: Page size. + name: user_id + description: Reference owner by user ID. schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 + type: string + default: null + nullable: true required: false - in: query - name: descending - description: List results in descending order. + name: group_id + description: Reference owner by group ID. schema: - type: boolean - default: false - required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserOwnerList' - description: Ok - /api/user/preferences: - get: - summary: Get current user preferences - operationId: currentuser_getPreferences - tags: - - current_user - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserPreferences' - description: Ok - patch: - summary: Update current user preferences - operationId: currentuser_updatePreferences - tags: - - current_user - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserPreferencesUpdate' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserPreferences' - description: Updated - /api/user/usage/aggregated: - get: - summary: Get aggregated usage - description: Get total aggregated usage for the current user. - operationId: currentuser_getAggregatedUsage - tags: - - current_user - parameters: - - in: query - name: start - schema: - type: string - format: date-time + type: string + default: null + nullable: true required: false - in: query - name: end + name: org_id + description: Reference owner by org ID. schema: type: string - format: date-time + default: null + nullable: true required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UsageLimits' - description: Ok - /api/users: - get: - summary: List users - description: Paginated list of users. - operationId: users_list - tags: - - users - parameters: - in: query - name: username - description: Prefix matched search string on user name. + name: owner + description: Reference owner by name. schema: type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: email - description: Prefix matched search string on user email. + name: name + description: Substring matched search string on shared folder name. schema: type: string required: false - in: query - name: details - description: Retrieve detailed user data. (Admin only) + name: access + description: Filter shared folders by access level. schema: - type: boolean - default: false + $ref: '#/components/schemas/SharedFolderAccessLevel' required: false - in: query name: prev_key @@ -7103,38 +7294,36 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UserList' - - $ref: '#/components/schemas/UserDetailedList' + $ref: '#/components/schemas/SharedFolderList' description: Ok post: - summary: Create user - description: Create a new user. - operationId: users_create + summary: Create shared folder + description: Create a new shared folder. + operationId: sharedfolders_create tags: - - users + - shared_folders requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserAdminCreate' + $ref: '#/components/schemas/SharedFolderCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/UserDetailed' + $ref: '#/components/schemas/SharedFolder' description: Created - /api/users/{user_id}: + /api/shared_folders/{shared_folder_id}: delete: - summary: Delete user - description: Delete an user. - operationId: users_delete + summary: Delete shared folder + description: Delete a shared folder. + operationId: sharedfolders_delete tags: - - users + - shared_folders parameters: - - name: user_id + - name: shared_folder_id in: path schema: type: string @@ -7143,41 +7332,32 @@ paths: '204': description: Deleted get: - summary: Get user - description: Get an user. - operationId: users_get + summary: Get shared folder + description: Get a shared folder. + operationId: sharedfolders_get tags: - - users + - shared_folders parameters: - - name: user_id + - name: shared_folder_id in: path schema: type: string required: true - - in: query - name: details - description: Retrive detailed user data. - schema: - type: boolean - default: false - required: false responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/User' - - $ref: '#/components/schemas/UserDetailed' + $ref: '#/components/schemas/SharedFolder' description: Ok patch: - summary: Update user - description: Update an user. - operationId: users_update + summary: Update shared folder + description: Update a shared folder. + operationId: sharedfolders_update tags: - - users + - shared_folders parameters: - - name: user_id + - name: shared_folder_id in: path schema: type: string @@ -7186,118 +7366,53 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserUpdate' + $ref: '#/components/schemas/SharedFolderUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/UserDetailed' + $ref: '#/components/schemas/SharedFolder' description: Updated - /api/users/{user_id}/owners: - get: - summary: List user owners across orgs - operationId: users_listOwners - tags: - - current_user - parameters: - - name: user_id - in: path - schema: - type: string - required: true - - in: query - name: prev_key - description: Previous page key. - schema: - type: string - required: false - - in: query - name: next_key - description: Next page key. - schema: - type: string - required: false - - in: query - name: page_size - description: Page size. - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - required: false - - in: query - name: descending - description: List results in descending order. - schema: - type: boolean - default: false - required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserOwnerList' - description: Ok - /api/workspaces: + /api/ssh_private_keys: get: - summary: List workspaces - description: Paginated list of workspaces. - operationId: workspaces_list + summary: List ssh private keys + description: Paginated list of ssh private keys. + operationId: sshprivatekeys_list tags: - - workspaces + - ssh_private_keys parameters: - - in: query - name: owner_name - description: Reference owner by name. - schema: - type: string - required: false - - in: query - name: owner_id - description: Reference owner by ID. - schema: - type: string - required: false - in: query name: user_id - description: Reference owner by user ID. + description: Identity reference by user ID schema: type: string - default: null - nullable: true required: false - in: query name: group_id - description: Reference owner by group ID. + description: Identity reference by group ID schema: type: string - default: null - nullable: true required: false - in: query - name: org_id - description: Reference owner by org ID. + name: identity + description: Identity reference by name schema: type: string - default: null - nullable: true + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: owner - description: Reference owner by name. + name: name + description: Substring matched search string on SSH private key name. schema: type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: name - description: Prefix matched search string on workspace name. + name: is_default + description: Filter SSH private keys by is_default. schema: - type: string + type: boolean required: false - in: query name: prev_key @@ -7332,58 +7447,51 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkspaceList' + $ref: '#/components/schemas/SSHPrivateKeyList' description: Ok post: - summary: Create workspace - description: Create a new workspace. - operationId: workspaces_create + summary: Create ssh private key + description: Create a new ssh private key. + operationId: sshprivatekeys_create tags: - - workspaces + - ssh_private_keys requestBody: content: application/json: schema: - $ref: '#/components/schemas/WorkspaceCreate' + $ref: '#/components/schemas/SSHPrivateKeyCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/Workspace' + $ref: '#/components/schemas/SSHPrivateKey' description: Created - /api/workspaces/{workspace_id}: + /api/ssh_private_keys/{ssh_privatekey_id}: delete: - summary: Delete workspace - description: Delete a workspace. - operationId: workspaces_delete + summary: Delete ssh private key + description: Delete a ssh private key. + operationId: sshprivatekeys_delete tags: - - workspaces + - ssh_private_keys parameters: - - name: workspace_id + - name: ssh_privatekey_id in: path schema: type: string required: true - - in: query - name: allow_active - description: Force delete workspace that is currently active. - schema: - type: boolean - default: false - required: false responses: '204': description: Deleted get: - summary: Get workspace - description: Get a workspace. - operationId: workspaces_get + summary: Get ssh private key + description: Get a ssh private key. + operationId: sshprivatekeys_get tags: - - workspaces + - ssh_private_keys parameters: - - name: workspace_id + - name: ssh_privatekey_id in: path schema: type: string @@ -7393,16 +7501,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Workspace' + $ref: '#/components/schemas/SSHPrivateKey' description: Ok patch: - summary: Update workspace - description: Update a workspace. - operationId: workspaces_update + summary: Update ssh private key + description: Update a ssh private key. + operationId: sshprivatekeys_update tags: - - workspaces + - ssh_private_keys parameters: - - name: workspace_id + - name: ssh_privatekey_id in: path schema: type: string @@ -7411,84 +7519,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkspaceUpdate' + $ref: '#/components/schemas/SSHPrivateKeyUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Workspace' + $ref: '#/components/schemas/SSHPrivateKey' description: Updated - /api/workspaces/{workspace_id}/clusters: - get: - summary: Get workspace cluster history - description: Get a list of clusters that the workspace has recently run on. - operationId: workspaces_getClusterHistory - tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceClusters' - description: Ok - /api/workspaces/{workspace_id}/history: + /api/ssh_public_keys: get: - summary: Get workspace pod history - description: Get history of pods run for the workspace. - operationId: workspaces_getPodHistory + summary: List ssh public keys + description: Paginated list of ssh public keys. + operationId: sshpublickeys_list tags: - - workspaces + - ssh_public_keys parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - in: query - name: cluster - description: Cluster to query for metrics. + name: user_id + description: Identity reference by user ID schema: type: string - nullable: true required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceHistory' - description: Ok - /api/workspaces/{workspace_id}/logs: - get: - summary: Get workspace historical logs - description: Historical record of logs from the resource. - operationId: workspaces_getLogs - tags: - - workspaces - parameters: - - name: workspace_id - in: path + - in: query + name: group_id + description: Identity reference by group ID schema: type: string - required: true + required: false - in: query - name: pod_name - description: Name of the pod to retrieve logs from. + name: identity + description: Identity reference by name schema: type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ required: false - in: query - name: cluster - description: Name of the cluster the pod lives in. + name: name + description: Substring matched search string on SSH public key name. schema: type: string required: false @@ -7506,106 +7575,89 @@ paths: required: false - in: query name: page_size - description: Maximum number of results per page. + description: Page size. schema: type: integer default: 100 minimum: 1 maximum: 1000 required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/HistoricLogList' + $ref: '#/components/schemas/SSHPublicKeyList' description: Ok - /api/workspaces/{workspace_id}/metrics: - get: - summary: Get workspace metrics - description: Hardware utilization metrics. - operationId: workspaces_getMetrics + post: + summary: Create ssh public key + description: Create a new ssh public key. + operationId: sshpublickeys_create tags: - - workspaces + - ssh_public_keys + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SSHPublicKeyCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHPublicKey' + description: Created + /api/ssh_public_keys/{ssh_publickey_id}: + delete: + summary: Delete ssh public key + description: Delete a ssh public key. + operationId: sshpublickeys_delete + tags: + - ssh_public_keys parameters: - - name: workspace_id + - name: ssh_publickey_id in: path schema: type: string required: true - - in: query - name: type - description: Filter metric series by type. - schema: - type: string - required: false - - in: query - name: start - description: Start timestamp of the metrics query. - schema: - type: string - format: date-time - required: false - - in: query - name: end - description: End timestamp of the metrics query. - schema: - type: string - format: date-time - required: false - - in: query - name: resolution - description: Sampling resolution of metrics points. - schema: - type: string - required: false - - in: query - name: cluster - description: Cluster to query for metrics. - schema: - type: string - required: false responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Metrics' - description: Ok - /api/workspaces/{workspace_id}/recipe: + '204': + description: Deleted get: - summary: Get workspace recipe - operationId: workspaces_getRecipe + summary: Get ssh public key + description: Get a ssh public key. + operationId: sshpublickeys_get tags: - - workspaces + - ssh_public_keys parameters: - - name: workspace_id + - name: ssh_publickey_id in: path schema: type: string required: true - - in: query - name: as_template - schema: - type: boolean - default: false - required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/WorkspaceRecipe' + $ref: '#/components/schemas/SSHPublicKey' description: Ok - /api/workspaces/{workspace_id}/restart: - post: - summary: Restart workspace - description: Restart a running workspace. - operationId: workspaces_restart + patch: + summary: Update ssh public key + description: Update a ssh public key. + operationId: sshpublickeys_update tags: - - workspaces + - ssh_public_keys parameters: - - name: workspace_id + - name: ssh_publickey_id in: path schema: type: string @@ -7614,42 +7666,63 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkspaceStart' - required: false + $ref: '#/components/schemas/SSHPublicKeyUpdate' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Workspace' - description: Restarted - /api/workspaces/{workspace_id}/routes: + $ref: '#/components/schemas/SSHPublicKey' + description: Updated + /api/status: get: - summary: List workspace routes - description: List ingress routes on the workspace. - operationId: workspaces_listRoutes + summary: Get API status + operationId: apistatus_get tags: - - workspaces + - api_status + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiStatus' + description: Ok + /api/tokens: + get: + summary: List api tokens + description: Paginated list of api tokens. + operationId: apitokens_list + tags: + - api_tokens parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - in: query - name: subdomain - description: Prefix matched search string on route subdomain. + name: user_id + description: Identity reference by user ID schema: type: string required: false - in: query - name: prev_key - description: Previous page key. + name: group_id + description: Identity reference by group ID schema: type: string required: false - in: query - name: next_key + name: identity + description: Identity reference by name + schema: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key description: Next page key. schema: type: string @@ -7675,47 +7748,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RouteList' + $ref: '#/components/schemas/ApiTokenList' description: Ok post: - summary: Create workspace route - description: Add a new ingress route to the workspace. - operationId: workspaces_createRoute + summary: Create api token + description: Create a new api token. + operationId: apitokens_create tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true + - api_tokens requestBody: content: application/json: schema: - $ref: '#/components/schemas/RouteCreate' + $ref: '#/components/schemas/ApiTokenCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/Route' + $ref: '#/components/schemas/ApiToken' description: Created - /api/workspaces/{workspace_id}/routes/{route_id}: + /api/tokens/{api_token_id}: delete: - summary: Delete workspace route - description: Remove an ingress route from workspace. - operationId: workspaces_deleteRoute + summary: Delete api token + description: Delete an api token. + operationId: apitokens_delete tags: - - workspaces + - api_tokens parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - - name: route_id + - name: api_token_id in: path schema: type: string @@ -7724,42 +7786,32 @@ paths: '204': description: Deleted get: - summary: Get workspace route - description: Get an ingress route. - operationId: workspaces_getRoute + summary: Get api token + description: Get an api token. + operationId: apitokens_get tags: - - workspaces + - api_tokens parameters: - - name: workspace_id + - name: api_token_id in: path schema: type: string required: true - - name: route_id - in: path - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Route' + $ref: '#/components/schemas/ApiTokenInfo' description: Ok patch: - summary: Update workspace route - description: Edit the configuration of an ingress route. - operationId: workspaces_updateRoute + summary: Update api token + description: Update an api token. + operationId: apitokens_update tags: - - workspaces + - api_tokens parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - - name: route_id + - name: api_token_id in: path schema: type: string @@ -7768,59 +7820,63 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RouteUpdate' + $ref: '#/components/schemas/ApiTokenUpdate' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Route' + $ref: '#/components/schemas/ApiTokenInfo' description: Updated - /api/workspaces/{workspace_id}/runtimesummary: + /api/user: + delete: + summary: Delete current user + operationId: currentuser_delete + tags: + - current_user + responses: + '204': + description: Deleted get: - summary: Get workspace runtime summary - description: Summary of the current runtime status. - operationId: workspaces_getRuntimeSummary + summary: Get current user + operationId: currentuser_get tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true + - current_user responses: '200': content: application/json: schema: - $ref: '#/components/schemas/WorkspaceRuntimeSummary' + $ref: '#/components/schemas/UserDetailed' description: Ok - /api/workspaces/{workspace_id}/secrets: + '204': + description: No authenticated user + patch: + summary: Update current user + operationId: currentuser_update + tags: + - current_user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailed' + description: Updated + /api/user/owners: get: - summary: List workspace secret attachments - operationId: workspaces_listSecretAttachments + summary: List current user owners across orgs + operationId: currentuser_listOwners tags: - - workspaces + - current_user parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - - in: query - name: location - description: Prefix matched search string on secret attachment location. - schema: - type: string - required: false - - in: query - name: attachment_type - description: Filter secret attachments by type. - schema: - $ref: '#/components/schemas/SecretAttachmentType' - required: false - in: query name: prev_key description: Previous page key. @@ -7854,340 +7910,319 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SecretAttachmentList' + $ref: '#/components/schemas/UserOwnerList' description: Ok - post: - summary: Create workspace secret attachment - operationId: workspaces_createSecretAttachment + /api/user/preferences: + get: + summary: Get current user preferences + operationId: currentuser_getPreferences tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true + - current_user + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserPreferences' + description: Ok + patch: + summary: Update current user preferences + operationId: currentuser_updatePreferences + tags: + - current_user requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecretAttachmentCreate' + $ref: '#/components/schemas/UserPreferencesUpdate' required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/SecretAttachment' - description: Created - /api/workspaces/{workspace_id}/secrets/{secret_attachment_id}: - delete: - summary: Delete workspace secret attachment - operationId: workspaces_deleteSecretAttachment - tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - - name: secret_attachment_id - in: path - required: true - schema: - type: string - responses: - '204': - description: Deleted + $ref: '#/components/schemas/UserPreferences' + description: Updated + /api/user/usage/aggregated: get: - summary: Get workspace secret attachment - operationId: workspaces_getSecretAttachment + summary: Get aggregated usage + description: Get total aggregated usage for the current user. + operationId: currentuser_getAggregatedUsage tags: - - workspaces + - current_user parameters: - - name: workspace_id - in: path + - in: query + name: start schema: type: string - required: true - - name: secret_attachment_id - in: path - required: true + format: date-time + required: false + - in: query + name: end schema: type: string + format: date-time + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecretAttachment' + $ref: '#/components/schemas/UsageLimits' description: Ok - patch: - summary: Update workspace secret attachment - operationId: workspaces_updateSecretAttachment + /api/users: + get: + summary: List users + description: Paginated list of users. + operationId: users_list tags: - - workspaces + - users parameters: - - name: workspace_id - in: path + - in: query + name: username + description: Substring matched search string on user name. schema: type: string - required: true - - name: secret_attachment_id - in: path - required: true + required: false + - in: query + name: email + description: Substring matched search string on user email. schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SecretAttachmentUpdate' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SecretAttachment' - description: Updated - /api/workspaces/{workspace_id}/service_account: - delete: - summary: Delete workspace service account attachment - operationId: workspaces_deleteServiceAccountAttachment - tags: - - workspaces - parameters: - - name: workspace_id - in: path + required: false + - in: query + name: details + description: Retrieve detailed user data. (Admin only) + schema: + type: boolean + default: false + required: false + - in: query + name: prev_key + description: Previous page key. schema: type: string - required: true - responses: - '204': - description: Deleted - get: - summary: Get workspace service account attachment - operationId: workspaces_getServiceAccountAttachment - tags: - - workspaces - parameters: - - name: workspace_id - in: path + required: false + - in: query + name: next_key + description: Next page key. schema: type: string - required: true + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountAttachment' + oneOf: + - $ref: '#/components/schemas/UserList' + - $ref: '#/components/schemas/UserDetailedList' description: Ok - put: - summary: Create workspace service account attachment - operationId: workspaces_createServiceAccountAttachment + post: + summary: Create user + description: Create a new user. + operationId: users_create tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true + - users requestBody: content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountCreateAttachment' + $ref: '#/components/schemas/UserAdminCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountAttachment' + $ref: '#/components/schemas/UserDetailed' description: Created - /api/workspaces/{workspace_id}/start: - post: - summary: Start workspace - description: Run a workspace. - operationId: workspaces_start - tags: - - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WorkspaceStart' - required: false - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Workspace' - description: Started - /api/workspaces/{workspace_id}/stop: - post: - summary: Stop workspace - description: Stop a running workspace. - operationId: workspaces_stop + /api/users/{user_id}: + delete: + summary: Delete user + description: Delete an user. + operationId: users_delete tags: - - workspaces + - users parameters: - - name: workspace_id + - name: user_id in: path schema: type: string required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Workspace' - description: Stopped - /api/workspaces/{workspace_id}/template: + '204': + description: Deleted get: - summary: Get workspace resource template - operationId: workspaces_getResourceTemplate + summary: Get user + description: Get an user. + operationId: users_get tags: - - workspaces + - users parameters: - - name: workspace_id + - name: user_id in: path schema: type: string required: true + - in: query + name: details + description: Retrive detailed user data. + schema: + type: boolean + default: false + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ResourceTemplate' + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/UserDetailed' description: Ok patch: - summary: Update workspace resource template - operationId: workspaces_updateResourceTemplate + summary: Update user + description: Update an user. + operationId: users_update tags: - - workspaces + - users parameters: - - name: workspace_id + - name: user_id in: path schema: type: string required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdate' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ResourceTemplate' - description: Ok - post: - summary: Create workspace resource template - operationId: workspaces_createResourceTemplate + $ref: '#/components/schemas/UserDetailed' + description: Updated + /api/users/{user_id}/owners: + get: + summary: List user owners across orgs + operationId: users_listOwners tags: - - workspaces + - current_user parameters: - - name: workspace_id + - name: user_id in: path schema: type: string required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceTemplate' - description: Ok - /api/workspaces/{workspace_id}/token: - get: - summary: Get workspace API token info - operationId: workspaces_getTokenInfo - tags: - - workspaces - parameters: - - name: workspace_id - in: path + - in: query + name: prev_key + description: Previous page key. schema: type: string - required: true + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ResourceTokenInfo' + $ref: '#/components/schemas/UserOwnerList' description: Ok - patch: - summary: Update workspace API token - description: Update API token scope on the workspace. Invalidates existing tokens. - operationId: workspaces_updateToken + /api/workspaces: + get: + summary: List workspaces + description: Paginated list of workspaces. + operationId: workspaces_list tags: - workspaces parameters: - - name: workspace_id - in: path + - in: query + name: owner_name + description: Reference owner by name. schema: type: string - required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceTokenUpdate' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceTokenInfo' - description: Updated - post: - summary: Rotate workspace API token - description: Invalidate existing API tokens for the workspace. - operationId: workspaces_rotateToken - tags: - - workspaces - parameters: - - name: workspace_id - in: path + required: false + - in: query + name: owner_id + description: Reference owner by ID. schema: type: string - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceTokenInfo' - description: Rotated - /api/workspaces/{workspace_id}/viewers: - get: - summary: List workspace viewers - description: List users and groups with view permissions. - operationId: workspaces_listViewers - tags: - - workspaces - parameters: - - name: workspace_id - in: path + required: false + - in: query + name: user_id + description: Reference owner by user ID. schema: type: string - required: true + default: null + nullable: true + required: false - in: query - name: route_id - description: Filter viewers by route ID. + name: group_id + description: Reference owner by group ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: org_id + description: Reference owner by org ID. + schema: + type: string + default: null + nullable: true + required: false + - in: query + name: owner + description: Reference owner by name. + schema: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + required: false + - in: query + name: name + description: Substring matched search string on workspace name. schema: type: string required: false @@ -8224,38 +8259,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ViewerList' + $ref: '#/components/schemas/WorkspaceList' description: Ok post: - summary: Create workspace viewer - description: Grant a user or group access to routes on the workspace. - operationId: workspaces_createViewer + summary: Create workspace + description: Create a new workspace. + operationId: workspaces_create tags: - workspaces - parameters: - - name: workspace_id - in: path - schema: - type: string - required: true requestBody: content: application/json: schema: - $ref: '#/components/schemas/ViewerCreate' + $ref: '#/components/schemas/WorkspaceCreate' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/Viewer' + $ref: '#/components/schemas/Workspace' description: Created - /api/workspaces/{workspace_id}/viewers/{viewer_id}: + /api/workspaces/{workspace_id}: delete: - summary: Delete workspace viewer - description: Remove a viewer's access permissions. - operationId: workspaces_deleteViewer + summary: Delete workspace + description: Delete a workspace. + operationId: workspaces_delete tags: - workspaces parameters: @@ -8264,2005 +8293,3618 @@ paths: schema: type: string required: true - - name: viewer_id - in: path + - in: query + name: allow_active + description: Force delete workspace that is currently active. schema: - type: string - required: true + type: boolean + default: false + required: false responses: '204': description: Deleted - /api/workspaces/info: get: - summary: Get workspace server options - operationId: workspaces_getServerOptions + summary: Get workspace + description: Get a workspace. + operationId: workspaces_get tags: - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/WorkspaceServerInfo' + $ref: '#/components/schemas/Workspace' description: Ok -openapi: 3.0.3 -components: - schemas: - Recipe: - discriminator: - propertyName: type - mapping: - deployment: '#/components/schemas/DeploymentRecipe' - job: '#/components/schemas/JobRecipe' - workspace: '#/components/schemas/WorkspaceRecipe' - image: '#/components/schemas/ImageRecipe' - oneOf: - - $ref: '#/components/schemas/DeploymentRecipe' - - $ref: '#/components/schemas/JobRecipe' - - $ref: '#/components/schemas/WorkspaceRecipe' - - $ref: '#/components/schemas/ImageRecipe' - type: object - properties: {} - OwnerByName: - type: object - properties: - name: + patch: + summary: Update workspace + description: Update a workspace. + operationId: workspaces_update + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: type: string - description: Reference owner by name. - required: - - name - OwnerById: - type: object - properties: - id: + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Workspace' + description: Updated + /api/workspaces/{workspace_id}/clusters: + get: + summary: Get workspace cluster history + description: Get a list of clusters that the workspace has recently run on. + operationId: workspaces_getClusterHistory + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: type: string - description: Reference owner by ID. - required: - - id - OwnerByIdentityId: - type: object - properties: - user_id: + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceClusters' + description: Ok + /api/workspaces/{workspace_id}/history: + get: + summary: Get workspace pod history + description: Get history of pods run for the workspace. + operationId: workspaces_getPodHistory + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: type: string - default: null - description: Reference owner by user ID. - nullable: true - group_id: + required: true + - in: query + name: cluster + description: Cluster to query for metrics. + schema: type: string - default: null - description: Reference owner by group ID. nullable: true - org_id: + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceHistory' + description: Ok + /api/workspaces/{workspace_id}/logs: + get: + summary: Get workspace historical logs + description: Historical record of logs from the resource. + operationId: workspaces_getLogs + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: type: string - default: null - description: Reference owner by org ID. - nullable: true - OwnerByPath: - type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ - description: Reference owner by name. - OwnerReference: - oneOf: - - $ref: '#/components/schemas/OwnerByName' - - $ref: '#/components/schemas/OwnerById' - - $ref: '#/components/schemas/OwnerByIdentityId' - - $ref: '#/components/schemas/OwnerByPath' - ImageTagById: - type: object + required: true + - in: query + name: pod_name + description: Name of the pod to retrieve logs from. + schema: + type: string + required: false + - in: query + name: cluster + description: Name of the cluster the pod lives in. + schema: + type: string + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Maximum number of results per page. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HistoricLogList' + description: Ok + /api/workspaces/{workspace_id}/metrics: + get: + summary: Get workspace metrics + description: Hardware utilization metrics. + operationId: workspaces_getMetrics + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - in: query + name: type + description: Filter metric series by type. + schema: + type: string + required: false + - in: query + name: start + description: Start timestamp of the metrics query. + schema: + type: string + format: date-time + required: false + - in: query + name: end + description: End timestamp of the metrics query. + schema: + type: string + format: date-time + required: false + - in: query + name: resolution + description: Sampling resolution of metrics points. + schema: + type: string + required: false + - in: query + name: cluster + description: Cluster to query for metrics. + schema: + type: string + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Metrics' + description: Ok + /api/workspaces/{workspace_id}/recipe: + get: + summary: Get workspace recipe + operationId: workspaces_getRecipe + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - in: query + name: as_template + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceRecipe' + description: Ok + /api/workspaces/{workspace_id}/restart: + post: + summary: Restart workspace + description: Restart a running workspace. + operationId: workspaces_restart + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceStart' + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Workspace' + description: Restarted + /api/workspaces/{workspace_id}/routes: + get: + summary: List workspace routes + description: List ingress routes on the workspace. + operationId: workspaces_listRoutes + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - in: query + name: subdomain + description: Substring matched search string on route subdomain. + schema: + type: string + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RouteList' + description: Ok + post: + summary: Create workspace route + description: Add a new ingress route to the workspace. + operationId: workspaces_createRoute + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RouteCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Route' + description: Created + /api/workspaces/{workspace_id}/routes/{route_id}: + delete: + summary: Delete workspace route + description: Remove an ingress route from workspace. + operationId: workspaces_deleteRoute + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: route_id + in: path + schema: + type: string + required: true + responses: + '204': + description: Deleted + get: + summary: Get workspace route + description: Get an ingress route. + operationId: workspaces_getRoute + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: route_id + in: path + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Route' + description: Ok + patch: + summary: Update workspace route + description: Edit the configuration of an ingress route. + operationId: workspaces_updateRoute + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: route_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RouteUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Route' + description: Updated + /api/workspaces/{workspace_id}/runtimesummary: + get: + summary: Get workspace runtime summary + description: Summary of the current runtime status. + operationId: workspaces_getRuntimeSummary + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceRuntimeSummary' + description: Ok + /api/workspaces/{workspace_id}/secrets: + get: + summary: List workspace secret attachments + operationId: workspaces_listSecretAttachments + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - in: query + name: location + description: Substring matched search string on secret attachment location. + schema: + type: string + required: false + - in: query + name: attachment_type + description: Filter secret attachments by type. + schema: + $ref: '#/components/schemas/SecretAttachmentType' + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachmentList' + description: Ok + post: + summary: Create workspace secret attachment + operationId: workspaces_createSecretAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachmentCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachment' + description: Created + /api/workspaces/{workspace_id}/secrets/{secret_attachment_id}: + delete: + summary: Delete workspace secret attachment + operationId: workspaces_deleteSecretAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: secret_attachment_id + in: path + required: true + schema: + type: string + responses: + '204': + description: Deleted + get: + summary: Get workspace secret attachment + operationId: workspaces_getSecretAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: secret_attachment_id + in: path + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachment' + description: Ok + patch: + summary: Update workspace secret attachment + operationId: workspaces_updateSecretAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: secret_attachment_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachmentUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretAttachment' + description: Updated + /api/workspaces/{workspace_id}/service_account: + delete: + summary: Delete workspace service account attachment + operationId: workspaces_deleteServiceAccountAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '204': + description: Deleted + get: + summary: Get workspace service account attachment + operationId: workspaces_getServiceAccountAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceAccountAttachment' + description: Ok + put: + summary: Create workspace service account attachment + operationId: workspaces_createServiceAccountAttachment + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceAccountCreateAttachment' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceAccountAttachment' + description: Created + /api/workspaces/{workspace_id}/start: + post: + summary: Start workspace + description: Run a workspace. + operationId: workspaces_start + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceStart' + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Workspace' + description: Started + /api/workspaces/{workspace_id}/stop: + post: + summary: Stop workspace + description: Stop a running workspace. + operationId: workspaces_stop + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Workspace' + description: Stopped + /api/workspaces/{workspace_id}/template: + get: + summary: Get workspace resource template + operationId: workspaces_getResourceTemplate + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTemplate' + description: Ok + patch: + summary: Update workspace resource template + operationId: workspaces_updateResourceTemplate + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTemplate' + description: Ok + post: + summary: Create workspace resource template + operationId: workspaces_createResourceTemplate + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTemplate' + description: Ok + /api/workspaces/{workspace_id}/token: + get: + summary: Get workspace API token info + operationId: workspaces_getTokenInfo + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTokenInfo' + description: Ok + patch: + summary: Update workspace API token + description: Update API token scope on the workspace. Invalidates existing tokens. + operationId: workspaces_updateToken + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTokenUpdate' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTokenInfo' + description: Updated + post: + summary: Rotate workspace API token + description: Invalidate existing API tokens for the workspace. + operationId: workspaces_rotateToken + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTokenInfo' + description: Rotated + /api/workspaces/{workspace_id}/viewers: + get: + summary: List workspace viewers + description: List users and groups with view permissions. + operationId: workspaces_listViewers + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - in: query + name: route_id + description: Filter viewers by route ID. + schema: + type: string + required: false + - in: query + name: prev_key + description: Previous page key. + schema: + type: string + required: false + - in: query + name: next_key + description: Next page key. + schema: + type: string + required: false + - in: query + name: page_size + description: Page size. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + required: false + - in: query + name: descending + description: List results in descending order. + schema: + type: boolean + default: false + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ViewerList' + description: Ok + post: + summary: Create workspace viewer + description: Grant a user or group access to routes on the workspace. + operationId: workspaces_createViewer + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ViewerCreate' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Viewer' + description: Created + /api/workspaces/{workspace_id}/viewers/{viewer_id}: + delete: + summary: Delete workspace viewer + description: Remove a viewer's access permissions. + operationId: workspaces_deleteViewer + tags: + - workspaces + parameters: + - name: workspace_id + in: path + schema: + type: string + required: true + - name: viewer_id + in: path + schema: + type: string + required: true + responses: + '204': + description: Deleted + /api/workspaces/info: + get: + summary: Get workspace server options + operationId: workspaces_getServerOptions + tags: + - workspaces + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceServerInfo' + description: Ok +openapi: 3.0.3 +components: + schemas: + Recipe: + discriminator: + propertyName: type + mapping: + deployment: '#/components/schemas/DeploymentRecipe' + job: '#/components/schemas/JobRecipe' + workspace: '#/components/schemas/WorkspaceRecipe' + image: '#/components/schemas/ImageRecipe' + oneOf: + - $ref: '#/components/schemas/DeploymentRecipe' + - $ref: '#/components/schemas/JobRecipe' + - $ref: '#/components/schemas/WorkspaceRecipe' + - $ref: '#/components/schemas/ImageRecipe' + type: object + properties: {} + OwnerByName: + type: object + properties: + name: + type: string + description: Reference owner by name. + required: + - name + OwnerById: + type: object + properties: + id: + type: string + description: Reference owner by ID. + required: + - id + OwnerByIdentityId: + type: object + properties: + user_id: + type: string + default: null + description: Reference owner by user ID. + nullable: true + group_id: + type: string + default: null + description: Reference owner by group ID. + nullable: true + org_id: + type: string + default: null + description: Reference owner by org ID. + nullable: true + OwnerByPath: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + description: Reference owner by name. + OwnerReference: + oneOf: + - $ref: '#/components/schemas/OwnerByName' + - $ref: '#/components/schemas/OwnerById' + - $ref: '#/components/schemas/OwnerByIdentityId' + - $ref: '#/components/schemas/OwnerByPath' + ImageTagById: + type: object + properties: + tag_id: + type: string + enforce_trusted: + type: boolean + default: true + writeOnly: true + required: + - tag_id + ImageTagByUri: + type: object + properties: + uri: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + enforce_trusted: + type: boolean + default: true + writeOnly: true + required: + - uri + ImageTagByName: + type: object + properties: + name: + type: string + version: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + enforce_trusted: + type: boolean + default: true + writeOnly: true + required: + - name + - version + ImageTagByPath: + type: string + ImageTagReference: + oneOf: + - $ref: '#/components/schemas/ImageTagById' + - $ref: '#/components/schemas/ImageTagByUri' + - $ref: '#/components/schemas/ImageTagByName' + - $ref: '#/components/schemas/ImageTagByPath' + ExtraPackagesRecipe: + type: object + properties: + pip: + type: object + properties: + install: + type: string + requirements_txt: + type: string + conda: + type: object + properties: + install: + type: string + environment_yml: + type: string + use_mamba: + type: boolean + default: false + apt: + type: object + properties: + install: + type: string + cran: + type: object + properties: + install: + type: string + remotes: + type: object + properties: + install: + type: string + bioconductor: + type: object + properties: + install: + type: string + ConfigFileEntry: + type: object + properties: + content: + type: string + description: Content of the config file. + mode: + type: string + default: '0644' + description: File mode as a 4-character octal string, e.g. '0644'. + required: + - content + DaskClusterAttachment: + type: object + properties: + num_workers: + type: integer + minimum: 0 + scheduler: + type: object + properties: + instance_type: + type: string + required: + - instance_type + worker: + type: object + properties: + instance_type: + type: string + num_processes: + type: integer + num_threads: + type: integer + use_spot_instances: + type: boolean + default: false + required: + - instance_type + status: + type: string + enum: + - stopped + - running + - null + nullable: true + required: + - num_workers + - scheduler + - worker + ExternalRepoAttachmentRecipe: + type: object + properties: + url: + type: string + path: + type: string + on_restart: + type: string + enum: + - preserve changes + - reclone + reference: + type: string + nullable: true + reference_type: + type: string + default: branch + enum: + - branch + - commit + - tag + public: + type: boolean + default: false + required: + - url + SecretAttachmentType: + type: string + enum: + - environment_variable + - file + SecretAttachmentRecipe: + type: object + properties: + location: + type: string + attachment_type: + $ref: '#/components/schemas/SecretAttachmentType' + description: + type: string + default: '' + maxLength: 2048 + owner: + $ref: '#/components/schemas/OwnerReference' + name: + type: string + required: + - attachment_type + - location + SharedFolderAttachmentRecipe: + type: object + properties: + owner: + $ref: '#/components/schemas/OwnerReference' + name: + type: string + path: + type: string + required: + - name + DeploymentRouteRecipe: + type: object + properties: + subdomain: + type: string + default: '' + container_port: + type: integer + minimum: 1024 + maximum: 65535 + visibility: + type: string + enum: + - unauthenticated + - account + - org + - owner + required: + - container_port + RouteById: + type: object + properties: + id: + type: string + required: + - id + RouteBySubdomain: + type: object + properties: + subdomain: + type: string + required: + - subdomain + RouteBySubdomainPath: + type: string + RouteByContainerPort: + type: object + properties: + container_port: + type: integer + minimum: 1024 + maximum: 65535 + required: + - container_port + RouteReference: + oneOf: + - $ref: '#/components/schemas/RouteById' + - $ref: '#/components/schemas/RouteBySubdomain' + - $ref: '#/components/schemas/RouteBySubdomainPath' + - $ref: '#/components/schemas/RouteByContainerPort' + ViewerRecipe: + type: object + properties: + identity: + type: string + route: + $ref: '#/components/schemas/RouteReference' + required: + - identity + DeploymentSpec: + type: object + properties: + name: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + description: + type: string + maxLength: 2048 + tags: + type: object + additionalProperties: + type: string + nullable: true + image: + $ref: '#/components/schemas/ImageTagReference' + instance_type: + type: string + environment_variables: + type: object + additionalProperties: + type: string + working_directory: + type: string + extra_packages: + $ref: '#/components/schemas/ExtraPackagesRecipe' + config_files: + type: object + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: + type: string + nullable: true + token_scope: + type: string + nullable: true + dask_cluster: + $ref: '#/components/schemas/DaskClusterAttachment' + git_repositories: + type: array + items: + $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' + secrets: + type: array + items: + $ref: '#/components/schemas/SecretAttachmentRecipe' + shared_folders: + type: array + items: + $ref: '#/components/schemas/SharedFolderAttachmentRecipe' + start_dind: + type: boolean + status: + type: string + enum: + - stopped + - running + - null + writeOnly: true + nullable: true + command: + type: string + minLength: 1 + scale: + type: integer + default: 1 + minimum: 1 + start_ssh: + type: boolean + default: false + use_spot_instance: + type: boolean + default: false + routes: + type: array + items: + $ref: '#/components/schemas/DeploymentRouteRecipe' + viewers: + type: array + items: + $ref: '#/components/schemas/ViewerRecipe' + required: + - command + - image + - instance_type + - name + RouteState: + type: object + properties: + subdomain: + type: string + readOnly: true + container_port: + type: integer + readOnly: true + url: + type: string + readOnly: true + required: + - container_port + - subdomain + - url + ResourceState: + type: object + properties: + id: + type: string + readOnly: true + action: + type: string + readOnly: true + status: + type: string + readOnly: true + url: + type: string + readOnly: true + description: External URL for the primary route, if applicable. + nullable: true + ssh_url: + type: string + readOnly: true + description: External SSH URL for the resource when SSH is enabled. + nullable: true + ssh_user: + type: string + readOnly: true + description: SSH username for the resource when SSH is enabled. + nullable: true + routes: + type: array + readOnly: true + description: External URL for each route exposed by the resource. + items: + $ref: '#/components/schemas/RouteState' + required: + - id + - status + DeploymentRecipe: + type: object + properties: + schema_version: + type: string + default: 2025.10.01 + type: + type: string + enum: + - deployment + spec: + $ref: '#/components/schemas/DeploymentSpec' + state: + readOnly: true + allOf: + - $ref: '#/components/schemas/ResourceState' + required: + - spec + - type + JobSpec: + type: object + properties: + name: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + description: + type: string + maxLength: 2048 + tags: + type: object + additionalProperties: + type: string + nullable: true + image: + $ref: '#/components/schemas/ImageTagReference' + instance_type: + type: string + environment_variables: + type: object + additionalProperties: + type: string + working_directory: + type: string + extra_packages: + $ref: '#/components/schemas/ExtraPackagesRecipe' + config_files: + type: object + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: + type: string + nullable: true + token_scope: + type: string + nullable: true + dask_cluster: + $ref: '#/components/schemas/DaskClusterAttachment' + git_repositories: + type: array + items: + $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' + secrets: + type: array + items: + $ref: '#/components/schemas/SecretAttachmentRecipe' + shared_folders: + type: array + items: + $ref: '#/components/schemas/SharedFolderAttachmentRecipe' + start_dind: + type: boolean + status: + type: string + enum: + - stopped + - running + - null + writeOnly: true + nullable: true + command: + type: string + minLength: 1 + scale: + type: integer + default: 1 + minimum: 1 + use_spot_instance: + type: boolean + default: false + schedule: + type: string + nullable: true + concurrency_policy: + type: string + enum: + - Allow + - Forbid + - Replace + retries: + type: integer + minimum: 0 + required: + - command + - image + - instance_type + - name + JobRecipe: + type: object properties: - tag_id: + schema_version: type: string - enforce_trusted: + default: 2025.10.01 + type: + type: string + enum: + - job + spec: + $ref: '#/components/schemas/JobSpec' + state: + readOnly: true + allOf: + - $ref: '#/components/schemas/ResourceState' + required: + - spec + - type + WorkspaceRouteRecipe: + type: object + properties: + subdomain: + type: string + default: '' + container_port: + type: integer + minimum: 1024 + maximum: 65535 + visibility: + type: string + enum: + - org + - owner + required: + - container_port + WorkspaceSpec: + type: object + properties: + name: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + description: + type: string + maxLength: 2048 + tags: + type: object + additionalProperties: + type: string + nullable: true + image: + $ref: '#/components/schemas/ImageTagReference' + instance_type: + type: string + environment_variables: + type: object + additionalProperties: + type: string + working_directory: + type: string + extra_packages: + $ref: '#/components/schemas/ExtraPackagesRecipe' + config_files: + type: object + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: + type: string + nullable: true + token_scope: + type: string + nullable: true + dask_cluster: + $ref: '#/components/schemas/DaskClusterAttachment' + git_repositories: + type: array + items: + $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' + secrets: + type: array + items: + $ref: '#/components/schemas/SecretAttachmentRecipe' + shared_folders: + type: array + items: + $ref: '#/components/schemas/SharedFolderAttachmentRecipe' + start_dind: type: boolean - default: true + status: + type: string + enum: + - stopped + - running + - null writeOnly: true + nullable: true + ide: + type: string + default: jupyter + enum: + - jupyter + - rstudio + disk_space: + type: string + auto_shutoff: + type: string + default: 1 hour + enum: + - 1 hour + - 6 hours + - 24 hours + - 3 days + - 7 days + - Never + start_ssh: + type: boolean + default: false + use_spot_instance: + type: boolean + default: false + routes: + type: array + items: + $ref: '#/components/schemas/WorkspaceRouteRecipe' + viewers: + type: array + items: + $ref: '#/components/schemas/ViewerRecipe' + self_destruct: + type: boolean + default: false + required: + - image + - instance_type + - name + WorkspaceRecipe: + type: object + properties: + schema_version: + type: string + default: 2025.10.01 + type: + type: string + enum: + - workspace + spec: + $ref: '#/components/schemas/WorkspaceSpec' + state: + readOnly: true + allOf: + - $ref: '#/components/schemas/ResourceState' + required: + - spec + - type + ImageTagRecipe: + type: object + properties: + name: + type: string + image_uri: + type: string + description: + type: string + archived: + type: boolean + default: false + build_data: + type: object + additionalProperties: + type: string + required: + - image_uri + - name + ImageSpec: + type: object + properties: + name: + type: string + owner: + $ref: '#/components/schemas/OwnerReference' + description: + type: string + default: '' + versions: + type: array + items: + $ref: '#/components/schemas/ImageTagRecipe' + hardware_type: + type: string + default: CPU + enum: + - CPU + - NVIDIA + - AMD + supports: + type: array + items: + type: string + access: + type: string + enum: + - account + - org + - owner + required: + - name + ImageTagState: + type: object + properties: + id: + type: string + readOnly: true + action: + type: string + readOnly: true + required: + - id + ImageState: + type: object + properties: + id: + type: string + readOnly: true + action: + type: string + readOnly: true + versions: + type: array + items: + $ref: '#/components/schemas/ImageTagState' + required: + - id + ImageRecipe: + type: object + properties: + schema_version: + type: string + default: 2025.10.01 + type: + type: string + enum: + - image + spec: + $ref: '#/components/schemas/ImageSpec' + state: + readOnly: true + allOf: + - $ref: '#/components/schemas/ImageState' required: - - tag_id - ImageTagByUri: + - spec + - type + Resource: + discriminator: + propertyName: resource_type + mapping: + dask: '#/components/schemas/DaskCluster' + deployment: '#/components/schemas/Deployment' + job: '#/components/schemas/Job' + workspace: '#/components/schemas/Workspace' + oneOf: + - $ref: '#/components/schemas/DaskCluster' + - $ref: '#/components/schemas/Deployment' + - $ref: '#/components/schemas/Job' + - $ref: '#/components/schemas/Workspace' type: object - properties: - uri: - type: string - owner: - $ref: '#/components/schemas/OwnerReference' - enforce_trusted: - type: boolean - default: true - writeOnly: true - required: - - uri - ImageTagByName: + properties: {} + IdentityType: + type: string + enum: + - user + - group + Owner: type: object properties: + id: + type: string + readOnly: true + description: ID of the owner name: type: string - version: + readOnly: true + description: 'Name of the owner (format: ''/'')' + identity_name: type: string - owner: - $ref: '#/components/schemas/OwnerReference' - enforce_trusted: + readOnly: true + description: Name of the owner's identity + org_name: + type: string + readOnly: true + description: Name of the org the owner belongs to. + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. + org_admin: type: boolean - default: true - writeOnly: true + readOnly: true + description: Enable the owner to take privileged actions on its org. + org_id: + type: string + readOnly: true + description: Org ID the owner belongs to. + user_id: + type: string + readOnly: true + description: User ID of the owner. + nullable: true + group_id: + type: string + readOnly: true + description: Group ID of the owner. + nullable: true + identity_type: + readOnly: true + description: Typo of the owner's identity (user or group). + $ref: '#/components/schemas/IdentityType' + avatar_url: + type: string + readOnly: true + description: Avatar URL of the owner's identity. required: + - avatar_url + - created_at + - id + - identity_name + - identity_type - name - - version - ImageTagByPath: - type: string - ImageTagReference: - oneOf: - - $ref: '#/components/schemas/ImageTagById' - - $ref: '#/components/schemas/ImageTagByUri' - - $ref: '#/components/schemas/ImageTagByName' - - $ref: '#/components/schemas/ImageTagByPath' - ExtraPackagesRecipe: + - org_admin + - org_id + - org_name + DaskCluster: type: object properties: - pip: - type: object - properties: - install: - type: string - requirements_txt: - type: string - conda: - type: object - properties: - install: - type: string - environment_yml: - type: string - use_mamba: - type: boolean - default: false - apt: - type: object - properties: - install: - type: string - cran: - type: object - properties: - install: - type: string - remotes: - type: object - properties: - install: - type: string - bioconductor: + id: + type: string + readOnly: true + description: ID of the dask cluster. + name: + type: string + readOnly: true + description: Name of the resource the dask cluster is attached to. + resource_type: + type: string + enum: + - dask + readOnly: true + description: Type of resource the dask cluster is attached to. + tags: type: object - properties: - install: - type: string - DaskClusterAttachment: - type: object - properties: - num_workers: + readOnly: true + description: Descriptive tags for the dask cluster. + additionalProperties: + type: string + nullable: true + worker_size: + type: string + readOnly: true + description: Instance size of the dask workers. + worker_size_display: + type: string + readOnly: true + description: Description of the instance size for the workers. + worker_is_spot: + type: boolean + readOnly: true + description: Enables spot instances for the dask workers. + scheduler_size: + type: string + readOnly: true + description: Instance size of the dask scheduler. + scheduler_size_display: + type: string + readOnly: true + description: Description of the instance size for the scheduler. + n_workers: type: integer - minimum: 0 - scheduler: - type: object - properties: - instance_type: - type: string - required: - - instance_type - worker: - type: object - properties: - instance_type: - type: string - num_processes: - type: integer - num_threads: - type: integer - use_spot_instances: - type: boolean - default: false - required: - - instance_type + readOnly: true + description: Number of dask workers. + nprocs: + type: integer + readOnly: true + description: Number of processes per worker. + nthreads: + type: integer + readOnly: true + description: Number of threads per process. + scheduler_url: + type: string + readOnly: true + description: Internal address for the dask scheduler + subdomain: + type: string + readOnly: true + description: Subdomain for the dask dashboard. + image: + type: string + readOnly: true + description: Image for the dask cluster and resource it is attached to. + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. status: type: string - enum: - - stopped - - running - - null - nullable: true - required: - - num_workers - - scheduler - - worker - ExternalRepoAttachmentRecipe: - type: object - properties: + readOnly: true + description: Current status of the dask cluster. + warnings: + type: array + description: Messages with warnings about the state of the dask cluster. + items: + type: string + readOnly: true + errors: + type: array + description: Messages with errors about the state of the dask cluster. + items: + type: string + readOnly: true url: type: string - path: - type: string - on_restart: + readOnly: true + description: External URL for the dask dashboard. + owner: + readOnly: true + description: Owner of the dask cluster. + allOf: + - $ref: '#/components/schemas/Owner' + deployment_id: type: string - enum: - - preserve changes - - reclone - reference: + readOnly: true + description: Deployment ID the dask cluster is attached to. + nullable: true + job_id: type: string + readOnly: true + description: Job ID the dask cluster is attached to. nullable: true - reference_type: + workspace_id: type: string - default: branch - enum: - - branch - - commit - - tag - public: - type: boolean - default: false + readOnly: true + description: Workspace ID the dask cluster is attached to. + nullable: true required: + - created_at + - id + - image + - n_workers + - name + - nprocs + - nthreads + - owner + - resource_type + - scheduler_size + - scheduler_size_display + - scheduler_url + - status + - subdomain + - tags - url - SecretAttachmentType: + - worker_is_spot + - worker_size + - worker_size_display + HardwareType: type: string enum: - - environment_variable - - file - SecretAttachmentRecipe: + - CPU + - NVIDIA + - AMD + ImageAccessLevel: + type: string + enum: + - account + - org + - owner + Image: type: object properties: - location: - type: string - attachment_type: - $ref: '#/components/schemas/SecretAttachmentType' - description: + id: type: string - default: '' - maxLength: 2048 - owner: - $ref: '#/components/schemas/OwnerReference' + readOnly: true + description: ID of the image. name: type: string - required: - - attachment_type - - location - SharedFolderAttachmentRecipe: - type: object - properties: + readOnly: true + description: Name of the image. owner: - $ref: '#/components/schemas/OwnerReference' - name: - type: string - path: - type: string - required: - - name - DeploymentRouteRecipe: - type: object - properties: - subdomain: - type: string - default: '' - container_port: - type: integer - minimum: 1024 - maximum: 65535 - visibility: + readOnly: true + description: Owner of the image. + allOf: + - $ref: '#/components/schemas/Owner' + description: type: string - enum: - - unauthenticated - - account - - org - - owner - required: - - container_port - RouteById: - type: object - properties: - id: + readOnly: true + description: Description of the image. + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. + hardware_type: + readOnly: true + description: Supported instance hardware type. + $ref: '#/components/schemas/HardwareType' + supports: + type: array + readOnly: true + description: Supported features. + items: + type: string + access: + readOnly: true + description: Describes who has access to the image. + $ref: '#/components/schemas/ImageAccessLevel' + is_base: + type: boolean + readOnly: true + description: True if the image is a base image for builds. + is_gpu: + type: boolean + readOnly: true + description: True if the image support GPU hardware. + trusted: + type: boolean + readOnly: true + description: True if the image belongs to a trusted source. required: + - access + - created_at + - description + - hardware_type - id - RouteBySubdomain: - type: object - properties: - subdomain: - type: string - required: - - subdomain - RouteBySubdomainPath: - type: string - RouteByContainerPort: - type: object - properties: - container_port: - type: integer - minimum: 1024 - maximum: 65535 - required: - - container_port - RouteReference: - oneOf: - - $ref: '#/components/schemas/RouteById' - - $ref: '#/components/schemas/RouteBySubdomain' - - $ref: '#/components/schemas/RouteBySubdomainPath' - - $ref: '#/components/schemas/RouteByContainerPort' - ViewerRecipe: - type: object - properties: - identity: - type: string - route: - $ref: '#/components/schemas/RouteReference' - required: - - identity - DeploymentSpec: + - is_base + - is_gpu + - name + - owner + - supports + - trusted + BuildData: type: object properties: - name: - type: string - owner: - $ref: '#/components/schemas/OwnerReference' - description: + base_image: type: string - maxLength: 2048 - tags: - type: object - additionalProperties: - type: string + default: null + description: Base image to build from. nullable: true - image: - $ref: '#/components/schemas/ImageTagReference' - instance_type: - type: string - environment_variables: - type: object - additionalProperties: - type: string - working_directory: + environment_yml: type: string - extra_packages: - $ref: '#/components/schemas/ExtraPackagesRecipe' - start_script: + default: null + description: Conda environment to install. + nullable: true + requirements_txt: type: string + default: null + description: Pip requirements to install. nullable: true - token_scope: + cran_packages: type: string + default: null + description: Cran packages to install nullable: true - dask_cluster: - $ref: '#/components/schemas/DaskClusterAttachment' - git_repositories: - type: array - items: - $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' - secrets: - type: array - items: - $ref: '#/components/schemas/SecretAttachmentRecipe' - shared_folders: - type: array - items: - $ref: '#/components/schemas/SharedFolderAttachmentRecipe' - start_dind: - type: boolean - status: + bioconductor_packages: type: string - enum: - - stopped - - running - - null - writeOnly: true + default: null + description: Bioconductor packages to install. nullable: true - command: + remotes_packages: type: string - minLength: 1 - scale: - type: integer - default: 1 - minimum: 1 - start_ssh: + default: null + description: Remotes packages to install. + nullable: true + apt_txt: + type: string + default: null + description: Apt packages to install. + nullable: true + post_build: + type: string + default: null + description: Post-build script to run. + nullable: true + use_mamba: type: boolean default: false - use_spot_instance: + description: Enable installing conda packages with mamba + adapt_image: type: boolean default: false - routes: - type: array - items: - $ref: '#/components/schemas/DeploymentRouteRecipe' - viewers: - type: array - items: - $ref: '#/components/schemas/ViewerRecipe' - required: - - command - - image - - instance_type - - name - ResourceState: + register_ipython_kernel: + type: boolean + rstudio_version: + type: string + default: null + nullable: true + install_r: + type: boolean + ImageTag: type: object properties: id: type: string readOnly: true - action: + description: ID of the image tag. + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - status: + description: Creation timestamp. + image: + readOnly: true + description: Image that the tag belongs to. + allOf: + - $ref: '#/components/schemas/Image' + image_uri: type: string readOnly: true - required: - - id - - status - DeploymentRecipe: - type: object - properties: - schema_version: + description: Image URI for the tag. + description: type: string - default: 2025.10.01 - type: + readOnly: true + description: Description of the image tag + version: type: string - enum: - - deployment - spec: - $ref: '#/components/schemas/DeploymentSpec' - state: readOnly: true + minLength: 1 + description: Version of the image tag. + build_data: + readOnly: true + description: Build data for the image tag. allOf: - - $ref: '#/components/schemas/ResourceState' + - $ref: '#/components/schemas/BuildData' + archived: + type: boolean + readOnly: true + description: True if the image tag is archived. Archived tags are not attachable + to new resources, but will continue to work on existing resources. + is_external: + type: boolean + readOnly: true + description: True if the image tag was imported from an external source. + status: + type: string + readOnly: true + description: Status of the image tag build. + saturn_env: + type: string + readOnly: true + description: Dump of the build env. required: - - spec - - type - JobSpec: + - archived + - created_at + - description + - id + - image + - image_uri + - is_external + - status + - version + ExtraPackages: type: object properties: - name: - type: string - owner: - $ref: '#/components/schemas/OwnerReference' - description: - type: string - maxLength: 2048 - tags: - type: object - additionalProperties: - type: string - nullable: true - image: - $ref: '#/components/schemas/ImageTagReference' - instance_type: - type: string - environment_variables: - type: object - additionalProperties: - type: string - working_directory: - type: string - extra_packages: - $ref: '#/components/schemas/ExtraPackagesRecipe' - start_script: - type: string - nullable: true - token_scope: + pip: type: string + description: Pip packages to install. nullable: true - dask_cluster: - $ref: '#/components/schemas/DaskClusterAttachment' - git_repositories: - type: array - items: - $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' - secrets: - type: array - items: - $ref: '#/components/schemas/SecretAttachmentRecipe' - shared_folders: - type: array - items: - $ref: '#/components/schemas/SharedFolderAttachmentRecipe' - start_dind: + as_requirements_txt: type: boolean - status: + default: false + description: True if pip field is formatted as requirements.txt + conda: type: string - enum: - - stopped - - running - - null - writeOnly: true + description: Conda packages to install nullable: true - command: - type: string - minLength: 1 - scale: - type: integer - default: 1 - minimum: 1 - use_spot_instance: + as_environment_yml: type: boolean default: false - schedule: + description: True if conda field is formatted as environment.yaml + apt: type: string + description: Apt packages to install. nullable: true - concurrency_policy: - type: string - enum: - - Allow - - Forbid - - Replace - retries: - type: integer - minimum: 0 - required: - - command - - image - - instance_type - - name - JobRecipe: - type: object - properties: - schema_version: - type: string - default: 2025.10.01 - type: + cran: type: string - enum: - - job - spec: - $ref: '#/components/schemas/JobSpec' - state: - readOnly: true - allOf: - - $ref: '#/components/schemas/ResourceState' - required: - - spec - - type - WorkspaceRouteRecipe: - type: object - properties: - subdomain: + description: Cran packages to install. + nullable: true + remotes: type: string - default: '' - container_port: - type: integer - minimum: 1024 - maximum: 65535 - visibility: + description: Remotes packages to install. + nullable: true + bioconductor: type: string - enum: - - org - - owner - required: - - container_port - WorkspaceSpec: + description: Bioconductor packages to install. + nullable: true + use_mamba: + type: boolean + default: false + description: Enable installing conda packages with mamba. + DaskClusterNested: type: object properties: + id: + type: string + readOnly: true + description: ID of the dask cluster. name: type: string - owner: - $ref: '#/components/schemas/OwnerReference' - description: + readOnly: true + description: Name of the resource the dask cluster is attached to. + resource_type: type: string - maxLength: 2048 + enum: + - dask + readOnly: true + description: Type of resource the dask cluster is attached to. tags: type: object + readOnly: true + description: Descriptive tags for the dask cluster. additionalProperties: type: string nullable: true - image: - $ref: '#/components/schemas/ImageTagReference' - instance_type: + worker_size: type: string - environment_variables: - type: object - additionalProperties: - type: string - working_directory: + readOnly: true + description: Instance size of the dask workers. + worker_size_display: type: string - extra_packages: - $ref: '#/components/schemas/ExtraPackagesRecipe' - start_script: + readOnly: true + description: Description of the instance size for the workers. + worker_is_spot: + type: boolean + readOnly: true + description: Enables spot instances for the dask workers. + scheduler_size: type: string - nullable: true - token_scope: + readOnly: true + description: Instance size of the dask scheduler. + scheduler_size_display: type: string - nullable: true - dask_cluster: - $ref: '#/components/schemas/DaskClusterAttachment' - git_repositories: - type: array - items: - $ref: '#/components/schemas/ExternalRepoAttachmentRecipe' - secrets: - type: array - items: - $ref: '#/components/schemas/SecretAttachmentRecipe' - shared_folders: - type: array - items: - $ref: '#/components/schemas/SharedFolderAttachmentRecipe' - start_dind: - type: boolean - status: + readOnly: true + description: Description of the instance size for the scheduler. + n_workers: + type: integer + readOnly: true + description: Number of dask workers. + nprocs: + type: integer + readOnly: true + description: Number of processes per worker. + nthreads: + type: integer + readOnly: true + description: Number of threads per process. + scheduler_url: type: string - enum: - - stopped - - running - - null - writeOnly: true - nullable: true - ide: + readOnly: true + description: Internal address for the dask scheduler + subdomain: type: string - default: jupyter - enum: - - jupyter - - rstudio - disk_space: + readOnly: true + description: Subdomain for the dask dashboard. + image: type: string - auto_shutoff: + readOnly: true + description: Image for the dask cluster and resource it is attached to. + created_at: type: string - default: 1 hour - enum: - - 1 hour - - 6 hours - - 24 hours - - 3 days - - 7 days - - Never - start_ssh: - type: boolean - default: false - use_spot_instance: - type: boolean - default: false - routes: + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. + status: + type: string + readOnly: true + description: Current status of the dask cluster. + warnings: type: array + description: Messages with warnings about the state of the dask cluster. items: - $ref: '#/components/schemas/WorkspaceRouteRecipe' - viewers: + type: string + readOnly: true + errors: type: array + description: Messages with errors about the state of the dask cluster. items: - $ref: '#/components/schemas/ViewerRecipe' - self_destruct: - type: boolean - default: false + type: string + readOnly: true + url: + type: string + readOnly: true + description: External URL for the dask dashboard. required: + - created_at + - id - image - - instance_type + - n_workers - name - WorkspaceRecipe: + - nprocs + - nthreads + - resource_type + - scheduler_size + - scheduler_size_display + - scheduler_url + - status + - subdomain + - tags + - url + - worker_is_spot + - worker_size + - worker_size_display + Deployment: type: object properties: - schema_version: - type: string - default: 2025.10.01 - type: + id: type: string - enum: - - workspace - spec: - $ref: '#/components/schemas/WorkspaceSpec' - state: readOnly: true - allOf: - - $ref: '#/components/schemas/ResourceState' - required: - - spec - - type - ImageTagRecipe: - type: object - properties: + description: ID of the deployment. name: type: string - image_uri: + readOnly: true + description: Name of the deployment. + owner: + readOnly: true + description: Owner of the deployment. + allOf: + - $ref: '#/components/schemas/Owner' + command: type: string + readOnly: true + description: Command that runs on start. description: type: string - archived: - type: boolean - default: false - build_data: + readOnly: true + description: Description of the deployment. + tags: type: object + description: Descriptive tags for the deployment. additionalProperties: type: string - required: - - image_uri - - name - ImageSpec: - type: object - properties: - name: - type: string - owner: - $ref: '#/components/schemas/OwnerReference' - description: - type: string - default: '' - versions: - type: array - items: - $ref: '#/components/schemas/ImageTagRecipe' - hardware_type: - type: string - default: CPU - enum: - - CPU - - NVIDIA - - AMD - supports: - type: array - items: - type: string - access: - type: string - enum: - - account - - org - - owner - required: - - name - ImageTagState: - type: object - properties: - id: + nullable: true + instance_size: type: string readOnly: true - action: + description: Instance size of the deployment. + image_tag: + readOnly: true + description: Image tag that is attached to the deployment. + allOf: + - $ref: '#/components/schemas/ImageTag' + extra_packages: + readOnly: true + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' + nullable: true + config_files: + type: object + readOnly: true + description: User-defined config files written to $HOME at pod startup. + additionalProperties: + type: object + additionalProperties: + type: string + nullable: true + scale: + type: integer + readOnly: true + description: Number of pod replicas. + start_script: type: string readOnly: true - required: - - id - ImageState: - type: object - properties: - id: - type: string + description: Shell script that runs on start before the primary command. + nullable: true + environment_variables: + type: object readOnly: true - action: + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + working_dir: type: string readOnly: true - versions: - type: array - items: - $ref: '#/components/schemas/ImageTagState' - required: - - id - ImageRecipe: - type: object - properties: - schema_version: - type: string - default: 2025.10.01 - type: - type: string - enum: - - image - spec: - $ref: '#/components/schemas/ImageSpec' - state: + description: Initial working directory. + start_ssh: + type: boolean readOnly: true - allOf: - - $ref: '#/components/schemas/ImageState' - required: - - spec - - type - Resource: - discriminator: - propertyName: resource_type - mapping: - dask: '#/components/schemas/DaskCluster' - deployment: '#/components/schemas/Deployment' - job: '#/components/schemas/Job' - workspace: '#/components/schemas/Workspace' - oneOf: - - $ref: '#/components/schemas/DaskCluster' - - $ref: '#/components/schemas/Deployment' - - $ref: '#/components/schemas/Job' - - $ref: '#/components/schemas/Workspace' - type: object - properties: {} - IdentityType: - type: string - enum: - - user - - group - Owner: - type: object - properties: - id: + description: Enable SSH access on the deployment. + is_spot: + type: boolean + readOnly: true + description: Enables running on spot instance sizes. + healthcheck: type: string readOnly: true - description: ID of the owner - name: + description: Healthcheck path on the deployment's primary port. + subdomain: type: string readOnly: true - description: 'Name of the owner (format: ''/'')' - identity_name: + description: Subdomain for the deployment URL. + start_dind: + type: boolean + readOnly: true + description: Enables docker-in-docker. + last_deploy: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Name of the owner's identity - org_name: + description: Last started timestamp. + k8s_name: type: string readOnly: true - description: Name of the org the owner belongs to. + description: Unique name for associated kubernetes objects. created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - org_admin: + description: Creation timestamp + updated_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Update timestamp. + require_restart: type: boolean readOnly: true - description: Enable the owner to take privileged actions on its org. - org_id: + description: True if an update was applied that requires restart to take + effect. + resource_type: type: string + enum: + - deployment readOnly: true - description: Org ID the owner belongs to. - user_id: + description: Resource type of the deployment. + size_display: type: string readOnly: true - description: User ID of the owner. - nullable: true - group_id: + description: Description of the instance size. + dask_cluster: + readOnly: true + description: Dask cluster attached to the deployment. + allOf: + - $ref: '#/components/schemas/DaskClusterNested' + status: type: string readOnly: true - description: Group ID of the owner. - nullable: true - identity_type: + description: Current status of the deployment. + running_count: + type: integer readOnly: true - description: Typo of the owner's identity (user or group). - $ref: '#/components/schemas/IdentityType' - avatar_url: + description: Number of running pods. + debug_mode: + type: boolean + readOnly: true + description: True if deployment is running in debug mode. + url: type: string readOnly: true - description: Avatar URL of the owner's identity. + description: External URL for the deployment. + ssh_url: + type: string + readOnly: true + description: External SSH URL for the deployment. required: - - avatar_url + - command - created_at + - debug_mode + - description + - environment_variables + - extra_packages - id - - identity_name - - identity_type + - image_tag + - instance_size + - is_spot + - k8s_name + - last_deploy - name - - org_admin - - org_id - - org_name - DaskCluster: + - owner + - require_restart + - resource_type + - running_count + - scale + - size_display + - start_dind + - start_ssh + - status + - subdomain + - updated_at + - url + - working_dir + CronSchedule: + type: object + properties: + schedule: + type: string + readOnly: true + description: Cron schedule for triggering the job. + concurrency_policy: + type: string + enum: + - Allow + - Forbid + - Replace + readOnly: true + description: Specifies how to treat concurrent executions of a job's cron + schedule. + required: + - concurrency_policy + - schedule + Job: type: object properties: id: type: string readOnly: true - description: ID of the dask cluster. + description: ID of the job. name: type: string readOnly: true - description: Name of the resource the dask cluster is attached to. - resource_type: + description: Name of the job. + owner: + readOnly: true + description: Owner of the job. + allOf: + - $ref: '#/components/schemas/Owner' + command: type: string - enum: - - dask readOnly: true - description: Type of resource the dask cluster is attached to. + description: Command that runs on start. + description: + type: string + readOnly: true + description: Description of the job. tags: type: object - readOnly: true - description: Descriptive tags for the dask cluster. + description: Descriptive tags for the job. additionalProperties: type: string nullable: true - worker_size: + instance_size: type: string readOnly: true - description: Instance size of the dask workers. - worker_size_display: + description: Instance size of the job. + image_tag: + readOnly: true + description: Image tag that is attached to the job. + allOf: + - $ref: '#/components/schemas/ImageTag' + extra_packages: + readOnly: true + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' + nullable: true + config_files: + type: object + readOnly: true + description: User-defined config files written to $HOME at pod startup. + additionalProperties: + type: object + additionalProperties: + type: string + nullable: true + cron_schedule_options: + readOnly: true + description: Cron schedule configuration for scheduled jobs. + allOf: + - $ref: '#/components/schemas/CronSchedule' + start_script: type: string readOnly: true - description: Description of the instance size for the workers. - worker_is_spot: - type: boolean + description: Shell script that runs on start before the primary command. + nullable: true + environment_variables: + type: object readOnly: true - description: Enables spot instances for the dask workers. - scheduler_size: + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + working_dir: type: string readOnly: true - description: Instance size of the dask scheduler. - scheduler_size_display: - type: string + description: Initial working directory. + is_spot: + type: boolean readOnly: true - description: Description of the instance size for the scheduler. - n_workers: - type: integer + description: Enables running on spot instance sizes. + start_dind: + type: boolean readOnly: true - description: Number of dask workers. - nprocs: + description: Enables docker-in-docker. + scale: type: integer readOnly: true - description: Number of processes per worker. - nthreads: + description: Number of pod replicas. + retries: type: integer readOnly: true - description: Number of threads per process. - scheduler_url: + description: Maximum number of retries for a failed job. + k8s_name: type: string readOnly: true - description: Internal address for the dask scheduler - subdomain: + description: Unique name for associated kubernetes objects. + require_restart: + type: boolean + readOnly: true + description: True if an update was applied that requires restart to take + effect. + resource_type: type: string + enum: + - job readOnly: true - description: Subdomain for the dask dashboard. - image: + description: Resource type of the job. + size_display: type: string readOnly: true - description: Image for the dask cluster and resource it is attached to. + description: Description of the instance size. created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - status: + updated_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Current status of the dask cluster. - warnings: - type: array - description: Messages with warnings about the state of the dask cluster. - items: - type: string - readOnly: true - errors: - type: array - description: Messages with errors about the state of the dask cluster. - items: - type: string - readOnly: true - url: + description: Update timestamp. + last_deploy: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: External URL for the dask dashboard. - owner: + description: Last started timestamp. + dask_cluster: readOnly: true - description: Owner of the dask cluster. + description: Dask cluster attached to the job. allOf: - - $ref: '#/components/schemas/Owner' - deployment_id: + - $ref: '#/components/schemas/DaskClusterNested' + status: type: string readOnly: true - description: Deployment ID the dask cluster is attached to. - nullable: true - job_id: - type: string + description: Current status of the job. + running_count: + type: integer readOnly: true - description: Job ID the dask cluster is attached to. - nullable: true - workspace_id: - type: string + description: Number of running pods. + debug_mode: + type: boolean readOnly: true - description: Workspace ID the dask cluster is attached to. - nullable: true + description: True if job is running in debug mode. + scheduled: + type: boolean + readOnly: true + description: True if job is currently scheduled. required: + - command - created_at + - debug_mode + - description + - environment_variables + - extra_packages - id - - image - - n_workers + - image_tag + - instance_size + - is_spot + - k8s_name + - last_deploy - name - - nprocs - - nthreads - owner + - require_restart - resource_type - - scheduler_size - - scheduler_size_display - - scheduler_url + - retries + - running_count + - scale + - scheduled + - size_display + - start_dind - status - - subdomain - - tags - - url - - worker_is_spot - - worker_size - - worker_size_display - HardwareType: - type: string - enum: - - CPU - - NVIDIA - - AMD - ImageAccessLevel: - type: string - enum: - - account - - org - - owner - Image: + - updated_at + - working_dir + Workspace: type: object properties: id: type: string readOnly: true - description: ID of the image. + description: ID of the workspace name: type: string readOnly: true - description: Name of the image. + description: Name of the workspace. owner: readOnly: true - description: Owner of the image. + description: Owner of the workspace. allOf: - $ref: '#/components/schemas/Owner' description: type: string readOnly: true - description: Description of the image. - created_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - hardware_type: - readOnly: true - description: Supported instance hardware type. - $ref: '#/components/schemas/HardwareType' - supports: - type: array - readOnly: true - description: Supported features. - items: + description: Description of the workspace. + tags: + type: object + description: Descriptive tags for the workspace. + additionalProperties: type: string - access: - readOnly: true - description: Describes who has access to the image. - $ref: '#/components/schemas/ImageAccessLevel' - is_base: - type: boolean - readOnly: true - description: True if the image is a base image for builds. - is_gpu: - type: boolean + nullable: true + image_tag: readOnly: true - description: True if the image support GPU hardware. - trusted: - type: boolean + description: Image tag that is attached to the workspace. + allOf: + - $ref: '#/components/schemas/ImageTag' + extra_packages: readOnly: true - description: True if the image belongs to a trusted source. - required: - - access - - created_at - - description - - hardware_type - - id - - is_base - - is_gpu - - name - - owner - - supports - - trusted - BuildData: - type: object - properties: - base_image: - type: string - default: null - description: Base image to build from. - nullable: true - environment_yml: - type: string - default: null - description: Conda environment to install. - nullable: true - requirements_txt: - type: string - default: null - description: Pip requirements to install. - nullable: true - cran_packages: - type: string - default: null - description: Cran packages to install - nullable: true - bioconductor_packages: - type: string - default: null - description: Bioconductor packages to install. - nullable: true - remotes_packages: - type: string - default: null - description: Remotes packages to install. - nullable: true - apt_txt: - type: string - default: null - description: Apt packages to install. - nullable: true - post_build: - type: string - default: null - description: Post-build script to run. - nullable: true - use_mamba: - type: boolean - default: false - description: Enable installing conda packages with mamba - adapt_image: - type: boolean - default: false - register_ipython_kernel: - type: boolean - rstudio_version: - type: string - default: null + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' nullable: true - install_r: - type: boolean - ImageTag: - type: object - properties: - id: + config_files: + type: object + readOnly: true + description: User-defined config files written to $HOME at pod startup. + additionalProperties: + type: object + additionalProperties: + type: string + nullable: true + ide: type: string readOnly: true - description: ID of the image tag. - created_at: + description: IDE of the workspace + start_script: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - image: + description: Shell script that runs on start before the primary command. + nullable: true + environment_variables: + type: object readOnly: true - description: Image that the tag belongs to. - allOf: - - $ref: '#/components/schemas/Image' - image_uri: + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + working_dir: type: string readOnly: true - description: Image URI for the tag. - description: + description: Initial working directory. + disk_space: type: string readOnly: true - description: Description of the image tag - version: + description: Size of the persistent volume attached to the workspace. + instance_size: type: string readOnly: true - minLength: 1 - description: Version of the image tag. - build_data: + description: Instance size of the workspace. + auto_shutoff: + type: string + enum: + - 1 hour + - 6 hours + - 24 hours + - 3 days + - 7 days + - Never readOnly: true - description: Build data for the image tag. - allOf: - - $ref: '#/components/schemas/BuildData' - archived: + description: Duration of inactivity before workspace is automatically stopped. + start_ssh: type: boolean readOnly: true - description: True if the image tag is archived. Archived tags are not attachable - to new resources, but will continue to work on existing resources. - is_external: + description: Enable SSH access on the workspace. + is_spot: type: boolean readOnly: true - description: True if the image tag was imported from an external source. - status: - type: string - readOnly: true - description: Status of the image tag build. - saturn_env: + description: Enables running on spot instance sizes. + subdomain: type: string readOnly: true - description: Dump of the build env. - required: - - archived - - created_at - - description - - id - - image - - image_uri - - is_external - - status - - version - ExtraPackages: - type: object - properties: - pip: - type: string - description: Pip packages to install. - nullable: true - as_requirements_txt: - type: boolean - default: false - description: True if pip field is formatted as requirements.txt - conda: - type: string - description: Conda packages to install - nullable: true - as_environment_yml: + description: Subdomain for the workspace URL. + start_dind: type: boolean - default: false - description: True if conda field is formatted as environment.yaml - apt: - type: string - description: Apt packages to install. - nullable: true - cran: + readOnly: true + description: Enables docker-in-docker. + resource_type: type: string - description: Cran packages to install. - nullable: true - remotes: + enum: + - workspace + readOnly: true + description: Resource type of the workspace. + size_display: type: string - description: Remotes packages to install. - nullable: true - bioconductor: + readOnly: true + description: Description of the instance size. + k8s_name: type: string - description: Bioconductor packages to install. - nullable: true - use_mamba: + readOnly: true + description: Unique name for associated kubernetes objects. + require_restart: type: boolean - default: false - description: Enable installing conda packages with mamba. - DaskClusterNested: - type: object - properties: - id: - type: string readOnly: true - description: ID of the dask cluster. - name: + description: True if an update was applied that requires restart to take + effect + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Name of the resource the dask cluster is attached to. - resource_type: + description: Creation timestamp. + updated_at: type: string - enum: - - dask + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Type of resource the dask cluster is attached to. - tags: - type: object + description: Updated timestamp. + started_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Descriptive tags for the dask cluster. - additionalProperties: - type: string + description: Last started timestamp. nullable: true - worker_size: - type: string + self_destruct: + type: boolean readOnly: true - description: Instance size of the dask workers. - worker_size_display: + description: Auto delete the workspace on stop. + dask_cluster: + readOnly: true + description: Dask cluster attached to the workspace. + allOf: + - $ref: '#/components/schemas/DaskClusterNested' + status: type: string readOnly: true - description: Description of the instance size for the workers. - worker_is_spot: + description: Current status of the workspace. + debug_mode: type: boolean readOnly: true - description: Enables spot instances for the dask workers. - scheduler_size: + description: True if workspace is running in debug mode. + url: type: string + format: url readOnly: true - description: Instance size of the dask scheduler. - scheduler_size_display: + description: External URL for the workspace. + ssh_url: type: string + format: url readOnly: true - description: Description of the instance size for the scheduler. - n_workers: - type: integer - readOnly: true - description: Number of dask workers. - nprocs: - type: integer - readOnly: true - description: Number of processes per worker. - nthreads: - type: integer - readOnly: true - description: Number of threads per process. - scheduler_url: + description: External SSH URL for the workspace. + nullable: true + required: + - auto_shutoff + - created_at + - debug_mode + - description + - disk_space + - environment_variables + - extra_packages + - id + - ide + - image_tag + - instance_size + - is_spot + - k8s_name + - name + - owner + - require_restart + - resource_type + - size_display + - ssh_url + - start_dind + - start_script + - start_ssh + - started_at + - status + - subdomain + - updated_at + - url + - working_dir + ResourceRecipe: + discriminator: + propertyName: type + mapping: + deployment: '#/components/schemas/DeploymentRecipe' + job: '#/components/schemas/JobRecipe' + workspace: '#/components/schemas/WorkspaceRecipe' + oneOf: + - $ref: '#/components/schemas/DeploymentRecipe' + - $ref: '#/components/schemas/JobRecipe' + - $ref: '#/components/schemas/WorkspaceRecipe' + type: object + properties: {} + AuthorizationGrant: + discriminator: + propertyName: grant_type + mapping: + authorization_code: '#/components/schemas/AuthorizationCodeGrant' + refresh_token: '#/components/schemas/AuthorizationRefreshGrant' + oneOf: + - $ref: '#/components/schemas/AuthorizationCodeGrant' + - $ref: '#/components/schemas/AuthorizationRefreshGrant' + type: object + properties: {} + AuthorizationCodeGrant: + type: object + properties: + grant_type: type: string - readOnly: true - description: Internal address for the dask scheduler - subdomain: + enum: + - authorization_code + description: OAuth grant type. + code: type: string - readOnly: true - description: Subdomain for the dask dashboard. - image: + description: OAuth response code. + code_verifier: type: string - readOnly: true - description: Image for the dask cluster and resource it is attached to. - created_at: + description: OAuth code verifier for the PKCE request. + redirect_uri: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - status: + description: OAuth redirect URI. + required: + - code + - code_verifier + - grant_type + - redirect_uri + AuthorizationRefreshGrant: + type: object + properties: + grant_type: type: string - readOnly: true - description: Current status of the dask cluster. - warnings: - type: array - description: Messages with warnings about the state of the dask cluster. - items: - type: string - readOnly: true - errors: - type: array - description: Messages with errors about the state of the dask cluster. - items: - type: string - readOnly: true - url: + enum: + - refresh_token + description: Oauth grant type. + refresh_token: type: string - readOnly: true - description: External URL for the dask dashboard. + description: Refresh token for retrieving a new token pair. required: - - created_at - - id - - image - - n_workers - - name - - nprocs - - nthreads - - resource_type - - scheduler_size - - scheduler_size_display - - scheduler_url - - status - - subdomain - - tags - - url - - worker_is_spot - - worker_size - - worker_size_display - Deployment: + - grant_type + - refresh_token + WorkloadType: + type: string + enum: + - dask + - deployment + - image_build + - job + - workspace + Condition: type: object properties: - id: + type: type: string readOnly: true - description: ID of the deployment. - name: + status: type: string readOnly: true - description: Name of the deployment. - owner: - readOnly: true - description: Owner of the deployment. - allOf: - - $ref: '#/components/schemas/Owner' - command: + reason: type: string readOnly: true - description: Command that runs on start. - description: + nullable: true + message: type: string readOnly: true - description: Description of the deployment. - tags: - type: object - description: Descriptive tags for the deployment. - additionalProperties: - type: string nullable: true - instance_size: + last_transition_time: type: string + format: date-time readOnly: true - description: Instance size of the deployment. - image_tag: - readOnly: true - description: Image tag that is attached to the deployment. - allOf: - - $ref: '#/components/schemas/ImageTag' - extra_packages: - readOnly: true - description: Addtitional packages to install on start. - allOf: - - $ref: '#/components/schemas/ExtraPackages' nullable: true - scale: - type: integer - readOnly: true - description: Number of pod replicas. - start_script: + last_probe_time: type: string + format: date-time readOnly: true - description: Shell script that runs on start before the primary command. nullable: true - environment_variables: - type: object - readOnly: true - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - working_dir: + required: + - last_probe_time + - last_transition_time + - message + - reason + - status + - type + PodStatus: + type: string + enum: + - pending + - running + - error + - stopping + - stopped + - completed + - unknown + ContainerStatus: + type: string + enum: + - running + - pending + - waiting + - completed + - error + RestartPolicy: + type: string + enum: + - Always + - Never + - OnFailure + ContainerRuntimeSummary: + type: object + properties: + name: type: string readOnly: true - description: Initial working directory. - start_ssh: - type: boolean - readOnly: true - description: Enable SSH access on the deployment. - is_spot: - type: boolean - readOnly: true - description: Enables running on spot instance sizes. - healthcheck: + namespace: type: string readOnly: true - description: Healthcheck path on the deployment's primary port. - subdomain: + uid: type: string readOnly: true - description: Subdomain for the deployment URL. - start_dind: - type: boolean - readOnly: true - description: Enables docker-in-docker. - last_deploy: + controller_uid: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Last started timestamp. - k8s_name: + nullable: true + controller_kind: type: string readOnly: true - description: Unique name for associated kubernetes objects. - created_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' + nullable: true + labels: + type: object readOnly: true - description: Creation timestamp - updated_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' + additionalProperties: + type: string + annotations: + type: object readOnly: true - description: Update timestamp. - require_restart: - type: boolean + additionalProperties: + type: string + conditions: + type: array readOnly: true - description: True if an update was applied that requires restart to take - effect. - resource_type: + items: + $ref: '#/components/schemas/Condition' + started_at: type: string - enum: - - deployment + format: date-time readOnly: true - description: Resource type of the deployment. - size_display: + nullable: true + deleted_at: type: string + format: date-time readOnly: true - description: Description of the instance size. - dask_cluster: - readOnly: true - description: Dask cluster attached to the deployment. - allOf: - - $ref: '#/components/schemas/DaskClusterNested' + nullable: true status: + readOnly: true + $ref: '#/components/schemas/ContainerStatus' + finished_at: type: string + format: date-time readOnly: true - description: Current status of the deployment. - running_count: - type: integer + nullable: true + restart_policy: readOnly: true - description: Number of running pods. - debug_mode: + $ref: '#/components/schemas/RestartPolicy' + image_pulled: type: boolean readOnly: true - description: True if deployment is running in debug mode. - url: - type: string + exit_code: + type: integer readOnly: true - description: External URL for the deployment. - ssh_url: + nullable: true + reason: type: string + enum: + - Evicted + - OOMKilled + - null readOnly: true - description: External SSH URL for the deployment. + nullable: true + previous: + readOnly: true + allOf: + - $ref: '#/components/schemas/ContainerRuntimeSummary' + nullable: true required: - - command - - created_at - - debug_mode - - description - - environment_variables - - extra_packages - - id - - image_tag - - instance_size - - is_spot - - k8s_name - - last_deploy + - annotations + - conditions + - controller_kind + - controller_uid + - deleted_at + - exit_code + - finished_at + - image_pulled + - labels - name - - owner - - require_restart - - resource_type - - running_count - - scale - - size_display - - start_dind - - start_ssh + - namespace + - previous + - reason + - restart_policy + - started_at - status - - subdomain - - updated_at - - url - - working_dir - CronSchedule: + - uid + PodRuntimeSummary: type: object properties: - schedule: + name: type: string readOnly: true - description: Cron schedule for triggering the job. - concurrency_policy: + namespace: type: string - enum: - - Allow - - Forbid - - Replace - readOnly: true - description: Specifies how to treat concurrent executions of a job's cron - schedule. - backoff_limit: - type: integer readOnly: true - minimum: 0 - description: Maximum number of retries for a failed job. - required: - - backoff_limit - - concurrency_policy - - schedule - Job: - type: object - properties: - id: + uid: type: string readOnly: true - description: ID of the job. - name: + controller_uid: type: string readOnly: true - description: Name of the job. - owner: - readOnly: true - description: Owner of the job. - allOf: - - $ref: '#/components/schemas/Owner' - command: + nullable: true + controller_kind: type: string readOnly: true - description: Command that runs on start. - description: - type: string + nullable: true + labels: + type: object readOnly: true - description: Description of the job. - tags: + additionalProperties: + type: string + annotations: type: object - description: Descriptive tags for the job. + readOnly: true additionalProperties: type: string + conditions: + type: array + readOnly: true + items: + $ref: '#/components/schemas/Condition' + started_at: + type: string + format: date-time + readOnly: true nullable: true - instance_size: + deleted_at: type: string + format: date-time readOnly: true - description: Instance size of the job. - image_tag: + nullable: true + status: readOnly: true - description: Image tag that is attached to the job. - allOf: - - $ref: '#/components/schemas/ImageTag' - extra_packages: + $ref: '#/components/schemas/PodStatus' + init_container_summaries: + type: array readOnly: true - description: Addtitional packages to install on start. - allOf: - - $ref: '#/components/schemas/ExtraPackages' - nullable: true - cron_schedule_options: + items: + $ref: '#/components/schemas/ContainerRuntimeSummary' + container_summaries: + type: array readOnly: true - description: Cron schedule configuration for scheduled jobs. - allOf: - - $ref: '#/components/schemas/CronSchedule' - start_script: + items: + $ref: '#/components/schemas/ContainerRuntimeSummary' + node_name: type: string readOnly: true - description: Shell script that runs on start before the primary command. nullable: true - environment_variables: - type: object + completed_at: + type: string + format: date-time readOnly: true - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - working_dir: + nullable: true + reason: type: string + enum: + - Evicted + - OOMKilled + - null readOnly: true - description: Initial working directory. - is_spot: - type: boolean + nullable: true + required: + - annotations + - completed_at + - conditions + - container_summaries + - controller_kind + - controller_uid + - deleted_at + - init_container_summaries + - labels + - name + - namespace + - node_name + - reason + - started_at + - status + - uid + PodRuntimeSummaryList: + type: object + properties: + pod_summaries: + type: array readOnly: true - description: Enables running on spot instance sizes. - start_dind: - type: boolean + description: List of pod summaries. + items: + $ref: '#/components/schemas/PodRuntimeSummary' + prev_key: + type: string readOnly: true - description: Enables docker-in-docker. - scale: - type: integer + description: Previous page key. + next_key: + type: string readOnly: true - description: Number of pod replicas. - k8s_name: + description: Next page key. + required: + - pod_summaries + PodLogs: + type: object + properties: + logs: type: string readOnly: true - description: Unique name for associated kubernetes objects. - require_restart: - type: boolean + description: Log lines from the active pod. + required: + - logs + ResourceType: + type: string + enum: + - deployment + - job + - workspace + - dask + ActiveResourceList: + type: object + properties: + resources: + type: array readOnly: true - description: True if an update was applied that requires restart to take - effect. - resource_type: + description: List of resources that are currently active. + items: + $ref: '#/components/schemas/Resource' + prev_key: type: string - enum: - - job readOnly: true - description: Resource type of the job. - size_display: + description: Previous page key. + next_key: + type: string + readOnly: true + description: Next page key. + required: + - resources + Login: + type: object + properties: + username: + type: string + description: The user's login username. + password: type: string - readOnly: true - description: Description of the instance size. - created_at: + description: The user's password. + required: + - password + - username + AuthorizationTokenResponse: + type: object + properties: + access_token: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - updated_at: + description: API access token. + refresh_token: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Update timestamp. - last_deploy: + description: API refresh token. + token_type: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Last started timestamp. - dask_cluster: - readOnly: true - description: Dask cluster attached to the job. - allOf: - - $ref: '#/components/schemas/DaskClusterNested' - status: + description: Type of the token. Only 'Bearer' is supported. + expires_at: type: string - readOnly: true - description: Current status of the job. - running_count: + format: date-time + description: Token expiration timestamp. + nullable: true + refresh_expires_at: + type: string + format: date-time + description: Refresh token expiration timestamp. + nullable: true + expires_in: type: integer - readOnly: true - description: Number of running pods. - debug_mode: - type: boolean - readOnly: true - description: True if job is running in debug mode. - scheduled: - type: boolean - readOnly: true - description: True if job is currently scheduled. + description: Lifetime of the token in seconds. + x-unit: seconds + nullable: true + refresh_expires_in: + type: integer + description: Lifetime of the refresh token in seconds. + x-unit: seconds + nullable: true required: - - command - - created_at - - debug_mode - - description - - environment_variables - - extra_packages - - id - - image_tag - - instance_size - - is_spot - - k8s_name - - last_deploy - - name - - owner - - require_restart - - resource_type - - running_count - - scale - - scheduled - - size_display - - start_dind - - status - - updated_at - - working_dir - Workspace: + - access_token + - expires_at + - expires_in + - refresh_expires_at + - refresh_expires_in + - refresh_token + - token_type + ClusterConnectionType: + type: string + enum: + - incluster + - token + Cluster: type: object properties: id: type: string readOnly: true - description: ID of the workspace + description: Cluster ID. name: type: string readOnly: true - description: Name of the workspace. - owner: - readOnly: true - description: Owner of the workspace. - allOf: - - $ref: '#/components/schemas/Owner' - description: + description: Cluster name. + org_id: type: string readOnly: true - description: Description of the workspace. - tags: - type: object - description: Descriptive tags for the workspace. - additionalProperties: - type: string - nullable: true - image_tag: - readOnly: true - description: Image tag that is attached to the workspace. - allOf: - - $ref: '#/components/schemas/ImageTag' - extra_packages: - readOnly: true - description: Addtitional packages to install on start. - allOf: - - $ref: '#/components/schemas/ExtraPackages' - nullable: true - ide: - type: string + description: Owning org ID. + connection_type: readOnly: true - description: IDE of the workspace - start_script: + description: Connection method. + $ref: '#/components/schemas/ClusterConnectionType' + server_url: type: string readOnly: true - description: Shell script that runs on start before the primary command. + description: K8s API server URL. nullable: true - environment_variables: + utilities: type: object readOnly: true - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - working_dir: + description: ClusterUtilities metadata. + nullable: true + additionalProperties: {} + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Initial working directory. - disk_space: + description: Creation timestamp. + updated_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Size of the persistent volume attached to the workspace. - instance_size: - type: string + description: Last update timestamp. + required: + - connection_type + - created_at + - id + - name + - org_id + - updated_at + ClusterList: + type: object + properties: + clusters: + type: array readOnly: true - description: Instance size of the workspace. - auto_shutoff: + description: List of clusters. + items: + $ref: '#/components/schemas/Cluster' + prev_key: type: string - enum: - - 1 hour - - 6 hours - - 24 hours - - 3 days - - 7 days - - Never - readOnly: true - description: Duration of inactivity before workspace is automatically stopped. - start_ssh: - type: boolean - readOnly: true - description: Enable SSH access on the workspace. - is_spot: - type: boolean readOnly: true - description: Enables running on spot instance sizes. - subdomain: + description: Previous page key. + next_key: type: string readOnly: true - description: Subdomain for the workspace URL. - start_dind: - type: boolean - readOnly: true - description: Enables docker-in-docker. - resource_type: + description: Next page key. + required: + - clusters + ClusterCreate: + type: object + properties: + name: type: string - enum: - - workspace - readOnly: true - description: Resource type of the workspace. - size_display: + description: Unique name of the cluster. + org_id: type: string - readOnly: true - description: Description of the instance size. - k8s_name: + description: ID of the org that owns the cluster. + connection_type: + description: 'How Atlas should connect to the cluster: ''incluster'' uses + the pod''s service account; ''token'' uses stored server_url + ca_bundle + + token.' + $ref: '#/components/schemas/ClusterConnectionType' + server_url: type: string - readOnly: true - description: Unique name for associated kubernetes objects. - require_restart: - type: boolean - readOnly: true - description: True if an update was applied that requires restart to take - effect - created_at: + default: null + description: K8s API server URL. Required when connection_type is 'token'. + nullable: true + ca_bundle: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - updated_at: + default: null + description: Base64-encoded CA bundle. Required when connection_type is + 'token'. + nullable: true + token: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Updated timestamp. - started_at: + default: null + description: Bearer token for k8s API. Required when connection_type is + 'token'. + nullable: true + utilities: + type: object + default: null + description: ClusterUtilities metadata (service endpoints). + nullable: true + additionalProperties: {} + required: + - connection_type + - name + - org_id + ClusterUpdate: + type: object + properties: + connection_type: + description: Connection type. + $ref: '#/components/schemas/ClusterConnectionType' + server_url: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Last started timestamp. + default: null + description: K8s API server URL. nullable: true - self_destruct: - type: boolean - readOnly: true - description: Auto delete the workspace on stop. - dask_cluster: - readOnly: true - description: Dask cluster attached to the workspace. - allOf: - - $ref: '#/components/schemas/DaskClusterNested' - status: + ca_bundle: type: string + default: null + description: Base64-encoded CA bundle. + nullable: true + token: + type: string + default: null + description: Bearer token. + nullable: true + utilities: + type: object + default: null + description: ClusterUtilities metadata. + nullable: true + additionalProperties: {} + DaskClusterList: + type: object + properties: + dask_clusters: + type: array readOnly: true - description: Current status of the workspace. - debug_mode: - type: boolean - readOnly: true - description: True if workspace is running in debug mode. - url: + description: List of dask clusters. + items: + $ref: '#/components/schemas/DaskCluster' + prev_key: type: string - format: url readOnly: true - description: External URL for the workspace. - ssh_url: + description: Previous page key. + next_key: type: string - format: url readOnly: true - description: External SSH URL for the workspace. - nullable: true + description: Next page key. required: - - auto_shutoff - - created_at - - debug_mode - - description - - disk_space - - environment_variables - - extra_packages - - id - - ide - - image_tag - - instance_size - - is_spot - - k8s_name - - name - - owner - - require_restart - - resource_type - - size_display - - ssh_url - - start_dind - - start_script - - start_ssh - - started_at - - status - - subdomain - - updated_at - - url - - working_dir - ResourceRecipe: - discriminator: - propertyName: type - mapping: - deployment: '#/components/schemas/DeploymentRecipe' - job: '#/components/schemas/JobRecipe' - workspace: '#/components/schemas/WorkspaceRecipe' - oneOf: - - $ref: '#/components/schemas/DeploymentRecipe' - - $ref: '#/components/schemas/JobRecipe' - - $ref: '#/components/schemas/WorkspaceRecipe' + - dask_clusters + ResourceByJobId: type: object - properties: {} - AuthorizationGrant: - discriminator: - propertyName: grant_type - mapping: - authorization_code: '#/components/schemas/AuthorizationCodeGrant' - refresh_token: '#/components/schemas/AuthorizationRefreshGrant' - oneOf: - - $ref: '#/components/schemas/AuthorizationCodeGrant' - - $ref: '#/components/schemas/AuthorizationRefreshGrant' + properties: + job_id: + type: string + description: Reference by job ID. + required: + - job_id + ResourceByDeploymentId: type: object - properties: {} - AuthorizationCodeGrant: + properties: + deployment_id: + type: string + description: Reference by deployment ID. + required: + - deployment_id + ResourceByWorkspaceId: type: object properties: - grant_type: + workspace_id: type: string - enum: - - authorization_code - description: OAuth grant type. - code: + description: Reference by workspace ID. + required: + - workspace_id + ResourceReference: + oneOf: + - $ref: '#/components/schemas/ResourceByJobId' + - $ref: '#/components/schemas/ResourceByDeploymentId' + - $ref: '#/components/schemas/ResourceByWorkspaceId' + DaskClusterCreate: + type: object + properties: + resource: + description: Reference to the resource to attach the dask cluster to. + allOf: + - $ref: '#/components/schemas/ResourceReference' + tags: + type: object + default: null + description: Descriptive tags for the dask cluster. + additionalProperties: + type: string + nullable: true + worker_size: type: string - description: OAuth response code. - code_verifier: + description: Instance size of the dask workers. + worker_is_spot: + type: boolean + default: false + description: Enables spot instances for the dask workers. + scheduler_size: type: string - description: OAuth code verifier for the PKCE request. - redirect_uri: + description: Instance size of the dask scheduler. + n_workers: + type: integer + default: 1 + description: Number of dask workers. + nprocs: + type: integer + description: Number of processes per worker. + nthreads: + type: integer + default: 2 + description: Number of threads per process. + subdomain: type: string - description: OAuth redirect URI. + default: null + description: Subdomain for the dask dashboard. + nullable: true required: - - code - - code_verifier - - grant_type - - redirect_uri - AuthorizationRefreshGrant: + - resource + DaskClusterUpdate: type: object properties: - grant_type: + tags: + type: object + default: null + description: Descriptive tags for the dask cluster. + additionalProperties: + type: string + nullable: true + worker_size: type: string - enum: - - refresh_token - description: Oauth grant type. - refresh_token: + description: Instance size of the dask workers. + worker_is_spot: + type: boolean + description: Enables spot instances for the dask workers. + scheduler_size: type: string - description: Refresh token for retrieving a new token pair. + description: Instance size of the dask scheduler. + n_workers: + type: integer + description: Number of dask workers. + nprocs: + type: integer + description: Number of processes per worker. + nthreads: + type: integer + description: Number of threads per process. + subdomain: + type: string + default: null + description: Subdomain for the dask dashboard. + nullable: true + DaskClusterAdapt: + type: object + properties: + minimum: + type: integer + minimum: 0 + description: Minimum number of dask workers for adaptive scaling. + maximum: + type: integer + minimum: 0 + description: Maximum number of dask workers for adaptive scaling. required: - - grant_type - - refresh_token - WorkloadType: + - maximum + - minimum + DaskComponents: type: string enum: - - dask - - deployment - - image_build - - job - - workspace - Condition: + - kubecluster + - scheduler + - worker + PodHistory: type: object properties: - type: + pod_name: type: string readOnly: true + description: Name of the pod. status: type: string readOnly: true - reason: - type: string - readOnly: true - nullable: true - message: + description: Last known status of the pod. + last_seen: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - nullable: true - last_transition_time: + description: Last seen timestamp of the pod. + start_time: type: string - format: date-time + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true + description: Start time of the pod. nullable: true - last_probe_time: + label_job_name: type: string - format: date-time readOnly: true + description: Job label, if applicable. nullable: true required: - - last_probe_time - - last_transition_time - - message - - reason + - last_seen + - pod_name + - start_time - status - - type - PodStatus: + ResourceHistory: + type: object + properties: + pods: + type: array + readOnly: true + description: List of pod history. + items: + $ref: '#/components/schemas/PodHistory' + required: + - pods + DeploymentStatus: type: string enum: - pending - running - - error - stopping - stopped - - completed - - unknown - ContainerStatus: - type: string - enum: - - running - - pending - - waiting - - completed - error - RestartPolicy: - type: string - enum: - - Always - - Never - - OnFailure - ContainerRuntimeSummary: + DeploymentRuntimeSummary: type: object properties: name: @@ -10309,54 +11951,209 @@ components: nullable: true status: readOnly: true - $ref: '#/components/schemas/ContainerStatus' - finished_at: - type: string - format: date-time - readOnly: true - nullable: true - restart_policy: - readOnly: true - $ref: '#/components/schemas/RestartPolicy' - image_pulled: - type: boolean - readOnly: true - exit_code: + $ref: '#/components/schemas/DeploymentStatus' + scale: type: integer readOnly: true - nullable: true - reason: - type: string - enum: - - Evicted - - OOMKilled - - null + running_count: + type: integer readOnly: true - nullable: true - previous: + active_count: + type: integer readOnly: true - allOf: - - $ref: '#/components/schemas/ContainerRuntimeSummary' - nullable: true required: + - active_count - annotations - conditions - controller_kind - controller_uid - deleted_at - - exit_code - - finished_at - - image_pulled - labels - name - namespace - - previous - - reason - - restart_policy + - running_count + - scale - started_at - status - uid - PodRuntimeSummary: + HistoricLog: + type: object + properties: + timestamp: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Log timestamp. + content: + type: string + readOnly: true + description: Content of the log. + pod_name: + type: string + readOnly: true + description: Name of the pod the log came from. + container_name: + type: string + readOnly: true + description: Name of the container the log came from. + required: + - container_name + - content + - pod_name + - timestamp + HistoricLogList: + type: object + properties: + logs: + type: array + readOnly: true + description: List of logs. + items: + $ref: '#/components/schemas/HistoricLog' + prev_key: + type: string + readOnly: true + description: Previous page key. + next_key: + type: string + readOnly: true + description: Next page key. + required: + - logs + Stats: + type: object + properties: + avg: + type: number + readOnly: true + description: Average value over the query range. + min: + type: number + readOnly: true + description: Minimum value over the query range. + max: + type: number + readOnly: true + description: Maximum value over the query range. + last: + type: number + readOnly: true + description: Last seen value in the query range. + required: + - avg + - last + - max + - min + DataPoint: + type: object + properties: + datetime: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Metric timestamp. + value: + type: number + readOnly: true + description: Value of the data point. + required: + - datetime + - value + MetricSeries: + type: object + properties: + pod_name: + type: string + readOnly: true + description: Name of the pod. + labels: + type: object + readOnly: true + description: Labels associated with the pod. + additionalProperties: + type: string + stats: + readOnly: true + description: Stats computed over the data range. + allOf: + - $ref: '#/components/schemas/Stats' + data: + type: array + readOnly: true + description: List of metrics data points. + items: + $ref: '#/components/schemas/DataPoint' + required: + - data + - labels + - pod_name + - stats + Metrics: + type: object + properties: + cpu: + type: array + readOnly: true + description: CPU usage metric. Values expressed in millicores. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + memory: + type: array + readOnly: true + description: Memory usage metric. Values expressed in bytes. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + network_in: + type: array + readOnly: true + description: Network inbound usage metric. Values expressed in bytes. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + network_out: + type: array + readOnly: true + description: Network outbound usage metric. Values expressed in bytes. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + gpu: + type: array + readOnly: true + description: GPU usage metric. Values expressed in millicores. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + gpu_memory: + type: array + readOnly: true + description: GPU memory usage metric. Values expressed in bytes. + items: + $ref: '#/components/schemas/MetricSeries' + nullable: true + DaskWorkerSummary: + type: object + properties: + count: + type: integer + readOnly: true + pending_count: + type: integer + readOnly: true + running_count: + type: integer + readOnly: true + error_count: + type: integer + readOnly: true + required: + - count + - error_count + - pending_count + - running_count + DaskClusterRuntimeSummary: type: object properties: name: @@ -10404,94 +12201,79 @@ components: status: readOnly: true $ref: '#/components/schemas/PodStatus' - init_container_summaries: - type: array + kubecluster_summary: readOnly: true - items: - $ref: '#/components/schemas/ContainerRuntimeSummary' - container_summaries: + allOf: + - $ref: '#/components/schemas/DeploymentRuntimeSummary' + scheduler_summary: + readOnly: true + allOf: + - $ref: '#/components/schemas/PodRuntimeSummary' + worker_summary: + readOnly: true + allOf: + - $ref: '#/components/schemas/DaskWorkerSummary' + errors: type: array readOnly: true items: - $ref: '#/components/schemas/ContainerRuntimeSummary' - node_name: - type: string - readOnly: true - nullable: true - completed_at: - type: string - format: date-time - readOnly: true - nullable: true - reason: - type: string - enum: - - Evicted - - OOMKilled - - null - readOnly: true - nullable: true + type: string required: - annotations - - completed_at - conditions - - container_summaries - controller_kind - controller_uid - deleted_at - - init_container_summaries + - errors + - kubecluster_summary - labels - name - namespace - - node_name - - reason + - scheduler_summary - started_at - status - uid - PodRuntimeSummaryList: + - worker_summary + DaskClusterScale: type: object properties: - pod_summaries: - type: array - readOnly: true - description: List of pod summaries. - items: - $ref: '#/components/schemas/PodRuntimeSummary' - prev_key: + n: + type: integer + minimum: 0 + description: Number of dask workers to scale to. + required: + - n + ResourceTokenInfo: + type: object + properties: + id: type: string - readOnly: true - description: Previous page key. - next_key: + description: ID of the token. + scope: type: string - readOnly: true - description: Next page key. + description: Permission scope of the token. + nullable: true required: - - pod_summaries - PodLogs: + - id + - scope + ResourceTokenUpdate: type: object properties: - logs: + scope: type: string - readOnly: true - description: Log lines from the active pod. + description: Permission scope of the token. + nullable: true required: - - logs - ResourceType: - type: string - enum: - - deployment - - job - - workspace - - dask - ActiveResourceList: + - scope + DaskWorkerRuntimeSummaryList: type: object properties: - resources: + workers: type: array readOnly: true - description: List of resources that are currently active. + description: List of worker pod runtime summaries. items: - $ref: '#/components/schemas/Resource' + $ref: '#/components/schemas/PodRuntimeSummary' prev_key: type: string readOnly: true @@ -10501,68 +12283,82 @@ components: readOnly: true description: Next page key. required: - - resources - Login: + - workers + InstanceSize: type: object properties: - username: + name: type: string - description: The user's login username. - password: + cores: + type: integer + memory: type: string - description: The user's password. - required: - - password - - username - AuthorizationTokenResponse: - type: object - properties: - access_token: + gpu: + type: integer + default: 0 + gpu_type: type: string - description: API access token. - refresh_token: + default: null + nullable: true + hardware_type: + $ref: '#/components/schemas/HardwareType' + cloud: type: string - description: API refresh token. - token_type: + display: type: string - description: Type of the token. Only 'Bearer' is supported. - expires_at: + readOnly: true + display_name: type: string - format: date-time - description: Token expiration timestamp. + price_per_hour: + type: number + default: null nullable: true - refresh_expires_at: + description: type: string - format: date-time - description: Refresh token expiration timestamp. - nullable: true - expires_in: - type: integer - description: Lifetime of the token in seconds. - x-unit: seconds - nullable: true - refresh_expires_in: - type: integer - description: Lifetime of the refresh token in seconds. - x-unit: seconds - nullable: true + default: '' + disabled: + type: boolean + default: false + disabled_message: + type: string + default: '' required: - - access_token - - expires_at - - expires_in - - refresh_expires_at - - refresh_expires_in - - refresh_token - - token_type - DaskClusterList: + - cloud + - cores + - display + - display_name + - hardware_type + - memory + - name + ServerOptionsSize: type: object properties: - dask_clusters: + size: type: array readOnly: true - description: List of dask clusters. + description: List of available instance sizes. items: - $ref: '#/components/schemas/DaskCluster' + $ref: '#/components/schemas/InstanceSize' + required: + - size + DaskClusterServerOptions: + type: object + properties: + server_options: + description: Configuration options for dask clusters. + allOf: + - $ref: '#/components/schemas/ServerOptionsSize' + required: + - server_options + DeploymentList: + type: object + properties: + deployments: + type: array + readOnly: true + description: List of deployments. + items: + $ref: '#/components/schemas/Deployment' prev_key: type: string readOnly: true @@ -10572,288 +12368,304 @@ components: readOnly: true description: Next page key. required: - - dask_clusters - ResourceByJobId: + - deployments + ExternalRepoAttachmentNested: type: object properties: - job_id: + path: type: string - description: Reference by job ID. - required: - - job_id - ResourceByDeploymentId: - type: object - properties: - deployment_id: + description: Path of the repository in the resource it is attached to. + on_restart: type: string - description: Reference by deployment ID. - required: - - deployment_id - ResourceByWorkspaceId: - type: object - properties: - workspace_id: + enum: + - preserve changes + - reclone + description: Repository clone behavior on restart. Preserve only applies + when path is in a persistent volume. + ref: type: string - description: Reference by workspace ID. + default: null + description: Git version reference on the repository. + nullable: true + ref_type: + type: string + enum: + - branch + - commit + - tag + description: Type of the git ref. + external_repo_id: + type: string + description: ID of the external repository to attach. required: - - workspace_id - ResourceReference: - oneOf: - - $ref: '#/components/schemas/ResourceByJobId' - - $ref: '#/components/schemas/ResourceByDeploymentId' - - $ref: '#/components/schemas/ResourceByWorkspaceId' - DaskClusterCreate: + - external_repo_id + DeploymentCreate: type: object properties: - resource: - description: Reference to the resource to attach the dask cluster to. + name: + type: string + description: Name of the deployment. + owner: + description: Owner of the deployment. allOf: - - $ref: '#/components/schemas/ResourceReference' + - $ref: '#/components/schemas/OwnerReference' + description: + type: string + default: '' + maxLength: 2048 + description: Description of the deployment. tags: type: object default: null - description: Descriptive tags for the dask cluster. + description: Descriptive tags for the deployment. + additionalProperties: + type: string + nullable: true + instance_size: + type: string + description: Instance size of the deployment. + image_uri: + type: string + description: URI of the image to attach. + image_tag_id: + type: string + description: Image tag ID to attach. + image_enforce_trusted: + type: boolean + default: true + description: Enable image trust validation before attaching. + environment_variables: + type: object + default: null + description: Mapping of environment variable keys to values. additionalProperties: type: string nullable: true - worker_size: + external_repo_attachments: + type: array + default: null + description: List of external repo attachments for the deployment. + items: + $ref: '#/components/schemas/ExternalRepoAttachmentNested' + nullable: true + extra_packages: + default: null + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' + nullable: true + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: type: string - description: Instance size of the dask workers. - worker_is_spot: + default: null + description: Shell script to run on start before the primary command. + nullable: true + working_dir: + type: string + default: /home/jovyan/workspace + description: Initial working directory for the deployment. + is_spot: type: boolean default: false - description: Enables spot instances for the dask workers. - scheduler_size: + description: Enables running on spot instance sizes. + start_dind: + type: boolean + default: false + description: Enables docker-in-docker. + command: type: string - description: Instance size of the dask scheduler. - n_workers: + minLength: 1 + description: Command that runs on start. + scale: type: integer default: 1 - description: Number of dask workers. - nprocs: - type: integer - description: Number of processes per worker. - nthreads: - type: integer - default: 2 - description: Number of threads per process. + minimum: 1 + description: Number of pod replicas. subdomain: + type: string + description: Subdomain for the deployment URL. + healthcheck: type: string default: null - description: Subdomain for the dask dashboard. + description: Healthcheck path on the deployment's primary port. nullable: true + start_ssh: + type: boolean + default: false + description: Enable SSH access on the deployment. required: - - resource - DaskClusterUpdate: + - command + - name + DeploymentUpdate: type: object properties: + name: + type: string + description: Name of the deployment. + description: + type: string + maxLength: 2048 + description: Description of the deployment. tags: type: object default: null - description: Descriptive tags for the dask cluster. + description: Descriptive tags for the deployment. additionalProperties: type: string nullable: true - worker_size: - type: string - description: Instance size of the dask workers. - worker_is_spot: - type: boolean - description: Enables spot instances for the dask workers. - scheduler_size: + image_uri: type: string - description: Instance size of the dask scheduler. - n_workers: - type: integer - description: Number of dask workers. - nprocs: - type: integer - description: Number of processes per worker. - nthreads: - type: integer - description: Number of threads per process. - subdomain: + description: URI of the image to attach. + image_tag_id: type: string + description: Image tag ID to attach. + image_enforce_trusted: + type: boolean + default: true + description: Enable image trust validation before attaching. + environment_variables: + type: object + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + external_repo_attachments: + type: array + description: List of external repo attachments. + items: + $ref: '#/components/schemas/ExternalRepoAttachmentNested' + extra_packages: default: null - description: Subdomain for the dask dashboard. + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' nullable: true - DaskClusterAdapt: - type: object - properties: - minimum: - type: integer - minimum: 0 - description: Minimum number of dask workers for adaptive scaling. - maximum: - type: integer - minimum: 0 - description: Maximum number of dask workers for adaptive scaling. - required: - - maximum - - minimum - DaskComponents: - type: string - enum: - - kubecluster - - scheduler - - worker - PodHistory: - type: object - properties: - pod_name: - type: string - readOnly: true - description: Name of the pod. - status: - type: string - readOnly: true - description: Last known status of the pod. - last_seen: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Last seen timestamp of the pod. - start_time: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Start time of the pod. + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' nullable: true - label_job_name: + start_script: type: string - readOnly: true - description: Job label, if applicable. + default: null + description: Shell script that runs on start before the primary command. nullable: true - required: - - last_seen - - pod_name - - start_time - - status - ResourceHistory: - type: object - properties: - pods: - type: array - readOnly: true - description: List of pod history. - items: - $ref: '#/components/schemas/PodHistory' - required: - - pods - DeploymentStatus: - type: string - enum: - - pending - - running - - stopping - - stopped - - error - DeploymentRuntimeSummary: - type: object - properties: - name: - type: string - readOnly: true - namespace: + working_dir: type: string - readOnly: true - uid: + description: Initial working directory. + instance_size: type: string - readOnly: true - controller_uid: + description: Instance size of the deployment. + is_spot: + type: boolean + description: Enables running on spot instance sizes. + start_dind: + type: boolean + description: Enables docker-in-docker. + command: type: string - readOnly: true - nullable: true - controller_kind: + minLength: 1 + description: Command that runs on start. + scale: + type: integer + minimum: 1 + description: Number of pod replicas. + subdomain: type: string - readOnly: true - nullable: true - labels: - type: object - readOnly: true - additionalProperties: - type: string - annotations: - type: object - readOnly: true - additionalProperties: - type: string - conditions: + default: null + description: Subdomain for the deployment URL. + nullable: true + healthcheck: + type: string + default: null + description: Healthcheck path on the deployment's primary port. + nullable: true + start_ssh: + type: boolean + description: Enable SSH access on the deployment. + ResourceClusters: + type: object + properties: + clusters: type: array readOnly: true + description: List of clusters the resource has run on. items: - $ref: '#/components/schemas/Condition' - started_at: + type: string + nullable: true + required: + - clusters + DeploymentStart: + type: object + properties: + debug_mode: + type: boolean + description: Enable debug mode. Deployment will continue to run on error, + and SSH will be enabled. + Route: + type: object + properties: + id: type: string - format: date-time readOnly: true - nullable: true - deleted_at: + subdomain: type: string - format: date-time - readOnly: true - nullable: true - status: - readOnly: true - $ref: '#/components/schemas/DeploymentStatus' - scale: - type: integer readOnly: true - running_count: + description: Subdomain of the route. + container_port: type: integer readOnly: true - active_count: - type: integer + description: Exposed port in the container. + visibility: + type: string readOnly: true - required: - - active_count - - annotations - - conditions - - controller_kind - - controller_uid - - deleted_at - - labels - - name - - namespace - - running_count - - scale - - started_at - - status - - uid - HistoricLog: - type: object - properties: - timestamp: + description: Describes who is allowed to access the route. + url: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' + format: url readOnly: true - description: Log timestamp. - content: + description: Full URL of the route. + required: + type: boolean + readOnly: true + description: True if the route is required for the resource. + daskcluster_id: type: string readOnly: true - description: Content of the log. - pod_name: + description: Dask cluster ID the route is attached to. + deployment_id: type: string readOnly: true - description: Name of the pod the log came from. - container_name: + description: Deployment ID the route is attached to. + workspace_id: type: string readOnly: true - description: Name of the container the log came from. + description: Workspace ID the route is attached to. required: - - container_name - - content - - pod_name - - timestamp - HistoricLogList: + - container_port + - id + - required + - subdomain + - url + - visibility + RouteList: type: object properties: - logs: + routes: type: array readOnly: true - description: List of logs. + description: List of routes. items: - $ref: '#/components/schemas/HistoricLog' + $ref: '#/components/schemas/Route' prev_key: type: string readOnly: true @@ -10863,261 +12675,135 @@ components: readOnly: true description: Next page key. required: - - logs - Stats: - type: object - properties: - avg: - type: number - readOnly: true - description: Average value over the query range. - min: - type: number - readOnly: true - description: Minimum value over the query range. - max: - type: number - readOnly: true - description: Maximum value over the query range. - last: - type: number - readOnly: true - description: Last seen value in the query range. - required: - - avg - - last - - max - - min - DataPoint: - type: object - properties: - datetime: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Metric timestamp. - value: - type: number - readOnly: true - description: Value of the data point. - required: - - datetime - - value - MetricSeries: + - routes + RouteCreate: type: object properties: - pod_name: + subdomain: type: string - readOnly: true - description: Name of the pod. - labels: - type: object - readOnly: true - description: Labels associated with the pod. - additionalProperties: - type: string - stats: - readOnly: true - description: Stats computed over the data range. - allOf: - - $ref: '#/components/schemas/Stats' - data: - type: array - readOnly: true - description: List of metrics data points. - items: - $ref: '#/components/schemas/DataPoint' - required: - - data - - labels - - pod_name - - stats - Metrics: - type: object - properties: - cpu: - type: array - readOnly: true - description: CPU usage metric. Values expressed in millicores. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - memory: - type: array - readOnly: true - description: Memory usage metric. Values expressed in bytes. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - network_in: - type: array - readOnly: true - description: Network inbound usage metric. Values expressed in bytes. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - network_out: - type: array - readOnly: true - description: Network outbound usage metric. Values expressed in bytes. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - gpu: - type: array - readOnly: true - description: GPU usage metric. Values expressed in millicores. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - gpu_memory: - type: array - readOnly: true - description: GPU memory usage metric. Values expressed in bytes. - items: - $ref: '#/components/schemas/MetricSeries' - nullable: true - DaskWorkerSummary: - type: object - properties: - count: - type: integer - readOnly: true - pending_count: - type: integer - readOnly: true - running_count: - type: integer - readOnly: true - error_count: + description: Subdomain of the route. + container_port: type: integer - readOnly: true - required: - - count - - error_count - - pending_count - - running_count - DaskClusterRuntimeSummary: + minimum: 1024 + maximum: 65535 + description: Exposed port in the container. + visibility: + type: string + enum: + - unauthenticated + - account + - org + - owner + description: Describes who is allowed to access the route. + required: + - container_port + - subdomain + RouteUpdate: type: object properties: - name: + subdomain: type: string - readOnly: true - namespace: + description: Subdomain of the route. + container_port: + type: integer + minimum: 1024 + maximum: 65535 + description: Exposed port in the container. + visibility: type: string - readOnly: true - uid: + enum: + - unauthenticated + - account + - org + - owner + description: Describes who is allowed to access the route. + SecretAccessLevel: + type: string + enum: + - org + - owner + Secret: + type: object + properties: + id: type: string readOnly: true - controller_uid: + description: ID of the secret. + name: type: string readOnly: true - nullable: true - controller_kind: - type: string + description: Name of the secret. + owner: readOnly: true - nullable: true - labels: - type: object + description: Owner of the secret. + allOf: + - $ref: '#/components/schemas/Owner' + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - additionalProperties: - type: string - annotations: - type: object + description: Creation timestamp. + access: readOnly: true - additionalProperties: - type: string - conditions: - type: array + description: Describes who is able to use the secret. + $ref: '#/components/schemas/SecretAccessLevel' + editable: + type: boolean readOnly: true - items: - $ref: '#/components/schemas/Condition' - started_at: + description: True if the secret is editable by the authenticated user/group. + required: + - access + - created_at + - id + - name + - owner + SecretAttachment: + type: object + properties: + id: type: string - format: date-time readOnly: true - nullable: true - deleted_at: + description: ID of the secret attachment. + created_at: type: string - format: date-time + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - nullable: true - status: + description: Creation timestamp. + attachment_type: readOnly: true - $ref: '#/components/schemas/PodStatus' - kubecluster_summary: + description: Attachment type of the secret onto the resource. + $ref: '#/components/schemas/SecretAttachmentType' + location: + type: string readOnly: true - allOf: - - $ref: '#/components/schemas/DeploymentRuntimeSummary' - scheduler_summary: + description: Location of the attachment on the resource. Format depends + on attachment type. + description: + type: string readOnly: true - allOf: - - $ref: '#/components/schemas/PodRuntimeSummary' - worker_summary: + description: Description of the secret attachment. + secret: readOnly: true + description: Secret attached to the resource. allOf: - - $ref: '#/components/schemas/DaskWorkerSummary' - errors: - type: array - readOnly: true - items: - type: string - required: - - annotations - - conditions - - controller_kind - - controller_uid - - deleted_at - - errors - - kubecluster_summary - - labels - - name - - namespace - - scheduler_summary - - started_at - - status - - uid - - worker_summary - DaskClusterScale: - type: object - properties: - n: - type: integer - minimum: 0 - description: Number of dask workers to scale to. - required: - - n - ResourceTokenInfo: - type: object - properties: - id: - type: string - description: ID of the token. - scope: - type: string - description: Permission scope of the token. + - $ref: '#/components/schemas/Secret' nullable: true required: + - attachment_type + - created_at + - description - id - - scope - ResourceTokenUpdate: - type: object - properties: - scope: - type: string - description: Permission scope of the token. - nullable: true - required: - - scope - DaskWorkerRuntimeSummaryList: + - location + - secret + SecretAttachmentList: type: object properties: - workers: + secret_attachments: type: array readOnly: true - description: List of worker pod runtime summaries. + description: List of secret attachments. items: - $ref: '#/components/schemas/PodRuntimeSummary' + $ref: '#/components/schemas/SecretAttachment' prev_key: type: string readOnly: true @@ -11127,367 +12813,439 @@ components: readOnly: true description: Next page key. required: - - workers - InstanceSize: + - secret_attachments + SecretCreate: type: object properties: name: type: string - cores: - type: integer - memory: + description: Name of the secret. + owner: + description: Owner of the secret. + allOf: + - $ref: '#/components/schemas/OwnerReference' + access: + default: owner + description: Describes who is able to use the secret. + $ref: '#/components/schemas/SecretAccessLevel' + value: type: string - gpu: - type: integer - default: 0 - gpu_type: + description: Value of the secret. + required: + - name + - value + SecretAttachmentCreate: + type: object + properties: + attachment_type: + default: environment_variable + description: Attachment type of the secret onto the resource. + $ref: '#/components/schemas/SecretAttachmentType' + location: + type: string + description: Location of the attachment on the resource. Format depends + on attachment type. + description: + type: string + default: '' + maxLength: 2048 + description: Description of the secret attachment. + secret: + default: null + description: New secret to create and attach to the resource. + allOf: + - $ref: '#/components/schemas/SecretCreate' + nullable: true + secret_id: type: string default: null + description: Secret ID attached to the resource. nullable: true - hardware_type: - $ref: '#/components/schemas/HardwareType' - cloud: + SecretAttachmentUpdate: + type: object + properties: + attachment_type: + description: Attachment type of the secret onto the resource. + $ref: '#/components/schemas/SecretAttachmentType' + location: + type: string + description: Location of the attachment on the resource. Format depends + on attachment type. + description: + type: string + maxLength: 2048 + description: Description of the secret attachment. + secret: + default: null + description: New secret to create and attach to the resource. + allOf: + - $ref: '#/components/schemas/SecretCreate' + nullable: true + secret_id: + type: string + default: null + description: Secret ID attached to the resource. + nullable: true + ServiceAccount: + type: object + properties: + id: + type: string + readOnly: true + description: ID of the service account. + created_at: type: string - display: + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp + name: type: string readOnly: true - display_name: + description: Name of the service account. + cloud_role: type: string - price_per_hour: - type: number - default: null + readOnly: true + description: Cloud role attached to the service account. nullable: true - description: - type: string - default: '' + auto_associate: + type: boolean + readOnly: true + description: Automatically entitle access to the service account for new + users and groups. required: - - cloud - - cores - - display - - display_name - - hardware_type - - memory + - auto_associate + - cloud_role + - created_at + - id - name - ServerOptionsSize: + ServiceAccountAttachment: type: object properties: - size: - type: array + service_account: readOnly: true - description: List of available instance sizes. - items: - $ref: '#/components/schemas/InstanceSize' - required: - - size - DaskClusterServerOptions: - type: object - properties: - server_options: - description: Configuration options for dask clusters. + description: Service account that is attached to the resource. allOf: - - $ref: '#/components/schemas/ServerOptionsSize' + - $ref: '#/components/schemas/ServiceAccount' required: - - server_options - DeploymentList: + - service_account + ServiceAccountCreateAttachment: type: object properties: - deployments: - type: array - readOnly: true - description: List of deployments. - items: - $ref: '#/components/schemas/Deployment' - prev_key: - type: string - readOnly: true - description: Previous page key. - next_key: + service_account_id: type: string - readOnly: true - description: Next page key. + description: Service account ID to attach to the resource. required: - - deployments - ExternalRepoAttachmentNested: + - service_account_id + ResourceTemplateAccessLevel: + type: string + enum: + - account + - org + - owner + ResourceTemplate: type: object properties: - path: - type: string - description: Path of the repository in the resource it is attached to. - on_restart: - type: string - enum: - - preserve changes - - reclone - description: Repository clone behavior on restart. Preserve only applies - when path is in a persistent volume. - ref: - type: string - default: null - description: Git version reference on the repository. - nullable: true - ref_type: - type: string - enum: - - branch - - commit - - tag - description: Type of the git ref. - external_repo_id: + id: type: string - description: ID of the external repository to attach. - required: - - external_repo_id - DeploymentCreate: - type: object - properties: + readOnly: true + description: ID of the resource template. name: type: string - description: Name of the deployment. + readOnly: true + description: Name of the resource template. owner: - description: Owner of the deployment. + readOnly: true + description: Owner of the resource template. allOf: - - $ref: '#/components/schemas/OwnerReference' + - $ref: '#/components/schemas/Owner' description: type: string - default: '' - maxLength: 2048 - description: Description of the deployment. - tags: - type: object - default: null - description: Descriptive tags for the deployment. - additionalProperties: - type: string - nullable: true - instance_size: - type: string - description: Instance size of the deployment. - image_uri: + readOnly: true + description: Description of the resource template. + created_at: type: string - description: URI of the image to attach. - image_tag_id: + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp + thumbnail_image_url: type: string - description: Image tag ID to attach. - image_enforce_trusted: - type: boolean - default: true - description: Enable image trust validation before attaching. - environment_variables: - type: object - default: null - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - nullable: true - external_repo_attachments: - type: array - default: null - description: List of external repo attachments for the deployment. - items: - $ref: '#/components/schemas/ExternalRepoAttachmentNested' - nullable: true - extra_packages: - default: null - description: Addtitional packages to install on start. - allOf: - - $ref: '#/components/schemas/ExtraPackages' + readOnly: true + description: Thumbnail image URL to display with the resource template. nullable: true - start_script: - type: string - default: null - description: Shell script to run on start before the primary command. + weight: + type: integer + readOnly: true + description: Gallery ordering weight. nullable: true - working_dir: - type: string - default: /home/jovyan/workspace - description: Initial working directory for the deployment. - is_spot: + recipe: + type: object + readOnly: true + description: Resource recipe to apply. + additionalProperties: {} + access: + readOnly: true + description: Describes who has access to the resource template. + $ref: '#/components/schemas/ResourceTemplateAccessLevel' + in_gallery: type: boolean - default: false - description: Enables running on spot instance sizes. - start_dind: + description: Enable displaying the resource template in the dashboard gallery. + editable: type: boolean - default: false - description: Enables docker-in-docker. - command: + readOnly: true + description: True if the resource template is editable by the authenticated + user/group. + required: + - access + - created_at + - description + - editable + - id + - name + - owner + - recipe + - thumbnail_image_url + - weight + Identity: + type: object + properties: + id: type: string - minLength: 1 - description: Command that runs on start. - scale: - type: integer - default: 1 - minimum: 1 - description: Number of pod replicas. - subdomain: + readOnly: true + description: ID of the user or group. + avatar_url: type: string - description: Subdomain for the deployment URL. - healthcheck: + format: url + readOnly: true + description: Avatar URL for the user or group. + created_at: type: string - default: null - description: Healthcheck path on the deployment's primary port. - nullable: true - start_ssh: - type: boolean - default: false - description: Enable SSH access on the deployment. + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. + name: + type: string + readOnly: true + description: Name of the user or group. + identity_type: + readOnly: true + description: Type of the identity (user or group). + $ref: '#/components/schemas/IdentityType' required: - - command + - avatar_url + - created_at + - id + - identity_type - name - DeploymentUpdate: + Viewer: type: object properties: - name: - type: string - description: Name of the deployment. - description: - type: string - maxLength: 2048 - description: Description of the deployment. - tags: - type: object - default: null - description: Descriptive tags for the deployment. - additionalProperties: - type: string - nullable: true - image_uri: + id: type: string - description: URI of the image to attach. - image_tag_id: + readOnly: true + description: ID of the viewer. + created_at: type: string - description: Image tag ID to attach. - image_enforce_trusted: - type: boolean - default: true - description: Enable image trust validation before attaching. - environment_variables: - type: object - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - external_repo_attachments: - type: array - description: List of external repo attachments. - items: - $ref: '#/components/schemas/ExternalRepoAttachmentNested' - extra_packages: - default: null - description: Addtitional packages to install on start. + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. + identity: + readOnly: true + description: Identity of the viewer. allOf: - - $ref: '#/components/schemas/ExtraPackages' + - $ref: '#/components/schemas/Identity' + route_id: + type: string + readOnly: true + description: Route ID to allow view access to. If null, all routes are granted. nullable: true - start_script: + subdomain: type: string - default: null - description: Shell script that runs on start before the primary command. + readOnly: true + description: Subdomain of the route. nullable: true - working_dir: + required: + - created_at + - id + - identity + - route_id + - subdomain + ViewerList: + type: object + properties: + viewers: + type: array + readOnly: true + description: List of viewers. + items: + $ref: '#/components/schemas/Viewer' + prev_key: type: string - description: Initial working directory. - instance_size: + readOnly: true + description: Previous page key. + next_key: type: string - description: Instance size of the deployment. - is_spot: - type: boolean - description: Enables running on spot instance sizes. - start_dind: - type: boolean - description: Enables docker-in-docker. - command: + readOnly: true + description: Next page key. + required: + - viewers + IdentityByUserId: + type: object + properties: + user_id: type: string - minLength: 1 - description: Command that runs on start. - scale: - type: integer - minimum: 1 - description: Number of pod replicas. - subdomain: + description: Identity reference by user ID + required: + - user_id + IdentityByGroupId: + type: object + properties: + group_id: type: string - default: null - description: Subdomain for the deployment URL. - nullable: true - healthcheck: + description: Identity reference by group ID + required: + - group_id + IdentityByPath: + type: string + pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ + description: Identity reference by name + IdentityReference: + oneOf: + - $ref: '#/components/schemas/IdentityByUserId' + - $ref: '#/components/schemas/IdentityByGroupId' + - $ref: '#/components/schemas/IdentityByPath' + ViewerCreate: + type: object + properties: + identity: + description: Reference to an identity. + allOf: + - $ref: '#/components/schemas/IdentityReference' + route_id: type: string default: null - description: Healthcheck path on the deployment's primary port. + description: Route ID to allow view access to. If null, all routes are granted. nullable: true - start_ssh: - type: boolean - description: Enable SSH access on the deployment. - ResourceClusters: + required: + - identity + DefaultImages: type: object properties: - clusters: - type: array - readOnly: true - description: List of clusters the resource has run on. - items: - type: string - nullable: true - required: - - clusters - DeploymentStart: + CPU: + description: Default image tag for CPU instances. + allOf: + - $ref: '#/components/schemas/ImageTag' + NVIDIA: + description: Default image tag for NVIDIA GPU instances. + allOf: + - $ref: '#/components/schemas/ImageTag' + AMD: + description: Default image tag for AMD GPU instances. + allOf: + - $ref: '#/components/schemas/ImageTag' + DefaultSizes: type: object properties: - debug_mode: - type: boolean - description: Enable debug mode. Deployment will continue to run on error, - and SSH will be enabled. - Route: + CPU: + description: Default CPU instance size. + allOf: + - $ref: '#/components/schemas/InstanceSize' + NVIDIA: + description: Default NVIDIA GPU instance size. + allOf: + - $ref: '#/components/schemas/InstanceSize' + AMD: + description: Default AMD GPU instance size. + allOf: + - $ref: '#/components/schemas/InstanceSize' + DeploymentServerInfo: + type: object + properties: + server_options: + description: Configuration options for deployments. + allOf: + - $ref: '#/components/schemas/ServerOptionsSize' + default_images: + description: Default images for deployments. + allOf: + - $ref: '#/components/schemas/DefaultImages' + default_sizes: + description: Default instance sizes for deployments. + allOf: + - $ref: '#/components/schemas/DefaultSizes' + required: + - default_images + - default_sizes + - server_options + ExternalRepoAttachment: type: object properties: id: type: string readOnly: true - subdomain: - type: string - readOnly: true - description: Subdomain of the route. - container_port: - type: integer + description: ID of the external repository attachment. + has_sshkey: + type: boolean readOnly: true - description: Exposed port in the container. - visibility: + description: True if the repository has an attached SSH Private Key + path: type: string readOnly: true - description: Describes who is allowed to access the route. - url: + description: Path of the repository in the resource it is attached to. + created_at: type: string - format: url + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Full URL of the route. - required: - type: boolean + description: Creation timestamp. + external_repo_id: + type: string readOnly: true - description: True if the route is required for the resource. - daskcluster_id: + description: ID of the external repository to attach. + remote_url: type: string readOnly: true - description: Dask cluster ID the route is attached to. + description: Repository URL deployment_id: type: string readOnly: true - description: Deployment ID the route is attached to. + description: Deployment ID the repository is attached to. + nullable: true workspace_id: type: string readOnly: true - description: Workspace ID the route is attached to. + description: Workspace ID the repository is attached to. + nullable: true + on_restart: + type: string + readOnly: true + description: Repository clone behavior on restart. Preserve only applies + when path is in a persistent volume. + ref: + type: string + readOnly: true + description: Git version reference on the repository. + nullable: true + ref_type: + type: string + readOnly: true + description: Type of the git ref. + nullable: true required: - - container_port + - created_at + - external_repo_id + - has_sshkey - id - - required - - subdomain - - url - - visibility - RouteList: + - on_restart + - path + - remote_url + ExternalRepoAttachmentList: type: object properties: - routes: + external_repo_attachments: type: array readOnly: true - description: List of routes. + description: List of external repository attachments. items: - $ref: '#/components/schemas/Route' + $ref: '#/components/schemas/ExternalRepoAttachment' prev_key: type: string readOnly: true @@ -11497,135 +13255,155 @@ components: readOnly: true description: Next page key. required: - - routes - RouteCreate: + - external_repo_attachments + ExternalRepoAttachmentCreate: type: object properties: - subdomain: + external_repo_id: type: string - description: Subdomain of the route. - container_port: - type: integer - minimum: 1024 - maximum: 65535 - description: Exposed port in the container. - visibility: + description: ID of the external repository to attach. + resource: + description: Reference to a resource to attach to. + allOf: + - $ref: '#/components/schemas/ResourceReference' + path: + type: string + description: Path of the repository in the resource it is attached to. + on_restart: type: string + default: preserve changes enum: - - unauthenticated - - account - - org - - owner - description: Describes who is allowed to access the route. + - preserve changes + - reclone + description: Repository clone behavior on restart. Preserve only applies + when path is in a persistent volume. + ref: + type: string + default: null + description: Git version reference on the repository. + nullable: true + ref_type: + type: string + default: branch + enum: + - branch + - commit + - tag + description: Type of the git ref. required: - - container_port - - subdomain - RouteUpdate: + - external_repo_id + - resource + ExternalRepoAttachmentUpdate: type: object properties: - subdomain: + path: type: string - description: Subdomain of the route. - container_port: - type: integer - minimum: 1024 - maximum: 65535 - description: Exposed port in the container. - visibility: + description: Path of the repository in the resource it is attached to. + on_restart: type: string enum: - - unauthenticated - - account - - org - - owner - description: Describes who is allowed to access the route. - SecretAccessLevel: - type: string - enum: - - org - - owner - Secret: + - preserve changes + - reclone + description: Repository clone behavior on restart. Preserve only applies + when path is in a persistent volume. + ref: + type: string + default: null + description: Git version reference on the repository. + nullable: true + ref_type: + type: string + enum: + - branch + - commit + - tag + description: Type of the git ref. + SSHPrivateKeyPartial: type: object properties: id: type: string readOnly: true - description: ID of the secret. + description: ID of the SSH private key. name: type: string readOnly: true - description: Name of the secret. - owner: + description: Name of the SSH private key. + identity: readOnly: true - description: Owner of the secret. + description: Identity that owns the SSH private key. allOf: - - $ref: '#/components/schemas/Owner' + - $ref: '#/components/schemas/Identity' created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - access: + location: + type: string readOnly: true - description: Describes who is able to use the secret. - $ref: '#/components/schemas/SecretAccessLevel' - editable: + description: Path to the SSH private key in resources. + is_default: type: boolean readOnly: true - description: True if the secret is editable by the authenticated user/group. + description: Enable SSH private key to be used for any external repositories + that do not specify a key. required: - - access - created_at - id + - identity + - is_default + - location - name - - owner - SecretAttachment: + ExternalRepo: type: object properties: id: type: string readOnly: true - description: ID of the secret attachment. + description: ID of the repository. + name: + type: string + readOnly: true + description: Name of the repository. + owner: + readOnly: true + description: Owner of the repository + allOf: + - $ref: '#/components/schemas/Owner' created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - attachment_type: - readOnly: true - description: Attachment type of the secret onto the resource. - $ref: '#/components/schemas/SecretAttachmentType' - location: + remote_url: type: string readOnly: true - description: Location of the attachment on the resource. Format depends - on attachment type. - description: + description: Repository URL. + ssh_privatekey_id: type: string readOnly: true - description: Description of the secret attachment. - secret: + description: ID of an SSH Private Key with permission to pull the repository. + ssh_privatekey: readOnly: true - description: Secret attached to the resource. + description: SSH Private Key information. allOf: - - $ref: '#/components/schemas/Secret' - nullable: true + - $ref: '#/components/schemas/SSHPrivateKeyPartial' required: - - attachment_type - created_at - - description - id - - location - - secret - SecretAttachmentList: + - name + - owner + - remote_url + ExternalRepoList: type: object properties: - secret_attachments: + external_repos: type: array readOnly: true - description: List of secret attachments. + description: List of external repositories. items: - $ref: '#/components/schemas/SecretAttachment' + $ref: '#/components/schemas/ExternalRepo' prev_key: type: string readOnly: true @@ -11635,271 +13413,340 @@ components: readOnly: true description: Next page key. required: - - secret_attachments - SecretCreate: + - external_repos + ExternalRepoCreate: type: object properties: - name: + remote_url: type: string - description: Name of the secret. + description: Repo URL. owner: - description: Owner of the secret. + description: Owner of the repository. allOf: - $ref: '#/components/schemas/OwnerReference' - access: - default: owner - description: Describes who is able to use the secret. - $ref: '#/components/schemas/SecretAccessLevel' - value: - type: string - description: Value of the secret. - required: - - name - - value - SecretAttachmentCreate: - type: object - properties: - attachment_type: - default: environment_variable - description: Attachment type of the secret onto the resource. - $ref: '#/components/schemas/SecretAttachmentType' - location: - type: string - description: Location of the attachment on the resource. Format depends - on attachment type. - description: - type: string - default: '' - maxLength: 2048 - description: Description of the secret attachment. - secret: - default: null - description: New secret to create and attach to the resource. - allOf: - - $ref: '#/components/schemas/SecretCreate' - nullable: true - secret_id: + ssh_privatekey_id: type: string default: null - description: Secret ID attached to the resource. + description: ID of an SSH Private Key with permission to pull the repository. nullable: true - SecretAttachmentUpdate: + required: + - remote_url + ExternalRepoUpdate: type: object properties: - attachment_type: - description: Attachment type of the secret onto the resource. - $ref: '#/components/schemas/SecretAttachmentType' - location: - type: string - description: Location of the attachment on the resource. Format depends - on attachment type. - description: + remote_url: type: string - maxLength: 2048 - description: Description of the secret attachment. - secret: - default: null - description: New secret to create and attach to the resource. - allOf: - - $ref: '#/components/schemas/SecretCreate' - nullable: true - secret_id: + description: Repository URL. + ssh_privatekey_id: type: string default: null - description: Secret ID attached to the resource. + description: ID of an SSH Private Key with permission to pull the repository. nullable: true - ServiceAccount: + Group: type: object properties: id: type: string readOnly: true - description: ID of the service account. + description: ID of the group. + groupname: + type: string + readOnly: true + description: Name of the group. created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp - name: + description: Creation timestamp. + description: type: string readOnly: true - description: Name of the service account. - cloud_role: + description: Description of the group. + avatar_url: type: string + format: url readOnly: true - description: Cloud role attached to the service account. - nullable: true - auto_associate: + description: Avatar URL for the group. + is_multiple_ssh_keys: type: boolean readOnly: true - description: Automatically entitle access to the service account for new - users and groups. + description: Enable multiple SSH keys. + org_id: + type: string + readOnly: true + description: Org ID that the group belongs to. + org_name: + type: string + readOnly: true + description: Org name that the group belongs to. + org_admin: + type: boolean + readOnly: true + description: Enable group to take privileged actions on its org. required: - - auto_associate - - cloud_role + - avatar_url - created_at + - description + - groupname - id - - name - ServiceAccountAttachment: + - is_multiple_ssh_keys + - org_admin + - org_id + - org_name + GroupList: type: object properties: - service_account: + groups: + type: array readOnly: true - description: Service account that is attached to the resource. - allOf: - - $ref: '#/components/schemas/ServiceAccount' + description: List of groups. + items: + $ref: '#/components/schemas/Group' + prev_key: + type: string + readOnly: true + description: Previous page key. + next_key: + type: string + readOnly: true + description: Next page key. required: - - service_account - ServiceAccountCreateAttachment: + - groups + GroupCreate: type: object properties: - service_account_id: + groupname: type: string - description: Service account ID to attach to the resource. + description: Name of the group. + org_id: + type: string + default: null + description: Org ID that the group belongs to. Defaults to the default org + for the authenticated user. + nullable: true + description: + type: string + description: Description of the group. + is_multiple_ssh_keys: + type: boolean + default: false + description: Enable multiple SSH keys. + org_admin: + type: boolean + default: false + description: Enable group to take privileged actions on its org. required: - - service_account_id - ResourceTemplateAccessLevel: - type: string - enum: - - account - - org - - owner - ResourceTemplate: + - groupname + GroupUpdate: type: object properties: - id: - type: string - readOnly: true - description: ID of the resource template. - name: + groupname: type: string - readOnly: true - description: Name of the resource template. - owner: - readOnly: true - description: Owner of the resource template. - allOf: - - $ref: '#/components/schemas/Owner' + description: Name of the group. description: type: string - readOnly: true - description: Description of the resource template. - created_at: + description: Description of the group. + is_multiple_ssh_keys: + type: boolean + description: Enable multiple SSH keys. + org_admin: + type: boolean + description: Enable group to take privileged actions on its org. + User: + type: object + properties: + id: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp - thumbnail_image_url: + description: ID of the user. + avatar_url: type: string + format: url readOnly: true - description: Thumbnail image URL to display with the resource template. - nullable: true - weight: - type: integer + description: Avatar URL of the user. + username: + type: string readOnly: true - description: Gallery ordering weight. - nullable: true - recipe: - type: object + description: Name of the user. + required: + - avatar_url + - id + - username + GroupMemberList: + type: object + properties: + users: + type: array readOnly: true - description: Resource recipe to apply. - additionalProperties: {} - access: + description: List of users. + items: + $ref: '#/components/schemas/User' + prev_key: + type: string readOnly: true - description: Describes who has access to the resource template. - $ref: '#/components/schemas/ResourceTemplateAccessLevel' - in_gallery: - type: boolean - description: Enable displaying the resource template in the dashboard gallery. - editable: - type: boolean + description: Previous page key. + next_key: + type: string readOnly: true - description: True if the resource template is editable by the authenticated - user/group. + description: Next page key. required: - - access - - created_at - - description - - editable - - id - - name - - owner - - recipe - - thumbnail_image_url - - weight - Identity: + - users + GroupMemberCreate: type: object properties: - id: + user_id: type: string - readOnly: true - description: ID of the user or group. - avatar_url: + description: User ID to add to the group. + required: + - user_id + GroupMember: + type: object + properties: + id: type: string - format: url readOnly: true - description: Avatar URL for the user or group. + description: ID of the group member created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - name: + user_id: type: string readOnly: true - description: Name of the user or group. - identity_type: + description: User ID of the group member. + group_id: + type: string readOnly: true - description: Type of the identity (user or group). - $ref: '#/components/schemas/IdentityType' + description: Group ID of the group member. required: - - avatar_url - created_at + - group_id - id - - identity_type - - name - Viewer: + - user_id + DailyUsage: + type: object + properties: + hours: + type: number + description: Compute hours used. + dollars: + type: number + description: Dollars spent. + date: + type: string + format: date + description: Date of the usage record. + instance_type: + type: string + description: Instance type used. + resource_type: + type: string + description: Resource type used. + required: + - date + - dollars + - hours + - instance_type + - resource_type + DailyUsageList: + type: object + properties: + usage: + type: array + description: List of daily usage records. + items: + $ref: '#/components/schemas/DailyUsage' + required: + - usage + ImageList: type: object properties: - id: - type: string + images: + type: array readOnly: true - description: ID of the viewer. - created_at: + description: List of images. + items: + $ref: '#/components/schemas/Image' + prev_key: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - identity: + description: Previous page key. + next_key: + type: string readOnly: true - description: Identity of the viewer. + description: Next page key. + required: + - images + ImageCreate: + type: object + properties: + name: + type: string + description: Name of the image. + owner: + description: Owner of the image. allOf: - - $ref: '#/components/schemas/Identity' - route_id: + - $ref: '#/components/schemas/OwnerReference' + description: type: string - readOnly: true - description: Route ID to allow view access to. If null, all routes are granted. + default: '' + description: Description of the image. nullable: true - subdomain: + hardware_type: + default: CPU + description: Supported instance hardware type. + $ref: '#/components/schemas/HardwareType' + supports: + type: array + description: Supported features. + items: + type: string + access: + default: owner + description: Describes who has access to the image. + $ref: '#/components/schemas/ImageAccessLevel' + required: + - name + ImageUpdate: + type: object + properties: + name: type: string - readOnly: true - description: Subdomain of the route. + description: Name of the image. + description: + type: string + default: null + description: Description of the image. nullable: true - required: - - created_at - - id - - identity - - route_id - - subdomain - ViewerList: + hardware_type: + description: Supported instance hardware type. + $ref: '#/components/schemas/HardwareType' + supports: + type: array + description: Supported features. + items: + type: string + access: + description: Describes who has access to the image. + $ref: '#/components/schemas/ImageAccessLevel' + ImageBuildStatus: + type: string + enum: + - built + - building + - error + - pending + - stopping + ImageTagList: type: object properties: - viewers: + image_tags: type: array readOnly: true - description: List of viewers. + description: List of image tags. items: - $ref: '#/components/schemas/Viewer' + $ref: '#/components/schemas/ImageTag' prev_key: type: string readOnly: true @@ -11909,421 +13756,415 @@ components: readOnly: true description: Next page key. required: - - viewers - IdentityByUserId: + - image_tags + ImageTagCreateBuild: type: object properties: - user_id: + version: type: string - description: Identity reference by user ID + minLength: 1 + description: Version of the image tag. + description: + type: string + default: '' + description: Description of the image tag. + build_data: + description: Build data for the image tag. + allOf: + - $ref: '#/components/schemas/BuildData' required: - - user_id - IdentityByGroupId: + - version + ImageTagCreateExternal: type: object properties: - group_id: + image_uri: type: string - description: Identity reference by group ID + description: External image URI + version: + type: string + default: '' + description: Version of the image tag. + description: + type: string + default: '' + description: Description of the image tag. required: - - group_id - IdentityByPath: - type: string - pattern: ^(?:(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/)?(?P[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})?$ - description: Identity reference by name - IdentityReference: + - image_uri + ImageTagCreate: oneOf: - - $ref: '#/components/schemas/IdentityByUserId' - - $ref: '#/components/schemas/IdentityByGroupId' - - $ref: '#/components/schemas/IdentityByPath' - ViewerCreate: + - $ref: '#/components/schemas/ImageTagCreateBuild' + - $ref: '#/components/schemas/ImageTagCreateExternal' + ImageTagUpdate: type: object properties: - identity: - description: Reference to an identity. - allOf: - - $ref: '#/components/schemas/IdentityReference' - route_id: + description: type: string - default: null - description: Route ID to allow view access to. If null, all routes are granted. - nullable: true - required: - - identity - DefaultImages: - type: object - properties: - CPU: - description: Default image tag for CPU instances. - allOf: - - $ref: '#/components/schemas/ImageTag' - NVIDIA: - description: Default image tag for NVIDIA GPU instances. - allOf: - - $ref: '#/components/schemas/ImageTag' - AMD: - description: Default image tag for AMD GPU instances. - allOf: - - $ref: '#/components/schemas/ImageTag' - DefaultSizes: - type: object - properties: - CPU: - description: Default CPU instance size. - allOf: - - $ref: '#/components/schemas/InstanceSize' - NVIDIA: - description: Default NVIDIA GPU instance size. - allOf: - - $ref: '#/components/schemas/InstanceSize' - AMD: - description: Default AMD GPU instance size. - allOf: - - $ref: '#/components/schemas/InstanceSize' - DeploymentServerInfo: - type: object - properties: - server_options: - description: Configuration options for deployments. - allOf: - - $ref: '#/components/schemas/ServerOptionsSize' - default_images: - description: Default images for deployments. - allOf: - - $ref: '#/components/schemas/DefaultImages' - default_sizes: - description: Default instance sizes for deployments. - allOf: - - $ref: '#/components/schemas/DefaultSizes' - required: - - default_images - - default_sizes - - server_options - ExternalRepoAttachment: + description: Description of the image tag. + version: + type: string + description: Version of the image tag. + archived: + type: boolean + description: Archive the image tag. Archived tags are not attachable to + new resources, but will continue to work on existing resources. + JobStatus: + type: string + enum: + - pending + - running + - stopping + - stopped + - completed + - error + JobRuntimeSummary: type: object properties: - id: + name: type: string readOnly: true - description: ID of the external repository attachment. - has_sshkey: - type: boolean - readOnly: true - description: True if the repository has an attached SSH Private Key - path: + namespace: type: string readOnly: true - description: Path of the repository in the resource it is attached to. - created_at: + uid: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - external_repo_id: + controller_uid: type: string readOnly: true - description: ID of the external repository to attach. - remote_url: + nullable: true + controller_kind: type: string readOnly: true - description: Repository URL - deployment_id: + nullable: true + labels: + type: object + readOnly: true + additionalProperties: + type: string + annotations: + type: object + readOnly: true + additionalProperties: + type: string + conditions: + type: array + readOnly: true + items: + $ref: '#/components/schemas/Condition' + started_at: type: string + format: date-time readOnly: true - description: Deployment ID the repository is attached to. nullable: true - workspace_id: + deleted_at: type: string + format: date-time readOnly: true - description: Workspace ID the repository is attached to. nullable: true - on_restart: - type: string + status: readOnly: true - description: Repository clone behavior on restart. Preserve only applies - when path is in a persistent volume. - ref: - type: string + $ref: '#/components/schemas/JobStatus' + scale: + type: integer readOnly: true - description: Git version reference on the repository. - nullable: true - ref_type: + running_count: + type: integer + readOnly: true + active_count: + type: integer + readOnly: true + completed_at: type: string + format: date-time readOnly: true - description: Type of the git ref. nullable: true required: - - created_at - - external_repo_id - - has_sshkey - - id - - on_restart - - path - - remote_url - ExternalRepoAttachmentList: + - active_count + - annotations + - completed_at + - conditions + - controller_kind + - controller_uid + - deleted_at + - labels + - name + - namespace + - running_count + - scale + - started_at + - status + - uid + Auth0Info: type: object properties: - external_repo_attachments: - type: array - readOnly: true - description: List of external repository attachments. - items: - $ref: '#/components/schemas/ExternalRepoAttachment' - prev_key: - type: string - readOnly: true - description: Previous page key. - next_key: - type: string - readOnly: true - description: Next page key. + enabled: + type: boolean + description: True if auth0 authentication is enabled. + connections: + type: object + description: Enabled auth providers. + additionalProperties: + type: string + disable_native_login: + type: boolean + description: True if native username/password login is disabled. required: - - external_repo_attachments - ExternalRepoAttachmentCreate: + - connections + - disable_native_login + - enabled + WhiteLabelConfiguration: type: object properties: - external_repo_id: + enabled: + type: boolean + description: Enable whitelabel configuration. + brand_name: type: string - description: ID of the external repository to attach. - resource: - description: Reference to a resource to attach to. - allOf: - - $ref: '#/components/schemas/ResourceReference' - path: + description: Whitelabeled brand name. + brand_short_name: type: string - description: Path of the repository in the resource it is attached to. - on_restart: + default: null + description: Short version of the brand name. + nullable: true + logo_mode: type: string - default: preserve changes - enum: - - preserve changes - - reclone - description: Repository clone behavior on restart. Preserve only applies - when path is in a persistent volume. - ref: + default: icon_and_text + description: 'Logo display mode: ''icon_and_text'' or ''logo_only''.' + logo_icon_url: + type: string + description: Brand icon URL. + logo_full_url: + type: string + description: Brand full icon URL. + favicon_url: type: string default: null - description: Git version reference on the repository. + description: Favicon URL. nullable: true - ref_type: + primary_color: type: string - default: branch - enum: - - branch - - commit - - tag - description: Type of the git ref. - required: - - external_repo_id - - resource - ExternalRepoAttachmentUpdate: - type: object - properties: - path: + description: Primary frontend color. + cloud_display_names: + type: object + default: null + description: 'Map of cloud provider IDs to display names (e.g. {''nebius'': + ''My Cloud''}).' + additionalProperties: + type: string + nullable: true + cloud_icon_urls: + type: object + default: null + description: Map of cloud provider IDs to icon URLs. + additionalProperties: + type: string + nullable: true + support_email: type: string - description: Path of the repository in the resource it is attached to. - on_restart: + description: Support contact email. + website_url: type: string - enum: - - preserve changes - - reclone - description: Repository clone behavior on restart. Preserve only applies - when path is in a persistent volume. - ref: + description: Website URL. + docs_url: type: string default: null - description: Git version reference on the repository. + description: Documentation URL. nullable: true - ref_type: - type: string - enum: - - branch - - commit - - tag - description: Type of the git ref. - SSHPrivateKeyPartial: + required: + - brand_name + - enabled + - logo_full_url + - logo_icon_url + - primary_color + - support_email + - website_url + AppInfo: type: object properties: - id: + cloud_provider: type: string - readOnly: true - description: ID of the SSH private key. - name: + description: Name of the primary cloud provider. + is_multicluster: + type: boolean + description: True if installation spans multiple clusters. + allow_deployment_public_access: + type: boolean + description: True if unauthenticated deployment access is allowed. + is_enterprise: + type: boolean + description: True if installation is Enterprise. + customer_name: type: string - readOnly: true - description: Name of the SSH private key. - identity: - readOnly: true - description: Identity that owns the SSH private key. + description: Name of the customer installation. + stripe_public_key: + type: string + description: Public key for billing in non-enterprise installations. + nullable: true + hotjar_user_tracking: + type: boolean + description: True if hotjar is enabled. + version: + type: string + description: Version of the API. + auth0: + description: Configuration for auth0 authentication. allOf: - - $ref: '#/components/schemas/Identity' - created_at: + - $ref: '#/components/schemas/Auth0Info' + network_filesystem_enabled: + type: boolean + description: True if NFS shared folders are enabled. + git_repo_clone_dir: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - location: + description: Default directory to clone git repositories into. + app_serving_domain: type: string - readOnly: true - description: Path to the SSH private key in resources. - is_default: + description: Root domain for deployment and workspace URLs. + dind_enabled: type: boolean - readOnly: true - description: Enable SSH private key to be used for any external repositories - that do not specify a key. + description: True if docker-in-docker is enabled. + token_factory_enabled_global: + type: boolean + description: Install-wide Token Factory switch (the global Settings flag). + Per-org enablement is narrowed client-side against the active owner's + usage-limit flag. + apply_requires_confirm: + type: boolean + description: True if recipe apply should be confirmed. + hide_invitations: + type: boolean + description: True if invitations are hidden in frontend. + populate_examples: + type: boolean + description: True if saturn examples are included. + whitelabel: + description: Configuration for whitelabeled installations. + allOf: + - $ref: '#/components/schemas/WhiteLabelConfiguration' + hide_resource_creation_bar: + type: boolean + description: True if resource creation bar should be hidden. + user_tracking: + type: boolean + description: True if intercomm tracking is enabled. required: - - created_at - - id - - identity - - is_default - - location - - name - ExternalRepo: + - allow_deployment_public_access + - app_serving_domain + - apply_requires_confirm + - auth0 + - cloud_provider + - customer_name + - dind_enabled + - git_repo_clone_dir + - hide_invitations + - hide_resource_creation_bar + - hotjar_user_tracking + - is_enterprise + - is_multicluster + - network_filesystem_enabled + - populate_examples + - stripe_public_key + - token_factory_enabled_global + - user_tracking + - version + - whitelabel + DiskSpaceOption: type: object properties: - id: - type: string - readOnly: true - description: ID of the repository. - name: - type: string - readOnly: true - description: Name of the repository. - owner: - readOnly: true - description: Owner of the repository - allOf: - - $ref: '#/components/schemas/Owner' - created_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - remote_url: + value: type: string readOnly: true - description: Repository URL. - ssh_privatekey_id: + description: Kubernetes-style disk size (e.g. '100Gi') submitted when creating + a resource. + display_str: type: string readOnly: true - description: ID of an SSH Private Key with permission to pull the repository. - ssh_privatekey: - readOnly: true - description: SSH Private Key information. - allOf: - - $ref: '#/components/schemas/SSHPrivateKeyPartial' + description: Human-readable label shown in the picker. required: - - created_at - - id - - name - - owner - - remote_url - ExternalRepoList: + - display_str + - value + ServerOptions: type: object properties: - external_repos: + auto_shutoff: type: array readOnly: true - description: List of external repositories. + description: List of available auto-shutoff settings for workspaces. items: - $ref: '#/components/schemas/ExternalRepo' - prev_key: - type: string + type: string + disk_space: + type: array readOnly: true - description: Previous page key. - next_key: - type: string + description: Available disk sizes for workspaces. + items: + $ref: '#/components/schemas/DiskSpaceOption' + sizes: + type: object readOnly: true - description: Next page key. - required: - - external_repos - ExternalRepoCreate: - type: object - properties: - remote_url: - type: string - description: Repo URL. - owner: - description: Owner of the repository. - allOf: - - $ref: '#/components/schemas/OwnerReference' - ssh_privatekey_id: - type: string - default: null - description: ID of an SSH Private Key with permission to pull the repository. - nullable: true + description: Mapping of instance size names to their configurations. + additionalProperties: + $ref: '#/components/schemas/InstanceSize' required: - - remote_url - ExternalRepoUpdate: - type: object - properties: - remote_url: - type: string - description: Repository URL. - ssh_privatekey_id: - type: string - default: null - description: ID of an SSH Private Key with permission to pull the repository. - nullable: true - Group: + - auto_shutoff + - disk_space + - sizes + InvitationStatus: + type: string + enum: + - pending + - approved + - rejected + Invitation: type: object properties: id: type: string readOnly: true - description: ID of the group. - groupname: + description: ID of the invitation. + email: type: string readOnly: true - description: Name of the group. - created_at: + description: Email that the invitation is sent to + invitee_name: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - description: - type: string + description: Name of the person being invited. + nullable: true + invitor: readOnly: true - description: Description of the group. - avatar_url: + description: User that sent the invite. + allOf: + - $ref: '#/components/schemas/User' + invitor_name: type: string - format: url - readOnly: true - description: Avatar URL for the group. - is_multiple_ssh_keys: - type: boolean readOnly: true - description: Enable multiple SSH keys. - org_id: + description: Name of the person sending the invite. + nullable: true + status: type: string readOnly: true - description: Org ID that the group belongs to. - org_name: + description: Status of the invitation. + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Org name that the group belongs to. - org_admin: - type: boolean - readOnly: true - description: Enable group to take privileged actions on its org. + description: Creation timestamp. required: - - avatar_url - created_at - - description - - groupname + - email - id - - is_multiple_ssh_keys - - org_admin - - org_id - - org_name - GroupList: + - invitee_name + - invitor + - invitor_name + - status + InvitationList: type: object properties: - groups: + invitations: type: array readOnly: true - description: List of groups. + description: List of invitations. items: - $ref: '#/components/schemas/Group' + $ref: '#/components/schemas/Invitation' prev_key: type: string readOnly: true @@ -12333,76 +14174,41 @@ components: readOnly: true description: Next page key. required: - - groups - GroupCreate: + - invitations + InvitationCreate: type: object properties: - groupname: + email: type: string - description: Name of the group. - org_id: + description: Email that the invitation is sent to. + invitee_name: type: string default: null - description: Org ID that the group belongs to. Defaults to the default org - for the authenticated user. nullable: true - description: + invitor_name: type: string - description: Description of the group. - is_multiple_ssh_keys: - type: boolean - default: false - description: Enable multiple SSH keys. - org_admin: - type: boolean - default: false - description: Enable group to take privileged actions on its org. + default: null + description: Name of the person sending the invite. + nullable: true required: - - groupname - GroupUpdate: - type: object - properties: - groupname: - type: string - description: Name of the group. - description: - type: string - description: Description of the group. - is_multiple_ssh_keys: - type: boolean - description: Enable multiple SSH keys. - org_admin: - type: boolean - description: Enable group to take privileged actions on its org. - User: + - email + InvitationUpdate: type: object properties: - id: - type: string - readOnly: true - description: ID of the user. - avatar_url: - type: string - format: url - readOnly: true - description: Avatar URL of the user. - username: - type: string - readOnly: true - description: Name of the user. + status: + description: Status of the invitation. + $ref: '#/components/schemas/InvitationStatus' required: - - avatar_url - - id - - username - GroupMemberList: + - status + JobList: type: object properties: - users: + jobs: type: array readOnly: true - description: List of users. + description: List of jobs. items: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/Job' prev_key: type: string readOnly: true @@ -12412,84 +14218,241 @@ components: readOnly: true description: Next page key. required: - - users - GroupMemberCreate: + - jobs + ConcurrencyPolicy: + type: string + enum: + - Allow + - Forbid + - Replace + CronScheduleCreate: type: object properties: - user_id: + schedule: type: string - description: User ID to add to the group. + description: Cron schedule for triggering the job. + concurrency_policy: + default: Allow + description: Specifies how to treat concurrent executions of a job's cron + schedule. + $ref: '#/components/schemas/ConcurrencyPolicy' required: - - user_id - GroupMember: + - schedule + JobCreate: type: object properties: - id: + name: type: string - readOnly: true - description: ID of the group member - created_at: + description: Name of the job. + owner: + description: Owner of the job. + allOf: + - $ref: '#/components/schemas/OwnerReference' + description: type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - user_id: + default: '' + maxLength: 2048 + description: Description of the job. + tags: + type: object + default: null + description: Descriptive tags for the job. + additionalProperties: + type: string + nullable: true + instance_size: type: string - readOnly: true - description: User ID of the group member. - group_id: + description: Instance size of the job. + image_uri: type: string - readOnly: true - description: Group ID of the group member. - required: - - created_at - - group_id - - id - - user_id - DailyUsage: - type: object - properties: - hours: - type: number - description: Compute hours used. - dollars: - type: number - description: Dollars spent. - date: + description: URI of the image to attach. + image_tag_id: type: string - format: date - description: Date of the usage record. - instance_type: + description: Image tag ID to attach. + image_enforce_trusted: + type: boolean + default: true + description: Enable image trust validation before attaching. + environment_variables: + type: object + default: null + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + nullable: true + external_repo_attachments: + type: array + default: null + description: List of external repo attachments for the job. + items: + $ref: '#/components/schemas/ExternalRepoAttachmentNested' + nullable: true + extra_packages: + default: null + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' + nullable: true + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: type: string - description: Instance type used. - resource_type: + default: null + description: Shell script to run on start before the primary command. + nullable: true + working_dir: type: string - description: Resource type used. + default: /home/jovyan/workspace + description: Initial working directory for the job. + is_spot: + type: boolean + default: false + description: Enables running on spot instance sizes. + start_dind: + type: boolean + default: false + description: Enables docker-in-docker. + command: + type: string + minLength: 1 + description: Command that runs on start. + scale: + type: integer + default: 1 + minimum: 1 + description: Number of pod replicas. + retries: + type: integer + default: 0 + minimum: 0 + description: Maximum number of retries for a failed job. + cron_schedule_options: + default: null + description: Cron schedule configuration for scheduled jobs. + allOf: + - $ref: '#/components/schemas/CronScheduleCreate' + nullable: true required: - - date - - dollars - - hours - - instance_type - - resource_type - DailyUsageList: + - command + - name + CronScheduleUpdate: type: object properties: - usage: + schedule: + type: string + description: Cron schedule for triggering the job. + concurrency_policy: + description: Specifies how to treat concurrent executions of a job's cron + schedule. + $ref: '#/components/schemas/ConcurrencyPolicy' + JobUpdate: + type: object + properties: + name: + type: string + description: Name of the job. + description: + type: string + maxLength: 2048 + description: Description of the job. + tags: + type: object + default: null + description: Descriptive tags for the job. + additionalProperties: + type: string + nullable: true + image_uri: + type: string + description: URI of the image to attach. + image_tag_id: + type: string + description: Image tag ID to attach. + image_enforce_trusted: + type: boolean + default: true + description: Enable image trust validation before attaching. + environment_variables: + type: object + description: Mapping of environment variable keys to values. + additionalProperties: + type: string + external_repo_attachments: type: array - description: List of daily usage records. + description: List of external repo attachments. items: - $ref: '#/components/schemas/DailyUsage' - required: - - usage - ImageList: + $ref: '#/components/schemas/ExternalRepoAttachmentNested' + extra_packages: + default: null + description: Addtitional packages to install on start. + allOf: + - $ref: '#/components/schemas/ExtraPackages' + nullable: true + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true + start_script: + type: string + default: null + description: Shell script that runs on start before the primary command. + nullable: true + working_dir: + type: string + description: Initial working directory. + instance_size: + type: string + description: Instance size of the job. + is_spot: + type: boolean + description: Enables running on spot instance sizes. + start_dind: + type: boolean + description: Enables docker-in-docker. + command: + type: string + minLength: 1 + description: Command that runs on start. + scale: + type: integer + minimum: 1 + description: Number of pod replicas. + retries: + type: integer + minimum: 0 + description: Maximum number of retries for a failed job. + cron_schedule_options: + default: null + description: Cron schedule configuration for scheduled jobs. + allOf: + - $ref: '#/components/schemas/CronScheduleUpdate' + nullable: true + JobRestart: + type: object + properties: + debug_mode: + type: boolean + description: Enable debug mode. Job will continue to run on error, and SSH + will be enabled. + JobRuntimeSummaryList: type: object properties: - images: + job_summaries: type: array readOnly: true - description: List of images. + description: List of job runtime summaries. items: - $ref: '#/components/schemas/Image' + $ref: '#/components/schemas/JobRuntimeSummary' prev_key: type: string readOnly: true @@ -12499,871 +14462,940 @@ components: readOnly: true description: Next page key. required: - - images - ImageCreate: + - job_summaries + JobStart: type: object properties: - name: - type: string - description: Name of the image. - owner: - description: Owner of the image. + debug_mode: + type: boolean + description: Enable debug mode. Job will continue to run on error, and SSH + will be enabled. + JobServerInfo: + type: object + properties: + server_options: + description: Configuration options for jobs. allOf: - - $ref: '#/components/schemas/OwnerReference' - description: - type: string - default: '' - description: Description of the image. - nullable: true - hardware_type: - default: CPU - description: Supported instance hardware type. - $ref: '#/components/schemas/HardwareType' - supports: - type: array - description: Supported features. - items: - type: string - access: - default: owner - description: Describes who has access to the image. - $ref: '#/components/schemas/ImageAccessLevel' + - $ref: '#/components/schemas/ServerOptionsSize' + default_images: + description: Default images for jobs. + allOf: + - $ref: '#/components/schemas/DefaultImages' + default_sizes: + description: Default instance sizes for jobs. + allOf: + - $ref: '#/components/schemas/DefaultSizes' required: - - name - ImageUpdate: + - default_images + - default_sizes + - server_options + UsageLimits: type: object properties: - name: + id: type: string - description: Name of the image. - description: + readOnly: true + description: ID of the usage limit. + org_id: type: string - default: null - description: Description of the image. - nullable: true - hardware_type: - description: Supported instance hardware type. - $ref: '#/components/schemas/HardwareType' - supports: + readOnly: true + description: Org ID that the usage limit belongs to. + created_at: + type: string + format: date-time + readOnly: true + description: Creation timestamp. + name: + type: string + readOnly: true + description: Name of the usage limit. + is_default: + type: boolean + readOnly: true + description: Default usage limit for the org. + instance_sizes: type: array - description: Supported features. + readOnly: true + description: Allowed instance sizes. Null if no limits. items: type: string - access: - description: Describes who has access to the image. - $ref: '#/components/schemas/ImageAccessLevel' - ImageBuildStatus: - type: string - enum: - - built - - building - - error - - pending - - stopping - ImageTagList: - type: object - properties: - image_tags: + nullable: true + resource_types: type: array readOnly: true - description: List of image tags. + description: Allowed resource types. Null if no limits. items: - $ref: '#/components/schemas/ImageTag' - prev_key: - type: string + type: string + nullable: true + token_factory_enabled: + type: boolean readOnly: true - description: Previous page key. - next_key: - type: string + description: Whether Token Factory is available under this limit. Null inherits + the global setting; False hard-disables it. + nullable: true + num_instances: + type: integer readOnly: true - description: Next page key. - required: - - image_tags - ImageTagCreateBuild: - type: object - properties: - version: - type: string - minLength: 1 - description: Version of the image tag. - description: - type: string - default: '' - description: Description of the image tag. - build_data: - description: Build data for the image tag. - allOf: - - $ref: '#/components/schemas/BuildData' - required: - - version - ImageTagCreateExternal: - type: object - properties: - image_uri: - type: string - description: External image URI - version: - type: string - default: '' - description: Version of the image tag. - description: - type: string - default: '' - description: Description of the image tag. - required: - - image_uri - ImageTagCreate: - oneOf: - - $ref: '#/components/schemas/ImageTagCreateBuild' - - $ref: '#/components/schemas/ImageTagCreateExternal' - ImageTagUpdate: - type: object - properties: - description: - type: string - description: Description of the image tag. - version: - type: string - description: Version of the image tag. - archived: - type: boolean - description: Archive the image tag. Archived tags are not attachable to - new resources, but will continue to work on existing resources. - JobStatus: - type: string - enum: - - pending - - running - - stopping - - stopped - - completed - - error - JobRuntimeSummary: - type: object - properties: - name: - type: string + description: Maximum number of active instances. Null if no limits. + nullable: true + auto_shutoff: + type: integer readOnly: true - namespace: - type: string + description: Maximum allowed auto-shutoff. Null if no limits. + nullable: true + storage_in_gb: + type: integer readOnly: true - uid: - type: string + description: Total allowed storage in GiB. Null if no limits. + nullable: true + num_shared_folders: + type: integer readOnly: true - controller_uid: - type: string + description: Maximum number of shared folders. Null if no limits. + nullable: true + object_storage_bytes: + type: integer readOnly: true + description: Maximum allowed object storage bytes. Null if no limits. nullable: true - controller_kind: - type: string + object_storage_count: + type: integer readOnly: true + description: Maximum number of object storage files. Null if no limits. nullable: true - labels: - type: object + hours_per_day: + type: integer readOnly: true - additionalProperties: - type: string - annotations: - type: object + description: Free compute hours per day. + nullable: true + hours_per_month: + type: integer readOnly: true - additionalProperties: - type: string - conditions: + description: Free compute hours per month. + nullable: true + hours_forever: + type: integer + readOnly: true + description: Free compute hours forever (one-time grant). + nullable: true + required: + - auto_shutoff + - created_at + - hours_forever + - hours_per_day + - hours_per_month + - id + - instance_sizes + - is_default + - name + - num_instances + - num_shared_folders + - object_storage_bytes + - object_storage_count + - org_id + - resource_types + - storage_in_gb + - token_factory_enabled + UsageLimitsList: + type: object + properties: + usage_limits: type: array readOnly: true + description: List of usage limits. items: - $ref: '#/components/schemas/Condition' - started_at: + $ref: '#/components/schemas/UsageLimits' + prev_key: type: string - format: date-time readOnly: true - nullable: true - deleted_at: + description: Previous page key. + next_key: type: string - format: date-time readOnly: true + description: Next page key. + required: + - usage_limits + UsageLimitsCreate: + type: object + properties: + name: + type: string + description: Name of the usage limit. + org_id: + type: string + description: Org ID that the usage limit belongs to. + is_default: + type: boolean + default: false + description: Default usage limit for the org. + instance_sizes: + type: array + default: null + description: Allowed instance sizes. Null if no limits. + items: + type: string nullable: true - status: - readOnly: true - $ref: '#/components/schemas/JobStatus' - scale: + resource_types: + type: array + default: null + description: Allowed resource types. Null if no limits. + items: + type: string + nullable: true + token_factory_enabled: + type: boolean + default: null + description: Whether Token Factory is available under this limit. Null inherits + the global setting; False hard-disables it. + nullable: true + num_instances: type: integer - readOnly: true - running_count: + default: null + minimum: 0 + description: Maximum number of active instances. Null if no limits. + nullable: true + auto_shutoff: type: integer - readOnly: true - active_count: + default: null + minimum: 0 + description: Maximum allowed auto-shutoff. Null if no limits. + nullable: true + storage_in_gb: type: integer - readOnly: true - completed_at: - type: string - format: date-time - readOnly: true + default: null + minimum: 0 + description: Total allowed storage in GiB. Null if no limits. + nullable: true + num_shared_folders: + type: integer + default: null + minimum: 0 + description: Maximum number of shared folders. Null if no limits. + nullable: true + object_storage_bytes: + type: integer + default: null + minimum: 0 + description: Maximum allowed object storage bytes. Null if no limits. + nullable: true + object_storage_count: + type: integer + default: null + minimum: 0 + description: Maximum number of object storage files. Null if no limits. + nullable: true + hours_per_day: + type: integer + default: null + minimum: 0 + description: Free compute hours per day. + nullable: true + hours_per_month: + type: integer + default: null + minimum: 0 + description: Free compute hours per month. + nullable: true + hours_forever: + type: integer + default: null + minimum: 0 + description: Free compute hours forever (one-time grant). nullable: true required: - - active_count - - annotations - - completed_at - - conditions - - controller_kind - - controller_uid - - deleted_at - - labels - name - - namespace - - running_count - - scale - - started_at - - status - - uid - Auth0Info: + UsageLimitsUpdate: type: object properties: - enabled: + name: + type: string + description: Name of the usage limit. + is_default: type: boolean - description: True if auth0 authentication is enabled. - connections: - type: object - description: Enabled auth providers. - additionalProperties: + description: Default usage limit for the org. + instance_sizes: + type: array + default: null + description: Allowed instance sizes. Null if no limits. + items: type: string - disable_native_login: - type: boolean - description: True if native username/password login is disabled. - required: - - connections - - disable_native_login - - enabled - WhiteLabelConfiguration: - type: object - properties: - enabled: + nullable: true + resource_types: + type: array + default: null + description: Allowed resource types. Null if no limits. + items: + type: string + nullable: true + token_factory_enabled: type: boolean - description: Enable whitelabel configuration. - brand_name: - type: string - description: Whitelabeled brand name. - brand_short_name: - type: string default: null - description: Short version of the brand name. + description: Whether Token Factory is available under this limit. Null inherits + the global setting; False hard-disables it. nullable: true - logo_icon_url: - type: string - description: Brand icon URL. - logo_full_url: - type: string - description: Brand full icon URL. - favicon_url: - type: string + num_instances: + type: integer default: null - description: Favicon URL. + minimum: 0 + description: Maximum number of active instances. Null if no limits. nullable: true - primary_color: - type: string - description: Primary frontend color. - support_email: - type: string - description: Support contact email. - website_url: - type: string - description: Website URL. - docs_url: - type: string + auto_shutoff: + type: integer default: null - description: Documentation URL. + minimum: 0 + description: Maximum allowed auto-shutoff. Null if no limits. nullable: true - required: - - brand_name - - enabled - - logo_full_url - - logo_icon_url - - primary_color - - support_email - - website_url - AppInfo: + storage_in_gb: + type: integer + default: null + minimum: 0 + description: Total allowed storage in GiB. Null if no limits. + nullable: true + num_shared_folders: + type: integer + default: null + minimum: 0 + description: Maximum number of shared folders. Null if no limits. + nullable: true + object_storage_bytes: + type: integer + default: null + minimum: 0 + description: Maximum allowed object storage bytes. Null if no limits. + nullable: true + object_storage_count: + type: integer + default: null + minimum: 0 + description: Maximum number of object storage files. Null if no limits. + nullable: true + hours_per_day: + type: integer + default: null + minimum: 0 + description: Free compute hours per day. + nullable: true + hours_per_month: + type: integer + default: null + minimum: 0 + description: Free compute hours per month. + nullable: true + hours_forever: + type: integer + default: null + minimum: 0 + description: Free compute hours forever (one-time grant). + nullable: true + NotificationDelete: + type: object + properties: + notification_ids: + type: array + maxItems: 1000 + description: List of notification IDs to delete. + items: + type: string + required: + - notification_ids + Notification: type: object properties: - cloud_provider: - type: string - description: Name of the primary cloud provider. - is_multicluster: - type: boolean - description: True if installation spans multiple clusters. - allow_deployment_public_access: - type: boolean - description: True if unauthenticated deployment access is allowed. - is_enterprise: - type: boolean - description: True if installation is Enterprise. - customer_name: + id: type: string - description: Name of the customer installation. - stripe_public_key: + readOnly: true + description: ID of the notification. + user_id: type: string - description: Public key for billing in non-enterprise installations. - nullable: true - hotjar_user_tracking: - type: boolean - description: True if hotjar is enabled. - version: + readOnly: true + description: User ID that is notified. + created_at: type: string - description: Version of the API. - auth0: - description: Configuration for auth0 authentication. - allOf: - - $ref: '#/components/schemas/Auth0Info' - network_filesystem_enabled: - type: boolean - description: True if NFS shared folders are enabled. - git_repo_clone_dir: + format: date-time + readOnly: true + description: Creation timestamp. + topic: type: string - description: Default directory to clone git repositories into. - app_serving_domain: + readOnly: true + description: Topic of the notification. + message: type: string - description: Root domain for deployment and workspace URLs. - dind_enabled: - type: boolean - description: True if docker-in-docker is enabled. - apply_requires_confirm: - type: boolean - description: True if recipe apply should be confirmed. - hide_invitations: - type: boolean - description: True if invitations are hidden in frontend. - populate_examples: - type: boolean - description: True if saturn examples are included. - whitelabel: - description: Configuration for whitelabeled installations. - allOf: - - $ref: '#/components/schemas/WhiteLabelConfiguration' - hide_resource_creation_bar: - type: boolean - description: True if resource creation bar should be hidden. - user_tracking: + readOnly: true + description: Message content of the notification. + data: + type: object + readOnly: true + description: Additional data associated with the notification. + additionalProperties: {} + acknowledged: type: boolean - description: True if intercomm tracking is enabled. + readOnly: true + description: Acknowledged by user. required: - - allow_deployment_public_access - - app_serving_domain - - apply_requires_confirm - - auth0 - - cloud_provider - - customer_name - - dind_enabled - - git_repo_clone_dir - - hide_invitations - - hide_resource_creation_bar - - hotjar_user_tracking - - is_enterprise - - is_multicluster - - network_filesystem_enabled - - populate_examples - - stripe_public_key - - user_tracking - - version - - whitelabel - ServerOptions: + - acknowledged + - created_at + - data + - id + - message + - topic + - user_id + NotificationList: type: object properties: - auto_shutoff: + notifications: type: array readOnly: true - description: List of available auto-shutoff settings for workspaces. + description: List of notifications. items: - type: string - disk_space: - type: array + $ref: '#/components/schemas/Notification' + prev_key: + type: string readOnly: true - description: List of available disk sizes for workspaces. + description: Previous page key. + next_key: + type: string + readOnly: true + description: Next page key. + required: + - notifications + NotificationAcknowledged: + type: object + properties: + notification_ids: + type: array + maxItems: 1000 + description: List of notification IDs to acknowledge. items: type: string - sizes: - type: object - readOnly: true - description: Mapping of instance size names to their configurations. - additionalProperties: - $ref: '#/components/schemas/InstanceSize' + acknowledged: + type: boolean + default: true + description: Mark notifications as acknowledged or unacknowledged. required: - - auto_shutoff - - disk_space - - sizes - InvitationStatus: - type: string - enum: - - pending - - approved - - rejected - Invitation: + - notification_ids + NotificationUnsubscribe: type: object properties: - id: + topic: type: string - readOnly: true - description: ID of the invitation. - email: + description: Topic of the subscription. + user_id: type: string - readOnly: true - description: Email that the invitation is sent to - invitee_name: + description: User ID to be unsubscribed. + required: + - topic + NotificationSubscription: + type: object + properties: + id: type: string readOnly: true - description: Name of the person being invited. - nullable: true - invitor: - readOnly: true - description: User that sent the invite. - allOf: - - $ref: '#/components/schemas/User' - invitor_name: + description: ID of the notification subscription. + user_id: type: string readOnly: true - description: Name of the person sending the invite. - nullable: true - status: + description: User ID to be notified. + topic: type: string readOnly: true - description: Status of the invitation. - created_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' + description: Topic of the subscription. + options: + type: object readOnly: true - description: Creation timestamp. + description: Options data for the topic. + additionalProperties: {} required: - - created_at - - email - id - - invitee_name - - invitor - - invitor_name - - status - InvitationList: + - topic + - user_id + NotificationSubscriptionList: type: object properties: - invitations: + subscriptions: type: array readOnly: true - description: List of invitations. + description: List of notification subscriptions. items: - $ref: '#/components/schemas/Invitation' + $ref: '#/components/schemas/NotificationSubscription' prev_key: type: string + description: Previous page key. + next_key: + type: string + description: Next page key. + required: + - subscriptions + NotificationSubscribe: + type: object + properties: + topic: + type: string + description: Topic of the subscription. + user_id: + type: string + description: User ID to be subscribed. + options: + type: object + description: Options data for the topic. + additionalProperties: {} + required: + - topic + ObjectStorageDirDetails: + type: object + properties: + prefix: + type: string + readOnly: true + description: Directory path. + required: + - prefix + ObjectStorageFileDetails: + type: object + properties: + file_path: + type: string + readOnly: true + description: File path in object storage. + size: + type: integer + readOnly: true + description: Size of the file. + created_at: + type: string + format: date-time readOnly: true - description: Previous page key. - next_key: + description: Creation timestamp. + updated_at: type: string + format: date-time readOnly: true - description: Next page key. + description: Update timestamp. required: - - invitations - InvitationCreate: + - created_at + - file_path + - size + - updated_at + ObjectStorageList: type: object properties: - email: - type: string - description: Email that the invitation is sent to. - invitee_name: - type: string - default: null - nullable: true - invitor_name: + dirs: + type: array + readOnly: true + description: List of directories. + items: + $ref: '#/components/schemas/ObjectStorageDirDetails' + files: + type: array + readOnly: true + description: List of files. + items: + $ref: '#/components/schemas/ObjectStorageFileDetails' + next_last_key: type: string - default: null - description: Name of the person sending the invite. + readOnly: true + description: Next pagination key. nullable: true required: - - email - InvitationUpdate: + - dirs + - files + - next_last_key + ObjectStorageBulkReference: type: object properties: - status: - description: Status of the invitation. - $ref: '#/components/schemas/InvitationStatus' + file_paths: + type: array + minItems: 1 + maxItems: 1000 + description: List of file paths in object storage. + items: + type: string + owner: + description: Owner of the files. + allOf: + - $ref: '#/components/schemas/OwnerReference' required: - - status - JobList: + - file_paths + ObjectStorageBulkDeleteResults: type: object properties: - jobs: + failed_file_paths: type: array readOnly: true - description: List of jobs. + description: List of file paths that failed to delete. items: - $ref: '#/components/schemas/Job' - prev_key: + type: string + required: + - failed_file_paths + ObjectStoragePresignedDownload: + type: object + properties: + file_path: type: string readOnly: true - description: Previous page key. - next_key: + description: File path in object storage. + size: + type: integer + readOnly: true + description: Size of the file. + updated_at: type: string + format: date-time readOnly: true - description: Next page key. + description: File updated timestamp. + url: + type: string + format: url + readOnly: true + description: Presigned download URL for the file. required: - - jobs - ConcurrencyPolicy: - type: string - enum: - - Allow - - Forbid - - Replace - CronScheduleCreate: + - file_path + - size + - updated_at + - url + ObjectStorageBulkDownload: type: object properties: - schedule: - type: string - description: Cron schedule for triggering the job. - concurrency_policy: - default: Allow - description: Specifies how to treat concurrent executions of a job's cron - schedule. - $ref: '#/components/schemas/ConcurrencyPolicy' - backoff_limit: - type: integer - default: 0 - minimum: 0 - description: Maximum number of retries for a failed job. + files: + type: array + readOnly: true + description: List of presigned downloads. + items: + $ref: '#/components/schemas/ObjectStoragePresignedDownload' required: - - schedule - JobCreate: + - files + ObjectStorageReference: type: object properties: - name: + file_path: type: string - description: Name of the job. + description: File path in object storage. owner: - description: Owner of the job. + description: Owner of the file. allOf: - $ref: '#/components/schemas/OwnerReference' - description: - type: string - default: '' - maxLength: 2048 - description: Description of the job. - tags: - type: object - default: null - description: Descriptive tags for the job. - additionalProperties: - type: string - nullable: true - instance_size: - type: string - description: Instance size of the job. - image_uri: + required: + - file_path + ObjectStorageSharedOwner: + type: object + properties: + id: type: string - description: URI of the image to attach. - image_tag_id: + readOnly: true + description: ID of the owner. + name: type: string - description: Image tag ID to attach. - image_enforce_trusted: - type: boolean - default: true - description: Enable image trust validation before attaching. - environment_variables: - type: object - default: null - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - nullable: true - external_repo_attachments: + readOnly: true + description: Name of the owner. + count: + type: integer + readOnly: true + description: Count of files shared by the owner. + required: + - count + - id + - name + ObjectStorageSharedOwnerList: + type: object + properties: + owners: type: array - default: null - description: List of external repo attachments for the job. + readOnly: true + description: List of owners with shared object storage. items: - $ref: '#/components/schemas/ExternalRepoAttachmentNested' - nullable: true - extra_packages: - default: null - description: Addtitional packages to install on start. - allOf: - - $ref: '#/components/schemas/ExtraPackages' - nullable: true - start_script: - type: string - default: null - description: Shell script to run on start before the primary command. - nullable: true - working_dir: - type: string - default: /home/jovyan/workspace - description: Initial working directory for the job. - is_spot: - type: boolean - default: false - description: Enables running on spot instance sizes. - start_dind: - type: boolean - default: false - description: Enables docker-in-docker. - command: + $ref: '#/components/schemas/ObjectStorageSharedOwner' + next_last_key: type: string - minLength: 1 - description: Command that runs on start. - scale: - type: integer - default: 1 - minimum: 1 - description: Number of pod replicas. - cron_schedule_options: - default: null - description: Cron schedule configuration for scheduled jobs. - allOf: - - $ref: '#/components/schemas/CronScheduleCreate' + readOnly: true + description: Next pagination key. nullable: true required: - - command - - name - CronScheduleUpdate: + - next_last_key + - owners + ObjectStorageCopySource: type: object properties: - schedule: + file_path: type: string - description: Cron schedule for triggering the job. - concurrency_policy: - description: Specifies how to treat concurrent executions of a job's cron - schedule. - $ref: '#/components/schemas/ConcurrencyPolicy' - backoff_limit: - type: integer - minimum: 0 - description: Maximum number of retries for a failed job. - JobUpdate: + readOnly: true + description: File path of the source in object storage. + owner_name: + type: string + readOnly: true + description: Name of the owner of the source. + required: + - file_path + - owner_name + ObjectStorageUpload: type: object properties: - name: + id: type: string - description: Name of the job. - description: + readOnly: true + description: ID of the object storage upload. + file_path: type: string - maxLength: 2048 - description: Description of the job. - tags: - type: object - default: null - description: Descriptive tags for the job. - additionalProperties: - type: string + readOnly: true + description: File path of the upload in object storage. + size: + type: integer + readOnly: true + description: Size of the file. nullable: true - image_uri: - type: string - description: URI of the image to attach. - image_tag_id: + part_size: + type: integer + readOnly: true + description: Multipart upload size. + expires_at: type: string - description: Image tag ID to attach. - image_enforce_trusted: - type: boolean - default: true - description: Enable image trust validation before attaching. - environment_variables: - type: object - description: Mapping of environment variable keys to values. - additionalProperties: - type: string - external_repo_attachments: - type: array - description: List of external repo attachments. - items: - $ref: '#/components/schemas/ExternalRepoAttachmentNested' - extra_packages: - default: null - description: Addtitional packages to install on start. + format: date-time + readOnly: true + description: Expiration timestamp for the upload. + copy_source: + readOnly: true + description: Object storage copy source. allOf: - - $ref: '#/components/schemas/ExtraPackages' + - $ref: '#/components/schemas/ObjectStorageCopySource' nullable: true - start_script: + required: + - expires_at + - file_path + - id + - part_size + - size + ObjectStorageUploadList: + type: object + properties: + uploads: + type: array + readOnly: true + description: List of object storage uploads. + items: + $ref: '#/components/schemas/ObjectStorageUpload' + required: + - uploads + ObjectStorageUploadCreate: + type: object + properties: + file_path: type: string + description: File path in object storage. + owner: + description: Owner of the file. Defaults to authenticated user/group. + allOf: + - $ref: '#/components/schemas/OwnerReference' + size: + type: integer default: null - description: Shell script that runs on start before the primary command. + minimum: 0 + description: Size of the file. nullable: true - working_dir: - type: string - description: Initial working directory. - instance_size: - type: string - description: Instance size of the job. - is_spot: - type: boolean - description: Enables running on spot instance sizes. - start_dind: - type: boolean - description: Enables docker-in-docker. - command: - type: string - minLength: 1 - description: Command that runs on start. - scale: + part_size: type: integer - minimum: 1 - description: Number of pod replicas. - cron_schedule_options: + description: Multipart upload size. + copy_source: default: null - description: Cron schedule configuration for scheduled jobs. + description: Object storage reference to copy. allOf: - - $ref: '#/components/schemas/CronScheduleUpdate' + - $ref: '#/components/schemas/ObjectStorageReference' nullable: true - JobRestart: + required: + - file_path + ObjectStoragePresignedPart: type: object properties: - debug_mode: - type: boolean - description: Enable debug mode. Job will continue to run on error, and SSH - will be enabled. - JobRuntimeSummaryList: + url: + type: string + format: url + readOnly: true + description: Presigned part upload URL. + part_number: + type: integer + readOnly: true + description: Part number. + size: + type: integer + readOnly: true + description: Size of the part. + headers: + type: object + readOnly: true + description: Headers for the upload request. + additionalProperties: + type: string + required: + - headers + - part_number + - size + - url + ObjectStoragePresignedUpload: type: object properties: - job_summaries: + object_storage_upload_id: + type: string + readOnly: true + description: ID of the object storage upload. + is_copy: + type: boolean + readOnly: true + description: True if upload is a copy operation. + parts: type: array readOnly: true - description: List of job runtime summaries. + description: List of presigned upload parts. items: - $ref: '#/components/schemas/JobRuntimeSummary' - prev_key: - type: string - readOnly: true - description: Previous page key. - next_key: + $ref: '#/components/schemas/ObjectStoragePresignedPart' + required: + - is_copy + - object_storage_upload_id + - parts + ObjectStorageCompletePart: + type: object + properties: + etag: type: string - readOnly: true - description: Next page key. + description: Etag of the completed part. + part_number: + type: integer + description: Part number. required: - - job_summaries - JobStart: + - etag + - part_number + ObjectStorageCompletedUpload: type: object properties: - debug_mode: - type: boolean - description: Enable debug mode. Job will continue to run on error, and SSH - will be enabled. - JobServerInfo: + parts: + type: array + description: List of completed upload parts. + items: + $ref: '#/components/schemas/ObjectStorageCompletePart' + required: + - parts + ObjectStorageUsageStats: type: object properties: - server_options: - description: Configuration options for jobs. - allOf: - - $ref: '#/components/schemas/ServerOptionsSize' - default_images: - description: Default images for jobs. - allOf: - - $ref: '#/components/schemas/DefaultImages' - default_sizes: - description: Default instance sizes for jobs. - allOf: - - $ref: '#/components/schemas/DefaultSizes' + used_bytes: + type: integer + readOnly: true + description: Total used bytes in object storage. + reserved_bytes: + type: integer + readOnly: true + description: Total reserved bytes for active uploads. + file_count: + type: integer + readOnly: true + description: Number of files in object storage. + active_uploads: + type: integer + readOnly: true + description: Number of active uploads in object storage. + max_bytes: + type: integer + readOnly: true + description: Maximum number of allowed object storage bytes. + nullable: true + max_files: + type: integer + readOnly: true + description: Maximum number of allowed object storage files. + nullable: true + max_uploads: + type: integer + readOnly: true + description: Maximum number of allowed concurrent uploads. required: - - default_images - - default_sizes - - server_options - UsageLimits: + - active_uploads + - file_count + - max_bytes + - max_files + - max_uploads + - reserved_bytes + - used_bytes + Org: type: object properties: id: type: string readOnly: true - description: ID of the usage limit. - org_id: - type: string - readOnly: true - description: Org ID that the usage limit belongs to. + description: ID of the org. created_at: type: string - format: date-time + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - name: + avatar_url: type: string + format: url readOnly: true - description: Name of the usage limit. - is_default: - type: boolean - readOnly: true - description: Default usage limit for the org. - instance_sizes: - type: array - readOnly: true - description: Allowed instance sizes. Null if no limits. - items: - type: string - nullable: true - resource_types: - type: array + description: Avatar URL for the org. + name: + type: string readOnly: true - description: Allowed resource types. Null if no limits. - items: - type: string - nullable: true - num_instances: - type: integer + description: Name of the org. + email: + type: string + format: email readOnly: true - description: Maximum number of active instances. Null if no limits. - nullable: true - auto_shutoff: - type: integer + description: Email of the org. + description: + type: string readOnly: true - description: Maximum allowed auto-shutoff. Null if no limits. - nullable: true - storage_in_gb: - type: integer + description: Description of the org. + website_url: + type: string + format: url readOnly: true - description: Total allowed storage in GiB. Null if no limits. + description: Website URL of the org. nullable: true - num_shared_folders: - type: integer + logo_image_url: + type: string readOnly: true - description: Maximum number of shared folders. Null if no limits. - nullable: true - object_storage_bytes: - type: integer + description: Logo of the org. + limits_id: + type: string readOnly: true - description: Maximum allowed object storage bytes. Null if no limits. + description: Usage limits ID applied to the entire org. nullable: true - object_storage_count: - type: integer + limits: readOnly: true - description: Maximum number of object storage files. Null if no limits. + description: Usage limits applied to the entire org, if set. + allOf: + - $ref: '#/components/schemas/UsageLimits' nullable: true - hours_per_day: - type: integer + is_primary: + type: boolean readOnly: true - description: Free compute hours per day. - nullable: true - hours_per_month: - type: integer + description: Primary org for the account. + locked: + type: boolean readOnly: true - description: Free compute hours per month. - nullable: true - hours_forever: - type: integer + description: Locked orgs have restricted access to the API. + locked_reason: + type: string readOnly: true - description: Free compute hours forever (one-time grant). - nullable: true + description: Reason for the org being locked. required: - - auto_shutoff + - avatar_url - created_at - - hours_forever - - hours_per_day - - hours_per_month + - description + - email - id - - instance_sizes - - is_default + - is_primary + - limits_id + - locked + - locked_reason + - logo_image_url - name - - num_instances - - num_shared_folders - - object_storage_bytes - - object_storage_count - - org_id - - resource_types - - storage_in_gb - UsageLimitsList: + - website_url + OrgList: type: object properties: - usage_limits: + orgs: type: array readOnly: true - description: List of usage limits. + description: List of orgs. items: - $ref: '#/components/schemas/UsageLimits' + $ref: '#/components/schemas/Org' prev_key: type: string readOnly: true @@ -13373,228 +15405,147 @@ components: readOnly: true description: Next page key. required: - - usage_limits - UsageLimitsCreate: - type: object - properties: - name: - type: string - description: Name of the usage limit. - org_id: - type: string - description: Org ID that the usage limit belongs to. - is_default: - type: boolean - default: false - description: Default usage limit for the org. - instance_sizes: - type: array - default: null - description: Allowed instance sizes. Null if no limits. - items: - type: string - nullable: true - resource_types: - type: array - default: null - description: Allowed resource types. Null if no limits. - items: - type: string - nullable: true - num_instances: - type: integer - default: null - minimum: 0 - description: Maximum number of active instances. Null if no limits. - nullable: true - auto_shutoff: - type: integer - default: null - minimum: 0 - description: Maximum allowed auto-shutoff. Null if no limits. - nullable: true - storage_in_gb: - type: integer - default: null - minimum: 0 - description: Total allowed storage in GiB. Null if no limits. - nullable: true - num_shared_folders: - type: integer - default: null - minimum: 0 - description: Maximum number of shared folders. Null if no limits. - nullable: true - object_storage_bytes: - type: integer - default: null - minimum: 0 - description: Maximum allowed object storage bytes. Null if no limits. - nullable: true - object_storage_count: - type: integer - default: null - minimum: 0 - description: Maximum number of object storage files. Null if no limits. - nullable: true - hours_per_day: - type: integer - default: null - minimum: 0 - description: Free compute hours per day. - nullable: true - hours_per_month: - type: integer - default: null - minimum: 0 - description: Free compute hours per month. - nullable: true - hours_forever: - type: integer - default: null - minimum: 0 - description: Free compute hours forever (one-time grant). - nullable: true - required: - - name - UsageLimitsUpdate: + - orgs + OrgCreate: type: object properties: name: type: string - description: Name of the usage limit. - is_default: - type: boolean - description: Default usage limit for the org. - instance_sizes: - type: array - default: null - description: Allowed instance sizes. Null if no limits. - items: - type: string - nullable: true - resource_types: - type: array - default: null - description: Allowed resource types. Null if no limits. - items: - type: string - nullable: true - num_instances: - type: integer - default: null - minimum: 0 - description: Maximum number of active instances. Null if no limits. - nullable: true - auto_shutoff: - type: integer - default: null - minimum: 0 - description: Maximum allowed auto-shutoff. Null if no limits. - nullable: true - storage_in_gb: - type: integer - default: null - minimum: 0 - description: Total allowed storage in GiB. Null if no limits. - nullable: true - num_shared_folders: - type: integer + description: Name of the org. + email: + type: string + format: email + description: Email of the org. + description: + type: string + default: '' + description: Description of the org. + website_url: + type: string + format: url default: null - minimum: 0 - description: Maximum number of shared folders. Null if no limits. + description: Website URL of the org. nullable: true - object_storage_bytes: - type: integer + logo_image_url: + type: string default: null - minimum: 0 - description: Maximum allowed object storage bytes. Null if no limits. + description: Logo of the org. nullable: true - object_storage_count: - type: integer + limits_id: + type: string default: null - minimum: 0 - description: Maximum number of object storage files. Null if no limits. + description: Usage limits ID applied to the entire org. (Admin only) nullable: true - hours_per_day: - type: integer + required: + - email + - name + OrgUpdate: + type: object + properties: + email: + type: string + format: email + description: Email of the org. + description: + type: string + description: Description of the org. + website_url: + type: string + format: url default: null - minimum: 0 - description: Free compute hours per day. + description: Website URL of the org. nullable: true - hours_per_month: - type: integer + logo_image_url: + type: string default: null - minimum: 0 - description: Free compute hours per month. + description: Logo of the org. nullable: true - hours_forever: - type: integer + limits_id: + type: string default: null - minimum: 0 - description: Free compute hours forever (one-time grant). + description: Usage limits ID applied to the entire org. (Admin only) nullable: true - NotificationDelete: - type: object - properties: - notification_ids: - type: array - maxItems: 1000 - description: List of notification IDs to delete. - items: - type: string - required: - - notification_ids - Notification: + locked: + type: boolean + description: Lock the org. (Admin only) + ArtifactKind: + type: string + enum: + - dataset + - checkpoint + - model-weights + ArtifactStatus: + type: string + enum: + - assembling + - pending + - ready + - error + - deleted + Artifact: type: object properties: id: type: string readOnly: true - description: ID of the notification. - user_id: + description: Artifact identifier. + org_id: type: string readOnly: true - description: User ID that is notified. - created_at: + description: Owning organisation ID. + name: type: string - format: date-time readOnly: true - description: Creation timestamp. - topic: - type: string + description: Human-readable artifact name. + kind: readOnly: true - description: Topic of the notification. - message: + description: 'Artifact kind: dataset, checkpoint, or model-weights.' + $ref: '#/components/schemas/ArtifactKind' + location: type: string readOnly: true - description: Message content of the notification. - data: + description: Storage location (NFS path or object storage URI). + producer: type: object readOnly: true - description: Additional data associated with the notification. + description: 'JSONB snapshot of the producer resource: {id, kind, name}. + Null if artifact was uploaded directly.' + nullable: true additionalProperties: {} - acknowledged: - type: boolean + metadata: + type: object readOnly: true - description: Acknowledged by user. + description: Arbitrary metadata blob. + nullable: true + additionalProperties: {} + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp (UTC). + status: + readOnly: true + description: 'Artifact status: pending, ready, or error.' + $ref: '#/components/schemas/ArtifactStatus' required: - - acknowledged - created_at - - data - id - - message - - topic - - user_id - NotificationList: + - kind + - location + - metadata + - name + - org_id + - producer + - status + ArtifactList: type: object properties: - notifications: + artifacts: type: array readOnly: true - description: List of notifications. + description: List of artifacts. items: - $ref: '#/components/schemas/Notification' + $ref: '#/components/schemas/Artifact' prev_key: type: string readOnly: true @@ -13604,539 +15555,515 @@ components: readOnly: true description: Next page key. required: - - notifications - NotificationAcknowledged: - type: object - properties: - notification_ids: - type: array - maxItems: 1000 - description: List of notification IDs to acknowledge. - items: - type: string - acknowledged: - type: boolean - default: true - description: Mark notifications as acknowledged or unacknowledged. - required: - - notification_ids - NotificationUnsubscribe: + - artifacts + ArtifactCreate: type: object properties: - topic: + name: type: string - description: Topic of the subscription. - user_id: + minLength: 1 + description: Human-readable name for the artifact. + kind: + description: 'Artifact type: dataset, checkpoint, or model-weights.' + $ref: '#/components/schemas/ArtifactKind' + location: type: string - description: User ID to be unsubscribed. + minLength: 1 + description: Storage location (NFS path or object storage URI). + status: + description: "Initial artifact status. Defaults to 'pending'. Producers\ + \ that finish their work before calling create (e.g. a training job registering\ + \ a finished checkpoint) may set this to 'ready' or 'error' directly,\ + \ avoiding a separate PATCH. 'deleted' is rejected \u2014 soft-delete\ + \ goes through DELETE." + $ref: '#/components/schemas/ArtifactStatus' + producer: + type: object + default: null + description: 'JSONB snapshot of the Saturn resource that produced this artifact. + Shape: {id, kind, name}. Null if uploaded directly.' + nullable: true + additionalProperties: {} + metadata: + type: object + default: null + description: 'Arbitrary metadata blob: schema_type, row_count, base_model, + epoch, metrics, etc.' + nullable: true + additionalProperties: {} required: - - topic - NotificationSubscription: + - location + - name + ArtifactUpdate: + type: object + properties: + status: + description: New artifact status. + $ref: '#/components/schemas/ArtifactStatus' + metadata: + type: object + default: null + description: Updated metadata blob. + nullable: true + additionalProperties: {} + OrgInvitation: type: object properties: id: type: string readOnly: true - description: ID of the notification subscription. - user_id: + description: ID of the org invitation. + email: type: string + format: email readOnly: true - description: User ID to be notified. - topic: + description: Email that the org invitation is sent to. + invitee_name: type: string readOnly: true - description: Topic of the subscription. - options: - type: object + description: Name of the person being invited. + nullable: true + invitor: readOnly: true - description: Options data for the topic. - additionalProperties: {} + description: User that sent the invite. + allOf: + - $ref: '#/components/schemas/User' + nullable: true + invitor_name: + type: string + readOnly: true + description: Name of the person sending the invite. + nullable: true + org_id: + type: string + readOnly: true + description: Org ID that the user is being invited to. + org_name: + type: string + readOnly: true + description: Org name that the user is being invited to. + status: + readOnly: true + description: Status of the org invitation. + $ref: '#/components/schemas/InvitationStatus' + expiration: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Invitation expiration timestamp. + nullable: true + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + description: Creation timestamp. required: + - created_at + - email + - expiration - id - - topic - - user_id - NotificationSubscriptionList: + - invitee_name + - invitor + - invitor_name + - org_id + - org_name + - status + OrgInvitationList: type: object properties: - subscriptions: + invitations: type: array readOnly: true - description: List of notification subscriptions. + description: List of org invitations. items: - $ref: '#/components/schemas/NotificationSubscription' + $ref: '#/components/schemas/OrgInvitation' prev_key: type: string + readOnly: true description: Previous page key. next_key: type: string - description: Next page key. + readOnly: true + description: Next page key. + required: + - invitations + OrgInvitationCreate: + type: object + properties: + email: + type: string + format: email + description: Email that the org invitation is sent to. + invitee_name: + type: string + default: null + nullable: true + invitor_name: + type: string + default: null + description: Name of the person sending the invite. + nullable: true required: - - subscriptions - NotificationSubscribe: + - email + OrgInvitationUpdate: type: object properties: - topic: - type: string - description: Topic of the subscription. - user_id: - type: string - description: User ID to be subscribed. - options: - type: object - description: Options data for the topic. - additionalProperties: {} + status: + description: Status of the org invitation. + $ref: '#/components/schemas/InvitationStatus' required: - - topic - ObjectStorageDirDetails: + - status + OrgMemberCreate: type: object properties: - prefix: + user_id: type: string - readOnly: true - description: Directory path. + description: User ID to add to the org. + org_admin: + type: boolean + default: false + description: Enable user to take privileged actions on the org. + limits_id: + type: string + default: null + description: Usage limits ID applied to this org member. + nullable: true required: - - prefix - ObjectStorageFileDetails: + - user_id + UserDetailed: type: object properties: - file_path: + id: type: string readOnly: true - description: File path in object storage. - size: - type: integer + description: ID of the user. + avatar_url: + type: string + format: url readOnly: true - description: Size of the file. + description: Avatar URL of the user. + username: + type: string + readOnly: true + description: Name of the user. created_at: type: string - format: date-time + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true description: Creation timestamp. - updated_at: + full_name: type: string - format: date-time readOnly: true - description: Update timestamp. - required: - - created_at - - file_path - - size - - updated_at - ObjectStorageList: - type: object - properties: - dirs: - type: array + description: Full name of the user. + email: + type: string + format: email readOnly: true - description: List of directories. - items: - $ref: '#/components/schemas/ObjectStorageDirDetails' - files: - type: array + description: Email of the user. + admin: + type: boolean readOnly: true - description: List of files. - items: - $ref: '#/components/schemas/ObjectStorageFileDetails' - next_last_key: + description: Enable user to take privileged actions in the API. + locked: + type: boolean + readOnly: true + description: Lock the user. + locked_reason: type: string readOnly: true - description: Next pagination key. - nullable: true - required: - - dirs - - files - - next_last_key - ObjectStorageBulkReference: - type: object - properties: - file_paths: - type: array - minItems: 1 - maxItems: 1000 - description: List of file paths in object storage. - items: - type: string - owner: - description: Owner of the files. - allOf: - - $ref: '#/components/schemas/OwnerReference' - required: - - file_paths - ObjectStorageBulkDeleteResults: - type: object - properties: - failed_file_paths: - type: array + description: Reason the user is locked. + is_multiple_ssh_keys: + type: boolean readOnly: true - description: List of file paths that failed to delete. - items: - type: string + description: Enable multiple SSH keys. + active: + type: boolean + readOnly: true + description: True if user is active. required: - - failed_file_paths - ObjectStoragePresignedDownload: + - active + - admin + - avatar_url + - created_at + - email + - full_name + - id + - is_multiple_ssh_keys + - locked + - locked_reason + - username + OwnerUserDetailed: type: object properties: - file_path: + id: type: string readOnly: true - description: File path in object storage. - size: - type: integer + description: ID of the owner + name: + type: string readOnly: true - description: Size of the file. - updated_at: + description: 'Name of the owner (format: ''/'')' + identity_name: type: string - format: date-time readOnly: true - description: File updated timestamp. - url: + description: Name of the owner's identity + org_name: type: string - format: url readOnly: true - description: Presigned download URL for the file. - required: - - file_path - - size - - updated_at - - url - ObjectStorageBulkDownload: - type: object - properties: - files: - type: array + description: Name of the org the owner belongs to. + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: List of presigned downloads. - items: - $ref: '#/components/schemas/ObjectStoragePresignedDownload' - required: - - files - ObjectStorageReference: - type: object - properties: - file_path: + description: Creation timestamp. + org_admin: + type: boolean + readOnly: true + description: Enable the owner to take privileged actions on its org. + org_id: type: string - description: File path in object storage. - owner: - description: Owner of the file. - allOf: - - $ref: '#/components/schemas/OwnerReference' - required: - - file_path - ObjectStorageSharedOwner: - type: object - properties: - id: + readOnly: true + description: Org ID the owner belongs to. + user_id: type: string readOnly: true - description: ID of the owner. - name: + description: User ID of the owner. + identity_type: + readOnly: true + description: Typo of the owner's identity (user or group). + $ref: '#/components/schemas/IdentityType' + avatar_url: type: string readOnly: true - description: Name of the owner. - count: - type: integer + description: Avatar URL of the owner's identity. + limits_id: + type: string readOnly: true - description: Count of files shared by the owner. + description: Usage limits ID applied to the owner. + nullable: true + org: + readOnly: true + description: Org that the owner belongs to. + allOf: + - $ref: '#/components/schemas/Org' + user: + readOnly: true + description: Usser identity of the owner. + allOf: + - $ref: '#/components/schemas/UserDetailed' + limits: + readOnly: true + description: Usage limits applied to the owner. + allOf: + - $ref: '#/components/schemas/UsageLimits' + nullable: true required: - - count + - avatar_url + - created_at - id + - identity_name + - identity_type - name - ObjectStorageSharedOwnerList: + - org + - org_admin + - org_id + - org_name + - user + - user_id + OrgMemberUpdate: + type: object + properties: + org_admin: + type: boolean + description: Enable user to take privileged actions on the org. + limits_id: + type: string + default: null + description: Usage limits ID applied to this org member. (Admin only) + nullable: true + OwnerList: type: object properties: owners: type: array readOnly: true - description: List of owners with shared object storage. + description: List of owners. items: - $ref: '#/components/schemas/ObjectStorageSharedOwner' - next_last_key: + $ref: '#/components/schemas/Owner' + prev_key: type: string readOnly: true - description: Next pagination key. - nullable: true + description: Previous page key. + next_key: + type: string + readOnly: true + description: Next page key. required: - - next_last_key - owners - ObjectStorageCopySource: + OwnerDetailed: type: object properties: - file_path: + id: type: string readOnly: true - description: File path of the source in object storage. - owner_name: + description: ID of the owner + name: type: string readOnly: true - description: Name of the owner of the source. - required: - - file_path - - owner_name - ObjectStorageUpload: - type: object - properties: - id: + description: 'Name of the owner (format: ''/'')' + identity_name: type: string readOnly: true - description: ID of the object storage upload. - file_path: + description: Name of the owner's identity + org_name: type: string readOnly: true - description: File path of the upload in object storage. - size: - type: integer + description: Name of the org the owner belongs to. + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Size of the file. - nullable: true - part_size: - type: integer + description: Creation timestamp. + org_admin: + type: boolean readOnly: true - description: Multipart upload size. - expires_at: + description: Enable the owner to take privileged actions on its org. + org_id: type: string - format: date-time readOnly: true - description: Expiration timestamp for the upload. - copy_source: + description: Org ID the owner belongs to. + user_id: + type: string readOnly: true - description: Object storage copy source. - allOf: - - $ref: '#/components/schemas/ObjectStorageCopySource' + description: User ID of the owner. nullable: true - required: - - expires_at - - file_path - - id - - part_size - - size - ObjectStorageUploadList: - type: object - properties: - uploads: - type: array - readOnly: true - description: List of object storage uploads. - items: - $ref: '#/components/schemas/ObjectStorageUpload' - required: - - uploads - ObjectStorageUploadCreate: - type: object - properties: - file_path: + group_id: type: string - description: File path in object storage. - owner: - description: Owner of the file. Defaults to authenticated user/group. - allOf: - - $ref: '#/components/schemas/OwnerReference' - size: - type: integer - default: null - minimum: 0 - description: Size of the file. - nullable: true - part_size: - type: integer - description: Multipart upload size. - copy_source: - default: null - description: Object storage reference to copy. - allOf: - - $ref: '#/components/schemas/ObjectStorageReference' + readOnly: true + description: Group ID of the owner. nullable: true - required: - - file_path - ObjectStoragePresignedPart: - type: object - properties: - url: - type: string - format: url + identity_type: readOnly: true - description: Presigned part upload URL. - part_number: - type: integer + description: Typo of the owner's identity (user or group). + $ref: '#/components/schemas/IdentityType' + avatar_url: + type: string readOnly: true - description: Part number. - size: - type: integer + description: Avatar URL of the owner's identity. + limits_id: + type: string readOnly: true - description: Size of the part. - headers: - type: object + description: Usage limits ID applied to the owner. + nullable: true + org: readOnly: true - description: Headers for the upload request. - additionalProperties: - type: string - required: - - headers - - part_number - - size - - url - ObjectStoragePresignedUpload: - type: object - properties: - object_storage_upload_id: - type: string + description: Org that the owner belongs to. + allOf: + - $ref: '#/components/schemas/Org' + user: readOnly: true - description: ID of the object storage upload. - is_copy: - type: boolean + description: User identity of the owner. + allOf: + - $ref: '#/components/schemas/UserDetailed' + nullable: true + group: readOnly: true - description: True if upload is a copy operation. - parts: - type: array + description: Group identity of the owner. + allOf: + - $ref: '#/components/schemas/Group' + nullable: true + limits: readOnly: true - description: List of presigned upload parts. - items: - $ref: '#/components/schemas/ObjectStoragePresignedPart' - required: - - is_copy - - object_storage_upload_id - - parts - ObjectStorageCompletePart: - type: object - properties: - etag: - type: string - description: Etag of the completed part. - part_number: - type: integer - description: Part number. + description: Usage limits applied to the owner. + allOf: + - $ref: '#/components/schemas/UsageLimits' + nullable: true required: - - etag - - part_number - ObjectStorageCompletedUpload: + - avatar_url + - created_at + - id + - identity_name + - identity_type + - name + - org + - org_admin + - org_id + - org_name + OwnerDetailedList: type: object properties: - parts: + owners: type: array - description: List of completed upload parts. - items: - $ref: '#/components/schemas/ObjectStorageCompletePart' - required: - - parts - ObjectStorageUsageStats: - type: object - properties: - used_bytes: - type: integer - readOnly: true - description: Total used bytes in object storage. - reserved_bytes: - type: integer - readOnly: true - description: Total reserved bytes for active uploads. - file_count: - type: integer - readOnly: true - description: Number of files in object storage. - active_uploads: - type: integer - readOnly: true - description: Number of active uploads in object storage. - max_bytes: - type: integer readOnly: true - description: Maximum number of allowed object storage bytes. - nullable: true - max_files: - type: integer + description: List of detailed owners. + items: + $ref: '#/components/schemas/OwnerDetailed' + prev_key: + type: string readOnly: true - description: Maximum number of allowed object storage files. - nullable: true - max_uploads: - type: integer + description: Previous page key. + next_key: + type: string readOnly: true - description: Maximum number of allowed concurrent uploads. + description: Next page key. required: - - active_uploads - - file_count - - max_bytes - - max_files - - max_uploads - - reserved_bytes - - used_bytes - Org: + - owners + Dataset: type: object properties: id: type: string readOnly: true - description: ID of the org. - created_at: - type: string - format: '%Y-%m-%dT%H:%M:%S+00:00' - readOnly: true - description: Creation timestamp. - avatar_url: + description: Dataset identifier. + org_id: type: string - format: url readOnly: true - description: Avatar URL for the org. + description: Owning organisation ID. name: type: string readOnly: true - description: Name of the org. - email: - type: string - format: email - readOnly: true - description: Email of the org. - description: - type: string + description: Human-readable dataset name. + kind: readOnly: true - description: Description of the org. - website_url: - type: string - format: url + description: Artifact kind (always 'dataset' for this endpoint). + $ref: '#/components/schemas/ArtifactKind' + status: readOnly: true - description: Website URL of the org. - nullable: true - logo_image_url: + description: 'Dataset status: assembling, ready, or deleted.' + $ref: '#/components/schemas/ArtifactStatus' + location: type: string readOnly: true - description: Logo of the org. - limits_id: - type: string + description: Storage location URI (sf:/). + metadata: + type: object readOnly: true - description: Usage limits ID applied to the entire org. + description: Arbitrary metadata blob (schema_type, row_count, etc.). nullable: true - is_primary: - type: boolean - readOnly: true - description: Primary org for the account. - locked: - type: boolean - readOnly: true - description: Locked orgs have restricted access to the API. - locked_reason: + additionalProperties: {} + created_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Reason for the org being locked. + description: Creation timestamp (UTC). required: - - avatar_url - created_at - - description - - email - id - - is_primary - - limits_id - - locked - - locked_reason - - logo_image_url + - kind + - location + - metadata - name - - website_url - OrgList: + - org_id + - status + DatasetList: type: object properties: - orgs: + datasets: type: array readOnly: true - description: List of orgs. + description: List of datasets. items: - $ref: '#/components/schemas/Org' + $ref: '#/components/schemas/Dataset' prev_key: type: string readOnly: true @@ -14146,140 +16073,158 @@ components: readOnly: true description: Next page key. required: - - orgs - OrgCreate: + - datasets + DatasetCreate: type: object properties: name: type: string - description: Name of the org. - email: - type: string - format: email - description: Email of the org. - description: - type: string - default: '' - description: Description of the org. - website_url: - type: string - format: url + minLength: 1 + description: Human-readable name for the dataset. + metadata: + type: object default: null - description: Website URL of the org. + description: "Optional metadata blob: schema_type, description, row_count,\ + \ format hints, etc. Platform treats dataset bytes as opaque \u2014 format\ + \ details live here." nullable: true - logo_image_url: + additionalProperties: {} + required: + - name + DatasetImportCreate: + type: object + properties: + name: type: string - default: null - description: Logo of the org. - nullable: true - limits_id: + minLength: 1 + description: Human-readable name for the dataset. + hf_dataset_id: + type: string + minLength: 1 + description: Hugging Face dataset identifier, e.g. ``databricks/databricks-dolly-15k``. + split: + type: string + default: train + minLength: 1 + description: 'Hugging Face split to import (default: ``train``).' + config_name: type: string default: null - description: Usage limits ID applied to the entire org. (Admin only) + description: Optional Hugging Face config/subset name. nullable: true required: - - email + - hf_dataset_id - name - OrgUpdate: + DatasetLockCreate: type: object properties: - email: - type: string - format: email - description: Email of the org. - description: + name: type: string - description: Description of the org. - website_url: + minLength: 1 + description: Human-readable name for the dataset. + shared_folder_id: type: string - format: url - default: null - description: Website URL of the org. - nullable: true - logo_image_url: + minLength: 1 + description: ID of the existing SharedFolder to lock and register as a dataset. + subpath: type: string default: null - description: Logo of the org. + description: Optional subpath within the folder where the dataset bytes + live (e.g. ``data.jsonl`` or ``subdir/``). Defaults to the folder root. nullable: true - limits_id: - type: string + metadata: + type: object default: null - description: Usage limits ID applied to the entire org. (Admin only) + description: Optional metadata blob (schema_type, row_count, etc.). nullable: true - locked: - type: boolean - description: Lock the org. (Admin only) - OrgInvitation: + additionalProperties: {} + required: + - name + - shared_folder_id + Hyperparameters: type: object properties: - id: - type: string + learning_rate: + type: number readOnly: true - description: ID of the org invitation. - email: - type: string - format: email + epochs: + type: integer readOnly: true - description: Email that the org invitation is sent to. - invitee_name: - type: string + effective_batch_size: + type: integer readOnly: true - description: Name of the person being invited. - nullable: true - invitor: + max_seq_length: + type: integer readOnly: true - description: User that sent the invite. - allOf: - - $ref: '#/components/schemas/User' - nullable: true - invitor_name: - type: string + lora_rank: + type: integer readOnly: true - description: Name of the person sending the invite. - nullable: true - org_id: + lora_alpha: + type: integer + readOnly: true + required: + - effective_batch_size + - epochs + - learning_rate + - lora_alpha + - lora_rank + - max_seq_length + FineTuneJobSummary: + type: object + properties: + id: type: string readOnly: true - description: Org ID that the user is being invited to. - org_name: + description: Fine-tune job ID (same as the underlying deployment ID). + name: type: string readOnly: true - description: Org name that the user is being invited to. status: + type: string readOnly: true - description: Status of the org invitation. - $ref: '#/components/schemas/InvitationStatus' - expiration: + description: "Underlying Saturn job status: pending, running, stopping,\ + \ stopped, completed, or error. Same vocabulary as the rest of the platform\ + \ \u2014 TF intentionally does not translate to a product-specific set." + created_at: + type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' + readOnly: true + started_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Invitation expiration timestamp. nullable: true - created_at: + finished_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. + nullable: true + base_model: + type: string + readOnly: true + hyperparameters: + readOnly: true + allOf: + - $ref: '#/components/schemas/Hyperparameters' required: + - base_model - created_at - - email - - expiration + - finished_at + - hyperparameters - id - - invitee_name - - invitor - - invitor_name - - org_id - - org_name + - name + - started_at - status - OrgInvitationList: + FineTuneJobList: type: object properties: - invitations: + jobs: type: array readOnly: true - description: List of org invitations. + description: "List of fine-tuning jobs (``FineTuneJobSummary`` projections\ + \ \u2014 without ``latest_checkpoint``; fetch the by-id endpoint for that)." items: - $ref: '#/components/schemas/OrgInvitation' + $ref: '#/components/schemas/FineTuneJobSummary' prev_key: type: string readOnly: true @@ -14289,210 +16234,229 @@ components: readOnly: true description: Next page key. required: - - invitations - OrgInvitationCreate: - type: object - properties: - email: - type: string - format: email - description: Email that the org invitation is sent to. - invitee_name: - type: string - default: null - nullable: true - invitor_name: - type: string - default: null - description: Name of the person sending the invite. - nullable: true - required: - - email - OrgInvitationUpdate: + - jobs + Hyperparameters1: type: object properties: - status: - description: Status of the org invitation. - $ref: '#/components/schemas/InvitationStatus' + learning_rate: + type: number + minimum: 0.0 + maximum: 1.0 + description: Learning rate. Must be in (0, 1). + epochs: + type: integer + minimum: 1 + maximum: 10 + description: Number of training epochs. Must be in [1, 10]. + effective_batch_size: + type: integer + minimum: 1 + maximum: 128 + description: "Effective batch size \u2014 the number of samples whose gradients\ + \ are averaged per optimizer step. The platform translates this to axolotl's\ + \ ``gradient_accumulation_steps \xD7 micro_batch_size``; ``micro_batch_size``\ + \ is auto-found at runtime to fit GPU memory." + max_seq_length: + type: integer + minimum: 128 + maximum: 16384 + description: Maximum sequence length (tokens) per training sample. Longer + sequences use proportionally more GPU memory. Must be in [128, 16384]. + lora_rank: + type: integer + minimum: 1 + maximum: 128 + description: LoRA adapter rank. Must be in [1, 128]. + lora_alpha: + type: integer + minimum: 1 + maximum: 256 + description: LoRA alpha scaling factor. Must be in [1, 256]. required: - - status - OrgMemberCreate: + - effective_batch_size + - epochs + - learning_rate + - lora_alpha + - lora_rank + - max_seq_length + FineTuneJobCreate: type: object properties: - user_id: + name: type: string - description: User ID to add to the org. - org_admin: - type: boolean - default: false - description: Enable user to take privileged actions on the org. - limits_id: + minLength: 1 + description: Human-readable name for the fine-tuning job. + dataset_id: + type: string + minLength: 1 + description: Identifier of a token-factory dataset artifact. The dataset + must have status=READY and belong to the same org as the requester. + hyperparameters: + description: Training hyperparameters. + allOf: + - $ref: '#/components/schemas/Hyperparameters1' + instance_size: + type: string + minLength: 1 + description: Saturn instance size to run the training pod on. Must be a + GPU-equipped size (gpu > 0). + base_model: type: string default: null - description: Usage limits ID applied to this org member. + minLength: 1 + description: "Base model to fine-tune a fresh adapter from. Must be one\ + \ of the platform's supported models (see SUPPORTED_MODELS allow-list).\ + \ Provide EITHER this OR ``source_checkpoint_artifact_id`` (exactly one).\ + \ Omit when continuing from a checkpoint \u2014 the base_model is then\ + \ derived from the checkpoint's metadata." + nullable: true + source_checkpoint_artifact_id: + type: string + default: null + minLength: 1 + description: Artifact id of an existing checkpoint to continue-train. Must + be a ``kind=checkpoint`` Artifact with ``status=ready`` belonging to the + same org as the requester. When set, training continues the SAME LoRA + adapter on the new dataset (weight-init continuation), and ``base_model`` + is derived from the checkpoint's metadata. Provide EITHER this OR ``base_model`` + (exactly one). nullable: true required: - - user_id - UserDetailed: + - dataset_id + - hyperparameters + - instance_size + - name + FineTuneJobView: type: object properties: id: type: string readOnly: true - description: ID of the user. - avatar_url: + description: Fine-tune job ID (same as the underlying deployment ID). + name: type: string - format: url readOnly: true - description: Avatar URL of the user. - username: + status: type: string readOnly: true - description: Name of the user. + description: "Underlying Saturn job status: pending, running, stopping,\ + \ stopped, completed, or error. Same vocabulary as the rest of the platform\ + \ \u2014 TF intentionally does not translate to a product-specific set." created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - full_name: + started_at: type: string + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Full name of the user. - email: + nullable: true + finished_at: type: string - format: email + format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Email of the user. - admin: - type: boolean + nullable: true + base_model: + type: string readOnly: true - description: Enable user to take privileged actions in the API. - locked: - type: boolean + hyperparameters: readOnly: true - description: Lock the user. - locked_reason: + allOf: + - $ref: '#/components/schemas/Hyperparameters' + dataset_id: type: string readOnly: true - description: Reason the user is locked. - is_multiple_ssh_keys: - type: boolean + output_location: + type: string readOnly: true - description: Enable multiple SSH keys. - active: - type: boolean + description: 'Structured location of the job''s RW output folder: sf://.' + latest_checkpoint: readOnly: true - description: True if user is active. + description: "Most recently-registered usable (``status=ready``) checkpoint\ + \ artifact (kind=checkpoint) whose ``producer.id`` matches this job's\ + \ deployment id. Null if no ready checkpoint exists \u2014 the job may\ + \ still be running, may have failed, or may have registered an error artifact\ + \ (``status=error``) which is deliberately NOT surfaced here. To diagnose\ + \ failures, read the job's training logs; the shim tees axolotl output\ + \ to ``/training.log``. Named ``latest_checkpoint`` rather\ + \ than ``checkpoint`` to leave room for future API surface exposing intermediate\ + \ per-epoch checkpoints (axolotl writes ``checkpoint-N/`` subdirs to NFS\ + \ during training, but those are not registered as separate Artifact rows\ + \ today). Only returned by the single-GET endpoint; list responses use\ + \ ``FineTuneJobSummary`` which omits this field." + allOf: + - $ref: '#/components/schemas/Artifact' + nullable: true required: - - active - - admin - - avatar_url + - base_model - created_at - - email - - full_name + - dataset_id + - finished_at + - hyperparameters - id - - is_multiple_ssh_keys - - locked - - locked_reason - - username - OwnerUserDetailed: + - latest_checkpoint + - name + - output_location + - started_at + - status + InferenceEndpointSummary: type: object properties: id: type: string readOnly: true - description: ID of the owner + description: Inference endpoint ID (same as the underlying deployment ID). name: type: string readOnly: true - description: 'Name of the owner (format: ''/'')' - identity_name: - type: string - readOnly: true - description: Name of the owner's identity - org_name: + status: type: string readOnly: true - description: Name of the org the owner belongs to. + description: 'Underlying Saturn deployment status: pending, running, stopping, + stopped, or error.' created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - org_admin: - type: boolean - readOnly: true - description: Enable the owner to take privileged actions on its org. - org_id: + base_model: type: string readOnly: true - description: Org ID the owner belongs to. - user_id: + description: HuggingFace base model id derived from the checkpoint Artifact's + ``metadata.base_model`` at create time. + checkpoint_artifact_id: type: string readOnly: true - description: User ID of the owner. - identity_type: - readOnly: true - description: Typo of the owner's identity (user or group). - $ref: '#/components/schemas/IdentityType' - avatar_url: + description: Artifact id of the checkpoint this endpoint is serving. + instance_size: type: string readOnly: true - description: Avatar URL of the owner's identity. - limits_id: + endpoint_url: type: string readOnly: true - description: Usage limits ID applied to the owner. - nullable: true - org: - readOnly: true - description: Org that the owner belongs to. - allOf: - - $ref: '#/components/schemas/Org' - user: - readOnly: true - description: Usser identity of the owner. - allOf: - - $ref: '#/components/schemas/UserDetailed' - limits: - readOnly: true - description: Usage limits applied to the owner. - allOf: - - $ref: '#/components/schemas/UsageLimits' - nullable: true + description: "Public URL clients POST OpenAI-compatible inference requests\ + \ to. Uses the deployment's auto-generated subdomain. Returns the URL\ + \ regardless of running state \u2014 clients can stash it; calls fail\ + \ while the endpoint is stopped." required: - - avatar_url + - base_model + - checkpoint_artifact_id - created_at + - endpoint_url - id - - identity_name - - identity_type + - instance_size - name - - org - - org_admin - - org_id - - org_name - - user - - user_id - OrgMemberUpdate: - type: object - properties: - org_admin: - type: boolean - description: Enable user to take privileged actions on the org. - limits_id: - type: string - default: null - description: Usage limits ID applied to this org member. (Admin only) - nullable: true - OwnerList: + - status + InferenceEndpointList: type: object properties: - owners: + endpoints: type: array readOnly: true - description: List of owners. + description: "List of inference endpoints (``InferenceEndpointSummary``\ + \ projections \u2014 without ``checkpoint``; fetch the by-id endpoint\ + \ for that)." items: - $ref: '#/components/schemas/Owner' + $ref: '#/components/schemas/InferenceEndpointSummary' prev_key: type: string readOnly: true @@ -14502,115 +16466,113 @@ components: readOnly: true description: Next page key. required: - - owners - OwnerDetailed: + - endpoints + InferenceEndpointCreate: + type: object + properties: + name: + type: string + minLength: 1 + description: Human-readable name for the inference endpoint. + checkpoint_artifact_id: + type: string + minLength: 1 + description: Artifact id of the checkpoint to serve. Must be a ``kind=checkpoint`` + Artifact with ``status=ready`` belonging to the same org as the requester. + instance_size: + type: string + minLength: 1 + description: Saturn instance size to run the inference pod on. Must be a + GPU-equipped size (gpu > 0). + quantization: + type: string + default: null + enum: + - fp8 + - int8 + - null + description: "Optional vLLM quantization method. Restricted to calibration-free\ + \ methods (``fp8``, ``int8``) \u2014 these quantize on the fly with no\ + \ calibration dataset. Calibration-requiring methods (gptq, awq) are rejected.\ + \ Omit (the default) to serve in the checkpoint's native precision (BF16)." + nullable: true + visibility: + type: string + default: org + enum: + - org + - owner + description: 'Route visibility enforced by ForwardAuth: ``org`` (any member + of the endpoint''s org may call it) or ``owner`` (only the owning identity + and explicit ``viewers``). Defaults to ``org``.' + viewers: + type: array + description: Optional list of identity names (usernames or group names in + the endpoint's org) granted access to the endpoint route in addition to + the owner. Honored by ForwardAuth exactly like a normal deployment's viewers. + items: + type: string + minLength: 1 + required: + - checkpoint_artifact_id + - instance_size + - name + InferenceEndpointView: type: object properties: id: type: string readOnly: true - description: ID of the owner + description: Inference endpoint ID (same as the underlying deployment ID). name: type: string readOnly: true - description: 'Name of the owner (format: ''/'')' - identity_name: - type: string - readOnly: true - description: Name of the owner's identity - org_name: + status: type: string readOnly: true - description: Name of the org the owner belongs to. + description: 'Underlying Saturn deployment status: pending, running, stopping, + stopped, or error.' created_at: type: string format: '%Y-%m-%dT%H:%M:%S+00:00' readOnly: true - description: Creation timestamp. - org_admin: - type: boolean - readOnly: true - description: Enable the owner to take privileged actions on its org. - org_id: - type: string - readOnly: true - description: Org ID the owner belongs to. - user_id: + base_model: type: string readOnly: true - description: User ID of the owner. - nullable: true - group_id: + description: HuggingFace base model id derived from the checkpoint Artifact's + ``metadata.base_model`` at create time. + checkpoint_artifact_id: type: string readOnly: true - description: Group ID of the owner. - nullable: true - identity_type: - readOnly: true - description: Typo of the owner's identity (user or group). - $ref: '#/components/schemas/IdentityType' - avatar_url: + description: Artifact id of the checkpoint this endpoint is serving. + instance_size: type: string readOnly: true - description: Avatar URL of the owner's identity. - limits_id: + endpoint_url: type: string readOnly: true - description: Usage limits ID applied to the owner. - nullable: true - org: - readOnly: true - description: Org that the owner belongs to. - allOf: - - $ref: '#/components/schemas/Org' - user: - readOnly: true - description: User identity of the owner. - allOf: - - $ref: '#/components/schemas/UserDetailed' - nullable: true - group: - readOnly: true - description: Group identity of the owner. - allOf: - - $ref: '#/components/schemas/Group' - nullable: true - limits: + description: "Public URL clients POST OpenAI-compatible inference requests\ + \ to. Uses the deployment's auto-generated subdomain. Returns the URL\ + \ regardless of running state \u2014 clients can stash it; calls fail\ + \ while the endpoint is stopped." + checkpoint: readOnly: true - description: Usage limits applied to the owner. + description: Resolved checkpoint Artifact. Null only if the artifact was + deleted out from under the endpoint (we block that path; the field is + nullable defensively). allOf: - - $ref: '#/components/schemas/UsageLimits' + - $ref: '#/components/schemas/Artifact' nullable: true required: - - avatar_url + - base_model + - checkpoint + - checkpoint_artifact_id - created_at + - endpoint_url - id - - identity_name - - identity_type + - instance_size - name - - org - - org_admin - - org_id - - org_name - OwnerDetailedList: - type: object - properties: - owners: - type: array - readOnly: true - description: List of detailed owners. - items: - $ref: '#/components/schemas/OwnerDetailed' - prev_key: - type: string - readOnly: true - description: Previous page key. - next_key: - type: string - readOnly: true - description: Next page key. - required: - - owners + - status AggregatedUsage: type: object properties: @@ -15588,6 +17550,14 @@ components: allOf: - $ref: '#/components/schemas/ExtraPackages' nullable: true + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true start_script: type: string default: null @@ -15682,6 +17652,14 @@ components: allOf: - $ref: '#/components/schemas/ExtraPackages' nullable: true + config_files: + type: object + default: null + description: User-defined config files written to $HOME at pod startup. + Keys are relative paths; values contain content and mode. + additionalProperties: + $ref: '#/components/schemas/ConfigFileEntry' + nullable: true start_script: type: string default: null @@ -15822,9 +17800,9 @@ components: disk_space: type: array readOnly: true - description: List of available disk space sizes. + description: Available disk space sizes. items: - type: string + $ref: '#/components/schemas/DiskSpaceOption' size: type: array readOnly: true diff --git a/docs/AppInfo.md b/docs/AppInfo.md index ecc128a..d4d09c6 100644 --- a/docs/AppInfo.md +++ b/docs/AppInfo.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **git_repo_clone_dir** | **str** | Default directory to clone git repositories into. | **app_serving_domain** | **str** | Root domain for deployment and workspace URLs. | **dind_enabled** | **bool** | True if docker-in-docker is enabled. | +**token_factory_enabled_global** | **bool** | Install-wide Token Factory switch (the global Settings flag). Per-org enablement is narrowed client-side against the active owner's usage-limit flag. | **apply_requires_confirm** | **bool** | True if recipe apply should be confirmed. | **hide_invitations** | **bool** | True if invitations are hidden in frontend. | **populate_examples** | **bool** | True if saturn examples are included. | diff --git a/docs/Artifact.md b/docs/Artifact.md new file mode 100644 index 0000000..b8ea539 --- /dev/null +++ b/docs/Artifact.md @@ -0,0 +1,37 @@ +# Artifact + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Artifact identifier. | [readonly] +**org_id** | **str** | Owning organisation ID. | [readonly] +**name** | **str** | Human-readable artifact name. | [readonly] +**kind** | [**ArtifactKind**](ArtifactKind.md) | | +**location** | **str** | Storage location (NFS path or object storage URI). | [readonly] +**producer** | **Dict[str, object]** | JSONB snapshot of the producer resource: {id, kind, name}. Null if artifact was uploaded directly. | [readonly] +**metadata** | **Dict[str, object]** | Arbitrary metadata blob. | [readonly] +**created_at** | **str** | Creation timestamp (UTC). | [readonly] +**status** | [**ArtifactStatus**](ArtifactStatus.md) | | + +## Example + +```python +from saturn_api.models.artifact import Artifact + +# TODO update the JSON string below +json = "{}" +# create an instance of Artifact from a JSON string +artifact_instance = Artifact.from_json(json) +# print the JSON string representation of the object +print(Artifact.to_json()) + +# convert the object into a dict +artifact_dict = artifact_instance.to_dict() +# create an instance of Artifact from a dict +artifact_from_dict = Artifact.from_dict(artifact_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/docs/ArtifactCreate.md b/docs/ArtifactCreate.md new file mode 100644 index 0000000..7b6dba9 --- /dev/null +++ b/docs/ArtifactCreate.md @@ -0,0 +1,34 @@ +# ArtifactCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the artifact. | +**kind** | [**ArtifactKind**](ArtifactKind.md) | | [optional] +**location** | **str** | Storage location (NFS path or object storage URI). | +**status** | [**ArtifactStatus**](ArtifactStatus.md) | | [optional] +**producer** | **Dict[str, object]** | JSONB snapshot of the Saturn resource that produced this artifact. Shape: {id, kind, name}. Null if uploaded directly. | [optional] +**metadata** | **Dict[str, object]** | Arbitrary metadata blob: schema_type, row_count, base_model, epoch, metrics, etc. | [optional] + +## Example + +```python +from saturn_api.models.artifact_create import ArtifactCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactCreate from a JSON string +artifact_create_instance = ArtifactCreate.from_json(json) +# print the JSON string representation of the object +print(ArtifactCreate.to_json()) + +# convert the object into a dict +artifact_create_dict = artifact_create_instance.to_dict() +# create an instance of ArtifactCreate from a dict +artifact_create_from_dict = ArtifactCreate.from_dict(artifact_create_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/docs/ArtifactKind.md b/docs/ArtifactKind.md new file mode 100644 index 0000000..a2d68dd --- /dev/null +++ b/docs/ArtifactKind.md @@ -0,0 +1,14 @@ +# ArtifactKind + + +## Enum + +* `DATASET` (value: `'dataset'`) + +* `CHECKPOINT` (value: `'checkpoint'`) + +* `MODEL_MINUS_WEIGHTS` (value: `'model-weights'`) + +[[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/docs/ArtifactList.md b/docs/ArtifactList.md new file mode 100644 index 0000000..ec6cc22 --- /dev/null +++ b/docs/ArtifactList.md @@ -0,0 +1,31 @@ +# ArtifactList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artifacts** | [**List[Artifact]**](Artifact.md) | List of artifacts. | [readonly] +**prev_key** | **str** | Previous page key. | [optional] [readonly] +**next_key** | **str** | Next page key. | [optional] [readonly] + +## Example + +```python +from saturn_api.models.artifact_list import ArtifactList + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactList from a JSON string +artifact_list_instance = ArtifactList.from_json(json) +# print the JSON string representation of the object +print(ArtifactList.to_json()) + +# convert the object into a dict +artifact_list_dict = artifact_list_instance.to_dict() +# create an instance of ArtifactList from a dict +artifact_list_from_dict = ArtifactList.from_dict(artifact_list_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/docs/ArtifactStatus.md b/docs/ArtifactStatus.md new file mode 100644 index 0000000..842cb8e --- /dev/null +++ b/docs/ArtifactStatus.md @@ -0,0 +1,18 @@ +# ArtifactStatus + + +## Enum + +* `ASSEMBLING` (value: `'assembling'`) + +* `PENDING` (value: `'pending'`) + +* `READY` (value: `'ready'`) + +* `ERROR` (value: `'error'`) + +* `DELETED` (value: `'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/docs/ArtifactUpdate.md b/docs/ArtifactUpdate.md new file mode 100644 index 0000000..8d8882b --- /dev/null +++ b/docs/ArtifactUpdate.md @@ -0,0 +1,30 @@ +# ArtifactUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**ArtifactStatus**](ArtifactStatus.md) | | [optional] +**metadata** | **Dict[str, object]** | Updated metadata blob. | [optional] + +## Example + +```python +from saturn_api.models.artifact_update import ArtifactUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactUpdate from a JSON string +artifact_update_instance = ArtifactUpdate.from_json(json) +# print the JSON string representation of the object +print(ArtifactUpdate.to_json()) + +# convert the object into a dict +artifact_update_dict = artifact_update_instance.to_dict() +# create an instance of ArtifactUpdate from a dict +artifact_update_from_dict = ArtifactUpdate.from_dict(artifact_update_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/docs/ArtifactsApi.md b/docs/ArtifactsApi.md new file mode 100644 index 0000000..62e5fb8 --- /dev/null +++ b/docs/ArtifactsApi.md @@ -0,0 +1,423 @@ +# saturn_api.ArtifactsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](ArtifactsApi.md#create) | **POST** /api/orgs/{org_id}/artifacts | Create artifact +[**delete**](ArtifactsApi.md#delete) | **DELETE** /api/orgs/{org_id}/artifacts/{artifact_id} | Delete artifact +[**get**](ArtifactsApi.md#get) | **GET** /api/orgs/{org_id}/artifacts/{artifact_id} | Get artifact +[**list**](ArtifactsApi.md#list) | **GET** /api/orgs/{org_id}/artifacts | List artifacts +[**update**](ArtifactsApi.md#update) | **PATCH** /api/orgs/{org_id}/artifacts/{artifact_id} | Update artifact + + +# **create** +> Artifact create(org_id, artifact_create) + +Create artifact + +Create a new artifact. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.artifact import Artifact +from saturn_api.models.artifact_create import ArtifactCreate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ArtifactsApi(api_client) + org_id = 'org_id_example' # str | + artifact_create = saturn_api.ArtifactCreate() # ArtifactCreate | + + try: + # Create artifact + api_response = await api_instance.create(org_id, artifact_create) + print("The response of ArtifactsApi->create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ArtifactsApi->create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **artifact_create** | [**ArtifactCreate**](ArtifactCreate.md)| | + +### Return type + +[**Artifact**](Artifact.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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** +> delete(org_id, artifact_id) + +Delete artifact + +Delete an artifact. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ArtifactsApi(api_client) + org_id = 'org_id_example' # str | + artifact_id = 'artifact_id_example' # str | + + try: + # Delete artifact + await api_instance.delete(org_id, artifact_id) + except Exception as e: + print("Exception when calling ArtifactsApi->delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **artifact_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Deleted | - | + +[[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** +> Artifact get(org_id, artifact_id) + +Get artifact + +Get an artifact. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.artifact import Artifact +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ArtifactsApi(api_client) + org_id = 'org_id_example' # str | + artifact_id = 'artifact_id_example' # str | + + try: + # Get artifact + api_response = await api_instance.get(org_id, artifact_id) + print("The response of ArtifactsApi->get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ArtifactsApi->get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **artifact_id** | **str**| | + +### Return type + +[**Artifact**](Artifact.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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** +> ArtifactList list(org_id, kind=kind, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + +List artifacts + +Paginated list of artifacts. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_list import ArtifactList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ArtifactsApi(api_client) + org_id = 'org_id_example' # str | + kind = saturn_api.ArtifactKind() # ArtifactKind | Filter artifacts by kind. (optional) + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Page size. (optional) (default to 100) + descending = False # bool | List results in descending order. (optional) (default to False) + + try: + # List artifacts + api_response = await api_instance.list(org_id, kind=kind, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + print("The response of ArtifactsApi->list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ArtifactsApi->list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **kind** | [**ArtifactKind**](.md)| Filter artifacts by kind. | [optional] + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Page size. | [optional] [default to 100] + **descending** | **bool**| List results in descending order. | [optional] [default to False] + +### Return type + +[**ArtifactList**](ArtifactList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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) + +# **update** +> Artifact update(org_id, artifact_id, artifact_update) + +Update artifact + +Update an artifact. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.artifact import Artifact +from saturn_api.models.artifact_update import ArtifactUpdate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ArtifactsApi(api_client) + org_id = 'org_id_example' # str | + artifact_id = 'artifact_id_example' # str | + artifact_update = saturn_api.ArtifactUpdate() # ArtifactUpdate | + + try: + # Update artifact + api_response = await api_instance.update(org_id, artifact_id, artifact_update) + print("The response of ArtifactsApi->update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ArtifactsApi->update: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **artifact_id** | **str**| | + **artifact_update** | [**ArtifactUpdate**](ArtifactUpdate.md)| | + +### Return type + +[**Artifact**](Artifact.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Updated | - | + +[[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/docs/Cluster.md b/docs/Cluster.md new file mode 100644 index 0000000..850e8cc --- /dev/null +++ b/docs/Cluster.md @@ -0,0 +1,36 @@ +# Cluster + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Cluster ID. | [readonly] +**name** | **str** | Cluster name. | [readonly] +**org_id** | **str** | Owning org ID. | [readonly] +**connection_type** | [**ClusterConnectionType**](ClusterConnectionType.md) | | +**server_url** | **str** | K8s API server URL. | [optional] [readonly] +**utilities** | **Dict[str, object]** | ClusterUtilities metadata. | [optional] [readonly] +**created_at** | **str** | Creation timestamp. | [readonly] +**updated_at** | **str** | Last update timestamp. | [readonly] + +## Example + +```python +from saturn_api.models.cluster import Cluster + +# TODO update the JSON string below +json = "{}" +# create an instance of Cluster from a JSON string +cluster_instance = Cluster.from_json(json) +# print the JSON string representation of the object +print(Cluster.to_json()) + +# convert the object into a dict +cluster_dict = cluster_instance.to_dict() +# create an instance of Cluster from a dict +cluster_from_dict = Cluster.from_dict(cluster_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/docs/ClusterConnectionType.md b/docs/ClusterConnectionType.md new file mode 100644 index 0000000..d84ea9d --- /dev/null +++ b/docs/ClusterConnectionType.md @@ -0,0 +1,12 @@ +# ClusterConnectionType + + +## Enum + +* `INCLUSTER` (value: `'incluster'`) + +* `TOKEN` (value: `'token'`) + +[[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/docs/ClusterCreate.md b/docs/ClusterCreate.md new file mode 100644 index 0000000..05daa61 --- /dev/null +++ b/docs/ClusterCreate.md @@ -0,0 +1,35 @@ +# ClusterCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Unique name of the cluster. | +**org_id** | **str** | ID of the org that owns the cluster. | +**connection_type** | [**ClusterConnectionType**](ClusterConnectionType.md) | | +**server_url** | **str** | K8s API server URL. Required when connection_type is 'token'. | [optional] +**ca_bundle** | **str** | Base64-encoded CA bundle. Required when connection_type is 'token'. | [optional] +**token** | **str** | Bearer token for k8s API. Required when connection_type is 'token'. | [optional] +**utilities** | **Dict[str, object]** | ClusterUtilities metadata (service endpoints). | [optional] + +## Example + +```python +from saturn_api.models.cluster_create import ClusterCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ClusterCreate from a JSON string +cluster_create_instance = ClusterCreate.from_json(json) +# print the JSON string representation of the object +print(ClusterCreate.to_json()) + +# convert the object into a dict +cluster_create_dict = cluster_create_instance.to_dict() +# create an instance of ClusterCreate from a dict +cluster_create_from_dict = ClusterCreate.from_dict(cluster_create_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/docs/ClusterList.md b/docs/ClusterList.md new file mode 100644 index 0000000..cdc33aa --- /dev/null +++ b/docs/ClusterList.md @@ -0,0 +1,31 @@ +# ClusterList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clusters** | [**List[Cluster]**](Cluster.md) | List of clusters. | [readonly] +**prev_key** | **str** | Previous page key. | [optional] [readonly] +**next_key** | **str** | Next page key. | [optional] [readonly] + +## Example + +```python +from saturn_api.models.cluster_list import ClusterList + +# TODO update the JSON string below +json = "{}" +# create an instance of ClusterList from a JSON string +cluster_list_instance = ClusterList.from_json(json) +# print the JSON string representation of the object +print(ClusterList.to_json()) + +# convert the object into a dict +cluster_list_dict = cluster_list_instance.to_dict() +# create an instance of ClusterList from a dict +cluster_list_from_dict = ClusterList.from_dict(cluster_list_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/docs/ClusterUpdate.md b/docs/ClusterUpdate.md new file mode 100644 index 0000000..5e0bc2e --- /dev/null +++ b/docs/ClusterUpdate.md @@ -0,0 +1,33 @@ +# ClusterUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_type** | [**ClusterConnectionType**](ClusterConnectionType.md) | | [optional] +**server_url** | **str** | K8s API server URL. | [optional] +**ca_bundle** | **str** | Base64-encoded CA bundle. | [optional] +**token** | **str** | Bearer token. | [optional] +**utilities** | **Dict[str, object]** | ClusterUtilities metadata. | [optional] + +## Example + +```python +from saturn_api.models.cluster_update import ClusterUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ClusterUpdate from a JSON string +cluster_update_instance = ClusterUpdate.from_json(json) +# print the JSON string representation of the object +print(ClusterUpdate.to_json()) + +# convert the object into a dict +cluster_update_dict = cluster_update_instance.to_dict() +# create an instance of ClusterUpdate from a dict +cluster_update_from_dict = ClusterUpdate.from_dict(cluster_update_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/docs/ClustersApi.md b/docs/ClustersApi.md new file mode 100644 index 0000000..3c8f113 --- /dev/null +++ b/docs/ClustersApi.md @@ -0,0 +1,414 @@ +# saturn_api.ClustersApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](ClustersApi.md#create) | **POST** /api/clusters | Create cluster +[**delete**](ClustersApi.md#delete) | **DELETE** /api/clusters/{cluster_id} | Delete cluster +[**get**](ClustersApi.md#get) | **GET** /api/clusters/{cluster_id} | Get cluster +[**list**](ClustersApi.md#list) | **GET** /api/clusters | List clusters +[**update**](ClustersApi.md#update) | **PATCH** /api/clusters/{cluster_id} | Update cluster + + +# **create** +> Cluster create(cluster_create) + +Create cluster + +Create a new cluster. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.cluster import Cluster +from saturn_api.models.cluster_create import ClusterCreate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ClustersApi(api_client) + cluster_create = saturn_api.ClusterCreate() # ClusterCreate | + + try: + # Create cluster + api_response = await api_instance.create(cluster_create) + print("The response of ClustersApi->create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClustersApi->create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cluster_create** | [**ClusterCreate**](ClusterCreate.md)| | + +### Return type + +[**Cluster**](Cluster.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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** +> delete(cluster_id) + +Delete cluster + +Delete a cluster. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ClustersApi(api_client) + cluster_id = 'cluster_id_example' # str | + + try: + # Delete cluster + await api_instance.delete(cluster_id) + except Exception as e: + print("Exception when calling ClustersApi->delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cluster_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Deleted | - | + +[[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** +> Cluster get(cluster_id) + +Get cluster + +Get a cluster. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.cluster import Cluster +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ClustersApi(api_client) + cluster_id = 'cluster_id_example' # str | + + try: + # Get cluster + api_response = await api_instance.get(cluster_id) + print("The response of ClustersApi->get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClustersApi->get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cluster_id** | **str**| | + +### Return type + +[**Cluster**](Cluster.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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** +> ClusterList list(org_id=org_id, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + +List clusters + +Paginated list of clusters. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.cluster_list import ClusterList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ClustersApi(api_client) + org_id = 'org_id_example' # str | Filter clusters by org ID. (optional) + name = 'name_example' # str | Substring search on cluster name. (optional) + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Page size. (optional) (default to 100) + descending = False # bool | List results in descending order. (optional) (default to False) + + try: + # List clusters + api_response = await api_instance.list(org_id=org_id, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + print("The response of ClustersApi->list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClustersApi->list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| Filter clusters by org ID. | [optional] + **name** | **str**| Substring search on cluster name. | [optional] + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Page size. | [optional] [default to 100] + **descending** | **bool**| List results in descending order. | [optional] [default to False] + +### Return type + +[**ClusterList**](ClusterList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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) + +# **update** +> Cluster update(cluster_id, cluster_update) + +Update cluster + +Update a cluster. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.cluster import Cluster +from saturn_api.models.cluster_update import ClusterUpdate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.ClustersApi(api_client) + cluster_id = 'cluster_id_example' # str | + cluster_update = saturn_api.ClusterUpdate() # ClusterUpdate | + + try: + # Update cluster + api_response = await api_instance.update(cluster_id, cluster_update) + print("The response of ClustersApi->update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClustersApi->update: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cluster_id** | **str**| | + **cluster_update** | [**ClusterUpdate**](ClusterUpdate.md)| | + +### Return type + +[**Cluster**](Cluster.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Updated | - | + +[[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/docs/ConfigFileEntry.md b/docs/ConfigFileEntry.md new file mode 100644 index 0000000..e8d4a99 --- /dev/null +++ b/docs/ConfigFileEntry.md @@ -0,0 +1,30 @@ +# ConfigFileEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **str** | Content of the config file. | +**mode** | **str** | File mode as a 4-character octal string, e.g. '0644'. | [optional] [default to '0644'] + +## Example + +```python +from saturn_api.models.config_file_entry import ConfigFileEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ConfigFileEntry from a JSON string +config_file_entry_instance = ConfigFileEntry.from_json(json) +# print the JSON string representation of the object +print(ConfigFileEntry.to_json()) + +# convert the object into a dict +config_file_entry_dict = config_file_entry_instance.to_dict() +# create an instance of ConfigFileEntry from a dict +config_file_entry_from_dict = ConfigFileEntry.from_dict(config_file_entry_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/docs/CronSchedule.md b/docs/CronSchedule.md index 6bf4f0d..a5120d0 100644 --- a/docs/CronSchedule.md +++ b/docs/CronSchedule.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **schedule** | **str** | Cron schedule for triggering the job. | [readonly] **concurrency_policy** | **str** | Specifies how to treat concurrent executions of a job's cron schedule. | [readonly] -**backoff_limit** | **int** | Maximum number of retries for a failed job. | [readonly] ## Example diff --git a/docs/CronScheduleCreate.md b/docs/CronScheduleCreate.md index dbec5de..9cbbf6e 100644 --- a/docs/CronScheduleCreate.md +++ b/docs/CronScheduleCreate.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **schedule** | **str** | Cron schedule for triggering the job. | **concurrency_policy** | [**ConcurrencyPolicy**](ConcurrencyPolicy.md) | | [optional] -**backoff_limit** | **int** | Maximum number of retries for a failed job. | [optional] [default to 0] ## Example diff --git a/docs/CronScheduleUpdate.md b/docs/CronScheduleUpdate.md index 38790ae..c0be573 100644 --- a/docs/CronScheduleUpdate.md +++ b/docs/CronScheduleUpdate.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **schedule** | **str** | Cron schedule for triggering the job. | [optional] **concurrency_policy** | [**ConcurrencyPolicy**](ConcurrencyPolicy.md) | | [optional] -**backoff_limit** | **int** | Maximum number of retries for a failed job. | [optional] ## Example diff --git a/docs/CurrentUserApi.md b/docs/CurrentUserApi.md index aa33d07..7eec75a 100644 --- a/docs/CurrentUserApi.md +++ b/docs/CurrentUserApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**delete**](CurrentUserApi.md#delete) | **DELETE** /api/user | Delete current user [**get**](CurrentUserApi.md#get) | **GET** /api/user | Get current user [**get_aggregated_usage**](CurrentUserApi.md#get_aggregated_usage) | **GET** /api/user/usage/aggregated | Get aggregated usage [**get_preferences**](CurrentUserApi.md#get_preferences) | **GET** /api/user/preferences | Get current user preferences @@ -13,6 +14,75 @@ Method | HTTP request | Description [**update_preferences**](CurrentUserApi.md#update_preferences) | **PATCH** /api/user/preferences | Update current user preferences +# **delete** +> delete() + +Delete current user + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.CurrentUserApi(api_client) + + try: + # Delete current user + await api_instance.delete() + except Exception as e: + print("Exception when calling CurrentUserApi->delete: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Deleted | - | + +[[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** > UserDetailed get() diff --git a/docs/Dataset.md b/docs/Dataset.md new file mode 100644 index 0000000..8e748b9 --- /dev/null +++ b/docs/Dataset.md @@ -0,0 +1,36 @@ +# Dataset + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Dataset identifier. | [readonly] +**org_id** | **str** | Owning organisation ID. | [readonly] +**name** | **str** | Human-readable dataset name. | [readonly] +**kind** | [**ArtifactKind**](ArtifactKind.md) | | +**status** | [**ArtifactStatus**](ArtifactStatus.md) | | +**location** | **str** | Storage location URI (sf:<folder_id>/<path>). | [readonly] +**metadata** | **Dict[str, object]** | Arbitrary metadata blob (schema_type, row_count, etc.). | [readonly] +**created_at** | **str** | Creation timestamp (UTC). | [readonly] + +## Example + +```python +from saturn_api.models.dataset import Dataset + +# TODO update the JSON string below +json = "{}" +# create an instance of Dataset from a JSON string +dataset_instance = Dataset.from_json(json) +# print the JSON string representation of the object +print(Dataset.to_json()) + +# convert the object into a dict +dataset_dict = dataset_instance.to_dict() +# create an instance of Dataset from a dict +dataset_from_dict = Dataset.from_dict(dataset_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/docs/DatasetCreate.md b/docs/DatasetCreate.md new file mode 100644 index 0000000..725f9c2 --- /dev/null +++ b/docs/DatasetCreate.md @@ -0,0 +1,30 @@ +# DatasetCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the dataset. | +**metadata** | **Dict[str, object]** | Optional metadata blob: schema_type, description, row_count, format hints, etc. Platform treats dataset bytes as opaque — format details live here. | [optional] + +## Example + +```python +from saturn_api.models.dataset_create import DatasetCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetCreate from a JSON string +dataset_create_instance = DatasetCreate.from_json(json) +# print the JSON string representation of the object +print(DatasetCreate.to_json()) + +# convert the object into a dict +dataset_create_dict = dataset_create_instance.to_dict() +# create an instance of DatasetCreate from a dict +dataset_create_from_dict = DatasetCreate.from_dict(dataset_create_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/docs/DatasetImportCreate.md b/docs/DatasetImportCreate.md new file mode 100644 index 0000000..bc7dda0 --- /dev/null +++ b/docs/DatasetImportCreate.md @@ -0,0 +1,32 @@ +# DatasetImportCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the dataset. | +**hf_dataset_id** | **str** | Hugging Face dataset identifier, e.g. ``databricks/databricks-dolly-15k``. | +**split** | **str** | Hugging Face split to import (default: ``train``). | [optional] [default to 'train'] +**config_name** | **str** | Optional Hugging Face config/subset name. | [optional] + +## Example + +```python +from saturn_api.models.dataset_import_create import DatasetImportCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetImportCreate from a JSON string +dataset_import_create_instance = DatasetImportCreate.from_json(json) +# print the JSON string representation of the object +print(DatasetImportCreate.to_json()) + +# convert the object into a dict +dataset_import_create_dict = dataset_import_create_instance.to_dict() +# create an instance of DatasetImportCreate from a dict +dataset_import_create_from_dict = DatasetImportCreate.from_dict(dataset_import_create_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/docs/DatasetList.md b/docs/DatasetList.md new file mode 100644 index 0000000..adc3aa9 --- /dev/null +++ b/docs/DatasetList.md @@ -0,0 +1,31 @@ +# DatasetList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**datasets** | [**List[Dataset]**](Dataset.md) | List of datasets. | [readonly] +**prev_key** | **str** | Previous page key. | [optional] [readonly] +**next_key** | **str** | Next page key. | [optional] [readonly] + +## Example + +```python +from saturn_api.models.dataset_list import DatasetList + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetList from a JSON string +dataset_list_instance = DatasetList.from_json(json) +# print the JSON string representation of the object +print(DatasetList.to_json()) + +# convert the object into a dict +dataset_list_dict = dataset_list_instance.to_dict() +# create an instance of DatasetList from a dict +dataset_list_from_dict = DatasetList.from_dict(dataset_list_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/docs/DatasetLockCreate.md b/docs/DatasetLockCreate.md new file mode 100644 index 0000000..37f94c8 --- /dev/null +++ b/docs/DatasetLockCreate.md @@ -0,0 +1,32 @@ +# DatasetLockCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the dataset. | +**shared_folder_id** | **str** | ID of the existing SharedFolder to lock and register as a dataset. | +**subpath** | **str** | Optional subpath within the folder where the dataset bytes live (e.g. ``data.jsonl`` or ``subdir/``). Defaults to the folder root. | [optional] +**metadata** | **Dict[str, object]** | Optional metadata blob (schema_type, row_count, etc.). | [optional] + +## Example + +```python +from saturn_api.models.dataset_lock_create import DatasetLockCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetLockCreate from a JSON string +dataset_lock_create_instance = DatasetLockCreate.from_json(json) +# print the JSON string representation of the object +print(DatasetLockCreate.to_json()) + +# convert the object into a dict +dataset_lock_create_dict = dataset_lock_create_instance.to_dict() +# create an instance of DatasetLockCreate from a dict +dataset_lock_create_from_dict = DatasetLockCreate.from_dict(dataset_lock_create_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/docs/DatasetsApi.md b/docs/DatasetsApi.md new file mode 100644 index 0000000..7d9171a --- /dev/null +++ b/docs/DatasetsApi.md @@ -0,0 +1,586 @@ +# saturn_api.DatasetsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_import**](DatasetsApi.md#call_import) | **POST** /api/orgs/{org_id}/token-factory/datasets/import | Import dataset +[**create**](DatasetsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/datasets | Create dataset +[**delete**](DatasetsApi.md#delete) | **DELETE** /api/orgs/{org_id}/token-factory/datasets/{dataset_id} | Delete dataset +[**get**](DatasetsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/datasets/{dataset_id} | Get dataset +[**list**](DatasetsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/datasets | List datasets +[**lock**](DatasetsApi.md#lock) | **POST** /api/orgs/{org_id}/token-factory/datasets/lock | Lock shared folder as dataset +[**seal**](DatasetsApi.md#seal) | **POST** /api/orgs/{org_id}/token-factory/datasets/{dataset_id}/seal | Seal dataset + + +# **call_import** +> Dataset call_import(org_id, dataset_import_create=dataset_import_create) + +Import dataset + +Create a dataset in `assembling` state and launch a CPU job that downloads the given Hugging Face dataset, auto-detects its shape, normalises it to the canonical conversational format, and writes it into the org's tf-datasets folder. The job marks the dataset `ready` on success or `error` if the source format is not recognised. + + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.dataset import Dataset +from saturn_api.models.dataset_import_create import DatasetImportCreate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_import_create = saturn_api.DatasetImportCreate() # DatasetImportCreate | (optional) + + try: + # Import dataset + api_response = await api_instance.call_import(org_id, dataset_import_create=dataset_import_create) + print("The response of DatasetsApi->call_import:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->call_import: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_import_create** | [**DatasetImportCreate**](DatasetImportCreate.md)| | [optional] + +### Return type + +[**Dataset**](Dataset.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Import started | - | + +[[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) + +# **create** +> Dataset create(org_id, dataset_create) + +Create dataset + +Create a new dataset. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.dataset import Dataset +from saturn_api.models.dataset_create import DatasetCreate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_create = saturn_api.DatasetCreate() # DatasetCreate | + + try: + # Create dataset + api_response = await api_instance.create(org_id, dataset_create) + print("The response of DatasetsApi->create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_create** | [**DatasetCreate**](DatasetCreate.md)| | + +### Return type + +[**Dataset**](Dataset.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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** +> delete(org_id, dataset_id) + +Delete dataset + +Delete a dataset. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_id = 'dataset_id_example' # str | + + try: + # Delete dataset + await api_instance.delete(org_id, dataset_id) + except Exception as e: + print("Exception when calling DatasetsApi->delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Deleted | - | + +[[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** +> Dataset get(org_id, dataset_id) + +Get dataset + +Get a dataset. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.dataset import Dataset +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_id = 'dataset_id_example' # str | + + try: + # Get dataset + api_response = await api_instance.get(org_id, dataset_id) + print("The response of DatasetsApi->get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_id** | **str**| | + +### Return type + +[**Dataset**](Dataset.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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** +> DatasetList list(org_id, status=status, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + +List datasets + +Paginated list of datasets. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.artifact_status import ArtifactStatus +from saturn_api.models.dataset_list import DatasetList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + status = saturn_api.ArtifactStatus() # ArtifactStatus | Filter datasets by status. (optional) + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Page size. (optional) (default to 100) + descending = False # bool | List results in descending order. (optional) (default to False) + + try: + # List datasets + api_response = await api_instance.list(org_id, status=status, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + print("The response of DatasetsApi->list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **status** | [**ArtifactStatus**](.md)| Filter datasets by status. | [optional] + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Page size. | [optional] [default to 100] + **descending** | **bool**| List results in descending order. | [optional] [default to False] + +### Return type + +[**DatasetList**](DatasetList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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) + +# **lock** +> Dataset lock(org_id, dataset_lock_create=dataset_lock_create) + +Lock shared folder as dataset + +Register an existing SharedFolder (that already holds dataset bytes) as a dataset, zero-copy, by locking it to ReadOnlyMany. No job runs and nothing is copied; the dataset is immediately `ready` and its location points at the existing folder. The folder becomes read-only. + + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.dataset import Dataset +from saturn_api.models.dataset_lock_create import DatasetLockCreate +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_lock_create = saturn_api.DatasetLockCreate() # DatasetLockCreate | (optional) + + try: + # Lock shared folder as dataset + api_response = await api_instance.lock(org_id, dataset_lock_create=dataset_lock_create) + print("The response of DatasetsApi->lock:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->lock: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_lock_create** | [**DatasetLockCreate**](DatasetLockCreate.md)| | [optional] + +### Return type + +[**Dataset**](Dataset.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Locked and registered | - | + +[[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) + +# **seal** +> Dataset seal(org_id, dataset_id) + +Seal dataset + +Transition a dataset from `assembling` to `ready`, making it immutable. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.dataset import Dataset +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.DatasetsApi(api_client) + org_id = 'org_id_example' # str | + dataset_id = 'dataset_id_example' # str | + + try: + # Seal dataset + api_response = await api_instance.seal(org_id, dataset_id) + print("The response of DatasetsApi->seal:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DatasetsApi->seal: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **dataset_id** | **str**| | + +### Return type + +[**Dataset**](Dataset.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Sealed | - | + +[[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/docs/Deployment.md b/docs/Deployment.md index 6281a1d..d300b6d 100644 --- a/docs/Deployment.md +++ b/docs/Deployment.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **instance_size** | **str** | Instance size of the deployment. | [readonly] **image_tag** | [**ImageTag**](ImageTag.md) | Image tag that is attached to the deployment. | [readonly] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [readonly] +**config_files** | **Dict[str, Dict[str, str]]** | User-defined config files written to $HOME at pod startup. | [optional] [readonly] **scale** | **int** | Number of pod replicas. | [readonly] **start_script** | **str** | Shell script that runs on start before the primary command. | [optional] [readonly] **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [readonly] diff --git a/docs/DeploymentCreate.md b/docs/DeploymentCreate.md index 40efe96..e62c08e 100644 --- a/docs/DeploymentCreate.md +++ b/docs/DeploymentCreate.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments for the deployment. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script to run on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory for the deployment. | [optional] [default to '/home/jovyan/workspace'] **is_spot** | **bool** | Enables running on spot instance sizes. | [optional] [default to False] diff --git a/docs/DeploymentSpec.md b/docs/DeploymentSpec.md index 0e05470..a1dc9cd 100644 --- a/docs/DeploymentSpec.md +++ b/docs/DeploymentSpec.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | | [optional] **working_directory** | **str** | | [optional] **extra_packages** | [**ExtraPackagesRecipe**](ExtraPackagesRecipe.md) | | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | | [optional] **start_script** | **str** | | [optional] **token_scope** | **str** | | [optional] **dask_cluster** | [**DaskClusterAttachment**](DaskClusterAttachment.md) | | [optional] diff --git a/docs/DeploymentUpdate.md b/docs/DeploymentUpdate.md index d8ba71c..51e6613 100644 --- a/docs/DeploymentUpdate.md +++ b/docs/DeploymentUpdate.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script that runs on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory. | [optional] **instance_size** | **str** | Instance size of the deployment. | [optional] diff --git a/docs/DeploymentsApi.md b/docs/DeploymentsApi.md index 2152c65..c15bddf 100644 --- a/docs/DeploymentsApi.md +++ b/docs/DeploymentsApi.md @@ -1845,7 +1845,7 @@ Name | Type | Description | Notes [[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** -> DeploymentList list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) +> DeploymentList list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) List deployments @@ -1887,7 +1887,8 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on deployment name. (optional) + name = 'name_example' # str | Substring matched search string on deployment name. (optional) + tags = 'tags_example' # str | Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -1895,7 +1896,7 @@ async with saturn_api.ApiClient(configuration) as api_client: try: # List deployments - api_response = await api_instance.list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + api_response = await api_instance.list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) print("The response of DeploymentsApi->list:\n") pprint(api_response) except Exception as e: @@ -1915,7 +1916,8 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on deployment name. | [optional] + **name** | **str**| Substring matched search string on deployment name. | [optional] + **tags** | **str**| Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] @@ -1980,7 +1982,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.DeploymentsApi(api_client) deployment_id = 'deployment_id_example' # str | - subdomain = 'subdomain_example' # str | Prefix matched search string on route subdomain. (optional) + subdomain = 'subdomain_example' # str | Substring matched search string on route subdomain. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -2003,7 +2005,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deployment_id** | **str**| | - **subdomain** | **str**| Prefix matched search string on route subdomain. | [optional] + **subdomain** | **str**| Substring matched search string on route subdomain. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] @@ -2067,7 +2069,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.DeploymentsApi(api_client) deployment_id = 'deployment_id_example' # str | - location = 'location_example' # str | Prefix matched search string on secret attachment location. (optional) + location = 'location_example' # str | Substring matched search string on secret attachment location. (optional) attachment_type = saturn_api.SecretAttachmentType() # SecretAttachmentType | Filter secret attachments by type. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -2091,7 +2093,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deployment_id** | **str**| | - **location** | **str**| Prefix matched search string on secret attachment location. | [optional] + **location** | **str**| Substring matched search string on secret attachment location. | [optional] **attachment_type** | [**SecretAttachmentType**](.md)| Filter secret attachments by type. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/DiskSpaceOption.md b/docs/DiskSpaceOption.md new file mode 100644 index 0000000..1480ee6 --- /dev/null +++ b/docs/DiskSpaceOption.md @@ -0,0 +1,30 @@ +# DiskSpaceOption + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Kubernetes-style disk size (e.g. '100Gi') submitted when creating a resource. | [readonly] +**display_str** | **str** | Human-readable label shown in the picker. | [readonly] + +## Example + +```python +from saturn_api.models.disk_space_option import DiskSpaceOption + +# TODO update the JSON string below +json = "{}" +# create an instance of DiskSpaceOption from a JSON string +disk_space_option_instance = DiskSpaceOption.from_json(json) +# print the JSON string representation of the object +print(DiskSpaceOption.to_json()) + +# convert the object into a dict +disk_space_option_dict = disk_space_option_instance.to_dict() +# create an instance of DiskSpaceOption from a dict +disk_space_option_from_dict = DiskSpaceOption.from_dict(disk_space_option_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/docs/ExternalReposApi.md b/docs/ExternalReposApi.md index de63ac4..33a620f 100644 --- a/docs/ExternalReposApi.md +++ b/docs/ExternalReposApi.md @@ -286,7 +286,7 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - remote_url = 'remote_url_example' # str | Prefix matched search string on repository remote URL. (optional) + remote_url = 'remote_url_example' # str | Substring matched search string on repository remote URL. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -314,7 +314,7 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **remote_url** | **str**| Prefix matched search string on repository remote URL. | [optional] + **remote_url** | **str**| Substring matched search string on repository remote URL. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] diff --git a/docs/FineTuneJobCreate.md b/docs/FineTuneJobCreate.md new file mode 100644 index 0000000..2ea2e00 --- /dev/null +++ b/docs/FineTuneJobCreate.md @@ -0,0 +1,34 @@ +# FineTuneJobCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the fine-tuning job. | +**dataset_id** | **str** | Identifier of a token-factory dataset artifact. The dataset must have status=READY and belong to the same org as the requester. | +**hyperparameters** | [**Hyperparameters1**](Hyperparameters1.md) | Training hyperparameters. | +**instance_size** | **str** | Saturn instance size to run the training pod on. Must be a GPU-equipped size (gpu > 0). | +**base_model** | **str** | Base model to fine-tune a fresh adapter from. Must be one of the platform's supported models (see SUPPORTED_MODELS allow-list). Provide EITHER this OR ``source_checkpoint_artifact_id`` (exactly one). Omit when continuing from a checkpoint — the base_model is then derived from the checkpoint's metadata. | [optional] +**source_checkpoint_artifact_id** | **str** | Artifact id of an existing checkpoint to continue-train. Must be a ``kind=checkpoint`` Artifact with ``status=ready`` belonging to the same org as the requester. When set, training continues the SAME LoRA adapter on the new dataset (weight-init continuation), and ``base_model`` is derived from the checkpoint's metadata. Provide EITHER this OR ``base_model`` (exactly one). | [optional] + +## Example + +```python +from saturn_api.models.fine_tune_job_create import FineTuneJobCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of FineTuneJobCreate from a JSON string +fine_tune_job_create_instance = FineTuneJobCreate.from_json(json) +# print the JSON string representation of the object +print(FineTuneJobCreate.to_json()) + +# convert the object into a dict +fine_tune_job_create_dict = fine_tune_job_create_instance.to_dict() +# create an instance of FineTuneJobCreate from a dict +fine_tune_job_create_from_dict = FineTuneJobCreate.from_dict(fine_tune_job_create_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/docs/FineTuneJobList.md b/docs/FineTuneJobList.md new file mode 100644 index 0000000..de2b721 --- /dev/null +++ b/docs/FineTuneJobList.md @@ -0,0 +1,31 @@ +# FineTuneJobList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**jobs** | [**List[FineTuneJobSummary]**](FineTuneJobSummary.md) | List of fine-tuning jobs (``FineTuneJobSummary`` projections — without ``latest_checkpoint``; fetch the by-id endpoint for that). | [readonly] +**prev_key** | **str** | Previous page key. | [optional] [readonly] +**next_key** | **str** | Next page key. | [optional] [readonly] + +## Example + +```python +from saturn_api.models.fine_tune_job_list import FineTuneJobList + +# TODO update the JSON string below +json = "{}" +# create an instance of FineTuneJobList from a JSON string +fine_tune_job_list_instance = FineTuneJobList.from_json(json) +# print the JSON string representation of the object +print(FineTuneJobList.to_json()) + +# convert the object into a dict +fine_tune_job_list_dict = fine_tune_job_list_instance.to_dict() +# create an instance of FineTuneJobList from a dict +fine_tune_job_list_from_dict = FineTuneJobList.from_dict(fine_tune_job_list_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/docs/FineTuneJobSummary.md b/docs/FineTuneJobSummary.md new file mode 100644 index 0000000..d00351d --- /dev/null +++ b/docs/FineTuneJobSummary.md @@ -0,0 +1,36 @@ +# FineTuneJobSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Fine-tune job ID (same as the underlying deployment ID). | [readonly] +**name** | **str** | | [readonly] +**status** | **str** | Underlying Saturn job status: pending, running, stopping, stopped, completed, or error. Same vocabulary as the rest of the platform — TF intentionally does not translate to a product-specific set. | [readonly] +**created_at** | **str** | | [readonly] +**started_at** | **str** | | [readonly] +**finished_at** | **str** | | [readonly] +**base_model** | **str** | | [readonly] +**hyperparameters** | [**Hyperparameters**](Hyperparameters.md) | | [readonly] + +## Example + +```python +from saturn_api.models.fine_tune_job_summary import FineTuneJobSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of FineTuneJobSummary from a JSON string +fine_tune_job_summary_instance = FineTuneJobSummary.from_json(json) +# print the JSON string representation of the object +print(FineTuneJobSummary.to_json()) + +# convert the object into a dict +fine_tune_job_summary_dict = fine_tune_job_summary_instance.to_dict() +# create an instance of FineTuneJobSummary from a dict +fine_tune_job_summary_from_dict = FineTuneJobSummary.from_dict(fine_tune_job_summary_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/docs/FineTuneJobView.md b/docs/FineTuneJobView.md new file mode 100644 index 0000000..99fee3a --- /dev/null +++ b/docs/FineTuneJobView.md @@ -0,0 +1,39 @@ +# FineTuneJobView + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Fine-tune job ID (same as the underlying deployment ID). | [readonly] +**name** | **str** | | [readonly] +**status** | **str** | Underlying Saturn job status: pending, running, stopping, stopped, completed, or error. Same vocabulary as the rest of the platform — TF intentionally does not translate to a product-specific set. | [readonly] +**created_at** | **str** | | [readonly] +**started_at** | **str** | | [readonly] +**finished_at** | **str** | | [readonly] +**base_model** | **str** | | [readonly] +**hyperparameters** | [**Hyperparameters**](Hyperparameters.md) | | [readonly] +**dataset_id** | **str** | | [readonly] +**output_location** | **str** | Structured location of the job's RW output folder: sf:<tf-jobs-folder-id>/<job-id>/. | [readonly] +**latest_checkpoint** | [**Artifact**](Artifact.md) | Most recently-registered usable (``status=ready``) checkpoint artifact (kind=checkpoint) whose ``producer.id`` matches this job's deployment id. Null if no ready checkpoint exists — the job may still be running, may have failed, or may have registered an error artifact (``status=error``) which is deliberately NOT surfaced here. To diagnose failures, read the job's training logs; the shim tees axolotl output to ``<output_dir>/training.log``. Named ``latest_checkpoint`` rather than ``checkpoint`` to leave room for future API surface exposing intermediate per-epoch checkpoints (axolotl writes ``checkpoint-N/`` subdirs to NFS during training, but those are not registered as separate Artifact rows today). Only returned by the single-GET endpoint; list responses use ``FineTuneJobSummary`` which omits this field. | [readonly] + +## Example + +```python +from saturn_api.models.fine_tune_job_view import FineTuneJobView + +# TODO update the JSON string below +json = "{}" +# create an instance of FineTuneJobView from a JSON string +fine_tune_job_view_instance = FineTuneJobView.from_json(json) +# print the JSON string representation of the object +print(FineTuneJobView.to_json()) + +# convert the object into a dict +fine_tune_job_view_dict = fine_tune_job_view_instance.to_dict() +# create an instance of FineTuneJobView from a dict +fine_tune_job_view_from_dict = FineTuneJobView.from_dict(fine_tune_job_view_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/docs/FineTuningJobsApi.md b/docs/FineTuningJobsApi.md new file mode 100644 index 0000000..e1dbe77 --- /dev/null +++ b/docs/FineTuningJobsApi.md @@ -0,0 +1,430 @@ +# saturn_api.FineTuningJobsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](FineTuningJobsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/fine-tuning/jobs | Create fine-tuning job +[**get**](FineTuningJobsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id} | Get fine-tuning job +[**get_logs**](FineTuningJobsApi.md#get_logs) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/logs | Get fine-tuning job historical logs +[**jobs_cancel**](FineTuningJobsApi.md#jobs_cancel) | **POST** /api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/cancel | Cancel fine-tuning job +[**list**](FineTuningJobsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/fine-tuning/jobs | List fine-tuning jobs + + +# **create** +> FineTuneJobView create(org_id, fine_tune_job_create) + +Create fine-tuning job + +Create a new fine-tuning job. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.fine_tune_job_create import FineTuneJobCreate +from saturn_api.models.fine_tune_job_view import FineTuneJobView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.FineTuningJobsApi(api_client) + org_id = 'org_id_example' # str | + fine_tune_job_create = saturn_api.FineTuneJobCreate() # FineTuneJobCreate | + + try: + # Create fine-tuning job + api_response = await api_instance.create(org_id, fine_tune_job_create) + print("The response of FineTuningJobsApi->create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FineTuningJobsApi->create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **fine_tune_job_create** | [**FineTuneJobCreate**](FineTuneJobCreate.md)| | + +### Return type + +[**FineTuneJobView**](FineTuneJobView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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** +> FineTuneJobView get(org_id, job_id) + +Get fine-tuning job + +Get a fine-tuning job. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.fine_tune_job_view import FineTuneJobView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.FineTuningJobsApi(api_client) + org_id = 'org_id_example' # str | + job_id = 'job_id_example' # str | + + try: + # Get fine-tuning job + api_response = await api_instance.get(org_id, job_id) + print("The response of FineTuningJobsApi->get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FineTuningJobsApi->get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **job_id** | **str**| | + +### Return type + +[**FineTuneJobView**](FineTuneJobView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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_logs** +> HistoricLogList get_logs(org_id, job_id, pod_name=pod_name, cluster=cluster, prev_key=prev_key, next_key=next_key, page_size=page_size) + +Get fine-tuning job historical logs + +Historical record of logs from the resource. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.historic_log_list import HistoricLogList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.FineTuningJobsApi(api_client) + org_id = 'org_id_example' # str | + job_id = 'job_id_example' # str | + pod_name = 'pod_name_example' # str | Name of the pod to retrieve logs from. (optional) + cluster = 'cluster_example' # str | Name of the cluster the pod lives in. (optional) + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Maximum number of results per page. (optional) (default to 100) + + try: + # Get fine-tuning job historical logs + api_response = await api_instance.get_logs(org_id, job_id, pod_name=pod_name, cluster=cluster, prev_key=prev_key, next_key=next_key, page_size=page_size) + print("The response of FineTuningJobsApi->get_logs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FineTuningJobsApi->get_logs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **job_id** | **str**| | + **pod_name** | **str**| Name of the pod to retrieve logs from. | [optional] + **cluster** | **str**| Name of the cluster the pod lives in. | [optional] + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Maximum number of results per page. | [optional] [default to 100] + +### Return type + +[**HistoricLogList**](HistoricLogList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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) + +# **jobs_cancel** +> FineTuneJobView jobs_cancel(org_id, job_id) + +Cancel fine-tuning job + +Stop the underlying intermittent deployment. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.fine_tune_job_view import FineTuneJobView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.FineTuningJobsApi(api_client) + org_id = 'org_id_example' # str | + job_id = 'job_id_example' # str | + + try: + # Cancel fine-tuning job + api_response = await api_instance.jobs_cancel(org_id, job_id) + print("The response of FineTuningJobsApi->jobs_cancel:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FineTuningJobsApi->jobs_cancel: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **job_id** | **str**| | + +### Return type + +[**FineTuneJobView**](FineTuneJobView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Cancelled | - | + +[[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** +> FineTuneJobList list(org_id, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + +List fine-tuning jobs + +Paginated list of fine-tuning jobs. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.fine_tune_job_list import FineTuneJobList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.FineTuningJobsApi(api_client) + org_id = 'org_id_example' # str | + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Page size. (optional) (default to 100) + descending = False # bool | List results in descending order. (optional) (default to False) + + try: + # List fine-tuning jobs + api_response = await api_instance.list(org_id, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + print("The response of FineTuningJobsApi->list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FineTuningJobsApi->list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Page size. | [optional] [default to 100] + **descending** | **bool**| List results in descending order. | [optional] [default to False] + +### Return type + +[**FineTuneJobList**](FineTuneJobList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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/docs/GroupsApi.md b/docs/GroupsApi.md index e67535e..58a375f 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -520,7 +520,7 @@ configuration = saturn_api.Configuration( async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.GroupsApi(api_client) - name = 'name_example' # str | Prefix matched search string on group name. (optional) + name = 'name_example' # str | Substring matched search string on group name. (optional) org_id = 'org_id_example' # str | Org ID to query for groups. Defaults to the default org for the authenticated user. (optional) all_groups = False # bool | Search for all groups in the org, instead of only groups the authenticated user is a member of. (optional) (default to False) prev_key = 'prev_key_example' # str | Previous page key. (optional) @@ -544,7 +544,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **str**| Prefix matched search string on group name. | [optional] + **name** | **str**| Substring matched search string on group name. | [optional] **org_id** | **str**| Org ID to query for groups. Defaults to the default org for the authenticated user. | [optional] **all_groups** | **bool**| Search for all groups in the org, instead of only groups the authenticated user is a member of. | [optional] [default to False] **prev_key** | **str**| Previous page key. | [optional] @@ -609,7 +609,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.GroupsApi(api_client) group_id = 'group_id_example' # str | - name = 'name_example' # str | Prefix matched search string on group member username. (optional) + name = 'name_example' # str | Substring matched search string on group member username. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -632,7 +632,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| | - **name** | **str**| Prefix matched search string on group member username. | [optional] + **name** | **str**| Substring matched search string on group member username. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] diff --git a/docs/Hyperparameters.md b/docs/Hyperparameters.md new file mode 100644 index 0000000..371ece8 --- /dev/null +++ b/docs/Hyperparameters.md @@ -0,0 +1,34 @@ +# Hyperparameters + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**learning_rate** | **float** | | [readonly] +**epochs** | **int** | | [readonly] +**effective_batch_size** | **int** | | [readonly] +**max_seq_length** | **int** | | [readonly] +**lora_rank** | **int** | | [readonly] +**lora_alpha** | **int** | | [readonly] + +## Example + +```python +from saturn_api.models.hyperparameters import Hyperparameters + +# TODO update the JSON string below +json = "{}" +# create an instance of Hyperparameters from a JSON string +hyperparameters_instance = Hyperparameters.from_json(json) +# print the JSON string representation of the object +print(Hyperparameters.to_json()) + +# convert the object into a dict +hyperparameters_dict = hyperparameters_instance.to_dict() +# create an instance of Hyperparameters from a dict +hyperparameters_from_dict = Hyperparameters.from_dict(hyperparameters_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/docs/Hyperparameters1.md b/docs/Hyperparameters1.md new file mode 100644 index 0000000..2a1d460 --- /dev/null +++ b/docs/Hyperparameters1.md @@ -0,0 +1,34 @@ +# Hyperparameters1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**learning_rate** | **float** | Learning rate. Must be in (0, 1). | +**epochs** | **int** | Number of training epochs. Must be in [1, 10]. | +**effective_batch_size** | **int** | Effective batch size — the number of samples whose gradients are averaged per optimizer step. The platform translates this to axolotl's ``gradient_accumulation_steps × micro_batch_size``; ``micro_batch_size`` is auto-found at runtime to fit GPU memory. | +**max_seq_length** | **int** | Maximum sequence length (tokens) per training sample. Longer sequences use proportionally more GPU memory. Must be in [128, 16384]. | +**lora_rank** | **int** | LoRA adapter rank. Must be in [1, 128]. | +**lora_alpha** | **int** | LoRA alpha scaling factor. Must be in [1, 256]. | + +## Example + +```python +from saturn_api.models.hyperparameters1 import Hyperparameters1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Hyperparameters1 from a JSON string +hyperparameters1_instance = Hyperparameters1.from_json(json) +# print the JSON string representation of the object +print(Hyperparameters1.to_json()) + +# convert the object into a dict +hyperparameters1_dict = hyperparameters1_instance.to_dict() +# create an instance of Hyperparameters1 from a dict +hyperparameters1_from_dict = Hyperparameters1.from_dict(hyperparameters1_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/docs/ImageTagsApi.md b/docs/ImageTagsApi.md index 5517201..1c56cb9 100644 --- a/docs/ImageTagsApi.md +++ b/docs/ImageTagsApi.md @@ -540,8 +540,8 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.ImageTagsApi(api_client) image_id = 'image_id_example' # str | - version = 'version_example' # str | Prefix matched search string on image tag version. (optional) - image_uri = 'image_uri_example' # str | Prefix matched search string on image tag URI. (optional) + version = 'version_example' # str | Substring matched search string on image tag version. (optional) + image_uri = 'image_uri_example' # str | Substring matched search string on image tag URI. (optional) is_external = True # bool | Filter image tags by is_external. (optional) archived = True # bool | Filter images tags by archived. (optional) status = saturn_api.ImageBuildStatus() # ImageBuildStatus | Filter image tags by build status. (optional) @@ -567,8 +567,8 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **image_id** | **str**| | - **version** | **str**| Prefix matched search string on image tag version. | [optional] - **image_uri** | **str**| Prefix matched search string on image tag URI. | [optional] + **version** | **str**| Substring matched search string on image tag version. | [optional] + **image_uri** | **str**| Substring matched search string on image tag URI. | [optional] **is_external** | **bool**| Filter image tags by is_external. | [optional] **archived** | **bool**| Filter images tags by archived. | [optional] **status** | [**ImageBuildStatus**](.md)| Filter image tags by build status. | [optional] diff --git a/docs/ImagesApi.md b/docs/ImagesApi.md index 2e22642..8a329d1 100644 --- a/docs/ImagesApi.md +++ b/docs/ImagesApi.md @@ -288,7 +288,7 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on image name. (optional) + name = 'name_example' # str | Substring matched search string on image name. (optional) access = saturn_api.ImageAccessLevel() # ImageAccessLevel | Filter images by access level. (optional) supports = 'supports_example' # str | Filter images by supported features. (optional) hardware_type = saturn_api.HardwareType() # HardwareType | Filter images by hardware type. (optional) @@ -320,7 +320,7 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on image name. | [optional] + **name** | **str**| Substring matched search string on image name. | [optional] **access** | [**ImageAccessLevel**](.md)| Filter images by access level. | [optional] **supports** | **str**| Filter images by supported features. | [optional] **hardware_type** | [**HardwareType**](.md)| Filter images by hardware type. | [optional] diff --git a/docs/InferenceEndpointCreate.md b/docs/InferenceEndpointCreate.md new file mode 100644 index 0000000..7093a60 --- /dev/null +++ b/docs/InferenceEndpointCreate.md @@ -0,0 +1,34 @@ +# InferenceEndpointCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Human-readable name for the inference endpoint. | +**checkpoint_artifact_id** | **str** | Artifact id of the checkpoint to serve. Must be a ``kind=checkpoint`` Artifact with ``status=ready`` belonging to the same org as the requester. | +**instance_size** | **str** | Saturn instance size to run the inference pod on. Must be a GPU-equipped size (gpu > 0). | +**quantization** | **str** | Optional vLLM quantization method. Restricted to calibration-free methods (``fp8``, ``int8``) — these quantize on the fly with no calibration dataset. Calibration-requiring methods (gptq, awq) are rejected. Omit (the default) to serve in the checkpoint's native precision (BF16). | [optional] +**visibility** | **str** | Route visibility enforced by ForwardAuth: ``org`` (any member of the endpoint's org may call it) or ``owner`` (only the owning identity and explicit ``viewers``). Defaults to ``org``. | [optional] [default to 'org'] +**viewers** | **List[str]** | Optional list of identity names (usernames or group names in the endpoint's org) granted access to the endpoint route in addition to the owner. Honored by ForwardAuth exactly like a normal deployment's viewers. | [optional] + +## Example + +```python +from saturn_api.models.inference_endpoint_create import InferenceEndpointCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceEndpointCreate from a JSON string +inference_endpoint_create_instance = InferenceEndpointCreate.from_json(json) +# print the JSON string representation of the object +print(InferenceEndpointCreate.to_json()) + +# convert the object into a dict +inference_endpoint_create_dict = inference_endpoint_create_instance.to_dict() +# create an instance of InferenceEndpointCreate from a dict +inference_endpoint_create_from_dict = InferenceEndpointCreate.from_dict(inference_endpoint_create_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/docs/InferenceEndpointList.md b/docs/InferenceEndpointList.md new file mode 100644 index 0000000..46290c5 --- /dev/null +++ b/docs/InferenceEndpointList.md @@ -0,0 +1,31 @@ +# InferenceEndpointList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoints** | [**List[InferenceEndpointSummary]**](InferenceEndpointSummary.md) | List of inference endpoints (``InferenceEndpointSummary`` projections — without ``checkpoint``; fetch the by-id endpoint for that). | [readonly] +**prev_key** | **str** | Previous page key. | [optional] [readonly] +**next_key** | **str** | Next page key. | [optional] [readonly] + +## Example + +```python +from saturn_api.models.inference_endpoint_list import InferenceEndpointList + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceEndpointList from a JSON string +inference_endpoint_list_instance = InferenceEndpointList.from_json(json) +# print the JSON string representation of the object +print(InferenceEndpointList.to_json()) + +# convert the object into a dict +inference_endpoint_list_dict = inference_endpoint_list_instance.to_dict() +# create an instance of InferenceEndpointList from a dict +inference_endpoint_list_from_dict = InferenceEndpointList.from_dict(inference_endpoint_list_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/docs/InferenceEndpointSummary.md b/docs/InferenceEndpointSummary.md new file mode 100644 index 0000000..589a22a --- /dev/null +++ b/docs/InferenceEndpointSummary.md @@ -0,0 +1,36 @@ +# InferenceEndpointSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Inference endpoint ID (same as the underlying deployment ID). | [readonly] +**name** | **str** | | [readonly] +**status** | **str** | Underlying Saturn deployment status: pending, running, stopping, stopped, or error. | [readonly] +**created_at** | **str** | | [readonly] +**base_model** | **str** | HuggingFace base model id derived from the checkpoint Artifact's ``metadata.base_model`` at create time. | [readonly] +**checkpoint_artifact_id** | **str** | Artifact id of the checkpoint this endpoint is serving. | [readonly] +**instance_size** | **str** | | [readonly] +**endpoint_url** | **str** | Public URL clients POST OpenAI-compatible inference requests to. Uses the deployment's auto-generated subdomain. Returns the URL regardless of running state — clients can stash it; calls fail while the endpoint is stopped. | [readonly] + +## Example + +```python +from saturn_api.models.inference_endpoint_summary import InferenceEndpointSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceEndpointSummary from a JSON string +inference_endpoint_summary_instance = InferenceEndpointSummary.from_json(json) +# print the JSON string representation of the object +print(InferenceEndpointSummary.to_json()) + +# convert the object into a dict +inference_endpoint_summary_dict = inference_endpoint_summary_instance.to_dict() +# create an instance of InferenceEndpointSummary from a dict +inference_endpoint_summary_from_dict = InferenceEndpointSummary.from_dict(inference_endpoint_summary_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/docs/InferenceEndpointView.md b/docs/InferenceEndpointView.md new file mode 100644 index 0000000..4c8dedc --- /dev/null +++ b/docs/InferenceEndpointView.md @@ -0,0 +1,37 @@ +# InferenceEndpointView + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Inference endpoint ID (same as the underlying deployment ID). | [readonly] +**name** | **str** | | [readonly] +**status** | **str** | Underlying Saturn deployment status: pending, running, stopping, stopped, or error. | [readonly] +**created_at** | **str** | | [readonly] +**base_model** | **str** | HuggingFace base model id derived from the checkpoint Artifact's ``metadata.base_model`` at create time. | [readonly] +**checkpoint_artifact_id** | **str** | Artifact id of the checkpoint this endpoint is serving. | [readonly] +**instance_size** | **str** | | [readonly] +**endpoint_url** | **str** | Public URL clients POST OpenAI-compatible inference requests to. Uses the deployment's auto-generated subdomain. Returns the URL regardless of running state — clients can stash it; calls fail while the endpoint is stopped. | [readonly] +**checkpoint** | [**Artifact**](Artifact.md) | Resolved checkpoint Artifact. Null only if the artifact was deleted out from under the endpoint (we block that path; the field is nullable defensively). | [readonly] + +## Example + +```python +from saturn_api.models.inference_endpoint_view import InferenceEndpointView + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceEndpointView from a JSON string +inference_endpoint_view_instance = InferenceEndpointView.from_json(json) +# print the JSON string representation of the object +print(InferenceEndpointView.to_json()) + +# convert the object into a dict +inference_endpoint_view_dict = inference_endpoint_view_instance.to_dict() +# create an instance of InferenceEndpointView from a dict +inference_endpoint_view_from_dict = InferenceEndpointView.from_dict(inference_endpoint_view_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/docs/InferenceEndpointsApi.md b/docs/InferenceEndpointsApi.md new file mode 100644 index 0000000..233c728 --- /dev/null +++ b/docs/InferenceEndpointsApi.md @@ -0,0 +1,589 @@ +# saturn_api.InferenceEndpointsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](InferenceEndpointsApi.md#create) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints | Create inference endpoint +[**delete**](InferenceEndpointsApi.md#delete) | **DELETE** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id} | Delete inference endpoint +[**endpoints_start**](InferenceEndpointsApi.md#endpoints_start) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/start | Start inference endpoint +[**endpoints_stop**](InferenceEndpointsApi.md#endpoints_stop) | **POST** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/stop | Stop inference endpoint +[**get**](InferenceEndpointsApi.md#get) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id} | Get inference endpoint +[**get_logs**](InferenceEndpointsApi.md#get_logs) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/logs | Get inference endpoint historical logs +[**list**](InferenceEndpointsApi.md#list) | **GET** /api/orgs/{org_id}/token-factory/inference-endpoints | List inference endpoints + + +# **create** +> InferenceEndpointView create(org_id, inference_endpoint_create) + +Create inference endpoint + +Create a new inference endpoint. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.inference_endpoint_create import InferenceEndpointCreate +from saturn_api.models.inference_endpoint_view import InferenceEndpointView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + inference_endpoint_create = saturn_api.InferenceEndpointCreate() # InferenceEndpointCreate | + + try: + # Create inference endpoint + api_response = await api_instance.create(org_id, inference_endpoint_create) + print("The response of InferenceEndpointsApi->create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **inference_endpoint_create** | [**InferenceEndpointCreate**](InferenceEndpointCreate.md)| | + +### Return type + +[**InferenceEndpointView**](InferenceEndpointView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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** +> delete(org_id, endpoint_id) + +Delete inference endpoint + +Delete an inference endpoint. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + endpoint_id = 'endpoint_id_example' # str | + + try: + # Delete inference endpoint + await api_instance.delete(org_id, endpoint_id) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **endpoint_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Deleted | - | + +[[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) + +# **endpoints_start** +> InferenceEndpointView endpoints_start(org_id, endpoint_id) + +Start inference endpoint + +Bring up the underlying persistent deployment. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.inference_endpoint_view import InferenceEndpointView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + endpoint_id = 'endpoint_id_example' # str | + + try: + # Start inference endpoint + api_response = await api_instance.endpoints_start(org_id, endpoint_id) + print("The response of InferenceEndpointsApi->endpoints_start:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->endpoints_start: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **endpoint_id** | **str**| | + +### Return type + +[**InferenceEndpointView**](InferenceEndpointView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Started | - | + +[[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) + +# **endpoints_stop** +> InferenceEndpointView endpoints_stop(org_id, endpoint_id) + +Stop inference endpoint + +Tear down the pod but keep the DB row. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.inference_endpoint_view import InferenceEndpointView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + endpoint_id = 'endpoint_id_example' # str | + + try: + # Stop inference endpoint + api_response = await api_instance.endpoints_stop(org_id, endpoint_id) + print("The response of InferenceEndpointsApi->endpoints_stop:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->endpoints_stop: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **endpoint_id** | **str**| | + +### Return type + +[**InferenceEndpointView**](InferenceEndpointView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Stopped | - | + +[[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** +> InferenceEndpointView get(org_id, endpoint_id) + +Get inference endpoint + +Get an inference endpoint. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.inference_endpoint_view import InferenceEndpointView +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + endpoint_id = 'endpoint_id_example' # str | + + try: + # Get inference endpoint + api_response = await api_instance.get(org_id, endpoint_id) + print("The response of InferenceEndpointsApi->get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **endpoint_id** | **str**| | + +### Return type + +[**InferenceEndpointView**](InferenceEndpointView.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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_logs** +> HistoricLogList get_logs(org_id, endpoint_id, pod_name=pod_name, cluster=cluster, prev_key=prev_key, next_key=next_key, page_size=page_size) + +Get inference endpoint historical logs + +Historical record of logs from the resource. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.historic_log_list import HistoricLogList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + endpoint_id = 'endpoint_id_example' # str | + pod_name = 'pod_name_example' # str | Name of the pod to retrieve logs from. (optional) + cluster = 'cluster_example' # str | Name of the cluster the pod lives in. (optional) + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Maximum number of results per page. (optional) (default to 100) + + try: + # Get inference endpoint historical logs + api_response = await api_instance.get_logs(org_id, endpoint_id, pod_name=pod_name, cluster=cluster, prev_key=prev_key, next_key=next_key, page_size=page_size) + print("The response of InferenceEndpointsApi->get_logs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->get_logs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **endpoint_id** | **str**| | + **pod_name** | **str**| Name of the pod to retrieve logs from. | [optional] + **cluster** | **str**| Name of the cluster the pod lives in. | [optional] + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Maximum number of results per page. | [optional] [default to 100] + +### Return type + +[**HistoricLogList**](HistoricLogList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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** +> InferenceEndpointList list(org_id, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + +List inference endpoints + +Paginated list of inference endpoints. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import saturn_api +from saturn_api.models.inference_endpoint_list import InferenceEndpointList +from saturn_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to the SATURN_BASE_URL env or http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = saturn_api.Configuration( + host = os.getenv("SATURN_BASE_URL", "http://localhost") +) + +# 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 Bearer authorization: bearerAuth, defaults to the SATURN_TOKEN env +configuration = saturn_api.Configuration( + access_token = os.environ["SATURN_TOKEN"] +) + +# Enter a context with an instance of the API client +async with saturn_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = saturn_api.InferenceEndpointsApi(api_client) + org_id = 'org_id_example' # str | + prev_key = 'prev_key_example' # str | Previous page key. (optional) + next_key = 'next_key_example' # str | Next page key. (optional) + page_size = 100 # int | Page size. (optional) (default to 100) + descending = False # bool | List results in descending order. (optional) (default to False) + + try: + # List inference endpoints + api_response = await api_instance.list(org_id, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + print("The response of InferenceEndpointsApi->list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InferenceEndpointsApi->list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| | + **prev_key** | **str**| Previous page key. | [optional] + **next_key** | **str**| Next page key. | [optional] + **page_size** | **int**| Page size. | [optional] [default to 100] + **descending** | **bool**| List results in descending order. | [optional] [default to False] + +### Return type + +[**InferenceEndpointList**](InferenceEndpointList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ok | - | + +[[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/docs/InstanceSize.md b/docs/InstanceSize.md index 08412f6..cb1449e 100644 --- a/docs/InstanceSize.md +++ b/docs/InstanceSize.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **display_name** | **str** | | **price_per_hour** | **float** | | [optional] **description** | **str** | | [optional] [default to ''] +**disabled** | **bool** | | [optional] [default to False] +**disabled_message** | **str** | | [optional] [default to ''] ## Example diff --git a/docs/InvitationsApi.md b/docs/InvitationsApi.md index 4db3fa1..cdbd295 100644 --- a/docs/InvitationsApi.md +++ b/docs/InvitationsApi.md @@ -282,7 +282,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.InvitationsApi(api_client) status = saturn_api.InvitationStatus() # InvitationStatus | Filter invitations by status. (optional) - email = 'email_example' # str | Prefix matched search string on email. (optional) + email = 'email_example' # str | Substring matched search string on email. (optional) invitor_id = 'invitor_id_example' # str | Filter invitations by invitor user ID. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -306,7 +306,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**InvitationStatus**](.md)| Filter invitations by status. | [optional] - **email** | **str**| Prefix matched search string on email. | [optional] + **email** | **str**| Substring matched search string on email. | [optional] **invitor_id** | **str**| Filter invitations by invitor user ID. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/Job.md b/docs/Job.md index 92b9387..780d767 100644 --- a/docs/Job.md +++ b/docs/Job.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **instance_size** | **str** | Instance size of the job. | [readonly] **image_tag** | [**ImageTag**](ImageTag.md) | Image tag that is attached to the job. | [readonly] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [readonly] +**config_files** | **Dict[str, Dict[str, str]]** | User-defined config files written to $HOME at pod startup. | [optional] [readonly] **cron_schedule_options** | [**CronSchedule**](CronSchedule.md) | Cron schedule configuration for scheduled jobs. | [optional] [readonly] **start_script** | **str** | Shell script that runs on start before the primary command. | [optional] [readonly] **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [readonly] @@ -21,6 +22,7 @@ Name | Type | Description | Notes **is_spot** | **bool** | Enables running on spot instance sizes. | [readonly] **start_dind** | **bool** | Enables docker-in-docker. | [readonly] **scale** | **int** | Number of pod replicas. | [readonly] +**retries** | **int** | Maximum number of retries for a failed job. | [readonly] **k8s_name** | **str** | Unique name for associated kubernetes objects. | [readonly] **require_restart** | **bool** | True if an update was applied that requires restart to take effect. | [readonly] **resource_type** | **str** | Resource type of the job. | [readonly] diff --git a/docs/JobCreate.md b/docs/JobCreate.md index d0124bc..7426336 100644 --- a/docs/JobCreate.md +++ b/docs/JobCreate.md @@ -16,12 +16,14 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments for the job. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script to run on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory for the job. | [optional] [default to '/home/jovyan/workspace'] **is_spot** | **bool** | Enables running on spot instance sizes. | [optional] [default to False] **start_dind** | **bool** | Enables docker-in-docker. | [optional] [default to False] **command** | **str** | Command that runs on start. | **scale** | **int** | Number of pod replicas. | [optional] [default to 1] +**retries** | **int** | Maximum number of retries for a failed job. | [optional] [default to 0] **cron_schedule_options** | [**CronScheduleCreate**](CronScheduleCreate.md) | Cron schedule configuration for scheduled jobs. | [optional] ## Example diff --git a/docs/JobSpec.md b/docs/JobSpec.md index 899f591..dd15ca6 100644 --- a/docs/JobSpec.md +++ b/docs/JobSpec.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | | [optional] **working_directory** | **str** | | [optional] **extra_packages** | [**ExtraPackagesRecipe**](ExtraPackagesRecipe.md) | | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | | [optional] **start_script** | **str** | | [optional] **token_scope** | **str** | | [optional] **dask_cluster** | [**DaskClusterAttachment**](DaskClusterAttachment.md) | | [optional] diff --git a/docs/JobUpdate.md b/docs/JobUpdate.md index c0b03e2..f3278de 100644 --- a/docs/JobUpdate.md +++ b/docs/JobUpdate.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script that runs on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory. | [optional] **instance_size** | **str** | Instance size of the job. | [optional] @@ -21,6 +22,7 @@ Name | Type | Description | Notes **start_dind** | **bool** | Enables docker-in-docker. | [optional] **command** | **str** | Command that runs on start. | [optional] **scale** | **int** | Number of pod replicas. | [optional] +**retries** | **int** | Maximum number of retries for a failed job. | [optional] **cron_schedule_options** | [**CronScheduleUpdate**](CronScheduleUpdate.md) | Cron schedule configuration for scheduled jobs. | [optional] ## Example diff --git a/docs/JobsApi.md b/docs/JobsApi.md index 7d5c96b..6137ee5 100644 --- a/docs/JobsApi.md +++ b/docs/JobsApi.md @@ -1445,7 +1445,7 @@ Name | Type | Description | Notes [[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** -> JobList list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) +> JobList list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) List jobs @@ -1487,7 +1487,8 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on job name. (optional) + name = 'name_example' # str | Substring matched search string on job name. (optional) + tags = 'tags_example' # str | Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -1495,7 +1496,7 @@ async with saturn_api.ApiClient(configuration) as api_client: try: # List jobs - api_response = await api_instance.list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) + api_response = await api_instance.list(owner_name=owner_name, owner_id=owner_id, user_id=user_id, group_id=group_id, org_id=org_id, owner=owner, name=name, tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, descending=descending) print("The response of JobsApi->list:\n") pprint(api_response) except Exception as e: @@ -1515,7 +1516,8 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on job name. | [optional] + **name** | **str**| Substring matched search string on job name. | [optional] + **tags** | **str**| Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] @@ -1663,7 +1665,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.JobsApi(api_client) job_id = 'job_id_example' # str | - location = 'location_example' # str | Prefix matched search string on secret attachment location. (optional) + location = 'location_example' # str | Substring matched search string on secret attachment location. (optional) attachment_type = saturn_api.SecretAttachmentType() # SecretAttachmentType | Filter secret attachments by type. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -1687,7 +1689,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **job_id** | **str**| | - **location** | **str**| Prefix matched search string on secret attachment location. | [optional] + **location** | **str**| Substring matched search string on secret attachment location. | [optional] **attachment_type** | [**SecretAttachmentType**](.md)| Filter secret attachments by type. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/LimitsApi.md b/docs/LimitsApi.md index ac483b0..b0a88c7 100644 --- a/docs/LimitsApi.md +++ b/docs/LimitsApi.md @@ -280,7 +280,7 @@ configuration = saturn_api.Configuration( async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.LimitsApi(api_client) - name = 'name_example' # str | Prefix matched search string on usage limit name. (optional) + name = 'name_example' # str | Substring matched search string on usage limit name. (optional) org_id = 'org_id_example' # str | Filter usage limits by org. Defaults to the default org for the current user/group. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -303,7 +303,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **str**| Prefix matched search string on usage limit name. | [optional] + **name** | **str**| Substring matched search string on usage limit name. | [optional] **org_id** | **str**| Filter usage limits by org. Defaults to the default org for the current user/group. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/Org.md b/docs/Org.md index 465a937..5414e50 100644 --- a/docs/Org.md +++ b/docs/Org.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **website_url** | **str** | Website URL of the org. | [readonly] **logo_image_url** | **str** | Logo of the org. | [readonly] **limits_id** | **str** | Usage limits ID applied to the entire org. | [readonly] +**limits** | [**UsageLimits**](UsageLimits.md) | Usage limits applied to the entire org, if set. | [optional] [readonly] **is_primary** | **bool** | Primary org for the account. | [readonly] **locked** | **bool** | Locked orgs have restricted access to the API. | [readonly] **locked_reason** | **str** | Reason for the org being locked. | [readonly] diff --git a/docs/OrgsApi.md b/docs/OrgsApi.md index d22ee10..458efbb 100644 --- a/docs/OrgsApi.md +++ b/docs/OrgsApi.md @@ -1318,7 +1318,7 @@ configuration = saturn_api.Configuration( async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.OrgsApi(api_client) - name = 'name_example' # str | Prefix matched search string on org name. (optional) + name = 'name_example' # str | Substring matched search string on org name. (optional) all_orgs = True # bool | List all orgs, instead of only orgs the user is a member of. (Admin only) (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -1341,7 +1341,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **str**| Prefix matched search string on org name. | [optional] + **name** | **str**| Substring matched search string on org name. | [optional] **all_orgs** | **bool**| List all orgs, instead of only orgs the user is a member of. (Admin only) | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] @@ -1407,7 +1407,7 @@ async with saturn_api.ApiClient(configuration) as api_client: api_instance = saturn_api.OrgsApi(api_client) org_id = 'org_id_example' # str | status = saturn_api.InvitationStatus() # InvitationStatus | Filter org invitations by status. (optional) - email = 'email_example' # str | Prefix matched search string on email. (optional) + email = 'email_example' # str | Substring matched search string on email. (optional) invitor_id = 'invitor_id_example' # str | Filter invitations by invitor user ID. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -1432,7 +1432,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **org_id** | **str**| | **status** | [**InvitationStatus**](.md)| Filter org invitations by status. | [optional] - **email** | **str**| Prefix matched search string on email. | [optional] + **email** | **str**| Substring matched search string on email. | [optional] **invitor_id** | **str**| Filter invitations by invitor user ID. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] @@ -1499,7 +1499,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.OrgsApi(api_client) org_id = 'org_id_example' # str | - name = 'name_example' # str | Prefix matched search string by owner identity name. (optional) + name = 'name_example' # str | Substring matched search string by owner identity name. (optional) identity_type = saturn_api.IdentityType() # IdentityType | Filter owners by identity type. (optional) all_users = False # bool | List all user owners, instead of just the authenticated user. (optional) (default to False) all_groups = False # bool | List all group owners, instead of just groups the authenticated user is a member of. (optional) (default to False) @@ -1526,7 +1526,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **org_id** | **str**| | - **name** | **str**| Prefix matched search string by owner identity name. | [optional] + **name** | **str**| Substring matched search string by owner identity name. | [optional] **identity_type** | [**IdentityType**](.md)| Filter owners by identity type. | [optional] **all_users** | **bool**| List all user owners, instead of just the authenticated user. | [optional] [default to False] **all_groups** | **bool**| List all group owners, instead of just groups the authenticated user is a member of. | [optional] [default to False] diff --git a/docs/Resource.md b/docs/Resource.md index 2a7c654..f6ac024 100644 --- a/docs/Resource.md +++ b/docs/Resource.md @@ -34,6 +34,7 @@ Name | Type | Description | Notes **instance_size** | **str** | Instance size of the workspace. | [readonly] **image_tag** | [**ImageTag**](ImageTag.md) | Image tag that is attached to the workspace. | [readonly] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [readonly] +**config_files** | **Dict[str, Dict[str, str]]** | User-defined config files written to $HOME at pod startup. | [optional] [readonly] **scale** | **int** | Number of pod replicas. | [readonly] **start_script** | **str** | Shell script that runs on start before the primary command. | [readonly] **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [readonly] @@ -52,6 +53,7 @@ Name | Type | Description | Notes **debug_mode** | **bool** | True if workspace is running in debug mode. | [readonly] **ssh_url** | **str** | External SSH URL for the workspace. | [readonly] **cron_schedule_options** | [**CronSchedule**](CronSchedule.md) | Cron schedule configuration for scheduled jobs. | [optional] [readonly] +**retries** | **int** | Maximum number of retries for a failed job. | [readonly] **scheduled** | **bool** | True if job is currently scheduled. | [readonly] **ide** | **str** | IDE of the workspace | [readonly] **disk_space** | **str** | Size of the persistent volume attached to the workspace. | [readonly] diff --git a/docs/ResourceState.md b/docs/ResourceState.md index 24599e7..ee5c072 100644 --- a/docs/ResourceState.md +++ b/docs/ResourceState.md @@ -8,6 +8,10 @@ Name | Type | Description | Notes **id** | **str** | | [readonly] **action** | **str** | | [optional] [readonly] **status** | **str** | | [readonly] +**url** | **str** | External URL for the primary route, if applicable. | [optional] [readonly] +**ssh_url** | **str** | External SSH URL for the resource when SSH is enabled. | [optional] [readonly] +**ssh_user** | **str** | SSH username for the resource when SSH is enabled. | [optional] [readonly] +**routes** | [**List[RouteState]**](RouteState.md) | External URL for each route exposed by the resource. | [optional] [readonly] ## Example diff --git a/docs/RouteState.md b/docs/RouteState.md new file mode 100644 index 0000000..49e4c63 --- /dev/null +++ b/docs/RouteState.md @@ -0,0 +1,31 @@ +# RouteState + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subdomain** | **str** | | [readonly] +**container_port** | **int** | | [readonly] +**url** | **str** | | [readonly] + +## Example + +```python +from saturn_api.models.route_state import RouteState + +# TODO update the JSON string below +json = "{}" +# create an instance of RouteState from a JSON string +route_state_instance = RouteState.from_json(json) +# print the JSON string representation of the object +print(RouteState.to_json()) + +# convert the object into a dict +route_state_dict = route_state_instance.to_dict() +# create an instance of RouteState from a dict +route_state_from_dict = RouteState.from_dict(route_state_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/docs/SecretsApi.md b/docs/SecretsApi.md index b14d9ce..cd3f3ef 100644 --- a/docs/SecretsApi.md +++ b/docs/SecretsApi.md @@ -287,7 +287,7 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on secret name. (optional) + name = 'name_example' # str | Substring matched search string on secret name. (optional) access = saturn_api.SecretAccessLevel() # SecretAccessLevel | Filter secrets by access level. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -316,7 +316,7 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on secret name. | [optional] + **name** | **str**| Substring matched search string on secret name. | [optional] **access** | [**SecretAccessLevel**](.md)| Filter secrets by access level. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/ServerOptions.md b/docs/ServerOptions.md index c2c141e..f7e6563 100644 --- a/docs/ServerOptions.md +++ b/docs/ServerOptions.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **auto_shutoff** | **List[str]** | List of available auto-shutoff settings for workspaces. | [readonly] -**disk_space** | **List[str]** | List of available disk sizes for workspaces. | [readonly] +**disk_space** | [**List[DiskSpaceOption]**](DiskSpaceOption.md) | Available disk sizes for workspaces. | [readonly] **sizes** | [**Dict[str, InstanceSize]**](InstanceSize.md) | Mapping of instance size names to their configurations. | [readonly] ## Example diff --git a/docs/ServiceAccountEntitlementsApi.md b/docs/ServiceAccountEntitlementsApi.md index d3da20d..79d732d 100644 --- a/docs/ServiceAccountEntitlementsApi.md +++ b/docs/ServiceAccountEntitlementsApi.md @@ -282,7 +282,7 @@ async with saturn_api.ApiClient(configuration) as api_client: user_id = 'user_id_example' # str | Identity reference by user ID (optional) group_id = 'group_id_example' # str | Identity reference by group ID (optional) identity = 'identity_example' # str | Identity reference by name (optional) - name = 'name_example' # str | Prefix matched search string on entitled service account name. (optional) + name = 'name_example' # str | Substring matched search string on entitled service account name. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -307,7 +307,7 @@ Name | Type | Description | Notes **user_id** | **str**| Identity reference by user ID | [optional] **group_id** | **str**| Identity reference by group ID | [optional] **identity** | **str**| Identity reference by name | [optional] - **name** | **str**| Prefix matched search string on entitled service account name. | [optional] + **name** | **str**| Substring matched search string on entitled service account name. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] diff --git a/docs/ServiceAccountsApi.md b/docs/ServiceAccountsApi.md index 0c5feea..9a6bced 100644 --- a/docs/ServiceAccountsApi.md +++ b/docs/ServiceAccountsApi.md @@ -280,7 +280,7 @@ configuration = saturn_api.Configuration( async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.ServiceAccountsApi(api_client) - name = 'name_example' # str | Prefix matched search string on service account name. (optional) + name = 'name_example' # str | Substring matched search string on service account name. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -302,7 +302,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **str**| Prefix matched search string on service account name. | [optional] + **name** | **str**| Substring matched search string on service account name. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] diff --git a/docs/SharedFoldersApi.md b/docs/SharedFoldersApi.md index 40059f6..f5ca871 100644 --- a/docs/SharedFoldersApi.md +++ b/docs/SharedFoldersApi.md @@ -287,7 +287,7 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on shared folder name. (optional) + name = 'name_example' # str | Substring matched search string on shared folder name. (optional) access = saturn_api.SharedFolderAccessLevel() # SharedFolderAccessLevel | Filter shared folders by access level. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -316,7 +316,7 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on shared folder name. | [optional] + **name** | **str**| Substring matched search string on shared folder name. | [optional] **access** | [**SharedFolderAccessLevel**](.md)| Filter shared folders by access level. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/SshPrivateKeysApi.md b/docs/SshPrivateKeysApi.md index fda26cd..a9cc7d9 100644 --- a/docs/SshPrivateKeysApi.md +++ b/docs/SshPrivateKeysApi.md @@ -283,7 +283,7 @@ async with saturn_api.ApiClient(configuration) as api_client: user_id = 'user_id_example' # str | Identity reference by user ID (optional) group_id = 'group_id_example' # str | Identity reference by group ID (optional) identity = 'identity_example' # str | Identity reference by name (optional) - name = 'name_example' # str | Prefix matched search string on SSH private key name. (optional) + name = 'name_example' # str | Substring matched search string on SSH private key name. (optional) is_default = True # bool | Filter SSH private keys by is_default. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -309,7 +309,7 @@ Name | Type | Description | Notes **user_id** | **str**| Identity reference by user ID | [optional] **group_id** | **str**| Identity reference by group ID | [optional] **identity** | **str**| Identity reference by name | [optional] - **name** | **str**| Prefix matched search string on SSH private key name. | [optional] + **name** | **str**| Substring matched search string on SSH private key name. | [optional] **is_default** | **bool**| Filter SSH private keys by is_default. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/SshPublicKeysApi.md b/docs/SshPublicKeysApi.md index 7275099..0d1c0ba 100644 --- a/docs/SshPublicKeysApi.md +++ b/docs/SshPublicKeysApi.md @@ -283,7 +283,7 @@ async with saturn_api.ApiClient(configuration) as api_client: user_id = 'user_id_example' # str | Identity reference by user ID (optional) group_id = 'group_id_example' # str | Identity reference by group ID (optional) identity = 'identity_example' # str | Identity reference by name (optional) - name = 'name_example' # str | Prefix matched search string on SSH public key name. (optional) + name = 'name_example' # str | Substring matched search string on SSH public key name. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -308,7 +308,7 @@ Name | Type | Description | Notes **user_id** | **str**| Identity reference by user ID | [optional] **group_id** | **str**| Identity reference by group ID | [optional] **identity** | **str**| Identity reference by name | [optional] - **name** | **str**| Prefix matched search string on SSH public key name. | [optional] + **name** | **str**| Substring matched search string on SSH public key name. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] diff --git a/docs/UsageLimits.md b/docs/UsageLimits.md index a10cddb..5ff08bc 100644 --- a/docs/UsageLimits.md +++ b/docs/UsageLimits.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **is_default** | **bool** | Default usage limit for the org. | [readonly] **instance_sizes** | **List[str]** | Allowed instance sizes. Null if no limits. | [readonly] **resource_types** | **List[str]** | Allowed resource types. Null if no limits. | [readonly] +**token_factory_enabled** | **bool** | Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it. | [readonly] **num_instances** | **int** | Maximum number of active instances. Null if no limits. | [readonly] **auto_shutoff** | **int** | Maximum allowed auto-shutoff. Null if no limits. | [readonly] **storage_in_gb** | **int** | Total allowed storage in GiB. Null if no limits. | [readonly] diff --git a/docs/UsageLimitsCreate.md b/docs/UsageLimitsCreate.md index 5849e9e..a4f091b 100644 --- a/docs/UsageLimitsCreate.md +++ b/docs/UsageLimitsCreate.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **is_default** | **bool** | Default usage limit for the org. | [optional] [default to False] **instance_sizes** | **List[str]** | Allowed instance sizes. Null if no limits. | [optional] **resource_types** | **List[str]** | Allowed resource types. Null if no limits. | [optional] +**token_factory_enabled** | **bool** | Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it. | [optional] **num_instances** | **int** | Maximum number of active instances. Null if no limits. | [optional] **auto_shutoff** | **int** | Maximum allowed auto-shutoff. Null if no limits. | [optional] **storage_in_gb** | **int** | Total allowed storage in GiB. Null if no limits. | [optional] diff --git a/docs/UsageLimitsUpdate.md b/docs/UsageLimitsUpdate.md index d73d68b..3014282 100644 --- a/docs/UsageLimitsUpdate.md +++ b/docs/UsageLimitsUpdate.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **is_default** | **bool** | Default usage limit for the org. | [optional] **instance_sizes** | **List[str]** | Allowed instance sizes. Null if no limits. | [optional] **resource_types** | **List[str]** | Allowed resource types. Null if no limits. | [optional] +**token_factory_enabled** | **bool** | Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it. | [optional] **num_instances** | **int** | Maximum number of active instances. Null if no limits. | [optional] **auto_shutoff** | **int** | Maximum allowed auto-shutoff. Null if no limits. | [optional] **storage_in_gb** | **int** | Total allowed storage in GiB. Null if no limits. | [optional] diff --git a/docs/UsersApi.md b/docs/UsersApi.md index cc0e63a..0e2e7c3 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -282,8 +282,8 @@ configuration = saturn_api.Configuration( async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.UsersApi(api_client) - username = 'username_example' # str | Prefix matched search string on user name. (optional) - email = 'email_example' # str | Prefix matched search string on user email. (optional) + username = 'username_example' # str | Substring matched search string on user name. (optional) + email = 'email_example' # str | Substring matched search string on user email. (optional) details = False # bool | Retrieve detailed user data. (Admin only) (optional) (default to False) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -306,8 +306,8 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **str**| Prefix matched search string on user name. | [optional] - **email** | **str**| Prefix matched search string on user email. | [optional] + **username** | **str**| Substring matched search string on user name. | [optional] + **email** | **str**| Substring matched search string on user email. | [optional] **details** | **bool**| Retrieve detailed user data. (Admin only) | [optional] [default to False] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/docs/WhiteLabelConfiguration.md b/docs/WhiteLabelConfiguration.md index dac6b48..0e306bf 100644 --- a/docs/WhiteLabelConfiguration.md +++ b/docs/WhiteLabelConfiguration.md @@ -8,10 +8,13 @@ Name | Type | Description | Notes **enabled** | **bool** | Enable whitelabel configuration. | **brand_name** | **str** | Whitelabeled brand name. | **brand_short_name** | **str** | Short version of the brand name. | [optional] +**logo_mode** | **str** | Logo display mode: 'icon_and_text' or 'logo_only'. | [optional] [default to 'icon_and_text'] **logo_icon_url** | **str** | Brand icon URL. | **logo_full_url** | **str** | Brand full icon URL. | **favicon_url** | **str** | Favicon URL. | [optional] **primary_color** | **str** | Primary frontend color. | +**cloud_display_names** | **Dict[str, str]** | Map of cloud provider IDs to display names (e.g. {'nebius': 'My Cloud'}). | [optional] +**cloud_icon_urls** | **Dict[str, str]** | Map of cloud provider IDs to icon URLs. | [optional] **support_email** | **str** | Support contact email. | **website_url** | **str** | Website URL. | **docs_url** | **str** | Documentation URL. | [optional] diff --git a/docs/Workspace.md b/docs/Workspace.md index 5ecc992..078ca8a 100644 --- a/docs/Workspace.md +++ b/docs/Workspace.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **tags** | **Dict[str, str]** | Descriptive tags for the workspace. | [optional] **image_tag** | [**ImageTag**](ImageTag.md) | Image tag that is attached to the workspace. | [readonly] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [readonly] +**config_files** | **Dict[str, Dict[str, str]]** | User-defined config files written to $HOME at pod startup. | [optional] [readonly] **ide** | **str** | IDE of the workspace | [readonly] **start_script** | **str** | Shell script that runs on start before the primary command. | [readonly] **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [readonly] diff --git a/docs/WorkspaceCreate.md b/docs/WorkspaceCreate.md index 01badbf..e9f472d 100644 --- a/docs/WorkspaceCreate.md +++ b/docs/WorkspaceCreate.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments for the workspace. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script to run on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory for the workspace. | [optional] [default to '/home/jovyan/workspace'] **is_spot** | **bool** | Enables running on spot instance sizes. | [optional] [default to False] diff --git a/docs/WorkspaceServerOptions.md b/docs/WorkspaceServerOptions.md index 6caf76b..1bb817e 100644 --- a/docs/WorkspaceServerOptions.md +++ b/docs/WorkspaceServerOptions.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **auto_shutoff** | **List[str]** | List of available auto-shutoff settings. | [readonly] -**disk_space** | **List[str]** | List of available disk space sizes. | [readonly] +**disk_space** | [**List[DiskSpaceOption]**](DiskSpaceOption.md) | Available disk space sizes. | [readonly] **size** | [**List[InstanceSize]**](InstanceSize.md) | List of available instance sizes. | [readonly] ## Example diff --git a/docs/WorkspaceSpec.md b/docs/WorkspaceSpec.md index 9096e9b..661b771 100644 --- a/docs/WorkspaceSpec.md +++ b/docs/WorkspaceSpec.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | | [optional] **working_directory** | **str** | | [optional] **extra_packages** | [**ExtraPackagesRecipe**](ExtraPackagesRecipe.md) | | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | | [optional] **start_script** | **str** | | [optional] **token_scope** | **str** | | [optional] **dask_cluster** | [**DaskClusterAttachment**](DaskClusterAttachment.md) | | [optional] diff --git a/docs/WorkspaceUpdate.md b/docs/WorkspaceUpdate.md index fed6748..0b1e1ed 100644 --- a/docs/WorkspaceUpdate.md +++ b/docs/WorkspaceUpdate.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **environment_variables** | **Dict[str, str]** | Mapping of environment variable keys to values. | [optional] **external_repo_attachments** | [**List[ExternalRepoAttachmentNested]**](ExternalRepoAttachmentNested.md) | List of external repo attachments. | [optional] **extra_packages** | [**ExtraPackages**](ExtraPackages.md) | Addtitional packages to install on start. | [optional] +**config_files** | [**Dict[str, ConfigFileEntry]**](ConfigFileEntry.md) | User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode. | [optional] **start_script** | **str** | Shell script that runs on start before the primary command. | [optional] **working_dir** | **str** | Initial working directory. | [optional] **instance_size** | **str** | Instance size of the workspace. | [optional] diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 0a065e8..5275821 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -1966,7 +1966,7 @@ async with saturn_api.ApiClient(configuration) as api_client: group_id = 'group_id_example' # str | Reference owner by group ID. (optional) org_id = 'org_id_example' # str | Reference owner by org ID. (optional) owner = 'owner_example' # str | Reference owner by name. (optional) - name = 'name_example' # str | Prefix matched search string on workspace name. (optional) + name = 'name_example' # str | Substring matched search string on workspace name. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -1994,7 +1994,7 @@ Name | Type | Description | Notes **group_id** | **str**| Reference owner by group ID. | [optional] **org_id** | **str**| Reference owner by org ID. | [optional] **owner** | **str**| Reference owner by name. | [optional] - **name** | **str**| Prefix matched search string on workspace name. | [optional] + **name** | **str**| Substring matched search string on workspace name. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] @@ -2059,7 +2059,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.WorkspacesApi(api_client) workspace_id = 'workspace_id_example' # str | - subdomain = 'subdomain_example' # str | Prefix matched search string on route subdomain. (optional) + subdomain = 'subdomain_example' # str | Substring matched search string on route subdomain. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) page_size = 100 # int | Page size. (optional) (default to 100) @@ -2082,7 +2082,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workspace_id** | **str**| | - **subdomain** | **str**| Prefix matched search string on route subdomain. | [optional] + **subdomain** | **str**| Substring matched search string on route subdomain. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] **page_size** | **int**| Page size. | [optional] [default to 100] @@ -2146,7 +2146,7 @@ async with saturn_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = saturn_api.WorkspacesApi(api_client) workspace_id = 'workspace_id_example' # str | - location = 'location_example' # str | Prefix matched search string on secret attachment location. (optional) + location = 'location_example' # str | Substring matched search string on secret attachment location. (optional) attachment_type = saturn_api.SecretAttachmentType() # SecretAttachmentType | Filter secret attachments by type. (optional) prev_key = 'prev_key_example' # str | Previous page key. (optional) next_key = 'next_key_example' # str | Next page key. (optional) @@ -2170,7 +2170,7 @@ async with saturn_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workspace_id** | **str**| | - **location** | **str**| Prefix matched search string on secret attachment location. | [optional] + **location** | **str**| Substring matched search string on secret attachment location. | [optional] **attachment_type** | [**SecretAttachmentType**](.md)| Filter secret attachments by type. | [optional] **prev_key** | **str**| Previous page key. | [optional] **next_key** | **str**| Next page key. | [optional] diff --git a/requirements.txt b/requirements.txt index 6ab392f..ef5088f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -urllib3 >= 2.1.0, < 3.0.0 python_dateutil >= 2.8.2 -httpx = ">= 0.28.1" -pydantic >= 2 +httpx >= 0.28.1 +pydantic >= 2.11 typing-extensions >= 4.7.1 diff --git a/saturn_api/__init__.py b/saturn_api/__init__.py index 8d75f17..cc73703 100644 --- a/saturn_api/__init__.py +++ b/saturn_api/__init__.py @@ -20,15 +20,20 @@ "ActiveApi", "ApiStatusApi", "ApiTokensApi", + "ArtifactsApi", "AuthorizationApi", + "ClustersApi", "CurrentUserApi", "DaskClustersApi", + "DatasetsApi", "DeploymentsApi", "ExternalRepoAttachmentsApi", "ExternalReposApi", + "FineTuningJobsApi", "GroupsApi", "ImageTagsApi", "ImagesApi", + "InferenceEndpointsApi", "InfoApi", "InvitationsApi", "JobsApi", @@ -64,14 +69,26 @@ "ApiTokenList", "ApiTokenUpdate", "AppInfo", + "Artifact", + "ArtifactCreate", + "ArtifactKind", + "ArtifactList", + "ArtifactStatus", + "ArtifactUpdate", "Auth0Info", "AuthorizationCodeGrant", "AuthorizationGrant", "AuthorizationRefreshGrant", "AuthorizationTokenResponse", "BuildData", + "Cluster", + "ClusterConnectionType", + "ClusterCreate", + "ClusterList", + "ClusterUpdate", "ConcurrencyPolicy", "Condition", + "ConfigFileEntry", "ContainerRuntimeSummary", "ContainerStatus", "CronSchedule", @@ -95,6 +112,11 @@ "DaskWorkerRuntimeSummaryList", "DaskWorkerSummary", "DataPoint", + "Dataset", + "DatasetCreate", + "DatasetImportCreate", + "DatasetList", + "DatasetLockCreate", "DefaultImages", "DefaultSizes", "Deployment", @@ -108,6 +130,7 @@ "DeploymentStart", "DeploymentStatus", "DeploymentUpdate", + "DiskSpaceOption", "ExternalRepo", "ExternalRepoAttachment", "ExternalRepoAttachmentCreate", @@ -123,6 +146,10 @@ "ExtraPackagesRecipeApt", "ExtraPackagesRecipeConda", "ExtraPackagesRecipePip", + "FineTuneJobCreate", + "FineTuneJobList", + "FineTuneJobSummary", + "FineTuneJobView", "Group", "GroupCreate", "GroupList", @@ -133,6 +160,8 @@ "HardwareType", "HistoricLog", "HistoricLogList", + "Hyperparameters", + "Hyperparameters1", "Identity", "IdentityByGroupId", "IdentityByUserId", @@ -159,6 +188,10 @@ "ImageTagState", "ImageTagUpdate", "ImageUpdate", + "InferenceEndpointCreate", + "InferenceEndpointList", + "InferenceEndpointSummary", + "InferenceEndpointView", "InstanceSize", "Invitation", "InvitationCreate", @@ -258,6 +291,7 @@ "RouteCreate", "RouteList", "RouteReference", + "RouteState", "RouteUpdate", "SSHPrivateKey", "SSHPrivateKeyCreate", @@ -342,17 +376,24 @@ from saturn_api.api.active_api import ActiveApi as ActiveApi from saturn_api.api.api_status_api import ApiStatusApi as ApiStatusApi from saturn_api.api.api_tokens_api import ApiTokensApi as ApiTokensApi +from saturn_api.api.artifacts_api import ArtifactsApi as ArtifactsApi from saturn_api.api.authorization_api import AuthorizationApi as AuthorizationApi +from saturn_api.api.clusters_api import ClustersApi as ClustersApi from saturn_api.api.current_user_api import CurrentUserApi as CurrentUserApi from saturn_api.api.dask_clusters_api import DaskClustersApi as DaskClustersApi +from saturn_api.api.datasets_api import DatasetsApi as DatasetsApi from saturn_api.api.deployments_api import DeploymentsApi as DeploymentsApi from saturn_api.api.external_repo_attachments_api import ( ExternalRepoAttachmentsApi as ExternalRepoAttachmentsApi, ) from saturn_api.api.external_repos_api import ExternalReposApi as ExternalReposApi +from saturn_api.api.fine_tuning_jobs_api import FineTuningJobsApi as FineTuningJobsApi from saturn_api.api.groups_api import GroupsApi as GroupsApi from saturn_api.api.image_tags_api import ImageTagsApi as ImageTagsApi from saturn_api.api.images_api import ImagesApi as ImagesApi +from saturn_api.api.inference_endpoints_api import ( + InferenceEndpointsApi as InferenceEndpointsApi, +) from saturn_api.api.info_api import InfoApi as InfoApi from saturn_api.api.invitations_api import InvitationsApi as InvitationsApi from saturn_api.api.jobs_api import JobsApi as JobsApi @@ -398,6 +439,12 @@ from saturn_api.models.api_token_list import ApiTokenList as ApiTokenList from saturn_api.models.api_token_update import ApiTokenUpdate as ApiTokenUpdate from saturn_api.models.app_info import AppInfo as AppInfo +from saturn_api.models.artifact import Artifact as Artifact +from saturn_api.models.artifact_create import ArtifactCreate as ArtifactCreate +from saturn_api.models.artifact_kind import ArtifactKind as ArtifactKind +from saturn_api.models.artifact_list import ArtifactList as ArtifactList +from saturn_api.models.artifact_status import ArtifactStatus as ArtifactStatus +from saturn_api.models.artifact_update import ArtifactUpdate as ArtifactUpdate from saturn_api.models.auth0_info import Auth0Info as Auth0Info from saturn_api.models.authorization_code_grant import ( AuthorizationCodeGrant as AuthorizationCodeGrant, @@ -412,8 +459,16 @@ AuthorizationTokenResponse as AuthorizationTokenResponse, ) from saturn_api.models.build_data import BuildData as BuildData +from saturn_api.models.cluster import Cluster as Cluster +from saturn_api.models.cluster_connection_type import ( + ClusterConnectionType as ClusterConnectionType, +) +from saturn_api.models.cluster_create import ClusterCreate as ClusterCreate +from saturn_api.models.cluster_list import ClusterList as ClusterList +from saturn_api.models.cluster_update import ClusterUpdate as ClusterUpdate from saturn_api.models.concurrency_policy import ConcurrencyPolicy as ConcurrencyPolicy from saturn_api.models.condition import Condition as Condition +from saturn_api.models.config_file_entry import ConfigFileEntry as ConfigFileEntry from saturn_api.models.container_runtime_summary import ( ContainerRuntimeSummary as ContainerRuntimeSummary, ) @@ -455,6 +510,13 @@ ) from saturn_api.models.dask_worker_summary import DaskWorkerSummary as DaskWorkerSummary from saturn_api.models.data_point import DataPoint as DataPoint +from saturn_api.models.dataset import Dataset as Dataset +from saturn_api.models.dataset_create import DatasetCreate as DatasetCreate +from saturn_api.models.dataset_import_create import ( + DatasetImportCreate as DatasetImportCreate, +) +from saturn_api.models.dataset_list import DatasetList as DatasetList +from saturn_api.models.dataset_lock_create import DatasetLockCreate as DatasetLockCreate from saturn_api.models.default_images import DefaultImages as DefaultImages from saturn_api.models.default_sizes import DefaultSizes as DefaultSizes from saturn_api.models.deployment import Deployment as Deployment @@ -474,6 +536,7 @@ from saturn_api.models.deployment_start import DeploymentStart as DeploymentStart from saturn_api.models.deployment_status import DeploymentStatus as DeploymentStatus from saturn_api.models.deployment_update import DeploymentUpdate as DeploymentUpdate +from saturn_api.models.disk_space_option import DiskSpaceOption as DiskSpaceOption from saturn_api.models.external_repo import ExternalRepo as ExternalRepo from saturn_api.models.external_repo_attachment import ( ExternalRepoAttachment as ExternalRepoAttachment, @@ -513,6 +576,14 @@ from saturn_api.models.extra_packages_recipe_pip import ( ExtraPackagesRecipePip as ExtraPackagesRecipePip, ) +from saturn_api.models.fine_tune_job_create import ( + FineTuneJobCreate as FineTuneJobCreate, +) +from saturn_api.models.fine_tune_job_list import FineTuneJobList as FineTuneJobList +from saturn_api.models.fine_tune_job_summary import ( + FineTuneJobSummary as FineTuneJobSummary, +) +from saturn_api.models.fine_tune_job_view import FineTuneJobView as FineTuneJobView from saturn_api.models.group import Group as Group from saturn_api.models.group_create import GroupCreate as GroupCreate from saturn_api.models.group_list import GroupList as GroupList @@ -523,6 +594,8 @@ from saturn_api.models.hardware_type import HardwareType as HardwareType from saturn_api.models.historic_log import HistoricLog as HistoricLog from saturn_api.models.historic_log_list import HistoricLogList as HistoricLogList +from saturn_api.models.hyperparameters import Hyperparameters as Hyperparameters +from saturn_api.models.hyperparameters1 import Hyperparameters1 as Hyperparameters1 from saturn_api.models.identity import Identity as Identity from saturn_api.models.identity_by_group_id import ( IdentityByGroupId as IdentityByGroupId, @@ -555,6 +628,18 @@ from saturn_api.models.image_tag_state import ImageTagState as ImageTagState from saturn_api.models.image_tag_update import ImageTagUpdate as ImageTagUpdate from saturn_api.models.image_update import ImageUpdate as ImageUpdate +from saturn_api.models.inference_endpoint_create import ( + InferenceEndpointCreate as InferenceEndpointCreate, +) +from saturn_api.models.inference_endpoint_list import ( + InferenceEndpointList as InferenceEndpointList, +) +from saturn_api.models.inference_endpoint_summary import ( + InferenceEndpointSummary as InferenceEndpointSummary, +) +from saturn_api.models.inference_endpoint_view import ( + InferenceEndpointView as InferenceEndpointView, +) from saturn_api.models.instance_size import InstanceSize as InstanceSize from saturn_api.models.invitation import Invitation as Invitation from saturn_api.models.invitation_create import InvitationCreate as InvitationCreate @@ -724,6 +809,7 @@ from saturn_api.models.route_create import RouteCreate as RouteCreate from saturn_api.models.route_list import RouteList as RouteList from saturn_api.models.route_reference import RouteReference as RouteReference +from saturn_api.models.route_state import RouteState as RouteState from saturn_api.models.route_update import RouteUpdate as RouteUpdate from saturn_api.models.secret import Secret as Secret from saturn_api.models.secret_access_level import SecretAccessLevel as SecretAccessLevel diff --git a/saturn_api/api/__init__.py b/saturn_api/api/__init__.py index 74a63a4..2c09dfc 100644 --- a/saturn_api/api/__init__.py +++ b/saturn_api/api/__init__.py @@ -4,15 +4,20 @@ from saturn_api.api.active_api import ActiveApi from saturn_api.api.api_status_api import ApiStatusApi from saturn_api.api.api_tokens_api import ApiTokensApi +from saturn_api.api.artifacts_api import ArtifactsApi from saturn_api.api.authorization_api import AuthorizationApi +from saturn_api.api.clusters_api import ClustersApi from saturn_api.api.current_user_api import CurrentUserApi from saturn_api.api.dask_clusters_api import DaskClustersApi +from saturn_api.api.datasets_api import DatasetsApi from saturn_api.api.deployments_api import DeploymentsApi from saturn_api.api.external_repo_attachments_api import ExternalRepoAttachmentsApi from saturn_api.api.external_repos_api import ExternalReposApi +from saturn_api.api.fine_tuning_jobs_api import FineTuningJobsApi from saturn_api.api.groups_api import GroupsApi from saturn_api.api.image_tags_api import ImageTagsApi from saturn_api.api.images_api import ImagesApi +from saturn_api.api.inference_endpoints_api import InferenceEndpointsApi from saturn_api.api.info_api import InfoApi from saturn_api.api.invitations_api import InvitationsApi from saturn_api.api.jobs_api import JobsApi diff --git a/saturn_api/api/active_api.py b/saturn_api/api/active_api.py index ba4f742..85c821e 100644 --- a/saturn_api/api/active_api.py +++ b/saturn_api/api/active_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/api_status_api.py b/saturn_api/api/api_status_api.py index 2c02ec5..014719c 100644 --- a/saturn_api/api/api_status_api.py +++ b/saturn_api/api/api_status_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/api_tokens_api.py b/saturn_api/api/api_tokens_api.py index cae4ff9..2013fe2 100644 --- a/saturn_api/api/api_tokens_api.py +++ b/saturn_api/api/api_tokens_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/artifacts_api.py b/saturn_api/api/artifacts_api.py new file mode 100644 index 0000000..47c3101 --- /dev/null +++ b/saturn_api/api/artifacts_api.py @@ -0,0 +1,1360 @@ +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from saturn_api.api_client import ApiClient, RequestSerialized +from saturn_api.api_response import ApiResponse +from saturn_api.models.artifact import Artifact +from saturn_api.models.artifact_create import ArtifactCreate +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_list import ArtifactList +from saturn_api.models.artifact_update import ArtifactUpdate +from saturn_api.rest import RESTResponseType + + +class ArtifactsApi: + """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( + self, + org_id: StrictStr, + artifact_create: ArtifactCreate, + _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, + ) -> Artifact: + """Create artifact + + Create a new artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_create: (required) + :type artifact_create: ArtifactCreate + :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_serialize( + org_id=org_id, + artifact_create=artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Artifact", + } + 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_with_http_info( + self, + org_id: StrictStr, + artifact_create: ArtifactCreate, + _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[Artifact]: + """Create artifact + + Create a new artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_create: (required) + :type artifact_create: ArtifactCreate + :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_serialize( + org_id=org_id, + artifact_create=artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Artifact", + } + 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_without_preload_content( + self, + org_id: StrictStr, + artifact_create: ArtifactCreate, + _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 artifact + + Create a new artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_create: (required) + :type artifact_create: ArtifactCreate + :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_serialize( + org_id=org_id, + artifact_create=artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Artifact", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serialize( + self, + org_id, + artifact_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if artifact_create is not None: + _body_params = artifact_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/artifacts", + 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( + self, + org_id: StrictStr, + artifact_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, + ) -> None: + """Delete artifact + + Delete an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_with_http_info( + self, + org_id: StrictStr, + artifact_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[None]: + """Delete artifact + + Delete an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_without_preload_content( + self, + org_id: StrictStr, + artifact_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 artifact + + Delete an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_serialize( + self, + org_id, + artifact_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 org_id is not None: + _path_params["org_id"] = org_id + if artifact_id is not None: + _path_params["artifact_id"] = artifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/api/orgs/{org_id}/artifacts/{artifact_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( + self, + org_id: StrictStr, + artifact_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, + ) -> Artifact: + """Get artifact + + Get an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + 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_with_http_info( + self, + org_id: StrictStr, + artifact_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[Artifact]: + """Get artifact + + Get an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + 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_without_preload_content( + self, + org_id: StrictStr, + artifact_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 artifact + + Get an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_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_serialize( + org_id=org_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serialize( + self, + org_id, + artifact_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 org_id is not None: + _path_params["org_id"] = org_id + if artifact_id is not None: + _path_params["artifact_id"] = artifact_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/artifacts/{artifact_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( + self, + org_id: StrictStr, + kind: Annotated[ + Optional[ArtifactKind], Field(description="Filter artifacts by kind.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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, + ) -> ArtifactList: + """List artifacts + + Paginated list of artifacts. + + :param org_id: (required) + :type org_id: str + :param kind: Filter artifacts by kind. + :type kind: ArtifactKind + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + kind=kind, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ArtifactList", + } + 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_with_http_info( + self, + org_id: StrictStr, + kind: Annotated[ + Optional[ArtifactKind], Field(description="Filter artifacts by kind.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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[ArtifactList]: + """List artifacts + + Paginated list of artifacts. + + :param org_id: (required) + :type org_id: str + :param kind: Filter artifacts by kind. + :type kind: ArtifactKind + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + kind=kind, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ArtifactList", + } + 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_without_preload_content( + self, + org_id: StrictStr, + kind: Annotated[ + Optional[ArtifactKind], Field(description="Filter artifacts by kind.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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 artifacts + + Paginated list of artifacts. + + :param org_id: (required) + :type org_id: str + :param kind: Filter artifacts by kind. + :type kind: ArtifactKind + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + kind=kind, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ArtifactList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_serialize( + self, + org_id, + kind, + prev_key, + next_key, + page_size, + descending, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + if kind is not None: + + _query_params.append(("kind", kind.value)) + + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + if descending is not None: + + _query_params.append(("descending", descending)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/artifacts", + 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 update( + self, + org_id: StrictStr, + artifact_id: StrictStr, + artifact_update: ArtifactUpdate, + _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, + ) -> Artifact: + """Update artifact + + Update an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_id: str + :param artifact_update: (required) + :type artifact_update: ArtifactUpdate + :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._update_serialize( + org_id=org_id, + artifact_id=artifact_id, + artifact_update=artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + 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 update_with_http_info( + self, + org_id: StrictStr, + artifact_id: StrictStr, + artifact_update: ArtifactUpdate, + _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[Artifact]: + """Update artifact + + Update an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_id: str + :param artifact_update: (required) + :type artifact_update: ArtifactUpdate + :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._update_serialize( + org_id=org_id, + artifact_id=artifact_id, + artifact_update=artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + 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 update_without_preload_content( + self, + org_id: StrictStr, + artifact_id: StrictStr, + artifact_update: ArtifactUpdate, + _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: + """Update artifact + + Update an artifact. + + :param org_id: (required) + :type org_id: str + :param artifact_id: (required) + :type artifact_id: str + :param artifact_update: (required) + :type artifact_update: ArtifactUpdate + :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._update_serialize( + org_id=org_id, + artifact_id=artifact_id, + artifact_update=artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Artifact", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_serialize( + self, + org_id, + artifact_id, + artifact_update, + _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 org_id is not None: + _path_params["org_id"] = org_id + if artifact_id is not None: + _path_params["artifact_id"] = artifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if artifact_update is not None: + _body_params = artifact_update + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/orgs/{org_id}/artifacts/{artifact_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, + ) diff --git a/saturn_api/api/authorization_api.py b/saturn_api/api/authorization_api.py index bee9979..0fac217 100644 --- a/saturn_api/api/authorization_api.py +++ b/saturn_api/api/authorization_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/clusters_api.py b/saturn_api/api/clusters_api.py new file mode 100644 index 0000000..dc62935 --- /dev/null +++ b/saturn_api/api/clusters_api.py @@ -0,0 +1,1307 @@ +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from saturn_api.api_client import ApiClient, RequestSerialized +from saturn_api.api_response import ApiResponse +from saturn_api.models.cluster import Cluster +from saturn_api.models.cluster_create import ClusterCreate +from saturn_api.models.cluster_list import ClusterList +from saturn_api.models.cluster_update import ClusterUpdate +from saturn_api.rest import RESTResponseType + + +class ClustersApi: + """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( + self, + cluster_create: ClusterCreate, + _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, + ) -> Cluster: + """Create cluster + + Create a new cluster. + + :param cluster_create: (required) + :type cluster_create: ClusterCreate + :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_serialize( + cluster_create=cluster_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Cluster", + } + 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_with_http_info( + self, + cluster_create: ClusterCreate, + _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[Cluster]: + """Create cluster + + Create a new cluster. + + :param cluster_create: (required) + :type cluster_create: ClusterCreate + :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_serialize( + cluster_create=cluster_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Cluster", + } + 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_without_preload_content( + self, + cluster_create: ClusterCreate, + _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 cluster + + Create a new cluster. + + :param cluster_create: (required) + :type cluster_create: ClusterCreate + :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_serialize( + cluster_create=cluster_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Cluster", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serialize( + self, + cluster_create, + _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 cluster_create is not None: + _body_params = cluster_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/clusters", + 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( + self, + cluster_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, + ) -> None: + """Delete cluster + + Delete a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_with_http_info( + self, + cluster_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[None]: + """Delete cluster + + Delete a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_without_preload_content( + self, + cluster_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 cluster + + Delete a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_serialize( + self, + cluster_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 cluster_id is not None: + _path_params["cluster_id"] = cluster_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/api/clusters/{cluster_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( + self, + cluster_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, + ) -> Cluster: + """Get cluster + + Get a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + 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_with_http_info( + self, + cluster_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[Cluster]: + """Get cluster + + Get a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + 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_without_preload_content( + self, + cluster_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 cluster + + Get a cluster. + + :param cluster_id: (required) + :type cluster_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_serialize( + cluster_id=cluster_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serialize( + self, + cluster_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 cluster_id is not None: + _path_params["cluster_id"] = cluster_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/clusters/{cluster_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( + self, + org_id: Annotated[ + Optional[StrictStr], Field(description="Filter clusters by org ID.") + ] = None, + name: Annotated[ + Optional[StrictStr], Field(description="Substring search on cluster name.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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, + ) -> ClusterList: + """List clusters + + Paginated list of clusters. + + :param org_id: Filter clusters by org ID. + :type org_id: str + :param name: Substring search on cluster name. + :type name: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + name=name, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ClusterList", + } + 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_with_http_info( + self, + org_id: Annotated[ + Optional[StrictStr], Field(description="Filter clusters by org ID.") + ] = None, + name: Annotated[ + Optional[StrictStr], Field(description="Substring search on cluster name.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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[ClusterList]: + """List clusters + + Paginated list of clusters. + + :param org_id: Filter clusters by org ID. + :type org_id: str + :param name: Substring search on cluster name. + :type name: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + name=name, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ClusterList", + } + 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_without_preload_content( + self, + org_id: Annotated[ + Optional[StrictStr], Field(description="Filter clusters by org ID.") + ] = None, + name: Annotated[ + Optional[StrictStr], Field(description="Substring search on cluster name.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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 clusters + + Paginated list of clusters. + + :param org_id: Filter clusters by org ID. + :type org_id: str + :param name: Substring search on cluster name. + :type name: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + name=name, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ClusterList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_serialize( + self, + org_id, + name, + prev_key, + next_key, + page_size, + descending, + _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 + if org_id is not None: + + _query_params.append(("org_id", org_id)) + + if name is not None: + + _query_params.append(("name", name)) + + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + if descending is not None: + + _query_params.append(("descending", descending)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/clusters", + 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 update( + self, + cluster_id: StrictStr, + cluster_update: ClusterUpdate, + _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, + ) -> Cluster: + """Update cluster + + Update a cluster. + + :param cluster_id: (required) + :type cluster_id: str + :param cluster_update: (required) + :type cluster_update: ClusterUpdate + :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._update_serialize( + cluster_id=cluster_id, + cluster_update=cluster_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + 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 update_with_http_info( + self, + cluster_id: StrictStr, + cluster_update: ClusterUpdate, + _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[Cluster]: + """Update cluster + + Update a cluster. + + :param cluster_id: (required) + :type cluster_id: str + :param cluster_update: (required) + :type cluster_update: ClusterUpdate + :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._update_serialize( + cluster_id=cluster_id, + cluster_update=cluster_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + 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 update_without_preload_content( + self, + cluster_id: StrictStr, + cluster_update: ClusterUpdate, + _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: + """Update cluster + + Update a cluster. + + :param cluster_id: (required) + :type cluster_id: str + :param cluster_update: (required) + :type cluster_update: ClusterUpdate + :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._update_serialize( + cluster_id=cluster_id, + cluster_update=cluster_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Cluster", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_serialize( + self, + cluster_id, + cluster_update, + _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 cluster_id is not None: + _path_params["cluster_id"] = cluster_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if cluster_update is not None: + _body_params = cluster_update + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/clusters/{cluster_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, + ) diff --git a/saturn_api/api/current_user_api.py b/saturn_api/api/current_user_api.py index d6ace1b..bdd0708 100644 --- a/saturn_api/api/current_user_api.py +++ b/saturn_api/api/current_user_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -40,6 +38,210 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call + async def delete( + self, + _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, + ) -> None: + """Delete current user + + + :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_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_with_http_info( + self, + _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[None]: + """Delete current user + + + :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_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_without_preload_content( + self, + _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 current user + + + :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_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_serialize( + self, + _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 + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/api/user", + 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( self, diff --git a/saturn_api/api/dask_clusters_api.py b/saturn_api/api/dask_clusters_api.py index 8fa23ff..6935694 100644 --- a/saturn_api/api/dask_clusters_api.py +++ b/saturn_api/api/dask_clusters_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/datasets_api.py b/saturn_api/api/datasets_api.py new file mode 100644 index 0000000..fdc8107 --- /dev/null +++ b/saturn_api/api/datasets_api.py @@ -0,0 +1,1836 @@ +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from saturn_api.api_client import ApiClient, RequestSerialized +from saturn_api.api_response import ApiResponse +from saturn_api.models.artifact_status import ArtifactStatus +from saturn_api.models.dataset import Dataset +from saturn_api.models.dataset_create import DatasetCreate +from saturn_api.models.dataset_import_create import DatasetImportCreate +from saturn_api.models.dataset_list import DatasetList +from saturn_api.models.dataset_lock_create import DatasetLockCreate +from saturn_api.rest import RESTResponseType + + +class DatasetsApi: + """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 call_import( + self, + org_id: StrictStr, + dataset_import_create: Optional[DatasetImportCreate] = 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, + ) -> Dataset: + """Import dataset + + Create a dataset in `assembling` state and launch a CPU job that downloads the given Hugging Face dataset, auto-detects its shape, normalises it to the canonical conversational format, and writes it into the org's tf-datasets folder. The job marks the dataset `ready` on success or `error` if the source format is not recognised. + + :param org_id: (required) + :type org_id: str + :param dataset_import_create: + :type dataset_import_create: DatasetImportCreate + :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._call_import_serialize( + org_id=org_id, + dataset_import_create=dataset_import_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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 call_import_with_http_info( + self, + org_id: StrictStr, + dataset_import_create: Optional[DatasetImportCreate] = 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[Dataset]: + """Import dataset + + Create a dataset in `assembling` state and launch a CPU job that downloads the given Hugging Face dataset, auto-detects its shape, normalises it to the canonical conversational format, and writes it into the org's tf-datasets folder. The job marks the dataset `ready` on success or `error` if the source format is not recognised. + + :param org_id: (required) + :type org_id: str + :param dataset_import_create: + :type dataset_import_create: DatasetImportCreate + :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._call_import_serialize( + org_id=org_id, + dataset_import_create=dataset_import_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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 call_import_without_preload_content( + self, + org_id: StrictStr, + dataset_import_create: Optional[DatasetImportCreate] = 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: + """Import dataset + + Create a dataset in `assembling` state and launch a CPU job that downloads the given Hugging Face dataset, auto-detects its shape, normalises it to the canonical conversational format, and writes it into the org's tf-datasets folder. The job marks the dataset `ready` on success or `error` if the source format is not recognised. + + :param org_id: (required) + :type org_id: str + :param dataset_import_create: + :type dataset_import_create: DatasetImportCreate + :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._call_import_serialize( + org_id=org_id, + dataset_import_create=dataset_import_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _call_import_serialize( + self, + org_id, + dataset_import_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dataset_import_create is not None: + _body_params = dataset_import_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/datasets/import", + 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 create( + self, + org_id: StrictStr, + dataset_create: DatasetCreate, + _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, + ) -> Dataset: + """Create dataset + + Create a new dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_create: (required) + :type dataset_create: DatasetCreate + :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_serialize( + org_id=org_id, + dataset_create=dataset_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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_with_http_info( + self, + org_id: StrictStr, + dataset_create: DatasetCreate, + _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[Dataset]: + """Create dataset + + Create a new dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_create: (required) + :type dataset_create: DatasetCreate + :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_serialize( + org_id=org_id, + dataset_create=dataset_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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_without_preload_content( + self, + org_id: StrictStr, + dataset_create: DatasetCreate, + _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 dataset + + Create a new dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_create: (required) + :type dataset_create: DatasetCreate + :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_serialize( + org_id=org_id, + dataset_create=dataset_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serialize( + self, + org_id, + dataset_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dataset_create is not None: + _body_params = dataset_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/datasets", + 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( + self, + org_id: StrictStr, + dataset_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, + ) -> None: + """Delete dataset + + Delete a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_with_http_info( + self, + org_id: StrictStr, + dataset_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[None]: + """Delete dataset + + Delete a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_without_preload_content( + self, + org_id: StrictStr, + dataset_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 dataset + + Delete a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_serialize( + self, + org_id, + dataset_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 org_id is not None: + _path_params["org_id"] = org_id + if dataset_id is not None: + _path_params["dataset_id"] = dataset_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/api/orgs/{org_id}/token-factory/datasets/{dataset_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( + self, + org_id: StrictStr, + dataset_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, + ) -> Dataset: + """Get dataset + + Get a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + 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_with_http_info( + self, + org_id: StrictStr, + dataset_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[Dataset]: + """Get dataset + + Get a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + 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_without_preload_content( + self, + org_id: StrictStr, + dataset_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 dataset + + Get a dataset. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serialize( + self, + org_id, + dataset_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 org_id is not None: + _path_params["org_id"] = org_id + if dataset_id is not None: + _path_params["dataset_id"] = dataset_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/datasets/{dataset_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( + self, + org_id: StrictStr, + status: Annotated[ + Optional[ArtifactStatus], Field(description="Filter datasets by status.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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, + ) -> DatasetList: + """List datasets + + Paginated list of datasets. + + :param org_id: (required) + :type org_id: str + :param status: Filter datasets by status. + :type status: ArtifactStatus + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + status=status, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DatasetList", + } + 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_with_http_info( + self, + org_id: StrictStr, + status: Annotated[ + Optional[ArtifactStatus], Field(description="Filter datasets by status.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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[DatasetList]: + """List datasets + + Paginated list of datasets. + + :param org_id: (required) + :type org_id: str + :param status: Filter datasets by status. + :type status: ArtifactStatus + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + status=status, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DatasetList", + } + 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_without_preload_content( + self, + org_id: StrictStr, + status: Annotated[ + Optional[ArtifactStatus], Field(description="Filter datasets by status.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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 datasets + + Paginated list of datasets. + + :param org_id: (required) + :type org_id: str + :param status: Filter datasets by status. + :type status: ArtifactStatus + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + status=status, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DatasetList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_serialize( + self, + org_id, + status, + prev_key, + next_key, + page_size, + descending, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + if status is not None: + + _query_params.append(("status", status.value)) + + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + if descending is not None: + + _query_params.append(("descending", descending)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/datasets", + 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 lock( + self, + org_id: StrictStr, + dataset_lock_create: Optional[DatasetLockCreate] = 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, + ) -> Dataset: + """Lock shared folder as dataset + + Register an existing SharedFolder (that already holds dataset bytes) as a dataset, zero-copy, by locking it to ReadOnlyMany. No job runs and nothing is copied; the dataset is immediately `ready` and its location points at the existing folder. The folder becomes read-only. + + :param org_id: (required) + :type org_id: str + :param dataset_lock_create: + :type dataset_lock_create: DatasetLockCreate + :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._lock_serialize( + org_id=org_id, + dataset_lock_create=dataset_lock_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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 lock_with_http_info( + self, + org_id: StrictStr, + dataset_lock_create: Optional[DatasetLockCreate] = 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[Dataset]: + """Lock shared folder as dataset + + Register an existing SharedFolder (that already holds dataset bytes) as a dataset, zero-copy, by locking it to ReadOnlyMany. No job runs and nothing is copied; the dataset is immediately `ready` and its location points at the existing folder. The folder becomes read-only. + + :param org_id: (required) + :type org_id: str + :param dataset_lock_create: + :type dataset_lock_create: DatasetLockCreate + :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._lock_serialize( + org_id=org_id, + dataset_lock_create=dataset_lock_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + 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 lock_without_preload_content( + self, + org_id: StrictStr, + dataset_lock_create: Optional[DatasetLockCreate] = 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: + """Lock shared folder as dataset + + Register an existing SharedFolder (that already holds dataset bytes) as a dataset, zero-copy, by locking it to ReadOnlyMany. No job runs and nothing is copied; the dataset is immediately `ready` and its location points at the existing folder. The folder becomes read-only. + + :param org_id: (required) + :type org_id: str + :param dataset_lock_create: + :type dataset_lock_create: DatasetLockCreate + :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._lock_serialize( + org_id=org_id, + dataset_lock_create=dataset_lock_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Dataset", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _lock_serialize( + self, + org_id, + dataset_lock_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dataset_lock_create is not None: + _body_params = dataset_lock_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/datasets/lock", + 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 seal( + self, + org_id: StrictStr, + dataset_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, + ) -> Dataset: + """Seal dataset + + Transition a dataset from `assembling` to `ready`, making it immutable. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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._seal_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + 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 seal_with_http_info( + self, + org_id: StrictStr, + dataset_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[Dataset]: + """Seal dataset + + Transition a dataset from `assembling` to `ready`, making it immutable. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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._seal_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + 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 seal_without_preload_content( + self, + org_id: StrictStr, + dataset_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: + """Seal dataset + + Transition a dataset from `assembling` to `ready`, making it immutable. + + :param org_id: (required) + :type org_id: str + :param dataset_id: (required) + :type dataset_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._seal_serialize( + org_id=org_id, + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dataset", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _seal_serialize( + self, + org_id, + dataset_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 org_id is not None: + _path_params["org_id"] = org_id + if dataset_id is not None: + _path_params["dataset_id"] = dataset_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/datasets/{dataset_id}/seal", + 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/saturn_api/api/deployments_api.py b/saturn_api/api/deployments_api.py index 4fe8104..6f2d1e9 100644 --- a/saturn_api/api/deployments_api.py +++ b/saturn_api/api/deployments_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -5698,7 +5696,13 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on deployment name."), + Field(description="Substring matched search string on deployment name."), + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -5735,8 +5739,10 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on deployment name. + :param name: Substring matched search string on deployment name. :type name: str + :param tags: Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -5775,6 +5781,7 @@ async def list( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -5819,7 +5826,13 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on deployment name."), + Field(description="Substring matched search string on deployment name."), + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -5856,8 +5869,10 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on deployment name. + :param name: Substring matched search string on deployment name. :type name: str + :param tags: Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -5896,6 +5911,7 @@ async def list_with_http_info( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -5940,7 +5956,13 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on deployment name."), + Field(description="Substring matched search string on deployment name."), + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -5977,8 +5999,10 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on deployment name. + :param name: Substring matched search string on deployment name. :type name: str + :param tags: Filter to deployments whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -6017,6 +6041,7 @@ async def list_without_preload_content( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -6042,6 +6067,7 @@ def _list_serialize( org_id, owner, name, + tags, prev_key, next_key, page_size, @@ -6093,6 +6119,10 @@ def _list_serialize( _query_params.append(("name", name)) + if tags is not None: + + _query_params.append(("tags", tags)) + if prev_key is not None: _query_params.append(("prev_key", prev_key)) @@ -6141,7 +6171,7 @@ async def list_routes( deployment_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6168,7 +6198,7 @@ async def list_routes( :param deployment_id: (required) :type deployment_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6229,7 +6259,7 @@ async def list_routes_with_http_info( deployment_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6256,7 +6286,7 @@ async def list_routes_with_http_info( :param deployment_id: (required) :type deployment_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6317,7 +6347,7 @@ async def list_routes_without_preload_content( deployment_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6344,7 +6374,7 @@ async def list_routes_without_preload_content( :param deployment_id: (required) :type deployment_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6476,7 +6506,7 @@ async def list_secret_attachments( deployment_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6505,7 +6535,7 @@ async def list_secret_attachments( :param deployment_id: (required) :type deployment_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -6569,7 +6599,7 @@ async def list_secret_attachments_with_http_info( deployment_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6598,7 +6628,7 @@ async def list_secret_attachments_with_http_info( :param deployment_id: (required) :type deployment_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -6662,7 +6692,7 @@ async def list_secret_attachments_without_preload_content( deployment_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6691,7 +6721,7 @@ async def list_secret_attachments_without_preload_content( :param deployment_id: (required) :type deployment_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType diff --git a/saturn_api/api/external_repo_attachments_api.py b/saturn_api/api/external_repo_attachments_api.py index d05f5f2..dae0975 100644 --- a/saturn_api/api/external_repo_attachments_api.py +++ b/saturn_api/api/external_repo_attachments_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/external_repos_api.py b/saturn_api/api/external_repos_api.py index 1609bf7..2e16d52 100644 --- a/saturn_api/api/external_repos_api.py +++ b/saturn_api/api/external_repos_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -751,7 +749,7 @@ async def list( ] = None, remote_url: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on repository remote URL."), + Field(description="Substring matched search string on repository remote URL."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -788,7 +786,7 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param remote_url: Prefix matched search string on repository remote URL. + :param remote_url: Substring matched search string on repository remote URL. :type remote_url: str :param prev_key: Previous page key. :type prev_key: str @@ -872,7 +870,7 @@ async def list_with_http_info( ] = None, remote_url: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on repository remote URL."), + Field(description="Substring matched search string on repository remote URL."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -909,7 +907,7 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param remote_url: Prefix matched search string on repository remote URL. + :param remote_url: Substring matched search string on repository remote URL. :type remote_url: str :param prev_key: Previous page key. :type prev_key: str @@ -993,7 +991,7 @@ async def list_without_preload_content( ] = None, remote_url: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on repository remote URL."), + Field(description="Substring matched search string on repository remote URL."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -1030,7 +1028,7 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param remote_url: Prefix matched search string on repository remote URL. + :param remote_url: Substring matched search string on repository remote URL. :type remote_url: str :param prev_key: Previous page key. :type prev_key: str diff --git a/saturn_api/api/fine_tuning_jobs_api.py b/saturn_api/api/fine_tuning_jobs_api.py new file mode 100644 index 0000000..3c54d95 --- /dev/null +++ b/saturn_api/api/fine_tuning_jobs_api.py @@ -0,0 +1,1423 @@ +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from saturn_api.api_client import ApiClient, RequestSerialized +from saturn_api.api_response import ApiResponse +from saturn_api.models.fine_tune_job_create import FineTuneJobCreate +from saturn_api.models.fine_tune_job_list import FineTuneJobList +from saturn_api.models.fine_tune_job_view import FineTuneJobView +from saturn_api.models.historic_log_list import HistoricLogList +from saturn_api.rest import RESTResponseType + + +class FineTuningJobsApi: + """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( + self, + org_id: StrictStr, + fine_tune_job_create: FineTuneJobCreate, + _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, + ) -> FineTuneJobView: + """Create fine-tuning job + + Create a new fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param fine_tune_job_create: (required) + :type fine_tune_job_create: FineTuneJobCreate + :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_serialize( + org_id=org_id, + fine_tune_job_create=fine_tune_job_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "FineTuneJobView", + } + 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_with_http_info( + self, + org_id: StrictStr, + fine_tune_job_create: FineTuneJobCreate, + _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[FineTuneJobView]: + """Create fine-tuning job + + Create a new fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param fine_tune_job_create: (required) + :type fine_tune_job_create: FineTuneJobCreate + :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_serialize( + org_id=org_id, + fine_tune_job_create=fine_tune_job_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "FineTuneJobView", + } + 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_without_preload_content( + self, + org_id: StrictStr, + fine_tune_job_create: FineTuneJobCreate, + _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 fine-tuning job + + Create a new fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param fine_tune_job_create: (required) + :type fine_tune_job_create: FineTuneJobCreate + :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_serialize( + org_id=org_id, + fine_tune_job_create=fine_tune_job_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "FineTuneJobView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serialize( + self, + org_id, + fine_tune_job_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fine_tune_job_create is not None: + _body_params = fine_tune_job_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/fine-tuning/jobs", + 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( + self, + org_id: StrictStr, + job_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, + ) -> FineTuneJobView: + """Get fine-tuning job + + Get a fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + 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_with_http_info( + self, + org_id: StrictStr, + job_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[FineTuneJobView]: + """Get fine-tuning job + + Get a fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + 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_without_preload_content( + self, + org_id: StrictStr, + job_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 fine-tuning job + + Get a fine-tuning job. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serialize( + self, + org_id, + job_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 org_id is not None: + _path_params["org_id"] = org_id + if job_id is not None: + _path_params["job_id"] = job_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_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_logs( + self, + org_id: StrictStr, + job_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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, + ) -> HistoricLogList: + """Get fine-tuning job historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + job_id=job_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + 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_logs_with_http_info( + self, + org_id: StrictStr, + job_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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[HistoricLogList]: + """Get fine-tuning job historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + job_id=job_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + 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_logs_without_preload_content( + self, + org_id: StrictStr, + job_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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: + """Get fine-tuning job historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + job_id=job_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_logs_serialize( + self, + org_id, + job_id, + pod_name, + cluster, + prev_key, + next_key, + page_size, + _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 org_id is not None: + _path_params["org_id"] = org_id + if job_id is not None: + _path_params["job_id"] = job_id + # process the query parameters + if pod_name is not None: + + _query_params.append(("pod_name", pod_name)) + + if cluster is not None: + + _query_params.append(("cluster", cluster)) + + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/logs", + 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 jobs_cancel( + self, + org_id: StrictStr, + job_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, + ) -> FineTuneJobView: + """Cancel fine-tuning job + + Stop the underlying intermittent deployment. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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._jobs_cancel_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + 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 jobs_cancel_with_http_info( + self, + org_id: StrictStr, + job_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[FineTuneJobView]: + """Cancel fine-tuning job + + Stop the underlying intermittent deployment. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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._jobs_cancel_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + 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 jobs_cancel_without_preload_content( + self, + org_id: StrictStr, + job_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: + """Cancel fine-tuning job + + Stop the underlying intermittent deployment. + + :param org_id: (required) + :type org_id: str + :param job_id: (required) + :type job_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._jobs_cancel_serialize( + org_id=org_id, + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _jobs_cancel_serialize( + self, + org_id, + job_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 org_id is not None: + _path_params["org_id"] = org_id + if job_id is not None: + _path_params["job_id"] = job_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/fine-tuning/jobs/{job_id}/cancel", + 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( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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, + ) -> FineTuneJobList: + """List fine-tuning jobs + + Paginated list of fine-tuning jobs. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobList", + } + 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_with_http_info( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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[FineTuneJobList]: + """List fine-tuning jobs + + Paginated list of fine-tuning jobs. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobList", + } + 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_without_preload_content( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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 fine-tuning jobs + + Paginated list of fine-tuning jobs. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FineTuneJobList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_serialize( + self, + org_id, + prev_key, + next_key, + page_size, + descending, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + if descending is not None: + + _query_params.append(("descending", descending)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/fine-tuning/jobs", + 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/saturn_api/api/groups_api.py b/saturn_api/api/groups_api.py index b0198e2..b8a9ad1 100644 --- a/saturn_api/api/groups_api.py +++ b/saturn_api/api/groups_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -1478,7 +1476,7 @@ def _get_daily_usage_serialize( async def list( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on group name.") + Optional[StrictStr], Field(description="Substring matched search string on group name.") ] = None, org_id: Annotated[ Optional[StrictStr], @@ -1515,7 +1513,7 @@ async def list( Paginated list of groups. - :param name: Prefix matched search string on group name. + :param name: Substring matched search string on group name. :type name: str :param org_id: Org ID to query for groups. Defaults to the default org for the authenticated user. :type org_id: str @@ -1579,7 +1577,7 @@ async def list( async def list_with_http_info( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on group name.") + Optional[StrictStr], Field(description="Substring matched search string on group name.") ] = None, org_id: Annotated[ Optional[StrictStr], @@ -1616,7 +1614,7 @@ async def list_with_http_info( Paginated list of groups. - :param name: Prefix matched search string on group name. + :param name: Substring matched search string on group name. :type name: str :param org_id: Org ID to query for groups. Defaults to the default org for the authenticated user. :type org_id: str @@ -1680,7 +1678,7 @@ async def list_with_http_info( async def list_without_preload_content( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on group name.") + Optional[StrictStr], Field(description="Substring matched search string on group name.") ] = None, org_id: Annotated[ Optional[StrictStr], @@ -1717,7 +1715,7 @@ async def list_without_preload_content( Paginated list of groups. - :param name: Prefix matched search string on group name. + :param name: Substring matched search string on group name. :type name: str :param org_id: Org ID to query for groups. Defaults to the default org for the authenticated user. :type org_id: str @@ -1861,7 +1859,7 @@ async def list_members( group_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on group member username."), + Field(description="Substring matched search string on group member username."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -1887,7 +1885,7 @@ async def list_members( :param group_id: (required) :type group_id: str - :param name: Prefix matched search string on group member username. + :param name: Substring matched search string on group member username. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -1948,7 +1946,7 @@ async def list_members_with_http_info( group_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on group member username."), + Field(description="Substring matched search string on group member username."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -1974,7 +1972,7 @@ async def list_members_with_http_info( :param group_id: (required) :type group_id: str - :param name: Prefix matched search string on group member username. + :param name: Substring matched search string on group member username. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -2035,7 +2033,7 @@ async def list_members_without_preload_content( group_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on group member username."), + Field(description="Substring matched search string on group member username."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -2061,7 +2059,7 @@ async def list_members_without_preload_content( :param group_id: (required) :type group_id: str - :param name: Prefix matched search string on group member username. + :param name: Substring matched search string on group member username. :type name: str :param prev_key: Previous page key. :type prev_key: str diff --git a/saturn_api/api/image_tags_api.py b/saturn_api/api/image_tags_api.py index 00c2dc3..9124d6d 100644 --- a/saturn_api/api/image_tags_api.py +++ b/saturn_api/api/image_tags_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -1600,10 +1598,11 @@ async def list( image_id: StrictStr, version: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on image tag version."), + Field(description="Substring matched search string on image tag version."), ] = None, image_uri: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image tag URI.") + Optional[StrictStr], + Field(description="Substring matched search string on image tag URI."), ] = None, is_external: Annotated[ Optional[StrictBool], Field(description="Filter image tags by is_external.") @@ -1639,9 +1638,9 @@ async def list( :param image_id: (required) :type image_id: str - :param version: Prefix matched search string on image tag version. + :param version: Substring matched search string on image tag version. :type version: str - :param image_uri: Prefix matched search string on image tag URI. + :param image_uri: Substring matched search string on image tag URI. :type image_uri: str :param is_external: Filter image tags by is_external. :type is_external: bool @@ -1712,10 +1711,11 @@ async def list_with_http_info( image_id: StrictStr, version: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on image tag version."), + Field(description="Substring matched search string on image tag version."), ] = None, image_uri: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image tag URI.") + Optional[StrictStr], + Field(description="Substring matched search string on image tag URI."), ] = None, is_external: Annotated[ Optional[StrictBool], Field(description="Filter image tags by is_external.") @@ -1751,9 +1751,9 @@ async def list_with_http_info( :param image_id: (required) :type image_id: str - :param version: Prefix matched search string on image tag version. + :param version: Substring matched search string on image tag version. :type version: str - :param image_uri: Prefix matched search string on image tag URI. + :param image_uri: Substring matched search string on image tag URI. :type image_uri: str :param is_external: Filter image tags by is_external. :type is_external: bool @@ -1824,10 +1824,11 @@ async def list_without_preload_content( image_id: StrictStr, version: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on image tag version."), + Field(description="Substring matched search string on image tag version."), ] = None, image_uri: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image tag URI.") + Optional[StrictStr], + Field(description="Substring matched search string on image tag URI."), ] = None, is_external: Annotated[ Optional[StrictBool], Field(description="Filter image tags by is_external.") @@ -1863,9 +1864,9 @@ async def list_without_preload_content( :param image_id: (required) :type image_id: str - :param version: Prefix matched search string on image tag version. + :param version: Substring matched search string on image tag version. :type version: str - :param image_uri: Prefix matched search string on image tag URI. + :param image_uri: Substring matched search string on image tag URI. :type image_uri: str :param is_external: Filter image tags by is_external. :type is_external: bool diff --git a/saturn_api/api/images_api.py b/saturn_api/api/images_api.py index 32ece47..35e8676 100644 --- a/saturn_api/api/images_api.py +++ b/saturn_api/api/images_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -752,7 +750,7 @@ async def list( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image name.") + Optional[StrictStr], Field(description="Substring matched search string on image name.") ] = None, access: Annotated[ Optional[ImageAccessLevel], Field(description="Filter images by access level.") @@ -802,7 +800,7 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on image name. + :param name: Substring matched search string on image name. :type name: str :param access: Filter images by access level. :type access: ImageAccessLevel @@ -897,7 +895,7 @@ async def list_with_http_info( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image name.") + Optional[StrictStr], Field(description="Substring matched search string on image name.") ] = None, access: Annotated[ Optional[ImageAccessLevel], Field(description="Filter images by access level.") @@ -947,7 +945,7 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on image name. + :param name: Substring matched search string on image name. :type name: str :param access: Filter images by access level. :type access: ImageAccessLevel @@ -1042,7 +1040,7 @@ async def list_without_preload_content( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on image name.") + Optional[StrictStr], Field(description="Substring matched search string on image name.") ] = None, access: Annotated[ Optional[ImageAccessLevel], Field(description="Filter images by access level.") @@ -1092,7 +1090,7 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on image name. + :param name: Substring matched search string on image name. :type name: str :param access: Filter images by access level. :type access: ImageAccessLevel diff --git a/saturn_api/api/inference_endpoints_api.py b/saturn_api/api/inference_endpoints_api.py new file mode 100644 index 0000000..ca3e96b --- /dev/null +++ b/saturn_api/api/inference_endpoints_api.py @@ -0,0 +1,1901 @@ +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from saturn_api.api_client import ApiClient, RequestSerialized +from saturn_api.api_response import ApiResponse +from saturn_api.models.historic_log_list import HistoricLogList +from saturn_api.models.inference_endpoint_create import InferenceEndpointCreate +from saturn_api.models.inference_endpoint_list import InferenceEndpointList +from saturn_api.models.inference_endpoint_view import InferenceEndpointView +from saturn_api.rest import RESTResponseType + + +class InferenceEndpointsApi: + """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( + self, + org_id: StrictStr, + inference_endpoint_create: InferenceEndpointCreate, + _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, + ) -> InferenceEndpointView: + """Create inference endpoint + + Create a new inference endpoint. + + :param org_id: (required) + :type org_id: str + :param inference_endpoint_create: (required) + :type inference_endpoint_create: InferenceEndpointCreate + :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_serialize( + org_id=org_id, + inference_endpoint_create=inference_endpoint_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "InferenceEndpointView", + } + 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_with_http_info( + self, + org_id: StrictStr, + inference_endpoint_create: InferenceEndpointCreate, + _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[InferenceEndpointView]: + """Create inference endpoint + + Create a new inference endpoint. + + :param org_id: (required) + :type org_id: str + :param inference_endpoint_create: (required) + :type inference_endpoint_create: InferenceEndpointCreate + :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_serialize( + org_id=org_id, + inference_endpoint_create=inference_endpoint_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "InferenceEndpointView", + } + 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_without_preload_content( + self, + org_id: StrictStr, + inference_endpoint_create: InferenceEndpointCreate, + _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 inference endpoint + + Create a new inference endpoint. + + :param org_id: (required) + :type org_id: str + :param inference_endpoint_create: (required) + :type inference_endpoint_create: InferenceEndpointCreate + :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_serialize( + org_id=org_id, + inference_endpoint_create=inference_endpoint_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "InferenceEndpointView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serialize( + self, + org_id, + inference_endpoint_create, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if inference_endpoint_create is not None: + _body_params = inference_endpoint_create + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints", + 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( + self, + org_id: StrictStr, + endpoint_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, + ) -> None: + """Delete inference endpoint + + Delete an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_with_http_info( + self, + org_id: StrictStr, + endpoint_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[None]: + """Delete inference endpoint + + Delete an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + 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_without_preload_content( + self, + org_id: StrictStr, + endpoint_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 inference endpoint + + Delete an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_serialize( + self, + org_id, + endpoint_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 org_id is not None: + _path_params["org_id"] = org_id + if endpoint_id is not None: + _path_params["endpoint_id"] = endpoint_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_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 endpoints_start( + self, + org_id: StrictStr, + endpoint_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, + ) -> InferenceEndpointView: + """Start inference endpoint + + Bring up the underlying persistent deployment. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_start_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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 endpoints_start_with_http_info( + self, + org_id: StrictStr, + endpoint_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[InferenceEndpointView]: + """Start inference endpoint + + Bring up the underlying persistent deployment. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_start_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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 endpoints_start_without_preload_content( + self, + org_id: StrictStr, + endpoint_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: + """Start inference endpoint + + Bring up the underlying persistent deployment. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_start_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _endpoints_start_serialize( + self, + org_id, + endpoint_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 org_id is not None: + _path_params["org_id"] = org_id + if endpoint_id is not None: + _path_params["endpoint_id"] = endpoint_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/start", + 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 endpoints_stop( + self, + org_id: StrictStr, + endpoint_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, + ) -> InferenceEndpointView: + """Stop inference endpoint + + Tear down the pod but keep the DB row. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_stop_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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 endpoints_stop_with_http_info( + self, + org_id: StrictStr, + endpoint_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[InferenceEndpointView]: + """Stop inference endpoint + + Tear down the pod but keep the DB row. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_stop_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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 endpoints_stop_without_preload_content( + self, + org_id: StrictStr, + endpoint_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: + """Stop inference endpoint + + Tear down the pod but keep the DB row. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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._endpoints_stop_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _endpoints_stop_serialize( + self, + org_id, + endpoint_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 org_id is not None: + _path_params["org_id"] = org_id + if endpoint_id is not None: + _path_params["endpoint_id"] = endpoint_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/stop", + 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( + self, + org_id: StrictStr, + endpoint_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, + ) -> InferenceEndpointView: + """Get inference endpoint + + Get an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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_with_http_info( + self, + org_id: StrictStr, + endpoint_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[InferenceEndpointView]: + """Get inference endpoint + + Get an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + 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_without_preload_content( + self, + org_id: StrictStr, + endpoint_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 inference endpoint + + Get an inference endpoint. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_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_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointView", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serialize( + self, + org_id, + endpoint_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 org_id is not None: + _path_params["org_id"] = org_id + if endpoint_id is not None: + _path_params["endpoint_id"] = endpoint_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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_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_logs( + self, + org_id: StrictStr, + endpoint_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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, + ) -> HistoricLogList: + """Get inference endpoint historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + 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_logs_with_http_info( + self, + org_id: StrictStr, + endpoint_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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[HistoricLogList]: + """Get inference endpoint historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + 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_logs_without_preload_content( + self, + org_id: StrictStr, + endpoint_id: StrictStr, + pod_name: Annotated[ + Optional[StrictStr], Field(description="Name of the pod to retrieve logs from.") + ] = None, + cluster: Annotated[ + Optional[StrictStr], Field(description="Name of the cluster the pod lives in.") + ] = None, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Maximum number of results per page."), + ] = 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: + """Get inference endpoint historical logs + + Historical record of logs from the resource. + + :param org_id: (required) + :type org_id: str + :param endpoint_id: (required) + :type endpoint_id: str + :param pod_name: Name of the pod to retrieve logs from. + :type pod_name: str + :param cluster: Name of the cluster the pod lives in. + :type cluster: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Maximum number of results per page. + :type page_size: int + :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_logs_serialize( + org_id=org_id, + endpoint_id=endpoint_id, + pod_name=pod_name, + cluster=cluster, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HistoricLogList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_logs_serialize( + self, + org_id, + endpoint_id, + pod_name, + cluster, + prev_key, + next_key, + page_size, + _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 org_id is not None: + _path_params["org_id"] = org_id + if endpoint_id is not None: + _path_params["endpoint_id"] = endpoint_id + # process the query parameters + if pod_name is not None: + + _query_params.append(("pod_name", pod_name)) + + if cluster is not None: + + _query_params.append(("cluster", cluster)) + + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints/{endpoint_id}/logs", + 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( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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, + ) -> InferenceEndpointList: + """List inference endpoints + + Paginated list of inference endpoints. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointList", + } + 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_with_http_info( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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[InferenceEndpointList]: + """List inference endpoints + + Paginated list of inference endpoints. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointList", + } + 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_without_preload_content( + self, + org_id: StrictStr, + prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, + next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field(description="Page size."), + ] = None, + descending: Annotated[ + Optional[StrictBool], Field(description="List results in 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 inference endpoints + + Paginated list of inference endpoints. + + :param org_id: (required) + :type org_id: str + :param prev_key: Previous page key. + :type prev_key: str + :param next_key: Next page key. + :type next_key: str + :param page_size: Page size. + :type page_size: int + :param descending: List results in descending order. + :type descending: bool + :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_serialize( + org_id=org_id, + prev_key=prev_key, + next_key=next_key, + page_size=page_size, + descending=descending, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "InferenceEndpointList", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_serialize( + self, + org_id, + prev_key, + next_key, + page_size, + descending, + _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 org_id is not None: + _path_params["org_id"] = org_id + # process the query parameters + if prev_key is not None: + + _query_params.append(("prev_key", prev_key)) + + if next_key is not None: + + _query_params.append(("next_key", next_key)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + if descending is not None: + + _query_params.append(("descending", descending)) + + # 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(["application/json"]) + + # authentication setting + _auth_settings: List[str] = ["bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/orgs/{org_id}/token-factory/inference-endpoints", + 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/saturn_api/api/info_api.py b/saturn_api/api/info_api.py index 8d0b38e..c9e48ed 100644 --- a/saturn_api/api/info_api.py +++ b/saturn_api/api/info_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/invitations_api.py b/saturn_api/api/invitations_api.py index 2b441b7..24ec00f 100644 --- a/saturn_api/api/invitations_api.py +++ b/saturn_api/api/invitations_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -727,7 +725,7 @@ async def list( Optional[InvitationStatus], Field(description="Filter invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -757,7 +755,7 @@ async def list( :param status: Filter invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str @@ -822,7 +820,7 @@ async def list_with_http_info( Optional[InvitationStatus], Field(description="Filter invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -852,7 +850,7 @@ async def list_with_http_info( :param status: Filter invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str @@ -917,7 +915,7 @@ async def list_without_preload_content( Optional[InvitationStatus], Field(description="Filter invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -947,7 +945,7 @@ async def list_without_preload_content( :param status: Filter invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str diff --git a/saturn_api/api/jobs_api.py b/saturn_api/api/jobs_api.py index 8488bd3..1f3aa0f 100644 --- a/saturn_api/api/jobs_api.py +++ b/saturn_api/api/jobs_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -4475,7 +4473,13 @@ async def list( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on job name.") + Optional[StrictStr], Field(description="Substring matched search string on job name.") + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -4512,8 +4516,10 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on job name. + :param name: Substring matched search string on job name. :type name: str + :param tags: Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -4552,6 +4558,7 @@ async def list( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -4595,7 +4602,13 @@ async def list_with_http_info( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on job name.") + Optional[StrictStr], Field(description="Substring matched search string on job name.") + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -4632,8 +4645,10 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on job name. + :param name: Substring matched search string on job name. :type name: str + :param tags: Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -4672,6 +4687,7 @@ async def list_with_http_info( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -4715,7 +4731,13 @@ async def list_without_preload_content( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on job name.") + Optional[StrictStr], Field(description="Substring matched search string on job name.") + ] = None, + tags: Annotated[ + Optional[StrictStr], + Field( + description="Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'." + ), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -4752,8 +4774,10 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on job name. + :param name: Substring matched search string on job name. :type name: str + :param tags: Filter to jobs whose tags contain the given 'key:value' pair, e.g. 'saturn.io/kind:finetune'. + :type tags: str :param prev_key: Previous page key. :type prev_key: str :param next_key: Next page key. @@ -4792,6 +4816,7 @@ async def list_without_preload_content( org_id=org_id, owner=owner, name=name, + tags=tags, prev_key=prev_key, next_key=next_key, page_size=page_size, @@ -4817,6 +4842,7 @@ def _list_serialize( org_id, owner, name, + tags, prev_key, next_key, page_size, @@ -4868,6 +4894,10 @@ def _list_serialize( _query_params.append(("name", name)) + if tags is not None: + + _query_params.append(("tags", tags)) + if prev_key is not None: _query_params.append(("prev_key", prev_key)) @@ -5202,7 +5232,7 @@ async def list_secret_attachments( job_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -5231,7 +5261,7 @@ async def list_secret_attachments( :param job_id: (required) :type job_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -5295,7 +5325,7 @@ async def list_secret_attachments_with_http_info( job_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -5324,7 +5354,7 @@ async def list_secret_attachments_with_http_info( :param job_id: (required) :type job_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -5388,7 +5418,7 @@ async def list_secret_attachments_without_preload_content( job_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -5417,7 +5447,7 @@ async def list_secret_attachments_without_preload_content( :param job_id: (required) :type job_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType diff --git a/saturn_api/api/limits_api.py b/saturn_api/api/limits_api.py index 917e8a0..f5e2680 100644 --- a/saturn_api/api/limits_api.py +++ b/saturn_api/api/limits_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -724,7 +722,7 @@ async def list( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on usage limit name."), + Field(description="Substring matched search string on usage limit name."), ] = None, org_id: Annotated[ Optional[StrictStr], @@ -755,7 +753,7 @@ async def list( Paginated list of limits. - :param name: Prefix matched search string on usage limit name. + :param name: Substring matched search string on usage limit name. :type name: str :param org_id: Filter usage limits by org. Defaults to the default org for the current user/group. :type org_id: str @@ -817,7 +815,7 @@ async def list_with_http_info( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on usage limit name."), + Field(description="Substring matched search string on usage limit name."), ] = None, org_id: Annotated[ Optional[StrictStr], @@ -848,7 +846,7 @@ async def list_with_http_info( Paginated list of limits. - :param name: Prefix matched search string on usage limit name. + :param name: Substring matched search string on usage limit name. :type name: str :param org_id: Filter usage limits by org. Defaults to the default org for the current user/group. :type org_id: str @@ -910,7 +908,7 @@ async def list_without_preload_content( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on usage limit name."), + Field(description="Substring matched search string on usage limit name."), ] = None, org_id: Annotated[ Optional[StrictStr], @@ -941,7 +939,7 @@ async def list_without_preload_content( Paginated list of limits. - :param name: Prefix matched search string on usage limit name. + :param name: Substring matched search string on usage limit name. :type name: str :param org_id: Filter usage limits by org. Defaults to the default org for the current user/group. :type org_id: str diff --git a/saturn_api/api/notifications_api.py b/saturn_api/api/notifications_api.py index 59a741b..2a5d845 100644 --- a/saturn_api/api/notifications_api.py +++ b/saturn_api/api/notifications_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/object_storage_api.py b/saturn_api/api/object_storage_api.py index 87ea4e7..c1ec99b 100644 --- a/saturn_api/api/object_storage_api.py +++ b/saturn_api/api/object_storage_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/orgs_api.py b/saturn_api/api/orgs_api.py index 718c06a..088697b 100644 --- a/saturn_api/api/orgs_api.py +++ b/saturn_api/api/orgs_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -3930,7 +3928,7 @@ def _get_usage_limits_serialize( async def list( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on org name.") + Optional[StrictStr], Field(description="Substring matched search string on org name.") ] = None, all_orgs: Annotated[ Optional[StrictBool], @@ -3961,7 +3959,7 @@ async def list( Paginated list of orgs. - :param name: Prefix matched search string on org name. + :param name: Substring matched search string on org name. :type name: str :param all_orgs: List all orgs, instead of only orgs the user is a member of. (Admin only) :type all_orgs: bool @@ -4022,7 +4020,7 @@ async def list( async def list_with_http_info( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on org name.") + Optional[StrictStr], Field(description="Substring matched search string on org name.") ] = None, all_orgs: Annotated[ Optional[StrictBool], @@ -4053,7 +4051,7 @@ async def list_with_http_info( Paginated list of orgs. - :param name: Prefix matched search string on org name. + :param name: Substring matched search string on org name. :type name: str :param all_orgs: List all orgs, instead of only orgs the user is a member of. (Admin only) :type all_orgs: bool @@ -4114,7 +4112,7 @@ async def list_with_http_info( async def list_without_preload_content( self, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on org name.") + Optional[StrictStr], Field(description="Substring matched search string on org name.") ] = None, all_orgs: Annotated[ Optional[StrictBool], @@ -4145,7 +4143,7 @@ async def list_without_preload_content( Paginated list of orgs. - :param name: Prefix matched search string on org name. + :param name: Substring matched search string on org name. :type name: str :param all_orgs: List all orgs, instead of only orgs the user is a member of. (Admin only) :type all_orgs: bool @@ -4283,7 +4281,7 @@ async def list_invitations( Optional[InvitationStatus], Field(description="Filter org invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -4314,7 +4312,7 @@ async def list_invitations( :type org_id: str :param status: Filter org invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str @@ -4381,7 +4379,7 @@ async def list_invitations_with_http_info( Optional[InvitationStatus], Field(description="Filter org invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -4412,7 +4410,7 @@ async def list_invitations_with_http_info( :type org_id: str :param status: Filter org invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str @@ -4479,7 +4477,7 @@ async def list_invitations_without_preload_content( Optional[InvitationStatus], Field(description="Filter org invitations by status.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on email.") + Optional[StrictStr], Field(description="Substring matched search string on email.") ] = None, invitor_id: Annotated[ Optional[StrictStr], Field(description="Filter invitations by invitor user ID.") @@ -4510,7 +4508,7 @@ async def list_invitations_without_preload_content( :type org_id: str :param status: Filter org invitations by status. :type status: InvitationStatus - :param email: Prefix matched search string on email. + :param email: Substring matched search string on email. :type email: str :param invitor_id: Filter invitations by invitor user ID. :type invitor_id: str @@ -4656,7 +4654,7 @@ async def list_owners( org_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string by owner identity name."), + Field(description="Substring matched search string by owner identity name."), ] = None, identity_type: Annotated[ Optional[IdentityType], Field(description="Filter owners by identity type.") @@ -4699,7 +4697,7 @@ async def list_owners( :param org_id: (required) :type org_id: str - :param name: Prefix matched search string by owner identity name. + :param name: Substring matched search string by owner identity name. :type name: str :param identity_type: Filter owners by identity type. :type identity_type: IdentityType @@ -4772,7 +4770,7 @@ async def list_owners_with_http_info( org_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string by owner identity name."), + Field(description="Substring matched search string by owner identity name."), ] = None, identity_type: Annotated[ Optional[IdentityType], Field(description="Filter owners by identity type.") @@ -4815,7 +4813,7 @@ async def list_owners_with_http_info( :param org_id: (required) :type org_id: str - :param name: Prefix matched search string by owner identity name. + :param name: Substring matched search string by owner identity name. :type name: str :param identity_type: Filter owners by identity type. :type identity_type: IdentityType @@ -4888,7 +4886,7 @@ async def list_owners_without_preload_content( org_id: StrictStr, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string by owner identity name."), + Field(description="Substring matched search string by owner identity name."), ] = None, identity_type: Annotated[ Optional[IdentityType], Field(description="Filter owners by identity type.") @@ -4931,7 +4929,7 @@ async def list_owners_without_preload_content( :param org_id: (required) :type org_id: str - :param name: Prefix matched search string by owner identity name. + :param name: Substring matched search string by owner identity name. :type name: str :param identity_type: Filter owners by identity type. :type identity_type: IdentityType diff --git a/saturn_api/api/recipes_api.py b/saturn_api/api/recipes_api.py index 1a26595..43ef3a9 100644 --- a/saturn_api/api/recipes_api.py +++ b/saturn_api/api/recipes_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/secrets_api.py b/saturn_api/api/secrets_api.py index 0814dbf..b023184 100644 --- a/saturn_api/api/secrets_api.py +++ b/saturn_api/api/secrets_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -751,7 +749,8 @@ async def list( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on secret name.") + Optional[StrictStr], + Field(description="Substring matched search string on secret name."), ] = None, access: Annotated[ Optional[SecretAccessLevel], Field(description="Filter secrets by access level.") @@ -791,7 +790,7 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on secret name. + :param name: Substring matched search string on secret name. :type name: str :param access: Filter secrets by access level. :type access: SecretAccessLevel @@ -877,7 +876,8 @@ async def list_with_http_info( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on secret name.") + Optional[StrictStr], + Field(description="Substring matched search string on secret name."), ] = None, access: Annotated[ Optional[SecretAccessLevel], Field(description="Filter secrets by access level.") @@ -917,7 +917,7 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on secret name. + :param name: Substring matched search string on secret name. :type name: str :param access: Filter secrets by access level. :type access: SecretAccessLevel @@ -1003,7 +1003,8 @@ async def list_without_preload_content( Field(description="Reference owner by name."), ] = None, name: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on secret name.") + Optional[StrictStr], + Field(description="Substring matched search string on secret name."), ] = None, access: Annotated[ Optional[SecretAccessLevel], Field(description="Filter secrets by access level.") @@ -1043,7 +1044,7 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on secret name. + :param name: Substring matched search string on secret name. :type name: str :param access: Filter secrets by access level. :type access: SecretAccessLevel diff --git a/saturn_api/api/service_account_entitlements_api.py b/saturn_api/api/service_account_entitlements_api.py index 084e324..4d1a8c4 100644 --- a/saturn_api/api/service_account_entitlements_api.py +++ b/saturn_api/api/service_account_entitlements_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -745,7 +743,7 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on entitled service account name."), + Field(description="Substring matched search string on entitled service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -776,7 +774,7 @@ async def list( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on entitled service account name. + :param name: Substring matched search string on entitled service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -848,7 +846,7 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on entitled service account name."), + Field(description="Substring matched search string on entitled service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -879,7 +877,7 @@ async def list_with_http_info( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on entitled service account name. + :param name: Substring matched search string on entitled service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -951,7 +949,7 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on entitled service account name."), + Field(description="Substring matched search string on entitled service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -982,7 +980,7 @@ async def list_without_preload_content( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on entitled service account name. + :param name: Substring matched search string on entitled service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str diff --git a/saturn_api/api/service_accounts_api.py b/saturn_api/api/service_accounts_api.py index 2aad4da..8570225 100644 --- a/saturn_api/api/service_accounts_api.py +++ b/saturn_api/api/service_accounts_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -724,7 +722,7 @@ async def list( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on service account name."), + Field(description="Substring matched search string on service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -749,7 +747,7 @@ async def list( Paginated list of service accounts. - :param name: Prefix matched search string on service account name. + :param name: Substring matched search string on service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -808,7 +806,7 @@ async def list_with_http_info( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on service account name."), + Field(description="Substring matched search string on service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -833,7 +831,7 @@ async def list_with_http_info( Paginated list of service accounts. - :param name: Prefix matched search string on service account name. + :param name: Substring matched search string on service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -892,7 +890,7 @@ async def list_without_preload_content( self, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on service account name."), + Field(description="Substring matched search string on service account name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -917,7 +915,7 @@ async def list_without_preload_content( Paginated list of service accounts. - :param name: Prefix matched search string on service account name. + :param name: Substring matched search string on service account name. :type name: str :param prev_key: Previous page key. :type prev_key: str diff --git a/saturn_api/api/shared_folder_attachments_api.py b/saturn_api/api/shared_folder_attachments_api.py index 8fc636d..4cd3356 100644 --- a/saturn_api/api/shared_folder_attachments_api.py +++ b/saturn_api/api/shared_folder_attachments_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud diff --git a/saturn_api/api/shared_folders_api.py b/saturn_api/api/shared_folders_api.py index 8a79c91..fbc9d76 100644 --- a/saturn_api/api/shared_folders_api.py +++ b/saturn_api/api/shared_folders_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -752,7 +750,7 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on shared folder name."), + Field(description="Substring matched search string on shared folder name."), ] = None, access: Annotated[ Optional[SharedFolderAccessLevel], @@ -793,7 +791,7 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on shared folder name. + :param name: Substring matched search string on shared folder name. :type name: str :param access: Filter shared folders by access level. :type access: SharedFolderAccessLevel @@ -880,7 +878,7 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on shared folder name."), + Field(description="Substring matched search string on shared folder name."), ] = None, access: Annotated[ Optional[SharedFolderAccessLevel], @@ -921,7 +919,7 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on shared folder name. + :param name: Substring matched search string on shared folder name. :type name: str :param access: Filter shared folders by access level. :type access: SharedFolderAccessLevel @@ -1008,7 +1006,7 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on shared folder name."), + Field(description="Substring matched search string on shared folder name."), ] = None, access: Annotated[ Optional[SharedFolderAccessLevel], @@ -1049,7 +1047,7 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on shared folder name. + :param name: Substring matched search string on shared folder name. :type name: str :param access: Filter shared folders by access level. :type access: SharedFolderAccessLevel diff --git a/saturn_api/api/ssh_private_keys_api.py b/saturn_api/api/ssh_private_keys_api.py index f1de117..9a5d891 100644 --- a/saturn_api/api/ssh_private_keys_api.py +++ b/saturn_api/api/ssh_private_keys_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -742,7 +740,7 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH private key name."), + Field(description="Substring matched search string on SSH private key name."), ] = None, is_default: Annotated[ Optional[StrictBool], Field(description="Filter SSH private keys by is_default.") @@ -776,7 +774,7 @@ async def list( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH private key name. + :param name: Substring matched search string on SSH private key name. :type name: str :param is_default: Filter SSH private keys by is_default. :type is_default: bool @@ -851,7 +849,7 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH private key name."), + Field(description="Substring matched search string on SSH private key name."), ] = None, is_default: Annotated[ Optional[StrictBool], Field(description="Filter SSH private keys by is_default.") @@ -885,7 +883,7 @@ async def list_with_http_info( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH private key name. + :param name: Substring matched search string on SSH private key name. :type name: str :param is_default: Filter SSH private keys by is_default. :type is_default: bool @@ -960,7 +958,7 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH private key name."), + Field(description="Substring matched search string on SSH private key name."), ] = None, is_default: Annotated[ Optional[StrictBool], Field(description="Filter SSH private keys by is_default.") @@ -994,7 +992,7 @@ async def list_without_preload_content( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH private key name. + :param name: Substring matched search string on SSH private key name. :type name: str :param is_default: Filter SSH private keys by is_default. :type is_default: bool diff --git a/saturn_api/api/ssh_public_keys_api.py b/saturn_api/api/ssh_public_keys_api.py index 4822442..476d5f2 100644 --- a/saturn_api/api/ssh_public_keys_api.py +++ b/saturn_api/api/ssh_public_keys_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -742,7 +740,7 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH public key name."), + Field(description="Substring matched search string on SSH public key name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -773,7 +771,7 @@ async def list( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH public key name. + :param name: Substring matched search string on SSH public key name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -845,7 +843,7 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH public key name."), + Field(description="Substring matched search string on SSH public key name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -876,7 +874,7 @@ async def list_with_http_info( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH public key name. + :param name: Substring matched search string on SSH public key name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -948,7 +946,7 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on SSH public key name."), + Field(description="Substring matched search string on SSH public key name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -979,7 +977,7 @@ async def list_without_preload_content( :type group_id: str :param identity: Identity reference by name :type identity: str - :param name: Prefix matched search string on SSH public key name. + :param name: Substring matched search string on SSH public key name. :type name: str :param prev_key: Previous page key. :type prev_key: str diff --git a/saturn_api/api/users_api.py b/saturn_api/api/users_api.py index 952bf7d..20e6a6c 100644 --- a/saturn_api/api/users_api.py +++ b/saturn_api/api/users_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -747,10 +745,10 @@ def _get_serialize( async def list( self, username: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user name.") + Optional[StrictStr], Field(description="Substring matched search string on user name.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user email.") + Optional[StrictStr], Field(description="Substring matched search string on user email.") ] = None, details: Annotated[ Optional[StrictBool], Field(description="Retrieve detailed user data. (Admin only)") @@ -778,9 +776,9 @@ async def list( Paginated list of users. - :param username: Prefix matched search string on user name. + :param username: Substring matched search string on user name. :type username: str - :param email: Prefix matched search string on user email. + :param email: Substring matched search string on user email. :type email: str :param details: Retrieve detailed user data. (Admin only) :type details: bool @@ -842,10 +840,10 @@ async def list( async def list_with_http_info( self, username: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user name.") + Optional[StrictStr], Field(description="Substring matched search string on user name.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user email.") + Optional[StrictStr], Field(description="Substring matched search string on user email.") ] = None, details: Annotated[ Optional[StrictBool], Field(description="Retrieve detailed user data. (Admin only)") @@ -873,9 +871,9 @@ async def list_with_http_info( Paginated list of users. - :param username: Prefix matched search string on user name. + :param username: Substring matched search string on user name. :type username: str - :param email: Prefix matched search string on user email. + :param email: Substring matched search string on user email. :type email: str :param details: Retrieve detailed user data. (Admin only) :type details: bool @@ -937,10 +935,10 @@ async def list_with_http_info( async def list_without_preload_content( self, username: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user name.") + Optional[StrictStr], Field(description="Substring matched search string on user name.") ] = None, email: Annotated[ - Optional[StrictStr], Field(description="Prefix matched search string on user email.") + Optional[StrictStr], Field(description="Substring matched search string on user email.") ] = None, details: Annotated[ Optional[StrictBool], Field(description="Retrieve detailed user data. (Admin only)") @@ -968,9 +966,9 @@ async def list_without_preload_content( Paginated list of users. - :param username: Prefix matched search string on user name. + :param username: Substring matched search string on user name. :type username: str - :param email: Prefix matched search string on user email. + :param email: Substring matched search string on user email. :type email: str :param details: Retrieve detailed user data. (Admin only) :type details: bool diff --git a/saturn_api/api/workspaces_api.py b/saturn_api/api/workspaces_api.py index 253ff7d..9cd3ec9 100644 --- a/saturn_api/api/workspaces_api.py +++ b/saturn_api/api/workspaces_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -5923,7 +5921,7 @@ async def list( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on workspace name."), + Field(description="Substring matched search string on workspace name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -5960,7 +5958,7 @@ async def list( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on workspace name. + :param name: Substring matched search string on workspace name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -6044,7 +6042,7 @@ async def list_with_http_info( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on workspace name."), + Field(description="Substring matched search string on workspace name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6081,7 +6079,7 @@ async def list_with_http_info( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on workspace name. + :param name: Substring matched search string on workspace name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -6165,7 +6163,7 @@ async def list_without_preload_content( ] = None, name: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on workspace name."), + Field(description="Substring matched search string on workspace name."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6202,7 +6200,7 @@ async def list_without_preload_content( :type org_id: str :param owner: Reference owner by name. :type owner: str - :param name: Prefix matched search string on workspace name. + :param name: Substring matched search string on workspace name. :type name: str :param prev_key: Previous page key. :type prev_key: str @@ -6366,7 +6364,7 @@ async def list_routes( workspace_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6393,7 +6391,7 @@ async def list_routes( :param workspace_id: (required) :type workspace_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6454,7 +6452,7 @@ async def list_routes_with_http_info( workspace_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6481,7 +6479,7 @@ async def list_routes_with_http_info( :param workspace_id: (required) :type workspace_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6542,7 +6540,7 @@ async def list_routes_without_preload_content( workspace_id: StrictStr, subdomain: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on route subdomain."), + Field(description="Substring matched search string on route subdomain."), ] = None, prev_key: Annotated[Optional[StrictStr], Field(description="Previous page key.")] = None, next_key: Annotated[Optional[StrictStr], Field(description="Next page key.")] = None, @@ -6569,7 +6567,7 @@ async def list_routes_without_preload_content( :param workspace_id: (required) :type workspace_id: str - :param subdomain: Prefix matched search string on route subdomain. + :param subdomain: Substring matched search string on route subdomain. :type subdomain: str :param prev_key: Previous page key. :type prev_key: str @@ -6701,7 +6699,7 @@ async def list_secret_attachments( workspace_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6730,7 +6728,7 @@ async def list_secret_attachments( :param workspace_id: (required) :type workspace_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -6794,7 +6792,7 @@ async def list_secret_attachments_with_http_info( workspace_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6823,7 +6821,7 @@ async def list_secret_attachments_with_http_info( :param workspace_id: (required) :type workspace_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType @@ -6887,7 +6885,7 @@ async def list_secret_attachments_without_preload_content( workspace_id: StrictStr, location: Annotated[ Optional[StrictStr], - Field(description="Prefix matched search string on secret attachment location."), + Field(description="Substring matched search string on secret attachment location."), ] = None, attachment_type: Annotated[ Optional[SecretAttachmentType], Field(description="Filter secret attachments by type.") @@ -6916,7 +6914,7 @@ async def list_secret_attachments_without_preload_content( :param workspace_id: (required) :type workspace_id: str - :param location: Prefix matched search string on secret attachment location. + :param location: Substring matched search string on secret attachment location. :type location: str :param attachment_type: Filter secret attachments by type. :type attachment_type: SecretAttachmentType diff --git a/saturn_api/api_client.py b/saturn_api/api_client.py index f7b2ec9..1a5471d 100644 --- a/saturn_api/api_client.py +++ b/saturn_api/api_client.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -70,6 +68,7 @@ class ApiClient: "date": datetime.date, "datetime": datetime.datetime, "decimal": decimal.Decimal, + "UUID": uuid.UUID, "object": object, } _pool = None @@ -292,13 +291,13 @@ def response_deserialize( response_text = None return_data = None try: - if response_type == "bytearray": + if response_type in ("bytearray", "bytes"): return_data = response_data.data elif response_type == "file": return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader("content-type") + content_type = response_data.headers.get("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" @@ -315,7 +314,7 @@ def response_deserialize( return ApiResponse( status_code=response_data.status, data=return_data, - headers=response_data.getheaders(), + headers=response_data.headers, raw_data=response_data.data, ) @@ -353,25 +352,20 @@ def sanitize_for_serialization(self, obj): return obj.isoformat() elif isinstance(obj, decimal.Decimal): return str(obj) - elif isinstance(obj, dict): - obj_dict = obj + 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() else: - # 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__ - - 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) + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} + return self.sanitize_for_serialization(obj_dict) def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. @@ -446,6 +440,8 @@ def __deserialize(self, data, klass): return self.__deserialize_datetime(data) elif klass is decimal.Decimal: return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: @@ -644,11 +640,13 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") + content_disposition = response.headers.get("Content-Disposition") if content_disposition: m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/saturn_api/exceptions.py b/saturn_api/exceptions.py index 10a69f2..81747ec 100644 --- a/saturn_api/exceptions.py +++ b/saturn_api/exceptions.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -129,7 +127,7 @@ def __init__( self.body = http_resp.data.decode("utf-8") except Exception: pass - self.headers = http_resp.getheaders() + self.headers = http_resp.headers @classmethod def from_response( @@ -168,8 +166,11 @@ def __str__(self): if self.headers: error_message += "HTTP response headers: {0}\n".format(self.headers) - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) return error_message diff --git a/saturn_api/models/__init__.py b/saturn_api/models/__init__.py index f766943..84721bc 100644 --- a/saturn_api/models/__init__.py +++ b/saturn_api/models/__init__.py @@ -22,14 +22,26 @@ from saturn_api.models.api_token_list import ApiTokenList from saturn_api.models.api_token_update import ApiTokenUpdate from saturn_api.models.app_info import AppInfo +from saturn_api.models.artifact import Artifact +from saturn_api.models.artifact_create import ArtifactCreate +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_list import ArtifactList +from saturn_api.models.artifact_status import ArtifactStatus +from saturn_api.models.artifact_update import ArtifactUpdate from saturn_api.models.auth0_info import Auth0Info from saturn_api.models.authorization_code_grant import AuthorizationCodeGrant from saturn_api.models.authorization_grant import AuthorizationGrant from saturn_api.models.authorization_refresh_grant import AuthorizationRefreshGrant from saturn_api.models.authorization_token_response import AuthorizationTokenResponse from saturn_api.models.build_data import BuildData +from saturn_api.models.cluster import Cluster +from saturn_api.models.cluster_connection_type import ClusterConnectionType +from saturn_api.models.cluster_create import ClusterCreate +from saturn_api.models.cluster_list import ClusterList +from saturn_api.models.cluster_update import ClusterUpdate from saturn_api.models.concurrency_policy import ConcurrencyPolicy from saturn_api.models.condition import Condition +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.container_runtime_summary import ContainerRuntimeSummary from saturn_api.models.container_status import ContainerStatus from saturn_api.models.cron_schedule import CronSchedule @@ -57,6 +69,11 @@ ) from saturn_api.models.dask_worker_summary import DaskWorkerSummary from saturn_api.models.data_point import DataPoint +from saturn_api.models.dataset import Dataset +from saturn_api.models.dataset_create import DatasetCreate +from saturn_api.models.dataset_import_create import DatasetImportCreate +from saturn_api.models.dataset_list import DatasetList +from saturn_api.models.dataset_lock_create import DatasetLockCreate from saturn_api.models.default_images import DefaultImages from saturn_api.models.default_sizes import DefaultSizes from saturn_api.models.deployment import Deployment @@ -70,6 +87,7 @@ from saturn_api.models.deployment_start import DeploymentStart from saturn_api.models.deployment_status import DeploymentStatus from saturn_api.models.deployment_update import DeploymentUpdate +from saturn_api.models.disk_space_option import DiskSpaceOption from saturn_api.models.external_repo import ExternalRepo from saturn_api.models.external_repo_attachment import ExternalRepoAttachment from saturn_api.models.external_repo_attachment_create import ( @@ -93,6 +111,10 @@ from saturn_api.models.extra_packages_recipe_apt import ExtraPackagesRecipeApt from saturn_api.models.extra_packages_recipe_conda import ExtraPackagesRecipeConda from saturn_api.models.extra_packages_recipe_pip import ExtraPackagesRecipePip +from saturn_api.models.fine_tune_job_create import FineTuneJobCreate +from saturn_api.models.fine_tune_job_list import FineTuneJobList +from saturn_api.models.fine_tune_job_summary import FineTuneJobSummary +from saturn_api.models.fine_tune_job_view import FineTuneJobView from saturn_api.models.group import Group from saturn_api.models.group_create import GroupCreate from saturn_api.models.group_list import GroupList @@ -103,6 +125,8 @@ from saturn_api.models.hardware_type import HardwareType from saturn_api.models.historic_log import HistoricLog from saturn_api.models.historic_log_list import HistoricLogList +from saturn_api.models.hyperparameters import Hyperparameters +from saturn_api.models.hyperparameters1 import Hyperparameters1 from saturn_api.models.identity import Identity from saturn_api.models.identity_by_group_id import IdentityByGroupId from saturn_api.models.identity_by_user_id import IdentityByUserId @@ -129,6 +153,10 @@ from saturn_api.models.image_tag_state import ImageTagState from saturn_api.models.image_tag_update import ImageTagUpdate from saturn_api.models.image_update import ImageUpdate +from saturn_api.models.inference_endpoint_create import InferenceEndpointCreate +from saturn_api.models.inference_endpoint_list import InferenceEndpointList +from saturn_api.models.inference_endpoint_summary import InferenceEndpointSummary +from saturn_api.models.inference_endpoint_view import InferenceEndpointView from saturn_api.models.instance_size import InstanceSize from saturn_api.models.invitation import Invitation from saturn_api.models.invitation_create import InvitationCreate @@ -240,6 +268,7 @@ from saturn_api.models.route_create import RouteCreate from saturn_api.models.route_list import RouteList from saturn_api.models.route_reference import RouteReference +from saturn_api.models.route_state import RouteState from saturn_api.models.route_update import RouteUpdate from saturn_api.models.secret import Secret from saturn_api.models.secret_access_level import SecretAccessLevel diff --git a/saturn_api/models/app_info.py b/saturn_api/models/app_info.py index 57dda3c..03e9ed8 100644 --- a/saturn_api/models/app_info.py +++ b/saturn_api/models/app_info.py @@ -53,6 +53,9 @@ class AppInfo(BaseModel): description="Root domain for deployment and workspace URLs." ) dind_enabled: StrictBool = Field(description="True if docker-in-docker is enabled.") + token_factory_enabled_global: StrictBool = Field( + description="Install-wide Token Factory switch (the global Settings flag). Per-org enablement is narrowed client-side against the active owner's usage-limit flag." + ) apply_requires_confirm: StrictBool = Field( description="True if recipe apply should be confirmed." ) @@ -79,6 +82,7 @@ class AppInfo(BaseModel): "git_repo_clone_dir", "app_serving_domain", "dind_enabled", + "token_factory_enabled_global", "apply_requires_confirm", "hide_invitations", "populate_examples", @@ -163,6 +167,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "git_repo_clone_dir": obj.get("git_repo_clone_dir"), "app_serving_domain": obj.get("app_serving_domain"), "dind_enabled": obj.get("dind_enabled"), + "token_factory_enabled_global": obj.get("token_factory_enabled_global"), "apply_requires_confirm": obj.get("apply_requires_confirm"), "hide_invitations": obj.get("hide_invitations"), "populate_examples": obj.get("populate_examples"), diff --git a/saturn_api/models/artifact.py b/saturn_api/models/artifact.py new file mode 100644 index 0000000..c9cea54 --- /dev/null +++ b/saturn_api/models/artifact.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_status import ArtifactStatus + + +class Artifact(BaseModel): + """ + Artifact + """ # noqa: E501 + + id: StrictStr = Field(description="Artifact identifier.") + org_id: StrictStr = Field(description="Owning organisation ID.") + name: StrictStr = Field(description="Human-readable artifact name.") + kind: ArtifactKind + location: StrictStr = Field(description="Storage location (NFS path or object storage URI).") + producer: Optional[Dict[str, Any]] = Field( + description="JSONB snapshot of the producer resource: {id, kind, name}. Null if artifact was uploaded directly." + ) + metadata: Optional[Dict[str, Any]] = Field(description="Arbitrary metadata blob.") + created_at: StrictStr = Field(description="Creation timestamp (UTC).") + status: ArtifactStatus + __properties: ClassVar[List[str]] = [ + "id", + "org_id", + "name", + "kind", + "location", + "producer", + "metadata", + "created_at", + "status", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Artifact 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "org_id", + "name", + "location", + "producer", + "metadata", + "created_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if producer (nullable) is None + # and model_fields_set contains the field + if self.producer is None and "producer" in self.model_fields_set: + _dict["producer"] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Artifact 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"), + "org_id": obj.get("org_id"), + "name": obj.get("name"), + "kind": obj.get("kind"), + "location": obj.get("location"), + "producer": obj.get("producer"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at"), + "status": obj.get("status"), + } + ) + return _obj diff --git a/saturn_api/models/artifact_create.py b/saturn_api/models/artifact_create.py new file mode 100644 index 0000000..887c763 --- /dev/null +++ b/saturn_api/models/artifact_create.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_status import ArtifactStatus + + +class ArtifactCreate(BaseModel): + """ + ArtifactCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the artifact." + ) + kind: Optional[ArtifactKind] = None + location: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Storage location (NFS path or object storage URI)." + ) + status: Optional[ArtifactStatus] = None + producer: Optional[Dict[str, Any]] = Field( + default=None, + description="JSONB snapshot of the Saturn resource that produced this artifact. Shape: {id, kind, name}. Null if uploaded directly.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Arbitrary metadata blob: schema_type, row_count, base_model, epoch, metrics, etc.", + ) + __properties: ClassVar[List[str]] = [ + "name", + "kind", + "location", + "status", + "producer", + "metadata", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactCreate 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, + ) + # set to None if producer (nullable) is None + # and model_fields_set contains the field + if self.producer is None and "producer" in self.model_fields_set: + _dict["producer"] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "kind": obj.get("kind"), + "location": obj.get("location"), + "status": obj.get("status"), + "producer": obj.get("producer"), + "metadata": obj.get("metadata"), + } + ) + return _obj diff --git a/saturn_api/models/artifact_kind.py b/saturn_api/models/artifact_kind.py new file mode 100644 index 0000000..2774150 --- /dev/null +++ b/saturn_api/models/artifact_kind.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +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 ArtifactKind(str, Enum): + """ + ArtifactKind + """ + + """ + allowed enum values + """ + DATASET = "dataset" + CHECKPOINT = "checkpoint" + MODEL_MINUS_WEIGHTS = "model-weights" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ArtifactKind from a JSON string""" + return cls(json.loads(json_str)) diff --git a/saturn_api/models/artifact_list.py b/saturn_api/models/artifact_list.py new file mode 100644 index 0000000..acd1245 --- /dev/null +++ b/saturn_api/models/artifact_list.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.artifact import Artifact + + +class ArtifactList(BaseModel): + """ + ArtifactList + """ # noqa: E501 + + artifacts: List[Artifact] = Field(description="List of artifacts.") + prev_key: Optional[StrictStr] = Field(default=None, description="Previous page key.") + next_key: Optional[StrictStr] = Field(default=None, description="Next page key.") + __properties: ClassVar[List[str]] = ["artifacts", "prev_key", "next_key"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactList 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "artifacts", + "prev_key", + "next_key", + ] + ) + + _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 artifacts (list) + _items = [] + if self.artifacts: + for _item_artifacts in self.artifacts: + if _item_artifacts: + _items.append(_item_artifacts.to_dict()) + _dict["artifacts"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "artifacts": ( + [Artifact.from_dict(_item) for _item in obj["artifacts"]] + if obj.get("artifacts") is not None + else None + ), + "prev_key": obj.get("prev_key"), + "next_key": obj.get("next_key"), + } + ) + return _obj diff --git a/saturn_api/models/artifact_status.py b/saturn_api/models/artifact_status.py new file mode 100644 index 0000000..2178121 --- /dev/null +++ b/saturn_api/models/artifact_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +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 ArtifactStatus(str, Enum): + """ + ArtifactStatus + """ + + """ + allowed enum values + """ + ASSEMBLING = "assembling" + PENDING = "pending" + READY = "ready" + ERROR = "error" + DELETED = "deleted" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ArtifactStatus from a JSON string""" + return cls(json.loads(json_str)) diff --git a/saturn_api/models/artifact_update.py b/saturn_api/models/artifact_update.py new file mode 100644 index 0000000..1aea28c --- /dev/null +++ b/saturn_api/models/artifact_update.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from saturn_api.models.artifact_status import ArtifactStatus + + +class ArtifactUpdate(BaseModel): + """ + ArtifactUpdate + """ # noqa: E501 + + status: Optional[ArtifactStatus] = None + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Updated metadata blob.") + __properties: ClassVar[List[str]] = ["status", "metadata"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactUpdate 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, + ) + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"status": obj.get("status"), "metadata": obj.get("metadata")}) + return _obj diff --git a/saturn_api/models/cluster.py b/saturn_api/models/cluster.py new file mode 100644 index 0000000..1cc6f3b --- /dev/null +++ b/saturn_api/models/cluster.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.cluster_connection_type import ClusterConnectionType + + +class Cluster(BaseModel): + """ + Cluster + """ # noqa: E501 + + id: StrictStr = Field(description="Cluster ID.") + name: StrictStr = Field(description="Cluster name.") + org_id: StrictStr = Field(description="Owning org ID.") + connection_type: ClusterConnectionType + server_url: Optional[StrictStr] = Field(default=None, description="K8s API server URL.") + utilities: Optional[Dict[str, Any]] = Field( + default=None, description="ClusterUtilities metadata." + ) + created_at: StrictStr = Field(description="Creation timestamp.") + updated_at: StrictStr = Field(description="Last update timestamp.") + __properties: ClassVar[List[str]] = [ + "id", + "name", + "org_id", + "connection_type", + "server_url", + "utilities", + "created_at", + "updated_at", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Cluster 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "name", + "org_id", + "server_url", + "utilities", + "created_at", + "updated_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if server_url (nullable) is None + # and model_fields_set contains the field + if self.server_url is None and "server_url" in self.model_fields_set: + _dict["server_url"] = None + + # set to None if utilities (nullable) is None + # and model_fields_set contains the field + if self.utilities is None and "utilities" in self.model_fields_set: + _dict["utilities"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Cluster 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"), + "org_id": obj.get("org_id"), + "connection_type": obj.get("connection_type"), + "server_url": obj.get("server_url"), + "utilities": obj.get("utilities"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + } + ) + return _obj diff --git a/saturn_api/models/cluster_connection_type.py b/saturn_api/models/cluster_connection_type.py new file mode 100644 index 0000000..d4c2272 --- /dev/null +++ b/saturn_api/models/cluster_connection_type.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +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 ClusterConnectionType(str, Enum): + """ + ClusterConnectionType + """ + + """ + allowed enum values + """ + INCLUSTER = "incluster" + TOKEN = "token" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ClusterConnectionType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/saturn_api/models/cluster_create.py b/saturn_api/models/cluster_create.py new file mode 100644 index 0000000..868081d --- /dev/null +++ b/saturn_api/models/cluster_create.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.cluster_connection_type import ClusterConnectionType + + +class ClusterCreate(BaseModel): + """ + ClusterCreate + """ # noqa: E501 + + name: StrictStr = Field(description="Unique name of the cluster.") + org_id: StrictStr = Field(description="ID of the org that owns the cluster.") + connection_type: ClusterConnectionType + server_url: Optional[StrictStr] = Field( + default=None, description="K8s API server URL. Required when connection_type is 'token'." + ) + ca_bundle: Optional[StrictStr] = Field( + default=None, + description="Base64-encoded CA bundle. Required when connection_type is 'token'.", + ) + token: Optional[StrictStr] = Field( + default=None, + description="Bearer token for k8s API. Required when connection_type is 'token'.", + ) + utilities: Optional[Dict[str, Any]] = Field( + default=None, description="ClusterUtilities metadata (service endpoints)." + ) + __properties: ClassVar[List[str]] = [ + "name", + "org_id", + "connection_type", + "server_url", + "ca_bundle", + "token", + "utilities", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClusterCreate 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, + ) + # set to None if server_url (nullable) is None + # and model_fields_set contains the field + if self.server_url is None and "server_url" in self.model_fields_set: + _dict["server_url"] = None + + # set to None if ca_bundle (nullable) is None + # and model_fields_set contains the field + if self.ca_bundle is None and "ca_bundle" in self.model_fields_set: + _dict["ca_bundle"] = None + + # set to None if token (nullable) is None + # and model_fields_set contains the field + if self.token is None and "token" in self.model_fields_set: + _dict["token"] = None + + # set to None if utilities (nullable) is None + # and model_fields_set contains the field + if self.utilities is None and "utilities" in self.model_fields_set: + _dict["utilities"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClusterCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "org_id": obj.get("org_id"), + "connection_type": obj.get("connection_type"), + "server_url": obj.get("server_url"), + "ca_bundle": obj.get("ca_bundle"), + "token": obj.get("token"), + "utilities": obj.get("utilities"), + } + ) + return _obj diff --git a/saturn_api/models/cluster_list.py b/saturn_api/models/cluster_list.py new file mode 100644 index 0000000..46d13cb --- /dev/null +++ b/saturn_api/models/cluster_list.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.cluster import Cluster + + +class ClusterList(BaseModel): + """ + ClusterList + """ # noqa: E501 + + clusters: List[Cluster] = Field(description="List of clusters.") + prev_key: Optional[StrictStr] = Field(default=None, description="Previous page key.") + next_key: Optional[StrictStr] = Field(default=None, description="Next page key.") + __properties: ClassVar[List[str]] = ["clusters", "prev_key", "next_key"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClusterList 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "clusters", + "prev_key", + "next_key", + ] + ) + + _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 clusters (list) + _items = [] + if self.clusters: + for _item_clusters in self.clusters: + if _item_clusters: + _items.append(_item_clusters.to_dict()) + _dict["clusters"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClusterList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "clusters": ( + [Cluster.from_dict(_item) for _item in obj["clusters"]] + if obj.get("clusters") is not None + else None + ), + "prev_key": obj.get("prev_key"), + "next_key": obj.get("next_key"), + } + ) + return _obj diff --git a/saturn_api/models/cluster_update.py b/saturn_api/models/cluster_update.py new file mode 100644 index 0000000..6000c51 --- /dev/null +++ b/saturn_api/models/cluster_update.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.cluster_connection_type import ClusterConnectionType + + +class ClusterUpdate(BaseModel): + """ + ClusterUpdate + """ # noqa: E501 + + connection_type: Optional[ClusterConnectionType] = None + server_url: Optional[StrictStr] = Field(default=None, description="K8s API server URL.") + ca_bundle: Optional[StrictStr] = Field(default=None, description="Base64-encoded CA bundle.") + token: Optional[StrictStr] = Field(default=None, description="Bearer token.") + utilities: Optional[Dict[str, Any]] = Field( + default=None, description="ClusterUtilities metadata." + ) + __properties: ClassVar[List[str]] = [ + "connection_type", + "server_url", + "ca_bundle", + "token", + "utilities", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClusterUpdate 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, + ) + # set to None if server_url (nullable) is None + # and model_fields_set contains the field + if self.server_url is None and "server_url" in self.model_fields_set: + _dict["server_url"] = None + + # set to None if ca_bundle (nullable) is None + # and model_fields_set contains the field + if self.ca_bundle is None and "ca_bundle" in self.model_fields_set: + _dict["ca_bundle"] = None + + # set to None if token (nullable) is None + # and model_fields_set contains the field + if self.token is None and "token" in self.model_fields_set: + _dict["token"] = None + + # set to None if utilities (nullable) is None + # and model_fields_set contains the field + if self.utilities is None and "utilities" in self.model_fields_set: + _dict["utilities"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClusterUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "connection_type": obj.get("connection_type"), + "server_url": obj.get("server_url"), + "ca_bundle": obj.get("ca_bundle"), + "token": obj.get("token"), + "utilities": obj.get("utilities"), + } + ) + return _obj diff --git a/saturn_api/models/config_file_entry.py b/saturn_api/models/config_file_entry.py new file mode 100644 index 0000000..35e79cf --- /dev/null +++ b/saturn_api/models/config_file_entry.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class ConfigFileEntry(BaseModel): + """ + ConfigFileEntry + """ # noqa: E501 + + content: StrictStr = Field(description="Content of the config file.") + mode: Optional[StrictStr] = Field( + default="0644", description="File mode as a 4-character octal string, e.g. '0644'." + ) + __properties: ClassVar[List[str]] = ["content", "mode"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConfigFileEntry 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 ConfigFileEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "content": obj.get("content"), + "mode": obj.get("mode") if obj.get("mode") is not None else "0644", + } + ) + return _obj diff --git a/saturn_api/models/cron_schedule.py b/saturn_api/models/cron_schedule.py index 29a8faa..6a3493b 100644 --- a/saturn_api/models/cron_schedule.py +++ b/saturn_api/models/cron_schedule.py @@ -19,7 +19,7 @@ from typing import Any, ClassVar, Dict, List, Literal, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing_extensions import Annotated, Self +from typing_extensions import Self class CronSchedule(BaseModel): @@ -29,10 +29,7 @@ class CronSchedule(BaseModel): schedule: StrictStr = Field(description="Cron schedule for triggering the job.") concurrency_policy: Literal["Allow", "Forbid", "Replace"] - backoff_limit: Annotated[int, Field(strict=True, ge=0)] = Field( - description="Maximum number of retries for a failed job." - ) - __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy", "backoff_limit"] + __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy"] @field_validator("concurrency_policy") def concurrency_policy_validate_enum(cls, value): @@ -72,13 +69,11 @@ def to_dict(self) -> Dict[str, Any]: are ignored. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "schedule", "concurrency_policy", - "backoff_limit", ] ) @@ -99,10 +94,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - { - "schedule": obj.get("schedule"), - "concurrency_policy": obj.get("concurrency_policy"), - "backoff_limit": obj.get("backoff_limit"), - } + {"schedule": obj.get("schedule"), "concurrency_policy": obj.get("concurrency_policy")} ) return _obj diff --git a/saturn_api/models/cron_schedule_create.py b/saturn_api/models/cron_schedule_create.py index 67b1088..48d4139 100644 --- a/saturn_api/models/cron_schedule_create.py +++ b/saturn_api/models/cron_schedule_create.py @@ -19,7 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self +from typing_extensions import Self from saturn_api.models.concurrency_policy import ConcurrencyPolicy @@ -31,10 +31,7 @@ class CronScheduleCreate(BaseModel): schedule: StrictStr = Field(description="Cron schedule for triggering the job.") concurrency_policy: Optional[ConcurrencyPolicy] = None - backoff_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=0, description="Maximum number of retries for a failed job." - ) - __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy", "backoff_limit"] + __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy"] model_config = ConfigDict( populate_by_name=True, @@ -85,12 +82,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - { - "schedule": obj.get("schedule"), - "concurrency_policy": obj.get("concurrency_policy"), - "backoff_limit": ( - obj.get("backoff_limit") if obj.get("backoff_limit") is not None else 0 - ), - } + {"schedule": obj.get("schedule"), "concurrency_policy": obj.get("concurrency_policy")} ) return _obj diff --git a/saturn_api/models/cron_schedule_update.py b/saturn_api/models/cron_schedule_update.py index 730fd87..a746793 100644 --- a/saturn_api/models/cron_schedule_update.py +++ b/saturn_api/models/cron_schedule_update.py @@ -19,7 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self +from typing_extensions import Self from saturn_api.models.concurrency_policy import ConcurrencyPolicy @@ -33,10 +33,7 @@ class CronScheduleUpdate(BaseModel): default=None, description="Cron schedule for triggering the job." ) concurrency_policy: Optional[ConcurrencyPolicy] = None - backoff_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=None, description="Maximum number of retries for a failed job." - ) - __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy", "backoff_limit"] + __properties: ClassVar[List[str]] = ["schedule", "concurrency_policy"] model_config = ConfigDict( populate_by_name=True, @@ -87,10 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - { - "schedule": obj.get("schedule"), - "concurrency_policy": obj.get("concurrency_policy"), - "backoff_limit": obj.get("backoff_limit"), - } + {"schedule": obj.get("schedule"), "concurrency_policy": obj.get("concurrency_policy")} ) return _obj diff --git a/saturn_api/models/dataset.py b/saturn_api/models/dataset.py new file mode 100644 index 0000000..9293e6b --- /dev/null +++ b/saturn_api/models/dataset.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.artifact_kind import ArtifactKind +from saturn_api.models.artifact_status import ArtifactStatus + + +class Dataset(BaseModel): + """ + Dataset + """ # noqa: E501 + + id: StrictStr = Field(description="Dataset identifier.") + org_id: StrictStr = Field(description="Owning organisation ID.") + name: StrictStr = Field(description="Human-readable dataset name.") + kind: ArtifactKind + status: ArtifactStatus + location: StrictStr = Field(description="Storage location URI (sf:/).") + metadata: Optional[Dict[str, Any]] = Field( + description="Arbitrary metadata blob (schema_type, row_count, etc.)." + ) + created_at: StrictStr = Field(description="Creation timestamp (UTC).") + __properties: ClassVar[List[str]] = [ + "id", + "org_id", + "name", + "kind", + "status", + "location", + "metadata", + "created_at", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Dataset 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "org_id", + "name", + "location", + "metadata", + "created_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Dataset 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"), + "org_id": obj.get("org_id"), + "name": obj.get("name"), + "kind": obj.get("kind"), + "status": obj.get("status"), + "location": obj.get("location"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at"), + } + ) + return _obj diff --git a/saturn_api/models/dataset_create.py b/saturn_api/models/dataset_create.py new file mode 100644 index 0000000..82bb576 --- /dev/null +++ b/saturn_api/models/dataset_create.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class DatasetCreate(BaseModel): + """ + DatasetCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the dataset." + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Optional metadata blob: schema_type, description, row_count, format hints, etc. Platform treats dataset bytes as opaque — format details live here.", + ) + __properties: ClassVar[List[str]] = ["name", "metadata"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetCreate 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, + ) + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "metadata": obj.get("metadata")}) + return _obj diff --git a/saturn_api/models/dataset_import_create.py b/saturn_api/models/dataset_import_create.py new file mode 100644 index 0000000..aa2c350 --- /dev/null +++ b/saturn_api/models/dataset_import_create.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Annotated, Self + + +class DatasetImportCreate(BaseModel): + """ + DatasetImportCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the dataset." + ) + hf_dataset_id: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Hugging Face dataset identifier, e.g. ``databricks/databricks-dolly-15k``." + ) + split: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( + default="train", description="Hugging Face split to import (default: ``train``)." + ) + config_name: Optional[StrictStr] = Field( + default=None, description="Optional Hugging Face config/subset name." + ) + __properties: ClassVar[List[str]] = ["name", "hf_dataset_id", "split", "config_name"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetImportCreate 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, + ) + # set to None if config_name (nullable) is None + # and model_fields_set contains the field + if self.config_name is None and "config_name" in self.model_fields_set: + _dict["config_name"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetImportCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "hf_dataset_id": obj.get("hf_dataset_id"), + "split": obj.get("split") if obj.get("split") is not None else "train", + "config_name": obj.get("config_name"), + } + ) + return _obj diff --git a/saturn_api/models/dataset_list.py b/saturn_api/models/dataset_list.py new file mode 100644 index 0000000..795fe0c --- /dev/null +++ b/saturn_api/models/dataset_list.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.dataset import Dataset + + +class DatasetList(BaseModel): + """ + DatasetList + """ # noqa: E501 + + datasets: List[Dataset] = Field(description="List of datasets.") + prev_key: Optional[StrictStr] = Field(default=None, description="Previous page key.") + next_key: Optional[StrictStr] = Field(default=None, description="Next page key.") + __properties: ClassVar[List[str]] = ["datasets", "prev_key", "next_key"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetList 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "datasets", + "prev_key", + "next_key", + ] + ) + + _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 datasets (list) + _items = [] + if self.datasets: + for _item_datasets in self.datasets: + if _item_datasets: + _items.append(_item_datasets.to_dict()) + _dict["datasets"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "datasets": ( + [Dataset.from_dict(_item) for _item in obj["datasets"]] + if obj.get("datasets") is not None + else None + ), + "prev_key": obj.get("prev_key"), + "next_key": obj.get("next_key"), + } + ) + return _obj diff --git a/saturn_api/models/dataset_lock_create.py b/saturn_api/models/dataset_lock_create.py new file mode 100644 index 0000000..10280ed --- /dev/null +++ b/saturn_api/models/dataset_lock_create.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Annotated, Self + + +class DatasetLockCreate(BaseModel): + """ + DatasetLockCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the dataset." + ) + shared_folder_id: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="ID of the existing SharedFolder to lock and register as a dataset." + ) + subpath: Optional[StrictStr] = Field( + default=None, + description="Optional subpath within the folder where the dataset bytes live (e.g. ``data.jsonl`` or ``subdir/``). Defaults to the folder root.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, description="Optional metadata blob (schema_type, row_count, etc.)." + ) + __properties: ClassVar[List[str]] = ["name", "shared_folder_id", "subpath", "metadata"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetLockCreate 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, + ) + # set to None if subpath (nullable) is None + # and model_fields_set contains the field + if self.subpath is None and "subpath" in self.model_fields_set: + _dict["subpath"] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetLockCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "shared_folder_id": obj.get("shared_folder_id"), + "subpath": obj.get("subpath"), + "metadata": obj.get("metadata"), + } + ) + return _obj diff --git a/saturn_api/models/deployment.py b/saturn_api/models/deployment.py index b8001b2..5c78c33 100644 --- a/saturn_api/models/deployment.py +++ b/saturn_api/models/deployment.py @@ -53,6 +53,9 @@ class Deployment(BaseModel): extra_packages: Optional[ExtraPackages] = Field( description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, Dict[str, StrictStr]]] = Field( + default=None, description="User-defined config files written to $HOME at pod startup." + ) scale: StrictInt = Field(description="Number of pod replicas.") start_script: Optional[StrictStr] = Field( default=None, description="Shell script that runs on start before the primary command." @@ -97,6 +100,7 @@ class Deployment(BaseModel): "instance_size", "image_tag", "extra_packages", + "config_files", "scale", "start_script", "environment_variables", @@ -187,6 +191,7 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ @@ -198,6 +203,7 @@ def to_dict(self) -> Dict[str, Any]: "instance_size", "image_tag", "extra_packages", + "config_files", "scale", "start_script", "environment_variables", @@ -250,6 +256,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -285,6 +296,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": obj.get("config_files"), "scale": obj.get("scale"), "start_script": obj.get("start_script"), "environment_variables": obj.get("environment_variables"), diff --git a/saturn_api/models/deployment_create.py b/saturn_api/models/deployment_create.py index 84c20c9..3f9c394 100644 --- a/saturn_api/models/deployment_create.py +++ b/saturn_api/models/deployment_create.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, ) @@ -58,6 +59,10 @@ class DeploymentCreate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script to run on start before the primary command." ) @@ -96,6 +101,7 @@ class DeploymentCreate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "is_spot", @@ -157,6 +163,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # set to None if tags (nullable) is None # and model_fields_set contains the field if self.tags is None and "tags" in self.model_fields_set: @@ -180,6 +193,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -231,6 +249,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": ( obj.get("working_dir") diff --git a/saturn_api/models/deployment_spec.py b/saturn_api/models/deployment_spec.py index 5cd08c7..2cdfefb 100644 --- a/saturn_api/models/deployment_spec.py +++ b/saturn_api/models/deployment_spec.py @@ -28,6 +28,7 @@ ) from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.dask_cluster_attachment import DaskClusterAttachment from saturn_api.models.deployment_route_recipe import DeploymentRouteRecipe from saturn_api.models.external_repo_attachment_recipe import ( @@ -57,6 +58,7 @@ class DeploymentSpec(BaseModel): environment_variables: Optional[Dict[str, StrictStr]] = None working_directory: Optional[StrictStr] = None extra_packages: Optional[ExtraPackagesRecipe] = None + config_files: Optional[Dict[str, ConfigFileEntry]] = None start_script: Optional[StrictStr] = None token_scope: Optional[StrictStr] = None dask_cluster: Optional[DaskClusterAttachment] = None @@ -81,6 +83,7 @@ class DeploymentSpec(BaseModel): "environment_variables", "working_directory", "extra_packages", + "config_files", "start_script", "token_scope", "dask_cluster", @@ -153,6 +156,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # override the default output from pydantic by calling `to_dict()` of dask_cluster if self.dask_cluster: _dict["dask_cluster"] = self.dask_cluster.to_dict() @@ -196,6 +206,11 @@ def to_dict(self) -> Dict[str, Any]: if self.tags is None and "tags" in self.model_fields_set: _dict["tags"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -243,6 +258,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "token_scope": obj.get("token_scope"), "dask_cluster": ( diff --git a/saturn_api/models/deployment_update.py b/saturn_api/models/deployment_update.py index cb8ddf0..7e88c9c 100644 --- a/saturn_api/models/deployment_update.py +++ b/saturn_api/models/deployment_update.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, ) @@ -53,6 +54,10 @@ class DeploymentUpdate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script that runs on start before the primary command." ) @@ -89,6 +94,7 @@ class DeploymentUpdate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "instance_size", @@ -148,6 +154,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # set to None if tags (nullable) is None # and model_fields_set contains the field if self.tags is None and "tags" in self.model_fields_set: @@ -158,6 +171,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -210,6 +228,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": obj.get("working_dir"), "instance_size": obj.get("instance_size"), diff --git a/saturn_api/models/disk_space_option.py b/saturn_api/models/disk_space_option.py new file mode 100644 index 0000000..8f35b41 --- /dev/null +++ b/saturn_api/models/disk_space_option.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class DiskSpaceOption(BaseModel): + """ + DiskSpaceOption + """ # noqa: E501 + + value: StrictStr = Field( + description="Kubernetes-style disk size (e.g. '100Gi') submitted when creating a resource." + ) + display_str: StrictStr = Field(description="Human-readable label shown in the picker.") + __properties: ClassVar[List[str]] = ["value", "display_str"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiskSpaceOption 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "value", + "display_str", + ] + ) + + _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 DiskSpaceOption from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"value": obj.get("value"), "display_str": obj.get("display_str")} + ) + return _obj diff --git a/saturn_api/models/fine_tune_job_create.py b/saturn_api/models/fine_tune_job_create.py new file mode 100644 index 0000000..17a5cec --- /dev/null +++ b/saturn_api/models/fine_tune_job_create.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from saturn_api.models.hyperparameters1 import Hyperparameters1 + + +class FineTuneJobCreate(BaseModel): + """ + FineTuneJobCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the fine-tuning job." + ) + dataset_id: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Identifier of a token-factory dataset artifact. The dataset must have status=READY and belong to the same org as the requester." + ) + hyperparameters: Hyperparameters1 = Field(description="Training hyperparameters.") + instance_size: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Saturn instance size to run the training pod on. Must be a GPU-equipped size (gpu > 0)." + ) + base_model: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( + default=None, + description="Base model to fine-tune a fresh adapter from. Must be one of the platform's supported models (see SUPPORTED_MODELS allow-list). Provide EITHER this OR ``source_checkpoint_artifact_id`` (exactly one). Omit when continuing from a checkpoint — the base_model is then derived from the checkpoint's metadata.", + ) + source_checkpoint_artifact_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = ( + Field( + default=None, + description="Artifact id of an existing checkpoint to continue-train. Must be a ``kind=checkpoint`` Artifact with ``status=ready`` belonging to the same org as the requester. When set, training continues the SAME LoRA adapter on the new dataset (weight-init continuation), and ``base_model`` is derived from the checkpoint's metadata. Provide EITHER this OR ``base_model`` (exactly one).", + ) + ) + __properties: ClassVar[List[str]] = [ + "name", + "dataset_id", + "hyperparameters", + "instance_size", + "base_model", + "source_checkpoint_artifact_id", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FineTuneJobCreate 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 hyperparameters + if self.hyperparameters: + _dict["hyperparameters"] = self.hyperparameters.to_dict() + # set to None if base_model (nullable) is None + # and model_fields_set contains the field + if self.base_model is None and "base_model" in self.model_fields_set: + _dict["base_model"] = None + + # set to None if source_checkpoint_artifact_id (nullable) is None + # and model_fields_set contains the field + if ( + self.source_checkpoint_artifact_id is None + and "source_checkpoint_artifact_id" in self.model_fields_set + ): + _dict["source_checkpoint_artifact_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FineTuneJobCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "dataset_id": obj.get("dataset_id"), + "hyperparameters": ( + Hyperparameters1.from_dict(obj["hyperparameters"]) + if obj.get("hyperparameters") is not None + else None + ), + "instance_size": obj.get("instance_size"), + "base_model": obj.get("base_model"), + "source_checkpoint_artifact_id": obj.get("source_checkpoint_artifact_id"), + } + ) + return _obj diff --git a/saturn_api/models/fine_tune_job_list.py b/saturn_api/models/fine_tune_job_list.py new file mode 100644 index 0000000..6fc8489 --- /dev/null +++ b/saturn_api/models/fine_tune_job_list.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.fine_tune_job_summary import FineTuneJobSummary + + +class FineTuneJobList(BaseModel): + """ + FineTuneJobList + """ # noqa: E501 + + jobs: List[FineTuneJobSummary] = Field( + description="List of fine-tuning jobs (``FineTuneJobSummary`` projections — without ``latest_checkpoint``; fetch the by-id endpoint for that)." + ) + prev_key: Optional[StrictStr] = Field(default=None, description="Previous page key.") + next_key: Optional[StrictStr] = Field(default=None, description="Next page key.") + __properties: ClassVar[List[str]] = ["jobs", "prev_key", "next_key"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FineTuneJobList 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "jobs", + "prev_key", + "next_key", + ] + ) + + _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 jobs (list) + _items = [] + if self.jobs: + for _item_jobs in self.jobs: + if _item_jobs: + _items.append(_item_jobs.to_dict()) + _dict["jobs"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FineTuneJobList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "jobs": ( + [FineTuneJobSummary.from_dict(_item) for _item in obj["jobs"]] + if obj.get("jobs") is not None + else None + ), + "prev_key": obj.get("prev_key"), + "next_key": obj.get("next_key"), + } + ) + return _obj diff --git a/saturn_api/models/fine_tune_job_summary.py b/saturn_api/models/fine_tune_job_summary.py new file mode 100644 index 0000000..3332549 --- /dev/null +++ b/saturn_api/models/fine_tune_job_summary.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.hyperparameters import Hyperparameters + + +class FineTuneJobSummary(BaseModel): + """ + FineTuneJobSummary + """ # noqa: E501 + + id: StrictStr = Field(description="Fine-tune job ID (same as the underlying deployment ID).") + name: StrictStr + status: StrictStr = Field( + description="Underlying Saturn job status: pending, running, stopping, stopped, completed, or error. Same vocabulary as the rest of the platform — TF intentionally does not translate to a product-specific set." + ) + created_at: StrictStr + started_at: Optional[StrictStr] + finished_at: Optional[StrictStr] + base_model: StrictStr + hyperparameters: Hyperparameters + __properties: ClassVar[List[str]] = [ + "id", + "name", + "status", + "created_at", + "started_at", + "finished_at", + "base_model", + "hyperparameters", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FineTuneJobSummary 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "name", + "status", + "created_at", + "started_at", + "finished_at", + "base_model", + "hyperparameters", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of hyperparameters + if self.hyperparameters: + _dict["hyperparameters"] = self.hyperparameters.to_dict() + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict["started_at"] = None + + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict["finished_at"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FineTuneJobSummary 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"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at"), + "base_model": obj.get("base_model"), + "hyperparameters": ( + Hyperparameters.from_dict(obj["hyperparameters"]) + if obj.get("hyperparameters") is not None + else None + ), + } + ) + return _obj diff --git a/saturn_api/models/fine_tune_job_view.py b/saturn_api/models/fine_tune_job_view.py new file mode 100644 index 0000000..f6a1419 --- /dev/null +++ b/saturn_api/models/fine_tune_job_view.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.artifact import Artifact +from saturn_api.models.hyperparameters import Hyperparameters + + +class FineTuneJobView(BaseModel): + """ + FineTuneJobView + """ # noqa: E501 + + id: StrictStr = Field(description="Fine-tune job ID (same as the underlying deployment ID).") + name: StrictStr + status: StrictStr = Field( + description="Underlying Saturn job status: pending, running, stopping, stopped, completed, or error. Same vocabulary as the rest of the platform — TF intentionally does not translate to a product-specific set." + ) + created_at: StrictStr + started_at: Optional[StrictStr] + finished_at: Optional[StrictStr] + base_model: StrictStr + hyperparameters: Hyperparameters + dataset_id: StrictStr + output_location: StrictStr = Field( + description="Structured location of the job's RW output folder: sf://." + ) + latest_checkpoint: Optional[Artifact] = Field( + description="Most recently-registered usable (``status=ready``) checkpoint artifact (kind=checkpoint) whose ``producer.id`` matches this job's deployment id. Null if no ready checkpoint exists — the job may still be running, may have failed, or may have registered an error artifact (``status=error``) which is deliberately NOT surfaced here. To diagnose failures, read the job's training logs; the shim tees axolotl output to ``/training.log``. Named ``latest_checkpoint`` rather than ``checkpoint`` to leave room for future API surface exposing intermediate per-epoch checkpoints (axolotl writes ``checkpoint-N/`` subdirs to NFS during training, but those are not registered as separate Artifact rows today). Only returned by the single-GET endpoint; list responses use ``FineTuneJobSummary`` which omits this field." + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "status", + "created_at", + "started_at", + "finished_at", + "base_model", + "hyperparameters", + "dataset_id", + "output_location", + "latest_checkpoint", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FineTuneJobView 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "name", + "status", + "created_at", + "started_at", + "finished_at", + "base_model", + "hyperparameters", + "dataset_id", + "output_location", + "latest_checkpoint", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of hyperparameters + if self.hyperparameters: + _dict["hyperparameters"] = self.hyperparameters.to_dict() + # override the default output from pydantic by calling `to_dict()` of latest_checkpoint + if self.latest_checkpoint: + _dict["latest_checkpoint"] = self.latest_checkpoint.to_dict() + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict["started_at"] = None + + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict["finished_at"] = None + + # set to None if latest_checkpoint (nullable) is None + # and model_fields_set contains the field + if self.latest_checkpoint is None and "latest_checkpoint" in self.model_fields_set: + _dict["latest_checkpoint"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FineTuneJobView 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"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at"), + "base_model": obj.get("base_model"), + "hyperparameters": ( + Hyperparameters.from_dict(obj["hyperparameters"]) + if obj.get("hyperparameters") is not None + else None + ), + "dataset_id": obj.get("dataset_id"), + "output_location": obj.get("output_location"), + "latest_checkpoint": ( + Artifact.from_dict(obj["latest_checkpoint"]) + if obj.get("latest_checkpoint") is not None + else None + ), + } + ) + return _obj diff --git a/saturn_api/models/hyperparameters.py b/saturn_api/models/hyperparameters.py new file mode 100644 index 0000000..0407bf4 --- /dev/null +++ b/saturn_api/models/hyperparameters.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing_extensions import Self + + +class Hyperparameters(BaseModel): + """ + Hyperparameters + """ # noqa: E501 + + learning_rate: Union[StrictFloat, StrictInt] + epochs: StrictInt + effective_batch_size: StrictInt + max_seq_length: StrictInt + lora_rank: StrictInt + lora_alpha: StrictInt + __properties: ClassVar[List[str]] = [ + "learning_rate", + "epochs", + "effective_batch_size", + "max_seq_length", + "lora_rank", + "lora_alpha", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Hyperparameters 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "learning_rate", + "epochs", + "effective_batch_size", + "max_seq_length", + "lora_rank", + "lora_alpha", + ] + ) + + _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 Hyperparameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "learning_rate": obj.get("learning_rate"), + "epochs": obj.get("epochs"), + "effective_batch_size": obj.get("effective_batch_size"), + "max_seq_length": obj.get("max_seq_length"), + "lora_rank": obj.get("lora_rank"), + "lora_alpha": obj.get("lora_alpha"), + } + ) + return _obj diff --git a/saturn_api/models/hyperparameters1.py b/saturn_api/models/hyperparameters1.py new file mode 100644 index 0000000..323662a --- /dev/null +++ b/saturn_api/models/hyperparameters1.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class Hyperparameters1(BaseModel): + """ + Hyperparameters1 + """ # noqa: E501 + + learning_rate: Union[ + Annotated[float, Field(le=1.0, strict=True, ge=0.0)], + Annotated[int, Field(le=1, strict=True, ge=0)], + ] = Field(description="Learning rate. Must be in (0, 1).") + epochs: Annotated[int, Field(le=10, strict=True, ge=1)] = Field( + description="Number of training epochs. Must be in [1, 10]." + ) + effective_batch_size: Annotated[int, Field(le=128, strict=True, ge=1)] = Field( + description="Effective batch size — the number of samples whose gradients are averaged per optimizer step. The platform translates this to axolotl's ``gradient_accumulation_steps × micro_batch_size``; ``micro_batch_size`` is auto-found at runtime to fit GPU memory." + ) + max_seq_length: Annotated[int, Field(le=16384, strict=True, ge=128)] = Field( + description="Maximum sequence length (tokens) per training sample. Longer sequences use proportionally more GPU memory. Must be in [128, 16384]." + ) + lora_rank: Annotated[int, Field(le=128, strict=True, ge=1)] = Field( + description="LoRA adapter rank. Must be in [1, 128]." + ) + lora_alpha: Annotated[int, Field(le=256, strict=True, ge=1)] = Field( + description="LoRA alpha scaling factor. Must be in [1, 256]." + ) + __properties: ClassVar[List[str]] = [ + "learning_rate", + "epochs", + "effective_batch_size", + "max_seq_length", + "lora_rank", + "lora_alpha", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Hyperparameters1 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 Hyperparameters1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "learning_rate": obj.get("learning_rate"), + "epochs": obj.get("epochs"), + "effective_batch_size": obj.get("effective_batch_size"), + "max_seq_length": obj.get("max_seq_length"), + "lora_rank": obj.get("lora_rank"), + "lora_alpha": obj.get("lora_alpha"), + } + ) + return _obj diff --git a/saturn_api/models/inference_endpoint_create.py b/saturn_api/models/inference_endpoint_create.py new file mode 100644 index 0000000..b4fd3a5 --- /dev/null +++ b/saturn_api/models/inference_endpoint_create.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Literal, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class InferenceEndpointCreate(BaseModel): + """ + InferenceEndpointCreate + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Human-readable name for the inference endpoint." + ) + checkpoint_artifact_id: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Artifact id of the checkpoint to serve. Must be a ``kind=checkpoint`` Artifact with ``status=ready`` belonging to the same org as the requester." + ) + instance_size: Annotated[str, Field(min_length=1, strict=True)] = Field( + description="Saturn instance size to run the inference pod on. Must be a GPU-equipped size (gpu > 0)." + ) + quantization: Literal["fp8", "int8"] | None = None + visibility: Literal["org", "owner"] = "org" + viewers: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = Field( + default=None, + description="Optional list of identity names (usernames or group names in the endpoint's org) granted access to the endpoint route in addition to the owner. Honored by ForwardAuth exactly like a normal deployment's viewers.", + ) + __properties: ClassVar[List[str]] = [ + "name", + "checkpoint_artifact_id", + "instance_size", + "quantization", + "visibility", + "viewers", + ] + + @field_validator("quantization") + def quantization_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["fp8", "int8"]): + raise ValueError("must be one of enum values ('fp8', 'int8')") + return value + + @field_validator("visibility") + def visibility_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["org", "owner"]): + raise ValueError("must be one of enum values ('org', 'owner')") + return value + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InferenceEndpointCreate 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, + ) + # set to None if quantization (nullable) is None + # and model_fields_set contains the field + if self.quantization is None and "quantization" in self.model_fields_set: + _dict["quantization"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InferenceEndpointCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "checkpoint_artifact_id": obj.get("checkpoint_artifact_id"), + "instance_size": obj.get("instance_size"), + "quantization": obj.get("quantization"), + "visibility": obj.get("visibility") if obj.get("visibility") is not None else "org", + "viewers": obj.get("viewers"), + } + ) + return _obj diff --git a/saturn_api/models/inference_endpoint_list.py b/saturn_api/models/inference_endpoint_list.py new file mode 100644 index 0000000..909c4fd --- /dev/null +++ b/saturn_api/models/inference_endpoint_list.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.inference_endpoint_summary import InferenceEndpointSummary + + +class InferenceEndpointList(BaseModel): + """ + InferenceEndpointList + """ # noqa: E501 + + endpoints: List[InferenceEndpointSummary] = Field( + description="List of inference endpoints (``InferenceEndpointSummary`` projections — without ``checkpoint``; fetch the by-id endpoint for that)." + ) + prev_key: Optional[StrictStr] = Field(default=None, description="Previous page key.") + next_key: Optional[StrictStr] = Field(default=None, description="Next page key.") + __properties: ClassVar[List[str]] = ["endpoints", "prev_key", "next_key"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InferenceEndpointList 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "endpoints", + "prev_key", + "next_key", + ] + ) + + _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 endpoints (list) + _items = [] + if self.endpoints: + for _item_endpoints in self.endpoints: + if _item_endpoints: + _items.append(_item_endpoints.to_dict()) + _dict["endpoints"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InferenceEndpointList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "endpoints": ( + [InferenceEndpointSummary.from_dict(_item) for _item in obj["endpoints"]] + if obj.get("endpoints") is not None + else None + ), + "prev_key": obj.get("prev_key"), + "next_key": obj.get("next_key"), + } + ) + return _obj diff --git a/saturn_api/models/inference_endpoint_summary.py b/saturn_api/models/inference_endpoint_summary.py new file mode 100644 index 0000000..6745a8a --- /dev/null +++ b/saturn_api/models/inference_endpoint_summary.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class InferenceEndpointSummary(BaseModel): + """ + InferenceEndpointSummary + """ # noqa: E501 + + id: StrictStr = Field( + description="Inference endpoint ID (same as the underlying deployment ID)." + ) + name: StrictStr + status: StrictStr = Field( + description="Underlying Saturn deployment status: pending, running, stopping, stopped, or error." + ) + created_at: StrictStr + base_model: StrictStr = Field( + description="HuggingFace base model id derived from the checkpoint Artifact's ``metadata.base_model`` at create time." + ) + checkpoint_artifact_id: StrictStr = Field( + description="Artifact id of the checkpoint this endpoint is serving." + ) + instance_size: StrictStr + endpoint_url: StrictStr = Field( + description="Public URL clients POST OpenAI-compatible inference requests to. Uses the deployment's auto-generated subdomain. Returns the URL regardless of running state — clients can stash it; calls fail while the endpoint is stopped." + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "status", + "created_at", + "base_model", + "checkpoint_artifact_id", + "instance_size", + "endpoint_url", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InferenceEndpointSummary 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "name", + "status", + "created_at", + "base_model", + "checkpoint_artifact_id", + "instance_size", + "endpoint_url", + ] + ) + + _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 InferenceEndpointSummary 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"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "base_model": obj.get("base_model"), + "checkpoint_artifact_id": obj.get("checkpoint_artifact_id"), + "instance_size": obj.get("instance_size"), + "endpoint_url": obj.get("endpoint_url"), + } + ) + return _obj diff --git a/saturn_api/models/inference_endpoint_view.py b/saturn_api/models/inference_endpoint_view.py new file mode 100644 index 0000000..7175432 --- /dev/null +++ b/saturn_api/models/inference_endpoint_view.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from saturn_api.models.artifact import Artifact + + +class InferenceEndpointView(BaseModel): + """ + InferenceEndpointView + """ # noqa: E501 + + id: StrictStr = Field( + description="Inference endpoint ID (same as the underlying deployment ID)." + ) + name: StrictStr + status: StrictStr = Field( + description="Underlying Saturn deployment status: pending, running, stopping, stopped, or error." + ) + created_at: StrictStr + base_model: StrictStr = Field( + description="HuggingFace base model id derived from the checkpoint Artifact's ``metadata.base_model`` at create time." + ) + checkpoint_artifact_id: StrictStr = Field( + description="Artifact id of the checkpoint this endpoint is serving." + ) + instance_size: StrictStr + endpoint_url: StrictStr = Field( + description="Public URL clients POST OpenAI-compatible inference requests to. Uses the deployment's auto-generated subdomain. Returns the URL regardless of running state — clients can stash it; calls fail while the endpoint is stopped." + ) + checkpoint: Optional[Artifact] = Field( + description="Resolved checkpoint Artifact. Null only if the artifact was deleted out from under the endpoint (we block that path; the field is nullable defensively)." + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "status", + "created_at", + "base_model", + "checkpoint_artifact_id", + "instance_size", + "endpoint_url", + "checkpoint", + ] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InferenceEndpointView 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + "name", + "status", + "created_at", + "base_model", + "checkpoint_artifact_id", + "instance_size", + "endpoint_url", + "checkpoint", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of checkpoint + if self.checkpoint: + _dict["checkpoint"] = self.checkpoint.to_dict() + # set to None if checkpoint (nullable) is None + # and model_fields_set contains the field + if self.checkpoint is None and "checkpoint" in self.model_fields_set: + _dict["checkpoint"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InferenceEndpointView 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"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "base_model": obj.get("base_model"), + "checkpoint_artifact_id": obj.get("checkpoint_artifact_id"), + "instance_size": obj.get("instance_size"), + "endpoint_url": obj.get("endpoint_url"), + "checkpoint": ( + Artifact.from_dict(obj["checkpoint"]) + if obj.get("checkpoint") is not None + else None + ), + } + ) + return _obj diff --git a/saturn_api/models/instance_size.py b/saturn_api/models/instance_size.py index 01defc7..53d0aba 100644 --- a/saturn_api/models/instance_size.py +++ b/saturn_api/models/instance_size.py @@ -18,7 +18,14 @@ import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set, Union -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, +) from typing_extensions import Self from saturn_api.models.hardware_type import HardwareType @@ -40,6 +47,8 @@ class InstanceSize(BaseModel): display_name: StrictStr price_per_hour: Optional[Union[StrictFloat, StrictInt]] = None description: Optional[StrictStr] = "" + disabled: Optional[StrictBool] = False + disabled_message: Optional[StrictStr] = "" __properties: ClassVar[List[str]] = [ "name", "cores", @@ -52,6 +61,8 @@ class InstanceSize(BaseModel): "display_name", "price_per_hour", "description", + "disabled", + "disabled_message", ] model_config = ConfigDict( @@ -130,6 +141,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "display_name": obj.get("display_name"), "price_per_hour": obj.get("price_per_hour"), "description": obj.get("description") if obj.get("description") is not None else "", + "disabled": obj.get("disabled") if obj.get("disabled") is not None else False, + "disabled_message": ( + obj.get("disabled_message") if obj.get("disabled_message") is not None else "" + ), } ) return _obj diff --git a/saturn_api/models/job.py b/saturn_api/models/job.py index 8a00b52..ca9bf51 100644 --- a/saturn_api/models/job.py +++ b/saturn_api/models/job.py @@ -54,6 +54,9 @@ class Job(BaseModel): extra_packages: Optional[ExtraPackages] = Field( description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, Dict[str, StrictStr]]] = Field( + default=None, description="User-defined config files written to $HOME at pod startup." + ) cron_schedule_options: Optional[CronSchedule] = Field( default=None, description="Cron schedule configuration for scheduled jobs." ) @@ -67,6 +70,7 @@ class Job(BaseModel): is_spot: StrictBool = Field(description="Enables running on spot instance sizes.") start_dind: StrictBool = Field(description="Enables docker-in-docker.") scale: StrictInt = Field(description="Number of pod replicas.") + retries: StrictInt = Field(description="Maximum number of retries for a failed job.") k8s_name: StrictStr = Field(description="Unique name for associated kubernetes objects.") require_restart: StrictBool = Field( description="True if an update was applied that requires restart to take effect." @@ -93,6 +97,7 @@ class Job(BaseModel): "instance_size", "image_tag", "extra_packages", + "config_files", "cron_schedule_options", "start_script", "environment_variables", @@ -100,6 +105,7 @@ class Job(BaseModel): "is_spot", "start_dind", "scale", + "retries", "k8s_name", "require_restart", "resource_type", @@ -177,6 +183,8 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ @@ -188,6 +196,7 @@ def to_dict(self) -> Dict[str, Any]: "instance_size", "image_tag", "extra_packages", + "config_files", "cron_schedule_options", "start_script", "environment_variables", @@ -195,6 +204,7 @@ def to_dict(self) -> Dict[str, Any]: "is_spot", "start_dind", "scale", + "retries", "k8s_name", "require_restart", "resource_type", @@ -240,6 +250,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -275,6 +290,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": obj.get("config_files"), "cron_schedule_options": ( CronSchedule.from_dict(obj["cron_schedule_options"]) if obj.get("cron_schedule_options") is not None @@ -286,6 +302,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_spot": obj.get("is_spot"), "start_dind": obj.get("start_dind"), "scale": obj.get("scale"), + "retries": obj.get("retries"), "k8s_name": obj.get("k8s_name"), "require_restart": obj.get("require_restart"), "resource_type": obj.get("resource_type"), diff --git a/saturn_api/models/job_create.py b/saturn_api/models/job_create.py index 5de896c..9c646be 100644 --- a/saturn_api/models/job_create.py +++ b/saturn_api/models/job_create.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.cron_schedule_create import CronScheduleCreate from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, @@ -59,6 +60,10 @@ class JobCreate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script to run on start before the primary command." ) @@ -75,6 +80,9 @@ class JobCreate(BaseModel): scale: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field( default=1, description="Number of pod replicas." ) + retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( + default=0, description="Maximum number of retries for a failed job." + ) cron_schedule_options: Optional[CronScheduleCreate] = Field( default=None, description="Cron schedule configuration for scheduled jobs." ) @@ -90,12 +98,14 @@ class JobCreate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "is_spot", "start_dind", "command", "scale", + "retries", "cron_schedule_options", ] @@ -149,6 +159,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # override the default output from pydantic by calling `to_dict()` of cron_schedule_options if self.cron_schedule_options: _dict["cron_schedule_options"] = self.cron_schedule_options.to_dict() @@ -175,6 +192,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -226,6 +248,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": ( obj.get("working_dir") @@ -236,6 +266,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "start_dind": obj.get("start_dind") if obj.get("start_dind") is not None else False, "command": obj.get("command"), "scale": obj.get("scale") if obj.get("scale") is not None else 1, + "retries": obj.get("retries") if obj.get("retries") is not None else 0, "cron_schedule_options": ( CronScheduleCreate.from_dict(obj["cron_schedule_options"]) if obj.get("cron_schedule_options") is not None diff --git a/saturn_api/models/job_spec.py b/saturn_api/models/job_spec.py index 48cf46b..b935a44 100644 --- a/saturn_api/models/job_spec.py +++ b/saturn_api/models/job_spec.py @@ -28,6 +28,7 @@ ) from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.dask_cluster_attachment import DaskClusterAttachment from saturn_api.models.external_repo_attachment_recipe import ( ExternalRepoAttachmentRecipe, @@ -55,6 +56,7 @@ class JobSpec(BaseModel): environment_variables: Optional[Dict[str, StrictStr]] = None working_directory: Optional[StrictStr] = None extra_packages: Optional[ExtraPackagesRecipe] = None + config_files: Optional[Dict[str, ConfigFileEntry]] = None start_script: Optional[StrictStr] = None token_scope: Optional[StrictStr] = None dask_cluster: Optional[DaskClusterAttachment] = None @@ -79,6 +81,7 @@ class JobSpec(BaseModel): "environment_variables", "working_directory", "extra_packages", + "config_files", "start_script", "token_scope", "dask_cluster", @@ -161,6 +164,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # override the default output from pydantic by calling `to_dict()` of dask_cluster if self.dask_cluster: _dict["dask_cluster"] = self.dask_cluster.to_dict() @@ -190,6 +200,11 @@ def to_dict(self) -> Dict[str, Any]: if self.tags is None and "tags" in self.model_fields_set: _dict["tags"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -242,6 +257,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "token_scope": obj.get("token_scope"), "dask_cluster": ( diff --git a/saturn_api/models/job_update.py b/saturn_api/models/job_update.py index 06cdf12..f1909bc 100644 --- a/saturn_api/models/job_update.py +++ b/saturn_api/models/job_update.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.cron_schedule_update import CronScheduleUpdate from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, @@ -54,6 +55,10 @@ class JobUpdate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script that runs on start before the primary command." ) @@ -71,6 +76,9 @@ class JobUpdate(BaseModel): scale: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field( default=None, description="Number of pod replicas." ) + retries: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( + default=None, description="Maximum number of retries for a failed job." + ) cron_schedule_options: Optional[CronScheduleUpdate] = Field( default=None, description="Cron schedule configuration for scheduled jobs." ) @@ -84,6 +92,7 @@ class JobUpdate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "instance_size", @@ -91,6 +100,7 @@ class JobUpdate(BaseModel): "start_dind", "command", "scale", + "retries", "cron_schedule_options", ] @@ -141,6 +151,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # override the default output from pydantic by calling `to_dict()` of cron_schedule_options if self.cron_schedule_options: _dict["cron_schedule_options"] = self.cron_schedule_options.to_dict() @@ -154,6 +171,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -201,6 +223,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": obj.get("working_dir"), "instance_size": obj.get("instance_size"), @@ -208,6 +238,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "start_dind": obj.get("start_dind"), "command": obj.get("command"), "scale": obj.get("scale"), + "retries": obj.get("retries"), "cron_schedule_options": ( CronScheduleUpdate.from_dict(obj["cron_schedule_options"]) if obj.get("cron_schedule_options") is not None diff --git a/saturn_api/models/org.py b/saturn_api/models/org.py index 102704c..fc0e5a1 100644 --- a/saturn_api/models/org.py +++ b/saturn_api/models/org.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Self +from saturn_api.models.usage_limits import UsageLimits + class Org(BaseModel): """ @@ -36,6 +38,9 @@ class Org(BaseModel): website_url: Optional[StrictStr] = Field(description="Website URL of the org.") logo_image_url: StrictStr = Field(description="Logo of the org.") limits_id: Optional[StrictStr] = Field(description="Usage limits ID applied to the entire org.") + limits: Optional[UsageLimits] = Field( + default=None, description="Usage limits applied to the entire org, if set." + ) is_primary: StrictBool = Field(description="Primary org for the account.") locked: StrictBool = Field(description="Locked orgs have restricted access to the API.") locked_reason: StrictStr = Field(description="Reason for the org being locked.") @@ -49,6 +54,7 @@ class Org(BaseModel): "website_url", "logo_image_url", "limits_id", + "limits", "is_primary", "locked", "locked_reason", @@ -95,6 +101,7 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ @@ -107,6 +114,7 @@ def to_dict(self) -> Dict[str, Any]: "website_url", "logo_image_url", "limits_id", + "limits", "is_primary", "locked", "locked_reason", @@ -118,6 +126,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of limits + if self.limits: + _dict["limits"] = self.limits.to_dict() # set to None if website_url (nullable) is None # and model_fields_set contains the field if self.website_url is None and "website_url" in self.model_fields_set: @@ -128,6 +139,11 @@ def to_dict(self) -> Dict[str, Any]: if self.limits_id is None and "limits_id" in self.model_fields_set: _dict["limits_id"] = None + # set to None if limits (nullable) is None + # and model_fields_set contains the field + if self.limits is None and "limits" in self.model_fields_set: + _dict["limits"] = None + return _dict @classmethod @@ -150,6 +166,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "website_url": obj.get("website_url"), "logo_image_url": obj.get("logo_image_url"), "limits_id": obj.get("limits_id"), + "limits": ( + UsageLimits.from_dict(obj["limits"]) if obj.get("limits") is not None else None + ), "is_primary": obj.get("is_primary"), "locked": obj.get("locked"), "locked_reason": obj.get("locked_reason"), diff --git a/saturn_api/models/resource_state.py b/saturn_api/models/resource_state.py index 508822c..2ab9d00 100644 --- a/saturn_api/models/resource_state.py +++ b/saturn_api/models/resource_state.py @@ -18,9 +18,11 @@ import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Self +from saturn_api.models.route_state import RouteState + class ResourceState(BaseModel): """ @@ -30,7 +32,27 @@ class ResourceState(BaseModel): id: StrictStr action: Optional[StrictStr] = None status: StrictStr - __properties: ClassVar[List[str]] = ["id", "action", "status"] + url: Optional[StrictStr] = Field( + default=None, description="External URL for the primary route, if applicable." + ) + ssh_url: Optional[StrictStr] = Field( + default=None, description="External SSH URL for the resource when SSH is enabled." + ) + ssh_user: Optional[StrictStr] = Field( + default=None, description="SSH username for the resource when SSH is enabled." + ) + routes: Optional[List[RouteState]] = Field( + default=None, description="External URL for each route exposed by the resource." + ) + __properties: ClassVar[List[str]] = [ + "id", + "action", + "status", + "url", + "ssh_url", + "ssh_user", + "routes", + ] model_config = ConfigDict( populate_by_name=True, @@ -64,12 +86,20 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "id", "action", "status", + "url", + "ssh_url", + "ssh_user", + "routes", ] ) @@ -78,6 +108,28 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in routes (list) + _items = [] + if self.routes: + for _item_routes in self.routes: + if _item_routes: + _items.append(_item_routes.to_dict()) + _dict["routes"] = _items + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict["url"] = None + + # set to None if ssh_url (nullable) is None + # and model_fields_set contains the field + if self.ssh_url is None and "ssh_url" in self.model_fields_set: + _dict["ssh_url"] = None + + # set to None if ssh_user (nullable) is None + # and model_fields_set contains the field + if self.ssh_user is None and "ssh_user" in self.model_fields_set: + _dict["ssh_user"] = None + return _dict @classmethod @@ -90,6 +142,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"id": obj.get("id"), "action": obj.get("action"), "status": obj.get("status")} + { + "id": obj.get("id"), + "action": obj.get("action"), + "status": obj.get("status"), + "url": obj.get("url"), + "ssh_url": obj.get("ssh_url"), + "ssh_user": obj.get("ssh_user"), + "routes": ( + [RouteState.from_dict(_item) for _item in obj["routes"]] + if obj.get("routes") is not None + else None + ), + } ) return _obj diff --git a/saturn_api/models/route_state.py b/saturn_api/models/route_state.py new file mode 100644 index 0000000..309e289 --- /dev/null +++ b/saturn_api/models/route_state.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +Saturn Cloud + +The API for Saturn Cloud. + +The version of the OpenAPI document: 2026.02.01 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing_extensions import Self + + +class RouteState(BaseModel): + """ + RouteState + """ # noqa: E501 + + subdomain: StrictStr + container_port: StrictInt + url: StrictStr + __properties: ClassVar[List[str]] = ["subdomain", "container_port", "url"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RouteState 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "subdomain", + "container_port", + "url", + ] + ) + + _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 RouteState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "subdomain": obj.get("subdomain"), + "container_port": obj.get("container_port"), + "url": obj.get("url"), + } + ) + return _obj diff --git a/saturn_api/models/server_options.py b/saturn_api/models/server_options.py index 1f90eff..3f301f7 100644 --- a/saturn_api/models/server_options.py +++ b/saturn_api/models/server_options.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Self +from saturn_api.models.disk_space_option import DiskSpaceOption from saturn_api.models.instance_size import InstanceSize @@ -32,7 +33,7 @@ class ServerOptions(BaseModel): auto_shutoff: List[StrictStr] = Field( description="List of available auto-shutoff settings for workspaces." ) - disk_space: List[StrictStr] = Field(description="List of available disk sizes for workspaces.") + disk_space: List[DiskSpaceOption] = Field(description="Available disk sizes for workspaces.") sizes: Dict[str, InstanceSize] = Field( description="Mapping of instance size names to their configurations." ) @@ -84,6 +85,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in disk_space (list) + _items = [] + if self.disk_space: + for _item_disk_space in self.disk_space: + if _item_disk_space: + _items.append(_item_disk_space.to_dict()) + _dict["disk_space"] = _items # override the default output from pydantic by calling `to_dict()` of each value in sizes (dict) _field_dict = {} if self.sizes: @@ -105,7 +113,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "auto_shutoff": obj.get("auto_shutoff"), - "disk_space": obj.get("disk_space"), + "disk_space": ( + [DiskSpaceOption.from_dict(_item) for _item in obj["disk_space"]] + if obj.get("disk_space") is not None + else None + ), "sizes": ( dict((_k, InstanceSize.from_dict(_v)) for _k, _v in obj["sizes"].items()) if obj.get("sizes") is not None diff --git a/saturn_api/models/usage_limits.py b/saturn_api/models/usage_limits.py index a7b3c22..1343516 100644 --- a/saturn_api/models/usage_limits.py +++ b/saturn_api/models/usage_limits.py @@ -39,6 +39,9 @@ class UsageLimits(BaseModel): resource_types: Optional[List[StrictStr]] = Field( description="Allowed resource types. Null if no limits." ) + token_factory_enabled: Optional[StrictBool] = Field( + description="Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it." + ) num_instances: Optional[StrictInt] = Field( description="Maximum number of active instances. Null if no limits." ) @@ -70,6 +73,7 @@ class UsageLimits(BaseModel): "is_default", "instance_sizes", "resource_types", + "token_factory_enabled", "num_instances", "auto_shutoff", "storage_in_gb", @@ -126,6 +130,7 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ @@ -136,6 +141,7 @@ def to_dict(self) -> Dict[str, Any]: "is_default", "instance_sizes", "resource_types", + "token_factory_enabled", "num_instances", "auto_shutoff", "storage_in_gb", @@ -163,6 +169,11 @@ def to_dict(self) -> Dict[str, Any]: if self.resource_types is None and "resource_types" in self.model_fields_set: _dict["resource_types"] = None + # set to None if token_factory_enabled (nullable) is None + # and model_fields_set contains the field + if self.token_factory_enabled is None and "token_factory_enabled" in self.model_fields_set: + _dict["token_factory_enabled"] = None + # set to None if num_instances (nullable) is None # and model_fields_set contains the field if self.num_instances is None and "num_instances" in self.model_fields_set: @@ -228,6 +239,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_default": obj.get("is_default"), "instance_sizes": obj.get("instance_sizes"), "resource_types": obj.get("resource_types"), + "token_factory_enabled": obj.get("token_factory_enabled"), "num_instances": obj.get("num_instances"), "auto_shutoff": obj.get("auto_shutoff"), "storage_in_gb": obj.get("storage_in_gb"), diff --git a/saturn_api/models/usage_limits_create.py b/saturn_api/models/usage_limits_create.py index ecc2b31..b60da9c 100644 --- a/saturn_api/models/usage_limits_create.py +++ b/saturn_api/models/usage_limits_create.py @@ -40,6 +40,10 @@ class UsageLimitsCreate(BaseModel): resource_types: Optional[List[StrictStr]] = Field( default=None, description="Allowed resource types. Null if no limits." ) + token_factory_enabled: Optional[StrictBool] = Field( + default=None, + description="Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it.", + ) num_instances: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( default=None, description="Maximum number of active instances. Null if no limits." ) @@ -73,6 +77,7 @@ class UsageLimitsCreate(BaseModel): "is_default", "instance_sizes", "resource_types", + "token_factory_enabled", "num_instances", "auto_shutoff", "storage_in_gb", @@ -131,6 +136,11 @@ def to_dict(self) -> Dict[str, Any]: if self.resource_types is None and "resource_types" in self.model_fields_set: _dict["resource_types"] = None + # set to None if token_factory_enabled (nullable) is None + # and model_fields_set contains the field + if self.token_factory_enabled is None and "token_factory_enabled" in self.model_fields_set: + _dict["token_factory_enabled"] = None + # set to None if num_instances (nullable) is None # and model_fields_set contains the field if self.num_instances is None and "num_instances" in self.model_fields_set: @@ -194,6 +204,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_default": obj.get("is_default") if obj.get("is_default") is not None else False, "instance_sizes": obj.get("instance_sizes"), "resource_types": obj.get("resource_types"), + "token_factory_enabled": obj.get("token_factory_enabled"), "num_instances": obj.get("num_instances"), "auto_shutoff": obj.get("auto_shutoff"), "storage_in_gb": obj.get("storage_in_gb"), diff --git a/saturn_api/models/usage_limits_update.py b/saturn_api/models/usage_limits_update.py index 8c04dd1..3dfbd83 100644 --- a/saturn_api/models/usage_limits_update.py +++ b/saturn_api/models/usage_limits_update.py @@ -37,6 +37,10 @@ class UsageLimitsUpdate(BaseModel): resource_types: Optional[List[StrictStr]] = Field( default=None, description="Allowed resource types. Null if no limits." ) + token_factory_enabled: Optional[StrictBool] = Field( + default=None, + description="Whether Token Factory is available under this limit. Null inherits the global setting; False hard-disables it.", + ) num_instances: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( default=None, description="Maximum number of active instances. Null if no limits." ) @@ -69,6 +73,7 @@ class UsageLimitsUpdate(BaseModel): "is_default", "instance_sizes", "resource_types", + "token_factory_enabled", "num_instances", "auto_shutoff", "storage_in_gb", @@ -127,6 +132,11 @@ def to_dict(self) -> Dict[str, Any]: if self.resource_types is None and "resource_types" in self.model_fields_set: _dict["resource_types"] = None + # set to None if token_factory_enabled (nullable) is None + # and model_fields_set contains the field + if self.token_factory_enabled is None and "token_factory_enabled" in self.model_fields_set: + _dict["token_factory_enabled"] = None + # set to None if num_instances (nullable) is None # and model_fields_set contains the field if self.num_instances is None and "num_instances" in self.model_fields_set: @@ -189,6 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_default": obj.get("is_default"), "instance_sizes": obj.get("instance_sizes"), "resource_types": obj.get("resource_types"), + "token_factory_enabled": obj.get("token_factory_enabled"), "num_instances": obj.get("num_instances"), "auto_shutoff": obj.get("auto_shutoff"), "storage_in_gb": obj.get("storage_in_gb"), diff --git a/saturn_api/models/white_label_configuration.py b/saturn_api/models/white_label_configuration.py index 726f7db..ea4296d 100644 --- a/saturn_api/models/white_label_configuration.py +++ b/saturn_api/models/white_label_configuration.py @@ -32,10 +32,20 @@ class WhiteLabelConfiguration(BaseModel): brand_short_name: Optional[StrictStr] = Field( default=None, description="Short version of the brand name." ) + logo_mode: Optional[StrictStr] = Field( + default="icon_and_text", description="Logo display mode: 'icon_and_text' or 'logo_only'." + ) logo_icon_url: StrictStr = Field(description="Brand icon URL.") logo_full_url: StrictStr = Field(description="Brand full icon URL.") favicon_url: Optional[StrictStr] = Field(default=None, description="Favicon URL.") primary_color: StrictStr = Field(description="Primary frontend color.") + cloud_display_names: Optional[Dict[str, StrictStr]] = Field( + default=None, + description="Map of cloud provider IDs to display names (e.g. {'nebius': 'My Cloud'}).", + ) + cloud_icon_urls: Optional[Dict[str, StrictStr]] = Field( + default=None, description="Map of cloud provider IDs to icon URLs." + ) support_email: StrictStr = Field(description="Support contact email.") website_url: StrictStr = Field(description="Website URL.") docs_url: Optional[StrictStr] = Field(default=None, description="Documentation URL.") @@ -43,10 +53,13 @@ class WhiteLabelConfiguration(BaseModel): "enabled", "brand_name", "brand_short_name", + "logo_mode", "logo_icon_url", "logo_full_url", "favicon_url", "primary_color", + "cloud_display_names", + "cloud_icon_urls", "support_email", "website_url", "docs_url", @@ -99,6 +112,16 @@ def to_dict(self) -> Dict[str, Any]: if self.favicon_url is None and "favicon_url" in self.model_fields_set: _dict["favicon_url"] = None + # set to None if cloud_display_names (nullable) is None + # and model_fields_set contains the field + if self.cloud_display_names is None and "cloud_display_names" in self.model_fields_set: + _dict["cloud_display_names"] = None + + # set to None if cloud_icon_urls (nullable) is None + # and model_fields_set contains the field + if self.cloud_icon_urls is None and "cloud_icon_urls" in self.model_fields_set: + _dict["cloud_icon_urls"] = None + # set to None if docs_url (nullable) is None # and model_fields_set contains the field if self.docs_url is None and "docs_url" in self.model_fields_set: @@ -120,10 +143,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "enabled": obj.get("enabled"), "brand_name": obj.get("brand_name"), "brand_short_name": obj.get("brand_short_name"), + "logo_mode": ( + obj.get("logo_mode") if obj.get("logo_mode") is not None else "icon_and_text" + ), "logo_icon_url": obj.get("logo_icon_url"), "logo_full_url": obj.get("logo_full_url"), "favicon_url": obj.get("favicon_url"), "primary_color": obj.get("primary_color"), + "cloud_display_names": obj.get("cloud_display_names"), + "cloud_icon_urls": obj.get("cloud_icon_urls"), "support_email": obj.get("support_email"), "website_url": obj.get("website_url"), "docs_url": obj.get("docs_url"), diff --git a/saturn_api/models/workspace.py b/saturn_api/models/workspace.py index 142586d..345cabf 100644 --- a/saturn_api/models/workspace.py +++ b/saturn_api/models/workspace.py @@ -50,6 +50,9 @@ class Workspace(BaseModel): extra_packages: Optional[ExtraPackages] = Field( description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, Dict[str, StrictStr]]] = Field( + default=None, description="User-defined config files written to $HOME at pod startup." + ) ide: StrictStr = Field(description="IDE of the workspace") start_script: Optional[StrictStr] = Field( description="Shell script that runs on start before the primary command." @@ -94,6 +97,7 @@ class Workspace(BaseModel): "tags", "image_tag", "extra_packages", + "config_files", "ide", "start_script", "environment_variables", @@ -195,6 +199,7 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ @@ -204,6 +209,7 @@ def to_dict(self) -> Dict[str, Any]: "description", "image_tag", "extra_packages", + "config_files", "ide", "start_script", "environment_variables", @@ -258,6 +264,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -301,6 +312,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": obj.get("config_files"), "ide": obj.get("ide"), "start_script": obj.get("start_script"), "environment_variables": obj.get("environment_variables"), diff --git a/saturn_api/models/workspace_create.py b/saturn_api/models/workspace_create.py index 86db304..b213fa0 100644 --- a/saturn_api/models/workspace_create.py +++ b/saturn_api/models/workspace_create.py @@ -28,6 +28,7 @@ ) from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, ) @@ -65,6 +66,10 @@ class WorkspaceCreate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script to run on start before the primary command." ) @@ -101,6 +106,7 @@ class WorkspaceCreate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "is_spot", @@ -185,6 +191,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # set to None if tags (nullable) is None # and model_fields_set contains the field if self.tags is None and "tags" in self.model_fields_set: @@ -208,6 +221,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -254,6 +272,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": ( obj.get("working_dir") diff --git a/saturn_api/models/workspace_server_options.py b/saturn_api/models/workspace_server_options.py index 45c6633..f3f74fe 100644 --- a/saturn_api/models/workspace_server_options.py +++ b/saturn_api/models/workspace_server_options.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Self +from saturn_api.models.disk_space_option import DiskSpaceOption from saturn_api.models.instance_size import InstanceSize @@ -30,7 +31,7 @@ class WorkspaceServerOptions(BaseModel): """ # noqa: E501 auto_shutoff: Literal["1 hour", "6 hours", "24 hours", "3 days", "7 days", "Never"] - disk_space: List[StrictStr] = Field(description="List of available disk space sizes.") + disk_space: List[DiskSpaceOption] = Field(description="Available disk space sizes.") size: List[InstanceSize] = Field(description="List of available instance sizes.") __properties: ClassVar[List[str]] = ["auto_shutoff", "disk_space", "size"] @@ -90,6 +91,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in disk_space (list) + _items = [] + if self.disk_space: + for _item_disk_space in self.disk_space: + if _item_disk_space: + _items.append(_item_disk_space.to_dict()) + _dict["disk_space"] = _items # override the default output from pydantic by calling `to_dict()` of each item in size (list) _items = [] if self.size: @@ -111,7 +119,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "auto_shutoff": obj.get("auto_shutoff"), - "disk_space": obj.get("disk_space"), + "disk_space": ( + [DiskSpaceOption.from_dict(_item) for _item in obj["disk_space"]] + if obj.get("disk_space") is not None + else None + ), "size": ( [InstanceSize.from_dict(_item) for _item in obj["size"]] if obj.get("size") is not None diff --git a/saturn_api/models/workspace_spec.py b/saturn_api/models/workspace_spec.py index 83f7648..f48724b 100644 --- a/saturn_api/models/workspace_spec.py +++ b/saturn_api/models/workspace_spec.py @@ -28,6 +28,7 @@ ) from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.dask_cluster_attachment import DaskClusterAttachment from saturn_api.models.external_repo_attachment_recipe import ( ExternalRepoAttachmentRecipe, @@ -57,6 +58,7 @@ class WorkspaceSpec(BaseModel): environment_variables: Optional[Dict[str, StrictStr]] = None working_directory: Optional[StrictStr] = None extra_packages: Optional[ExtraPackagesRecipe] = None + config_files: Optional[Dict[str, ConfigFileEntry]] = None start_script: Optional[StrictStr] = None token_scope: Optional[StrictStr] = None dask_cluster: Optional[DaskClusterAttachment] = None @@ -83,6 +85,7 @@ class WorkspaceSpec(BaseModel): "environment_variables", "working_directory", "extra_packages", + "config_files", "start_script", "token_scope", "dask_cluster", @@ -179,6 +182,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # override the default output from pydantic by calling `to_dict()` of dask_cluster if self.dask_cluster: _dict["dask_cluster"] = self.dask_cluster.to_dict() @@ -222,6 +232,11 @@ def to_dict(self) -> Dict[str, Any]: if self.tags is None and "tags" in self.model_fields_set: _dict["tags"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -269,6 +284,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "token_scope": obj.get("token_scope"), "dask_cluster": ( diff --git a/saturn_api/models/workspace_update.py b/saturn_api/models/workspace_update.py index 195b87d..95859f6 100644 --- a/saturn_api/models/workspace_update.py +++ b/saturn_api/models/workspace_update.py @@ -28,6 +28,7 @@ ) from typing_extensions import Annotated, Self +from saturn_api.models.config_file_entry import ConfigFileEntry from saturn_api.models.external_repo_attachment_nested import ( ExternalRepoAttachmentNested, ) @@ -60,6 +61,10 @@ class WorkspaceUpdate(BaseModel): extra_packages: Optional[ExtraPackages] = Field( default=None, description="Addtitional packages to install on start." ) + config_files: Optional[Dict[str, ConfigFileEntry]] = Field( + default=None, + description="User-defined config files written to $HOME at pod startup. Keys are relative paths; values contain content and mode.", + ) start_script: Optional[StrictStr] = Field( default=None, description="Shell script that runs on start before the primary command." ) @@ -93,6 +98,7 @@ class WorkspaceUpdate(BaseModel): "environment_variables", "external_repo_attachments", "extra_packages", + "config_files", "start_script", "working_dir", "instance_size", @@ -163,6 +169,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of extra_packages if self.extra_packages: _dict["extra_packages"] = self.extra_packages.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in config_files (dict) + _field_dict = {} + if self.config_files: + for _key_config_files in self.config_files: + if self.config_files[_key_config_files]: + _field_dict[_key_config_files] = self.config_files[_key_config_files].to_dict() + _dict["config_files"] = _field_dict # set to None if tags (nullable) is None # and model_fields_set contains the field if self.tags is None and "tags" in self.model_fields_set: @@ -173,6 +186,11 @@ def to_dict(self) -> Dict[str, Any]: if self.extra_packages is None and "extra_packages" in self.model_fields_set: _dict["extra_packages"] = None + # set to None if config_files (nullable) is None + # and model_fields_set contains the field + if self.config_files is None and "config_files" in self.model_fields_set: + _dict["config_files"] = None + # set to None if start_script (nullable) is None # and model_fields_set contains the field if self.start_script is None and "start_script" in self.model_fields_set: @@ -220,6 +238,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("extra_packages") is not None else None ), + "config_files": ( + dict( + (_k, ConfigFileEntry.from_dict(_v)) + for _k, _v in obj["config_files"].items() + ) + if obj.get("config_files") is not None + else None + ), "start_script": obj.get("start_script"), "working_dir": obj.get("working_dir"), "instance_size": obj.get("instance_size"), diff --git a/saturn_api/rest.py b/saturn_api/rest.py index 8c746b8..81424cd 100644 --- a/saturn_api/rest.py +++ b/saturn_api/rest.py @@ -37,12 +37,17 @@ async def read(self): self.data = await self.response.aread() return self.data + @property + def headers(self): + """Returns a CIMultiDictProxy of response headers.""" + return self.response.headers + def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" + """Returns a CIMultiDictProxy of the response headers; use ``headers`` instead.""" return self.response.headers def getheader(self, name, default=None): - """Returns a given response header.""" + """Returns a given response header; use ``headers`` instead.""" return self.response.headers.get(name, default) @@ -112,6 +117,8 @@ 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/setup.py b/setup.py index 8ecdd9c..19c68a0 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Saturn Cloud @@ -21,12 +19,11 @@ # http://pypi.python.org/pypi/setuptools NAME = "saturn-api" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.9" +PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ - "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", "httpx >= 0.28.1", - "pydantic >= 2", + "pydantic >= 2.11", "typing-extensions >= 4.7.1", ] @@ -36,7 +33,7 @@ description="Saturn Cloud", author="OpenAPI Generator community", author_email="team@openapitools.org", - url="https://github.com/saturncloud/saturn-api", + url="github.com/saturncloud/saturn-api", keywords=["OpenAPI", "OpenAPI-Generator", "Saturn Cloud"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]),