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
55 changes: 55 additions & 0 deletions nebius/storage/v1/lifecycle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ option java_package = "ai.nebius.pub.storage.v1";
// that you can specify for current and noncurrent object versions.
message LifecycleConfiguration {
repeated LifecycleRule rules = 1 [(buf.validate.field) = { repeated: { max_items: 1000 } }];

// Specifies which requests are included in `days_since_last_access` calculations for all transition rules.
LifecycleAccessFilter last_access_filter = 2;
}

message LifecycleRule {
Expand Down Expand Up @@ -80,6 +83,55 @@ message LifecycleFilter {
int64 object_size_less_than_bytes = 3;
}

// Specifies which requests are included in `days_since_last_access` calculations.
message LifecycleAccessFilter {
// A request is included in `days_since_last_access` calculations if:
// - The first condition matching the request has `INCLUDE` type.
// OR
// - The request doesn't match any conditions
repeated Condition conditions = 1 [(buf.validate.field) = { repeated: { max_items: 100 } }];

message Condition {
Type type = 1 [(buf.validate.field).required = true];

// The s3 methods to match.
// An empty list matches all methods
repeated Method methods = 2 [(buf.validate.field) = { repeated: { max_items: 10 } }];

// User agents to match. Condition is satisfied if the request's user agent contains any of these substrings.
// An empty list matches all user agents.
repeated string user_agents = 3 [(buf.validate.field) = { repeated: { max_items: 100 } }];

enum Type {
TYPE_UNSPECIFIED = 0;

// If an include type condition is the first condition that the request match, the request will be included in `days_since_last_access` calculation.
INCLUDE = 1;

// If an exclude type condition is the first condition that the request match, the request will be ignored in `days_since_last_access` calculation.
EXCLUDE = 2;
}

enum Method {
METHOD_UNSPECIFIED = 0;

GET_OBJECT = 1;

HEAD_OBJECT = 2;

GET_OBJECT_TAGGING = 3;

// Copy object method reads the source object.
// We account for those operations as source object accesses when calculating `days_since_last_access` for source object.
COPY_OBJECT = 4;

// Upload part copy method reads the source object.
// We account for those operations as source object accesses when calculating `days_since_last_access` for source object.
UPLOAD_PART_COPY = 5;
}
}
}

message LifecycleExpiration {
oneof expired_with {
// Indicates at what date the object will be deleted. The time is always midnight UTC.
Expand Down Expand Up @@ -119,6 +171,9 @@ message LifecycleTransition {
// Amount of days since object was uploaded before it's transited to a new storage class.
// The value must be a non-zero positive integer.
int32 days = 2 [(buf.validate.field) = { int32: { lte: 18250, gte: 1 } }];

// The number of days since the object was last accessed before it is transitioned.
int32 days_since_last_access = 4 [(buf.validate.field) = { int32: { lte: 18250, gte: 1 } }];
}

// Target storage class to transit to.
Expand Down
2 changes: 2 additions & 0 deletions nebius/storage/v1/s3_events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ option java_multiple_files = true;
option java_outer_classname = "S3EventsProto";
option java_package = "ai.nebius.pub.storage.v1";

// ----------------------------------------

message CompleteMultipartUploadRequestParameters {
string bucket_name = 1;

Expand Down