transfer.proto 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // Copyright 2016 Google Inc.
  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/protobuf/empty.proto";
  18. import "google/protobuf/field_mask.proto";
  19. import "google/storagetransfer/v1/transfer_types.proto";
  20. option cc_enable_arenas = true;
  21. option java_outer_classname = "TransferProto";
  22. option java_package = "com.google.storagetransfer.v1.proto";
  23. // Transfers data between between Google Cloud Storage buckets or from a data
  24. // source external to Google to a Cloud Storage bucket.
  25. service StorageTransferService {
  26. // Returns the Google service account that is used by Storage Transfer
  27. // Service to access buckets in the project where transfers
  28. // run or in other projects. Each Google service account is associated
  29. // with one Google Cloud Platform Console project. Users
  30. // should add this service account to the Google Cloud Storage bucket
  31. // ACLs to grant access to Storage Transfer Service. This service
  32. // account is created and owned by Storage Transfer Service and can
  33. // only be used by Storage Transfer Service.
  34. rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) {
  35. option (google.api.http) = { get: "/v1/googleServiceAccounts/{project_id}" };
  36. }
  37. // Creates a transfer job that runs periodically.
  38. rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) {
  39. option (google.api.http) = { post: "/v1/transferJobs" body: "transfer_job" };
  40. }
  41. // Updates a transfer job. Updating a job's transfer spec does not affect
  42. // transfer operations that are running already. Updating the scheduling
  43. // of a job is not allowed.
  44. rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) {
  45. option (google.api.http) = { patch: "/v1/{job_name=transferJobs/**}" body: "*" };
  46. }
  47. // Gets a transfer job.
  48. rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) {
  49. option (google.api.http) = { get: "/v1/{job_name=transferJobs/**}" };
  50. }
  51. // Lists transfer jobs.
  52. rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) {
  53. option (google.api.http) = { get: "/v1/transferJobs" };
  54. }
  55. // Pauses a transfer operation.
  56. rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) {
  57. option (google.api.http) = { post: "/v1/{name=transferOperations/**}:pause" body: "*" };
  58. }
  59. // Resumes a transfer operation that is paused.
  60. rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) {
  61. option (google.api.http) = { post: "/v1/{name=transferOperations/**}:resume" body: "*" };
  62. }
  63. }
  64. // Request passed to GetGoogleServiceAccount.
  65. message GetGoogleServiceAccountRequest {
  66. // The ID of the Google Cloud Platform Console project that the Google service
  67. // account is associated with.
  68. // Required.
  69. string project_id = 1;
  70. }
  71. // Request passed to CreateTransferJob.
  72. message CreateTransferJobRequest {
  73. // The job to create.
  74. // Required.
  75. TransferJob transfer_job = 1;
  76. }
  77. // Request passed to UpdateTransferJob.
  78. message UpdateTransferJobRequest {
  79. // The name of job to update.
  80. // Required.
  81. string job_name = 1;
  82. // The ID of the Google Cloud Platform Console project that owns the job.
  83. // Required.
  84. string project_id = 2;
  85. // The job to update.
  86. // Required.
  87. TransferJob transfer_job = 3;
  88. // The field mask of the fields in `transferJob` that are to be updated in
  89. // this request. Fields in `transferJob` that can be updated are:
  90. // `description`, `transferSpec`, and `status`. To update the `transferSpec`
  91. // of the job, a complete transfer specification has to be provided. An
  92. // incomplete specification which misses any required fields will be rejected
  93. // with the error `INVALID_ARGUMENT`.
  94. google.protobuf.FieldMask update_transfer_job_field_mask = 4;
  95. }
  96. // Request passed to GetTransferJob.
  97. message GetTransferJobRequest {
  98. // The job to get.
  99. // Required.
  100. string job_name = 1;
  101. // The ID of the Google Cloud Platform Console project that owns the job.
  102. // Required.
  103. string project_id = 2;
  104. }
  105. // `project_id`, `job_names`, and `job_statuses` are query parameters that can
  106. // be specified when listing transfer jobs.
  107. message ListTransferJobsRequest {
  108. // A list of query parameters specified as JSON text in the form of
  109. // {"project_id":"my_project_id",
  110. // "job_names":["jobid1","jobid2",...],
  111. // "job_statuses":["status1","status2",...]}.
  112. // Since `job_names` and `job_statuses` support multiple values, their values
  113. // must be specified with array notation. `project_id` is required. `job_names`
  114. // and `job_statuses` are optional. The valid values for `job_statuses` are
  115. // case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.
  116. string filter = 1;
  117. // The list page size. The max allowed value is 256.
  118. int32 page_size = 4;
  119. // The list page token.
  120. string page_token = 5;
  121. }
  122. // Response from ListTransferJobs.
  123. message ListTransferJobsResponse {
  124. // A list of transfer jobs.
  125. repeated TransferJob transfer_jobs = 1;
  126. // The list next page token.
  127. string next_page_token = 2;
  128. }
  129. // Request passed to PauseTransferOperation.
  130. message PauseTransferOperationRequest {
  131. // The name of the transfer operation.
  132. // Required.
  133. string name = 1;
  134. }
  135. // Request passed to ResumeTransferOperation.
  136. message ResumeTransferOperationRequest {
  137. // The name of the transfer operation.
  138. // Required.
  139. string name = 1;
  140. }