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] [lint] Re-enable several rules #218

Merged
merged 6 commits into from
Dec 8, 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
4 changes: 2 additions & 2 deletions storage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all:
# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
mv google "${PWD}"/v1alpha1/
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format summary"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0131 --disable-rule=core::0132 --disable-rule=core::0133 --disable-rule=core::0134 --disable-rule=core::0135 --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out -v "${PWD}"/v1alpha1:/protos pseudomuto/protoc-gen-doc -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format summary"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0127 --disable-rule=core::0156 --set-exit-status"
rm -rf "${PWD}"/v1alpha1/google
313 changes: 176 additions & 137 deletions storage/v1alpha1/autogen.md

Large diffs are not rendered by default.

61 changes: 44 additions & 17 deletions storage/v1alpha1/backend_aio.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,49 @@ option java_outer_classname = "BackendAioProto";

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

import "google/api/client.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/field_mask.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 CreateAioController (CreateAioControllerRequest) returns (AioController) {
option (google.api.http) = {
post: "/v1/subsystems"
body: "subsystem"
post: "/v1/{parent=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.

don't review URLs, they will be fixed here #188

body: "aio_controller"
};
option (google.api.method_signature) = "parent,aio_controller,aio_controller_id";
}
rpc DeleteAioController (DeleteAioControllerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
delete: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc UpdateAioController (UpdateAioControllerRequest) returns (AioController) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
patch: "/v1/{aio_controller.name=subsystems}"
body: "aio_controller"
};
option (google.api.method_signature) = "aio_controller,update_mask";
}
rpc ListAioController (ListAioControllerRequest) returns (ListAioControllerResponse) {
rpc ListAioControllers (ListAioControllersRequest) returns (ListAioControllersResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
get: "/v1/{parent=subsystems}"
};
option (google.api.method_signature) = "parent";
}
rpc GetAioController (GetAioControllerRequest) returns (AioController) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
get: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc AioControllerStats (AioControllerStatsRequest) returns (AioControllerStatsResponse) {}
}
Expand All @@ -59,29 +69,46 @@ message AioController {
}

message CreateAioControllerRequest {
AioController device = 1;
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
AioController aio_controller = 2 [(google.api.field_behavior) = REQUIRED];
string aio_controller_id = 3;
}

message DeleteAioControllerRequest {
common.v1.ObjectKey handle = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message UpdateAioControllerRequest {
AioController device = 1;
AioController aio_controller = 1;
// The list of fields to update.
google.protobuf.FieldMask update_mask = 2;
}

message ListAioControllerRequest {
int32 page_size = 1;
string page_token = 2;
message ListAioControllersRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
int32 page_size = 2;
string page_token = 3;
}

message ListAioControllerResponse{
repeated AioController devices = 1;
message ListAioControllersResponse{
repeated AioController aio_controllers = 1;
string next_page_token = 2;
}

message GetAioControllerRequest {
common.v1.ObjectKey handle = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message AioControllerStatsRequest {
Expand Down
62 changes: 44 additions & 18 deletions storage/v1alpha1/backend_null.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,49 @@ option java_outer_classname = "BackendNullProto";

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

import "google/api/client.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/field_mask.proto";

import "object_key.proto";
import "uuid.proto";

// Back End (network-facing) APIs. This is debug interface for null block devices.
service NullDebugService {
rpc CreateNullDebug (CreateNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
post: "/v1/subsystems"
body: "subsystem"
post: "/v1/{parent=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.

don't review URLs, they will be fixed here #188

body: "null_debug"
};
option (google.api.method_signature) = "parent,null_debug,null_debug_id";
}
rpc DeleteNullDebug (DeleteNullDebugRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
delete: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc UpdateNullDebug (UpdateNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
patch: "/v1/{null_debug.name=subsystems}"
body: "null_debug"
};
option (google.api.method_signature) = "null_debug,update_mask";
}
rpc ListNullDebug (ListNullDebugRequest) returns (ListNullDebugResponse) {
rpc ListNullDebugs (ListNullDebugsRequest) returns (ListNullDebugsResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
get: "/v1/{parent=subsystems}"
};
option (google.api.method_signature) = "parent";
}
rpc GetNullDebug (GetNullDebugRequest) returns (NullDebug) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
get: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc NullDebugStats (NullDebugStatsRequest) returns (NullDebugStatsResponse) {}
}
Expand All @@ -55,30 +65,46 @@ message NullDebug {
}

message CreateNullDebugRequest {
NullDebug device = 1;
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
NullDebug null_debug = 2 [(google.api.field_behavior) = REQUIRED];
string null_debug_id = 3;
}

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

string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message UpdateNullDebugRequest {
NullDebug device = 1;
NullDebug null_debug = 1;
// The list of fields to update.
google.protobuf.FieldMask update_mask = 2;
}

message ListNullDebugRequest {
int32 page_size = 1;
string page_token = 2;
message ListNullDebugsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
int32 page_size = 2;
string page_token = 3;
}

message ListNullDebugResponse {
repeated NullDebug devices = 1;
message ListNullDebugsResponse {
repeated NullDebug null_debugs = 1;
string next_page_token = 2;
}

message GetNullDebugRequest {
common.v1.ObjectKey handle = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message NullDebugStatsRequest {
Expand Down
61 changes: 44 additions & 17 deletions storage/v1alpha1/backend_nvme_tcp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,48 @@ option java_outer_classname = "BackendNvmeTcpProto";

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

import "google/api/client.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/field_mask.proto";

import "object_key.proto";

// Back End (network-facing) APIs. NVMe/TCP and NVMe/RoCEv2 protocols are covered by this service.
service NVMfRemoteControllerService {
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.

don't review URLs, they will be fixed here #188

body: "subsystem"
post: "/v1/{parent=subsystems}"
body: "nv_mf_remote_controller"
};
option (google.api.method_signature) = "parent,nv_mf_remote_controller,nv_mf_remote_controller_id";
}
rpc DeleteNVMfRemoteController (DeleteNVMfRemoteControllerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/subsystems/{subsystem}"
delete: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc UpdateNVMfRemoteController (UpdateNVMfRemoteControllerRequest) returns (NVMfRemoteController) {
option (google.api.http) = {
patch: "/v1/subsystems"
body: "subsystem"
patch: "/v1/{nv_mf_remote_controller.name=subsystems}"
body: "nv_mf_remote_controller"
};
option (google.api.method_signature) = "nv_mf_remote_controller,update_mask";
}
rpc ListNVMfRemoteController (ListNVMfRemoteControllerRequest) returns (ListNVMfRemoteControllerResponse) {
rpc ListNVMfRemoteControllers (ListNVMfRemoteControllersRequest) returns (ListNVMfRemoteControllersResponse) {
option (google.api.http) = {
get: "/v1/subsystems"
get: "/v1/{parent=subsystems}"
};
option (google.api.method_signature) = "parent";
}
rpc GetNVMfRemoteController (GetNVMfRemoteControllerRequest) returns (NVMfRemoteController) {
option (google.api.http) = {
get: "/v1/subsystems/{subsystem}"
get: "/v1/{name=subsystems}/{subsystem}"
};
option (google.api.method_signature) = "name";
}
rpc NVMfRemoteControllerReset (NVMfRemoteControllerResetRequest) returns (google.protobuf.Empty) {}
rpc NVMfRemoteControllerStats (NVMfRemoteControllerStatsRequest) returns (NVMfRemoteControllerStatsResponse) {}
Expand All @@ -65,31 +75,48 @@ message NVMfRemoteController {
}

message CreateNVMfRemoteControllerRequest {
NVMfRemoteController ctrl = 1;
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
NVMfRemoteController nv_mf_remote_controller = 2 [(google.api.field_behavior) = REQUIRED];
string nv_mf_remote_controller_id = 3;
}

message DeleteNVMfRemoteControllerRequest {
// object's unique identifier
common.v1.ObjectKey id = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message UpdateNVMfRemoteControllerRequest {
NVMfRemoteController ctrl = 1;
NVMfRemoteController nv_mf_remote_controller = 1;
// The list of fields to update.
google.protobuf.FieldMask update_mask = 2;
}

message ListNVMfRemoteControllerRequest {
int32 page_size = 1;
string page_token = 2;
message ListNVMfRemoteControllersRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "library.googleapis.com/Publisher"
];
int32 page_size = 2;
string page_token = 3;
}

message ListNVMfRemoteControllerResponse {
repeated NVMfRemoteController ctrls = 1;
message ListNVMfRemoteControllersResponse {
repeated NVMfRemoteController nv_mf_remote_controllers = 1;
string next_page_token = 2;
}

message GetNVMfRemoteControllerRequest {
// object's unique identifier
common.v1.ObjectKey id = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi.storage.v1/NVMeSubsystem"
];
}

message NVMfRemoteControllerResetRequest {
Expand Down
Loading