transfer.proto 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. // Copyright 2021 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.storagetransfer.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/longrunning/operations.proto";
  20. import "google/protobuf/duration.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/storagetransfer/v1/transfer_types.proto";
  24. option cc_enable_arenas = true;
  25. option csharp_namespace = "Google.Cloud.StorageTransfer.V1";
  26. option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer";
  27. option java_outer_classname = "TransferProto";
  28. option java_package = "com.google.storagetransfer.v1.proto";
  29. option php_namespace = "Google\\Cloud\\StorageTransfer\\V1";
  30. option ruby_package = "Google::Cloud::StorageTransfer::V1";
  31. // Storage Transfer Service and its protos.
  32. // Transfers data between between Google Cloud Storage buckets or from a data
  33. // source external to Google to a Cloud Storage bucket.
  34. service StorageTransferService {
  35. option (google.api.default_host) = "storagetransfer.googleapis.com";
  36. option (google.api.oauth_scopes) =
  37. "https://www.googleapis.com/auth/cloud-platform";
  38. // Returns the Google service account that is used by Storage Transfer
  39. // Service to access buckets in the project where transfers
  40. // run or in other projects. Each Google service account is associated
  41. // with one Google Cloud Platform Console project. Users
  42. // should add this service account to the Google Cloud Storage bucket
  43. // ACLs to grant access to Storage Transfer Service. This service
  44. // account is created and owned by Storage Transfer Service and can
  45. // only be used by Storage Transfer Service.
  46. rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest)
  47. returns (GoogleServiceAccount) {
  48. option (google.api.http) = {
  49. get: "/v1/googleServiceAccounts/{project_id}"
  50. };
  51. }
  52. // Creates a transfer job that runs periodically.
  53. rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) {
  54. option (google.api.http) = {
  55. post: "/v1/transferJobs"
  56. body: "transfer_job"
  57. };
  58. }
  59. // Updates a transfer job. Updating a job's transfer spec does not affect
  60. // transfer operations that are running already.
  61. //
  62. // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status]
  63. // field can be modified using this RPC (for example, to set a job's status to
  64. // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED],
  65. // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or
  66. // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).
  67. rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) {
  68. option (google.api.http) = {
  69. patch: "/v1/{job_name=transferJobs/**}"
  70. body: "*"
  71. };
  72. }
  73. // Gets a transfer job.
  74. rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) {
  75. option (google.api.http) = {
  76. get: "/v1/{job_name=transferJobs/**}"
  77. };
  78. }
  79. // Lists transfer jobs.
  80. rpc ListTransferJobs(ListTransferJobsRequest)
  81. returns (ListTransferJobsResponse) {
  82. option (google.api.http) = {
  83. get: "/v1/transferJobs"
  84. };
  85. }
  86. // Pauses a transfer operation.
  87. rpc PauseTransferOperation(PauseTransferOperationRequest)
  88. returns (google.protobuf.Empty) {
  89. option (google.api.http) = {
  90. post: "/v1/{name=transferOperations/**}:pause"
  91. body: "*"
  92. };
  93. }
  94. // Resumes a transfer operation that is paused.
  95. rpc ResumeTransferOperation(ResumeTransferOperationRequest)
  96. returns (google.protobuf.Empty) {
  97. option (google.api.http) = {
  98. post: "/v1/{name=transferOperations/**}:resume"
  99. body: "*"
  100. };
  101. }
  102. // Attempts to start a new TransferOperation for the current TransferJob. A
  103. // TransferJob has a maximum of one active TransferOperation. If this method
  104. // is called while a TransferOperation is active, an error wil be returned.
  105. rpc RunTransferJob(RunTransferJobRequest)
  106. returns (google.longrunning.Operation) {
  107. option (google.api.http) = {
  108. post: "/v1/{job_name=transferJobs/**}:run"
  109. body: "*"
  110. };
  111. option (google.longrunning.operation_info) = {
  112. response_type: "google.protobuf.Empty"
  113. metadata_type: "TransferOperation"
  114. };
  115. }
  116. }
  117. // Request passed to GetGoogleServiceAccount.
  118. message GetGoogleServiceAccountRequest {
  119. // Required. The ID of the Google Cloud Platform Console project that the
  120. // Google service account is associated with.
  121. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  122. }
  123. // Request passed to CreateTransferJob.
  124. message CreateTransferJobRequest {
  125. // Required. The job to create.
  126. TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED];
  127. }
  128. // Request passed to UpdateTransferJob.
  129. message UpdateTransferJobRequest {
  130. // Required. The name of job to update.
  131. string job_name = 1 [(google.api.field_behavior) = REQUIRED];
  132. // Required. The ID of the Google Cloud Platform Console project that owns the
  133. // job.
  134. string project_id = 2 [(google.api.field_behavior) = REQUIRED];
  135. // Required. The job to update. `transferJob` is expected to specify only
  136. // four fields:
  137. // [description][google.storagetransfer.v1.TransferJob.description],
  138. // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
  139. // [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
  140. // and [status][google.storagetransfer.v1.TransferJob.status]. An
  141. // `UpdateTransferJobRequest` that specifies other fields are rejected with
  142. // the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a
  143. // job status to
  144. // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
  145. // `storagetransfer.jobs.delete` permissions.
  146. TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED];
  147. // The field mask of the fields in `transferJob` that are to be updated in
  148. // this request. Fields in `transferJob` that can be updated are:
  149. // [description][google.storagetransfer.v1.TransferJob.description],
  150. // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
  151. // [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
  152. // and [status][google.storagetransfer.v1.TransferJob.status]. To update the
  153. // `transfer_spec` of the job, a complete transfer specification must be
  154. // provided. An incomplete specification missing any required fields is
  155. // rejected with the error
  156. // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
  157. google.protobuf.FieldMask update_transfer_job_field_mask = 4;
  158. }
  159. // Request passed to GetTransferJob.
  160. message GetTransferJobRequest {
  161. // Required.
  162. // The job to get.
  163. string job_name = 1 [(google.api.field_behavior) = REQUIRED];
  164. // Required. The ID of the Google Cloud Platform Console project that owns the
  165. // job.
  166. string project_id = 2 [(google.api.field_behavior) = REQUIRED];
  167. }
  168. // `projectId`, `jobNames`, and `jobStatuses` are query parameters that can
  169. // be specified when listing transfer jobs.
  170. message ListTransferJobsRequest {
  171. // Required. A list of query parameters specified as JSON text in the form of:
  172. // `{"projectId":"my_project_id",
  173. // "jobNames":["jobid1","jobid2",...],
  174. // "jobStatuses":["status1","status2",...]}`
  175. //
  176. // Since `jobNames` and `jobStatuses` support multiple values, their values
  177. // must be specified with array notation. `projectId` is required.
  178. // `jobNames` and `jobStatuses` are optional. The valid values for
  179. // `jobStatuses` are case-insensitive:
  180. // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED],
  181. // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and
  182. // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
  183. string filter = 1 [(google.api.field_behavior) = REQUIRED];
  184. // The list page size. The max allowed value is 256.
  185. int32 page_size = 4;
  186. // The list page token.
  187. string page_token = 5;
  188. }
  189. // Response from ListTransferJobs.
  190. message ListTransferJobsResponse {
  191. // A list of transfer jobs.
  192. repeated TransferJob transfer_jobs = 1;
  193. // The list next page token.
  194. string next_page_token = 2;
  195. }
  196. // Request passed to PauseTransferOperation.
  197. message PauseTransferOperationRequest {
  198. // Required. The name of the transfer operation.
  199. string name = 1 [(google.api.field_behavior) = REQUIRED];
  200. }
  201. // Request passed to ResumeTransferOperation.
  202. message ResumeTransferOperationRequest {
  203. // Required. The name of the transfer operation.
  204. string name = 1 [(google.api.field_behavior) = REQUIRED];
  205. }
  206. // Request passed to RunTransferJob.
  207. message RunTransferJobRequest {
  208. // Required. The name of the transfer job.
  209. string job_name = 1 [(google.api.field_behavior) = REQUIRED];
  210. // Required. The ID of the Google Cloud Platform Console project that owns the
  211. // transfer job.
  212. string project_id = 2 [(google.api.field_behavior) = REQUIRED];
  213. }