transfer.proto 15 KB

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