syntax = "proto3";

package yandex.cloud.compute.v1;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1;compute";
option java_package = "yandex.cloud.api.compute.v1";

// An Image resource.
message Image {

  enum Status {
    STATUS_UNSPECIFIED = 0;

    // Image is being created.
    CREATING = 1;

    // Image is ready to use.
    READY = 2;

    // Image encountered a problem and cannot operate.
    ERROR = 3;

    // Image is being deleted.
    DELETING = 4;
  }

  // ID of the image.
  string id = 1;

  // ID of the folder that the image belongs to.
  string folder_id = 2;

  google.protobuf.Timestamp created_at = 3;

  // Name of the image. 1-63 characters long.
  string name = 4;

  // Description of the image. 0-256 characters long.
  string description = 5;

  // Resource labels as `key:value` pairs. Maximum of 64 per resource.
  map<string, string> labels = 6;

  // The name of the image family to which this image belongs.
  //
  // You can get the most recent image from a family by using
  // the [yandex.cloud.compute.v1.ImageService.GetLatestByFamily] request
  // and create the disk from this image.
  string family = 7;

  // The size of the image, specified in bytes.
  int64 storage_size = 8;

  // Minimum size of the disk which will be created from this image.
  int64 min_disk_size = 9;

  // License IDs that indicate which licenses are attached to this resource.
  // License IDs are used to calculate additional charges for the use of the virtual machine.
  //
  // The correct license ID is generated by Yandex.Cloud. IDs are inherited by new resources created from this resource.
  //
  // If you know the license IDs, specify them when you create the image.
  // For example, if you create a disk image using a third-party utility and load it into Yandex Object Storage, the license IDs will be lost.
  // You can specify them in the [yandex.cloud.compute.v1.ImageService.Create] request.
  repeated string product_ids = 10;

  // Current status of the image.
  Status status = 11;

  // Operating system that is contained in the image.
  Os os = 12;
}

message Os {

  enum Type {
    TYPE_UNSPECIFIED = 0;

    // Linux operating system.
    LINUX = 1;

    // Windows operating system.
    WINDOWS = 2;
  }

  // Operating system type. The default is `LINUX`.
  //
  // This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
  Type type = 1;
}
