Skip to content

Commit

Permalink
feat: add event driven transfer configuration
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 543540202
  • Loading branch information
Google APIs authored and Copybara-Service committed Jun 26, 2023
1 parent ae18706 commit 48e47e8
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 82 deletions.
62 changes: 37 additions & 25 deletions google/storagetransfer/v1/transfer.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,7 +37,8 @@ option ruby_package = "Google::Cloud::StorageTransfer::V1";
// source external to Google to a Cloud Storage bucket.
service StorageTransferService {
option (google.api.default_host) = "storagetransfer.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Returns the Google service account that is used by Storage Transfer
// Service to access buckets in the project where transfers
Expand All @@ -47,7 +48,8 @@ service StorageTransferService {
// ACLs to grant access to Storage Transfer Service. This service
// account is created and owned by Storage Transfer Service and can
// only be used by Storage Transfer Service.
rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) {
rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest)
returns (GoogleServiceAccount) {
option (google.api.http) = {
get: "/v1/googleServiceAccounts/{project_id}"
};
Expand All @@ -64,8 +66,8 @@ service StorageTransferService {
// Updates a transfer job. Updating a job's transfer spec does not affect
// transfer operations that are running already.
//
// **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified
// using this RPC (for example, to set a job's status to
// **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status]
// field can be modified using this RPC (for example, to set a job's status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED],
// [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or
// [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).
Expand All @@ -84,32 +86,37 @@ service StorageTransferService {
}

// Lists transfer jobs.
rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) {
rpc ListTransferJobs(ListTransferJobsRequest)
returns (ListTransferJobsResponse) {
option (google.api.http) = {
get: "/v1/transferJobs"
};
}

// Pauses a transfer operation.
rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) {
rpc PauseTransferOperation(PauseTransferOperationRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=transferOperations/**}:pause"
body: "*"
};
}

// Resumes a transfer operation that is paused.
rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) {
rpc ResumeTransferOperation(ResumeTransferOperationRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=transferOperations/**}:resume"
body: "*"
};
}

// Attempts to start a new TransferOperation for the current TransferJob. A
// TransferJob has a maximum of one active TransferOperation. If this method
// is called while a TransferOperation is active, an error will be returned.
rpc RunTransferJob(RunTransferJobRequest) returns (google.longrunning.Operation) {
// Starts a new operation for the specified transfer job.
// A `TransferJob` has a maximum of one active `TransferOperation`. If this
// method is called while a `TransferOperation` is active, an error is
// returned.
rpc RunTransferJob(RunTransferJobRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{job_name=transferJobs/**}:run"
body: "*"
Expand All @@ -122,7 +129,8 @@ service StorageTransferService {

// Deletes a transfer job. Deleting a transfer job sets its status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
rpc DeleteTransferJob(DeleteTransferJobRequest) returns (google.protobuf.Empty) {
rpc DeleteTransferJob(DeleteTransferJobRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{job_name=transferJobs/**}"
};
Expand All @@ -134,7 +142,8 @@ service StorageTransferService {
post: "/v1/projects/{project_id=*}/agentPools"
body: "agent_pool"
};
option (google.api.method_signature) = "project_id,agent_pool,agent_pool_id";
option (google.api.method_signature) =
"project_id,agent_pool,agent_pool_id";
}

// Updates an existing agent pool resource.
Expand Down Expand Up @@ -193,15 +202,17 @@ message UpdateTransferJobRequest {
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The job to update. `transferJob` is expected to specify one or more of
// five fields: [description][google.storagetransfer.v1.TransferJob.description],
// Required. The job to update. `transferJob` is expected to specify one or
// more of five fields:
// [description][google.storagetransfer.v1.TransferJob.description],
// [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
// [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
// [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and
// [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies
// other fields are rejected with the error
// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status
// to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
// [status][google.storagetransfer.v1.TransferJob.status]. An
// `UpdateTransferJobRequest` that specifies other fields are rejected with
// the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a
// job status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
// `storagetransfer.jobs.delete` permission.
TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED];

Expand All @@ -211,9 +222,10 @@ message UpdateTransferJobRequest {
// [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
// [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
// [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and
// [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a
// complete transfer specification must be provided. An incomplete
// specification missing any required fields is rejected with the error
// [status][google.storagetransfer.v1.TransferJob.status]. To update the
// `transfer_spec` of the job, a complete transfer specification must be
// provided. An incomplete specification missing any required fields is
// rejected with the error
// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
google.protobuf.FieldMask update_transfer_job_field_mask = 4;
}
Expand Down Expand Up @@ -320,8 +332,8 @@ message CreateAgentPoolRequest {

// Specifies the request passed to UpdateAgentPool.
message UpdateAgentPoolRequest {
// Required. The agent pool to update. `agent_pool` is expected to specify following
// fields:
// Required. The agent pool to update. `agent_pool` is expected to specify
// following fields:
//
// * [name][google.storagetransfer.v1.AgentPool.name]
//
Expand Down

0 comments on commit 48e47e8

Please sign in to comment.