xref: /aosp_15_r20/external/googleapis/google/firestore/admin/v1/backup.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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.firestore.admin.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
24option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
25option java_multiple_files = true;
26option java_outer_classname = "BackupProto";
27option java_package = "com.google.firestore.admin.v1";
28option objc_class_prefix = "GCFS";
29option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
30option ruby_package = "Google::Cloud::Firestore::Admin::V1";
31
32// A Backup of a Cloud Firestore Database.
33//
34// The backup contains all documents and index configurations for the given
35// database at a specific point in time.
36message Backup {
37  option (google.api.resource) = {
38    type: "firestore.googleapis.com/Backup"
39    pattern: "projects/{project}/locations/{location}/backups/{backup}"
40  };
41
42  // Backup specific statistics.
43  message Stats {
44    // Output only. Summation of the size of all documents and index entries in
45    // the backup, measured in bytes.
46    int64 size_bytes = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
47
48    // Output only. The total number of documents contained in the backup.
49    int64 document_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
50
51    // Output only. The total number of index entries contained in the backup.
52    int64 index_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
53  }
54
55  // Indicate the current state of the backup.
56  enum State {
57    // The state is unspecified.
58    STATE_UNSPECIFIED = 0;
59
60    // The pending backup is still being created. Operations on the
61    // backup will be rejected in this state.
62    CREATING = 1;
63
64    // The backup is complete and ready to use.
65    READY = 2;
66
67    // The backup is not available at this moment.
68    NOT_AVAILABLE = 3;
69  }
70
71  // Output only. The unique resource name of the Backup.
72  //
73  // Format is `projects/{project}/locations/{location}/backups/{backup}`.
74  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
75
76  // Output only. Name of the Firestore database that the backup is from.
77  //
78  // Format is `projects/{project}/databases/{database}`.
79  string database = 2 [
80    (google.api.field_behavior) = OUTPUT_ONLY,
81    (google.api.resource_reference) = {
82      type: "firestore.googleapis.com/Database"
83    }
84  ];
85
86  // Output only. The system-generated UUID4 for the Firestore database that the
87  // backup is from.
88  string database_uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
89
90  // Output only. The backup contains an externally consistent copy of the
91  // database at this time.
92  google.protobuf.Timestamp snapshot_time = 3
93      [(google.api.field_behavior) = OUTPUT_ONLY];
94
95  // Output only. The timestamp at which this backup expires.
96  google.protobuf.Timestamp expire_time = 4
97      [(google.api.field_behavior) = OUTPUT_ONLY];
98
99  // Output only. Statistics about the backup.
100  //
101  // This data only becomes available after the backup is fully materialized to
102  // secondary storage. This field will be empty till then.
103  Stats stats = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
104
105  // Output only. The current state of the backup.
106  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
107}
108