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.rapidmigrationassessment.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/rapidmigrationassessment/v1/api_entities.proto"; 24import "google/longrunning/operations.proto"; 25import "google/protobuf/field_mask.proto"; 26import "google/protobuf/timestamp.proto"; 27 28option csharp_namespace = "Google.Cloud.RapidMigrationAssessment.V1"; 29option go_package = "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb"; 30option java_multiple_files = true; 31option java_outer_classname = "RapidMigrationAssessmentProto"; 32option java_package = "com.google.cloud.rapidmigrationassessment.v1"; 33option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; 34option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; 35 36// Service describing handlers for resources. 37service RapidMigrationAssessment { 38 option (google.api.default_host) = "rapidmigrationassessment.googleapis.com"; 39 option (google.api.oauth_scopes) = 40 "https://www.googleapis.com/auth/cloud-platform"; 41 42 // Create a Collector to manage the on-prem appliance which collects 43 // information about Customer assets. 44 rpc CreateCollector(CreateCollectorRequest) 45 returns (google.longrunning.Operation) { 46 option (google.api.http) = { 47 post: "/v1/{parent=projects/*/locations/*}/collectors" 48 body: "collector" 49 }; 50 option (google.api.method_signature) = "parent,collector,collector_id"; 51 option (google.longrunning.operation_info) = { 52 response_type: "Collector" 53 metadata_type: "OperationMetadata" 54 }; 55 } 56 57 // Creates an Annotation 58 rpc CreateAnnotation(CreateAnnotationRequest) 59 returns (google.longrunning.Operation) { 60 option (google.api.http) = { 61 post: "/v1/{parent=projects/*/locations/*}/annotations" 62 body: "annotation" 63 }; 64 option (google.api.method_signature) = "parent,annotation"; 65 option (google.longrunning.operation_info) = { 66 response_type: "Annotation" 67 metadata_type: "OperationMetadata" 68 }; 69 } 70 71 // Gets details of a single Annotation. 72 rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) { 73 option (google.api.http) = { 74 get: "/v1/{name=projects/*/locations/*/annotations/*}" 75 }; 76 option (google.api.method_signature) = "name"; 77 } 78 79 // Lists Collectors in a given project and location. 80 rpc ListCollectors(ListCollectorsRequest) returns (ListCollectorsResponse) { 81 option (google.api.http) = { 82 get: "/v1/{parent=projects/*/locations/*}/collectors" 83 }; 84 option (google.api.method_signature) = "parent"; 85 } 86 87 // Gets details of a single Collector. 88 rpc GetCollector(GetCollectorRequest) returns (Collector) { 89 option (google.api.http) = { 90 get: "/v1/{name=projects/*/locations/*/collectors/*}" 91 }; 92 option (google.api.method_signature) = "name"; 93 } 94 95 // Updates the parameters of a single Collector. 96 rpc UpdateCollector(UpdateCollectorRequest) 97 returns (google.longrunning.Operation) { 98 option (google.api.http) = { 99 patch: "/v1/{collector.name=projects/*/locations/*/collectors/*}" 100 body: "collector" 101 }; 102 option (google.api.method_signature) = "collector,update_mask"; 103 option (google.longrunning.operation_info) = { 104 response_type: "Collector" 105 metadata_type: "OperationMetadata" 106 }; 107 } 108 109 // Deletes a single Collector - changes state of collector to "Deleting". 110 // Background jobs does final deletion thorugh producer api. 111 rpc DeleteCollector(DeleteCollectorRequest) 112 returns (google.longrunning.Operation) { 113 option (google.api.http) = { 114 delete: "/v1/{name=projects/*/locations/*/collectors/*}" 115 }; 116 option (google.api.method_signature) = "name"; 117 option (google.longrunning.operation_info) = { 118 response_type: "Collector" 119 metadata_type: "OperationMetadata" 120 }; 121 } 122 123 // Resumes the given collector. 124 rpc ResumeCollector(ResumeCollectorRequest) 125 returns (google.longrunning.Operation) { 126 option (google.api.http) = { 127 post: "/v1/{name=projects/*/locations/*/collectors/*}:resume" 128 body: "*" 129 }; 130 option (google.api.method_signature) = "name"; 131 option (google.longrunning.operation_info) = { 132 response_type: "Collector" 133 metadata_type: "OperationMetadata" 134 }; 135 } 136 137 // Registers the given collector. 138 rpc RegisterCollector(RegisterCollectorRequest) 139 returns (google.longrunning.Operation) { 140 option (google.api.http) = { 141 post: "/v1/{name=projects/*/locations/*/collectors/*}:register" 142 body: "*" 143 }; 144 option (google.api.method_signature) = "name"; 145 option (google.longrunning.operation_info) = { 146 response_type: "Collector" 147 metadata_type: "OperationMetadata" 148 }; 149 } 150 151 // Pauses the given collector. 152 rpc PauseCollector(PauseCollectorRequest) 153 returns (google.longrunning.Operation) { 154 option (google.api.http) = { 155 post: "/v1/{name=projects/*/locations/*/collectors/*}:pause" 156 body: "*" 157 }; 158 option (google.api.method_signature) = "name"; 159 option (google.longrunning.operation_info) = { 160 response_type: "Collector" 161 metadata_type: "OperationMetadata" 162 }; 163 } 164} 165 166// Message for creating an AnnotationS. 167message CreateAnnotationRequest { 168 // Required. Name of the parent (project+location). 169 string parent = 1 [ 170 (google.api.field_behavior) = REQUIRED, 171 (google.api.resource_reference) = { 172 type: "locations.googleapis.com/Location" 173 } 174 ]; 175 176 // Required. The resource being created. 177 Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; 178 179 // Optional. An optional request ID to identify requests. 180 string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; 181} 182 183// Message for getting a specific Annotation 184message GetAnnotationRequest { 185 // Required. Name of the resource. 186 string name = 1 [ 187 (google.api.field_behavior) = REQUIRED, 188 (google.api.resource_reference) = { 189 type: "rapidmigrationassessment.googleapis.com/Annotation" 190 } 191 ]; 192} 193 194// Message for creating a Collector. 195message CreateCollectorRequest { 196 // Required. Name of the parent (project+location). 197 string parent = 1 [ 198 (google.api.field_behavior) = REQUIRED, 199 (google.api.resource_reference) = { 200 type: "locations.googleapis.com/Location" 201 } 202 ]; 203 204 // Required. Id of the requesting object. 205 string collector_id = 2 [(google.api.field_behavior) = REQUIRED]; 206 207 // Required. The resource being created. 208 Collector collector = 3 [(google.api.field_behavior) = REQUIRED]; 209 210 // Optional. An optional request ID to identify requests. 211 string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; 212} 213 214// Message for requesting list of Collectors. 215message ListCollectorsRequest { 216 // Required. Parent value for ListCollectorsRequest. 217 string parent = 1 [ 218 (google.api.field_behavior) = REQUIRED, 219 (google.api.resource_reference) = { 220 type: "locations.googleapis.com/Location" 221 } 222 ]; 223 224 // Requested page size. Server may return fewer items than requested. 225 // If unspecified, server will pick an appropriate default. 226 int32 page_size = 2; 227 228 // A token identifying a page of results the server should return. 229 string page_token = 3; 230 231 // Filtering results. 232 string filter = 4; 233 234 // Hint for how to order the results. 235 string order_by = 5; 236} 237 238// Message for response to listing Collectors. 239message ListCollectorsResponse { 240 // The list of Collectors. 241 repeated Collector collectors = 1; 242 243 // A token identifying a page of results the server should return. 244 string next_page_token = 2; 245 246 // Locations that could not be reached. 247 repeated string unreachable = 3; 248} 249 250// Message for getting a specific Collector. 251message GetCollectorRequest { 252 // Required. Name of the resource. 253 string name = 1 [ 254 (google.api.field_behavior) = REQUIRED, 255 (google.api.resource_reference) = { 256 type: "rapidmigrationassessment.googleapis.com/Collector" 257 } 258 ]; 259} 260 261// Message for deleting a Collector. 262message DeleteCollectorRequest { 263 // Required. Name of the resource. 264 string name = 1 [ 265 (google.api.field_behavior) = REQUIRED, 266 (google.api.resource_reference) = { 267 type: "rapidmigrationassessment.googleapis.com/Collector" 268 } 269 ]; 270 271 // Optional. An optional request ID to identify requests. Specify a unique 272 // request ID so that if you must retry your request, the server will know to 273 // ignore the request if it has already been completed. The server will 274 // guarantee that for at least 60 minutes after the first request. 275 // 276 // For example, consider a situation where you make an initial request and 277 // the request times out. If you make the request again with the same request 278 // ID, the server can check if original operation with the same request ID 279 // was received, and if so, will ignore the second request. This prevents 280 // clients from accidentally creating duplicate commitments. 281 // 282 // The request ID must be a valid UUID with the exception that zero UUID is 283 // not supported (00000000-0000-0000-0000-000000000000). 284 string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; 285} 286 287// Message for updating a Collector. 288message UpdateCollectorRequest { 289 // Required. Field mask is used to specify the fields to be overwritten in the 290 // Collector resource by the update. 291 // The fields specified in the update_mask are relative to the resource, not 292 // the full request. A field will be overwritten if it is in the mask. If the 293 // user does not provide a mask then all fields will be overwritten. 294 google.protobuf.FieldMask update_mask = 1 295 [(google.api.field_behavior) = REQUIRED]; 296 297 // Required. The resource being updated. 298 Collector collector = 2 [(google.api.field_behavior) = REQUIRED]; 299 300 // Optional. An optional request ID to identify requests. Specify a unique 301 // request ID so that if you must retry your request, the server will know to 302 // ignore the request if it has already been completed. The server will 303 // guarantee that for at least 60 minutes since the first request. 304 // 305 // For example, consider a situation where you make an initial request and 306 // the request times out. If you make the request again with the same request 307 // ID, the server can check if original operation with the same request ID 308 // was received, and if so, will ignore the second request. This prevents 309 // clients from accidentally creating duplicate commitments. 310 // 311 // The request ID must be a valid UUID with the exception that zero UUID is 312 // not supported (00000000-0000-0000-0000-000000000000). 313 string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; 314} 315 316// Message for resuming a Collector. 317message ResumeCollectorRequest { 318 // Required. Name of the resource. 319 string name = 1 [ 320 (google.api.field_behavior) = REQUIRED, 321 (google.api.resource_reference) = { 322 type: "rapidmigrationassessment.googleapis.com/Collector" 323 } 324 ]; 325 326 // Optional. An optional request ID to identify requests. Specify a unique 327 // request ID so that if you must retry your request, the server will know to 328 // ignore the request if it has already been completed. The server will 329 // guarantee that for at least 60 minutes after the first request. 330 // 331 // For example, consider a situation where you make an initial request and 332 // the request times out. If you make the request again with the same request 333 // ID, the server can check if original operation with the same request ID 334 // was received, and if so, will ignore the second request. This prevents 335 // clients from accidentally creating duplicate commitments. 336 // 337 // The request ID must be a valid UUID with the exception that zero UUID is 338 // not supported (00000000-0000-0000-0000-000000000000). 339 string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; 340} 341 342// Message for registering a Collector. 343message RegisterCollectorRequest { 344 // Required. Name of the resource. 345 string name = 1 [ 346 (google.api.field_behavior) = REQUIRED, 347 (google.api.resource_reference) = { 348 type: "rapidmigrationassessment.googleapis.com/Collector" 349 } 350 ]; 351 352 // Optional. An optional request ID to identify requests. Specify a unique 353 // request ID so that if you must retry your request, the server will know to 354 // ignore the request if it has already been completed. The server will 355 // guarantee that for at least 60 minutes after the first request. 356 // 357 // For example, consider a situation where you make an initial request and 358 // the request times out. If you make the request again with the same request 359 // ID, the server can check if original operation with the same request ID 360 // was received, and if so, will ignore the second request. This prevents 361 // clients from accidentally creating duplicate commitments. 362 // 363 // The request ID must be a valid UUID with the exception that zero UUID is 364 // not supported (00000000-0000-0000-0000-000000000000). 365 string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; 366} 367 368// Message for pausing a Collector. 369message PauseCollectorRequest { 370 // Required. Name of the resource. 371 string name = 1 [ 372 (google.api.field_behavior) = REQUIRED, 373 (google.api.resource_reference) = { 374 type: "rapidmigrationassessment.googleapis.com/Collector" 375 } 376 ]; 377 378 // Optional. An optional request ID to identify requests. Specify a unique 379 // request ID so that if you must retry your request, the server will know to 380 // ignore the request if it has already been completed. The server will 381 // guarantee that for at least 60 minutes after the first request. 382 // 383 // For example, consider a situation where you make an initial request and 384 // the request times out. If you make the request again with the same request 385 // ID, the server can check if original operation with the same request ID 386 // was received, and if so, will ignore the second request. This prevents 387 // clients from accidentally creating duplicate commitments. 388 // 389 // The request ID must be a valid UUID with the exception that zero UUID is 390 // not supported (00000000-0000-0000-0000-000000000000). 391 string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; 392} 393 394// Represents the metadata of the long-running operation. 395message OperationMetadata { 396 // Output only. The time the operation was created. 397 google.protobuf.Timestamp create_time = 1 398 [(google.api.field_behavior) = OUTPUT_ONLY]; 399 400 // Output only. The time the operation finished running. 401 google.protobuf.Timestamp end_time = 2 402 [(google.api.field_behavior) = OUTPUT_ONLY]; 403 404 // Output only. Server-defined resource path for the target of the operation. 405 string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 406 407 // Output only. Name of the verb executed by the operation. 408 string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 409 410 // Output only. Human-readable status of the operation, if any. 411 string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 412 413 // Output only. Identifies whether the user has requested cancellation 414 // of the operation. Operations that have successfully been cancelled 415 // have [Operation.error][] value with a 416 // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 417 // `Code.CANCELLED`. 418 bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 419 420 // Output only. API version used to start the operation. 421 string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 422} 423