Crusoe Disks API
The Disks API from Crusoe — 2 operation(s) for disks.
The Disks API from Crusoe — 2 operation(s) for disks.
swagger: '2.0'
info:
description: The API Gateway exposes all publicly available API endpoints for Crusoe Cloud products.
title: Crusoe Cloud API Gateway Audit Logs Disks API
version: v1alpha5
host: api.crusoecloud.com
basePath: /v1alpha5
schemes:
- https
consumes:
- application/json
produces:
- application/json
tags:
- name: Disks
paths:
/projects/{project_id}/storage/disks:
get:
description: Size of disks will be in gibibytes (GiB)
tags:
- Disks
summary: Retrieve details about all disks that belong to the logged in user.
operationId: listDisks
parameters:
- type: string
x-go-name: ProjectID
name: project_id
in: path
required: true
- type: array
items:
type: string
x-go-name: DiskIds
name: disk_ids
in: query
- type: string
x-go-name: Location
name: location
in: query
- type: array
items:
type: string
x-go-name: DiskNames
name: disk_names
in: query
- type: boolean
x-go-name: ExcludeOs
name: exclude_os
in: query
responses:
'200':
$ref: '#/responses/listDisksResponse'
'401':
$ref: '#/responses/authError'
'403':
$ref: '#/responses/permissionsError'
'500':
$ref: '#/responses/serverError'
post:
description: '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 async operation.'
tags:
- Disks
summary: Create a new disk owned by the logged in user.
operationId: createDisk
parameters:
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: ProjectID
name: project_id
in: path
required: true
- name: Body
in: body
required: true
schema:
$ref: '#/definitions/DisksPostRequestV1Alpha5'
responses:
'200':
$ref: '#/responses/asyncOperationResponse'
'400':
$ref: '#/responses/badReqError'
'401':
$ref: '#/responses/authError'
'403':
$ref: '#/responses/permissionsError'
'500':
$ref: '#/responses/serverError'
/projects/{project_id}/storage/disks/{disk_id}:
get:
description: Size of disk will be in gibibytes (GiB)
tags:
- Disks
summary: Retrieve details for a disk that belongs to the logged in user.
operationId: getDisk
parameters:
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: ProjectID
name: project_id
in: path
required: true
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: DiskID
name: disk_id
in: path
required: true
responses:
'200':
$ref: '#/responses/getDiskResponse'
'401':
$ref: '#/responses/authError'
'403':
$ref: '#/responses/permissionsError'
'500':
$ref: '#/responses/serverError'
delete:
description: A successful response from this resource will contain the async operation.
tags:
- Disks
summary: Delete a disk owned by the logged in user.
operationId: deleteDisk
parameters:
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: ProjectID
name: project_id
in: path
required: true
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: DiskID
name: disk_id
in: path
required: true
responses:
'200':
$ref: '#/responses/asyncOperationResponse'
'401':
$ref: '#/responses/authError'
'403':
$ref: '#/responses/permissionsError'
'500':
$ref: '#/responses/serverError'
patch:
description: '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.'
tags:
- Disks
summary: Resize a disk that the logged in user owns.
operationId: resizeDisk
parameters:
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: ProjectID
name: project_id
in: path
required: true
- type: string
example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
x-go-name: DiskID
name: disk_id
in: path
required: true
- name: Body
in: body
required: true
schema:
$ref: '#/definitions/DisksPatchRequest'
responses:
'200':
$ref: '#/responses/asyncOperationResponse'
'400':
$ref: '#/responses/badReqError'
'401':
$ref: '#/responses/authError'
'403':
$ref: '#/responses/permissionsError'
'500':
$ref: '#/responses/serverError'
definitions:
ListDisksResponseV1Alpha5:
type: object
title: ListDisksResponseV1Alpha5 is the response type for GET requests to the disks endpoint.
required:
- items
properties:
items:
type: array
items:
$ref: '#/definitions/DiskV1Alpha5'
x-go-name: Items
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
Operation:
description: 'Individual resources that use Operations should populate the `metadata` field
with resource-specific information.'
type: object
title: Operation contains the common fields for all Operation API objects.
required:
- operation_id
- state
- metadata
- started_at
- completed_at
properties:
completed_at:
type: string
x-go-name: CompletedAt
example: '2021-12-03T19:59:34Z'
metadata:
x-go-name: Metadata
example: '{}'
operation_id:
type: string
x-go-name: ID
example: F6EF489C-086E-458D-B812-7962964A28C9
result:
x-go-name: Result
example: '{}'
started_at:
type: string
x-go-name: StartedAt
example: '2021-12-03T19:58:34Z'
state:
type: string
enum:
- IN_PROGRESS
- SUCCEEDED
- FAILED
x-go-name: State
example: IN_PROGRESS
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
AsyncOperationResponse:
type: object
title: AsyncOperationResponse is the response type for endpoints which return async operations.
required:
- operation
properties:
operation:
$ref: '#/definitions/Operation'
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
DiskV1Alpha5:
type: object
required:
- id
- name
- type
- size
- location
- block_size
- created_at
- updated_at
- serial_number
- attached_to
properties:
attached_to:
type: array
items:
$ref: '#/definitions/VMAttachmentV1Alpha5'
x-go-name: AttachedTo
block_size:
type: integer
format: int64
x-go-name: BlockSize
example: 4096
created_at:
type: string
x-go-name: CreatedAt
example: '2021-12-03T19:58:34Z'
id:
type: string
x-go-name: ID
example: 123e4567-e89b-12d3-a456-426614174000
location:
type: string
x-go-name: Location
example: us-southcentral1-a
name:
type: string
x-go-name: Name
example: my-disk
serial_number:
type: string
x-go-name: SerialNumber
example: 96FD14FDBCF7E21E8EC
size:
type: string
x-go-name: Size
example: 10GiB
type:
type: string
x-go-name: Type
example: persistent-ssd
updated_at:
type: string
x-go-name: UpdatedAt
example: '2021-12-03T19:58:34Z'
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
DisksPostRequestV1Alpha5:
type: object
required:
- name
properties:
block_size:
type: integer
format: int64
x-go-name: BlockSize
example: 4096
location:
type: string
x-go-name: Location
example: us-southcentral1-a
name:
type: string
x-go-name: Name
example: my-disk
size:
type: string
x-go-name: Size
example: 10GiB
snapshot_id:
type: string
x-go-name: DiskSnapshotID
example: 123e4567-e89b-12d3-a456-426614174000
type:
type: string
default: persistent-ssd
enum:
- persistent-ssd
- shared-volume
x-go-name: Type
example: persistent-ssd
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
DisksPatchRequest:
type: object
required:
- size
properties:
size:
type: string
x-go-name: Size
example: 10GiB
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
VMAttachmentType:
type: string
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
DiskModeType:
type: string
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
VMAttachmentV1Alpha5:
type: object
required:
- vm_id
- attachment_type
properties:
attachment_type:
$ref: '#/definitions/VMAttachmentType'
mode:
$ref: '#/definitions/DiskModeType'
vm_id:
type: string
x-go-name: VMID
example: 123e4567-e89b-12d3-a456-426614174000
x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
responses:
getDiskResponse:
description: ''
schema:
$ref: '#/definitions/DiskV1Alpha5'
serverError:
description: Error Internal Server
schema:
type: object
required:
- code
- message
properties:
code:
type: string
x-go-name: Code
example: '500'
message:
type: string
x-go-name: Message
example: internal_error
badReqError:
description: Error Bad Request
schema:
type: object
required:
- code
- message
properties:
code:
type: string
x-go-name: Code
example: '400'
message:
type: string
x-go-name: Message
example: bad_request
listDisksResponse:
description: ''
schema:
$ref: '#/definitions/ListDisksResponseV1Alpha5'
asyncOperationResponse:
description: ''
schema:
$ref: '#/definitions/AsyncOperationResponse'
permissionsError:
description: Error Permissions
schema:
type: object
required:
- code
- message
properties:
code:
type: string
x-go-name: Code
example: '403'
message:
type: string
x-go-name: Message
example: unauthorized
authError:
description: Error Authentication Failed
schema:
type: object
required:
- code
- message
properties:
code:
type: string
x-go-name: Code
example: '401'
message:
type: string
x-go-name: Message
example: bad_credential
x-tagGroups:
- name: Compute
tags:
- VMs
- VM Operations
- Images
- Instance Templates
- Custom Images
- Custom Image Operations
- name: Organizations
tags:
- Projects
- Entities
- Prospects
- Billing
- Usage
- Quotas
- Audit Logs
- Reservations
- name: Users
tags:
- Identities
- Roles
- SSH Keys
- Tokens
- name: Storage
tags:
- Disks
- Disk Operations
- Snapshots
- Snapshot Operations
- name: Networking
tags:
- VPC Firewall Rules
- VPC Firewall Rule Operations
- VPC Networks
- VPC Subnets
- IB Partitions
- Load Balancers
- name: Orchestration
tags:
- Kubernetes Clusters
- Kubernetes Cluster Operations
- Kubernetes Node Pools
- Kubernetes Node Pool Operations
- Kubernetes Versions
- AutoClusters
- AutoCluster Operations
- name: Locations
tags:
- Locations
- name: Capacities
tags:
- Capacities