diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d782c81..029ce0d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -32,7 +32,7 @@ jobs: Issues with the labels `no-stale`, `help wanted`, and `good first issue` are exempt from this policy. stale-pr-label: "stale" - exempt-pr-labels: "no-stale" + exempt-pr-labels: "dependencies,no-stale" stale-pr-message: > There hasn't been any activity on this pull request in 30 days. diff --git a/.manifest.json b/.manifest.json index 54c9af9..4beed8c 100644 --- a/.manifest.json +++ b/.manifest.json @@ -1,16 +1,257 @@ { - "liblabVersion": "2.5.1", - "date": "2024-10-04T04:24:23.969Z", + "liblabVersion": "2.13.0", + "date": "2025-02-05T02:35:46.742Z", "config": { - "apiId": 1252, + "apiId": 1737, "sdkName": "salad-cloud-sdk", - "sdkVersion": "0.9.0-alpha.6", + "sdkVersion": "0.9.0-alpha.7", + "languages": ["typescript"], + "auth": ["apikey"], + "docs": ["snippets"], "liblabVersion": "2", "deliveryMethods": ["zip"], - "languages": ["typescript"], + "rawConfig": { + "sdkName": "salad-cloud-sdk", + "specFilePath": "spec.yaml", + "languages": ["csharp", "go", "java", "python", "typescript"], + "auth": ["apikey"], + "docs": ["snippets"], + "customizations": { + "authentication": { + "apiKey": { + "header": "Salad-Api-Key" + } + }, + "license": { + "type": "MIT" + }, + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "devContainer": true + }, + "languageOptions": { + "csharp": { + "liblabVersion": "2", + "githubRepoName": "salad-cloud-sdk-dotnet", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "sdkVersion": "0.9.0-alpha.6", + "authors": [ + { + "name": "salad" + }, + { + "name": "seniorquico" + } + ], + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-dotnet", + "packageId": "Salad.Cloud.SDK" + }, + "go": { + "liblabVersion": "2", + "githubRepoName": "salad-cloud-sdk-go", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "sdkVersion": "0.9.0-alpha.6", + "goModuleName": "github.com/saladtechnologies/salad-cloud-sdk-go" + }, + "java": { + "liblabVersion": "2", + "githubRepoName": "salad-cloud-sdk-java", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "sdkVersion": "0.9.0-alpha.7", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-java", + "groupId": "com.salad.cloud", + "artifactId": "sdk", + "developers": [ + { + "name": "SaladCloud Developers", + "email": "dev@salad.com", + "organization": "Salad Technologies", + "organizationUrl": "https://salad.com" + }, + { + "name": "Kyle Dodson", + "email": "kyle@salad.com", + "organization": "Salad Technologies", + "organizationUrl": "https://salad.com" + } + ] + }, + "python": { + "liblabVersion": "2", + "githubRepoName": "salad-cloud-sdk-python", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "sdkVersion": "0.9.0-alpha.6", + "authors": [ + { + "name": "SaladCloud Developers", + "email": "dev@salad.com" + }, + { + "name": "Kyle Dodson", + "email": "kyle@salad.com" + } + ], + "pypiPackageName": "salad-cloud-sdk", + "alwaysInitializeOptionals": false, + "classifiers": [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Internet", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries" + ], + "projectUrls": { + "Homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-python", + "Documentation": "https://docs.salad.com", + "Repository": "https://github.com/SaladTechnologies/salad-cloud-sdk-python.git", + "Issues": "https://github.com/SaladTechnologies/salad-cloud-sdk-python/issues" + } + }, + "terraform": { + "liblabVersion": "2", + "githubRepoName": "terraform-provider-salad-cloud", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "providerName": "salad-cloud", + "providerVersion": "0.9.0-alpha.1", + "providerGoModuleName": "github.com/saladtechnologies/terraform-provider-salad-cloud", + "providerSchemaConfig": { + "authTokenKey": "api_key" + } + }, + "typescript": { + "liblabVersion": "2", + "githubRepoName": "salad-cloud-sdk-javascript", + "targetBranch": "main", + "ignoreFiles": [".gitignore", "./LICENSE"], + "sdkVersion": "0.9.0-alpha.7", + "authors": [ + { + "name": "SaladCloud Developers", + "email": "dev@salad.com" + }, + { + "name": "Kyle Dodson", + "email": "kyle@salad.com" + } + ], + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-javascript", + "npmOrg": "saladtechnologies-oss", + "npmName": "salad-cloud-sdk", + "httpClient": "fetch", + "bundle": true, + "exportClassDefault": false + } + }, + "publishing": { + "githubOrg": "SaladTechnologies" + }, + "validationsToIgnore": [ + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateQueueProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateQueueProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateQueueJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ListContainerGroupsProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "DeleteContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "StartContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "StopContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ReallocateContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "RecreateContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "RestartContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetInferenceEndpointJobsProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "DeleteInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetWebhookSecretKeyProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateWebhookSecretKeyProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ListGpuClassesProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "responses", "401"] + } + ] + }, "specFilePath": "spec.yaml", - "docs": ["snippets"], - "auth": ["apikey"], "languageOptions": { "csharp": { "packageId": "Salad.Cloud.SDK", @@ -26,7 +267,7 @@ "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-dotnet", "ignoreFiles": [".gitignore", "./LICENSE"], "liblabVersion": "2", - "sdkVersion": "0.9.0-alpha.5", + "sdkVersion": "0.9.0-alpha.6", "targetBranch": "main" }, "go": { @@ -34,7 +275,7 @@ "githubRepoName": "salad-cloud-sdk-go", "ignoreFiles": [".gitignore", "./LICENSE"], "liblabVersion": "2", - "sdkVersion": "0.9.0-alpha.5", + "sdkVersion": "0.9.0-alpha.6", "targetBranch": "main" }, "java": { @@ -58,7 +299,7 @@ "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-java", "ignoreFiles": [".gitignore", "./LICENSE"], "liblabVersion": "2", - "sdkVersion": "0.9.0-alpha.6", + "sdkVersion": "0.9.0-alpha.7", "targetBranch": "main" }, "python": { @@ -101,7 +342,7 @@ "githubRepoName": "salad-cloud-sdk-python", "ignoreFiles": [".gitignore", "./LICENSE"], "liblabVersion": "2", - "sdkVersion": "0.9.0-alpha.5", + "sdkVersion": "0.9.0-alpha.6", "targetBranch": "main" }, "terraform": { @@ -138,7 +379,7 @@ "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-javascript", "ignoreFiles": [".gitignore", "./LICENSE"], "liblabVersion": "2", - "sdkVersion": "0.9.0-alpha.6", + "sdkVersion": "0.9.0-alpha.7", "targetBranch": "main", "generateEnumAs": "enum" } @@ -233,7 +474,7 @@ } ], "apiName": "SaladCloud API", - "apiVersion": "0.9.0-alpha.5", + "apiVersion": "0.9.0-alpha.6", "authentication": { "apiKey": { "header": "Salad-Api-Key" @@ -295,6 +536,7 @@ "module": "Node16", "lib": ["es2018", "dom"] }, + "namingStrategy": "base", "usesFormData": false, "environmentVariables": [], "fileOutput": "/tmp", @@ -311,7 +553,8 @@ "paths": [], "rawQueries": [], "queriesData": [] - } + }, + "ai": false }, "files": [ "package.json", @@ -328,6 +571,7 @@ "src/services/container-groups/models/container-group-instances.ts", "src/services/container-groups/models/container-group-instance.ts", "src/services/workload-errors/models/workload-error-list.ts", + "src/services/system-logs/models/system-log-list.ts", "src/services/queues/models/queue-list.ts", "src/services/queues/models/create-queue.ts", "src/services/queues/models/queue.ts", @@ -418,6 +662,7 @@ "src/services/container-groups/models/registry-authentication-gcp-gar-2.ts", "src/services/container-groups/models/state.ts", "src/services/workload-errors/models/workload-error.ts", + "src/services/system-logs/models/system-log.ts", "src/services/queues/models/queue-job-status.ts", "src/services/queues/models/queue-job-event.ts", "src/services/queues/models/queue-job-event-action.ts", @@ -430,6 +675,7 @@ "src/services/base-service.ts", "src/services/container-groups/container-groups.ts", "src/services/workload-errors/workload-errors.ts", + "src/services/system-logs/system-logs.ts", "src/services/queues/queues.ts", "src/services/quotas/quotas.ts", "src/services/inference-endpoints/inference-endpoints.ts", @@ -439,6 +685,7 @@ "src/services/container-groups/models/index.ts", "src/services/common/index.ts", "src/services/workload-errors/models/index.ts", + "src/services/system-logs/models/index.ts", "src/services/queues/models/index.ts", "src/services/quotas/models/index.ts", "src/services/inference-endpoints/models/index.ts", @@ -446,6 +693,7 @@ "src/services/webhook-secret-key/models/index.ts", "src/services/container-groups/index.ts", "src/services/workload-errors/index.ts", + "src/services/system-logs/index.ts", "src/services/queues/index.ts", "src/services/quotas/index.ts", "src/services/inference-endpoints/index.ts", @@ -475,7 +723,7 @@ "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md", "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md", "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md", - "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-system-logs-get.md", "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md", "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md", "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md", @@ -503,6 +751,7 @@ "documentation/models/UpdateContainerGroup.md", "documentation/models/ContainerGroupInstances.md", "documentation/models/WorkloadErrorList.md", + "documentation/models/SystemLogList.md", "documentation/models/QueueList.md", "documentation/models/CreateQueue.md", "documentation/models/Queue.md", @@ -537,6 +786,7 @@ "documentation/models/ContainerGroupProbeHttpHeaders2.md", "documentation/models/UpdateContainerGroupNetworking.md", "documentation/models/WorkloadError.md", + "documentation/models/SystemLog.md", "documentation/models/ContainerGroupsQuotas.md", "documentation/models/GpuClass.md", "documentation/models/GpuClassPrice.md", @@ -550,6 +800,9 @@ "src/http/serialization/header-serializer.ts", "src/http/transport/request-fetch-adapter.ts", "src/http/transport/transport-hook-adapter.ts", + "src/http/utils/line-decoder.ts", + "src/http/utils/response-matcher.ts", + "documentation/services/WorkloadErrorsService.md", "documentation/models/ContainerGroupInstance.md", "documentation/models/QueueJob.md", "documentation/models/InferenceEndpointJob.md", @@ -557,7 +810,7 @@ "documentation/models/CreateContainerGroupNetworking.md", "documentation/models/QueueJobEvent.md", "documentation/models/InferenceEndpointJobEvent.md", - "documentation/services/WorkloadErrorsService.md", + "documentation/services/SystemLogsService.md", "documentation/services/QuotasService.md", "documentation/services/OrganizationDataService.md", "documentation/services/WebhookSecretKeyService.md", diff --git a/README.md b/README.md index 71ee569..71fbbca 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# SaladCloudSdk TypeScript SDK 0.9.0-alpha.6 +# SaladCloudSdk TypeScript SDK 0.9.0-alpha.7 Welcome to the SaladCloudSdk SDK documentation. This guide will help you get started with integrating and using the SaladCloudSdk SDK in your project. ## Versions -- API version: `0.9.0-alpha.5` -- SDK version: `0.9.0-alpha.6` +- API version: `0.9.0-alpha.6` +- SDK version: `0.9.0-alpha.7` ## About the API @@ -79,7 +79,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.quotas.getQuotas('oecson4k2eclxr'); + const { data } = await saladCloudSdk.quotas.getQuotas('fu2s7l'); console.log(data); })(); @@ -89,13 +89,14 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; The SDK provides various services to interact with the API. -
+
Below is a list of all available services with links to their detailed documentation: | Name | | :------------------------------------------------------------------------------- | | [ContainerGroupsService](documentation/services/ContainerGroupsService.md) | | [WorkloadErrorsService](documentation/services/WorkloadErrorsService.md) | +| [SystemLogsService](documentation/services/SystemLogsService.md) | | [QueuesService](documentation/services/QueuesService.md) | | [QuotasService](documentation/services/QuotasService.md) | | [InferenceEndpointsService](documentation/services/InferenceEndpointsService.md) | @@ -108,7 +109,7 @@ The SDK provides various services to interact with the API. The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. -
+
Below is a list of all available models with links to their detailed documentation: | Name | Description | @@ -120,6 +121,7 @@ The SDK includes several models that represent the data structures used in API r | [ContainerGroupInstances](documentation/models/ContainerGroupInstances.md) | Represents a list of container group instances | | [ContainerGroupInstance](documentation/models/ContainerGroupInstance.md) | Represents the details of a single container group instance | | [WorkloadErrorList](documentation/models/WorkloadErrorList.md) | Represents a list of workload errors | +| [SystemLogList](documentation/models/SystemLogList.md) | Represents a list of system logs | | [QueueList](documentation/models/QueueList.md) | Represents a list of queues | | [CreateQueue](documentation/models/CreateQueue.md) | Represents a request to create a new queue. | | [Queue](documentation/models/Queue.md) | Represents a queue. | @@ -161,6 +163,7 @@ The SDK includes several models that represent the data structures used in API r | [UpdateContainer](documentation/models/UpdateContainer.md) | Represents an update container object | | [UpdateContainerGroupNetworking](documentation/models/UpdateContainerGroupNetworking.md) | Represents update container group networking parameters | | [WorkloadError](documentation/models/WorkloadError.md) | Represents a workload error | +| [SystemLog](documentation/models/SystemLog.md) | Represents a system log | | [QueueJobEvent](documentation/models/QueueJobEvent.md) | Represents an event for queue job | | [ContainerGroupsQuotas](documentation/models/ContainerGroupsQuotas.md) | | | [InferenceEndpointJobEvent](documentation/models/InferenceEndpointJobEvent.md) | Represents an event for inference endpoint job | diff --git a/documentation/models/Container.md b/documentation/models/Container.md index ef9ca45..23ece59 100644 --- a/documentation/models/Container.md +++ b/documentation/models/Container.md @@ -103,10 +103,10 @@ Represents a container **Properties** -| Name | Type | Required | Description | -| :-------- | :----- | :------- | :----------- | -| JSON | string | ✅ | "json" | -| JSONLINES | string | ✅ | "json_lines" | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSON_LINES | string | ✅ | "json_lines" | # HttpCompression1 diff --git a/documentation/models/ContainerGroupNetworking.md b/documentation/models/ContainerGroupNetworking.md index 44d3ccb..f984244 100644 --- a/documentation/models/ContainerGroupNetworking.md +++ b/documentation/models/ContainerGroupNetworking.md @@ -19,7 +19,7 @@ Represents container group networking parameters **Properties** -| Name | Type | Required | Description | -| :----------------------- | :----- | :------- | :---------------------------- | -| ROUNDROBIN | string | ✅ | "round_robin" | -| LEASTNUMBEROFCONNECTIONS | string | ✅ | "least_number_of_connections" | +| Name | Type | Required | Description | +| :-------------------------- | :----- | :------- | :---------------------------- | +| ROUND_ROBIN | string | ✅ | "round_robin" | +| LEAST_NUMBER_OF_CONNECTIONS | string | ✅ | "least_number_of_connections" | diff --git a/documentation/models/ContainerRestartPolicy.md b/documentation/models/ContainerRestartPolicy.md index 62ff6d3..ae33632 100644 --- a/documentation/models/ContainerRestartPolicy.md +++ b/documentation/models/ContainerRestartPolicy.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :-------- | :----- | :------- | :----------- | -| ALWAYS | string | ✅ | "always" | -| ONFAILURE | string | ✅ | "on_failure" | -| NEVER | string | ✅ | "never" | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :----------- | +| ALWAYS | string | ✅ | "always" | +| ON_FAILURE | string | ✅ | "on_failure" | +| NEVER | string | ✅ | "never" | diff --git a/documentation/models/CreateContainer.md b/documentation/models/CreateContainer.md index 0d2313e..36735cc 100644 --- a/documentation/models/CreateContainer.md +++ b/documentation/models/CreateContainer.md @@ -102,10 +102,10 @@ Represents a container **Properties** -| Name | Type | Required | Description | -| :-------- | :----- | :------- | :----------- | -| JSON | string | ✅ | "json" | -| JSONLINES | string | ✅ | "json_lines" | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSON_LINES | string | ✅ | "json_lines" | # HttpCompression2 diff --git a/documentation/models/CreateContainerGroupNetworking.md b/documentation/models/CreateContainerGroupNetworking.md index 744d772..e2495c7 100644 --- a/documentation/models/CreateContainerGroupNetworking.md +++ b/documentation/models/CreateContainerGroupNetworking.md @@ -18,7 +18,7 @@ Represents container group networking parameters **Properties** -| Name | Type | Required | Description | -| :----------------------- | :----- | :------- | :---------------------------- | -| ROUNDROBIN | string | ✅ | "round_robin" | -| LEASTNUMBEROFCONNECTIONS | string | ✅ | "least_number_of_connections" | +| Name | Type | Required | Description | +| :-------------------------- | :----- | :------- | :---------------------------- | +| ROUND_ROBIN | string | ✅ | "round_robin" | +| LEAST_NUMBER_OF_CONNECTIONS | string | ✅ | "least_number_of_connections" | diff --git a/documentation/models/QueueAutoscaler.md b/documentation/models/QueueAutoscaler.md index 921623d..18f39d2 100644 --- a/documentation/models/QueueAutoscaler.md +++ b/documentation/models/QueueAutoscaler.md @@ -4,11 +4,11 @@ Represents the autoscaling rules for a queue **Properties** -| Name | Type | Required | Description | -| :-------------------- | :----- | :------- | :---------- | -| minReplicas | number | ✅ | | -| maxReplicas | number | ✅ | | -| desiredQueueLength | number | ✅ | | -| pollingPeriod | number | ❌ | | -| maxUpscalePerMinute | number | ❌ | | -| maxDownscalePerMinute | number | ❌ | | +| Name | Type | Required | Description | +| :-------------------- | :----- | :------- | :-------------------------------------------------------------- | +| minReplicas | number | ✅ | The minimum number of instances the container can scale down to | +| maxReplicas | number | ✅ | The maximum number of instances the container can scale up to | +| desiredQueueLength | number | ✅ | | +| pollingPeriod | number | ❌ | The period (in seconds) in which the queue checks the formula | +| maxUpscalePerMinute | number | ❌ | The maximum number of instances that can be added per minute | +| maxDownscalePerMinute | number | ❌ | The maximum number of instances that can be removed per minute | diff --git a/documentation/models/SystemLog.md b/documentation/models/SystemLog.md new file mode 100644 index 0000000..282c5ce --- /dev/null +++ b/documentation/models/SystemLog.md @@ -0,0 +1,17 @@ +# SystemLog + +Represents a system log + +**Properties** + +| Name | Type | Required | Description | +| :-------------------- | :----- | :------- | :------------------------------------------------ | +| eventName | string | ✅ | The name of the event | +| eventTime | string | ✅ | The UTC date & time when the log item was created | +| version | string | ✅ | The version instance ID | +| resourceCpu | number | ✅ | The number of CPUs | +| resourceMemory | number | ✅ | The memory amount in MB | +| resourceGpuClass | string | ✅ | The GPU class name | +| resourceStorageAmount | number | ✅ | The storage amount in bytes | +| instanceId | string | ❌ | The unique instance ID | +| machineId | string | ❌ | The organization-specific machine ID | diff --git a/documentation/models/SystemLogList.md b/documentation/models/SystemLogList.md new file mode 100644 index 0000000..00206d0 --- /dev/null +++ b/documentation/models/SystemLogList.md @@ -0,0 +1,9 @@ +# SystemLogList + +Represents a list of system logs + +**Properties** + +| Name | Type | Required | Description | +| :---- | :---------- | :------- | :---------- | +| items | SystemLog[] | ✅ | | diff --git a/documentation/models/UpdateContainer.md b/documentation/models/UpdateContainer.md index 9cfbe5b..f2bab78 100644 --- a/documentation/models/UpdateContainer.md +++ b/documentation/models/UpdateContainer.md @@ -113,10 +113,10 @@ Represents an update container object **Properties** -| Name | Type | Required | Description | -| :-------- | :----- | :------- | :----------- | -| JSON | string | ✅ | "json" | -| JSONLINES | string | ✅ | "json_lines" | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSON_LINES | string | ✅ | "json_lines" | # HttpCompression3 diff --git a/documentation/services/ContainerGroupsService.md b/documentation/services/ContainerGroupsService.md index b6d7436..e62428f 100644 --- a/documentation/services/ContainerGroupsService.md +++ b/documentation/services/ContainerGroupsService.md @@ -45,10 +45,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.containerGroups.listContainerGroups( - 'v50imwzgi4em4q035', - 'm6yw3-xm60cb7tiev8rketqiiwjepibzf2ust1cvjx8oua8mepeueo5-1', - ); + const { data } = await saladCloudSdk.containerGroups.listContainerGroups('o9lnd3c1w-4b', 'c9jr'); console.log(data); })(); @@ -97,17 +94,17 @@ import { const containerResourceRequirements: ContainerResourceRequirements = { cpu: 10, - memory: 35273, + memory: 9057, gpuClasses: ['gpu_classes'], - storageAmount: 32391110488, + storageAmount: 34911830561, }; const containerGroupPriority = ContainerGroupPriority.HIGH; const loggingAxiom2: LoggingAxiom2 = { - host: 'irure ut eiusmod velit incididunt', - apiToken: 'deserunt aute cillum dolor occaecat', - dataset: 'exercitation sit', + host: 'host', + apiToken: 'api_token', + dataset: 'dataset', }; const datadogTags2: DatadogTags2 = { @@ -116,24 +113,24 @@ import { }; const loggingDatadog2: LoggingDatadog2 = { - host: 'sunt consequat irure fugiat', - apiKey: 'magna', + host: 'host', + apiKey: 'api_key', tags: [datadogTags2], }; const loggingNewRelic2: LoggingNewRelic2 = { - host: 'quis aute in id proident', - ingestionKey: 'aliqua enim pariatur', + host: 'host', + ingestionKey: 'ingestion_key', }; const loggingSplunk2: LoggingSplunk2 = { - host: 'ad', - token: 'irure velit labore nostrud elit', + host: 'host', + token: 'token', }; const loggingTcp2: LoggingTcp2 = { - host: 'fugiat do', - port: 1272, + host: 'host', + port: 32723, }; const httpFormat2 = HttpFormat2.JSON; @@ -146,8 +143,8 @@ import { const httpCompression2 = HttpCompression2.NONE; const loggingHttp2: LoggingHttp2 = { - host: 'cillum', - port: 21241, + host: 'host', + port: 51830, user: 'user', password: 'password', path: 'path', @@ -197,7 +194,7 @@ import { }; const createContainer: CreateContainer = { - image: 'reprehenderit', + image: 'image', resources: containerResourceRequirements, command: ['command'], priority: containerGroupPriority, @@ -212,11 +209,11 @@ import { const containerNetworkingProtocol = ContainerNetworkingProtocol.HTTP; - const createContainerGroupNetworkingLoadBalancer = CreateContainerGroupNetworkingLoadBalancer.ROUNDROBIN; + const createContainerGroupNetworkingLoadBalancer = CreateContainerGroupNetworkingLoadBalancer.ROUND_ROBIN; const createContainerGroupNetworking: CreateContainerGroupNetworking = { protocol: containerNetworkingProtocol, - port: 43901, + port: 4465, auth: true, loadBalancer: createContainerGroupNetworkingLoadBalancer, singleConnectionLimit: true, @@ -225,7 +222,7 @@ import { }; const containerGroupProbeTcp: ContainerGroupProbeTcp = { - port: 61900, + port: 993, }; const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; @@ -237,14 +234,14 @@ import { const containerGroupProbeHttp: ContainerGroupProbeHttp = { path: 'path', - port: 58759, + port: 64175, scheme: containerProbeHttpScheme, headers: [containerGroupProbeHttpHeaders2], }; const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { service: 'service', - port: 32748, + port: 8441, }; const containerGroupProbeExec: ContainerGroupProbeExec = { @@ -256,7 +253,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 6, + initialDelaySeconds: 8, periodSeconds: 10, timeoutSeconds: 30, successThreshold: 1, @@ -268,7 +265,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 4, + initialDelaySeconds: 10, periodSeconds: 1, timeoutSeconds: 1, successThreshold: 1, @@ -280,7 +277,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 10, + initialDelaySeconds: 7, periodSeconds: 3, timeoutSeconds: 10, successThreshold: 2, @@ -288,27 +285,27 @@ import { }; const containerGroupQueueConnection: ContainerGroupQueueConnection = { - path: 'pariatur Ut aliqua irure', - port: 34903, - queueName: 'nz26lyemw7nednorlqjlsihb3', + path: 'path', + port: 43154, + queueName: 'oujbls0vsz6xilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2mppfvzd5f4e', }; const queueAutoscaler: QueueAutoscaler = { - minReplicas: 96, - maxReplicas: 190, - desiredQueueLength: 42, - pollingPeriod: 684, - maxUpscalePerMinute: 95, - maxDownscalePerMinute: 10, + minReplicas: 41, + maxReplicas: 135, + desiredQueueLength: 51, + pollingPeriod: 188, + maxUpscalePerMinute: 30, + maxDownscalePerMinute: 42, }; const createContainerGroup: CreateContainerGroup = { - name: 'xvih', - displayName: 'INce5LCTy', + name: 'name', + displayName: 'hfR', container: createContainer, autostartPolicy: true, restartPolicy: containerRestartPolicy, - replicas: 12, + replicas: 169, countryCodes: [countryCode], networking: createContainerGroupNetworking, livenessProbe: containerGroupLivenessProbe, @@ -319,9 +316,9 @@ import { }; const { data } = await saladCloudSdk.containerGroups.createContainerGroup( - 'v50imwzgi4em4q035', - 'm6yw3-xm60cb7tiev8rketqiiwjepibzf2ust1cvjx8oua8mepeueo5-1', - input, + 'o9lnd3c1w-4b', + 'c9jr', + createContainerGroup, ); console.log(data); @@ -358,9 +355,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.getContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', ); console.log(data); @@ -408,18 +405,18 @@ import { }); const resources: Resources = { - cpu: 3, - memory: 14678, + cpu: 12, + memory: 16671, gpuClasses: ['gpu_classes'], - storageAmount: 47984533464, + storageAmount: 47892181137, }; const containerGroupPriority = ContainerGroupPriority.HIGH; const loggingAxiom3: LoggingAxiom3 = { - host: 'aute veniam exercitation eiusmod et', - apiToken: 'mollit', - dataset: 'nisi in Lorem', + host: 'host', + apiToken: 'api_token', + dataset: 'dataset', }; const datadogTags3: DatadogTags3 = { @@ -428,24 +425,24 @@ import { }; const loggingDatadog3: LoggingDatadog3 = { - host: 'velit officia consequat', - apiKey: 'sit in veniam', + host: 'host', + apiKey: 'api_key', tags: [datadogTags3], }; const loggingNewRelic3: LoggingNewRelic3 = { - host: 'consequat sed', - ingestionKey: 'tempor exercitation', + host: 'host', + ingestionKey: 'ingestion_key', }; const loggingSplunk3: LoggingSplunk3 = { - host: 'qui enim Ut nostrud deserunt', - token: 'cillum sint ullamco veniam occaecat', + host: 'host', + token: 'token', }; const loggingTcp3: LoggingTcp3 = { - host: 'Ut amet', - port: 30110, + host: 'host', + port: 4071, }; const httpFormat3 = HttpFormat3.JSON; @@ -458,8 +455,8 @@ import { const httpCompression3 = HttpCompression3.NONE; const loggingHttp3: LoggingHttp3 = { - host: 'eiusmod labore proident sit ut', - port: 17490, + host: 'host', + port: 52384, user: 'user', password: 'password', path: 'path', @@ -509,7 +506,7 @@ import { }; const updateContainer: UpdateContainer = { - image: 'labore', + image: 'image', resources: resources, command: ['command'], priority: containerGroupPriority, @@ -521,11 +518,11 @@ import { const countryCode = CountryCode.AF; const updateContainerGroupNetworking: UpdateContainerGroupNetworking = { - port: 35022, + port: 49186, }; const containerGroupProbeTcp: ContainerGroupProbeTcp = { - port: 61900, + port: 993, }; const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; @@ -537,14 +534,14 @@ import { const containerGroupProbeHttp: ContainerGroupProbeHttp = { path: 'path', - port: 58759, + port: 64175, scheme: containerProbeHttpScheme, headers: [containerGroupProbeHttpHeaders2], }; const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { service: 'service', - port: 32748, + port: 8441, }; const containerGroupProbeExec: ContainerGroupProbeExec = { @@ -556,7 +553,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 6, + initialDelaySeconds: 8, periodSeconds: 10, timeoutSeconds: 30, successThreshold: 1, @@ -568,7 +565,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 4, + initialDelaySeconds: 10, periodSeconds: 1, timeoutSeconds: 1, successThreshold: 1, @@ -580,7 +577,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 10, + initialDelaySeconds: 7, periodSeconds: 3, timeoutSeconds: 10, successThreshold: 2, @@ -588,18 +585,18 @@ import { }; const queueAutoscaler: QueueAutoscaler = { - minReplicas: 96, - maxReplicas: 190, - desiredQueueLength: 42, - pollingPeriod: 684, - maxUpscalePerMinute: 95, - maxDownscalePerMinute: 10, + minReplicas: 41, + maxReplicas: 135, + desiredQueueLength: 51, + pollingPeriod: 188, + maxUpscalePerMinute: 30, + maxDownscalePerMinute: 42, }; const updateContainerGroup: UpdateContainerGroup = { - displayName: '01n75', + displayName: 'hx6nAEIR', container: updateContainer, - replicas: 232, + replicas: 90, countryCodes: [countryCode], networking: updateContainerGroupNetworking, livenessProbe: containerGroupLivenessProbe, @@ -609,10 +606,10 @@ import { }; const { data } = await saladCloudSdk.containerGroups.updateContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', - input, + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', + updateContainerGroup, ); console.log(data); @@ -645,9 +642,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.deleteContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', ); console.log(data); @@ -680,9 +677,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.startContainerGroup( - 'jfybnugpd6', - 'jngr', - 'vjne2vq5j0d2m4f21ex5ozb1-4j-you0d7uftlpfgcaqa-2oc58y844mz', + 'vrwopvwr-1961g-m85nbqda3ufsy', + 'm780t45z2tw4xt1b86w0clx6u', + 'h-405x811v32aty9s-ghx1hm2nw1m', ); console.log(data); @@ -715,9 +712,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.stopContainerGroup( - 'jpqhlkkgd', - 'a9h5upyur493wxwbxrj4xt9wfx07sgyz1fs97sfhtue78-54vd', - 'jp2qrcnt-8a3', + 'fooidhvnhwad', + 'azuh19krhv62or5c-im9-8sae7tz', + 'oo0emyztq64o8ut710qtepjztx34mk6lruecseiyq06ab3ok5xsg-okxar', ); console.log(data); @@ -754,9 +751,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.listContainerGroupInstances( - 'kjhy3jn2rdf012fi7ouno3mk-ax4d0ajj5ajjquzeg-z3kvqxtnoxnlzhi', - 'ft-8nawc40o0gqev-m', - 'jpy8af-s7rq68p2lenu', + 'y7y892q4m5rifzmevenpg1u', + 'k8xgbal184sloim-c7555huym18dia9d-gb', + 'opn2qgtohqud110sou2jqi50g1umdxtc9fte8n', ); console.log(data); @@ -794,9 +791,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.getContainerGroupInstance( - 'a09xnu6-fkv3', - 'ca4ydy-pi16e4ddle58fi8u9w2qgnsgj7cn', - 'b4p90a72aagy0fz', + 'z-5ux2vsm', + 'mjjt13u7q3pryx', + 'qnnyigut20zp1dyfm2yp4-lw', 'container_group_instance_id', ); @@ -831,9 +828,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.reallocateContainerGroupInstance( - 'sws1rwna83a3asu0izd6ugn07m5xpcp89lefemdke05z4s9d', - 'ed2caksvlhpzmfccbh2v7dcapp3enb9gd2f4k49vviu53s5', - 'xkwwnw', + 'a7tl0fwms3fu3myo74a99jr6ouv4w914sp420zyiuo43jexn', + 'czq6rnxf04dqmccakh', + 'k9g3a72svbjzx0y-i4o1cvulgdrylaujk1yrzfoq1', 'container_group_instance_id', ); @@ -868,9 +865,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.recreateContainerGroupInstance( - 'm-gfjsmt', - 'qljdg4', - 'nzzyoj4pl2kuh4c67m3ae7qwlwipkdye-ad90-cq0up7kyr6', + 'l7wk9jgwxjp56dzbnwtbgowklqt1wsbe00osnj3370c21vihvroq1cuqjb', + 'g-0jo001xz6w2uhgmhtgvpqzhztmaqawqn92-rig0bznv-21cb7s', + 'ghp2ecbvldrihtmaa78lqy5q1wdpi7ayf187etvt65ezckogou9lhenou1q2jx', 'container_group_instance_id', ); @@ -905,9 +902,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.restartContainerGroupInstance( - 'pb', - 'dvb96iwcvlvvm1n', - 'ngljb', + 'ogx1pei8lousb7ikadj659qttkrqdm5b9xdq', + 'cmet9ioqxf-a3suyfz4tkhle7s9-vpaj7uvpjx9jbtvwzjwvj900', + 'bqh9-1g8glb2305o-txbnrdvt2jc9nvk5fkdf18q9zdv3', 'container_group_instance_id', ); diff --git a/documentation/services/InferenceEndpointsService.md b/documentation/services/InferenceEndpointsService.md index f0b253f..78e68bd 100644 --- a/documentation/services/InferenceEndpointsService.md +++ b/documentation/services/InferenceEndpointsService.md @@ -41,10 +41,10 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.listInferenceEndpoints( - 'wtxd1j0ixuhfk-hdff3n3-hbtsigyh53bt0g4gjh8mcz4', + 'r98kinnaq6opnq-td84vb3q9zv3k2ki3jzct2pf06rygg23yz', { - page: 121822981, - pageSize: 37, + page: 1536623748, + pageSize: 41, }, ); @@ -80,7 +80,10 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint('u5ke3wy-5gl1809s8so', 'et tempor sint'); + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint( + 'cx2mv031v8afyh5y7ht26t-sfc4u7-dhjnxb2hbrz-ipttu1m2vc', + 'inference_endpoint_name', + ); console.log(data); })(); @@ -117,11 +120,11 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJobs( - 'yg0u13rmnwb7eyumc25lm4prwopvwr-1961f', - 'consectetur occaecat', + 'pk05fdmxk23ipxt6vd6e', + 'inference_endpoint_name', { - page: 355955712, - pageSize: 39, + page: 1228703779, + pageSize: 80, }, ); @@ -165,9 +168,9 @@ import { CreateInferenceEndpointJob, SaladCloudSdk } from '@saladtechnologies-os }; const { data } = await saladCloudSdk.inferenceEndpoints.createInferenceEndpointJob( - 'yg0u13rmnwb7eyumc25lm4prwopvwr-1961f', - 'consectetur occaecat', - input, + 'pk05fdmxk23ipxt6vd6e', + 'inference_endpoint_name', + createInferenceEndpointJob, ); console.log(data); @@ -204,8 +207,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJob( - 'kdhvnhwadaqzuh18', - 'eiusmod dolore do', + 'igqfe6b1d0c-0auqqph3bt-7bft4c1m95idut36tc-x7mo2nsh7uoln', + 'inference_endpoint_name', 'inference_endpoint_job_id', ); @@ -239,8 +242,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.deleteInferenceEndpointJob( - 'kdhvnhwadaqzuh18', - 'eiusmod dolore do', + 'igqfe6b1d0c-0auqqph3bt-7bft4c1m95idut36tc-x7mo2nsh7uoln', + 'inference_endpoint_name', 'inference_endpoint_job_id', ); diff --git a/documentation/services/OrganizationDataService.md b/documentation/services/OrganizationDataService.md index 4a45b89..a6fd318 100644 --- a/documentation/services/OrganizationDataService.md +++ b/documentation/services/OrganizationDataService.md @@ -33,7 +33,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.organizationData.listGpuClasses('vsg-okxas9m7y892q4m5rifzmevenpg1vot8xgbal'); + const { data } = await saladCloudSdk.organizationData.listGpuClasses('ydd335fjnk1n3-2syw9jsf8am-o3r88blouno'); console.log(data); })(); diff --git a/documentation/services/QueuesService.md b/documentation/services/QueuesService.md index 5994a8f..d4a9905 100644 --- a/documentation/services/QueuesService.md +++ b/documentation/services/QueuesService.md @@ -43,8 +43,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.listQueues( - 'xtp82b9jzwqov1insghigvfq0donadhrrdqx-2redu46g7e', - 'xk27gbnpmwk5xor49bk4ujk7', + 'ymfonstzqzsopxf2dyjvm8sjxa281t2p7ne1m', + 'sxk12v91ajseb3fzyxdaq', ); console.log(data); @@ -81,15 +81,15 @@ import { CreateQueue, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-s }); const createQueue: CreateQueue = { - name: 'ho4d79h7bg0vpngqc8hz5pxjwi', - displayName: 'IWPKHVWPTc', - description: 'aliqua id nostrud', + name: 'name', + displayName: 'M a1HEy', + description: 'description', }; const { data } = await saladCloudSdk.queues.createQueue( - 'xtp82b9jzwqov1insghigvfq0donadhrrdqx-2redu46g7e', - 'xk27gbnpmwk5xor49bk4ujk7', - input, + 'ymfonstzqzsopxf2dyjvm8sjxa281t2p7ne1m', + 'sxk12v91ajseb3fzyxdaq', + createQueue, ); console.log(data); @@ -126,9 +126,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.getQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', ); console.log(data); @@ -166,15 +166,15 @@ import { SaladCloudSdk, UpdateQueue } from '@saladtechnologies-oss/salad-cloud-s }); const updateQueue: UpdateQueue = { - displayName: 'O5Yf2', - description: 'cupidatat', + displayName: 'eYpeFzhf', + description: 'description', }; const { data } = await saladCloudSdk.queues.updateQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', - input, + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', + updateQueue, ); console.log(data); @@ -207,9 +207,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.deleteQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', ); console.log(data); @@ -248,12 +248,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.listQueueJobs( - 'wcaz2jbu5pfmpygxffsf4bh4e6', - 'dzh9lv6afpamv8cx0x6', - 's9f4ikmr0j6c3n18n4djttkqmgzb46dd5wogzrfe2pq12s2', + 'yl-v1qf-186n2145dgb2tg1emlkmk', + 'ufo7nbyl9hodgr47mbi5x5lh', + 'g-5jd', { - page: 706148771, - pageSize: 45, + page: 1000778021, + pageSize: 88, }, ); @@ -298,10 +298,10 @@ import { CreateQueueJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-clou }; const { data } = await saladCloudSdk.queues.createQueueJob( - 'wcaz2jbu5pfmpygxffsf4bh4e6', - 'dzh9lv6afpamv8cx0x6', - 's9f4ikmr0j6c3n18n4djttkqmgzb46dd5wogzrfe2pq12s2', - input, + 'yl-v1qf-186n2145dgb2tg1emlkmk', + 'ufo7nbyl9hodgr47mbi5x5lh', + 'g-5jd', + createQueueJob, ); console.log(data); @@ -338,7 +338,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.queues.getQueueJob('zm-jv', 'tq26', 'je5dpzbgsk8gvp', 'queue_job_id'); + const { data } = await saladCloudSdk.queues.getQueueJob( + 'hrf4burmjglxm0qfqui7u2clb2gfk12ij-g2i1z7we77-hpgwjdxcrr6-3c9', + 'dv3zyz-95e2zp7wjr', + 'zkrdg5h3eeasigc', + 'queue_job_id', + ); console.log(data); })(); @@ -370,7 +375,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.queues.deleteQueueJob('zm-jv', 'tq26', 'je5dpzbgsk8gvp', 'queue_job_id'); + const { data } = await saladCloudSdk.queues.deleteQueueJob( + 'hrf4burmjglxm0qfqui7u2clb2gfk12ij-g2i1z7we77-hpgwjdxcrr6-3c9', + 'dv3zyz-95e2zp7wjr', + 'zkrdg5h3eeasigc', + 'queue_job_id', + ); console.log(data); })(); diff --git a/documentation/services/QuotasService.md b/documentation/services/QuotasService.md index 79e1391..d64db46 100644 --- a/documentation/services/QuotasService.md +++ b/documentation/services/QuotasService.md @@ -33,7 +33,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.quotas.getQuotas('oecson4k2eclxr'); + const { data } = await saladCloudSdk.quotas.getQuotas('fu2s7l'); console.log(data); })(); diff --git a/documentation/services/SystemLogsService.md b/documentation/services/SystemLogsService.md new file mode 100644 index 0000000..7d55b9b --- /dev/null +++ b/documentation/services/SystemLogsService.md @@ -0,0 +1,46 @@ +# SystemLogsService + +A list of all methods in the `SystemLogsService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :------------------------------ | :------------------- | +| [getSystemLogs](#getsystemlogs) | Gets the System Logs | + +## getSystemLogs + +Gets the System Logs + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/system-logs` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| organizationName | string | ✅ | Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization. | +| projectName | string | ✅ | Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API. | +| containerGroupName | string | ✅ | The unique container group name | + +**Return Type** + +`SystemLogList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.systemLogs.getSystemLogs( + 'fmcz5cnnkfiyt3k5ke3wy-5gl1809s8sotrp88klv3q4l4ni7uszkt0ht2', + 'jpum7p7dqeb0o9xu', + 'nlzoet3pfl3xit2pe40saanre16q8ug0u13rmnwb7eyumc1', + ); + + console.log(data); +})(); +``` diff --git a/documentation/services/WebhookSecretKeyService.md b/documentation/services/WebhookSecretKeyService.md index 8513729..089b516 100644 --- a/documentation/services/WebhookSecretKeyService.md +++ b/documentation/services/WebhookSecretKeyService.md @@ -34,9 +34,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey( - 'mouv4w914sp420zyiuo43jexocjzq6rnxf04dqmccakipx9g3a72svbj', - ); + const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey('eqlckzjaa8wys5nkv5h5z8lk18'); console.log(data); })(); @@ -69,9 +67,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey( - 'mouv4w914sp420zyiuo43jexocjzq6rnxf04dqmccakipx9g3a72svbj', - ); + const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey('eqlckzjaa8wys5nkv5h5z8lk18'); console.log(data); })(); diff --git a/documentation/services/WorkloadErrorsService.md b/documentation/services/WorkloadErrorsService.md index efa91c6..73027ea 100644 --- a/documentation/services/WorkloadErrorsService.md +++ b/documentation/services/WorkloadErrorsService.md @@ -2,45 +2,5 @@ A list of all methods in the `WorkloadErrorsService` service. Click on the method name to view detailed information about that method. -| Methods | Description | -| :-------------------------------------- | :----------------------- | -| [getWorkloadErrors](#getworkloaderrors) | Gets the workload errors | - -## getWorkloadErrors - -Gets the workload errors - -- HTTP Method: `GET` -- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/errors` - -**Parameters** - -| Name | Type | Required | Description | -| :----------------- | :----- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| organizationName | string | ✅ | Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization. | -| projectName | string | ✅ | Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API. | -| containerGroupName | string | ✅ | The unique container group name | - -**Return Type** - -`WorkloadErrorList` - -**Example Usage Code Snippet** - -```typescript -import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; - -(async () => { - const saladCloudSdk = new SaladCloudSdk({ - apiKey: 'YOUR_API_KEY', - }); - - const { data } = await saladCloudSdk.workloadErrors.getWorkloadErrors( - 'x4hd7xmy53wgq8mpuy5k2wfbbzlhws5edt3sje', - 'hug6abtk-ewjq1594j27m6u1whmqikj9f18pd', - 'lq52i317o2r8pje-v4-ccp8q-329szw31h4fee236', - ); - - console.log(data); -})(); -``` +| Methods | Description | +| :------ | :---------- | diff --git a/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md b/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md index a623be9..787169b 100644 --- a/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md +++ b/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md @@ -6,7 +6,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.organizationData.listGpuClasses('vsg-okxas9m7y892q4m5rifzmevenpg1vot8xgbal'); + const { data } = await saladCloudSdk.organizationData.listGpuClasses('ydd335fjnk1n3-2syw9jsf8am-o3r88blouno'); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md index cfa17ec..193ab37 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md @@ -7,10 +7,10 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.listInferenceEndpoints( - 'wtxd1j0ixuhfk-hdff3n3-hbtsigyh53bt0g4gjh8mcz4', + 'r98kinnaq6opnq-td84vb3q9zv3k2ki3jzct2pf06rygg23yz', { - page: 121822981, - pageSize: 37, + page: 1536623748, + pageSize: 41, }, ); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md index 79f91a0..89ce8f3 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md @@ -6,7 +6,10 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint('u5ke3wy-5gl1809s8so', 'et tempor sint'); + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint( + 'cx2mv031v8afyh5y7ht26t-sfc4u7-dhjnxb2hbrz-ipttu1m2vc', + 'inference_endpoint_name', + ); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md index 1af568c..fb8b893 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md @@ -7,11 +7,11 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJobs( - 'yg0u13rmnwb7eyumc25lm4prwopvwr-1961f', - 'consectetur occaecat', + 'pk05fdmxk23ipxt6vd6e', + 'inference_endpoint_name', { - page: 355955712, - pageSize: 39, + page: 1228703779, + pageSize: 80, }, ); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md index 99f199b..562be44 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md @@ -13,9 +13,9 @@ import { CreateInferenceEndpointJob, SaladCloudSdk } from '@saladtechnologies-os }; const { data } = await saladCloudSdk.inferenceEndpoints.createInferenceEndpointJob( - 'yg0u13rmnwb7eyumc25lm4prwopvwr-1961f', - 'consectetur occaecat', - input, + 'pk05fdmxk23ipxt6vd6e', + 'inference_endpoint_name', + createInferenceEndpointJob, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md index 56a8eb0..66b48ae 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md @@ -7,8 +7,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.deleteInferenceEndpointJob( - 'kdhvnhwadaqzuh18', - 'eiusmod dolore do', + 'igqfe6b1d0c-0auqqph3bt-7bft4c1m95idut36tc-x7mo2nsh7uoln', + 'inference_endpoint_name', 'inference_endpoint_job_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md index 624ee58..992c0b5 100644 --- a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md @@ -7,8 +7,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJob( - 'kdhvnhwadaqzuh18', - 'eiusmod dolore do', + 'igqfe6b1d0c-0auqqph3bt-7bft4c1m95idut36tc-x7mo2nsh7uoln', + 'inference_endpoint_name', 'inference_endpoint_job_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md index ab6bf5f..c8ae413 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md @@ -6,10 +6,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.containerGroups.listContainerGroups( - 'v50imwzgi4em4q035', - 'm6yw3-xm60cb7tiev8rketqiiwjepibzf2ust1cvjx8oua8mepeueo5-1', - ); + const { data } = await saladCloudSdk.containerGroups.listContainerGroups('o9lnd3c1w-4b', 'c9jr'); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md index 5238c5f..99a75ad 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md @@ -20,17 +20,17 @@ import { const containerResourceRequirements: ContainerResourceRequirements = { cpu: 10, - memory: 35273, + memory: 9057, gpuClasses: ['gpu_classes'], - storageAmount: 32391110488, + storageAmount: 34911830561, }; const containerGroupPriority = ContainerGroupPriority.HIGH; const loggingAxiom2: LoggingAxiom2 = { - host: 'irure ut eiusmod velit incididunt', - apiToken: 'deserunt aute cillum dolor occaecat', - dataset: 'exercitation sit', + host: 'host', + apiToken: 'api_token', + dataset: 'dataset', }; const datadogTags2: DatadogTags2 = { @@ -39,24 +39,24 @@ import { }; const loggingDatadog2: LoggingDatadog2 = { - host: 'sunt consequat irure fugiat', - apiKey: 'magna', + host: 'host', + apiKey: 'api_key', tags: [datadogTags2], }; const loggingNewRelic2: LoggingNewRelic2 = { - host: 'quis aute in id proident', - ingestionKey: 'aliqua enim pariatur', + host: 'host', + ingestionKey: 'ingestion_key', }; const loggingSplunk2: LoggingSplunk2 = { - host: 'ad', - token: 'irure velit labore nostrud elit', + host: 'host', + token: 'token', }; const loggingTcp2: LoggingTcp2 = { - host: 'fugiat do', - port: 1272, + host: 'host', + port: 32723, }; const httpFormat2 = HttpFormat2.JSON; @@ -69,8 +69,8 @@ import { const httpCompression2 = HttpCompression2.NONE; const loggingHttp2: LoggingHttp2 = { - host: 'cillum', - port: 21241, + host: 'host', + port: 51830, user: 'user', password: 'password', path: 'path', @@ -120,7 +120,7 @@ import { }; const createContainer: CreateContainer = { - image: 'reprehenderit', + image: 'image', resources: containerResourceRequirements, command: ['command'], priority: containerGroupPriority, @@ -135,11 +135,11 @@ import { const containerNetworkingProtocol = ContainerNetworkingProtocol.HTTP; - const createContainerGroupNetworkingLoadBalancer = CreateContainerGroupNetworkingLoadBalancer.ROUNDROBIN; + const createContainerGroupNetworkingLoadBalancer = CreateContainerGroupNetworkingLoadBalancer.ROUND_ROBIN; const createContainerGroupNetworking: CreateContainerGroupNetworking = { protocol: containerNetworkingProtocol, - port: 43901, + port: 4465, auth: true, loadBalancer: createContainerGroupNetworkingLoadBalancer, singleConnectionLimit: true, @@ -148,7 +148,7 @@ import { }; const containerGroupProbeTcp: ContainerGroupProbeTcp = { - port: 61900, + port: 993, }; const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; @@ -160,14 +160,14 @@ import { const containerGroupProbeHttp: ContainerGroupProbeHttp = { path: 'path', - port: 58759, + port: 64175, scheme: containerProbeHttpScheme, headers: [containerGroupProbeHttpHeaders2], }; const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { service: 'service', - port: 32748, + port: 8441, }; const containerGroupProbeExec: ContainerGroupProbeExec = { @@ -179,7 +179,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 6, + initialDelaySeconds: 8, periodSeconds: 10, timeoutSeconds: 30, successThreshold: 1, @@ -191,7 +191,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 4, + initialDelaySeconds: 10, periodSeconds: 1, timeoutSeconds: 1, successThreshold: 1, @@ -203,7 +203,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 10, + initialDelaySeconds: 7, periodSeconds: 3, timeoutSeconds: 10, successThreshold: 2, @@ -211,27 +211,27 @@ import { }; const containerGroupQueueConnection: ContainerGroupQueueConnection = { - path: 'pariatur Ut aliqua irure', - port: 34903, - queueName: 'nz26lyemw7nednorlqjlsihb3', + path: 'path', + port: 43154, + queueName: 'oujbls0vsz6xilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2mppfvzd5f4e', }; const queueAutoscaler: QueueAutoscaler = { - minReplicas: 96, - maxReplicas: 190, - desiredQueueLength: 42, - pollingPeriod: 684, - maxUpscalePerMinute: 95, - maxDownscalePerMinute: 10, + minReplicas: 41, + maxReplicas: 135, + desiredQueueLength: 51, + pollingPeriod: 188, + maxUpscalePerMinute: 30, + maxDownscalePerMinute: 42, }; const createContainerGroup: CreateContainerGroup = { - name: 'xvih', - displayName: 'INce5LCTy', + name: 'name', + displayName: 'hfR', container: createContainer, autostartPolicy: true, restartPolicy: containerRestartPolicy, - replicas: 12, + replicas: 169, countryCodes: [countryCode], networking: createContainerGroupNetworking, livenessProbe: containerGroupLivenessProbe, @@ -242,9 +242,9 @@ import { }; const { data } = await saladCloudSdk.containerGroups.createContainerGroup( - 'v50imwzgi4em4q035', - 'm6yw3-xm60cb7tiev8rketqiiwjepibzf2ust1cvjx8oua8mepeueo5-1', - input, + 'o9lnd3c1w-4b', + 'c9jr', + createContainerGroup, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md index a208d8d..5b1f103 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.deleteContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md index 05d74ac..9c4a57f 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.getContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md index 9c1abb1..22b9056 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.listContainerGroupInstances( - 'kjhy3jn2rdf012fi7ouno3mk-ax4d0ajj5ajjquzeg-z3kvqxtnoxnlzhi', - 'ft-8nawc40o0gqev-m', - 'jpy8af-s7rq68p2lenu', + 'y7y892q4m5rifzmevenpg1u', + 'k8xgbal184sloim-c7555huym18dia9d-gb', + 'opn2qgtohqud110sou2jqi50g1umdxtc9fte8n', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md index 9cf74c7..e0cf825 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.getContainerGroupInstance( - 'a09xnu6-fkv3', - 'ca4ydy-pi16e4ddle58fi8u9w2qgnsgj7cn', - 'b4p90a72aagy0fz', + 'z-5ux2vsm', + 'mjjt13u7q3pryx', + 'qnnyigut20zp1dyfm2yp4-lw', 'container_group_instance_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md index f93ad8b..c99f85f 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.reallocateContainerGroupInstance( - 'sws1rwna83a3asu0izd6ugn07m5xpcp89lefemdke05z4s9d', - 'ed2caksvlhpzmfccbh2v7dcapp3enb9gd2f4k49vviu53s5', - 'xkwwnw', + 'a7tl0fwms3fu3myo74a99jr6ouv4w914sp420zyiuo43jexn', + 'czq6rnxf04dqmccakh', + 'k9g3a72svbjzx0y-i4o1cvulgdrylaujk1yrzfoq1', 'container_group_instance_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md index 5e8adca..962b221 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.recreateContainerGroupInstance( - 'm-gfjsmt', - 'qljdg4', - 'nzzyoj4pl2kuh4c67m3ae7qwlwipkdye-ad90-cq0up7kyr6', + 'l7wk9jgwxjp56dzbnwtbgowklqt1wsbe00osnj3370c21vihvroq1cuqjb', + 'g-0jo001xz6w2uhgmhtgvpqzhztmaqawqn92-rig0bznv-21cb7s', + 'ghp2ecbvldrihtmaa78lqy5q1wdpi7ayf187etvt65ezckogou9lhenou1q2jx', 'container_group_instance_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md index 96708ae..95f2d71 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.restartContainerGroupInstance( - 'pb', - 'dvb96iwcvlvvm1n', - 'ngljb', + 'ogx1pei8lousb7ikadj659qttkrqdm5b9xdq', + 'cmet9ioqxf-a3suyfz4tkhle7s9-vpaj7uvpjx9jbtvwzjwvj900', + 'bqh9-1g8glb2305o-txbnrdvt2jc9nvk5fkdf18q9zdv3', 'container_group_instance_id', ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md index 68c4bca..8df1092 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md @@ -17,18 +17,18 @@ import { }); const resources: Resources = { - cpu: 3, - memory: 14678, + cpu: 12, + memory: 16671, gpuClasses: ['gpu_classes'], - storageAmount: 47984533464, + storageAmount: 47892181137, }; const containerGroupPriority = ContainerGroupPriority.HIGH; const loggingAxiom3: LoggingAxiom3 = { - host: 'aute veniam exercitation eiusmod et', - apiToken: 'mollit', - dataset: 'nisi in Lorem', + host: 'host', + apiToken: 'api_token', + dataset: 'dataset', }; const datadogTags3: DatadogTags3 = { @@ -37,24 +37,24 @@ import { }; const loggingDatadog3: LoggingDatadog3 = { - host: 'velit officia consequat', - apiKey: 'sit in veniam', + host: 'host', + apiKey: 'api_key', tags: [datadogTags3], }; const loggingNewRelic3: LoggingNewRelic3 = { - host: 'consequat sed', - ingestionKey: 'tempor exercitation', + host: 'host', + ingestionKey: 'ingestion_key', }; const loggingSplunk3: LoggingSplunk3 = { - host: 'qui enim Ut nostrud deserunt', - token: 'cillum sint ullamco veniam occaecat', + host: 'host', + token: 'token', }; const loggingTcp3: LoggingTcp3 = { - host: 'Ut amet', - port: 30110, + host: 'host', + port: 4071, }; const httpFormat3 = HttpFormat3.JSON; @@ -67,8 +67,8 @@ import { const httpCompression3 = HttpCompression3.NONE; const loggingHttp3: LoggingHttp3 = { - host: 'eiusmod labore proident sit ut', - port: 17490, + host: 'host', + port: 52384, user: 'user', password: 'password', path: 'path', @@ -118,7 +118,7 @@ import { }; const updateContainer: UpdateContainer = { - image: 'labore', + image: 'image', resources: resources, command: ['command'], priority: containerGroupPriority, @@ -130,11 +130,11 @@ import { const countryCode = CountryCode.AF; const updateContainerGroupNetworking: UpdateContainerGroupNetworking = { - port: 35022, + port: 49186, }; const containerGroupProbeTcp: ContainerGroupProbeTcp = { - port: 61900, + port: 993, }; const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; @@ -146,14 +146,14 @@ import { const containerGroupProbeHttp: ContainerGroupProbeHttp = { path: 'path', - port: 58759, + port: 64175, scheme: containerProbeHttpScheme, headers: [containerGroupProbeHttpHeaders2], }; const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { service: 'service', - port: 32748, + port: 8441, }; const containerGroupProbeExec: ContainerGroupProbeExec = { @@ -165,7 +165,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 6, + initialDelaySeconds: 8, periodSeconds: 10, timeoutSeconds: 30, successThreshold: 1, @@ -177,7 +177,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 4, + initialDelaySeconds: 10, periodSeconds: 1, timeoutSeconds: 1, successThreshold: 1, @@ -189,7 +189,7 @@ import { http: containerGroupProbeHttp, grpc: containerGroupProbeGrpc, exec: containerGroupProbeExec, - initialDelaySeconds: 10, + initialDelaySeconds: 7, periodSeconds: 3, timeoutSeconds: 10, successThreshold: 2, @@ -197,18 +197,18 @@ import { }; const queueAutoscaler: QueueAutoscaler = { - minReplicas: 96, - maxReplicas: 190, - desiredQueueLength: 42, - pollingPeriod: 684, - maxUpscalePerMinute: 95, - maxDownscalePerMinute: 10, + minReplicas: 41, + maxReplicas: 135, + desiredQueueLength: 51, + pollingPeriod: 188, + maxUpscalePerMinute: 30, + maxDownscalePerMinute: 42, }; const updateContainerGroup: UpdateContainerGroup = { - displayName: '01n75', + displayName: 'hx6nAEIR', container: updateContainer, - replicas: 232, + replicas: 90, countryCodes: [countryCode], networking: updateContainerGroupNetworking, livenessProbe: containerGroupLivenessProbe, @@ -218,10 +218,10 @@ import { }; const { data } = await saladCloudSdk.containerGroups.updateContainerGroup( - 'oji7lyvxb3ca5hc', - 'olb1uzytbhhukf1u0-ahl0b9oqfjj', - 's7z7dvdopv2czgde1zrufxgiv5tp-j', - input, + 'mk0yct7b8bo1g8tvl9', + 'ax4qyju9jcnr3fw8e9al8o-4oreg5ocaz2jbu5pfmpygxffsf4bh4e6', + 'dzh9lv6afpamv8cx0x6', + updateContainerGroup, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md index 5235ee7..592efd5 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.startContainerGroup( - 'jfybnugpd6', - 'jngr', - 'vjne2vq5j0d2m4f21ex5ozb1-4j-you0d7uftlpfgcaqa-2oc58y844mz', + 'vrwopvwr-1961g-m85nbqda3ufsy', + 'm780t45z2tw4xt1b86w0clx6u', + 'h-405x811v32aty9s-ghx1hm2nw1m', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md index 4f5b2d6..1b285c6 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.containerGroups.stopContainerGroup( - 'jpqhlkkgd', - 'a9h5upyur493wxwbxrj4xt9wfx07sgyz1fs97sfhtue78-54vd', - 'jp2qrcnt-8a3', + 'fooidhvnhwad', + 'azuh19krhv62or5c-im9-8sae7tz', + 'oo0emyztq64o8ut710qtepjztx34mk6lruecseiyq06ab3ok5xsg-okxar', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-system-logs-get.md similarity index 50% rename from documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md rename to documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-system-logs-get.md index c7c0e33..39124ee 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-system-logs-get.md @@ -6,10 +6,10 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.workloadErrors.getWorkloadErrors( - 'x4hd7xmy53wgq8mpuy5k2wfbbzlhws5edt3sje', - 'hug6abtk-ewjq1594j27m6u1whmqikj9f18pd', - 'lq52i317o2r8pje-v4-ccp8q-329szw31h4fee236', + const { data } = await saladCloudSdk.systemLogs.getSystemLogs( + 'fmcz5cnnkfiyt3k5ke3wy-5gl1809s8sotrp88klv3q4l4ni7uszkt0ht2', + 'jpum7p7dqeb0o9xu', + 'nlzoet3pfl3xit2pe40saanre16q8ug0u13rmnwb7eyumc1', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md index 126655b..0c8605e 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md @@ -7,8 +7,8 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.listQueues( - 'xtp82b9jzwqov1insghigvfq0donadhrrdqx-2redu46g7e', - 'xk27gbnpmwk5xor49bk4ujk7', + 'ymfonstzqzsopxf2dyjvm8sjxa281t2p7ne1m', + 'sxk12v91ajseb3fzyxdaq', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md index dc1ff49..19d9be1 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md @@ -7,15 +7,15 @@ import { CreateQueue, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-s }); const createQueue: CreateQueue = { - name: 'ho4d79h7bg0vpngqc8hz5pxjwi', - displayName: 'IWPKHVWPTc', - description: 'aliqua id nostrud', + name: 'name', + displayName: 'M a1HEy', + description: 'description', }; const { data } = await saladCloudSdk.queues.createQueue( - 'xtp82b9jzwqov1insghigvfq0donadhrrdqx-2redu46g7e', - 'xk27gbnpmwk5xor49bk4ujk7', - input, + 'ymfonstzqzsopxf2dyjvm8sjxa281t2p7ne1m', + 'sxk12v91ajseb3fzyxdaq', + createQueue, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md index 4205668..9c45add 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.deleteQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md index 49bda3c..3309785 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md @@ -7,9 +7,9 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.getQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md index 9dc0ad5..ae575bc 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md @@ -7,12 +7,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; }); const { data } = await saladCloudSdk.queues.listQueueJobs( - 'wcaz2jbu5pfmpygxffsf4bh4e6', - 'dzh9lv6afpamv8cx0x6', - 's9f4ikmr0j6c3n18n4djttkqmgzb46dd5wogzrfe2pq12s2', + 'yl-v1qf-186n2145dgb2tg1emlkmk', + 'ufo7nbyl9hodgr47mbi5x5lh', + 'g-5jd', { - page: 706148771, - pageSize: 45, + page: 1000778021, + pageSize: 88, }, ); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md index 0723653..846e713 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md @@ -13,10 +13,10 @@ import { CreateQueueJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-clou }; const { data } = await saladCloudSdk.queues.createQueueJob( - 'wcaz2jbu5pfmpygxffsf4bh4e6', - 'dzh9lv6afpamv8cx0x6', - 's9f4ikmr0j6c3n18n4djttkqmgzb46dd5wogzrfe2pq12s2', - input, + 'yl-v1qf-186n2145dgb2tg1emlkmk', + 'ufo7nbyl9hodgr47mbi5x5lh', + 'g-5jd', + createQueueJob, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md index a805b24..58be043 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md @@ -6,7 +6,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.queues.deleteQueueJob('zm-jv', 'tq26', 'je5dpzbgsk8gvp', 'queue_job_id'); + const { data } = await saladCloudSdk.queues.deleteQueueJob( + 'hrf4burmjglxm0qfqui7u2clb2gfk12ij-g2i1z7we77-hpgwjdxcrr6-3c9', + 'dv3zyz-95e2zp7wjr', + 'zkrdg5h3eeasigc', + 'queue_job_id', + ); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md index ea94807..1cf32fb 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md @@ -6,7 +6,12 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.queues.getQueueJob('zm-jv', 'tq26', 'je5dpzbgsk8gvp', 'queue_job_id'); + const { data } = await saladCloudSdk.queues.getQueueJob( + 'hrf4burmjglxm0qfqui7u2clb2gfk12ij-g2i1z7we77-hpgwjdxcrr6-3c9', + 'dv3zyz-95e2zp7wjr', + 'zkrdg5h3eeasigc', + 'queue_job_id', + ); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md index abd9039..f42cc88 100644 --- a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md @@ -7,15 +7,15 @@ import { SaladCloudSdk, UpdateQueue } from '@saladtechnologies-oss/salad-cloud-s }); const updateQueue: UpdateQueue = { - displayName: 'O5Yf2', - description: 'cupidatat', + displayName: 'eYpeFzhf', + description: 'description', }; const { data } = await saladCloudSdk.queues.updateQueue( - 'bb5wprcvb9628akhug9lnd2', - 'bw-4bdb9jsi-f1xex70mdgjf5n-5ua-e28xyu9ujbls0vsy', - 'wilo12xl52y9c178cmdya6ykpby-hunb0b6s7s2l', - input, + 'xrt9bh26smkuf3v0nd2roppi64zikv73wys88ns82g85qcczec2y8bnwc4gs', + 'y6aeebojnkc8rl8-7pysy62j25cdn', + 'ujh0v34w5-21z63jxnxh38ckz48-k1ecu', + updateQueue, ); console.log(data); diff --git a/documentation/snippets/organizations-{organization_name}-quotas-get.md b/documentation/snippets/organizations-{organization_name}-quotas-get.md index d5a5010..475db80 100644 --- a/documentation/snippets/organizations-{organization_name}-quotas-get.md +++ b/documentation/snippets/organizations-{organization_name}-quotas-get.md @@ -6,7 +6,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.quotas.getQuotas('oecson4k2eclxr'); + const { data } = await saladCloudSdk.quotas.getQuotas('fu2s7l'); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md index 4ebc8dd..26be85e 100644 --- a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md +++ b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md @@ -6,9 +6,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey( - 'mouv4w914sp420zyiuo43jexocjzq6rnxf04dqmccakipx9g3a72svbj', - ); + const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey('eqlckzjaa8wys5nkv5h5z8lk18'); console.log(data); })(); diff --git a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md index a35b0a6..f902fd0 100644 --- a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md +++ b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md @@ -6,9 +6,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey( - 'mouv4w914sp420zyiuo43jexocjzq6rnxf04dqmccakipx9g3a72svbj', - ); + const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey('eqlckzjaa8wys5nkv5h5z8lk18'); console.log(data); })(); diff --git a/examples/package.json b/examples/package.json index 3f53f20..e8c1dad 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "salad-cloud-sdk", - "version": "0.9.0-alpha.6", + "version": "0.9.0-alpha.7", "private": true, "dependencies": { "@saladtechnologies-oss/salad-cloud-sdk": "file:../", diff --git a/examples/src/index.ts b/examples/src/index.ts index c748f6e..4bafeb1 100644 --- a/examples/src/index.ts +++ b/examples/src/index.ts @@ -5,7 +5,7 @@ import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; apiKey: 'YOUR_API_KEY', }); - const { data } = await saladCloudSdk.quotas.getQuotas('oecson4k2eclxr'); + const { data } = await saladCloudSdk.quotas.getQuotas('fu2s7l'); console.log(data); })(); diff --git a/package-lock.json b/package-lock.json index be8dc07..db6549c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@saladtechnologies-oss/salad-cloud-sdk", - "version": "0.9.0-alpha.6", + "version": "0.9.0-alpha.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@saladtechnologies-oss/salad-cloud-sdk", - "version": "0.9.0-alpha.6", + "version": "0.9.0-alpha.7", "license": "MIT", "dependencies": { "zod": "3.22.0" @@ -409,9 +409,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { @@ -692,9 +692,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { @@ -707,9 +707,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -814,9 +814,9 @@ } }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", "dependencies": { @@ -824,16 +824,16 @@ "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" } }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 9986bbd..1bb2ca7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@saladtechnologies-oss/salad-cloud-sdk", - "version": "0.9.0-alpha.6", + "version": "0.9.0-alpha.7", "description": "The SaladCloud REST API. Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details.", "source": "./src/index.ts", "main": "./dist/index.js", diff --git a/src/http/client.ts b/src/http/client.ts index 055ff2b..06e67e0 100644 --- a/src/http/client.ts +++ b/src/http/client.ts @@ -1,5 +1,4 @@ -import { SerializationStyle } from './serialization/base-serializer'; -import { HttpMethod, HttpResponse, Options, RetryOptions, SdkConfig } from './types'; +import { HttpResponse, SdkConfig } from './types'; import { RequestHandlerChain } from './handlers/handler-chain'; import { HookHandler } from './handlers/hook-handler'; import { ResponseValidationHandler } from './handlers/response-validation-handler'; @@ -25,11 +24,15 @@ export class HttpClient { this.requestHandlerChain.addHandler(new TerminatingHandler()); } - call(request: Request): Promise> { + call(request: Request): Promise> { return this.requestHandlerChain.callChain(request); } - public async callPaginated(request: Request): Promise> { + async *stream(request: Request): AsyncGenerator> { + yield* this.requestHandlerChain.streamChain(request); + } + + public async callPaginated(request: Request): Promise> { const response = await this.call(request as any); if (!response.data) { @@ -50,7 +53,7 @@ export class HttpClient { this.config = config; } - private getPage(request: Request, data: FullResponse): Page { + private getPage(request: Request, data: FullResponse): Page { if (!request.pagination) { throw new Error('getPage called for request without pagination property'); } diff --git a/src/http/handlers/auth-handler.ts b/src/http/handlers/auth-handler.ts index 8454647..f005f53 100644 --- a/src/http/handlers/auth-handler.ts +++ b/src/http/handlers/auth-handler.ts @@ -5,17 +5,27 @@ import { SerializationStyle } from '../serialization/base-serializer'; export class AuthHandler implements RequestHandler { next?: RequestHandler; - async handle(request: Request): Promise> { + public async handle(request: Request): Promise> { const requestWithAuth = this.addApiKeyHeader(request); if (!this.next) { throw new Error(`No next handler set in ${AuthHandler.name}`); } - return this.next?.handle(requestWithAuth); + return this.next.handle(requestWithAuth); } - private addApiKeyHeader(request: Request): Request { + public async *stream(request: Request): AsyncGenerator> { + const requestWithAuth = this.addApiKeyHeader(request); + + if (!this.next) { + throw new Error(`No next handler set in ${AuthHandler.name}`); + } + + yield* this.next.stream(requestWithAuth); + } + + private addApiKeyHeader(request: Request): Request { const apiKey = request.config?.apiKey; const apiKeyHeader = request.config?.apiKeyHeader ?? 'Salad-Api-Key'; if (!apiKey) { diff --git a/src/http/handlers/handler-chain.ts b/src/http/handlers/handler-chain.ts index 9f56b04..69cb350 100644 --- a/src/http/handlers/handler-chain.ts +++ b/src/http/handlers/handler-chain.ts @@ -12,11 +12,19 @@ export class RequestHandlerChain { this.handlers.push(handler); } - async callChain(request: Request): Promise> { + async callChain(request: Request): Promise> { if (!this.handlers.length) { throw new Error('No handlers added to the chain'); } - return this.handlers[0].handle(request); + return this.handlers[0].handle(request); + } + + async *streamChain(request: Request): AsyncGenerator> { + if (!this.handlers.length) { + throw new Error('No handlers added to the chain'); + } + + yield* this.handlers[0].stream(request); } } diff --git a/src/http/handlers/hook-handler.ts b/src/http/handlers/hook-handler.ts index 17f9935..a87b7e2 100644 --- a/src/http/handlers/hook-handler.ts +++ b/src/http/handlers/hook-handler.ts @@ -1,6 +1,5 @@ import { Request } from '../transport/request'; import { HttpResponse, RequestHandler } from '../types'; -import { HttpError } from '../error'; import { Hook } from '../hooks/hook'; import { TransportHookAdapter } from '../transport/transport-hook-adapter'; @@ -9,7 +8,7 @@ export class HookHandler implements RequestHandler { constructor(private readonly hook: Hook) {} - async handle(request: Request): Promise> { + async handle(request: Request): Promise> { if (!this.next) { throw new Error('No next handler set in hook handler.'); } @@ -20,7 +19,7 @@ export class HookHandler implements RequestHandler { const nextRequest = await hook.beforeRequest(request, hookParams); - const response = await this.next.handle(nextRequest); + const response = await this.next.handle(nextRequest); if (response.metadata.status < 400) { return await hook.afterResponse(nextRequest, response, hookParams); @@ -29,7 +28,29 @@ export class HookHandler implements RequestHandler { throw await hook.onError(nextRequest, response, hookParams); } - private getHookParams(_request: Request): Map { + async *stream(request: Request): AsyncGenerator> { + if (!this.next) { + throw new Error('No next handler set in hook handler.'); + } + + const hook = new TransportHookAdapter(); + + const hookParams = this.getHookParams(request); + + const nextRequest = await hook.beforeRequest(request, hookParams); + + const stream = this.next.stream(nextRequest); + + for await (const response of stream) { + if (response.metadata.status < 400) { + yield await hook.afterResponse(nextRequest, response, hookParams); + } else { + throw await hook.onError(nextRequest, response, hookParams); + } + } + } + + private getHookParams(_request: Request): Map { const hookParams: Map = new Map(); return hookParams; } diff --git a/src/http/handlers/request-validation-handler.ts b/src/http/handlers/request-validation-handler.ts index 65c761c..d9ac160 100644 --- a/src/http/handlers/request-validation-handler.ts +++ b/src/http/handlers/request-validation-handler.ts @@ -1,15 +1,30 @@ import { Request } from '../transport/request'; import { ContentType, HttpResponse, RequestHandler } from '../types'; -import { HttpError } from '../error'; export class RequestValidationHandler implements RequestHandler { next?: RequestHandler; - async handle(request: Request): Promise> { + async handle(request: Request): Promise> { if (!this.next) { throw new Error('No next handler set in ContentTypeHandler.'); } + this.validateRequest(request); + + return this.next.handle(request); + } + + async *stream(request: Request): AsyncGenerator> { + if (!this.next) { + throw new Error('No next handler set in ContentTypeHandler.'); + } + + this.validateRequest(request); + + yield* this.next.stream(request); + } + + validateRequest(request: Request): void { if (request.requestContentType === ContentType.Json) { request.body = JSON.stringify(request.requestSchema?.parse(request.body)); } else if ( @@ -19,41 +34,41 @@ export class RequestValidationHandler implements RequestHandler { ) { request.body = request.body; } else if (request.requestContentType === ContentType.FormUrlEncoded) { - request.body = this.toFormUrlEncoded(request.body); + request.body = this.toFormUrlEncoded(request); } else if (request.requestContentType === ContentType.MultipartFormData) { request.body = this.toFormData(request.body); } else { request.body = JSON.stringify(request.requestSchema?.parse(request.body)); } - - return await this.next.handle(request); } - toFormUrlEncoded(body: BodyInit | undefined): string { - if (body === undefined) { + toFormUrlEncoded(request: Request): string { + if (request.body === undefined) { return ''; } - if (typeof body === 'string') { - return body; + if (typeof request.body === 'string') { + return request.body; } - if (body instanceof URLSearchParams) { - return body.toString(); + if (request.body instanceof URLSearchParams) { + return request.body.toString(); } - if (body instanceof FormData) { + const validatedBody = request.requestSchema?.parse(request.body); + + if (validatedBody instanceof FormData) { const params = new URLSearchParams(); - body.forEach((value, key) => { + validatedBody.forEach((value, key) => { params.append(key, value.toString()); }); return params.toString(); } - if (typeof body === 'object' && !Array.isArray(body)) { + if (typeof validatedBody === 'object' && !Array.isArray(validatedBody)) { const params = new URLSearchParams(); - for (const [key, value] of Object.entries(body)) { - params.append(key, value.toString()); + for (const [key, value] of Object.entries(validatedBody)) { + params.append(key, `${value}`); } return params.toString(); } diff --git a/src/http/handlers/response-validation-handler.ts b/src/http/handlers/response-validation-handler.ts index 779c5f1..33b63eb 100644 --- a/src/http/handlers/response-validation-handler.ts +++ b/src/http/handlers/response-validation-handler.ts @@ -1,71 +1,166 @@ -import { Request } from '../transport/request'; +import { Request, ResponseDefinition } from '../transport/request'; import { ZodUndefined } from 'zod'; import { ContentType, HttpResponse, RequestHandler } from '../types'; -import { HttpError } from '../error'; +import { ResponseMatcher } from '../utils/response-matcher'; export class ResponseValidationHandler implements RequestHandler { next?: RequestHandler; - async handle(request: Request): Promise> { - const response = await this.next!.handle(request); + async handle(request: Request): Promise> { + const response = await this.next!.handle(request); - if (!this.hasContent(request, response)) { - return response; + return this.decodeBody(request, response); + } + + async *stream(request: Request): AsyncGenerator> { + const stream = this.next!.stream(request); + + for await (const response of stream) { + const responseChunks = this.splitByDataChunks(response); + for (const chunk of responseChunks) { + yield this.decodeBody(request, chunk); + } } + } - if (request.responseContentType === ContentType.Json) { - const decodedBody = new TextDecoder().decode(response.raw); - const json = JSON.parse(decodedBody); - return { - ...response, - data: this.validate(request, json), - }; - } else if ( - request.responseContentType === ContentType.Binary || - request.responseContentType === ContentType.Image - ) { - return { - ...response, - data: this.validate(request, response.raw), - }; - } else if (request.responseContentType === ContentType.Text || request.responseContentType === ContentType.Xml) { - const text = new TextDecoder().decode(response.raw); - return { - ...response, - data: this.validate(request, text), - }; - } else if (request.responseContentType === ContentType.FormUrlEncoded) { - const urlEncoded = this.fromUrlEncoded(new TextDecoder().decode(response.raw)); - return { - ...response, - data: this.validate(request, urlEncoded), - }; - } else if (request.responseContentType === ContentType.MultipartFormData) { - const formData = this.fromFormData(response.raw); - return { - ...response, - data: this.validate(request, formData), - }; - } else { - const decodedBody = new TextDecoder().decode(response.raw); - const json = JSON.parse(decodedBody); - return { + private splitByDataChunks(response: HttpResponse): HttpResponse[] { + if (!response.metadata.headers['content-type'].includes('text/event-stream')) { + return [response]; + } + + const text = new TextDecoder().decode(response.raw); + const encoder = new TextEncoder(); + return text + .split('\n') + .filter((line) => line.startsWith('data: ')) + .map((part) => ({ ...response, - data: this.validate(request, json), - }; + raw: encoder.encode(part), + })); + } + + private decodeBody(request: Request, response: HttpResponse): HttpResponse { + const responseMatcher = new ResponseMatcher(request.responses); + const responseDefinition = responseMatcher.getResponseDefinition(response); + + if (!responseDefinition || !this.hasContent(responseDefinition, response)) { + return response; + } + + const contentType = responseDefinition.contentType; + const contentTypeHandlers: { + [key: string]: (req: Request, resDef: ResponseDefinition, res: HttpResponse) => HttpResponse; + } = { + [ContentType.Binary]: this.decodeFile, + [ContentType.Image]: this.decodeFile, + [ContentType.MultipartFormData]: this.decodeMultipartFormData, + [ContentType.Text]: this.decodeText, + [ContentType.Xml]: this.decodeText, + [ContentType.FormUrlEncoded]: this.decodeFormUrlEncoded, + [ContentType.EventStream]: this.decodeEventStream, + }; + + if (contentTypeHandlers[contentType]) { + return contentTypeHandlers[contentType].call(this, request, responseDefinition, response); + } + + if (response.metadata.headers['content-type']?.includes('text/event-stream')) { + return this.decodeEventStream(request, responseDefinition, response); + } + + return this.decodeJson(request, responseDefinition, response); + } + + private decodeFile( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + return { + ...response, + data: this.validate(request, responseDefinition, response.raw), + }; + } + + private decodeMultipartFormData( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + const formData = this.fromFormData(response.raw); + return { + ...response, + data: this.validate(request, responseDefinition, formData), + }; + } + + private decodeText( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + const decodedBody = new TextDecoder().decode(response.raw); + return { + ...response, + data: this.validate(request, responseDefinition, decodedBody), + }; + } + + private decodeFormUrlEncoded( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + const decodedBody = new TextDecoder().decode(response.raw); + const urlEncoded = this.fromUrlEncoded(decodedBody); + return { + ...response, + data: this.validate(request, responseDefinition, urlEncoded), + }; + } + + private decodeEventStream( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + let decodedBody = new TextDecoder().decode(response.raw); + if (decodedBody.startsWith('data: ')) { + decodedBody = decodedBody.substring(6); } + // Note: this assumes that the content of data is a valid JSON string + const json = JSON.parse(decodedBody); + return { + ...response, + data: this.validate(request, responseDefinition, json), + }; + } + + private decodeJson( + request: Request, + responseDefinition: ResponseDefinition, + response: HttpResponse, + ): HttpResponse { + const decodedBody = new TextDecoder().decode(response.raw); + const json = JSON.parse(decodedBody); + return { + ...response, + data: this.validate(request, responseDefinition, json), + }; } - private validate(request: Request, data: any): T { + private validate(request: Request, response: ResponseDefinition, data: any): T { if (request.validation?.responseValidation) { - return request.responseSchema.parse(data); + return response.schema.parse(data); } return data; } - private hasContent(request: Request, response: HttpResponse): boolean { + private hasContent(responseDefinition: ResponseDefinition, response: HttpResponse): boolean { return ( - !!request.responseSchema && !(request.responseSchema instanceof ZodUndefined) && response.metadata.status !== 204 + !!responseDefinition.schema && + !(responseDefinition.schema instanceof ZodUndefined) && + response.metadata.status !== 204 ); } diff --git a/src/http/handlers/retry-handler.ts b/src/http/handlers/retry-handler.ts index 97bb8c7..48f6b7f 100644 --- a/src/http/handlers/retry-handler.ts +++ b/src/http/handlers/retry-handler.ts @@ -5,14 +5,34 @@ import { HttpError } from '../error'; export class RetryHandler implements RequestHandler { next?: RequestHandler; - async handle(request: Request): Promise> { + async handle(request: Request): Promise> { if (!this.next) { throw new Error('No next handler set in retry handler.'); } for (let attempt = 1; attempt <= request.retry.attempts; attempt++) { try { - return await this.next.handle(request); + return await this.next.handle(request); + } catch (error: any) { + if (!this.shouldRetry(error) || attempt === request.retry.attempts) { + throw error; + } + await this.delay(request.retry.delayMs); + } + } + + throw new Error('Error retrying request.'); + } + + async *stream(request: Request): AsyncGenerator> { + if (!this.next) { + throw new Error('No next handler set in retry handler.'); + } + + for (let attempt = 1; attempt <= request.retry.attempts; attempt++) { + try { + yield* this.next.stream(request); + return; } catch (error: any) { if (!this.shouldRetry(error) || attempt === request.retry.attempts) { throw error; diff --git a/src/http/handlers/terminating-handler.ts b/src/http/handlers/terminating-handler.ts index f7b90dd..6540e0c 100644 --- a/src/http/handlers/terminating-handler.ts +++ b/src/http/handlers/terminating-handler.ts @@ -4,7 +4,11 @@ import { HttpResponse, RequestHandler } from '../types'; import { RequestFetchAdapter } from '../transport/request-fetch-adapter'; export class TerminatingHandler implements RequestHandler { - async handle(request: Request): Promise> { - return new RequestFetchAdapter(request).send(); + async handle(request: Request): Promise> { + return new RequestFetchAdapter(request).send(); + } + + async *stream(request: Request): AsyncGenerator> { + yield* new RequestFetchAdapter(request).stream(); } } diff --git a/src/http/transport/request-builder.ts b/src/http/transport/request-builder.ts index 3d49a5a..51f0ccd 100644 --- a/src/http/transport/request-builder.ts +++ b/src/http/transport/request-builder.ts @@ -1,11 +1,11 @@ import z, { ZodType } from 'zod'; -import { Request, CreateRequestParameters, RequestParameter, RequestPagination } from './request'; +import { Request, CreateRequestParameters, RequestParameter, RequestPagination, ResponseDefinition } from './request'; import { ContentType, HttpMethod, SdkConfig, RequestConfig, RetryOptions, ValidationOptions } from '../types'; import { Environment } from '../environment'; import { SerializationStyle } from '../serialization/base-serializer'; -export class RequestBuilder { - private params: CreateRequestParameters; +export class RequestBuilder { + private params: CreateRequestParameters; constructor() { this.params = { @@ -13,10 +13,9 @@ export class RequestBuilder { method: 'GET', path: '', config: {}, - responseSchema: z.any(), + responses: [], requestSchema: z.any(), requestContentType: ContentType.Json, - responseContentType: ContentType.Json, retry: { attempts: 3, delayMs: 150, @@ -30,7 +29,7 @@ export class RequestBuilder { }; } - setRetryAttempts(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + setRetryAttempts(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { if (requestConfig?.retry?.attempts !== undefined) { this.params.retry.attempts = requestConfig.retry.attempts; } else if (sdkConfig?.retry?.attempts !== undefined) { @@ -40,7 +39,7 @@ export class RequestBuilder { return this; } - setRetryDelayMs(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + setRetryDelayMs(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { if (requestConfig?.retry?.delayMs !== undefined) { this.params.retry.delayMs = requestConfig.retry.delayMs; } else if (sdkConfig?.retry?.delayMs !== undefined) { @@ -50,7 +49,7 @@ export class RequestBuilder { return this; } - setResponseValidation(sdkConfig: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + setResponseValidation(sdkConfig: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { if (requestConfig?.validation?.responseValidation !== undefined) { this.params.validation.responseValidation = requestConfig.validation.responseValidation; } else if (sdkConfig?.validation?.responseValidation !== undefined) { @@ -60,7 +59,7 @@ export class RequestBuilder { return this; } - setBaseUrl(sdkConfig: SdkConfig): RequestBuilder { + setBaseUrl(sdkConfig: SdkConfig): RequestBuilder { if (sdkConfig?.baseUrl !== undefined) { this.params.baseUrl = sdkConfig.baseUrl; } @@ -68,54 +67,49 @@ export class RequestBuilder { return this; } - setMethod(method: HttpMethod): RequestBuilder { + setMethod(method: HttpMethod): RequestBuilder { this.params.method = method; return this; } - setPath(path: string): RequestBuilder { + setPath(path: string): RequestBuilder { this.params.path = path; return this; } - setConfig(config: SdkConfig): RequestBuilder { + setConfig(config: SdkConfig): RequestBuilder { this.params.config = config; return this; } - setRequestContentType(contentType: ContentType): RequestBuilder { + setRequestContentType(contentType: ContentType): RequestBuilder { this.params.requestContentType = contentType; return this; } - setResponseContentType(contentType: ContentType): RequestBuilder { - this.params.responseContentType = contentType; - return this; - } - - setRequestSchema(requestSchema: ZodType): RequestBuilder { + setRequestSchema(requestSchema: ZodType): RequestBuilder { this.params.requestSchema = requestSchema; return this; } - setResponseSchema(responseSchema: ZodType): RequestBuilder { - this.params.responseSchema = responseSchema; + setPagination(pagination: RequestPagination): RequestBuilder { + this.params.pagination = pagination; return this; } - setPagination(pagination: RequestPagination): RequestBuilder { - this.params.pagination = pagination; + addResponse(response: ResponseDefinition): RequestBuilder { + this.params.responses.push(response); return this; } - addBody(body?: any): RequestBuilder { + addBody(body?: any): RequestBuilder { if (body !== undefined) { this.params.body = body; } return this; } - addPathParam(param: Partial): RequestBuilder { + addPathParam(param: Partial): RequestBuilder { if (param.value === undefined || param.key === undefined) { return this; } @@ -133,7 +127,7 @@ export class RequestBuilder { return this; } - addQueryParam(param: Partial): RequestBuilder { + addQueryParam(param: Partial): RequestBuilder { if (param.value === undefined || param.key === undefined) { return this; } @@ -151,7 +145,7 @@ export class RequestBuilder { return this; } - addHeaderParam(param: Partial): RequestBuilder { + addHeaderParam(param: Partial): RequestBuilder { if (param.value === undefined || param.key === undefined) { return this; } @@ -169,7 +163,7 @@ export class RequestBuilder { return this; } - public build(): Request { - return new Request(this.params); + public build(): Request { + return new Request(this.params); } } diff --git a/src/http/transport/request-fetch-adapter.ts b/src/http/transport/request-fetch-adapter.ts index f88dd14..0db108a 100644 --- a/src/http/transport/request-fetch-adapter.ts +++ b/src/http/transport/request-fetch-adapter.ts @@ -1,15 +1,17 @@ -import { HttpMethod, HttpResponse } from '../types'; import { HttpError } from '../error'; +import { HttpMetadata, HttpMethod, HttpResponse } from '../types'; +import { LineDecoder } from '../utils/line-decoder'; import { Request } from './request'; interface HttpAdapter { send(): Promise; + stream(): AsyncGenerator; } export class RequestFetchAdapter implements HttpAdapter { private requestInit: RequestInit = {}; - constructor(private request: Request) { + constructor(private request: Request) { this.setMethod(request.method); this.setHeaders(request.getHeaders()); this.setBody(request.body); @@ -19,7 +21,7 @@ export class RequestFetchAdapter implements HttpAdapter { public async send(): Promise> { const response = await fetch(this.request.constructFullUrl(), this.requestInit); - const metadata = { + const metadata: HttpMetadata = { status: response.status, statusText: response.statusText || '', headers: this.getHeaders(response), @@ -31,7 +33,52 @@ export class RequestFetchAdapter implements HttpAdapter { }; } - private setMethod(method: HttpMethod) { + public async *stream(): AsyncGenerator> { + const response = await fetch(this.request.constructFullUrl(), this.requestInit); + + const metadata: HttpMetadata = { + status: response.status, + statusText: response.statusText || '', + headers: this.getHeaders(response), + }; + + if (response.status >= 400) { + throw new HttpError(metadata, await response.clone().arrayBuffer()); + } + + if (!response.body) { + return yield { + metadata, + raw: await response.clone().arrayBuffer(), + }; + } + + const reader = response.body.getReader(); + const lineDecoder = new LineDecoder(); + + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + + for (const line of lineDecoder.splitLines(value)) { + yield { + metadata, + raw: line, + }; + } + } + + for (const line of lineDecoder.flush()) { + yield { + metadata, + raw: line, + }; + } + } + + private setMethod(method: HttpMethod): void { if (!method) { return; } @@ -41,7 +88,7 @@ export class RequestFetchAdapter implements HttpAdapter { }; } - private setBody(body: ReadableStream | null) { + private setBody(body: ReadableStream | null): void { if (!body) { return; } @@ -51,7 +98,7 @@ export class RequestFetchAdapter implements HttpAdapter { }; } - private setHeaders(headers: HeadersInit | undefined) { + private setHeaders(headers: HeadersInit | undefined): void { if (!headers) { return; } @@ -62,7 +109,7 @@ export class RequestFetchAdapter implements HttpAdapter { }; } - private setTimeout(timeoutMs: number | undefined) { + private setTimeout(timeoutMs: number | undefined): void { if (!timeoutMs) { return; } diff --git a/src/http/transport/request.ts b/src/http/transport/request.ts index 3baa842..d7dc759 100644 --- a/src/http/transport/request.ts +++ b/src/http/transport/request.ts @@ -6,7 +6,13 @@ import { HeaderSerializer } from '../serialization/header-serializer'; import { HttpRequest } from '../hooks/hook'; import { SerializationStyle } from '../serialization/base-serializer'; -export interface CreateRequestParameters { +export interface ResponseDefinition { + schema: ZodType; + contentType: ContentType; + status: number; +} + +export interface CreateRequestParameters { baseUrl: string; method: HttpMethod; body?: any; @@ -15,10 +21,9 @@ export interface CreateRequestParameters { pathParams: Map; path: string; config: SdkConfig; - responseSchema: ZodType; + responses: ResponseDefinition[]; requestSchema: ZodType; requestContentType: ContentType; - responseContentType: ContentType; validation: ValidationOptions; retry: RetryOptions; pagination?: RequestPagination; @@ -40,7 +45,7 @@ export interface RequestPagination { pageSchema?: ZodType; } -export class Request { +export class Request { public baseUrl: string = ''; public headers: Map = new Map(); @@ -57,14 +62,12 @@ export class Request { public config: SdkConfig; - public responseSchema: ZodType; + public responses: ResponseDefinition[]; public requestSchema: ZodType; public requestContentType: ContentType; - public responseContentType: ContentType; - public validation: ValidationOptions = {} as any; public retry: RetryOptions = {} as any; @@ -73,7 +76,7 @@ export class Request { private readonly pathPattern: string; - constructor(params: CreateRequestParameters) { + constructor(params: CreateRequestParameters) { this.baseUrl = params.baseUrl; this.method = params.method; this.pathPattern = params.path; @@ -83,10 +86,9 @@ export class Request { this.pathParams = params.pathParams; this.headers = params.headers; this.queryParams = params.queryParams; - this.responseSchema = params.responseSchema; + this.responses = params.responses; this.requestSchema = params.requestSchema; this.requestContentType = params.requestContentType; - this.responseContentType = params.responseContentType; this.retry = params.retry; this.validation = params.validation; this.pagination = params.pagination; @@ -170,11 +172,13 @@ export class Request { public constructFullUrl(): string { const queryString = new QuerySerializer().serialize(this.queryParams); const path = this.constructPath(); - return `${this.baseUrl}${path}${queryString}`; + let baseUrl = this.baseUrl; + + return `${baseUrl}${path}${queryString}`; } - public copy(overrides?: Partial>) { - const createRequestParams: CreateRequestParameters = { + public copy(overrides?: Partial) { + const createRequestParams: CreateRequestParameters = { baseUrl: overrides?.baseUrl ?? this.baseUrl, method: overrides?.method ?? this.method, path: overrides?.path ?? this.path, @@ -183,14 +187,13 @@ export class Request { pathParams: overrides?.pathParams ?? this.pathParams, queryParams: overrides?.queryParams ?? this.queryParams, headers: overrides?.headers ?? this.headers, - responseSchema: overrides?.responseSchema ?? this.responseSchema, + responses: overrides?.responses ?? this.responses, requestSchema: overrides?.requestSchema ?? this.requestSchema, requestContentType: overrides?.requestContentType ?? this.requestContentType, - responseContentType: overrides?.responseContentType ?? this.responseContentType, retry: overrides?.retry ?? this.retry, validation: overrides?.validation ?? this.validation, }; - return new Request({ + return new Request({ ...createRequestParams, ...overrides, }); @@ -204,7 +207,7 @@ export class Request { return new HeaderSerializer().serialize(this.headers); } - public nextPage() { + public nextPage(): void { if (!this.pagination) { return; } @@ -229,15 +232,15 @@ export class Request { private getAllParams(): RequestParameter[] { const allParams: RequestParameter[] = []; - this.headers.forEach((val, key) => { + this.headers.forEach((val, _) => { allParams.push(val); }); - this.queryParams.forEach((val, key) => { + this.queryParams.forEach((val, _) => { allParams.push(val); }); - this.pathParams.forEach((val, key) => { + this.pathParams.forEach((val, _) => { allParams.push(val); }); diff --git a/src/http/transport/transport-hook-adapter.ts b/src/http/transport/transport-hook-adapter.ts index 91c13d9..b2091fa 100644 --- a/src/http/transport/transport-hook-adapter.ts +++ b/src/http/transport/transport-hook-adapter.ts @@ -7,7 +7,7 @@ import { Request, RequestParameter } from './request'; export class TransportHookAdapter { private hook: CustomHook = new CustomHook(); - public async beforeRequest(request: Request, params: Map): Promise> { + public async beforeRequest(request: Request, params: Map): Promise { const hookRequest = this.requestToHookRequest(request); const newRequest = await this.hook.beforeRequest(hookRequest, params); @@ -26,7 +26,7 @@ export class TransportHookAdapter { } public async afterResponse( - request: Request, + request: Request, response: HttpResponse, params: Map, ): Promise> { @@ -34,16 +34,12 @@ export class TransportHookAdapter { return this.hook.afterResponse(hookRequest, response, params); } - public async onError( - request: Request, - response: HttpResponse, - params: Map, - ): Promise { + public async onError(request: Request, response: HttpResponse, params: Map): Promise { const hookRequest = this.requestToHookRequest(request); return this.hook.onError(hookRequest, response, params); } - private requestToHookRequest(request: Request): HttpRequest { + private requestToHookRequest(request: Request): HttpRequest { const hookHeaders: Map = new Map(); request.headers.forEach((header, key) => { hookHeaders.set(key, header.value); diff --git a/src/http/types.ts b/src/http/types.ts index 7947fa9..4bf376b 100644 --- a/src/http/types.ts +++ b/src/http/types.ts @@ -29,7 +29,8 @@ export interface HttpResponse { export interface RequestHandler { next?: RequestHandler; - handle(request: Request): Promise>; + handle(request: Request): Promise>; + stream(request: Request): AsyncGenerator>; } export enum ContentType { @@ -42,6 +43,8 @@ export enum ContentType { FormUrlEncoded = 'form', Text = 'text', MultipartFormData = 'multipartFormData', + EventStream = 'eventStream', + NoContent = 'noContent', } export interface Options { diff --git a/src/http/utils/line-decoder.ts b/src/http/utils/line-decoder.ts new file mode 100644 index 0000000..822414b --- /dev/null +++ b/src/http/utils/line-decoder.ts @@ -0,0 +1,35 @@ +export class LineDecoder { + private lineBuffer = ''; + private decoder = new TextDecoder(); + private encoder = new TextEncoder(); + + /** + * Splits the given chunk into lines. + * Stores incomplete lines in a buffer and returns them when the next chunk arrives. + */ + public splitLines(chunk: Uint8Array): Uint8Array[] { + this.lineBuffer += this.decoder.decode(chunk); + + let lineEndIndex; + const lines: Uint8Array[] = []; + while ((lineEndIndex = this.lineBuffer.indexOf('\n')) >= 0) { + const line = this.lineBuffer.slice(0, lineEndIndex + 1); // Include the newline character + this.lineBuffer = this.lineBuffer.slice(lineEndIndex + 1); + if (line.length > 1) { + lines.push(this.encoder.encode(line)); + } + } + + return lines; + } + + /** Returns the remaining lines in the buffer. */ + public flush(): Uint8Array[] { + if (this.lineBuffer.length === 0) { + return []; + } + const lines = [this.encoder.encode(this.lineBuffer)]; + this.lineBuffer = ''; + return lines; + } +} diff --git a/src/http/utils/response-matcher.ts b/src/http/utils/response-matcher.ts new file mode 100644 index 0000000..4949c86 --- /dev/null +++ b/src/http/utils/response-matcher.ts @@ -0,0 +1,56 @@ +import { ResponseDefinition } from '../transport/request'; +import { ContentType, HttpResponse } from '../types'; + +export class ResponseMatcher { + constructor(private responses: ResponseDefinition[]) {} + + public getResponseDefinition(response: HttpResponse): ResponseDefinition | undefined { + const rawContentType = response.metadata.headers['content-type']?.toLocaleLowerCase() || ''; + const contentType = this.getContentTypeDefinition(rawContentType); + const statusCode = response.metadata.status; + + if (!this.responses.length) { + return; + } + + if (this.responses.length === 1) { + return this.responses[0]; + } + + return this.responses.find((response) => { + return response.contentType === contentType && response.status === statusCode; + }); + } + + private getContentTypeDefinition(contentType: string): ContentType { + if (contentType.startsWith('application/') && contentType.includes('xml')) { + return ContentType.Xml; + } + + if (contentType.toLowerCase() === 'application/x-www-form-urlencoded') { + return ContentType.FormUrlEncoded; + } + + if (contentType.toLowerCase() === 'text/event-stream') { + return ContentType.EventStream; + } + + if (contentType.toLowerCase().startsWith('text/')) { + return ContentType.Text; + } + + if (contentType.toLowerCase().startsWith('image/')) { + return ContentType.Image; + } + + if (contentType.toLowerCase() === 'application/octet-stream') { + return ContentType.Binary; + } + + if (contentType.toLowerCase() === 'application/json') { + return ContentType.Json; + } + + return ContentType.Json; + } +} diff --git a/src/index.ts b/src/index.ts index 38356e0..6dcf637 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { Environment } from './http/environment'; import { SdkConfig } from './http/types'; import { ContainerGroupsService } from './services/container-groups'; import { WorkloadErrorsService } from './services/workload-errors'; +import { SystemLogsService } from './services/system-logs'; import { QueuesService } from './services/queues'; import { QuotasService } from './services/quotas'; import { InferenceEndpointsService } from './services/inference-endpoints'; @@ -10,6 +11,7 @@ import { WebhookSecretKeyService } from './services/webhook-secret-key'; export * from './services/container-groups'; export * from './services/workload-errors'; +export * from './services/system-logs'; export * from './services/queues'; export * from './services/quotas'; export * from './services/inference-endpoints'; @@ -24,6 +26,8 @@ export class SaladCloudSdk { public readonly workloadErrors: WorkloadErrorsService; + public readonly systemLogs: SystemLogsService; + public readonly queues: QueuesService; public readonly quotas: QuotasService; @@ -44,6 +48,8 @@ export class SaladCloudSdk { this.workloadErrors = new WorkloadErrorsService(this.config); + this.systemLogs = new SystemLogsService(this.config); + this.queues = new QueuesService(this.config); this.quotas = new QuotasService(this.config); @@ -58,6 +64,7 @@ export class SaladCloudSdk { set baseUrl(baseUrl: string) { this.containerGroups.baseUrl = baseUrl; this.workloadErrors.baseUrl = baseUrl; + this.systemLogs.baseUrl = baseUrl; this.queues.baseUrl = baseUrl; this.quotas.baseUrl = baseUrl; this.inferenceEndpoints.baseUrl = baseUrl; @@ -68,6 +75,7 @@ export class SaladCloudSdk { set environment(environment: Environment) { this.containerGroups.baseUrl = environment; this.workloadErrors.baseUrl = environment; + this.systemLogs.baseUrl = environment; this.queues.baseUrl = environment; this.quotas.baseUrl = environment; this.inferenceEndpoints.baseUrl = environment; @@ -78,6 +86,7 @@ export class SaladCloudSdk { set timeoutMs(timeoutMs: number) { this.containerGroups.timeoutMs = timeoutMs; this.workloadErrors.timeoutMs = timeoutMs; + this.systemLogs.timeoutMs = timeoutMs; this.queues.timeoutMs = timeoutMs; this.quotas.timeoutMs = timeoutMs; this.inferenceEndpoints.timeoutMs = timeoutMs; @@ -88,6 +97,7 @@ export class SaladCloudSdk { set apiKey(apiKey: string) { this.containerGroups.apiKey = apiKey; this.workloadErrors.apiKey = apiKey; + this.systemLogs.apiKey = apiKey; this.queues.apiKey = apiKey; this.quotas.apiKey = apiKey; this.inferenceEndpoints.apiKey = apiKey; @@ -98,6 +108,7 @@ export class SaladCloudSdk { set apiKeyHeader(apiKeyHeader: string) { this.containerGroups.apiKeyHeader = apiKeyHeader; this.workloadErrors.apiKeyHeader = apiKeyHeader; + this.systemLogs.apiKeyHeader = apiKeyHeader; this.queues.apiKeyHeader = apiKeyHeader; this.quotas.apiKeyHeader = apiKeyHeader; this.inferenceEndpoints.apiKeyHeader = apiKeyHeader; diff --git a/src/services/common/container-group-networking-load-balancer.ts b/src/services/common/container-group-networking-load-balancer.ts index bad2778..a2bb653 100644 --- a/src/services/common/container-group-networking-load-balancer.ts +++ b/src/services/common/container-group-networking-load-balancer.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; export enum ContainerGroupNetworkingLoadBalancer { - ROUNDROBIN = 'round_robin', - LEASTNUMBEROFCONNECTIONS = 'least_number_of_connections', + ROUND_ROBIN = 'round_robin', + LEAST_NUMBER_OF_CONNECTIONS = 'least_number_of_connections', } diff --git a/src/services/common/container-restart-policy.ts b/src/services/common/container-restart-policy.ts index 6f4212b..3459582 100644 --- a/src/services/common/container-restart-policy.ts +++ b/src/services/common/container-restart-policy.ts @@ -2,6 +2,6 @@ import { z } from 'zod'; export enum ContainerRestartPolicy { ALWAYS = 'always', - ONFAILURE = 'on_failure', + ON_FAILURE = 'on_failure', NEVER = 'never', } diff --git a/src/services/common/http-format-1.ts b/src/services/common/http-format-1.ts index 32cb0ad..ca57867 100644 --- a/src/services/common/http-format-1.ts +++ b/src/services/common/http-format-1.ts @@ -2,5 +2,5 @@ import { z } from 'zod'; export enum HttpFormat1 { JSON = 'json', - JSONLINES = 'json_lines', + JSON_LINES = 'json_lines', } diff --git a/src/services/common/queue-autoscaler.ts b/src/services/common/queue-autoscaler.ts index 1819fdf..28d71d1 100644 --- a/src/services/common/queue-autoscaler.ts +++ b/src/services/common/queue-autoscaler.ts @@ -17,12 +17,12 @@ export const queueAutoscaler = z.lazy(() => { /** * Represents the autoscaling rules for a queue * @typedef {QueueAutoscaler} queueAutoscaler - Represents the autoscaling rules for a queue - Represents the autoscaling rules for a queue + * @property {number} - The minimum number of instances the container can scale down to + * @property {number} - The maximum number of instances the container can scale up to * @property {number} - * @property {number} - * @property {number} - * @property {number} - * @property {number} - * @property {number} + * @property {number} - The period (in seconds) in which the queue checks the formula + * @property {number} - The maximum number of instances that can be added per minute + * @property {number} - The maximum number of instances that can be removed per minute */ export type QueueAutoscaler = z.infer; diff --git a/src/services/container-groups/container-groups.ts b/src/services/container-groups/container-groups.ts index 78daa68..49ab363 100644 --- a/src/services/container-groups/container-groups.ts +++ b/src/services/container-groups/container-groups.ts @@ -22,15 +22,18 @@ export class ContainerGroupsService extends BaseService { projectName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/containers') .setRequestSchema(z.any()) - .setResponseSchema(containerGroupListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -58,15 +61,18 @@ export class ContainerGroupsService extends BaseService { body: CreateContainerGroup, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/projects/{project_name}/containers') .setRequestSchema(createContainerGroupRequest) - .setResponseSchema(containerGroupResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupResponse, + contentType: ContentType.Json, + status: 201, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -97,15 +103,18 @@ export class ContainerGroupsService extends BaseService { containerGroupName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') .setRequestSchema(z.any()) - .setResponseSchema(containerGroupResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -139,15 +148,18 @@ export class ContainerGroupsService extends BaseService { body: UpdateContainerGroup, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('PATCH') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') .setRequestSchema(updateContainerGroupRequest) - .setResponseSchema(containerGroupResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -181,16 +193,19 @@ export class ContainerGroupsService extends BaseService { projectName: string, containerGroupName: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('DELETE') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -207,7 +222,7 @@ export class ContainerGroupsService extends BaseService { value: containerGroupName, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -222,16 +237,19 @@ export class ContainerGroupsService extends BaseService { projectName: string, containerGroupName: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/start') .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -248,7 +266,7 @@ export class ContainerGroupsService extends BaseService { value: containerGroupName, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -263,16 +281,19 @@ export class ContainerGroupsService extends BaseService { projectName: string, containerGroupName: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/stop') .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -289,7 +310,7 @@ export class ContainerGroupsService extends BaseService { value: containerGroupName, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -305,15 +326,18 @@ export class ContainerGroupsService extends BaseService { containerGroupName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances') .setRequestSchema(z.any()) - .setResponseSchema(containerGroupInstancesResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupInstancesResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -348,7 +372,7 @@ export class ContainerGroupsService extends BaseService { containerGroupInstanceId: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') @@ -356,9 +380,12 @@ export class ContainerGroupsService extends BaseService { '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}', ) .setRequestSchema(z.any()) - .setResponseSchema(containerGroupInstanceResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: containerGroupInstanceResponse, + contentType: ContentType.Json, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -396,8 +423,8 @@ export class ContainerGroupsService extends BaseService { containerGroupName: string, containerGroupInstanceId: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') @@ -405,9 +432,12 @@ export class ContainerGroupsService extends BaseService { '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/reallocate', ) .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -428,7 +458,7 @@ export class ContainerGroupsService extends BaseService { value: containerGroupInstanceId, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -445,8 +475,8 @@ export class ContainerGroupsService extends BaseService { containerGroupName: string, containerGroupInstanceId: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') @@ -454,9 +484,12 @@ export class ContainerGroupsService extends BaseService { '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/recreate', ) .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -477,7 +510,7 @@ export class ContainerGroupsService extends BaseService { value: containerGroupInstanceId, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -494,8 +527,8 @@ export class ContainerGroupsService extends BaseService { containerGroupName: string, containerGroupInstanceId: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') @@ -503,9 +536,12 @@ export class ContainerGroupsService extends BaseService { '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/restart', ) .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -526,6 +562,6 @@ export class ContainerGroupsService extends BaseService { value: containerGroupInstanceId, }) .build(); - return this.client.call(request); + return this.client.call(request); } } diff --git a/src/services/container-groups/models/create-container-group-networking-load-balancer.ts b/src/services/container-groups/models/create-container-group-networking-load-balancer.ts index 54a3e7a..4c45684 100644 --- a/src/services/container-groups/models/create-container-group-networking-load-balancer.ts +++ b/src/services/container-groups/models/create-container-group-networking-load-balancer.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; export enum CreateContainerGroupNetworkingLoadBalancer { - ROUNDROBIN = 'round_robin', - LEASTNUMBEROFCONNECTIONS = 'least_number_of_connections', + ROUND_ROBIN = 'round_robin', + LEAST_NUMBER_OF_CONNECTIONS = 'least_number_of_connections', } diff --git a/src/services/container-groups/models/http-format-2.ts b/src/services/container-groups/models/http-format-2.ts index a9aab98..7cfa137 100644 --- a/src/services/container-groups/models/http-format-2.ts +++ b/src/services/container-groups/models/http-format-2.ts @@ -2,5 +2,5 @@ import { z } from 'zod'; export enum HttpFormat2 { JSON = 'json', - JSONLINES = 'json_lines', + JSON_LINES = 'json_lines', } diff --git a/src/services/container-groups/models/http-format-3.ts b/src/services/container-groups/models/http-format-3.ts index 6db9a36..c05a4e0 100644 --- a/src/services/container-groups/models/http-format-3.ts +++ b/src/services/container-groups/models/http-format-3.ts @@ -2,5 +2,5 @@ import { z } from 'zod'; export enum HttpFormat3 { JSON = 'json', - JSONLINES = 'json_lines', + JSON_LINES = 'json_lines', } diff --git a/src/services/container-groups/models/resources.ts b/src/services/container-groups/models/resources.ts index 5b31a64..c0729f9 100644 --- a/src/services/container-groups/models/resources.ts +++ b/src/services/container-groups/models/resources.ts @@ -6,7 +6,7 @@ import { z } from 'zod'; export const resources = z.lazy(() => { return z.object({ cpu: z.number().gte(1).lte(16).optional().nullable(), - memory: z.number().gte(1024).lte(30720).optional().nullable(), + memory: z.number().gte(1024).lte(61440).optional().nullable(), gpuClasses: z.array(z.string()).optional().nullable(), storageAmount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), }); @@ -30,7 +30,7 @@ export const resourcesResponse = z.lazy(() => { return z .object({ cpu: z.number().gte(1).lte(16).optional().nullable(), - memory: z.number().gte(1024).lte(30720).optional().nullable(), + memory: z.number().gte(1024).lte(61440).optional().nullable(), gpu_classes: z.array(z.string()).optional().nullable(), storage_amount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), }) diff --git a/src/services/inference-endpoints/inference-endpoints.ts b/src/services/inference-endpoints/inference-endpoints.ts index 84cc0e4..26a1cdf 100644 --- a/src/services/inference-endpoints/inference-endpoints.ts +++ b/src/services/inference-endpoints/inference-endpoints.ts @@ -23,15 +23,18 @@ export class InferenceEndpointsService extends BaseService { params?: ListInferenceEndpointsParams, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/inference-endpoints') .setRequestSchema(z.any()) - .setResponseSchema(inferenceEndpointsListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: inferenceEndpointsListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -62,15 +65,18 @@ export class InferenceEndpointsService extends BaseService { inferenceEndpointName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}') .setRequestSchema(z.any()) - .setResponseSchema(inferenceEndpointResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: inferenceEndpointResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -100,15 +106,18 @@ export class InferenceEndpointsService extends BaseService { params?: GetInferenceEndpointJobsParams, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs') .setRequestSchema(z.any()) - .setResponseSchema(inferenceEndpointJobListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: inferenceEndpointJobListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -144,15 +153,18 @@ export class InferenceEndpointsService extends BaseService { body: CreateInferenceEndpointJob, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs') .setRequestSchema(createInferenceEndpointJobRequest) - .setResponseSchema(inferenceEndpointJobResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: inferenceEndpointJobResponse, + contentType: ContentType.Json, + status: 201, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -183,7 +195,7 @@ export class InferenceEndpointsService extends BaseService { inferenceEndpointJobId: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') @@ -191,9 +203,12 @@ export class InferenceEndpointsService extends BaseService { '/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}', ) .setRequestSchema(z.any()) - .setResponseSchema(inferenceEndpointJobResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: inferenceEndpointJobResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -225,8 +240,8 @@ export class InferenceEndpointsService extends BaseService { inferenceEndpointName: string, inferenceEndpointJobId: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('DELETE') @@ -234,9 +249,12 @@ export class InferenceEndpointsService extends BaseService { '/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}', ) .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -253,6 +271,6 @@ export class InferenceEndpointsService extends BaseService { value: inferenceEndpointJobId, }) .build(); - return this.client.call(request); + return this.client.call(request); } } diff --git a/src/services/inference-endpoints/models/create-inference-endpoint-job.ts b/src/services/inference-endpoints/models/create-inference-endpoint-job.ts index e89be0f..a69e550 100644 --- a/src/services/inference-endpoints/models/create-inference-endpoint-job.ts +++ b/src/services/inference-endpoints/models/create-inference-endpoint-job.ts @@ -7,7 +7,7 @@ export const createInferenceEndpointJob = z.lazy(() => { return z.object({ input: z.any(), metadata: z.any().optional().nullable(), - webhook: z.string().optional().nullable(), + webhook: z.string().max(2000).optional().nullable(), }); }); @@ -29,7 +29,7 @@ export const createInferenceEndpointJobResponse = z.lazy(() => { .object({ input: z.any(), metadata: z.any().optional().nullable(), - webhook: z.string().optional().nullable(), + webhook: z.string().max(2000).optional().nullable(), }) .transform((data) => ({ input: data['input'], diff --git a/src/services/organization-data/organization-data.ts b/src/services/organization-data/organization-data.ts index 6366d28..f5a1ace 100644 --- a/src/services/organization-data/organization-data.ts +++ b/src/services/organization-data/organization-data.ts @@ -12,15 +12,18 @@ export class OrganizationDataService extends BaseService { * @returns {Promise>} OK */ async listGpuClasses(organizationName: string, requestConfig?: RequestConfig): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/gpu-classes') .setRequestSchema(z.any()) - .setResponseSchema(gpuClassesListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: gpuClassesListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) diff --git a/src/services/queues/queues.ts b/src/services/queues/queues.ts index a8dde88..b08b873 100644 --- a/src/services/queues/queues.ts +++ b/src/services/queues/queues.ts @@ -24,15 +24,18 @@ export class QueuesService extends BaseService { projectName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/queues') .setRequestSchema(z.any()) - .setResponseSchema(queueListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -60,15 +63,18 @@ export class QueuesService extends BaseService { body: CreateQueue, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/projects/{project_name}/queues') .setRequestSchema(createQueueRequest) - .setResponseSchema(queueResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueResponse, + contentType: ContentType.Json, + status: 201, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -99,15 +105,18 @@ export class QueuesService extends BaseService { queueName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') .setRequestSchema(z.any()) - .setResponseSchema(queueResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -141,15 +150,18 @@ export class QueuesService extends BaseService { body: UpdateQueue, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('PATCH') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') .setRequestSchema(updateQueueRequest) - .setResponseSchema(queueResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -183,16 +195,19 @@ export class QueuesService extends BaseService { projectName: string, queueName: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('DELETE') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -209,7 +224,7 @@ export class QueuesService extends BaseService { value: queueName, }) .build(); - return this.client.call(request); + return this.client.call(request); } /** @@ -228,15 +243,18 @@ export class QueuesService extends BaseService { params?: ListQueueJobsParams, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs') .setRequestSchema(z.any()) - .setResponseSchema(queueJobListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueJobListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -278,15 +296,18 @@ export class QueuesService extends BaseService { body: CreateQueueJob, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs') .setRequestSchema(createQueueJobRequest) - .setResponseSchema(queueJobResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueJobResponse, + contentType: ContentType.Json, + status: 201, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -323,15 +344,18 @@ export class QueuesService extends BaseService { queueJobId: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}') .setRequestSchema(z.any()) - .setResponseSchema(queueJobResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: queueJobResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -369,16 +393,19 @@ export class QueuesService extends BaseService { queueName: string, queueJobId: string, requestConfig?: RequestConfig, - ): Promise> { - const request = new RequestBuilder() + ): Promise> { + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('DELETE') .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}') .setRequestSchema(z.any()) - .setResponseSchema(z.undefined()) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: z.undefined(), + contentType: ContentType.NoContent, + status: 202, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -399,6 +426,6 @@ export class QueuesService extends BaseService { value: queueJobId, }) .build(); - return this.client.call(request); + return this.client.call(request); } } diff --git a/src/services/quotas/quotas.ts b/src/services/quotas/quotas.ts index ec65785..40de453 100644 --- a/src/services/quotas/quotas.ts +++ b/src/services/quotas/quotas.ts @@ -12,15 +12,18 @@ export class QuotasService extends BaseService { * @returns {Promise>} OK */ async getQuotas(organizationName: string, requestConfig?: RequestConfig): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/quotas') .setRequestSchema(z.any()) - .setResponseSchema(quotasResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: quotasResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) diff --git a/src/services/system-logs/index.ts b/src/services/system-logs/index.ts new file mode 100644 index 0000000..82369a2 --- /dev/null +++ b/src/services/system-logs/index.ts @@ -0,0 +1,2 @@ +export { SystemLogsService } from './system-logs'; +export * from './models'; diff --git a/src/services/system-logs/models/index.ts b/src/services/system-logs/models/index.ts new file mode 100644 index 0000000..c0ff51a --- /dev/null +++ b/src/services/system-logs/models/index.ts @@ -0,0 +1,2 @@ +export type { SystemLogList } from './system-log-list'; +export type { SystemLog } from './system-log'; diff --git a/src/services/system-logs/models/system-log-list.ts b/src/services/system-logs/models/system-log-list.ts new file mode 100644 index 0000000..e974dc4 --- /dev/null +++ b/src/services/system-logs/models/system-log-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { systemLog, systemLogRequest, systemLogResponse } from './system-log'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const systemLogList = z.lazy(() => { + return z.object({ + items: z.array(systemLog).max(50), + }); +}); + +/** + * Represents a list of system logs + * @typedef {SystemLogList} systemLogList - Represents a list of system logs - Represents a list of system logs + * @property {SystemLog[]} + */ +export type SystemLogList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const systemLogListResponse = z.lazy(() => { + return z + .object({ + items: z.array(systemLogResponse).max(50), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const systemLogListRequest = z.lazy(() => { + return z.object({ items: z.array(systemLogRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/system-logs/models/system-log.ts b/src/services/system-logs/models/system-log.ts new file mode 100644 index 0000000..8c27071 --- /dev/null +++ b/src/services/system-logs/models/system-log.ts @@ -0,0 +1,93 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const systemLog = z.lazy(() => { + return z.object({ + eventName: z.string(), + eventTime: z.string(), + instanceId: z.string().optional(), + machineId: z.string().optional(), + version: z.string(), + resourceCpu: z.number().gte(1).lte(16).nullable(), + resourceMemory: z.number().gte(1024).lte(61440).nullable(), + resourceGpuClass: z.string(), + resourceStorageAmount: z.number().gte(1073741824).lte(53687091200).nullable(), + }); +}); + +/** + * Represents a system log + * @typedef {SystemLog} systemLog - Represents a system log - Represents a system log + * @property {string} - The name of the event + * @property {string} - The UTC date & time when the log item was created + * @property {string} - The unique instance ID + * @property {string} - The organization-specific machine ID + * @property {string} - The version instance ID + * @property {number} - The number of CPUs + * @property {number} - The memory amount in MB + * @property {string} - The GPU class name + * @property {number} - The storage amount in bytes + */ +export type SystemLog = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const systemLogResponse = z.lazy(() => { + return z + .object({ + event_name: z.string(), + event_time: z.string(), + instance_id: z.string().optional(), + machine_id: z.string().optional(), + version: z.string(), + resource_cpu: z.number().gte(1).lte(16).nullable(), + resource_memory: z.number().gte(1024).lte(61440).nullable(), + resource_gpu_class: z.string(), + resource_storage_amount: z.number().gte(1073741824).lte(53687091200).nullable(), + }) + .transform((data) => ({ + eventName: data['event_name'], + eventTime: data['event_time'], + instanceId: data['instance_id'], + machineId: data['machine_id'], + version: data['version'], + resourceCpu: data['resource_cpu'], + resourceMemory: data['resource_memory'], + resourceGpuClass: data['resource_gpu_class'], + resourceStorageAmount: data['resource_storage_amount'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const systemLogRequest = z.lazy(() => { + return z + .object({ + eventName: z.string().nullish(), + eventTime: z.string().nullish(), + instanceId: z.string().nullish(), + machineId: z.string().nullish(), + version: z.string().nullish(), + resourceCpu: z.number().nullish(), + resourceMemory: z.number().nullish(), + resourceGpuClass: z.string().nullish(), + resourceStorageAmount: z.number().nullish(), + }) + .transform((data) => ({ + event_name: data['eventName'], + event_time: data['eventTime'], + instance_id: data['instanceId'], + machine_id: data['machineId'], + version: data['version'], + resource_cpu: data['resourceCpu'], + resource_memory: data['resourceMemory'], + resource_gpu_class: data['resourceGpuClass'], + resource_storage_amount: data['resourceStorageAmount'], + })); +}); diff --git a/src/services/system-logs/system-logs.ts b/src/services/system-logs/system-logs.ts new file mode 100644 index 0000000..13aaf55 --- /dev/null +++ b/src/services/system-logs/system-logs.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { SystemLogList, systemLogListResponse } from './models/system-log-list'; + +export class SystemLogsService extends BaseService { + /** + * Gets the System Logs + * @param {string} organizationName - Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization. + * @param {string} projectName - Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API. + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} OK + */ + async getSystemLogs( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setBaseUrl(this.config) + .setConfig(this.config) + .setMethod('GET') + .setPath( + '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/system-logs', + ) + .setRequestSchema(z.any()) + .setRequestContentType(ContentType.Json) + .addResponse({ + schema: systemLogListResponse, + contentType: ContentType.Json, + status: 200, + }) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/webhook-secret-key/webhook-secret-key.ts b/src/services/webhook-secret-key/webhook-secret-key.ts index c99b60c..9d9ddf5 100644 --- a/src/services/webhook-secret-key/webhook-secret-key.ts +++ b/src/services/webhook-secret-key/webhook-secret-key.ts @@ -15,15 +15,18 @@ export class WebhookSecretKeyService extends BaseService { organizationName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/webhook-secret-key') .setRequestSchema(z.any()) - .setResponseSchema(webhookSecretKeyResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: webhookSecretKeyResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) @@ -44,15 +47,18 @@ export class WebhookSecretKeyService extends BaseService { organizationName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('POST') .setPath('/organizations/{organization_name}/webhook-secret-key') .setRequestSchema(z.any()) - .setResponseSchema(webhookSecretKeyResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: webhookSecretKeyResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) diff --git a/src/services/workload-errors/workload-errors.ts b/src/services/workload-errors/workload-errors.ts index d4e60b3..e8ff818 100644 --- a/src/services/workload-errors/workload-errors.ts +++ b/src/services/workload-errors/workload-errors.ts @@ -7,7 +7,7 @@ import { WorkloadErrorList, workloadErrorListResponse } from './models/workload- export class WorkloadErrorsService extends BaseService { /** - * Gets the workload errors + * Gets the workload errors. This has been deprecated and will be replaced by the new System Logs endpoint. See `/system-logs`. * @param {string} organizationName - Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization. * @param {string} projectName - Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API. * @param {string} containerGroupName - The unique container group name @@ -19,15 +19,18 @@ export class WorkloadErrorsService extends BaseService { containerGroupName: string, requestConfig?: RequestConfig, ): Promise> { - const request = new RequestBuilder() + const request = new RequestBuilder() .setBaseUrl(this.config) .setConfig(this.config) .setMethod('GET') .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/errors') .setRequestSchema(z.any()) - .setResponseSchema(workloadErrorListResponse) .setRequestContentType(ContentType.Json) - .setResponseContentType(ContentType.Json) + .addResponse({ + schema: workloadErrorListResponse, + contentType: ContentType.Json, + status: 200, + }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig)