Skip to content

Commit c5ab720

Browse files
committed
new: Documented POST /images/upload endpoint
Needed for linode/linode-cli#234 This endpoint is currently in beta, and is not yet available for all customers. The CLI needs this endpoint to be documented for the convenience plugin to build and work correctly, and we do not expect the spec of this endpoint to change in the future. I included information about how to correctly use the endpoint, and how to enroll in the beta, but I am open to any changes or suggestions.
1 parent 1e3f8a4 commit c5ab720

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

openapi.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,6 +3471,65 @@ paths:
34713471
--description "A longer description \
34723472
of the image" \
34733473
--disk_id 123
3474+
/images/upload:
3475+
x-linode-cli-command: images
3476+
post:
3477+
tags: Images
3478+
summary: Upload Image
3479+
description: >
3480+
Initiates a Machine Image upload.
3481+
3482+
This endpoint creates a new private Image object and returns it, along
3483+
with the URL the image data should be uploaded to. Images must be uploaded
3484+
within 24 hours of creation or the upload will be cancelled. Image uploads
3485+
should be made as an HTTP PUT request to the returned URL, with a
3486+
`Content-type: application/octet-stream` header included in the request.
3487+
Uploaded image data should be in gzip format. A maximum file size of
3488+
5GB is supported for upload at this time.
3489+
3490+
*NOTE* This endpoint is currently in beta, and is only available to users
3491+
who are a part of the beta. You may see a 404 error returned from this
3492+
endpoint if you are not currently enrolled - open a support ticket to
3493+
sign up to join the beta when space becomes available.
3494+
x-linode-cli-action: upload
3495+
security:
3496+
- personalAccessToken: []
3497+
- oauth:
3498+
- images:read_write
3499+
requestBody:
3500+
description: The data
3501+
content:
3502+
application/json:
3503+
schema:
3504+
type: object
3505+
properties:
3506+
region:
3507+
type: string
3508+
description: The region to upload to.
3509+
example: eu-central
3510+
label:
3511+
type: string
3512+
description: Label for the new image.
3513+
example: my-image-label
3514+
description:
3515+
type: string
3516+
description: Description for the image.
3517+
example: This is an example image in the docs.
3518+
responses:
3519+
'200':
3520+
description: The new image and upload url.
3521+
content:
3522+
application/json:
3523+
schema:
3524+
type: object
3525+
properties:
3526+
upload_url:
3527+
type: string
3528+
description: The URL to upload the image to.
3529+
image:
3530+
$ref: '#/components/schemas/Image'
3531+
default:
3532+
$ref: '#/components/responses/ErrorResponse'
34743533
/images/{imageId}:
34753534
x-linode-cli-command: images
34763535
parameters:

0 commit comments

Comments
 (0)