salad-cloud-sdk 0.9.0a16
The SaladCloud REST API. Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details.
License: MIT
Requires Python: >=3.9

# SaladCloudSdk Python SDK 0.9.0a16<a id="saladcloudsdk-python-sdk-090a16"></a>

Welcome to the SaladCloudSdk SDK documentation. This guide will help you get started with integrating and using the SaladCloudSdk SDK in your project.

[![This SDK was generated by liblab](https://raw.githubusercontent.com/liblaber/liblab-assets/main/assets/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme)

## Versions<a id="versions"></a>

- API version: `0.9.0-alpha.16`
- SDK version: `0.9.0a16`

## About the API<a id="about-the-api"></a>

The SaladCloud REST API. Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details.

## Table of Contents<a id="table-of-contents"></a>

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Authentication](#authentication)
  - [API Key Authentication](#api-key-authentication)
- [Setting a Custom Timeout](#setting-a-custom-timeout)
- [Sample Usage](#sample-usage)
- [Services](#services)
- [Models](#models)
- [License](#license)

# Setup & Configuration<a id="setup--configuration"></a>

## Supported Language Versions<a id="supported-language-versions"></a>

This SDK is compatible with the following versions: `Python >= 3.7`

## Installation<a id="installation"></a>

To get started with the SDK, we recommend installing using `pip`:

```bash
pip install salad-cloud-sdk
```

If you are using Python 3, you can use `pip3` instead:

```bash
pip3 install salad-cloud-sdk
```

## Authentication<a id="authentication"></a>

### API Key Authentication<a id="api-key-authentication"></a>

The SaladCloudSdk API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API.

#### Setting the API key<a id="setting-the-api-key"></a>

When you initialize the SDK, you can set the API key as follows:

```py
SaladCloudSdk(
    api_key="YOUR_API_KEY",
    api_key_header="YOUR_API_KEY_HEADER",
    timeout=10000
)
```

If you need to set or update the API key after initializing the SDK, you can use:

```py
sdk.set_api_key("YOUR_API_KEY", "YOUR_API_KEY_HEADER")
```

## Setting a Custom Timeout<a id="setting-a-custom-timeout"></a>

You can set a custom timeout for the SDK's HTTP requests as follows:

```py
from salad_cloud_sdk import SaladCloudSdk

sdk = SaladCloudSdk(timeout=10000)
```

# Sample Usage<a id="sample-usage"></a>

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

```py
from salad_cloud_sdk import SaladCloudSdk

sdk = SaladCloudSdk(
    api_key="YOUR_API_KEY",
    api_key_header="YOUR_API_KEY_HEADER",
    timeout=10000
)

result = sdk.quotas.get_quotas(organization_name="acme-corp")

print(result)

```

# Async Usage<a id="async-usage"></a>

The SDK includes an Async Client for making asynchronous API requests. This is useful for applications that need non-blocking operations, like web servers or apps with a graphical user interface.

```py
import asyncio
from salad_cloud_sdk import SaladCloudSdkAsync

sdk = SaladCloudSdkAsync(
    api_key="YOUR_API_KEY",
    api_key_header="YOUR_API_KEY_HEADER",
    timeout=10000
)


async def main():
  result = await sdk.quotas.get_quotas(organization_name="acme-corp")
  print(result)

asyncio.run(main())
```

## Services<a id="services"></a>

The SDK provides various services to interact with the API.

<details>
<summary>Below is a list of all available services:</summary>

| Name                |
| :------------------ |
| container_groups    |
| system_logs         |
| queues              |
| quotas              |
| inference_endpoints |
| organization_data   |
| webhook_secret_key  |
| logs                |

</details>

## Models<a id="models"></a>

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.

<details>
<summary>Below is a list of all available models:</summary>

| Name                                     | Description                                                                                                                                                                                                                                                                                                                                                           |
| :--------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ContainerGroupCollection                 | A paginated collection of container groups that provides a structured way to access multiple container group resources in a single response.                                                                                                                                                                                                                          |
| ContainerGroupCreationRequest            | Represents a request to create a container group, which manages a collection of container instances with shared configuration and scaling policies                                                                                                                                                                                                                    |
| ContainerGroup                           | A container group definition that represents a scalable set of identical containers running as a distributed service                                                                                                                                                                                                                                                  |
| ContainerGroupPatch                      | Represents a request to update a container group                                                                                                                                                                                                                                                                                                                      |
| ContainerGroupInstanceCollection         | A collection of container group instances returned as part of a paginated response or batch operation result.                                                                                                                                                                                                                                                         |
| ContainerGroupInstance                   | A Container Group Instance represents a running instance of a container group on a specific machine. It provides information about the execution state, readiness, and version of the deployed container group.                                                                                                                                                       |
| ContainerGroupInstancePatch              | Represents a request to update a container group instance                                                                                                                                                                                                                                                                                                             |
| SystemLogList                            | Represents a list of system logs                                                                                                                                                                                                                                                                                                                                      |
| QueueCollection                          | Represents a Queue Collection                                                                                                                                                                                                                                                                                                                                         |
| QueuePrototype                           | Represents a request to create a new queue.                                                                                                                                                                                                                                                                                                                           |
| Queue                                    | Represents a queue.                                                                                                                                                                                                                                                                                                                                                   |
| QueuePatch                               | Represents a request to update an existing queue.                                                                                                                                                                                                                                                                                                                     |
| QueueJobCollection                       | Represents a Queue Job Collection                                                                                                                                                                                                                                                                                                                                     |
| QueueJobPrototype                        | Represents a request to create a queue job                                                                                                                                                                                                                                                                                                                            |
| QueueJob                                 | Represents a queue job                                                                                                                                                                                                                                                                                                                                                |
| Quotas                                   | Represents the organization quotas                                                                                                                                                                                                                                                                                                                                    |
| InferenceEndpointCollection              | Represents a page from the collection of inference endpoints.                                                                                                                                                                                                                                                                                                         |
| InferenceEndpoint                        | Represents an inference endpoint                                                                                                                                                                                                                                                                                                                                      |
| InferenceEndpointJobCollection           | Represents a collection of inference endpoint jobs                                                                                                                                                                                                                                                                                                                    |
| InferenceEndpointJobPrototype            | Represents a request to create a inference endpoint job                                                                                                                                                                                                                                                                                                               |
| InferenceEndpointJob                     | Represents a inference endpoint job                                                                                                                                                                                                                                                                                                                                   |
| GpuClassesList                           | Represents a list of GPU classes                                                                                                                                                                                                                                                                                                                                      |
| CpuAvailabilityPrototype                 |                                                                                                                                                                                                                                                                                                                                                                       |
| CpuAvailability                          |                                                                                                                                                                                                                                                                                                                                                                       |
| GpuAvailabilityPrototype                 |                                                                                                                                                                                                                                                                                                                                                                       |
| GpuAvailability                          |                                                                                                                                                                                                                                                                                                                                                                       |
| WebhookSecretKey                         | Represents a webhook secret key                                                                                                                                                                                                                                                                                                                                       |
| LogEntryQuery                            | Represents a query for logs                                                                                                                                                                                                                                                                                                                                           |
| LogEntryCollection                       | Represents a page of organization logs                                                                                                                                                                                                                                                                                                                                |
| Container                                | Represents a container with its configuration and resource requirements.                                                                                                                                                                                                                                                                                              |
| CountryCode                              | ISO 3166-1 alpha-2 country codes                                                                                                                                                                                                                                                                                                                                      |
| ContainerGroupState                      | Represents the operational state of a container group during its lifecycle, including timing information, status, and instance distribution metrics. This state captures the current execution status, start and finish times, and provides visibility into the operational health across instances.                                                                  |
| ContainerGroupLivenessProbe              | Defines a liveness probe for container groups that determines when to restart a container if it becomes unhealthy                                                                                                                                                                                                                                                     |
| ContainerGroupNetworkingConfiguration    | Network configuration for container groups that defines connectivity, routing, and access control settings                                                                                                                                                                                                                                                            |
| ContainerGroupPriority                   | Specifies the priority level for container group execution, which determines resource allocation and scheduling precedence.                                                                                                                                                                                                                                           |
| QueueBasedAutoscalerConfiguration        | Defines configuration for automatically scaling container instances based on queue length. The autoscaler monitors a queue and adjusts the number of running replicas to maintain the desired queue length.                                                                                                                                                           |
| ContainerGroupQueueConnection            | Configuration for connecting a container group to a message queue system, enabling asynchronous communication between services.                                                                                                                                                                                                                                       |
| ContainerGroupReadinessProbe             | Defines how to check if a container is ready to serve traffic. The readiness probe determines whether the container's application is ready to accept traffic. If the readiness probe fails, the container is considered not ready and traffic will not be sent to it.                                                                                                 |
| ContainerRestartPolicy                   | Specifies the policy for restarting containers when they exit or fail.                                                                                                                                                                                                                                                                                                |
| ContainerGroupStartupProbe               | Defines a probe that checks if a container application has started successfully. Startup probes help prevent applications from being prematurely marked as unhealthy during initialization. The probe can use HTTP requests, TCP connections, gRPC calls, or shell commands to determine startup status.                                                              |
| ContainerLogging                         | Configuration options for directing container logs to a logging provider. This schema enables you to specify a single logging destination for container output, supporting monitoring, debugging, and analytics use cases. Each provider has its own configuration parameters defined in the referenced schemas. Only one logging provider can be selected at a time. |
| ContainerResourceRequirements            | Specifies the resource requirements for a container.                                                                                                                                                                                                                                                                                                                  |
| AxiomLoggingConfiguration                | Configuration settings for integrating container logs with the Axiom logging service. When specified, container logs will be forwarded to the Axiom instance defined by these parameters.                                                                                                                                                                             |
| DatadogLoggingConfiguration              | Configuration for forwarding container logs to Datadog monitoring service.                                                                                                                                                                                                                                                                                            |
| ContainerLoggingConfigurationHttp1       | Configuration for sending container logs to an HTTP endpoint. Defines how logs are formatted, compressed, and transmitted.                                                                                                                                                                                                                                            |
| NewRelicLoggingConfiguration             | Configuration for sending container logs to New Relic's log management platform.                                                                                                                                                                                                                                                                                      |
| ContainerLoggingSplunkConfiguration      | Configuration settings for forwarding container logs to a Splunk instance.                                                                                                                                                                                                                                                                                            |
| TcpLoggingConfiguration                  | Configuration for forwarding container logs to a remote TCP endpoint                                                                                                                                                                                                                                                                                                  |
| DatadogTagForContainerLogging            | Represents a Datadog tag used for container logging metadata.                                                                                                                                                                                                                                                                                                         |
| ContainerLoggingHttpFormat               | The format in which logs will be delivered                                                                                                                                                                                                                                                                                                                            |
| ContainerLoggingHttpHeader               | Represents an HTTP header used for container logging configuration.                                                                                                                                                                                                                                                                                                   |
| ContainerLoggingHttpCompression          | The compression algorithm to apply to logs before transmission                                                                                                                                                                                                                                                                                                        |
| ContainerGroupInstanceStatusCount        | A summary of container group instances categorized by their current lifecycle status                                                                                                                                                                                                                                                                                  |
| ContainerGroupStatus                     | Represents the current operational state of a container group within the Salad platform.                                                                                                                                                                                                                                                                              |
| ContainerGroupProbeExec                  | Defines the exec action for a probe in a container group. This is used to execute a command inside a container for health checks.                                                                                                                                                                                                                                     |
| ContainerGroupGRpcProbe                  | Configuration for gRPC-based health probes in container groups, used to determine container health status.                                                                                                                                                                                                                                                            |
| ContainerGroupHttpProbeConfiguration     | Defines HTTP probe configuration for container health checks within a container group.                                                                                                                                                                                                                                                                                |
| ContainerGroupTcpProbe                   | Configuration for a TCP probe used to check container health via network connectivity.                                                                                                                                                                                                                                                                                |
| ContainerGroupProbeHttpHeader            |                                                                                                                                                                                                                                                                                                                                                                       |
| HttpScheme                               | The protocol scheme used for HTTP probe requests in container health checks.                                                                                                                                                                                                                                                                                          |
| TheContainerGroupNetworkingLoadBalancer  | The container group networking load balancer.                                                                                                                                                                                                                                                                                                                         |
| ContainerNetworkingProtocol              | Defines the communication protocol used for network traffic between containers or external systems. Currently supports HTTP protocol for web-based communication.                                                                                                                                                                                                     |
| ContainerConfiguration                   | Configuration for creating a container within a container group. Defines the container image, resource requirements, environment variables, and other settings needed to deploy and run the container.                                                                                                                                                                |
| CreateContainerGroupNetworking           | Network configuration for container groups specifying connectivity parameters, including authentication, protocol, and timeout settings                                                                                                                                                                                                                               |
| ContainerConfigurationLogging            | Configuration options for directing container logs to a logging provider. This schema enables you to specify a single logging destination for container output, supporting monitoring, debugging, and analytics use cases. Each provider has its own configuration parameters defined in the referenced schemas. Only one logging provider can be selected at a time. |
| ContainerRegistryAuthentication          | Authentication configuration for various container registry types, including AWS ECR, Docker Hub, GCP GAR, GCP GCR, and basic authentication.                                                                                                                                                                                                                         |
| CreateContainerResourceRequirements      | Specifies the resource requirements for creating a container.                                                                                                                                                                                                                                                                                                         |
| ContainerLoggingConfigurationHttp2       | Configuration for sending container logs to an HTTP endpoint. Defines how logs are formatted, compressed, and transmitted.                                                                                                                                                                                                                                            |
| ContainerRegistryAuthenticationAwsEcr    | Authentication details for AWS Elastic Container Registry (ECR)                                                                                                                                                                                                                                                                                                       |
| ContainerRegistryAuthenticationBasic     | Basic username and password authentication for generic container registries                                                                                                                                                                                                                                                                                           |
| ContainerRegistryAuthenticationDockerHub | Authentication details for Docker Hub registry                                                                                                                                                                                                                                                                                                                        |
| ContainerRegistryAuthenticationGcpGar    | Authentication details for Google Artifact Registry (GAR)                                                                                                                                                                                                                                                                                                             |
| ContainerRegistryAuthenticationGcpGcr    | Authentication details for Google Container Registry (GCR)                                                                                                                                                                                                                                                                                                            |
| UpdateContainer                          | Represents an update container object                                                                                                                                                                                                                                                                                                                                 |
| UpdateContainerGroupNetworking           | Represents update container group networking parameters                                                                                                                                                                                                                                                                                                               |
| UpdateContainerLogging                   | Configuration options for directing container logs to a logging provider. This schema enables you to specify a single logging destination for container output, supporting monitoring, debugging, and analytics use cases. Each provider has its own configuration parameters defined in the referenced schemas. Only one logging provider can be selected at a time. |
| ContainerResourceUpdateSchema            | Defines the resource specifications that can be modified for a container group, including CPU, memory, GPU classes, and storage allocations.                                                                                                                                                                                                                          |
| TheContainerGroupInstanceState           | The state of the container group instance                                                                                                                                                                                                                                                                                                                             |
| SystemLog                                | Represents a system log                                                                                                                                                                                                                                                                                                                                               |
| QueueJobEvent                            | Represents an event for queue job                                                                                                                                                                                                                                                                                                                                     |
| ContainerGroupsQuotas                    | Represents the organization quotas for container groups                                                                                                                                                                                                                                                                                                               |
| Status                                   | The current status.                                                                                                                                                                                                                                                                                                                                                   |
| InferenceEndpointJobEvent                | Represents an event for inference endpoint job                                                                                                                                                                                                                                                                                                                        |
| InferenceEndpointJobEventAction          | The action that was taken on the inference endpoint job.                                                                                                                                                                                                                                                                                                              |
| GpuClass                                 | Represents a GPU Class                                                                                                                                                                                                                                                                                                                                                |
| GpuClassPrice                            | Represents the price of a GPU class for a given container group priority                                                                                                                                                                                                                                                                                              |
| LogEntryQuerySortOrder                   | The sort order of the log entries. `asc` will sort the log entries in chronological order. `desc` will sort the log entries in reverse chronological order.