# Crusoe

> Manage Crusoe Cloud projects, virtual machines, and disks.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/crusoe

## Actions

### Create disk

Requires either a disk snapshot ID, or size and location, where size of disk should be in gibibytes (GiB) or tebibytes (TiB) in the format [Size][Unit]. E.g. 10GiB. Disk type must be one of: DISK_TYPE_PERSISTENT_SSD. A successful response from this resource will contain the…

**Inputs**

- Project (`project_id`, text, required): ID of the project.
- Block size (`block_size`, number): Block size for the new disk, in bytes: 512 or 4096.
- Location (`location`, text): Location to create the disk in.
- Name (`name`, text, required): Name for the new disk.
- Size (`size`, text): Storage capacity for the new disk, given as a size and unit in the format [Size][Unit], for example 100GiB or 1TiB.
- Snapshot ID (`snapshot_id`, text): ID of a disk snapshot to create the disk from.
- Type (`type`, text): Type of disk to create: persistent-ssd or shared-volume. Defaults to persistent-ssd. One of: `persistent-ssd`, `shared-volume`. Default: `persistent-ssd`.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```

### Create project

The logged-in user must have the permission to create projects within the organization. A successful response from this resource contains details of the created project.

**Inputs**

- Name (`name`, text, required): Name for the new project.
- Organization (`organization_id`, text, required): ID of the organization that will own the new project.

**Outputs**

- `data` (object): ProjectsPutPostResponseV1 is the response type for PUT and POST requests to the projects endpoint.

**Example output**

```json
{
  "data": {
    "project": {
      "id": "example",
      "name": "example",
      "organization_id": "example",
      "relation": "example",
      "resources": {
        "disks": {
          "count": 1
        },
        "images": {
          "count": 1
        },
        "instances": {
          "count": 1
        },
        "snapshots": {
          "count": 1
        },
        "vpc_networks": {
          "count": 1
        }
      }
    }
  }
}
```

### Create virtual machine

Create virtual machine.

**Inputs**

- Project (`project_id`, text, required): ID of the project.
- Crusoe watch agent install mode (`crusoe_watch_agent_install_mode`, text): Installation mode for the Crusoe Watch Agent: docker or native. Defaults to docker. One of: `docker`, `native`.
- Custom image (`custom_image`, text): ID of a custom image to use for the new VM. Either image or custom_image should be supplied, not both.
- Disks (`disks`, list): Disks to attach to the new VM.
- Host channel adapters (`host_channel_adapters`, list): Host channel adapters to attach to the new VM.
- Image (`image`, text): Name of the OS image to use for the new VM. Either image or custom_image should be supplied, not both.
- Install crusoe watch agent (`install_crusoe_watch_agent`, true/false): Whether to install the Crusoe Watch Agent on the VM. Defaults to true.
- Location (`location`, text, required): Location to create the VM in.
- Maintenance policy (`maintenance_policy`, text): Host maintenance policy to apply to the new VM: manual, stop-vm, or unspecified.
- Name (`name`, text, required): Name for the new VM.
- Network interfaces (`network_interfaces`, list): Network interfaces to attach to the new VM.
- Nvlink domain ID (`nvlink_domain_id`, text): ID of the NVLink domain to create the VM in.
- Reservation specification (`reservation_specification`, object): Reservation specification.
- Shutdown script (`shutdown_script`, text): Script to run when the VM shuts down.
- SSH public key (`ssh_public_key`, text, required): SSH public key to grant access to the new VM.
- Startup script (`startup_script`, text): Script to run when the VM starts.
- Type (`type`, text, required): Product name of the VM type to create.
- Virtualization features (`virtualization_features`, object): Virtualization features.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```

### Delete disk

A successful response from this resource will contain the async operation.

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the disk.
- Disk (`disk_id`, text, required): ID of the disk.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```

### Delete virtual machine

Delete virtual machine.

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the VM.
- VM (`vm_id`, text, required): ID of the VM.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```

### Get current user

Get current user.

**Inputs**: None.

**Outputs**

- `data` (object): UserResponse is the return type from the GET and PUT handlers to User. The Identity of a user is returned.

**Example output**

```json
{
  "data": {
    "identity": {
      "accepted_tos": false,
      "company_name": "example",
      "email": "example",
      "id": "example",
      "is_recovery": false,
      "managed_by": "example",
      "name": "example",
      "org_role": "example",
      "registration_type": "example",
      "role": "example",
      "role_bindings": [],
      "sso_enforcement": "example",
      "user_state": "example"
    }
  }
}
```

### Get disk

Size of disk will be in gibibytes (GiB)

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the disk.
- Disk (`disk_id`, text, required): ID of the disk.

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "attached_to": [],
    "block_size": 1,
    "created_at": "example",
    "dns_name": "example",
    "id": "example",
    "location": "example",
    "name": "example",
    "serial_number": "example",
    "size": "example",
    "type": "example",
    "updated_at": "example",
    "vips": []
  }
}
```

### Get project

Get project.

**Inputs**

- Project (`project_id`, text, required): ID of the project.

**Outputs**

- `data` (object): Project contains identifying information for a project.

**Example output**

```json
{
  "data": {
    "id": "example",
    "name": "example",
    "organization_id": "example",
    "relation": "example",
    "resources": {
      "disks": {
        "count": 1
      },
      "images": {
        "count": 1
      },
      "instances": {
        "count": 1
      },
      "snapshots": {
        "count": 1
      },
      "vpc_networks": {
        "count": 1
      }
    }
  }
}
```

### Get virtual machine

Get virtual machine.

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the VM.
- VM (`vm_id`, text, required): ID of the VM.

**Outputs**

- `data` (object): InstanceV1 contains identifying information about a vm instance for vms.instances endpoints.

**Example output**

```json
{
  "data": {
    "billing_type": "example",
    "commitment_end": "example",
    "commitment_period": 1,
    "created_at": "example",
    "disks": [],
    "host_channel_adapters": [],
    "id": "example",
    "instance_group_id": "example",
    "instance_template_id": "example",
    "location": "example",
    "maintenance_policy": "example",
    "name": "example",
    "network_interfaces": [],
    "nvlink_domain_id": "example",
    "pod_id": "example",
    "project_id": "example",
    "reservation_id": "example",
    "state": "example",
    "type": "example",
    "unit_id": "example",
    "updated_at": "example",
    "virtualization_features": {
      "nested_virtualization": false
    },
    "waypoint_ids": []
  }
}
```

### Get virtual machine operation

This resource retrieves information about the status of an asynchronous operation initiated by the instances resource. Only information about the operation specified in the path will be returned, or an HTTP 403 will be returned if the operation does not exist, was not…

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the operation.
- Operation ID (`operation_id`, text, required): ID of the operation.

**Outputs**

- `data` (object): Operation contains the common fields for all Operation API objects. Individual resources that use Operations should populate the metadata field with resource-specific information.

**Example output**

```json
{
  "data": {
    "completed_at": "example",
    "operation_id": "example",
    "started_at": "example",
    "state": "example"
  }
}
```

### List disks

Size of disks will be in gibibytes (GiB)

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the disks.
- Disk IDS (`disk_ids`, list): Filters results to disks with these IDs.
- Location (`location`, text): Filters results to disks in this location.
- Disk names (`disk_names`, list): Filters results to disks with these names.
- Exclude os (`exclude_os`, true/false): Excludes OS disks from the results when true.

**Outputs**

- `data` (object): ListDisksResponseV1 is the response type for GET requests to the disks endpoint.

**Example output**

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

### List images

List images.

**Inputs**

- Product group (`product_group`, text): Optional filter to return only images compatible with the specified product group (e.g. "a100", "h100").
- Product line (`product_line`, text): Optional filter to return only images compatible with the specified product line. an instance type without its size suffix (e.g. "h100-80gb-sxm-ib" for h100-80gb-sxm-ib.8x instances). Mutually exclusive with product_group.

**Outputs**

- `data` (object): ListImagesResponseV1 is the resource response type for GET requests to the Images endpoint.

**Example output**

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

### List locations

List locations.

**Inputs**: None.

**Outputs**

- `data` (object): Result.

**Example output**

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

### List organizations

List organizations.

**Inputs**: None.

**Outputs**

- `data` (object): ListEntitiesResponseV1 is the response type for GET requests to the entities endpoint.

**Example output**

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

### List projects

If querying for projects within an organization, the logged-in user must be the owner of the organization.

**Inputs**

- Org (`org_id`, text): Filters results to projects in this organization.
- Project name (`project_name`, text): Filters results to projects with this name.
- Skip loading project resources (`skip_loading_project_resources`, true/false): Whether to skip loading the resource counts for each project.

**Outputs**

- `data` (object): ListProjectsResponseV1 is the response type for GET requests to the projects endpoint.

**Example output**

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

### List virtual machine operations

This resource retrieves information about the status of asynchronous operations initiated by the instances resource. All operations that are either in-flight or completed but not yet queried will be returned.

**Inputs**

- Resource ID (`resource_id`, text): Filters results to operations on the resource with this ID.
- State (`state`, list): Filters results to operations in these states.
- Lower time bound (`lower_time_bound`, text): Lower time bound.
- Project (`project_id`, text, required): ID of the project.

**Outputs**

- `data` (object): Result.

**Example output**

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

### List virtual machine types

List virtual machine types.

**Inputs**

- Project (`project_id`, text, required): ID of the project.

**Outputs**

- `data` (object): Result.

**Example output**

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

### List virtual machines

List virtual machines.

**Inputs**

- Project (`project_id`, text, required): ID of the project.
- IDS (`ids`, list): Filters results to VMs with these IDs.
- Names (`names`, list): Filters results to VMs with these names.
- Types (`types`, list): Filters results to VMs of these types.
- Locations (`locations`, list): Filters results to VMs in these locations.
- States (`states`, list): Filters results to VMs in these states.
- Nvlink domain IDS (`nvlink_domain_ids`, list): Filters results to VMs in these NVLink domains.
- Limit (`limit`, number): Maximum number of VMs to return per page. At least 1.
- Sort (`sort`, text): Field to sort the results by.
- Next token (`next_token`, text): Token identifying the next page of results to return.
- Prev token (`prev_token`, text): Token identifying the previous page of results to return.

**Outputs**

- `data` (object): ListInstancesResponseV1 is the response type for GET requests to /compute/vms/instances.

**Example output**

```json
{
  "data": {
    "items": [],
    "next_page_token": "example",
    "prev_page_token": "example"
  }
}
```

### Resize disk

Size should be in gibibytes (GiB) or tebibytes (TiB) in the format [Size][Unit]. E.g. 10GiB A successful response from this resource will contain the async operation.

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the disk.
- Disk (`disk_id`, text, required): ID of the disk.
- Size (`size`, text, required): New storage capacity for the disk, given as a size and unit in the format [Size][Unit], for example 100GiB or 1TiB.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```

### Update virtual machine

Update virtual machine.

**Inputs**

- Project (`project_id`, text, required): ID of the project that owns the VM.
- VM (`vm_id`, text, required): ID of the VM.
- Remote action (`remote_action`, text, required): Action to perform on the VM: START, STOP, RESET, RESERVE, UNRESERVE, or UPDATE. RESERVE and UNRESERVE operations are done synchronously, and so will have succeeded with a 200 response. One of: `START`, `STOP`, `RESET`, `RESERVE`, `UNRESERVE`, `UPDATE`.
- Commitment period (`commitment_period`, number): CommitmentPeriod is deprecated, please use reservationID instead
- Host channel adapters (`host_channel_adapters`, list): New set of host channel adapters for the VM.
- Maintenance policy (`maintenance_policy`, text): New host maintenance policy for the VM: manual, stop-vm, or unspecified.
- Network interfaces (`network_interfaces`, list): New set of network interfaces for the VM.
- Reservation ID (`reservation_id`, text): ID of the reservation to use for the VM.
- Type (`type`, text): New VM type to change the VM to.

**Outputs**

- `data` (object): AsyncOperationResponse is the response type for endpoints which return async operations.

**Example output**

```json
{
  "data": {
    "operation": {
      "completed_at": "example",
      "operation_id": "example",
      "started_at": "example",
      "state": "example"
    }
  }
}
```
