1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.baremetalsolution.v2; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/field_mask.proto"; 22 23option csharp_namespace = "Google.Cloud.BareMetalSolution.V2"; 24option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb"; 25option java_multiple_files = true; 26option java_outer_classname = "NfsShareProto"; 27option java_package = "com.google.cloud.baremetalsolution.v2"; 28option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2"; 29option ruby_package = "Google::Cloud::BareMetalSolution::V2"; 30 31// An NFS share. 32message NfsShare { 33 option (google.api.resource) = { 34 type: "baremetalsolution.googleapis.com/NFSShare" 35 pattern: "projects/{project}/locations/{location}/nfsShares/{nfs_share}" 36 }; 37 38 // The possible states for this NFS share. 39 enum State { 40 // The share is in an unknown state. 41 STATE_UNSPECIFIED = 0; 42 43 // The share has been provisioned. 44 PROVISIONED = 1; 45 46 // The NFS Share is being created. 47 CREATING = 2; 48 49 // The NFS Share is being updated. 50 UPDATING = 3; 51 52 // The NFS Share has been requested to be deleted. 53 DELETING = 4; 54 } 55 56 // The possible mount permissions. 57 enum MountPermissions { 58 // Permissions were not specified. 59 MOUNT_PERMISSIONS_UNSPECIFIED = 0; 60 61 // NFS share can be mount with read-only permissions. 62 READ = 1; 63 64 // NFS share can be mount with read-write permissions. 65 READ_WRITE = 2; 66 } 67 68 // Represents an 'access point' for the share. 69 message AllowedClient { 70 // The network the access point sits on. 71 string network = 1 [(google.api.resource_reference) = { 72 type: "baremetalsolution.googleapis.com/Network" 73 }]; 74 75 // Output only. The IP address of the share on this network. Assigned 76 // automatically during provisioning based on the network's services_cidr. 77 string share_ip = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 78 79 // The subnet of IP addresses permitted to access the share. 80 string allowed_clients_cidr = 3; 81 82 // Mount permissions. 83 MountPermissions mount_permissions = 4; 84 85 // Allow dev flag. Which controls whether to allow creation of devices. 86 bool allow_dev = 5; 87 88 // Allow the setuid flag. 89 bool allow_suid = 6; 90 91 // Disable root squashing, which is a feature of NFS. 92 // Root squash is a special mapping of the remote superuser (root) identity 93 // when using identity authentication. 94 bool no_root_squash = 7; 95 96 // Output only. The path to access NFS, in format shareIP:/InstanceID 97 // InstanceID is the generated ID instead of customer provided name. 98 // example like "10.0.0.0:/g123456789-nfs001" 99 string nfs_path = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 100 } 101 102 // The storage type for a volume. 103 enum StorageType { 104 // The storage type for this volume is unknown. 105 STORAGE_TYPE_UNSPECIFIED = 0; 106 107 // The storage type for this volume is SSD. 108 SSD = 1; 109 110 // This storage type for this volume is HDD. 111 HDD = 2; 112 } 113 114 // Immutable. The name of the NFS share. 115 string name = 1 [(google.api.field_behavior) = IMMUTABLE]; 116 117 // Output only. An identifier for the NFS share, generated by the backend. 118 // This field will be deprecated in the future, use `id` instead. 119 string nfs_share_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 120 121 // Output only. An identifier for the NFS share, generated by the backend. 122 // This is the same value as nfs_share_id and will replace it in the future. 123 string id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 124 125 // Output only. The state of the NFS share. 126 State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 127 128 // Output only. The underlying volume of the share. Created automatically 129 // during provisioning. 130 string volume = 4 [ 131 (google.api.field_behavior) = OUTPUT_ONLY, 132 (google.api.resource_reference) = { 133 type: "baremetalsolution.googleapis.com/Volume" 134 } 135 ]; 136 137 // List of allowed access points. 138 repeated AllowedClient allowed_clients = 5; 139 140 // Labels as key value pairs. 141 map<string, string> labels = 6; 142 143 // The requested size, in GiB. 144 int64 requested_size_gib = 7; 145 146 // Immutable. The storage type of the underlying volume. 147 StorageType storage_type = 9 [(google.api.field_behavior) = IMMUTABLE]; 148} 149 150// Message for requesting NFS share information. 151message GetNfsShareRequest { 152 // Required. Name of the resource. 153 string name = 1 [ 154 (google.api.field_behavior) = REQUIRED, 155 (google.api.resource_reference) = { 156 type: "baremetalsolution.googleapis.com/NFSShare" 157 } 158 ]; 159} 160 161// Message for requesting a list of NFS shares. 162message ListNfsSharesRequest { 163 // Required. Parent value for ListNfsSharesRequest. 164 string parent = 1 [ 165 (google.api.field_behavior) = REQUIRED, 166 (google.api.resource_reference) = { 167 type: "locations.googleapis.com/Location" 168 } 169 ]; 170 171 // Requested page size. The server might return fewer items than requested. 172 // If unspecified, server will pick an appropriate default. 173 int32 page_size = 2; 174 175 // A token identifying a page of results from the server. 176 string page_token = 3; 177 178 // List filter. 179 string filter = 4; 180} 181 182// Response message containing the list of NFS shares. 183message ListNfsSharesResponse { 184 // The list of NFS shares. 185 repeated NfsShare nfs_shares = 1; 186 187 // A token identifying a page of results from the server. 188 string next_page_token = 2; 189 190 // Locations that could not be reached. 191 repeated string unreachable = 3; 192} 193 194// Message requesting to updating an NFS share. 195message UpdateNfsShareRequest { 196 // Required. The NFS share to update. 197 // 198 // The `name` field is used to identify the NFS share to update. 199 // Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} 200 NfsShare nfs_share = 1 [(google.api.field_behavior) = REQUIRED]; 201 202 // The list of fields to update. 203 // The only currently supported fields are: 204 // `labels` 205 // `allowed_clients` 206 google.protobuf.FieldMask update_mask = 2; 207} 208 209// Message requesting rename of a server. 210message RenameNfsShareRequest { 211 // Required. The `name` field is used to identify the nfsshare. 212 // Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} 213 string name = 1 [ 214 (google.api.field_behavior) = REQUIRED, 215 (google.api.resource_reference) = { 216 type: "baremetalsolution.googleapis.com/NFSShare" 217 } 218 ]; 219 220 // Required. The new `id` of the nfsshare. 221 string new_nfsshare_id = 2 [(google.api.field_behavior) = REQUIRED]; 222} 223 224// Message for creating an NFS share. 225message CreateNfsShareRequest { 226 // Required. The parent project and location. 227 string parent = 1 [ 228 (google.api.field_behavior) = REQUIRED, 229 (google.api.resource_reference) = { 230 type: "locations.googleapis.com/Location" 231 } 232 ]; 233 234 // Required. The NfsShare to create. 235 NfsShare nfs_share = 2 [(google.api.field_behavior) = REQUIRED]; 236} 237 238// Message for deleting an NFS share. 239message DeleteNfsShareRequest { 240 // Required. The name of the NFS share to delete. 241 string name = 1 [ 242 (google.api.field_behavior) = REQUIRED, 243 (google.api.resource_reference) = { 244 type: "baremetalsolution.googleapis.com/NFSShare" 245 } 246 ]; 247} 248