diff --git a/endpoints.md b/endpoints.md index 3eb6447..d80349c 100755 --- a/endpoints.md +++ b/endpoints.md @@ -25,6 +25,7 @@ * compute.api.nebius.cloud:443 * [nebius.common.v1.OperationService](nebius/common/v1/operation_service.proto) * [nebius.compute.v1.DiskService](nebius/compute/v1/disk_service.proto) + * [nebius.compute.v1.DiskSnapshotService](nebius/compute/v1/disk_snapshot_service.proto) * [nebius.compute.v1.FilesystemService](nebius/compute/v1/filesystem_service.proto) * [nebius.compute.v1.GpuClusterService](nebius/compute/v1/gpu_cluster_service.proto) * [nebius.compute.v1.ImageService](nebius/compute/v1/image_service.proto) diff --git a/nebius/common/v1/error.proto b/nebius/common/v1/error.proto index 15f0dd5..31bc3a0 100644 --- a/nebius/common/v1/error.proto +++ b/nebius/common/v1/error.proto @@ -34,6 +34,8 @@ message ServiceError { OperationAborted operation_aborted = 131; + OperationConflict operation_conflict = 132; + TooManyRequests too_many_requests = 140; QuotaFailure quota_failure = 141; @@ -116,6 +118,16 @@ message OperationAborted { string resource_id = 3; } +// Operation cannot be started because a conflicting operation is already running on the same resource. +// Wait until the conflicting operation finishes, then you can retry starting your operation. +message OperationConflict { + // ID of the conflicting operation (the one that's running). + string conflicting_operation_id = 1; + + // Resource ID corresponding to the conflicting operation. + string resource_id = 2; +} + // Indicates that element with requested parameters is exceeding the particular range. message OutOfRange { // Requested value. diff --git a/nebius/compute/v1/disk.proto b/nebius/compute/v1/disk.proto index 3616574..2d74ab4 100644 --- a/nebius/compute/v1/disk.proto +++ b/nebius/compute/v1/disk.proto @@ -139,6 +139,10 @@ message DiskStatus { // Disk is locked for deletion and for read-write operations while image is being created. // Here is the list of these images. repeated string images = 1; + + // Disk is locked only for deletion while snapshot is being created. + // Here is the list of these snapshots. + repeated string snapshots = 2; } // Indicates resources that prevent the disk from being attached as read-write. diff --git a/nebius/compute/v1/disk_snapshot.proto b/nebius/compute/v1/disk_snapshot.proto new file mode 100644 index 0000000..d328526 --- /dev/null +++ b/nebius/compute/v1/disk_snapshot.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package nebius.compute.v1; + +import "buf/validate/validate.proto"; +import "nebius/annotations.proto"; +import "nebius/common/v1/metadata.proto"; + +option go_package = "github.com/nebius/gosdk/proto/nebius/compute/v1"; +option java_multiple_files = true; +option java_outer_classname = "DiskSnapshotProto"; +option java_package = "ai.nebius.pub.compute.v1"; + +// DiskSnapshot resource +message DiskSnapshot { + common.v1.ResourceMetadata metadata = 1; + + DiskSnapshotSpec spec = 2; + + DiskSnapshotStatus status = 3; +} + +message DiskSnapshotSpec { + // Identifier of the source disk. May become stale if the disk is deleted. + string source_disk_id = 1 [ + (buf.validate.field).required = true, + (field_behavior) = IMMUTABLE + ]; + + // Arbitrary information about this snapshot provided by user. + string description = 2 [(buf.validate.field) = { + string: {max_len: 1024} + }]; +} + +message DiskSnapshotStatus { + // All possible states for DiskSnapshot resource + enum State { + UNSPECIFIED = 0; + + CREATING = 1; + + READY = 2; + + DELETING = 3; + + ERROR = 4; + } + + State state = 1; + + // Logical size of the snapshot content. + // This is the size of a disk that would be created from this snapshot. + int64 content_size_bytes = 2; + + // Physical storage used by this snapshot in the snapshot backend. + // This value is used for billing and quota and may change over time as the snapshot chain evolves + // (e.g., when earlier snapshots are deleted and data gets re-attributed). + // Currently is equal to content_size_bytes, as incremental snapshots are not supported yet. + int64 storage_size_bytes = 3; + + message LockState { + // The snapshot is locked for deletion while disk is being created from this snapshot. + // Here is the list of these disks. + repeated string disks = 1; + } + + // Indicates which resources prevent the disk snapshot from being deleted. + LockState lock_state = 4; + + // Right now UNDEFINED is an alias for AMD64, but that might change in the future + enum CPUArchitecture { + UNDEFINED = 0; + + AMD64 = 1; + + ARM64 = 2; + } + + // CPU architecture associated with the source disk. + // Not set if the architecture is unknown. + CPUArchitecture source_cpu_architecture = 5; +} diff --git a/nebius/compute/v1/disk_snapshot_service.proto b/nebius/compute/v1/disk_snapshot_service.proto new file mode 100644 index 0000000..44ec13e --- /dev/null +++ b/nebius/compute/v1/disk_snapshot_service.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; + +package nebius.compute.v1; + +import "nebius/annotations.proto"; +import "nebius/common/v1/metadata.proto"; +import "nebius/common/v1/operation.proto"; +import "nebius/compute/v1/disk_snapshot.proto"; + +option go_package = "github.com/nebius/gosdk/proto/nebius/compute/v1"; +option java_multiple_files = true; +option java_outer_classname = "DiskSnapshotServiceProto"; +option java_package = "ai.nebius.pub.compute.v1"; + +// Disk snapshot service specification +service DiskSnapshotService { + option (api_service_name) = "compute"; + + // Retrieves detailed information about a specific snapshot by its ID. + rpc Get(GetDiskSnapshotRequest) returns (DiskSnapshot); + + // Retrieves information about a snapshot by its parent and name. + rpc GetByName(common.v1.GetByNameRequest) returns (DiskSnapshot); + + // Lists all snapshots in a specific parent resource. + rpc List(ListDiskSnapshotsRequest) returns (ListDiskSnapshotsResponse); + + // Lists all snapshots with a specific source disk. + rpc ListByDisk(ListDiskSnapshotsByDiskRequest) returns (ListDiskSnapshotsByDiskResponse); + + // Creates a new snapshot resource of a disk. + rpc Create(CreateDiskSnapshotRequest) returns (common.v1.Operation); + + // Updates an existing snapshot with new configuration parameters. + rpc Update(UpdateDiskSnapshotRequest) returns (common.v1.Operation); + + // Deletes snapshot. + rpc Delete(DeleteDiskSnapshotRequest) returns (common.v1.Operation); +} + +message GetDiskSnapshotRequest { + string id = 1; +} + +message ListDiskSnapshotsRequest { + string parent_id = 1; + + int64 page_size = 2; + + string page_token = 3; +} + +message ListDiskSnapshotsResponse { + repeated DiskSnapshot items = 1; + + string next_page_token = 2; +} + +message ListDiskSnapshotsByDiskRequest { + // ID of computedisk resource + string disk_id = 1 [(nid) = { + resource: ["computedisk"] + }]; + + int64 page_size = 2; + + string page_token = 3; +} + +message ListDiskSnapshotsByDiskResponse { + repeated DiskSnapshot items = 1; + + string next_page_token = 2; +} + +message CreateDiskSnapshotRequest { + common.v1.ResourceMetadata metadata = 1; + + DiskSnapshotSpec spec = 2; +} + +message UpdateDiskSnapshotRequest { + common.v1.ResourceMetadata metadata = 1; + + DiskSnapshotSpec spec = 2; +} + +message DeleteDiskSnapshotRequest { + string id = 1; +}