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 1 commit
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
71 changes: 11 additions & 60 deletions storage/v1alpha1/autogen.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@
- [backend_nvme_tcp.proto](#backend_nvme_tcp-proto)
- [NVMfRemoteController](#opi_api-storage-v1-NVMfRemoteController)
- [NVMfRemoteControllerConnectRequest](#opi_api-storage-v1-NVMfRemoteControllerConnectRequest)
- [NVMfRemoteControllerConnectResponse](#opi_api-storage-v1-NVMfRemoteControllerConnectResponse)
- [NVMfRemoteControllerDisconnectRequest](#opi_api-storage-v1-NVMfRemoteControllerDisconnectRequest)
- [NVMfRemoteControllerDisconnectResponse](#opi_api-storage-v1-NVMfRemoteControllerDisconnectResponse)
- [NVMfRemoteControllerGetRequest](#opi_api-storage-v1-NVMfRemoteControllerGetRequest)
- [NVMfRemoteControllerGetResponse](#opi_api-storage-v1-NVMfRemoteControllerGetResponse)
- [NVMfRemoteControllerListRequest](#opi_api-storage-v1-NVMfRemoteControllerListRequest)
- [NVMfRemoteControllerListResponse](#opi_api-storage-v1-NVMfRemoteControllerListResponse)
- [NVMfRemoteControllerResetRequest](#opi_api-storage-v1-NVMfRemoteControllerResetRequest)
- [NVMfRemoteControllerResetResponse](#opi_api-storage-v1-NVMfRemoteControllerResetResponse)
- [NVMfRemoteControllerStatsRequest](#opi_api-storage-v1-NVMfRemoteControllerStatsRequest)
- [NVMfRemoteControllerStatsResponse](#opi_api-storage-v1-NVMfRemoteControllerStatsResponse)

Expand Down Expand Up @@ -559,7 +555,7 @@ Back End (network-facing) APIs. This is debug interface for null block devices.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| id | [opi_api.common.v1.ObjectKey](#opi_api-common-v1-ObjectKey) | | object's unique identifier |
| trtype | [NvmeTransportType](#opi_api-storage-v1-NvmeTransportType) | | |
| adrfam | [NvmeAddressFamily](#opi_api-storage-v1-NvmeAddressFamily) | | |
| traddr | [string](#string) | | |
Expand Down Expand Up @@ -592,16 +588,6 @@ Back End (network-facing) APIs. This is debug interface for null block devices.



<a name="opi_api-storage-v1-NVMfRemoteControllerConnectResponse"></a>

### NVMfRemoteControllerConnectResponse
Intentionally empty.






<a name="opi_api-storage-v1-NVMfRemoteControllerDisconnectRequest"></a>

### NVMfRemoteControllerDisconnectRequest
Expand All @@ -610,17 +596,7 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |






<a name="opi_api-storage-v1-NVMfRemoteControllerDisconnectResponse"></a>

### NVMfRemoteControllerDisconnectResponse
Intentionally empty.
| id | [opi_api.common.v1.ObjectKey](#opi_api-common-v1-ObjectKey) | | object&#39;s unique identifier |



Expand All @@ -635,22 +611,7 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |






<a name="opi_api-storage-v1-NVMfRemoteControllerGetResponse"></a>

### NVMfRemoteControllerGetResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ctrl | [NVMfRemoteController](#opi_api-storage-v1-NVMfRemoteController) | | |
| id | [opi_api.common.v1.ObjectKey](#opi_api-common-v1-ObjectKey) | | object&#39;s unique identifier |



Expand All @@ -665,7 +626,8 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| page_size | [int32](#int32) | | |
| page_token | [string](#string) | | |



Expand Down Expand Up @@ -695,17 +657,7 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |






<a name="opi_api-storage-v1-NVMfRemoteControllerResetResponse"></a>

### NVMfRemoteControllerResetResponse
Intentionally empty.
| id | [opi_api.common.v1.ObjectKey](#opi_api-common-v1-ObjectKey) | | object&#39;s unique identifier |



Expand All @@ -720,7 +672,7 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| id | [opi_api.common.v1.ObjectKey](#opi_api-common-v1-ObjectKey) | | object&#39;s unique identifier |



Expand All @@ -735,7 +687,6 @@ Intentionally empty.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| stats | [string](#string) | | |


Expand Down Expand Up @@ -802,11 +753,11 @@ Back End (network-facing) APIs. NVMe/TCP and NVMe/RoCEv2 protocols are covered b

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| NVMfRemoteControllerConnect | [NVMfRemoteControllerConnectRequest](#opi_api-storage-v1-NVMfRemoteControllerConnectRequest) | [NVMfRemoteControllerConnectResponse](#opi_api-storage-v1-NVMfRemoteControllerConnectResponse) | |
| NVMfRemoteControllerDisconnect | [NVMfRemoteControllerDisconnectRequest](#opi_api-storage-v1-NVMfRemoteControllerDisconnectRequest) | [NVMfRemoteControllerDisconnectResponse](#opi_api-storage-v1-NVMfRemoteControllerDisconnectResponse) | |
| NVMfRemoteControllerReset | [NVMfRemoteControllerResetRequest](#opi_api-storage-v1-NVMfRemoteControllerResetRequest) | [NVMfRemoteControllerResetResponse](#opi_api-storage-v1-NVMfRemoteControllerResetResponse) | |
| NVMfRemoteControllerConnect | [NVMfRemoteControllerConnectRequest](#opi_api-storage-v1-NVMfRemoteControllerConnectRequest) | [NVMfRemoteController](#opi_api-storage-v1-NVMfRemoteController) | |
| NVMfRemoteControllerDisconnect | [NVMfRemoteControllerDisconnectRequest](#opi_api-storage-v1-NVMfRemoteControllerDisconnectRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| NVMfRemoteControllerReset | [NVMfRemoteControllerResetRequest](#opi_api-storage-v1-NVMfRemoteControllerResetRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| NVMfRemoteControllerList | [NVMfRemoteControllerListRequest](#opi_api-storage-v1-NVMfRemoteControllerListRequest) | [NVMfRemoteControllerListResponse](#opi_api-storage-v1-NVMfRemoteControllerListResponse) | |
| NVMfRemoteControllerGet | [NVMfRemoteControllerGetRequest](#opi_api-storage-v1-NVMfRemoteControllerGetRequest) | [NVMfRemoteControllerGetResponse](#opi_api-storage-v1-NVMfRemoteControllerGetResponse) | |
| NVMfRemoteControllerGet | [NVMfRemoteControllerGetRequest](#opi_api-storage-v1-NVMfRemoteControllerGetRequest) | [NVMfRemoteController](#opi_api-storage-v1-NVMfRemoteController) | |
| NVMfRemoteControllerStats | [NVMfRemoteControllerStatsRequest](#opi_api-storage-v1-NVMfRemoteControllerStatsRequest) | [NVMfRemoteControllerStatsResponse](#opi_api-storage-v1-NVMfRemoteControllerStatsResponse) | |


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

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

import "google/protobuf/empty.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 NVMfRemoteControllerConnect (NVMfRemoteControllerConnectRequest) returns (NVMfRemoteController) {}
rpc NVMfRemoteControllerDisconnect (NVMfRemoteControllerDisconnectRequest) returns (google.protobuf.Empty) {}
rpc NVMfRemoteControllerReset (NVMfRemoteControllerResetRequest) returns (google.protobuf.Empty) {}
rpc NVMfRemoteControllerList (NVMfRemoteControllerListRequest) returns (NVMfRemoteControllerListResponse) {}
rpc NVMfRemoteControllerGet (NVMfRemoteControllerGetRequest) returns (NVMfRemoteControllerGetResponse) {}
rpc NVMfRemoteControllerGet (NVMfRemoteControllerGetRequest) returns (NVMfRemoteController) {}
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 @@ -39,49 +44,37 @@ message NVMfRemoteControllerConnectRequest {
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.
// object's unique identifier
common.v1.ObjectKey id = 1;
}

message NVMfRemoteControllerResetRequest {
int64 id = 1;
}

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

message NVMfRemoteControllerListRequest {
int64 id = 1;
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 NVMfRemoteControllerGetRequest {
int64 id = 1;
}

message NVMfRemoteControllerGetResponse {
NVMfRemoteController ctrl = 1;
// 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