baremetalsolution.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.baremetalsolution.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/cloud/baremetalsolution/v2/instance.proto";
  20. import "google/cloud/baremetalsolution/v2/lun.proto";
  21. import "google/cloud/baremetalsolution/v2/network.proto";
  22. import "google/cloud/baremetalsolution/v2/nfs_share.proto";
  23. import "google/cloud/baremetalsolution/v2/volume.proto";
  24. import "google/longrunning/operations.proto";
  25. import "google/protobuf/timestamp.proto";
  26. option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2;baremetalsolution";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "BareMetalSolutionProto";
  30. option java_package = "com.google.cloud.baremetalsolution.v2";
  31. option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
  32. option ruby_package = "Google::Cloud::BareMetalSolution::V2";
  33. // Performs management operations on Bare Metal Solution servers.
  34. //
  35. // The `baremetalsolution.googleapis.com` service provides management
  36. // capabilities for Bare Metal Solution servers. To access the API methods, you
  37. // must assign Bare Metal Solution IAM roles containing the desired permissions
  38. // to your staff in your Google Cloud project. You must also enable the Bare
  39. // Metal Solution API. Once enabled, the methods act
  40. // upon specific servers in your Bare Metal Solution environment.
  41. service BareMetalSolution {
  42. option (google.api.default_host) = "baremetalsolution.googleapis.com";
  43. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  44. // List servers in a given project and location.
  45. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
  46. option (google.api.http) = {
  47. get: "/v2/{parent=projects/*/locations/*}/instances"
  48. };
  49. option (google.api.method_signature) = "parent";
  50. }
  51. // Get details about a single server.
  52. rpc GetInstance(GetInstanceRequest) returns (Instance) {
  53. option (google.api.http) = {
  54. get: "/v2/{name=projects/*/locations/*/instances/*}"
  55. };
  56. option (google.api.method_signature) = "name";
  57. }
  58. // Update details of a single server.
  59. rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
  60. option (google.api.http) = {
  61. patch: "/v2/{instance.name=projects/*/locations/*/instances/*}"
  62. body: "instance"
  63. };
  64. option (google.api.method_signature) = "instance,update_mask";
  65. option (google.longrunning.operation_info) = {
  66. response_type: "Instance"
  67. metadata_type: "OperationMetadata"
  68. };
  69. }
  70. // Perform an ungraceful, hard reset on a server. Equivalent to shutting the
  71. // power off and then turning it back on.
  72. rpc ResetInstance(ResetInstanceRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. post: "/v2/{name=projects/*/locations/*/instances/*}:reset"
  75. body: "*"
  76. };
  77. option (google.api.method_signature) = "name";
  78. option (google.longrunning.operation_info) = {
  79. response_type: "ResetInstanceResponse"
  80. metadata_type: "OperationMetadata"
  81. };
  82. }
  83. // Starts a server that was shutdown.
  84. rpc StartInstance(StartInstanceRequest) returns (google.longrunning.Operation) {
  85. option (google.api.http) = {
  86. post: "/v2/{name=projects/*/locations/*/instances/*}:start"
  87. body: "*"
  88. };
  89. option (google.api.method_signature) = "name";
  90. option (google.longrunning.operation_info) = {
  91. response_type: "StartInstanceResponse"
  92. metadata_type: "OperationMetadata"
  93. };
  94. }
  95. // Stop a running server.
  96. rpc StopInstance(StopInstanceRequest) returns (google.longrunning.Operation) {
  97. option (google.api.http) = {
  98. post: "/v2/{name=projects/*/locations/*/instances/*}:stop"
  99. body: "*"
  100. };
  101. option (google.api.method_signature) = "name";
  102. option (google.longrunning.operation_info) = {
  103. response_type: "StopInstanceResponse"
  104. metadata_type: "OperationMetadata"
  105. };
  106. }
  107. // Detach LUN from Instance.
  108. rpc DetachLun(DetachLunRequest) returns (google.longrunning.Operation) {
  109. option (google.api.http) = {
  110. post: "/v2/{instance=projects/*/locations/*/instances/*}:detachLun"
  111. body: "*"
  112. };
  113. option (google.api.method_signature) = "instance,lun";
  114. option (google.longrunning.operation_info) = {
  115. response_type: "Instance"
  116. metadata_type: "OperationMetadata"
  117. };
  118. }
  119. // List storage volumes in a given project and location.
  120. rpc ListVolumes(ListVolumesRequest) returns (ListVolumesResponse) {
  121. option (google.api.http) = {
  122. get: "/v2/{parent=projects/*/locations/*}/volumes"
  123. };
  124. option (google.api.method_signature) = "parent";
  125. }
  126. // Get details of a single storage volume.
  127. rpc GetVolume(GetVolumeRequest) returns (Volume) {
  128. option (google.api.http) = {
  129. get: "/v2/{name=projects/*/locations/*/volumes/*}"
  130. };
  131. option (google.api.method_signature) = "name";
  132. }
  133. // Update details of a single storage volume.
  134. rpc UpdateVolume(UpdateVolumeRequest) returns (google.longrunning.Operation) {
  135. option (google.api.http) = {
  136. patch: "/v2/{volume.name=projects/*/locations/*/volumes/*}"
  137. body: "volume"
  138. };
  139. option (google.api.method_signature) = "volume,update_mask";
  140. option (google.longrunning.operation_info) = {
  141. response_type: "Volume"
  142. metadata_type: "OperationMetadata"
  143. };
  144. }
  145. // Emergency Volume resize.
  146. rpc ResizeVolume(ResizeVolumeRequest) returns (google.longrunning.Operation) {
  147. option (google.api.http) = {
  148. post: "/v2/{volume=projects/*/locations/*/volumes/*}:resize"
  149. body: "*"
  150. };
  151. option (google.api.method_signature) = "volume,size_gib";
  152. option (google.longrunning.operation_info) = {
  153. response_type: "Volume"
  154. metadata_type: "OperationMetadata"
  155. };
  156. }
  157. // List network in a given project and location.
  158. rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) {
  159. option (google.api.http) = {
  160. get: "/v2/{parent=projects/*/locations/*}/networks"
  161. };
  162. option (google.api.method_signature) = "parent";
  163. }
  164. // List all Networks (and used IPs for each Network) in the vendor account
  165. // associated with the specified project.
  166. rpc ListNetworkUsage(ListNetworkUsageRequest) returns (ListNetworkUsageResponse) {
  167. option (google.api.http) = {
  168. get: "/v2/{location=projects/*/locations/*}/networks:listNetworkUsage"
  169. };
  170. option (google.api.method_signature) = "location";
  171. }
  172. // Get details of a single network.
  173. rpc GetNetwork(GetNetworkRequest) returns (Network) {
  174. option (google.api.http) = {
  175. get: "/v2/{name=projects/*/locations/*/networks/*}"
  176. };
  177. option (google.api.method_signature) = "name";
  178. }
  179. // Update details of a single network.
  180. rpc UpdateNetwork(UpdateNetworkRequest) returns (google.longrunning.Operation) {
  181. option (google.api.http) = {
  182. patch: "/v2/{network.name=projects/*/locations/*/networks/*}"
  183. body: "network"
  184. };
  185. option (google.api.method_signature) = "network,update_mask";
  186. option (google.longrunning.operation_info) = {
  187. response_type: "Network"
  188. metadata_type: "OperationMetadata"
  189. };
  190. }
  191. // Get details of a single storage logical unit number(LUN).
  192. rpc GetLun(GetLunRequest) returns (Lun) {
  193. option (google.api.http) = {
  194. get: "/v2/{name=projects/*/locations/*/volumes/*/luns/*}"
  195. };
  196. option (google.api.method_signature) = "name";
  197. }
  198. // List storage volume luns for given storage volume.
  199. rpc ListLuns(ListLunsRequest) returns (ListLunsResponse) {
  200. option (google.api.http) = {
  201. get: "/v2/{parent=projects/*/locations/*/volumes/*}/luns"
  202. };
  203. option (google.api.method_signature) = "parent";
  204. }
  205. // Get details of a single NFS share.
  206. rpc GetNfsShare(GetNfsShareRequest) returns (NfsShare) {
  207. option (google.api.http) = {
  208. get: "/v2/{name=projects/*/locations/*/nfsShares/*}"
  209. };
  210. option (google.api.method_signature) = "name";
  211. }
  212. // List NFS shares.
  213. rpc ListNfsShares(ListNfsSharesRequest) returns (ListNfsSharesResponse) {
  214. option (google.api.http) = {
  215. get: "/v2/{parent=projects/*/locations/*}/nfsShares"
  216. };
  217. option (google.api.method_signature) = "parent";
  218. }
  219. // Update details of a single NFS share.
  220. rpc UpdateNfsShare(UpdateNfsShareRequest) returns (google.longrunning.Operation) {
  221. option (google.api.http) = {
  222. patch: "/v2/{nfs_share.name=projects/*/locations/*/nfsShares/*}"
  223. body: "nfs_share"
  224. };
  225. option (google.api.method_signature) = "nfs_share,update_mask";
  226. option (google.longrunning.operation_info) = {
  227. response_type: "NfsShare"
  228. metadata_type: "OperationMetadata"
  229. };
  230. }
  231. }
  232. // Represents the metadata from a long-running operation.
  233. message OperationMetadata {
  234. // The time the operation was created.
  235. google.protobuf.Timestamp create_time = 1
  236. [(google.api.field_behavior) = OUTPUT_ONLY];
  237. // The time the operation finished running.
  238. google.protobuf.Timestamp end_time = 2
  239. [(google.api.field_behavior) = OUTPUT_ONLY];
  240. // Server-defined resource path for the target of the operation.
  241. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  242. // Name of the action executed by the operation.
  243. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  244. // Human-readable status of the operation, if any.
  245. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  246. // Identifies whether the user requested the cancellation
  247. // of the operation. Operations that have been successfully cancelled
  248. // have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
  249. // corresponding to `Code.CANCELLED`.
  250. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  251. // API version used with the operation.
  252. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  253. }
  254. // Response message from resetting a server.
  255. message ResetInstanceResponse {
  256. }