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.storagetransfer.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/longrunning/operations.proto"; 23import "google/protobuf/empty.proto"; 24import "google/protobuf/field_mask.proto"; 25import "google/storagetransfer/v1/transfer_types.proto"; 26 27option cc_enable_arenas = true; 28option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; 29option go_package = "cloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb"; 30option java_outer_classname = "TransferProto"; 31option java_package = "com.google.storagetransfer.v1.proto"; 32option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; 33option ruby_package = "Google::Cloud::StorageTransfer::V1"; 34 35// Storage Transfer Service and its protos. 36// Transfers data between between Google Cloud Storage buckets or from a data 37// source external to Google to a Cloud Storage bucket. 38service StorageTransferService { 39 option (google.api.default_host) = "storagetransfer.googleapis.com"; 40 option (google.api.oauth_scopes) = 41 "https://www.googleapis.com/auth/cloud-platform"; 42 43 // Returns the Google service account that is used by Storage Transfer 44 // Service to access buckets in the project where transfers 45 // run or in other projects. Each Google service account is associated 46 // with one Google Cloud project. Users 47 // should add this service account to the Google Cloud Storage bucket 48 // ACLs to grant access to Storage Transfer Service. This service 49 // account is created and owned by Storage Transfer Service and can 50 // only be used by Storage Transfer Service. 51 rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) 52 returns (GoogleServiceAccount) { 53 option (google.api.http) = { 54 get: "/v1/googleServiceAccounts/{project_id}" 55 }; 56 } 57 58 // Creates a transfer job that runs periodically. 59 rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) { 60 option (google.api.http) = { 61 post: "/v1/transferJobs" 62 body: "transfer_job" 63 }; 64 } 65 66 // Updates a transfer job. Updating a job's transfer spec does not affect 67 // transfer operations that are running already. 68 // 69 // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] 70 // field can be modified using this RPC (for example, to set a job's status to 71 // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], 72 // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or 73 // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). 74 rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) { 75 option (google.api.http) = { 76 patch: "/v1/{job_name=transferJobs/**}" 77 body: "*" 78 }; 79 } 80 81 // Gets a transfer job. 82 rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) { 83 option (google.api.http) = { 84 get: "/v1/{job_name=transferJobs/**}" 85 }; 86 } 87 88 // Lists transfer jobs. 89 rpc ListTransferJobs(ListTransferJobsRequest) 90 returns (ListTransferJobsResponse) { 91 option (google.api.http) = { 92 get: "/v1/transferJobs" 93 }; 94 } 95 96 // Pauses a transfer operation. 97 rpc PauseTransferOperation(PauseTransferOperationRequest) 98 returns (google.protobuf.Empty) { 99 option (google.api.http) = { 100 post: "/v1/{name=transferOperations/**}:pause" 101 body: "*" 102 }; 103 } 104 105 // Resumes a transfer operation that is paused. 106 rpc ResumeTransferOperation(ResumeTransferOperationRequest) 107 returns (google.protobuf.Empty) { 108 option (google.api.http) = { 109 post: "/v1/{name=transferOperations/**}:resume" 110 body: "*" 111 }; 112 } 113 114 // Starts a new operation for the specified transfer job. 115 // A `TransferJob` has a maximum of one active `TransferOperation`. If this 116 // method is called while a `TransferOperation` is active, an error is 117 // returned. 118 rpc RunTransferJob(RunTransferJobRequest) 119 returns (google.longrunning.Operation) { 120 option (google.api.http) = { 121 post: "/v1/{job_name=transferJobs/**}:run" 122 body: "*" 123 }; 124 option (google.longrunning.operation_info) = { 125 response_type: "google.protobuf.Empty" 126 metadata_type: "TransferOperation" 127 }; 128 } 129 130 // Deletes a transfer job. Deleting a transfer job sets its status to 131 // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. 132 rpc DeleteTransferJob(DeleteTransferJobRequest) 133 returns (google.protobuf.Empty) { 134 option (google.api.http) = { 135 delete: "/v1/{job_name=transferJobs/**}" 136 }; 137 } 138 139 // Creates an agent pool resource. 140 rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) { 141 option (google.api.http) = { 142 post: "/v1/projects/{project_id=*}/agentPools" 143 body: "agent_pool" 144 }; 145 option (google.api.method_signature) = 146 "project_id,agent_pool,agent_pool_id"; 147 } 148 149 // Updates an existing agent pool resource. 150 rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) { 151 option (google.api.http) = { 152 patch: "/v1/{agent_pool.name=projects/*/agentPools/*}" 153 body: "agent_pool" 154 }; 155 option (google.api.method_signature) = "agent_pool,update_mask"; 156 } 157 158 // Gets an agent pool. 159 rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) { 160 option (google.api.http) = { 161 get: "/v1/{name=projects/*/agentPools/*}" 162 }; 163 option (google.api.method_signature) = "name"; 164 } 165 166 // Lists agent pools. 167 rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) { 168 option (google.api.http) = { 169 get: "/v1/projects/{project_id=*}/agentPools" 170 }; 171 option (google.api.method_signature) = "project_id"; 172 } 173 174 // Deletes an agent pool. 175 rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) { 176 option (google.api.http) = { 177 delete: "/v1/{name=projects/*/agentPools/*}" 178 }; 179 option (google.api.method_signature) = "name"; 180 } 181} 182 183// Request passed to GetGoogleServiceAccount. 184message GetGoogleServiceAccountRequest { 185 // Required. The ID of the Google Cloud project that the Google service 186 // account is associated with. 187 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 188} 189 190// Request passed to CreateTransferJob. 191message CreateTransferJobRequest { 192 // Required. The job to create. 193 TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED]; 194} 195 196// Request passed to UpdateTransferJob. 197message UpdateTransferJobRequest { 198 // Required. The name of job to update. 199 string job_name = 1 [(google.api.field_behavior) = REQUIRED]; 200 201 // Required. The ID of the Google Cloud project that owns the 202 // job. 203 string project_id = 2 [(google.api.field_behavior) = REQUIRED]; 204 205 // Required. The job to update. `transferJob` is expected to specify one or 206 // more of five fields: 207 // [description][google.storagetransfer.v1.TransferJob.description], 208 // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], 209 // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], 210 // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and 211 // [status][google.storagetransfer.v1.TransferJob.status]. An 212 // `UpdateTransferJobRequest` that specifies other fields are rejected with 213 // the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a 214 // job status to 215 // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires 216 // `storagetransfer.jobs.delete` permission. 217 TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED]; 218 219 // The field mask of the fields in `transferJob` that are to be updated in 220 // this request. Fields in `transferJob` that can be updated are: 221 // [description][google.storagetransfer.v1.TransferJob.description], 222 // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], 223 // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], 224 // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and 225 // [status][google.storagetransfer.v1.TransferJob.status]. To update the 226 // `transfer_spec` of the job, a complete transfer specification must be 227 // provided. An incomplete specification missing any required fields is 228 // rejected with the error 229 // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. 230 google.protobuf.FieldMask update_transfer_job_field_mask = 4; 231} 232 233// Request passed to GetTransferJob. 234message GetTransferJobRequest { 235 // Required. The job to get. 236 string job_name = 1 [(google.api.field_behavior) = REQUIRED]; 237 238 // Required. The ID of the Google Cloud project that owns the 239 // job. 240 string project_id = 2 [(google.api.field_behavior) = REQUIRED]; 241} 242 243// Request passed to DeleteTransferJob. 244message DeleteTransferJobRequest { 245 // Required. The job to delete. 246 string job_name = 1 [(google.api.field_behavior) = REQUIRED]; 247 248 // Required. The ID of the Google Cloud project that owns the 249 // job. 250 string project_id = 2 [(google.api.field_behavior) = REQUIRED]; 251} 252 253// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can 254// be specified when listing transfer jobs. 255message ListTransferJobsRequest { 256 // Required. A list of query parameters specified as JSON text in the form of: 257 // `{"projectId":"my_project_id", 258 // "jobNames":["jobid1","jobid2",...], 259 // "jobStatuses":["status1","status2",...]}` 260 // 261 // Since `jobNames` and `jobStatuses` support multiple values, their values 262 // must be specified with array notation. `projectId` is required. 263 // `jobNames` and `jobStatuses` are optional. The valid values for 264 // `jobStatuses` are case-insensitive: 265 // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED], 266 // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and 267 // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. 268 string filter = 1 [(google.api.field_behavior) = REQUIRED]; 269 270 // The list page size. The max allowed value is 256. 271 int32 page_size = 4; 272 273 // The list page token. 274 string page_token = 5; 275} 276 277// Response from ListTransferJobs. 278message ListTransferJobsResponse { 279 // A list of transfer jobs. 280 repeated TransferJob transfer_jobs = 1; 281 282 // The list next page token. 283 string next_page_token = 2; 284} 285 286// Request passed to PauseTransferOperation. 287message PauseTransferOperationRequest { 288 // Required. The name of the transfer operation. 289 string name = 1 [(google.api.field_behavior) = REQUIRED]; 290} 291 292// Request passed to ResumeTransferOperation. 293message ResumeTransferOperationRequest { 294 // Required. The name of the transfer operation. 295 string name = 1 [(google.api.field_behavior) = REQUIRED]; 296} 297 298// Request passed to RunTransferJob. 299message RunTransferJobRequest { 300 // Required. The name of the transfer job. 301 string job_name = 1 [(google.api.field_behavior) = REQUIRED]; 302 303 // Required. The ID of the Google Cloud project that owns the transfer 304 // job. 305 string project_id = 2 [(google.api.field_behavior) = REQUIRED]; 306} 307 308// Specifies the request passed to CreateAgentPool. 309message CreateAgentPoolRequest { 310 // Required. The ID of the Google Cloud project that owns the 311 // agent pool. 312 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 313 314 // Required. The agent pool to create. 315 AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED]; 316 317 // Required. The ID of the agent pool to create. 318 // 319 // The `agent_pool_id` must meet the following requirements: 320 // 321 // * Length of 128 characters or less. 322 // * Not start with the string `goog`. 323 // * Start with a lowercase ASCII character, followed by: 324 // * Zero or more: lowercase Latin alphabet characters, numerals, 325 // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). 326 // * One or more numerals or lowercase ASCII characters. 327 // 328 // As expressed by the regular expression: 329 // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. 330 string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; 331} 332 333// Specifies the request passed to UpdateAgentPool. 334message UpdateAgentPoolRequest { 335 // Required. The agent pool to update. `agent_pool` is expected to specify 336 // following fields: 337 // 338 // * [name][google.storagetransfer.v1.AgentPool.name] 339 // 340 // * [display_name][google.storagetransfer.v1.AgentPool.display_name] 341 // 342 // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] 343 // An `UpdateAgentPoolRequest` with any other fields is rejected 344 // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. 345 AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED]; 346 347 // The [field mask] 348 // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) 349 // of the fields in `agentPool` to update in this request. 350 // The following `agentPool` fields can be updated: 351 // 352 // * [display_name][google.storagetransfer.v1.AgentPool.display_name] 353 // 354 // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] 355 google.protobuf.FieldMask update_mask = 2; 356} 357 358// Specifies the request passed to GetAgentPool. 359message GetAgentPoolRequest { 360 // Required. The name of the agent pool to get. 361 string name = 1 [(google.api.field_behavior) = REQUIRED]; 362} 363 364// Specifies the request passed to DeleteAgentPool. 365message DeleteAgentPoolRequest { 366 // Required. The name of the agent pool to delete. 367 string name = 1 [(google.api.field_behavior) = REQUIRED]; 368} 369 370// The request passed to ListAgentPools. 371message ListAgentPoolsRequest { 372 // Required. The ID of the Google Cloud project that owns the job. 373 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 374 375 // An optional list of query parameters specified as JSON text in the 376 // form of: 377 // 378 // `{"agentPoolNames":["agentpool1","agentpool2",...]}` 379 // 380 // Since `agentPoolNames` support multiple values, its values must be 381 // specified with array notation. When the filter is either empty or not 382 // provided, the list returns all agent pools for the project. 383 string filter = 2; 384 385 // The list page size. The max allowed value is `256`. 386 int32 page_size = 3; 387 388 // The list page token. 389 string page_token = 4; 390} 391 392// Response from ListAgentPools. 393message ListAgentPoolsResponse { 394 // A list of agent pools. 395 repeated AgentPool agent_pools = 1; 396 397 // The list next page token. 398 string next_page_token = 2; 399} 400