Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saladtechnologies/salad-cloud-sdk-javascript

SaladCloud SDK for JavaScript and TypeScript
https://github.com/saladtechnologies/salad-cloud-sdk-javascript

javascript salad saladcloud sdk sdk-javascript sdk-typescript typescript

Last synced: 6 days ago
JSON representation

SaladCloud SDK for JavaScript and TypeScript

Awesome Lists containing this project

README

        

# SaladCloudSdk TypeScript SDK 0.9.0-alpha.6

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`

## About the API

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

## Table of Contents

- [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

## Supported Language Versions

This SDK is compatible with the following versions: `TypeScript >= 4.8.4`

## Installation

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

```bash
npm install @saladtechnologies-oss/salad-cloud-sdk
```

## Authentication

### API Key Authentication

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

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

```ts
const sdk = new SaladCloudSdk({ apiKey: 'YOUR_API_KEY' });
```

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

```ts
const sdk = new SaladCloudSdk();
sdk.apiKey = 'YOUR_API_KEY';
```

## Setting a Custom Timeout

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

```ts
const saladCloudSdk = new SaladCloudSdk({ timeout: 10000 });
```

# Sample Usage

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

```ts
import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
const saladCloudSdk = new SaladCloudSdk({
apiKey: 'YOUR_API_KEY',
});

const { data } = await saladCloudSdk.quotas.getQuotas('oecson4k2eclxr');

console.log(data);
})();
```

## Services

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) |
| [QueuesService](documentation/services/QueuesService.md) |
| [QuotasService](documentation/services/QuotasService.md) |
| [InferenceEndpointsService](documentation/services/InferenceEndpointsService.md) |
| [OrganizationDataService](documentation/services/OrganizationDataService.md) |
| [WebhookSecretKeyService](documentation/services/WebhookSecretKeyService.md) |

## Models

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 |
| :--------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------- |
| [ContainerGroupList](documentation/models/ContainerGroupList.md) | Represents a list of container groups |
| [CreateContainerGroup](documentation/models/CreateContainerGroup.md) | Represents a request to create a container group |
| [ContainerGroup](documentation/models/ContainerGroup.md) | Represents a container group |
| [UpdateContainerGroup](documentation/models/UpdateContainerGroup.md) | Represents a request to update a container group |
| [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 |
| [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. |
| [UpdateQueue](documentation/models/UpdateQueue.md) | Represents a request to update an existing queue. |
| [QueueJobList](documentation/models/QueueJobList.md) | Represents a list of queue jobs |
| [CreateQueueJob](documentation/models/CreateQueueJob.md) | Represents a request to create a queue job |
| [QueueJob](documentation/models/QueueJob.md) | Represents a queue job |
| [Quotas](documentation/models/Quotas.md) | Represents the organization quotas |
| [InferenceEndpointsList](documentation/models/InferenceEndpointsList.md) | Represents a list of inference endpoints |
| [InferenceEndpoint](documentation/models/InferenceEndpoint.md) | Represents an inference endpoint |
| [InferenceEndpointJobList](documentation/models/InferenceEndpointJobList.md) | Represents a list of inference endpoint jobs |
| [CreateInferenceEndpointJob](documentation/models/CreateInferenceEndpointJob.md) | Represents a request to create a inference endpoint job |
| [InferenceEndpointJob](documentation/models/InferenceEndpointJob.md) | Represents a inference endpoint job |
| [GpuClassesList](documentation/models/GpuClassesList.md) | Represents a list of GPU classes |
| [WebhookSecretKey](documentation/models/WebhookSecretKey.md) | Represents a webhook secret key |
| [Container](documentation/models/Container.md) | Represents a container |
| [ContainerRestartPolicy](documentation/models/ContainerRestartPolicy.md) | |
| [ContainerGroupState](documentation/models/ContainerGroupState.md) | Represents a container group state |
| [CountryCode](documentation/models/CountryCode.md) | |
| [ContainerGroupNetworking](documentation/models/ContainerGroupNetworking.md) | Represents container group networking parameters |
| [ContainerGroupLivenessProbe](documentation/models/ContainerGroupLivenessProbe.md) | Represents the container group liveness probe |
| [ContainerGroupReadinessProbe](documentation/models/ContainerGroupReadinessProbe.md) | Represents the container group readiness probe |
| [ContainerGroupStartupProbe](documentation/models/ContainerGroupStartupProbe.md) | Represents the container group startup probe |
| [ContainerGroupQueueConnection](documentation/models/ContainerGroupQueueConnection.md) | Represents container group queue connection |
| [QueueAutoscaler](documentation/models/QueueAutoscaler.md) | Represents the autoscaling rules for a queue |
| [ContainerResourceRequirements](documentation/models/ContainerResourceRequirements.md) | Represents a container resource requirements |
| [ContainerGroupPriority](documentation/models/ContainerGroupPriority.md) | |
| [ContainerGroupStatus](documentation/models/ContainerGroupStatus.md) | |
| [ContainerGroupInstanceStatusCount](documentation/models/ContainerGroupInstanceStatusCount.md) | Represents a container group instance status count |
| [ContainerNetworkingProtocol](documentation/models/ContainerNetworkingProtocol.md) | |
| [ContainerGroupProbeTcp](documentation/models/ContainerGroupProbeTcp.md) | |
| [ContainerGroupProbeHttp](documentation/models/ContainerGroupProbeHttp.md) | |
| [ContainerGroupProbeGrpc](documentation/models/ContainerGroupProbeGrpc.md) | |
| [ContainerGroupProbeExec](documentation/models/ContainerGroupProbeExec.md) | |
| [ContainerProbeHttpScheme](documentation/models/ContainerProbeHttpScheme.md) | |
| [ContainerGroupProbeHttpHeaders2](documentation/models/ContainerGroupProbeHttpHeaders2.md) | |
| [CreateContainer](documentation/models/CreateContainer.md) | Represents a container |
| [CreateContainerGroupNetworking](documentation/models/CreateContainerGroupNetworking.md) | Represents container group networking parameters |
| [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 |
| [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 |
| [GpuClass](documentation/models/GpuClass.md) | Represents a GPU Class |
| [GpuClassPrice](documentation/models/GpuClassPrice.md) | Represents the price of a GPU class for a given container group priority |

## License

This SDK is licensed under the MIT License.

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