Перейти до вмісту
NimbusNexus

Образи VM

Образ VM — це шаблон ОС, з якого завантажується кореневий диск нової VM. NimbusNexus надає публічні образи, а ви можете завантажити свої власні образи, зібрані за допомогою інструментів на кшталт Packer.

Публічні образи

GET /api/v1/image/ перелічує образи, які ви можете використати; visibility=public звужує список до публічних. Образ ідентифікується своїм id (UUID), і саме його ви передаєте як image під час створення VM. Назви — це мітки, а не slug-и з версіями, тож шукайте id, а не прописуйте назву в коді.

Під час завантаження VM отримує SSH-ключ, указаний у sshs (див. SSH-ключі), і user_data, якщо ви їх передали; образ із cloud-init застосовує їх під час першого завантаження.

Власні образи

Власний образ створюється за два виклики:

  1. POST /api/v1/image/ створює запис образу з name (щонайменше 5 символів), disk_format і container_format та повертає його id. За бажанням задайте visibility (за замовчуванням private: лише ваш проєкт) і subscription — тарифний план (за замовчуванням Hourly).
  2. POST /api/v1/image/file завантажує файл як multipart-поля file і image_id. Або ж POST /api/v1/image/import з {"id": "…", "url": "…"} отримує образ за URL.

Приймаються файли з розширеннями .img, .qcow2, .vmdk, .vhd, .vhdx, .raw, .iso, .ami, .ari, .aki і .vdi; на будь-яке інше розширення API відповідає 400.

Власні образи тарифікуються за GB з округленням угору до цілого GB як окремий продукт, за планом у subscription; див. Дані про ціни.

Регіони

Виклики для образів працюють у регіоні вашої сесії. Виклику, який копіює образ в інший регіон, немає.

Що далі

Reference

GET/api/v1/image/

Images List

Lists images visible to the caller, applying the supplied filters and pagination.

Parameters

NameInTypeDescription
limitqueryinteger | null—
markerquerystring | null—
namequerystring | null—
ownerquerystring | null—
protectedqueryboolean | null—
statusquerystring | null—
tagquerystring | null—
visibilityquery"public" | "private" | "community" | "shared" | "all" | null—
os_hiddenqueryboolean | null—
member_statusquery"accepted" | "pending" | "rejected" | "all" | null—
size_maxquerystring | null—
size_minquerystring | null—
created_atquerystring | null—
updated_atquerystring | null—
sort_dirquerystring | null—
sort_keyquerystring | null—
sortquerystring | null—

Responses

  • 200Successful Response
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/image/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/image/

Image Create

Creates a new image record and resolves its billing product for the calling project.

Request body

FieldTypeDescription
name*string—
descriptionstring | null—
disk_format*string—
container_format*string—
visibilitystring—
product_categorystringProduct category for billing
subscriptionobjectSubscription plan type

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/image/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example",
    "disk_format": "example",
    "container_format": "example"
  }'
DELETE/api/v1/image/

Images Delete

admin_domain, admin_project are only for admin

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
projectstring | null—
ids*array of string—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/image/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "example"
    ]
  }'
POST/api/v1/image/file

Image Upload

Uploads the binary contents of a previously created image from the supplied file.

Request body

JSON body required.

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/image/file" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/image/import

Image Import

Imports an image into the catalog by fetching its contents from a remote URL.

Request body

FieldTypeDescription
id*string—
url*string—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/image/import" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "example",
    "url": "https://example.com/webhooks"
  }'
PATCH/api/v1/image/{image_id}

Image Update

Updates the editable fields of an image owned by the caller's project.

Parameters

NameInTypeDescription
image_id*pathstring—

Request body

FieldTypeDescription
namestring | null—
descriptionstring | null—
metadataobject | null—

Responses

  • 200Successful Response
  • 422Validation Error

Example

curl -X PATCH "https://api.nimbusnexus.net/api/v1/image/<image_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Need to make a real call? Try these endpoints in the live Swagger UI →