transfer_activity_log.proto 8.3 KB

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