transfer.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. // Copyright 2020 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.cloud.bigquery.datatransfer.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/struct.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/rpc/status.proto";
  21. option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "TransferProto";
  25. option java_package = "com.google.cloud.bigquery.datatransfer.v1";
  26. option objc_class_prefix = "GCBDT";
  27. option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
  28. option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1";
  29. // DEPRECATED. Represents data transfer type.
  30. enum TransferType {
  31. option deprecated = true;
  32. // Invalid or Unknown transfer type placeholder.
  33. TRANSFER_TYPE_UNSPECIFIED = 0;
  34. // Batch data transfer.
  35. BATCH = 1;
  36. // Streaming data transfer. Streaming data source currently doesn't
  37. // support multiple transfer configs per project.
  38. STREAMING = 2;
  39. }
  40. // Represents data transfer run state.
  41. enum TransferState {
  42. // State placeholder.
  43. TRANSFER_STATE_UNSPECIFIED = 0;
  44. // Data transfer is scheduled and is waiting to be picked up by
  45. // data transfer backend.
  46. PENDING = 2;
  47. // Data transfer is in progress.
  48. RUNNING = 3;
  49. // Data transfer completed successfully.
  50. SUCCEEDED = 4;
  51. // Data transfer failed.
  52. FAILED = 5;
  53. // Data transfer is cancelled.
  54. CANCELLED = 6;
  55. }
  56. // Represents preferences for sending email notifications for transfer run
  57. // events.
  58. message EmailPreferences {
  59. // If true, email notifications will be sent on transfer run failures.
  60. bool enable_failure_email = 1;
  61. }
  62. // Options customizing the data transfer schedule.
  63. message ScheduleOptions {
  64. // If true, automatic scheduling of data transfer runs for this configuration
  65. // will be disabled. The runs can be started on ad-hoc basis using
  66. // StartManualTransferRuns API. When automatic scheduling is disabled, the
  67. // TransferConfig.schedule field will be ignored.
  68. bool disable_auto_scheduling = 3;
  69. // Specifies time to start scheduling transfer runs. The first run will be
  70. // scheduled at or after the start time according to a recurrence pattern
  71. // defined in the schedule string. The start time can be changed at any
  72. // moment. The time when a data transfer can be trigerred manually is not
  73. // limited by this option.
  74. google.protobuf.Timestamp start_time = 1;
  75. // Defines time to stop scheduling transfer runs. A transfer run cannot be
  76. // scheduled at or after the end time. The end time can be changed at any
  77. // moment. The time when a data transfer can be trigerred manually is not
  78. // limited by this option.
  79. google.protobuf.Timestamp end_time = 2;
  80. }
  81. // Represents a data transfer configuration. A transfer configuration
  82. // contains all metadata needed to perform a data transfer. For example,
  83. // `destination_dataset_id` specifies where data should be stored.
  84. // When a new transfer configuration is created, the specified
  85. // `destination_dataset_id` is created when needed and shared with the
  86. // appropriate data source service account.
  87. message TransferConfig {
  88. option (google.api.resource) = {
  89. type: "bigquerydatatransfer.googleapis.com/TransferConfig"
  90. pattern: "projects/{project}/transferConfigs/{transfer_config}"
  91. pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}"
  92. };
  93. // The resource name of the transfer config.
  94. // Transfer config names have the form of
  95. // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`.
  96. // The name is automatically generated based on the config_id specified in
  97. // CreateTransferConfigRequest along with project_id and region. If config_id
  98. // is not provided, usually a uuid, even though it is not guaranteed or
  99. // required, will be generated for config_id.
  100. string name = 1;
  101. // The desination of the transfer config.
  102. oneof destination {
  103. // The BigQuery target dataset id.
  104. string destination_dataset_id = 2;
  105. }
  106. // User specified display name for the data transfer.
  107. string display_name = 3;
  108. // Data source id. Cannot be changed once data transfer is created.
  109. string data_source_id = 5;
  110. // Data transfer specific parameters.
  111. google.protobuf.Struct params = 9;
  112. // Data transfer schedule.
  113. // If the data source does not support a custom schedule, this should be
  114. // empty. If it is empty, the default value for the data source will be
  115. // used.
  116. // The specified times are in UTC.
  117. // Examples of valid format:
  118. // `1st,3rd monday of month 15:30`,
  119. // `every wed,fri of jan,jun 13:15`, and
  120. // `first sunday of quarter 00:00`.
  121. // See more explanation about the format here:
  122. // https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format
  123. // NOTE: the granularity should be at least 8 hours, or less frequent.
  124. string schedule = 7;
  125. // Options customizing the data transfer schedule.
  126. ScheduleOptions schedule_options = 24;
  127. // The number of days to look back to automatically refresh the data.
  128. // For example, if `data_refresh_window_days = 10`, then every day
  129. // BigQuery reingests data for [today-10, today-1], rather than ingesting data
  130. // for just [today-1].
  131. // Only valid if the data source supports the feature. Set the value to 0
  132. // to use the default value.
  133. int32 data_refresh_window_days = 12;
  134. // Is this config disabled. When set to true, no runs are scheduled
  135. // for a given transfer.
  136. bool disabled = 13;
  137. // Output only. Data transfer modification time. Ignored by server on input.
  138. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  139. // Output only. Next time when data transfer will run.
  140. google.protobuf.Timestamp next_run_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  141. // Output only. State of the most recently updated transfer run.
  142. TransferState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  143. // Deprecated. Unique ID of the user on whose behalf transfer is done.
  144. int64 user_id = 11;
  145. // Output only. Region in which BigQuery dataset is located.
  146. string dataset_region = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  147. // Pub/Sub topic where notifications will be sent after transfer runs
  148. // associated with this transfer config finish.
  149. string notification_pubsub_topic = 15;
  150. // Email notifications will be sent according to these preferences
  151. // to the email address of the user who owns this transfer config.
  152. EmailPreferences email_preferences = 18;
  153. }
  154. // Represents a data transfer run.
  155. message TransferRun {
  156. option (google.api.resource) = {
  157. type: "bigquerydatatransfer.googleapis.com/Run"
  158. pattern: "projects/{project}/transferConfigs/{transfer_config}/runs/{run}"
  159. pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}"
  160. };
  161. // The resource name of the transfer run.
  162. // Transfer run names have the form
  163. // `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.
  164. // The name is ignored when creating a transfer run.
  165. string name = 1;
  166. // Minimum time after which a transfer run can be started.
  167. google.protobuf.Timestamp schedule_time = 3;
  168. // For batch transfer runs, specifies the date and time of the data should be
  169. // ingested.
  170. google.protobuf.Timestamp run_time = 10;
  171. // Status of the transfer run.
  172. google.rpc.Status error_status = 21;
  173. // Output only. Time when transfer run was started.
  174. // Parameter ignored by server for input requests.
  175. google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  176. // Output only. Time when transfer run ended.
  177. // Parameter ignored by server for input requests.
  178. google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  179. // Output only. Last time the data transfer run state was updated.
  180. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  181. // Output only. Data transfer specific parameters.
  182. google.protobuf.Struct params = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  183. // Data transfer destination.
  184. oneof destination {
  185. // Output only. The BigQuery target dataset id.
  186. string destination_dataset_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  187. }
  188. // Output only. Data source id.
  189. string data_source_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  190. // Data transfer run state. Ignored for input requests.
  191. TransferState state = 8;
  192. // Deprecated. Unique ID of the user on whose behalf transfer is done.
  193. int64 user_id = 11;
  194. // Output only. Describes the schedule of this transfer run if it was
  195. // created as part of a regular schedule. For batch transfer runs that are
  196. // scheduled manually, this is empty.
  197. // NOTE: the system might choose to delay the schedule depending on the
  198. // current load, so `schedule_time` doesn't always match this.
  199. string schedule = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  200. // Output only. Pub/Sub topic where a notification will be sent after this
  201. // transfer run finishes
  202. string notification_pubsub_topic = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
  203. // Output only. Email notifications will be sent according to these
  204. // preferences to the email address of the user who owns the transfer config
  205. // this run was derived from.
  206. EmailPreferences email_preferences = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
  207. }
  208. // Represents a user facing message for a particular data transfer run.
  209. message TransferMessage {
  210. // Represents data transfer user facing message severity.
  211. enum MessageSeverity {
  212. // No severity specified.
  213. MESSAGE_SEVERITY_UNSPECIFIED = 0;
  214. // Informational message.
  215. INFO = 1;
  216. // Warning message.
  217. WARNING = 2;
  218. // Error message.
  219. ERROR = 3;
  220. }
  221. // Time when message was logged.
  222. google.protobuf.Timestamp message_time = 1;
  223. // Message severity.
  224. MessageSeverity severity = 2;
  225. // Message text.
  226. string message_text = 3;
  227. }