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

fix(storage): use the same type names for resources and resource references #391

Merged
merged 4 commits into from
Oct 24, 2023
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
5 changes: 5 additions & 0 deletions storage/v1alpha1/autogen.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,11 @@ Represents a request to delete an Nvme Namespace.
<a name="opi_api-storage-v1-DeleteNvmeSubsystemRequest"></a>

### DeleteNvmeSubsystemRequest
(-- api-linter: core::0135::force-field=disabled
aip.dev/not-precedent: disabled since cascade deleting is a dangerous
operation and we want to force a user to delete
all child resources(controllers and namespaces) on
its own --)
Represents a request to delete an Nvme Subsystem.


Expand Down
4 changes: 2 additions & 2 deletions storage/v1alpha1/backend_aio.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ service AioVolumeService {
// Volume represented by Linux kernel block device or a file on a Linux filesystem
message AioVolume {
option (google.api.resource) = {
type: "storage.opiproject.org/AioVolume"
type: "opi_api.storage.v1/AioVolume"
pattern: "aioVolumes/{volume}"
singular: "aioVolume"
plural: "aioVolumes"
Expand Down Expand Up @@ -133,7 +133,7 @@ message ListAioVolumesRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/AioVolume"
(google.api.resource_reference).child_type = "opi_api.storage.v1/AioVolume"
glimchb marked this conversation as resolved.
Show resolved Hide resolved
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
4 changes: 2 additions & 2 deletions storage/v1alpha1/backend_null.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ service NullVolumeService {
// Null volume which discards writes and returns random reads
message NullVolume {
option (google.api.resource) = {
type: "storage.opiproject.org/NullVolume"
type: "opi_api.storage.v1/NullVolume"
pattern: "nullVolumes/{volume}"
singular: "nullVolume"
plural: "nullVolumes"
Expand Down Expand Up @@ -130,7 +130,7 @@ message ListNullVolumesRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NullVolume"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NullVolume"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
12 changes: 6 additions & 6 deletions storage/v1alpha1/backend_nvme.proto
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ service NvmeRemoteControllerService {
// Represents a target controller
message NvmeRemoteController {
option (google.api.resource) = {
type: "storage.opiproject.org/NvmeRemoteController"
type: "opi_api.storage.v1/NvmeRemoteController"
pattern: "nvmeRemoteControllers/{volume}"
singular: "nvmeRemoteController"
plural: "nvmeRemoteControllers"
Expand Down Expand Up @@ -186,7 +186,7 @@ message TcpController {
// Represents a specific path to target controller
message NvmePath {
option (google.api.resource) = {
type: "storage.opiproject.org/NvmePath"
type: "opi_api.storage.v1/NvmePath"
pattern: "nvmePaths/{volume}"
singular: "nvmePath"
plural: "nvmePaths"
Expand Down Expand Up @@ -238,7 +238,7 @@ message FabricsPath {
message NvmeRemoteNamespace {
// namespace's unique key. Assign to middle/front-end objects.
option (google.api.resource) = {
type: "storage.opiproject.org/NvmeRemoteNamespace"
type: "opi_api.storage.v1/NvmeRemoteNamespace"
pattern: "nvmeRemoteNamespaces/{volume}"
singular: "nvmeRemoteNamespace"
plural: "nvmeRemoteNamespaces"
Expand Down Expand Up @@ -308,7 +308,7 @@ message ListNvmeRemoteControllersRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NvmeRemoteController"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NvmeRemoteController"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down Expand Up @@ -363,7 +363,7 @@ message ListNvmeRemoteNamespacesRequest {
// namespaces for a particular controller.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NvmeRemoteNamespace"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NvmeRemoteNamespace"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down Expand Up @@ -425,7 +425,7 @@ message ListNvmePathsRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NvmePath"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NvmePath"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
15 changes: 10 additions & 5 deletions storage/v1alpha1/frontend_nvme.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ service FrontendNvmeService {
// Represents Nvme Subsystem
message NvmeSubsystem {
option (google.api.resource) = {
type: "storage.opiproject.org/NvmeSubsystem"
type: "opi_api.storage.v1/NvmeSubsystem"
pattern: "nvmeSubsystems/{subsystem}"
singular: "nvmeSubsystem"
plural: "nvmeSubsystems"
Expand Down Expand Up @@ -216,7 +216,7 @@ message NvmeSubsystemStatus {
// Represents Nvme Controller
message NvmeController {
option (google.api.resource) = {
type: "storage.opiproject.org/NvmeController"
type: "opi_api.storage.v1/NvmeController"
pattern: "nvmeSubsystems/{subsystem}/nvmeControllers/{controller}"
singular: "nvmeController"
plural: "nvmeControllers"
Expand Down Expand Up @@ -291,7 +291,7 @@ message NvmeControllerStatus {
// Represents Nvme Namespace
message NvmeNamespace {
option (google.api.resource) = {
type: "storage.opiproject.org/NvmeNamespace"
type: "opi_api.storage.v1/NvmeNamespace"
pattern: "nvmeSubsystems/{subsystem}/nvmeNamespaces/{namespace}"
singular: "nvmeNamespace"
plural: "nvmeNamespaces"
Expand Down Expand Up @@ -369,6 +369,11 @@ message CreateNvmeSubsystemRequest {
string nvme_subsystem_id = 2 [(google.api.field_behavior) = OPTIONAL];
}

// (-- api-linter: core::0135::force-field=disabled
// aip.dev/not-precedent: disabled since cascade deleting is a dangerous
// operation and we want to force a user to delete
// all child resources(controllers and namespaces) on
// its own --)
// Represents a request to delete an Nvme Subsystem.
message DeleteNvmeSubsystemRequest {
// Object's unique identifier to delete
Expand Down Expand Up @@ -474,7 +479,7 @@ message ListNvmeControllersRequest {
// Parent's subsystem unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NvmeController"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NvmeController"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down Expand Up @@ -556,7 +561,7 @@ message ListNvmeNamespacesRequest {
// Parent's subsystem unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/NvmeNamespace"
(google.api.resource_reference).child_type = "opi_api.storage.v1/NvmeNamespace"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
4 changes: 2 additions & 2 deletions storage/v1alpha1/frontend_virtio_blk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ service FrontendVirtioBlkService {
// Represnts emulated Virtio-blk device
message VirtioBlk {
option (google.api.resource) = {
type: "storage.opiproject.org/VirtioBlk"
type: "opi_api.storage.v1/VirtioBlk"
pattern: "virtioBlks/{volume}"
singular: "virtioBlk"
plural: "virtioBlks"
Expand Down Expand Up @@ -134,7 +134,7 @@ message ListVirtioBlksRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/VirtioBlk"
(google.api.resource_reference).child_type = "opi_api.storage.v1/VirtioBlk"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
12 changes: 6 additions & 6 deletions storage/v1alpha1/frontend_virtio_scsi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ service FrontendVirtioScsiService {
// Represents Scsi Target
message VirtioScsiTarget {
option (google.api.resource) = {
type: "storage.opiproject.org/VirtioScsiTarget"
type: "opi_api.storage.v1/VirtioScsiTarget"
pattern: "virtioScsiTargets/{volume}"
singular: "virtioScsiTarget"
plural: "virtioScsiTargets"
Expand All @@ -176,7 +176,7 @@ message VirtioScsiTarget {
// Represents Scsi Controller
message VirtioScsiController {
option (google.api.resource) = {
type: "storage.opiproject.org/VirtioScsiController"
type: "opi_api.storage.v1/VirtioScsiController"
pattern: "virtioScsiControllers/{volume}"
singular: "virtioScsiController"
plural: "virtioScsiControllers"
Expand All @@ -200,7 +200,7 @@ message VirtioScsiController {
// Represents Scsi Lun
message VirtioScsiLun {
option (google.api.resource) = {
type: "storage.opiproject.org/VirtioScsiLun"
type: "opi_api.storage.v1/VirtioScsiLun"
pattern: "virtioScsiLuns/{volume}"
singular: "virtioScsiLun"
plural: "virtioScsiLuns"
Expand Down Expand Up @@ -255,7 +255,7 @@ message ListVirtioScsiTargetsRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/VirtioScsiTarget"
(google.api.resource_reference).child_type = "opi_api.storage.v1/VirtioScsiTarget"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down Expand Up @@ -332,7 +332,7 @@ message ListVirtioScsiControllersRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/VirtioScsiController"
(google.api.resource_reference).child_type = "opi_api.storage.v1/VirtioScsiController"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down Expand Up @@ -409,7 +409,7 @@ message ListVirtioScsiLunsRequest {
// Parent's object unique identifier
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "opi_api.storage.v1/VirtioScsiLun"
(google.api.resource_reference).child_type = "opi_api.storage.v1/VirtioScsiLun"
];
// page size of list request
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
104 changes: 52 additions & 52 deletions storage/v1alpha1/gen/cpp/backend_aio.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading