Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[storage] [backend] Add Handle to BE object now #217

Merged
merged 2 commits into from
Dec 7, 2022
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
297 changes: 132 additions & 165 deletions storage/v1alpha1/autogen.md

Large diffs are not rendered by default.

59 changes: 40 additions & 19 deletions storage/v1alpha1/backend_aio.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,40 @@ option java_outer_classname = "BackendAioProto";
option go_package = "github.com/opiproject/opi-api/storage/v1alpha1/gen/go";

import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "object_key.proto";
import "uuid.proto";

// Back End (network-facing) APIs. This service is for AIO generic kernel block device.
service AioControllerService {
rpc AioControllerCreate (AioControllerCreateRequest) returns (AioController) {}
rpc AioControllerDelete (AioControllerDeleteRequest) returns (google.protobuf.Empty) {}
rpc AioControllerGet (AioControllerGetRequest) returns (AioController) {}
rpc AioControllerGetList (AioControllerGetListRequest) returns (AioControllerList) {}
rpc AioControllerGetStats (AioControllerGetStatsRequest) returns (AioControllerStats) {}
rpc AioControllerUpdate (AioControllerUpdateRequest) returns (AioController) {}
rpc CreateAioController (CreateAioControllerRequest) returns (AioController) {
option (google.api.http) = {
post: "/v1/subsystems"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLs will be fixed #188

body: "subsystem"
};
}
rpc DeleteAioController (DeleteAioControllerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
};
}
rpc UpdateAioController (UpdateAioControllerRequest) returns (AioController) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
};
}
rpc ListAioController (ListAioControllerRequest) returns (ListAioControllerResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
};
}
rpc GetAioController (GetAioControllerRequest) returns (AioController) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
};
}
rpc AioControllerStats (AioControllerStatsRequest) returns (AioControllerStatsResponse) {}
}

message AioController {
Expand All @@ -35,39 +58,37 @@ message AioController {
string filename = 5;
}

message AioControllerCreateRequest {
message CreateAioControllerRequest {
AioController device = 1;
}

message AioControllerDeleteRequest {
message DeleteAioControllerRequest {
common.v1.ObjectKey handle = 1;
}

message AioControllerUpdateRequest {
message UpdateAioControllerRequest {
AioController device = 1;
}

message AioControllerList{
repeated AioController device = 1;
message ListAioControllerRequest {
int32 page_size = 1;
string page_token = 2;
}

message AioControllerGetRequest {
common.v1.ObjectKey handle = 1;
}

message AioControllerGetListRequest {
// Intentionally empty
message ListAioControllerResponse{
repeated AioController devices = 1;
string next_page_token = 2;
}

message AioControllerGetStatsRequest {
message GetAioControllerRequest {
common.v1.ObjectKey handle = 1;
}

message AioControllerStatsRequest {
common.v1.ObjectKey handle = 1;
}

message AioControllerStats {
message AioControllerStatsResponse {
common.v1.ObjectKey handle = 1;
string stats = 2;
}
Expand Down
51 changes: 38 additions & 13 deletions storage/v1alpha1/backend_null.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,39 @@ option java_outer_classname = "BackendNullProto";
option go_package = "github.com/opiproject/opi-api/storage/v1alpha1/gen/go";

import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "object_key.proto";
import "uuid.proto";

// Back End (network-facing) APIs. This is debug interface for null block devices.
service NullDebugService {
rpc NullDebugCreate (NullDebugCreateRequest) returns (NullDebug) {}
rpc NullDebugDelete (NullDebugDeleteRequest) returns (google.protobuf.Empty) {}
rpc NullDebugUpdate (NullDebugUpdateRequest) returns (NullDebug) {}
rpc NullDebugList (NullDebugListRequest) returns (NullDebugListResponse) {}
rpc NullDebugGet (NullDebugGetRequest) returns (NullDebug) {}
rpc CreateNullDebug (CreateNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
post: "/v1/subsystems"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLs will be fixed #188

body: "subsystem"
};
}
rpc DeleteNullDebug (DeleteNullDebugRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
};
}
rpc UpdateNullDebug (UpdateNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
};
}
rpc ListNullDebug (ListNullDebugRequest) returns (ListNullDebugResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
};
}
rpc GetNullDebug (GetNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
};
}
rpc NullDebugStats (NullDebugStatsRequest) returns (NullDebugStatsResponse) {}
}

Expand All @@ -31,28 +54,30 @@ message NullDebug {
common.v1.Uuid uuid = 4;
}

message NullDebugCreateRequest {
message CreateNullDebugRequest {
NullDebug device = 1;
}

message NullDebugDeleteRequest {
message DeleteNullDebugRequest {
common.v1.ObjectKey handle = 1;

}

message NullDebugUpdateRequest {
message UpdateNullDebugRequest {
NullDebug device = 1;
}

message NullDebugListRequest {
// Intentionally empty.
message ListNullDebugRequest {
int32 page_size = 1;
string page_token = 2;
}

message NullDebugListResponse {
repeated NullDebug device = 1;
message ListNullDebugResponse {
repeated NullDebug devices = 1;
string next_page_token = 2;
}

message NullDebugGetRequest {
message GetNullDebugRequest {
common.v1.ObjectKey handle = 1;
}

Expand Down
90 changes: 56 additions & 34 deletions storage/v1alpha1/backend_nvme_tcp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,47 @@ option java_outer_classname = "BackendNvmeTcpProto";

option go_package = "github.com/opiproject/opi-api/storage/v1alpha1/gen/go";

import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "object_key.proto";

// Back End (network-facing) APIs. NVMe/TCP and NVMe/RoCEv2 protocols are covered by this service.
service NVMfRemoteControllerService {
rpc NVMfRemoteControllerConnect (NVMfRemoteControllerConnectRequest) returns (NVMfRemoteControllerConnectResponse) {}
rpc NVMfRemoteControllerDisconnect (NVMfRemoteControllerDisconnectRequest) returns (NVMfRemoteControllerDisconnectResponse) {}
rpc NVMfRemoteControllerReset (NVMfRemoteControllerResetRequest) returns (NVMfRemoteControllerResetResponse) {}
rpc NVMfRemoteControllerList (NVMfRemoteControllerListRequest) returns (NVMfRemoteControllerListResponse) {}
rpc NVMfRemoteControllerGet (NVMfRemoteControllerGetRequest) returns (NVMfRemoteControllerGetResponse) {}
rpc CreateNVMfRemoteController (CreateNVMfRemoteControllerRequest) returns (NVMfRemoteController) {
option (google.api.http) = {
post: "/v1/subsystems"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLs will be fixed #188

body: "subsystem"
};
}
rpc DeleteNVMfRemoteController (DeleteNVMfRemoteControllerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
};
}
rpc UpdateNVMfRemoteController (UpdateNVMfRemoteControllerRequest) returns (NVMfRemoteController) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
};
}
rpc ListNVMfRemoteController (ListNVMfRemoteControllerRequest) returns (ListNVMfRemoteControllerResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
};
}
rpc GetNVMfRemoteController (GetNVMfRemoteControllerRequest) returns (NVMfRemoteController) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
};
}
rpc NVMfRemoteControllerReset (NVMfRemoteControllerResetRequest) returns (google.protobuf.Empty) {}
rpc NVMfRemoteControllerStats (NVMfRemoteControllerStatsRequest) returns (NVMfRemoteControllerStatsResponse) {}
}

message NVMfRemoteController {
int64 id = 1;
// object's unique identifier
common.v1.ObjectKey id = 1;

NvmeTransportType trtype = 2;
NvmeAddressFamily adrfam = 3;
string traddr = 4;
Expand All @@ -35,53 +64,46 @@ message NVMfRemoteController {
string hostnqn = 12;
}

message NVMfRemoteControllerConnectRequest {
message CreateNVMfRemoteControllerRequest {
NVMfRemoteController ctrl = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not provide the objectKey here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question. according to what we did in frontend, we put the ID inside the object, so I wanted to align those here as well. From https://google.aip.dev/133#user-specified-ids indeed IDs should be in the request message, not the object and named string {resource}_id

}

message NVMfRemoteControllerConnectResponse {
// Intentionally empty.
}

message NVMfRemoteControllerDisconnectRequest {
int64 id = 1;
}

message NVMfRemoteControllerDisconnectResponse {
// Intentionally empty.
message DeleteNVMfRemoteControllerRequest {
// object's unique identifier
common.v1.ObjectKey id = 1;
}

message NVMfRemoteControllerResetRequest {
int64 id = 1;
}

message NVMfRemoteControllerResetResponse {
// Intentionally empty.
message UpdateNVMfRemoteControllerRequest {
NVMfRemoteController ctrl = 1;
}

message NVMfRemoteControllerListRequest {
int64 id = 1;
message ListNVMfRemoteControllerRequest {
int32 page_size = 1;
string page_token = 2;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are these related to this pr ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could've split in 2 commits here, you are right.
the page fields are from https://google.aip.dev/132
just aligning the objects here from the frontend work we did


message NVMfRemoteControllerListResponse {
repeated NVMfRemoteController ctrl = 1;
message ListNVMfRemoteControllerResponse {
repeated NVMfRemoteController ctrls = 1;
string next_page_token = 2;
}

message NVMfRemoteControllerGetRequest {
int64 id = 1;
message GetNVMfRemoteControllerRequest {
// object's unique identifier
common.v1.ObjectKey id = 1;
}

message NVMfRemoteControllerGetResponse {
NVMfRemoteController ctrl = 1;
message NVMfRemoteControllerResetRequest {
// object's unique identifier
common.v1.ObjectKey id = 1;
}

message NVMfRemoteControllerStatsRequest {
int64 id = 1;
// object's unique identifier
common.v1.ObjectKey id = 1;
}

message NVMfRemoteControllerStatsResponse {
int64 id = 1;
string stats = 2;
string stats = 1;
}

enum NvmeTransportType {
Expand Down
Loading