Skip to content

SaladTechnologies/salad-cloud-sdk-javascript

Repository files navigation

SaladCloudSdk TypeScript SDK 0.9.0-alpha.12

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

Versions

  • API version: 0.9.0-alpha.11
  • SDK version: 0.9.0-alpha.12

About the API

The SaladCloud REST API. Please refer to the SaladCloud API Documentation for more details.

Table of Contents

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:

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:

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:

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:

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

Sample Usage

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

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

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

  const { data } = await saladCloudSdk.quotas.getQuotas('acme-corp');

  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
WorkloadErrorsService
SystemLogsService
QueuesService
QuotasService
InferenceEndpointsService
OrganizationDataService
WebhookSecretKeyService

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
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
WorkloadErrorList Represents a list of workload errors
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
WebhookSecretKey Represents a webhook secret key
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.
ContainerGroupPriority Specifies the priority level for container group execution, which determines resource allocation and scheduling precedence.
ContainerRestartPolicy Specifies the policy for restarting containers when they exit or fail.
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
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.
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.
ContainerResourceRequirements Specifies the resource requirements for a container.
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.
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.
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
WorkloadError Represents a workload error
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

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.