Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* [nebius.audit.v2.AuditEventExportService](nebius/audit/v2/audit_event_export_service.proto)
* [nebius.audit.v2.AuditEventService](nebius/audit/v2/audit_event_service.proto)
* [nebius.common.v1.OperationService](nebius/common/v1/operation_service.proto)
* capacity-blocks.billing-cpl.api.nebius.cloud:443
* [nebius.capacity.v1.CapacityBlockGroupService](nebius/capacity/v1/capacity_block_group_service.proto)
* [nebius.capacity.v1.CapacityIntervalService](nebius/capacity/v1/capacity_interval_service.proto)
* compute.api.nebius.cloud:443
* [nebius.common.v1.OperationService](nebius/common/v1/operation_service.proto)
* [nebius.common.v1alpha1.OperationService](nebius/common/v1alpha1/operation_service.proto)
Expand Down
2 changes: 1 addition & 1 deletion nebius/audit/v2/audit_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ message AuditEvent {
// Version of CloudEvents spec. See https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#specversion
string spec_version = 3 [(buf.validate.field).required = true];

// The type of event related to the originating occurrence. Formed according to template: "ai.nebius.<serviceName>.<resourceType>.<action>"
// The type of event related to the originating occurrence. Formed according to template: `ai.nebius.<serviceName>.<resourceType>.<action>`
string type = 4 [(buf.validate.field).required = true];

// Indicates the service that generated the event.
Expand Down
147 changes: 147 additions & 0 deletions nebius/capacity/v1/capacity_block_group.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
syntax = "proto3";

package nebius.capacity.v1;

import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
import "nebius/annotations.proto";
import "nebius/capacity/v1/resource_affinity.proto";
import "nebius/common/v1/metadata.proto";

option go_package = "github.com/nebius/gosdk/proto/nebius/capacity/v1";
option java_multiple_files = true;
option java_outer_classname = "CapacityBlockGroupProto";
option java_package = "ai.nebius.pub.capacity.v1";

// Capacity Block Group specification.
message CapacityBlockGroupSpec {}

// Current, last or future concatenation of Capacity Intervals in a Capacity Block Group.
message CurrentContinuousInterval {
// Shows a state of a Continuous Interval.
enum State {
// Shouldn't happen.
STATE_UNSPECIFIED = 0;

// Continuous Interval is in the future.
STATE_SCHEDULED = 1;

// Continuous Interval is active.
STATE_ACTIVE = 2;

// Continuous Interval is in the past.
STATE_EXPIRED = 3;
}

// Start time of the first interval(s) in Continuous Interval.
google.protobuf.Timestamp start_time = 1;

// End time of the last interval(s) in Continuous Interval.
google.protobuf.Timestamp end_time = 2;

// Quota quantity that is currently set, was set or will be set in the Continuous Interval depending on it's
// start_time and end_time.
// If the Continuous Interval is currently active, quantity is the sum of quantities of the currently active
// non-zero intervals.
// If the Continuous Interval is in the past, quantity is the sum of quantities of the last non-zero active
// intervals.
// If the Continuous Interval is in the future, quantity is the sum of the quantities of the first scheduled
// non-zero active intervals.
uint64 quantity = 3;

// Continuous Interval state.
State state = 4;
}

// Capacity Block Group status.
message CapacityBlockGroupStatus {
// Shows the state of a Capacity Block Group with respect to its quota.
enum State {
// Shouldn't happen.
STATE_UNSPECIFIED = 0;

// Capacity Block Group quota is being allocated as one or more capacity intervals have started.
STATE_ALLOCATING = 1;

// Capacity Block Group quota is already allocated and active as one or more capacity intervals are active.
STATE_ACTIVE = 2;

// Capacity Block Group is being shut down due to absence of active intervals at the time.
STATE_SHUTTING = 3;

// Capacity Block Group is inactive due to absence of active intervals at the time.
STATE_INACTIVE = 4;
}

// Shows the usage state if a Capacity Block Group quota.
enum UsageState {
// Shouldn't happen.
USAGE_STATE_UNSPECIFIED = 0;

// Capacity Block Group quota is actively in use.
USAGE_STATE_USED = 1;

// Capacity Block Group quota is not currently in use.
USAGE_STATE_NOT_USED = 2;

// Capacity Block Group region is unreachable, the current usage is therefore unknown.
// Please, retry the request later.
USAGE_STATE_UNKNOWN = 3;
}

// Name of the region where the Capacity Block Group is allocated.
// Example: "eu-north1".
string region = 1;

// Specification of the Capacity Block Group.
ResourceAffinity resource_affinity = 2;

// Service for which the Capacity Block Group is allocated.
string service = 3;

// Capacity Block Group state with respect to quota allocation.
State state = 5;

// Capacity Block Group current quota limit.
uint64 current_limit = 6;

// Capacity Block Group quota usage.
uint64 usage = 8;

// Capacity Block Group quota usage percentage.
string usage_percentage = 9;

// Time of the next Capacity Block Group quota change.
google.protobuf.Timestamp next_change_at = 10;

// The next expected change of the Capacity Block Group quota limit.
// the quota limit change that is currently performed.
optional uint64 next_change_to = 11;

// Current concatenation of non-zero Capacity Intervals that overlap or follow each other without a break.
// If all Capacity Intervals are in the past, returns the last Continuous Interval.
// If all Capacity Intervals are in the future, returns the first Continuous Interval scheduled.
CurrentContinuousInterval current_continuous_interval = 12;

// Capacity Block Group quota usage state.
UsageState usage_state = 13;

// Shows that changes are in flight.
bool reconciling = 100;
}

// Capacity Block Group is a parent resource for Capacity Intervals.
message CapacityBlockGroup {
option (resource_behavior) = UNNAMED;

common.v1.ResourceMetadata metadata = 1 [
(buf.validate.field).required = true,
(nid) = {
parent_resource: ["tenant"]
}
];

CapacityBlockGroupSpec spec = 2;

CapacityBlockGroupStatus status = 3 [(field_behavior) = OUTPUT_ONLY];
}
89 changes: 89 additions & 0 deletions nebius/capacity/v1/capacity_block_group_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
syntax = "proto3";

package nebius.capacity.v1;

import "buf/validate/validate.proto";
import "nebius/annotations.proto";
import "nebius/capacity/v1/capacity_block_group.proto";
import "nebius/capacity/v1/resource_affinity.proto";

option go_package = "github.com/nebius/gosdk/proto/nebius/capacity/v1";
option java_multiple_files = true;
option java_outer_classname = "CapacityBlockGroupServiceProto";
option java_package = "ai.nebius.pub.capacity.v1";

// Capacity Block Group service provides read access to Capacity Block Groups resources.
service CapacityBlockGroupService {
option (api_service_name) = "capacity-blocks.billing-cpl";

// Get Capacity Block Group by its ID.
rpc Get(GetCapacityBlockGroupRequest) returns (CapacityBlockGroup);

// Get Capacity Block Group by its specification.
rpc GetByResourceAffinity(GetCapacityBlockGroupByResourceAffinityRequest) returns (CapacityBlockGroup);

// List all Capacity Block Groups for the specified Tenant.
rpc List(ListCapacityBlockGroupsRequest) returns (ListCapacityBlockGroupsResponse);
}

// Get a Capacity Block Group by its ID.
message GetCapacityBlockGroupRequest {
// ID of the Capacity Block Group.
string id = 1 [
(buf.validate.field).required = true,
(field_behavior) = IDENTIFIER,
(nid) = {
resource: ["capacityblockgroup"]
}
];
}

// Get a Capacity Block Group in a Tenant by its Resource Affinity.
message GetCapacityBlockGroupByResourceAffinityRequest {
// Tenant ID of the Capacity Block Group.
string parent_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["tenant"]
}
];

// Name of the region where the Capacity Block Group is allocated.
// Example: "eu-north1".
string region = 2 [(buf.validate.field).required = true];

// Specifications of the Capacity Block Group.
ResourceAffinity resource_affinity = 3 [(buf.validate.field).required = true];
}

// List Capacity Block Groups by a Tenant ID.
message ListCapacityBlockGroupsRequest {
// Tenant ID of the Capacity Block Group.
string parent_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["tenant"]
}
];

// Page size. Must be between [1...200].
// Optional; if not specified, a reasonable default will be chosen by the service.
int64 page_size = 2 [(buf.validate.field) = {
int64: {
lte: 200
gte: 0
}
}];

// Listing continuation token. Pass an empty string to start listing from the first page.
string page_token = 3;
}

// All existing Capacity Block Groups in a Tenant.
message ListCapacityBlockGroupsResponse {
// List of Capacity Block Groups on this result page.
repeated CapacityBlockGroup items = 1;

// Listing continuation token for the next page of results.
string next_page_token = 2;
}
80 changes: 80 additions & 0 deletions nebius/capacity/v1/capacity_interval.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
syntax = "proto3";

package nebius.capacity.v1;

import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
import "nebius/annotations.proto";
import "nebius/capacity/v1/resource_affinity.proto";
import "nebius/common/v1/metadata.proto";

option go_package = "github.com/nebius/gosdk/proto/nebius/capacity/v1";
option java_multiple_files = true;
option java_outer_classname = "CapacityIntervalProto";
option java_package = "ai.nebius.pub.capacity.v1";

// Capacity Interval specification.
message CapacityIntervalSpec {}

// Capacity Interval status data.
message CapacityIntervalStatus {
enum State {
// Shouldn't happen.
STATE_UNSPECIFIED = 0;

// Capacity Interval is fully in the future (now < start_time).
STATE_SCHEDULED = 1;

// Capacity Interval is currently active (start_time <= now < end_time).
STATE_ACTIVE = 2;

// Capacity Interval is fully in the past (end_time <= now).
STATE_EXPIRED = 3;
}

// Tenant ID for which the Capacity Interval is created.
string container_id = 1 [(nid) = {
resource: ["tenant"]
}];

// Name of the region where the Capacity Interval is created.
// Example: "eu-north1".
string region = 2;

// Specification of the Capacity Interval.
ResourceAffinity resource_affinity = 3;

// Service for which the Capacity Interval is created.
string service = 4;

// Resource quantity of the Capacity Interval.
uint64 quantity = 5;

// Start time of the Capacity Interval.
google.protobuf.Timestamp start_time = 6;

// End time of the Capacity Interval.
google.protobuf.Timestamp end_time = 7;

// State of the Capacity Interval.
State state = 8;

// Shows that changes are in flight.
bool reconciling = 100;
}

// Capacity Intervals represents a timeframe during which the specified resources can be used.
message CapacityInterval {
option (resource_behavior) = UNNAMED;

common.v1.ResourceMetadata metadata = 1 [
(buf.validate.field).required = true,
(nid) = {
parent_resource: ["capacityblockgroup"]
}
];

CapacityIntervalSpec spec = 2 [(buf.validate.field).required = true];

CapacityIntervalStatus status = 3 [(field_behavior) = OUTPUT_ONLY];
}
Loading