xref: /aosp_15_r20/external/googleapis/google/storagetransfer/logging/transfer_activity_log.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.storagetransfer.logging;
18
19import "google/api/field_behavior.proto";
20import "google/protobuf/timestamp.proto";
21
22option go_package = "google.golang.org/genproto/googleapis/storagetransfer/logging;logging";
23option java_multiple_files = true;
24option java_outer_classname = "TransferActivityLogProto";
25option java_package = "com.google.storagetransfer.logging";
26option csharp_namespace = "Google.StorageTransfer.Logging";
27option php_namespace = "Google\\StorageTransfer\\Logging";
28option ruby_package = "Google::StorageTransfer::Logging";
29
30// AWS S3 object metadata.
31message AwsS3ObjectMetadata {
32  // Required. Name of the S3 bucket.
33  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
34
35  // Required. Name/key of the object.
36  string object_key = 2 [(google.api.field_behavior) = REQUIRED];
37
38  // Last modified time of the object.
39  google.protobuf.Timestamp last_modified_time = 3;
40
41  // The MD5 checksum of the object's content.
42  string md5 = 4;
43
44  // Required. Size of the object in bytes.
45  int64 size = 5 [(google.api.field_behavior) = REQUIRED];
46}
47
48// AWS S3 bucket metadata.
49message AwsS3BucketMetadata {
50  // Required. Name of the S3 bucket.
51  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
52
53  // The path of transfer objects as an object key prefix ending with "/".
54  string path = 2;
55}
56
57// Google Cloud Storage object metadata.
58message GcsObjectMetadata {
59  // Required. Name of the Cloud Storage bucket.
60  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
61
62  // Required. Name/key of the object.
63  string object_key = 2 [(google.api.field_behavior) = REQUIRED];
64
65  // Last modified time of the object.
66  google.protobuf.Timestamp last_modified_time = 3;
67
68  // The MD5 checksum of the object's content.
69  string md5 = 4;
70
71  // The CRC32C checksum of the object's content.
72  string crc32c = 5;
73
74  // Required. Size of the object in bytes.
75  int64 size = 6 [(google.api.field_behavior) = REQUIRED];
76}
77
78// Google Cloud Storage bucket metadata.
79message GcsBucketMetadata {
80  // Required. Name of the Cloud Storage bucket.
81  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
82
83  // The path of transfer objects as an object key prefix ending with "/".
84  string path = 2;
85}
86
87// Azure Blob Storage blob metadata.
88message AzureBlobMetadata {
89  // Required. Name of the Azure Blob storage account.
90  string account = 1 [(google.api.field_behavior) = REQUIRED];
91
92  // Required. Name of the container.
93  string container = 2 [(google.api.field_behavior) = REQUIRED];
94
95  // Required. Name of the blob.
96  string blob_name = 3 [(google.api.field_behavior) = REQUIRED];
97
98  // Last modified time of the blob.
99  google.protobuf.Timestamp last_modified_time = 4;
100
101  // The MD5 checksum of the object's content.
102  string md5 = 5;
103
104  // Required. Size of the blob in bytes.
105  int64 size = 6 [(google.api.field_behavior) = REQUIRED];
106}
107
108// Azure Blob Storage container metadata.
109message AzureBlobContainerMetadata {
110  // Required. Name of the Azure Blob storage account.
111  string account = 1 [(google.api.field_behavior) = REQUIRED];
112
113  // Required. Name of the container.
114  string container = 2 [(google.api.field_behavior) = REQUIRED];
115
116  // The path of transfer blobs as a blob name prefix ending with "/".
117  string path = 3;
118}
119
120// POSIX file metadata.
121message PosixFileMetadata {
122  // Required. Path of a file.
123  string path = 1 [(google.api.field_behavior) = REQUIRED];
124
125  // Last modified time (mtime) of the file.
126  google.protobuf.Timestamp last_modified_time = 2;
127
128  // The CRC32C checksum of the object's content.
129  string crc32c = 3;
130
131  // Required. Size of the file in bytes.
132  int64 size = 4 [(google.api.field_behavior) = REQUIRED];
133}
134
135// HTTP file metadata.
136message HttpFileMetadata {
137  // Required. Url of the HTTP file.
138  string url = 1 [(google.api.field_behavior) = REQUIRED];
139
140  // The MD5 checksum of the file's content.
141  string md5 = 2;
142
143  // Size of the file in bytes.
144  int64 size = 3;
145}
146
147// HTTP manifest file metadata.
148message HttpManifestMetadata {
149  // Required. Url of the HTTP manifest which contains the list of HTTP files to
150  // transfer.
151  string url = 1 [(google.api.field_behavior) = REQUIRED];
152}
153
154// Metadata of a blob/file/object.
155message ObjectMetadata {
156  // Required. Storage system type of the object.
157  StorageSystemType type = 1 [(google.api.field_behavior) = REQUIRED];
158
159  oneof metadata {
160    // Object metadata of AWS S3.
161    AwsS3ObjectMetadata aws_s3_object = 3;
162
163    // Blob metadata of Azure Blob Storage.
164    AzureBlobMetadata azure_blob = 4;
165
166    // Object metadata of Google Cloud Storage.
167    GcsObjectMetadata gcs_object = 5;
168
169    // File/directory metadata of POSIX file system.
170    PosixFileMetadata posix_file = 6;
171
172    // Metadata of a file on a HTTP server.
173    HttpFileMetadata http_file = 7;
174  }
175}
176
177// Metadata of a bucket/container/directory
178message ContainerMetadata {
179  // Required. Storage system type of the object.
180  StorageSystemType type = 1 [(google.api.field_behavior) = REQUIRED];
181
182  oneof metadata {
183    // Bucket metadata of AWS S3.
184    AwsS3BucketMetadata aws_s3_bucket = 3;
185
186    // Container metadata of Azure Blob Storage.
187    AzureBlobContainerMetadata azure_blob_container = 4;
188
189    // Bucket metadata of Google Cloud Storage.
190    GcsBucketMetadata gcs_bucket = 5;
191
192    // Directory metadata of POSIX file system.
193    PosixFileMetadata posix_directory = 6;
194
195    // Metadata of a manifest file on a HTTP server.
196    HttpManifestMetadata http_manifest = 7;
197  }
198}
199
200// Schema of log payload of transfer activity.
201message TransferActivityLog {
202  // Possible actions which a transfer operation can make.
203  enum Action {
204    // Unspeficied action.
205    ACTION_UNSPECIFIED = 0;
206
207    // Finding work to do, such as listing files in a directory or listing
208    // objects in a bucket.
209    FIND = 1;
210
211    // Copying files or objects.
212    COPY = 2;
213
214    // Deleting files or objects at destination.
215    DELETE = 3;
216  }
217
218  // Status of an action.
219  message Status {
220    // Required. A string value of the Google RPC code as the status of the
221    // action. The action succeeded if it's `OK`, and failed otherwise.
222    string status_code = 1 [(google.api.field_behavior) = REQUIRED];
223
224    // A string that represents the type of error encountered. Populated only if
225    // status_code is not `OK`.
226    string error_type = 2;
227
228    // A human-readable error message for the failure. Populated only if
229    // status_code is not `OK`.
230    string error_message = 3;
231  }
232
233  // Required. Name of the transfer operation.
234  string operation = 1 [(google.api.field_behavior) = REQUIRED];
235
236  // Required. The action which the transfer operation made.
237  Action action = 2 [(google.api.field_behavior) = REQUIRED];
238
239  // Required. Status of the action.
240  Status status = 3 [(google.api.field_behavior) = REQUIRED];
241
242  // Metadata of source bucket/container/directory. Only set if the action is
243  // FIND.
244  ContainerMetadata source_container = 4;
245
246  // Metadata of destination bucket/container/directory. Only set if the action
247  // is FIND.
248  ContainerMetadata destination_container = 5;
249
250  // Metadata of the source blob/file/object. Only set if the action is COPY or
251  // DELETE when deletion is applied to source.
252  ObjectMetadata source_object = 6;
253
254  // Metadata of the destination blob/file/object. Only set if the action is
255  // or DELETE when deletion is applied to destination.
256  ObjectMetadata destination_object = 7;
257
258  // Required. Completion time of the action.
259  google.protobuf.Timestamp complete_time = 8
260      [(google.api.field_behavior) = REQUIRED];
261}
262
263// Type of the storage system.
264enum StorageSystemType {
265  // Unspecified.
266  STORAGE_SYSTEM_TYPE_UNSPECIFIED = 0;
267
268  // AWS S3.
269  AWS_S3 = 1;
270
271  // Azure Blob Storage.
272  AZURE_BLOB = 2;
273
274  // Google Cloud Storage.
275  GCS = 3;
276
277  // POSIX file system.
278  POSIX_FS = 4;
279
280  // HTTP/HTTPS servers.
281  HTTP = 5;
282}
283