The Lambda Cloud API provides a set of REST API endpoints you can use to create and manage your Lambda Cloud resources.
Requests to the API are generally limited to one request per second. Requests to
the /instance-operations/launch endpoint are limited to one request per 12
seconds, or five requests per minute.
The format of each response object depends on whether the request succeeded or failed.
When a request succeeds, the API returns a response object in the following format. <PAYLOAD>
represents the endpoint-specific data object returned as part of the response object.
{
\"data\": <PAYLOAD>
}When a request fails, the API returns an error response object in the following format:
{
\"error\": {
\"code\": string,
\"message\": string,
\"suggestion\": string?
}
}code: A machine- and human-readable error code specific to a particular failure mode.message: An explanation of the error.suggestion: When present, a suggestion for how to address the error.
message or suggestion, as
these values are subject to change. Instead, use the value of code.In some cases, you might receive errors that come from upstream services/providers rather than directly
from Lambda services. You can identify these errors by their error code prefix, provider/.
Common provider errors include:
- Network outages or connectivity issues
- Service unavailability
- Quota limitations or resource exhaustion
An example of a typical service unavailability error:
{
\"error\": {
\"code\": \"provider/internal-unavailable\",
\"message\": \"Provider unavailable\",
\"suggestion\": \"Try again shortly\",
}
}The Lambda Cloud API uses API keys to authenticate incoming requests. You can generate a new API key pair or view your existing API keys by visiting the <a href="/api-keys" style="color: var(--highlight-primary); text-decoration: none" target="_blank">API keys page in the Lambda Cloud dashboard.
In general, Lambda recommends passing an HTTP Bearer header that contains your API key:
Authorization: Bearer <YOUR-API-KEY>The API also supports passing an HTTP Basic header. This option chiefly exists
to support curl's -u flag, which allows you to pass your credentials
without having to write out the full Authorization: Basic header string.
For example:
curl -X GET \"https://cloud.lambda.ai/api/v1/instances\" \\
-H 'accept: application/json' \\
-u '<YOUR-API-KEY>:'If your use case requires it, you can also pass the HTTP Basic header directly. The value you pass must be a Base64-encoded string containing your API key and a trailing colon:
Authorization: Basic <BASE64-ENCODED-API-KEY-WITH-COLON>Authorization
header, the request will fail.This Dart package is automatically generated by the OpenAPI Generator project:
- API version: 1.8.0
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
Dart 2.12 or later
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
To use the package in your local drive, add the following dependency to your pubspec.yaml
dependencies:
openapi:
path: /path/to/openapi
TODO
Please follow the installation procedure and then run the following:
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
// TODO Configure HTTP Bearer authorization: bearerAuth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearerAuth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = FilesystemsApi();
final filesystemCreateRequest = FilesystemCreateRequest(); // FilesystemCreateRequest |
try {
final result = api_instance.createFilesystem(filesystemCreateRequest);
print(result);
} catch (e) {
print('Exception when calling FilesystemsApi->createFilesystem: $e\n');
}
All URIs are relative to https://cloud.lambda.ai
| Class | Method | HTTP request | Description |
|---|---|---|---|
| FilesystemsApi | createFilesystem | POST /api/v1/filesystems | Create filesystem |
| FilesystemsApi | filesystemDelete | DELETE /api/v1/filesystems/{id} | Delete filesystem |
| FilesystemsApi | listFilesystems | GET /api/v1/file-systems | List filesystems |
| FirewallsApi | createFirewallRuleset | POST /api/v1/firewall-rulesets | Create firewall ruleset |
| FirewallsApi | deleteFirewallRuleset | DELETE /api/v1/firewall-rulesets/{id} | Delete firewall ruleset |
| FirewallsApi | firewallRulesList | GET /api/v1/firewall-rules | List inbound firewall rules |
| FirewallsApi | firewallRulesSet | PUT /api/v1/firewall-rules | Replace inbound firewall rules |
| FirewallsApi | firewallRulesetsList | GET /api/v1/firewall-rulesets | List firewall rulesets |
| FirewallsApi | getFirewallRuleset | GET /api/v1/firewall-rulesets/{id} | Retrieve firewall ruleset details |
| FirewallsApi | getGlobalFirewallRuleset | GET /api/v1/firewall-rulesets/global | Retrieve global firewall ruleset details |
| FirewallsApi | updateFirewallRuleset | PATCH /api/v1/firewall-rulesets/{id} | Update firewall ruleset |
| FirewallsApi | updateGlobalFirewallRuleset | PATCH /api/v1/firewall-rulesets/global | Update global firewall ruleset |
| ImagesApi | listImages | GET /api/v1/images | List available images |
| InstancesApi | getInstance | GET /api/v1/instances/{id} | Retrieve instance details |
| InstancesApi | launchInstance | POST /api/v1/instance-operations/launch | Launch instances |
| InstancesApi | listInstanceTypes | GET /api/v1/instance-types | List available instance types |
| InstancesApi | listInstances | GET /api/v1/instances | List running instances |
| InstancesApi | postInstance | POST /api/v1/instances/{id} | Update instance details |
| InstancesApi | restartInstance | POST /api/v1/instance-operations/restart | Restart instances |
| InstancesApi | terminateInstance | POST /api/v1/instance-operations/terminate | Terminate instances |
| SSHKeysApi | addSSHKey | POST /api/v1/ssh-keys | Add an SSH key |
| SSHKeysApi | deleteSSHKey | DELETE /api/v1/ssh-keys/{id} | Delete an SSH key |
| SSHKeysApi | listSSHKeys | GET /api/v1/ssh-keys | List your SSH keys |
- AddSSHKey200Response
- AddSSHKey200ResponseData
- AddSSHKeyRequest
- ApiErrorAccountInactive
- ApiErrorDuplicate
- ApiErrorFileSystemInWrongRegion
- ApiErrorFilesystemInUse
- ApiErrorFilesystemNotFound
- ApiErrorFirewallRulesetInUse
- ApiErrorFirewallRulesetNotFound
- ApiErrorInstanceNotFound
- ApiErrorInsufficientCapacity
- ApiErrorInternal
- ApiErrorInvalidBillingAddress
- ApiErrorInvalidParameters
- ApiErrorLaunchResourceNotFound
- ApiErrorQuotaExceeded
- ApiErrorUnauthorized
- CreateFilesystem200Response
- CreateFilesystem400Response
- CreateFilesystem400ResponseError
- CreateFirewallRuleset200Response
- CreateFirewallRuleset400Response
- CreateFirewallRuleset400ResponseError
- CreateFirewallRuleset409Response
- DeleteFirewallRuleset400Response
- DeleteSSHKey200Response
- Filesystem
- FilesystemCreateRequest
- FilesystemDelete200Response
- FilesystemDelete400Response
- FilesystemDelete404Response
- FilesystemDeleteResponse
- FilesystemMountEntry
- FirewallRule
- FirewallRulesList200Response
- FirewallRulesPutRequest
- FirewallRuleset
- FirewallRulesetCreateRequest
- FirewallRulesetEntry
- FirewallRulesetPatchRequest
- FirewallRulesetsList200Response
- GeneratedSSHKey
- GetFirewallRuleset404Response
- GetGlobalFirewallRuleset200Response
- GetInstance200Response
- GetInstance401Response
- GetInstance404Response
- GlobalFirewallRuleset
- GlobalFirewallRulesetPatchRequest
- Image
- ImageArchitecture
- ImageSpecificationFamily
- ImageSpecificationID
- Instance
- InstanceActionAvailability
- InstanceActionAvailabilityDetails
- InstanceActionAvailabilityDetailsReasonCode
- InstanceActionUnavailableCode
- InstanceLaunchRequest
- InstanceLaunchRequestImage
- InstanceLaunchResponse
- InstanceModificationRequest
- InstanceRestartRequest
- InstanceRestartResponse
- InstanceStatus
- InstanceTerminateRequest
- InstanceTerminateResponse
- InstanceType
- InstanceTypeSpecs
- InstanceTypesItem
- LaunchInstance200Response
- LaunchInstance400Response
- LaunchInstance400ResponseError
- LaunchInstance403Response
- LaunchInstance403ResponseError
- LaunchInstance404Response
- ListFilesystems200Response
- ListImages200Response
- ListInstanceTypes200Response
- ListInstances200Response
- ListInstances401Response
- ListInstances403Response
- ListSSHKeys200Response
- NetworkProtocol
- PostInstance400Response
- PublicRegionCode
- Region
- RequestedFilesystemMountEntry
- RequestedTagEntry
- RestartInstance200Response
- SSHKey
- TagEntry
- TerminateInstance200Response
- User
- UserStatus
Authentication schemes defined for the API:
- Type: HTTP Basic authentication
- Type: HTTP Bearer authentication