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/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/cloud/baremetalsolution/v2/instance.proto"; 23import "google/cloud/baremetalsolution/v2/lun.proto"; 24import "google/cloud/baremetalsolution/v2/network.proto"; 25import "google/cloud/baremetalsolution/v2/nfs_share.proto"; 26import "google/cloud/baremetalsolution/v2/osimage.proto"; 27import "google/cloud/baremetalsolution/v2/provisioning.proto"; 28import "google/cloud/baremetalsolution/v2/ssh_key.proto"; 29import "google/cloud/baremetalsolution/v2/volume.proto"; 30import "google/cloud/baremetalsolution/v2/volume_snapshot.proto"; 31import "google/longrunning/operations.proto"; 32import "google/protobuf/empty.proto"; 33import "google/protobuf/timestamp.proto"; 34 35option csharp_namespace = "Google.Cloud.BareMetalSolution.V2"; 36option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb"; 37option java_multiple_files = true; 38option java_outer_classname = "BareMetalSolutionProto"; 39option java_package = "com.google.cloud.baremetalsolution.v2"; 40option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2"; 41option ruby_package = "Google::Cloud::BareMetalSolution::V2"; 42 43// Performs management operations on Bare Metal Solution servers. 44// 45// The `baremetalsolution.googleapis.com` service provides management 46// capabilities for Bare Metal Solution servers. To access the API methods, you 47// must assign Bare Metal Solution IAM roles containing the desired permissions 48// to your staff in your Google Cloud project. You must also enable the Bare 49// Metal Solution API. Once enabled, the methods act 50// upon specific servers in your Bare Metal Solution environment. 51service BareMetalSolution { 52 option (google.api.default_host) = "baremetalsolution.googleapis.com"; 53 option (google.api.oauth_scopes) = 54 "https://www.googleapis.com/auth/cloud-platform"; 55 56 // List servers in a given project and location. 57 rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { 58 option (google.api.http) = { 59 get: "/v2/{parent=projects/*/locations/*}/instances" 60 }; 61 option (google.api.method_signature) = "parent"; 62 } 63 64 // Get details about a single server. 65 rpc GetInstance(GetInstanceRequest) returns (Instance) { 66 option (google.api.http) = { 67 get: "/v2/{name=projects/*/locations/*/instances/*}" 68 }; 69 option (google.api.method_signature) = "name"; 70 } 71 72 // Update details of a single server. 73 rpc UpdateInstance(UpdateInstanceRequest) 74 returns (google.longrunning.Operation) { 75 option (google.api.http) = { 76 patch: "/v2/{instance.name=projects/*/locations/*/instances/*}" 77 body: "instance" 78 }; 79 option (google.api.method_signature) = "instance,update_mask"; 80 option (google.longrunning.operation_info) = { 81 response_type: "Instance" 82 metadata_type: "OperationMetadata" 83 }; 84 } 85 86 // RenameInstance sets a new name for an instance. 87 // Use with caution, previous names become immediately invalidated. 88 rpc RenameInstance(RenameInstanceRequest) returns (Instance) { 89 option (google.api.http) = { 90 post: "/v2/{name=projects/*/locations/*/instances/*}:rename" 91 body: "*" 92 }; 93 option (google.api.method_signature) = "name,new_instance_id"; 94 } 95 96 // Perform an ungraceful, hard reset on a server. Equivalent to shutting the 97 // power off and then turning it back on. 98 rpc ResetInstance(ResetInstanceRequest) 99 returns (google.longrunning.Operation) { 100 option (google.api.http) = { 101 post: "/v2/{name=projects/*/locations/*/instances/*}:reset" 102 body: "*" 103 }; 104 option (google.api.method_signature) = "name"; 105 option (google.longrunning.operation_info) = { 106 response_type: "ResetInstanceResponse" 107 metadata_type: "OperationMetadata" 108 }; 109 } 110 111 // Starts a server that was shutdown. 112 rpc StartInstance(StartInstanceRequest) 113 returns (google.longrunning.Operation) { 114 option (google.api.http) = { 115 post: "/v2/{name=projects/*/locations/*/instances/*}:start" 116 body: "*" 117 }; 118 option (google.api.method_signature) = "name"; 119 option (google.longrunning.operation_info) = { 120 response_type: "StartInstanceResponse" 121 metadata_type: "OperationMetadata" 122 }; 123 } 124 125 // Stop a running server. 126 rpc StopInstance(StopInstanceRequest) returns (google.longrunning.Operation) { 127 option (google.api.http) = { 128 post: "/v2/{name=projects/*/locations/*/instances/*}:stop" 129 body: "*" 130 }; 131 option (google.api.method_signature) = "name"; 132 option (google.longrunning.operation_info) = { 133 response_type: "StopInstanceResponse" 134 metadata_type: "OperationMetadata" 135 }; 136 } 137 138 // Enable the interactive serial console feature on an instance. 139 rpc EnableInteractiveSerialConsole(EnableInteractiveSerialConsoleRequest) 140 returns (google.longrunning.Operation) { 141 option (google.api.http) = { 142 post: "/v2/{name=projects/*/locations/*/instances/*}:enableInteractiveSerialConsole" 143 body: "*" 144 }; 145 option (google.api.method_signature) = "name"; 146 option (google.longrunning.operation_info) = { 147 response_type: "EnableInteractiveSerialConsoleResponse" 148 metadata_type: "OperationMetadata" 149 }; 150 } 151 152 // Disable the interactive serial console feature on an instance. 153 rpc DisableInteractiveSerialConsole(DisableInteractiveSerialConsoleRequest) 154 returns (google.longrunning.Operation) { 155 option (google.api.http) = { 156 post: "/v2/{name=projects/*/locations/*/instances/*}:disableInteractiveSerialConsole" 157 body: "*" 158 }; 159 option (google.api.method_signature) = "name"; 160 option (google.longrunning.operation_info) = { 161 response_type: "DisableInteractiveSerialConsoleResponse" 162 metadata_type: "OperationMetadata" 163 }; 164 } 165 166 // Detach LUN from Instance. 167 rpc DetachLun(DetachLunRequest) returns (google.longrunning.Operation) { 168 option (google.api.http) = { 169 post: "/v2/{instance=projects/*/locations/*/instances/*}:detachLun" 170 body: "*" 171 }; 172 option (google.api.method_signature) = "instance,lun"; 173 option (google.longrunning.operation_info) = { 174 response_type: "Instance" 175 metadata_type: "OperationMetadata" 176 }; 177 } 178 179 // Lists the public SSH keys registered for the specified project. 180 // These SSH keys are used only for the interactive serial console feature. 181 rpc ListSSHKeys(ListSSHKeysRequest) returns (ListSSHKeysResponse) { 182 option (google.api.http) = { 183 get: "/v2/{parent=projects/*/locations/*}/sshKeys" 184 }; 185 option (google.api.method_signature) = "parent"; 186 } 187 188 // Register a public SSH key in the specified project for use with the 189 // interactive serial console feature. 190 rpc CreateSSHKey(CreateSSHKeyRequest) returns (SSHKey) { 191 option (google.api.http) = { 192 post: "/v2/{parent=projects/*/locations/*}/sshKeys" 193 body: "ssh_key" 194 }; 195 option (google.api.method_signature) = "parent,ssh_key,ssh_key_id"; 196 } 197 198 // Deletes a public SSH key registered in the specified project. 199 rpc DeleteSSHKey(DeleteSSHKeyRequest) returns (google.protobuf.Empty) { 200 option (google.api.http) = { 201 delete: "/v2/{name=projects/*/locations/*/sshKeys/*}" 202 }; 203 option (google.api.method_signature) = "name"; 204 } 205 206 // List storage volumes in a given project and location. 207 rpc ListVolumes(ListVolumesRequest) returns (ListVolumesResponse) { 208 option (google.api.http) = { 209 get: "/v2/{parent=projects/*/locations/*}/volumes" 210 }; 211 option (google.api.method_signature) = "parent"; 212 } 213 214 // Get details of a single storage volume. 215 rpc GetVolume(GetVolumeRequest) returns (Volume) { 216 option (google.api.http) = { 217 get: "/v2/{name=projects/*/locations/*/volumes/*}" 218 }; 219 option (google.api.method_signature) = "name"; 220 } 221 222 // Update details of a single storage volume. 223 rpc UpdateVolume(UpdateVolumeRequest) returns (google.longrunning.Operation) { 224 option (google.api.http) = { 225 patch: "/v2/{volume.name=projects/*/locations/*/volumes/*}" 226 body: "volume" 227 }; 228 option (google.api.method_signature) = "volume,update_mask"; 229 option (google.longrunning.operation_info) = { 230 response_type: "Volume" 231 metadata_type: "OperationMetadata" 232 }; 233 } 234 235 // RenameVolume sets a new name for a volume. 236 // Use with caution, previous names become immediately invalidated. 237 rpc RenameVolume(RenameVolumeRequest) returns (Volume) { 238 option (google.api.http) = { 239 post: "/v2/{name=projects/*/locations/*/volumes/*}:rename" 240 body: "*" 241 }; 242 option (google.api.method_signature) = "name,new_volume_id"; 243 } 244 245 // Skips volume's cooloff and deletes it now. 246 // Volume must be in cooloff state. 247 rpc EvictVolume(EvictVolumeRequest) returns (google.longrunning.Operation) { 248 option (google.api.http) = { 249 post: "/v2/{name=projects/*/locations/*/volumes/*}:evict" 250 body: "*" 251 }; 252 option (google.api.method_signature) = "name"; 253 option (google.longrunning.operation_info) = { 254 response_type: "google.protobuf.Empty" 255 metadata_type: "OperationMetadata" 256 }; 257 } 258 259 // Emergency Volume resize. 260 rpc ResizeVolume(ResizeVolumeRequest) returns (google.longrunning.Operation) { 261 option (google.api.http) = { 262 post: "/v2/{volume=projects/*/locations/*/volumes/*}:resize" 263 body: "*" 264 }; 265 option (google.api.method_signature) = "volume,size_gib"; 266 option (google.longrunning.operation_info) = { 267 response_type: "Volume" 268 metadata_type: "OperationMetadata" 269 }; 270 } 271 272 // List network in a given project and location. 273 rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) { 274 option (google.api.http) = { 275 get: "/v2/{parent=projects/*/locations/*}/networks" 276 }; 277 option (google.api.method_signature) = "parent"; 278 } 279 280 // List all Networks (and used IPs for each Network) in the vendor account 281 // associated with the specified project. 282 rpc ListNetworkUsage(ListNetworkUsageRequest) 283 returns (ListNetworkUsageResponse) { 284 option (google.api.http) = { 285 get: "/v2/{location=projects/*/locations/*}/networks:listNetworkUsage" 286 }; 287 option (google.api.method_signature) = "location"; 288 } 289 290 // Get details of a single network. 291 rpc GetNetwork(GetNetworkRequest) returns (Network) { 292 option (google.api.http) = { 293 get: "/v2/{name=projects/*/locations/*/networks/*}" 294 }; 295 option (google.api.method_signature) = "name"; 296 } 297 298 // Update details of a single network. 299 rpc UpdateNetwork(UpdateNetworkRequest) 300 returns (google.longrunning.Operation) { 301 option (google.api.http) = { 302 patch: "/v2/{network.name=projects/*/locations/*/networks/*}" 303 body: "network" 304 }; 305 option (google.api.method_signature) = "network,update_mask"; 306 option (google.longrunning.operation_info) = { 307 response_type: "Network" 308 metadata_type: "OperationMetadata" 309 }; 310 } 311 312 // Takes a snapshot of a boot volume. 313 // Returns INVALID_ARGUMENT if called for a non-boot volume. 314 rpc CreateVolumeSnapshot(CreateVolumeSnapshotRequest) 315 returns (VolumeSnapshot) { 316 option (google.api.http) = { 317 post: "/v2/{parent=projects/*/locations/*/volumes/*}/snapshots" 318 body: "volume_snapshot" 319 }; 320 option (google.api.method_signature) = "parent,volume_snapshot"; 321 } 322 323 // Uses the specified snapshot to restore its parent volume. 324 // Returns INVALID_ARGUMENT if called for a non-boot volume. 325 rpc RestoreVolumeSnapshot(RestoreVolumeSnapshotRequest) 326 returns (google.longrunning.Operation) { 327 option (google.api.http) = { 328 post: "/v2/{volume_snapshot=projects/*/locations/*/volumes/*/snapshots/*}:restoreVolumeSnapshot" 329 body: "*" 330 }; 331 option (google.api.method_signature) = "volume_snapshot"; 332 option (google.longrunning.operation_info) = { 333 response_type: "VolumeSnapshot" 334 metadata_type: "OperationMetadata" 335 }; 336 } 337 338 // Deletes a volume snapshot. 339 // Returns INVALID_ARGUMENT if called for a non-boot volume. 340 rpc DeleteVolumeSnapshot(DeleteVolumeSnapshotRequest) 341 returns (google.protobuf.Empty) { 342 option (google.api.http) = { 343 delete: "/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}" 344 }; 345 option (google.api.method_signature) = "name"; 346 } 347 348 // Returns the specified snapshot resource. 349 // Returns INVALID_ARGUMENT if called for a non-boot volume. 350 rpc GetVolumeSnapshot(GetVolumeSnapshotRequest) returns (VolumeSnapshot) { 351 option (google.api.http) = { 352 get: "/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}" 353 }; 354 option (google.api.method_signature) = "name"; 355 } 356 357 // Retrieves the list of snapshots for the specified volume. 358 // Returns a response with an empty list of snapshots if called 359 // for a non-boot volume. 360 rpc ListVolumeSnapshots(ListVolumeSnapshotsRequest) 361 returns (ListVolumeSnapshotsResponse) { 362 option (google.api.http) = { 363 get: "/v2/{parent=projects/*/locations/*/volumes/*}/snapshots" 364 }; 365 option (google.api.method_signature) = "parent"; 366 } 367 368 // Get details of a single storage logical unit number(LUN). 369 rpc GetLun(GetLunRequest) returns (Lun) { 370 option (google.api.http) = { 371 get: "/v2/{name=projects/*/locations/*/volumes/*/luns/*}" 372 }; 373 option (google.api.method_signature) = "name"; 374 } 375 376 // List storage volume luns for given storage volume. 377 rpc ListLuns(ListLunsRequest) returns (ListLunsResponse) { 378 option (google.api.http) = { 379 get: "/v2/{parent=projects/*/locations/*/volumes/*}/luns" 380 }; 381 option (google.api.method_signature) = "parent"; 382 } 383 384 // Skips lun's cooloff and deletes it now. 385 // Lun must be in cooloff state. 386 rpc EvictLun(EvictLunRequest) returns (google.longrunning.Operation) { 387 option (google.api.http) = { 388 post: "/v2/{name=projects/*/locations/*/volumes/*/luns/*}:evict" 389 body: "*" 390 }; 391 option (google.api.method_signature) = "name"; 392 option (google.longrunning.operation_info) = { 393 response_type: "google.protobuf.Empty" 394 metadata_type: "OperationMetadata" 395 }; 396 } 397 398 // Get details of a single NFS share. 399 rpc GetNfsShare(GetNfsShareRequest) returns (NfsShare) { 400 option (google.api.http) = { 401 get: "/v2/{name=projects/*/locations/*/nfsShares/*}" 402 }; 403 option (google.api.method_signature) = "name"; 404 } 405 406 // List NFS shares. 407 rpc ListNfsShares(ListNfsSharesRequest) returns (ListNfsSharesResponse) { 408 option (google.api.http) = { 409 get: "/v2/{parent=projects/*/locations/*}/nfsShares" 410 }; 411 option (google.api.method_signature) = "parent"; 412 } 413 414 // Update details of a single NFS share. 415 rpc UpdateNfsShare(UpdateNfsShareRequest) 416 returns (google.longrunning.Operation) { 417 option (google.api.http) = { 418 patch: "/v2/{nfs_share.name=projects/*/locations/*/nfsShares/*}" 419 body: "nfs_share" 420 }; 421 option (google.api.method_signature) = "nfs_share,update_mask"; 422 option (google.longrunning.operation_info) = { 423 response_type: "NfsShare" 424 metadata_type: "OperationMetadata" 425 }; 426 } 427 428 // Create an NFS share. 429 rpc CreateNfsShare(CreateNfsShareRequest) 430 returns (google.longrunning.Operation) { 431 option (google.api.http) = { 432 post: "/v2/{parent=projects/*/locations/*}/nfsShares" 433 body: "nfs_share" 434 }; 435 option (google.api.method_signature) = "parent,nfs_share"; 436 option (google.longrunning.operation_info) = { 437 response_type: "NfsShare" 438 metadata_type: "OperationMetadata" 439 }; 440 } 441 442 // RenameNfsShare sets a new name for an nfsshare. 443 // Use with caution, previous names become immediately invalidated. 444 rpc RenameNfsShare(RenameNfsShareRequest) returns (NfsShare) { 445 option (google.api.http) = { 446 post: "/v2/{name=projects/*/locations/*/nfsShares/*}:rename" 447 body: "*" 448 }; 449 option (google.api.method_signature) = "name,new_nfsshare_id"; 450 } 451 452 // Delete an NFS share. The underlying volume is automatically deleted. 453 rpc DeleteNfsShare(DeleteNfsShareRequest) 454 returns (google.longrunning.Operation) { 455 option (google.api.http) = { 456 delete: "/v2/{name=projects/*/locations/*/nfsShares/*}" 457 }; 458 option (google.api.method_signature) = "name"; 459 option (google.longrunning.operation_info) = { 460 response_type: "google.protobuf.Empty" 461 metadata_type: "OperationMetadata" 462 }; 463 } 464 465 // List the budget details to provision resources on a given project. 466 rpc ListProvisioningQuotas(ListProvisioningQuotasRequest) 467 returns (ListProvisioningQuotasResponse) { 468 option (google.api.http) = { 469 get: "/v2/{parent=projects/*/locations/*}/provisioningQuotas" 470 }; 471 option (google.api.method_signature) = "parent"; 472 } 473 474 // Submit a provisiong configuration for a given project. 475 rpc SubmitProvisioningConfig(SubmitProvisioningConfigRequest) 476 returns (SubmitProvisioningConfigResponse) { 477 option (google.api.http) = { 478 post: "/v2/{parent=projects/*/locations/*}/provisioningConfigs:submit" 479 body: "*" 480 }; 481 option (google.api.method_signature) = "parent,provisioning_config"; 482 } 483 484 // Get ProvisioningConfig by name. 485 rpc GetProvisioningConfig(GetProvisioningConfigRequest) 486 returns (ProvisioningConfig) { 487 option (google.api.http) = { 488 get: "/v2/{name=projects/*/locations/*/provisioningConfigs/*}" 489 }; 490 option (google.api.method_signature) = "name"; 491 } 492 493 // Create new ProvisioningConfig. 494 rpc CreateProvisioningConfig(CreateProvisioningConfigRequest) 495 returns (ProvisioningConfig) { 496 option (google.api.http) = { 497 post: "/v2/{parent=projects/*/locations/*}/provisioningConfigs" 498 body: "provisioning_config" 499 }; 500 option (google.api.method_signature) = "parent,provisioning_config"; 501 } 502 503 // Update existing ProvisioningConfig. 504 rpc UpdateProvisioningConfig(UpdateProvisioningConfigRequest) 505 returns (ProvisioningConfig) { 506 option (google.api.http) = { 507 patch: "/v2/{provisioning_config.name=projects/*/locations/*/provisioningConfigs/*}" 508 body: "provisioning_config" 509 }; 510 option (google.api.method_signature) = "provisioning_config,update_mask"; 511 } 512 513 // RenameNetwork sets a new name for a network. 514 // Use with caution, previous names become immediately invalidated. 515 rpc RenameNetwork(RenameNetworkRequest) returns (Network) { 516 option (google.api.http) = { 517 post: "/v2/{name=projects/*/locations/*/networks/*}:rename" 518 body: "*" 519 }; 520 option (google.api.method_signature) = "name,new_network_id"; 521 } 522 523 // Retrieves the list of OS images which are currently approved. 524 rpc ListOSImages(ListOSImagesRequest) returns (ListOSImagesResponse) { 525 option (google.api.http) = { 526 get: "/v2/{parent=projects/*/locations/*}/osImages" 527 }; 528 option (google.api.method_signature) = "parent"; 529 } 530} 531 532// Represents the metadata from a long-running operation. 533message OperationMetadata { 534 // Output only. The time the operation was created. 535 google.protobuf.Timestamp create_time = 1 536 [(google.api.field_behavior) = OUTPUT_ONLY]; 537 538 // Output only. The time the operation finished running. 539 google.protobuf.Timestamp end_time = 2 540 [(google.api.field_behavior) = OUTPUT_ONLY]; 541 542 // Output only. Server-defined resource path for the target of the operation. 543 string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 544 545 // Output only. Name of the action executed by the operation. 546 string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 547 548 // Output only. Human-readable status of the operation, if any. 549 string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 550 551 // Output only. Identifies whether the user requested the cancellation 552 // of the operation. Operations that have been successfully cancelled 553 // have [Operation.error][] value with a 554 // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 555 // `Code.CANCELLED`. 556 bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 557 558 // Output only. API version used with the operation. 559 string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 560} 561 562// Response message from resetting a server. 563message ResetInstanceResponse {} 564