salad-cloud-imds-sdk 0.9.0a5
The SaladCloud Instance Metadata Service (IMDS). Please refer to the [SaladCloud API Documentation](https://docs.salad.com/reference) for more details.
License: MIT
Requires Python: >=3.9

# SaladCloudImdsSdk Python SDK 0.9.0-alpha.5<a id="saladcloudimdssdk-python-sdk-090-alpha5"></a>

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

[![This SDK was generated by liblab](https://public-liblab-readme-assets.s3.us-east-1.amazonaws.com/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme)

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

- API version: `0.9.0-alpha.2`
- SDK version: `0.9.0-alpha.5`

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

The SaladCloud Instance Metadata Service (IMDS). Please refer to the [SaladCloud API Documentation](https://docs.salad.com/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)
- [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-imds-sdk
```

## 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_imds_sdk import SaladCloudImdsSdk

sdk = SaladCloudImdsSdk(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_imds_sdk import SaladCloudImdsSdk

sdk = SaladCloudImdsSdk(
    timeout=10000
)

result = sdk.metadata.get_deletion_cost()

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_imds_sdk import SaladCloudImdsSdkAsync

sdk = SaladCloudImdsSdkAsync(
    timeout=10000
)


async def main():
  result = await sdk.metadata.get_deletion_cost()
  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     |
| :------- |
| metadata |

</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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DeletionCost        | The deletion cost of the current container instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ReallocatePrototype | Represents a request to reallocate the current container instance to another SaladCloud node.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Status              | The health statuses of the current container instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Token               | The identity token of the current container instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| SaladCloudImdsError | An API error. The `code` and `type` uniquely identify the type of the error. The `code` is a short value that may be used for programmatic error handling. The `type` is an absolute URL that may be resolved for more detailed information. Refer to the [SaladCloud IMDS reference](https://leaf.salad.com/l/saladcloud-imds-errors) for a list of the expected `code` and `type` values. Also, note that all properties are optional. Clients should implement robust error handling to account for unexpected errors. |

</details>

## License<a id="license"></a>

This SDK is licensed under the MIT License.

See the [LICENSE](LICENSE) file for more details.