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
2 changes: 2 additions & 0 deletions endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
* capacity-advisor.billing-cpl.api.nebius.cloud:443
* [nebius.capacity.v1.ResourceAdviceService](nebius/capacity/v1/resource_advice_service.proto)
* capacity-blocks.billing-cpl.api.nebius.cloud:443
* [nebius.capacity.v1.CapacityAllowanceService](nebius/capacity/v1/capacity_allowance_service.proto)
* [nebius.capacity.v1.CapacityBlockGroupService](nebius/capacity/v1/capacity_block_group_service.proto)
* [nebius.capacity.v1.CapacityIntervalService](nebius/capacity/v1/capacity_interval_service.proto)
* [nebius.common.v1.OperationService](nebius/common/v1/operation_service.proto)
* 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)
Expand Down
95 changes: 95 additions & 0 deletions nebius/capacity/v1/capacity_allowance.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
syntax = "proto3";

package nebius.capacity.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/capacity/v1";
option java_multiple_files = true;
option java_outer_classname = "CapacityAllowanceProto";
option java_package = "ai.nebius.pub.capacity.v1";

// Resource that restricts Capacity Block Group quota by project.
message CapacityAllowance {
option (resource_behavior) = UNNAMED;

// Standard metadata. parent_id is the User's Project NID.
common.v1.ResourceMetadata metadata = 1 [
(buf.validate.field).required = true,
(nid) = {
parent_resource: ["project"]
}
];

// Identifiers for the limit and technical configuration.
CapacityAllowanceSpec spec = 2 [(buf.validate.field).required = true];

// Current status of the Capacity Allowance.
CapacityAllowanceStatus status = 3 [(field_behavior) = OUTPUT_ONLY];
}

// Capacity Allowance specification.
message CapacityAllowanceSpec {
// Capacity Block Group NID.
string capacity_block_group_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["capacityblockgroup"]
}
];

// Total amount of resources allocated.
// Optional is used to define an unlimited Capacity Allowance.
optional uint64 limit = 2;
}

// Capacity Allowance status.
message CapacityAllowanceStatus {
enum State {
STATE_UNSPECIFIED = 0;

// Capacity Allowance is being allocated; the process can take up to several minutes.
STATE_PROVISIONING = 1;

// Capacity Allowance is allocated and can be used.
STATE_ACTIVE = 2;

// The container of the Capacity Allowance is deleted. Capacity Allowance cannot be changed.
STATE_CONTAINER_DELETED = 100;
}

// Current state of the capacity allowance.
State state = 1;

// Current capacity allowance usage.
uint64 usage = 2;

// Capacity allowance usage percentage.
string usage_percentage = 3;

enum UsageState {
USAGE_STATE_UNSPECIFIED = 0;

// Capacity allowance is actively in use.
USAGE_STATE_USED = 1;

// Capacity allowance is not currently in use.
USAGE_STATE_NOT_USED = 2;

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

// Current state of the capacity allowance usage.
UsageState usage_state = 4;

// Capacity Allowance unit.
// Example: "GPU".
string unit = 5;

// Shows that changes are in flight.
bool reconciling = 100;
}
141 changes: 141 additions & 0 deletions nebius/capacity/v1/capacity_allowance_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
syntax = "proto3";

package nebius.capacity.v1;

import "buf/validate/validate.proto";
import "nebius/annotations.proto";
import "nebius/capacity/v1/capacity_allowance.proto";
import "nebius/common/v1/metadata.proto";
import "nebius/common/v1/operation.proto";

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

// Capacity Allowance service manages project limits for Capacity Block Groups.
service CapacityAllowanceService {
option (api_service_name) = "capacity-blocks.billing-cpl";

// Lists project limits.
// Lists non-created Capacity Allowances as well for clarity, showing the default limit.
rpc List(ListCapacityAllowancesRequest) returns (ListCapacityAllowancesResponse);

// Lists project limits for a Capacity Block Group.
rpc ListByCapacityBlockGroup(ListCapacityAllowancesByCapacityBlockGroupRequest) returns (ListCapacityAllowancesResponse);

// Gets a Capacity Allowance by its ID.
rpc Get(GetCapacityAllowanceRequest) returns (CapacityAllowance);

// Gets a Capacity Allowance by a project and a Capacity Block Group NID.
// Returns non-created Capacity Allowances as well for clarity, showing the default limit.
rpc GetByParentAndCapacityBlockGroup(GetCapacityAllowanceByParentAndCapacityBlockGroupRequest) returns (CapacityAllowance);

// Creates a Capacity Allowance by project ID and Capacity Block Group NID.
rpc Create(CreateCapacityAllowanceRequest) returns (common.v1.Operation);

// Updates a Capacity Allowance by project ID and Capacity Block Group NID.
rpc Update(UpdateCapacityAllowanceRequest) returns (common.v1.Operation);

// Resets Capacity Allowance limit to the default value.
rpc Delete(DeleteCapacityAllowanceRequest) returns (common.v1.Operation);
}

message ListCapacityAllowancesRequest {
// ID of the Project to list capacity allowances for.
string parent_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["project"]
}
];

// Page size. Must be between [1...1000].
// Optional; if not specified, a reasonable default will be chosen by the service.
int64 page_size = 2;

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

message ListCapacityAllowancesResponse {
// List of Capacity Allowances on this result page.
repeated CapacityAllowance items = 1;

// Listing continuation token for the next page of results.
string next_page_token = 2;
}

message ListCapacityAllowancesByCapacityBlockGroupRequest {
// ID of a Capacity Block Group to list capacity allowances for.
string capacity_block_group_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["capacityblockgroup"]
}
];

// Page size. Must be between [1...1000].
// Optional; if not specified, a reasonable default will be chosen by the service.
int64 page_size = 2;

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

message GetCapacityAllowanceRequest {
// ID of the Capacity Allowance.
string id = 1 [
(buf.validate.field).required = true,
(field_behavior) = IDENTIFIER,
(nid) = {
resource: ["capacityallowance"]
}
];
}

message GetCapacityAllowanceByParentAndCapacityBlockGroupRequest {
// ID of the Project to get capacity allowance for.
string parent_id = 1 [
(buf.validate.field).required = true,
(nid) = {
resource: ["project"]
}
];

// ID of a Capacity Block Group to get capacity allowance for.
string capacity_block_group_id = 2 [
(buf.validate.field).required = true,
(nid) = {
resource: ["capacityblockgroup"]
}
];
}

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

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

message UpdateCapacityAllowanceRequest {
common.v1.ResourceMetadata metadata = 1 [(buf.validate.field).required = true];

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

message DeleteCapacityAllowanceRequest {
// ID of the Capacity Allowance.
string id = 1 [
(buf.validate.field).required = true,
(field_behavior) = IDENTIFIER,
(nid) = {
resource: ["capacityallowance"]
}
];
}
1 change: 1 addition & 0 deletions nebius/capacity/v1/capacity_block_group.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ message CapacityBlockGroupStatus {
ResourceAffinity resource_affinity = 2;

// Service for which the Capacity Block Group is allocated.
// Derived from the resource_affinity variant (compute_v1 -> "compute", tokenfactory_v1 -> "tokenfactory").
string service = 3;

// Capacity Block Group state with respect to quota allocation.
Expand Down