# Lambda

> Manage Lambda Cloud GPU instances, SSH keys and shared file systems.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/lambda-cloud

## Actions

### Add SSH key

Add an SSH key to your Lambda Cloud account. You can upload an existing public key, or you can generate a new key pair.

**Inputs**

- Name (`name`, text, required): The name of the SSH key.
- Public key (`public_key`, text, required): The public key to store. Omit this to generate a new key pair.
- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace that will own this SSH key. Defaults to the account's default workspace.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "id": "example",
      "name": "example",
      "public_key": "example",
      "workspace_id": "example"
    }
  }
}
```

### Create file system

Creates a new filesystem.

**Inputs**

- Name (`name`, text, required): The name of the filesystem.
- Region (`region`, text, required): The region in which you want to create the filesystem.
- Workspace (`workspace_id`, text): The workspace in which to create the filesystem. If not specified, the filesystem will be created within the default workspace.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "bytes_used": 1,
      "created": "example",
      "created_by": {
        "email": "example",
        "id": "example",
        "status": "example"
      },
      "id": "example",
      "is_in_use": false,
      "mount_point": "example",
      "name": "example",
      "region": {
        "description": "example",
        "name": "example"
      },
      "workspace_id": "example"
    }
  }
}
```

### Delete file system

Deletes the filesystem with the specified ID. The filesystem must not be mounted to any running instances at the time of deletion.

**Inputs**

- File system (`file_system_id`, text, required): The unique identifier (ID) of the filesystem to delete

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "deleted_ids": []
    }
  }
}
```

### Delete SSH key

Deletes the specified SSH key.

**Inputs**

- SSH key (`ssh_key_id`, text, required): The unique identifier (ID) of the SSH key to delete

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {}
  }
}
```

### Get current identity

Retrieves the details of the current identity.

**Inputs**: None.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "account_id": "example",
      "created_at": "example",
      "display_name": "example",
      "email": "example",
      "first_name": "example",
      "id": "example",
      "identity_type": "example",
      "is_managed": false,
      "is_verified": false,
      "last_name": "example",
      "status": "example"
    }
  }
}
```

### Get instance

Retrieves the details of a specific instance, including whether or not the instance is running.

**Inputs**

- Instance (`instance_id`, text, required): The unique identifier (ID) of the instance

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "actions": {
        "cold_reboot": {
          "available": false,
          "reason_description": "example"
        },
        "migrate": {
          "available": false,
          "reason_description": "example"
        },
        "power_cycle": {
          "available": false,
          "reason_description": "example"
        },
        "rebuild": {
          "available": false,
          "reason_description": "example"
        },
        "restart": {
          "available": false,
          "reason_description": "example"
        },
        "terminate": {
          "available": false,
          "reason_description": "example"
        }
      },
      "file_system_mounts": [],
      "file_system_names": [],
      "firewall_rulesets": [],
      "first_healthy": "example",
      "hostname": "example",
      "id": "example",
      "image": {
        "family": "example",
        "id": "example"
      },
      "instance_type": {
        "architecture": "example",
        "description": "example",
        "gpu_description": "example",
        "name": "example",
        "price_cents_per_hour": 1,
        "specs": {
          "gpus": 1,
          "memory_gib": 1,
          "storage_gib": 1,
          "vcpus": 1
        }
      },
      "ip": "example",
      "name": "example",
      "private_ip": "example",
      "region": {
        "description": "example",
        "name": "example"
      },
      "ssh_key_names": [],
      "status": "example",
      "tags": [],
      "workspace_id": "example"
    }
  }
}
```

### Get workspace

Retrieves the details of a specific workspace.

**Inputs**

- Workspace (`workspace_id`, text, required): The unique identifier (ID) of the workspace

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "account_id": "example",
      "created": "example",
      "id": "example",
      "is_default": false,
      "name": "example"
    }
  }
}
```

### Launch instance

Launches a Lambda On-Demand Cloud instance.

**Inputs**

- Region name (`region_name`, text, required): The region into which you want to launch the instance.
- Instance type name (`instance_type_name`, text, required): The type of instance you want to launch. To retrieve a list of available instance types, see List available instance types.
- SSH key names (`ssh_key_names`, list, required): The names of the SSH keys you want to use to provide access to the instance. Currently, exactly one SSH key must be specified.
- File system names (`file_system_names`, list): The names of the filesystems you want to mount to the instance. When specified alongside file_system_mounts, any filesystems referred to in both lists will use the mount path specified in file_system_mounts, rather than the default.
- File system mounts (`file_system_mounts`, list): The filesystem mounts to mount to the instance. When specified alongside file_system_names, any filesystems referred to in both lists will use the mount path specified in file_system_mounts, rather than the default.
- Hostname (`hostname`, text): The hostname to assign to the instance. If not specified, a default, IP-address-based hostname is assigned. This hostname is driven into /etc/hostname on the instance.
- Name (`name`, text): The name you want to assign to your instance. Must be 64 characters or fewer.
- Image (`image`, object): The machine image you want to use. Defaults to the latest Lambda Stack image.
- User data (`user_data`, text): An instance configuration string specified in a valid cloud-init user-data format. You can use this field to configure your instance on launch. The user data string must be plain text and cannot exceed 1MB in size.
- Tags (`tags`, list): Key/value pairs representing the instance's tags.
- Firewall rulesets (`firewall_rulesets`, list): The firewall rulesets to associate with the instance. The firewall rulesets must exist in the same region as the instance.
- Workspace (`workspace_id`, text): The workspace ID to associate with the instance. When specified, the instance will be created within the specified workspace.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "instance_ids": []
    }
  }
}
```

### List audit events

Retrieves a list of audit events that have occurred in your account. To view the full catalog of possible audit events, visit Access and security > Audit logs in the Lambda Cloud documentation.

**Inputs**

- Start (`start`, date and time): An ISO 8601 timestamp defining the start of the time range to query, inclusive. If omitted, the response starts at the earliest available event.
- End (`end`, date and time): An ISO 8601 timestamp defining the end of the time range to query, inclusive. If omitted, the response ends at the most recent event.
- Page token (`page_token`, text): The token returned by the previous API response to retrieve the next page of results.
- Resource type (`resource_type`, text): The resource type to filter by. By default, all available resource types are retrieved.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": [],
    "page_token": "example"
  }
}
```

### List file systems

Retrieves a list of your filesystems.

**Inputs**

- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List firewall rulesets

Retrieves a list of your firewall rulesets.

**Inputs**

- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List images

Retrieves a list of available images by region.

**Inputs**

- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List instance types

Retrieves a list of the instance types currently offered on Lambda's public cloud, as well as details about each type. Details include resource specifications, pricing, and regional availability.

**Inputs**

- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {}
  }
}
```

### List instances

Retrieves a list of your running instances.

**Inputs**

- Page size (`page_size`, number): Maximum number of results per page. Can be between 1 and 100. The default is 50.
- Page token (`page_token`, text): A page token for cursor-based pagination.
- Cluster ID (`cluster_id`, text): If provided, the resulting list will only include instances that are part of a cluster with this unique identifier (ID).
- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": [],
    "page_token": "example"
  }
}
```

### List regions

Retrieves a list of available regions.

**Inputs**: None.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List SSH keys

Retrieves a list of your SSH keys.

**Inputs**

- Workspace (`workspace_id`, text): The unique identifier (ID) of the workspace to filter by

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List workspaces

Lists the workspaces the requester is a member of, by default (when view=membership), or all workspaces in the account (when view=all). The view=all option requires the iam:workspace:read permission on the account.

**Inputs**

- View (`view`, text): View. One of: `membership`, `all`. Default: `membership`.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### Restart instances

Restarts one or more instances.

**Inputs**

- Instance IDS (`instance_ids`, list, required): The unique identifiers (IDs) of the instances to restart.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "restarted_instances": []
    }
  }
}
```

### Terminate instances

Terminates one or more instances.

**Inputs**

- Instance IDS (`instance_ids`, list, required): The unique identifiers (IDs) of the instances to terminate.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "terminated_instances": []
    }
  }
}
```

### Update instance

Updates the details of the specified instance.

**Inputs**

- Instance (`instance_id`, text, required): The unique identifier (ID) of the instance
- Name (`name`, text): The new, user-provided name for the instance.
- Tags (`tags`, list): The new tags for the instance. If provided, this replaces the existing tags (an empty list clears them). If not provided, the tags will not be updated.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "data": {
      "actions": {
        "cold_reboot": {
          "available": false,
          "reason_description": "example"
        },
        "migrate": {
          "available": false,
          "reason_description": "example"
        },
        "power_cycle": {
          "available": false,
          "reason_description": "example"
        },
        "rebuild": {
          "available": false,
          "reason_description": "example"
        },
        "restart": {
          "available": false,
          "reason_description": "example"
        },
        "terminate": {
          "available": false,
          "reason_description": "example"
        }
      },
      "file_system_mounts": [],
      "file_system_names": [],
      "firewall_rulesets": [],
      "first_healthy": "example",
      "hostname": "example",
      "id": "example",
      "image": {
        "family": "example",
        "id": "example"
      },
      "instance_type": {
        "architecture": "example",
        "description": "example",
        "gpu_description": "example",
        "name": "example",
        "price_cents_per_hour": 1,
        "specs": {
          "gpus": 1,
          "memory_gib": 1,
          "storage_gib": 1,
          "vcpus": 1
        }
      },
      "ip": "example",
      "jupyter_token": "example",
      "jupyter_url": "example",
      "name": "example",
      "private_ip": "example",
      "region": {
        "description": "example",
        "name": "example"
      },
      "ssh_key_names": [],
      "status": "example",
      "tags": [],
      "workspace_id": "example"
    }
  }
}
```
