Skip to content

Commit

Permalink
feat: add default retry configuration
Browse files Browse the repository at this point in the history
feat: add DeleteTransferJob operation
feat: add AWS S3 compatible data source

PiperOrigin-RevId: 473348271
  • Loading branch information
Google APIs authored and Copybara-Service committed Sep 9, 2022
1 parent 38e8b44 commit 56f2049
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 19 deletions.
29 changes: 19 additions & 10 deletions google/storagetransfer/v1/storagetransfer_grpc_service_config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"methodConfig": [
{
"name": [
{
"service": "google.storagetransfer.v1.StorageTransferService"
}
],
"timeout": "30s"
"methodConfig": [{
"name": [{ "service": "google.storagetransfer.v1.StorageTransferService"},
{ "service": "google.longrunning.Operations"}],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "1s",
"maxBackoff": "60s",
"backoffMultiplier": 2,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
]
}
},
{
"name": [{ "service": "google.storagetransfer.v1.StorageTransferService", "method": "CreateTransferJob"}],
"timeout" : "60s"
}
]
}
1 change: 1 addition & 0 deletions google/storagetransfer/v1/storagetransfer_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: storagetransfer.googleapis.com
title: Storage Transfer API

apis:
- name: google.longrunning.Operations
- name: google.storagetransfer.v1.StorageTransferService

types:
Expand Down
20 changes: 19 additions & 1 deletion google/storagetransfer/v1/transfer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ 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) {
option (google.api.http) = {
delete: "/v1/{job_name=transferJobs/**}"
};
}

// Creates an agent pool resource.
rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) {
option (google.api.http) = {
Expand Down Expand Up @@ -194,7 +202,7 @@ message UpdateTransferJobRequest {
// 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` permissions.
// `storagetransfer.jobs.delete` permission.
TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED];

// The field mask of the fields in `transferJob` that are to be updated in
Expand All @@ -220,6 +228,16 @@ message GetTransferJobRequest {
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request passed to DeleteTransferJob.
message DeleteTransferJobRequest {
// Required. The job to delete.
string job_name = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The ID of the Google Cloud project that owns the
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}

// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can
// be specified when listing transfer jobs.
message ListTransferJobsRequest {
Expand Down
122 changes: 114 additions & 8 deletions google/storagetransfer/v1/transfer_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,108 @@ message PosixFilesystem {
string root_directory = 1;
}

// An AwsS3CompatibleData resource.
message AwsS3CompatibleData {
// Required. Specifies the name of the bucket.
string bucket_name = 1 [(google.api.field_behavior) = REQUIRED];

// Specifies the root path to transfer objects.
//
// Must be an empty string or full path name that ends with a '/'. This
// field is treated as an object prefix. As such, it should generally not
// begin with a '/'.
string path = 2;

// Required. Specifies the endpoint of the storage service.
string endpoint = 3 [(google.api.field_behavior) = REQUIRED];

// Specifies the region to sign requests with. This can be left blank if
// requests should be signed with an empty region.
string region = 5;

// Specifies the metadata of the S3 compatible data provider. Each provider
// may contain some attributes that do not apply to all S3-compatible data
// providers. When not specified, S3CompatibleMetadata is used by default.
oneof data_provider {
// A S3 compatible metadata.
S3CompatibleMetadata s3_metadata = 4;
}
}

// S3CompatibleMetadata contains the metadata fields that apply to the basic
// types of S3-compatible data providers.
message S3CompatibleMetadata {
// The authentication and authorization method used by the storage service.
enum AuthMethod {
// AuthMethod is not specified.
AUTH_METHOD_UNSPECIFIED = 0;

// Auth requests with AWS SigV4.
AUTH_METHOD_AWS_SIGNATURE_V4 = 1;

// Auth requests with AWS SigV2.
AUTH_METHOD_AWS_SIGNATURE_V2 = 2;
}

// The request model of the API.
enum RequestModel {
// RequestModel is not specified.
REQUEST_MODEL_UNSPECIFIED = 0;

// Perform requests using Virtual Hosted Style.
// Example: https://bucket-name.s3.region.amazonaws.com/key-name
REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1;

// Perform requests using Path Style.
// Example: https://s3.region.amazonaws.com/bucket-name/key-name
REQUEST_MODEL_PATH_STYLE = 2;
}

// The agent network protocol to access the storage service.
enum NetworkProtocol {
// NetworkProtocol is not specified.
NETWORK_PROTOCOL_UNSPECIFIED = 0;

// Perform requests using HTTPS.
NETWORK_PROTOCOL_HTTPS = 1;

// Not recommended: This sends data in clear-text. This is only
// appropriate within a closed network or for publicly available data.
// Perform requests using HTTP.
NETWORK_PROTOCOL_HTTP = 2;
}

// The Listing API to use for discovering objects.
enum ListApi {
// ListApi is not specified.
LIST_API_UNSPECIFIED = 0;

// Perform listing using ListObjectsV2 API.
LIST_OBJECTS_V2 = 1;

// Legacy ListObjects API.
LIST_OBJECTS = 2;
}

// Specifies the authentication and authorization method used by the storage
// service. When not specified, Transfer Service will attempt to determine
// right auth method to use.
AuthMethod auth_method = 1;

// Specifies the API request model used to call the storage service. When not
// specified, the default value of RequestModel
// REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used.
RequestModel request_model = 2;

// Specifies the network protocol of the agent. When not specified, the
// default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used.
NetworkProtocol protocol = 3;

// The Listing API to use for discovering objects. When not specified,
// Transfer Service will attempt to determine the right API to use.
ListApi list_api = 4;
}

// Represents an On-Premises Agent pool.
message AgentPool {
option (google.api.resource) = {
Expand Down Expand Up @@ -372,17 +474,19 @@ message TransferOptions {
// Specifies when to overwrite an object in the sink when an object with
// matching name is found in the source.
enum OverwriteWhen {
// Indicate the option is not set.
// Overwrite behavior is unspecified.
OVERWRITE_WHEN_UNSPECIFIED = 0;

// Overwrite destination object with source if the two objects are
// different.
// Overwrites destination objects with the source objects, only if the
// objects have the same name but different HTTP ETags or checksum values.
DIFFERENT = 1;

// Never overwrite destination object.
// Never overwrites a destination object if a source object has the
// same name. In this case, the source object is not transferred.
NEVER = 2;

// Always overwrite destination object.
// Always overwrite the destination object with the source object, even if
// the HTTP Etags or checksum values are the same.
ALWAYS = 3;
}

Expand All @@ -405,13 +509,12 @@ message TransferOptions {
// exclusive.
bool delete_objects_from_source_after_transfer = 3;

// When to overwrite objects that already exist in the sink. If not set
// When to overwrite objects that already exist in the sink. If not set,
// overwrite behavior is determined by
// [overwrite_objects_already_existing_in_sink][google.storagetransfer.v1.TransferOptions.overwrite_objects_already_existing_in_sink].
OverwriteWhen overwrite_when = 4;

// Represents the selected metadata options for a transfer job. This feature
// is in Preview.
// Represents the selected metadata options for a transfer job.
MetadataOptions metadata_options = 5;
}

Expand Down Expand Up @@ -442,6 +545,9 @@ message TransferSpec {

// An Azure Blob Storage data source.
AzureBlobStorageData azure_blob_storage_data_source = 8;

// An AWS S3 compatible data source.
AwsS3CompatibleData aws_s3_compatible_data_source = 19;
}

// Represents a supported data container type which is required for transfer
Expand Down

0 comments on commit 56f2049

Please sign in to comment.