Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

salad-cloud-sdk

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

salad-cloud-sdk

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

pipPyPI
Version
0.9.0a13
Maintainers
1

SaladCloudSdk Python SDK 0.9.0-alpha.13

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.14
  • SDK version: 0.9.0-alpha.13

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: Python >= 3.7

Installation

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

pip install 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:

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:

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

Setting a Custom Timeout

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

from salad_cloud_sdk import SaladCloudSdk

sdk = SaladCloudSdk(timeout=10000)

Sample Usage

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

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

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.

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

The SDK provides various services to interact with the API.

Below is a list of all available services:
Name
container_groups
workload_errors
system_logs
queues
quotas
inference_endpoints
organization_data
webhook_secret_key
logs

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:
NameDescription
ContainerGroupCollectionA paginated collection of container groups that provides a structured way to access multiple container group resources in a single response.
ContainerGroupCreationRequestRepresents a request to create a container group, which manages a collection of container instances with shared configuration and scaling policies
ContainerGroupA container group definition that represents a scalable set of identical containers running as a distributed service
ContainerGroupPatchRepresents a request to update a container group
ContainerGroupInstanceCollectionA collection of container group instances returned as part of a paginated response or batch operation result.
ContainerGroupInstanceA 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.
ContainerGroupInstancePatchRepresents a request to update a container group instance
WorkloadErrorListRepresents a list of workload errors
SystemLogListRepresents a list of system logs
QueueCollectionRepresents a Queue Collection
QueuePrototypeRepresents a request to create a new queue.
QueueRepresents a queue.
QueuePatchRepresents a request to update an existing queue.
QueueJobCollectionRepresents a Queue Job Collection
QueueJobPrototypeRepresents a request to create a queue job
QueueJobRepresents a queue job
QuotasRepresents the organization quotas
InferenceEndpointCollectionRepresents a page from the collection of inference endpoints.
InferenceEndpointRepresents an inference endpoint
InferenceEndpointJobCollectionRepresents a collection of inference endpoint jobs
InferenceEndpointJobPrototypeRepresents a request to create a inference endpoint job
InferenceEndpointJobRepresents a inference endpoint job
GpuClassesListRepresents a list of GPU classes
WebhookSecretKeyRepresents a webhook secret key
LogEntryQueryRepresents a query for logs
LogEntryCollectionRepresents a page of organization logs
ContainerRepresents a container with its configuration and resource requirements.
CountryCodeISO 3166-1 alpha-2 country codes
ContainerGroupStateRepresents 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.
ContainerGroupLivenessProbeDefines a liveness probe for container groups that determines when to restart a container if it becomes unhealthy
ContainerGroupNetworkingConfigurationNetwork configuration for container groups that defines connectivity, routing, and access control settings
ContainerGroupPrioritySpecifies the priority level for container group execution, which determines resource allocation and scheduling precedence.
QueueBasedAutoscalerConfigurationDefines 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.
ContainerGroupQueueConnectionConfiguration for connecting a container group to a message queue system, enabling asynchronous communication between services.
ContainerGroupReadinessProbeDefines 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.
ContainerRestartPolicySpecifies the policy for restarting containers when they exit or fail.
ContainerGroupStartupProbeDefines 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.
ContainerLoggingConfiguration 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.
ContainerResourceRequirementsSpecifies the resource requirements for a container.
AxiomLoggingConfigurationConfiguration 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.
DatadogLoggingConfigurationConfiguration for forwarding container logs to Datadog monitoring service.
ContainerLoggingConfigurationHttp1Configuration for sending container logs to an HTTP endpoint. Defines how logs are formatted, compressed, and transmitted.
NewRelicLoggingConfigurationConfiguration for sending container logs to New Relic's log management platform.
ContainerLoggingSplunkConfigurationConfiguration settings for forwarding container logs to a Splunk instance.
TcpLoggingConfigurationConfiguration for forwarding container logs to a remote TCP endpoint
DatadogTagForContainerLoggingRepresents a Datadog tag used for container logging metadata.
ContainerLoggingHttpFormatThe format in which logs will be delivered
ContainerLoggingHttpHeaderRepresents an HTTP header used for container logging configuration.
ContainerLoggingHttpCompressionThe compression algorithm to apply to logs before transmission
ContainerGroupInstanceStatusCountA summary of container group instances categorized by their current lifecycle status
ContainerGroupStatusRepresents the current operational state of a container group within the Salad platform.
ContainerGroupProbeExecDefines the exec action for a probe in a container group. This is used to execute a command inside a container for health checks.
ContainerGroupGRpcProbeConfiguration for gRPC-based health probes in container groups, used to determine container health status.
ContainerGroupHttpProbeConfigurationDefines HTTP probe configuration for container health checks within a container group.
ContainerGroupTcpProbeConfiguration for a TCP probe used to check container health via network connectivity.
ContainerGroupProbeHttpHeader
HttpSchemeThe protocol scheme used for HTTP probe requests in container health checks.
TheContainerGroupNetworkingLoadBalancerThe container group networking load balancer.
ContainerNetworkingProtocolDefines the communication protocol used for network traffic between containers or external systems. Currently supports HTTP protocol for web-based communication.
ContainerConfigurationConfiguration 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.
CreateContainerGroupNetworkingNetwork configuration for container groups specifying connectivity parameters, including authentication, protocol, and timeout settings
ContainerConfigurationLoggingConfiguration 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.
ContainerRegistryAuthenticationAuthentication configuration for various container registry types, including AWS ECR, Docker Hub, GCP GAR, GCP GCR, and basic authentication.
CreateContainerResourceRequirementsSpecifies the resource requirements for creating a container.
ContainerLoggingConfigurationHttp2Configuration for sending container logs to an HTTP endpoint. Defines how logs are formatted, compressed, and transmitted.
ContainerRegistryAuthenticationAwsEcrAuthentication details for AWS Elastic Container Registry (ECR)
ContainerRegistryAuthenticationBasicBasic username and password authentication for generic container registries
ContainerRegistryAuthenticationDockerHubAuthentication details for Docker Hub registry
ContainerRegistryAuthenticationGcpGarAuthentication details for Google Artifact Registry (GAR)
ContainerRegistryAuthenticationGcpGcrAuthentication details for Google Container Registry (GCR)
UpdateContainerRepresents an update container object
UpdateContainerGroupNetworkingRepresents update container group networking parameters
UpdateContainerLoggingConfiguration 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.
ContainerResourceUpdateSchemaDefines the resource specifications that can be modified for a container group, including CPU, memory, GPU classes, and storage allocations.
TheContainerGroupInstanceStateThe state of the container group instance
WorkloadErrorRepresents a workload error
SystemLogRepresents a system log
QueueJobEventRepresents an event for queue job
ContainerGroupsQuotasRepresents the organization quotas for container groups
StatusThe current status.
InferenceEndpointJobEventRepresents an event for inference endpoint job
InferenceEndpointJobEventActionThe action that was taken on the inference endpoint job.
GpuClassRepresents a GPU Class
GpuClassPriceRepresents the price of a GPU class for a given container group priority
LogEntryQuerySortOrderThe 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.
LogEntry
LogEntryResourceThe resource associated with the log entry
LogEntrySeverityThe severity level of the log entry
ProblemDetailsRepresents an API error

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts