Skip to content

Commit 44f08c6

Browse files
feat: [backupdr] Adding unreachable field to ListDataSourceReferences API (#6865)
* feat: Adding `FetchBackupsForResourceType` API feat: Adding `ListDataSourceReferences` API feat: Adding `source_resource` fields to Backup resource feat: Adding new workload specific fields for Cloud SQL PiperOrigin-RevId: 827762328 Source-Link: googleapis/googleapis@a0066e7 Source-Link: googleapis/googleapis-gen@85ae209 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhY2t1cGRyLy5Pd2xCb3QueWFtbCIsImgiOiI4NWFlMjA5NTEwNTQ0MWNkZGExY2Y3YTRjODVmMTM0ZmYyNjIwYjNlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Adding `unreachable` field to `ListDataSourceReferences` API PiperOrigin-RevId: 828740816 Source-Link: googleapis/googleapis@73c0641 Source-Link: googleapis/googleapis-gen@ba4d457 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhY2t1cGRyLy5Pd2xCb3QueWFtbCIsImgiOiJiYTRkNDU3MTM4NDdlZDgzYWQwYTZjMDc5NjNiNjIxN2E0ODk0NmE1In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e4faaba commit 44f08c6

15 files changed

+4087
-1
lines changed

packages/google-cloud-backupdr/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
6868
| delete backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js) |
6969
| delete management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js) |
7070
| fetch backup plan associations for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js) |
71+
| fetch backups for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js) |
7172
| fetch data source references for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js) |
7273
| fetch usable backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js) |
7374
| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js) |
@@ -84,6 +85,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
8485
| list backup plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js) |
8586
| list backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js) |
8687
| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js) |
88+
| list data source references | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js) |
8789
| list data sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js) |
8890
| list management servers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js) |
8991
| restore backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js) |

packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ service BackupDR {
200200
option (google.api.method_signature) = "parent";
201201
}
202202

203+
// Fetch Backups for a given resource type.
204+
rpc FetchBackupsForResourceType(FetchBackupsForResourceTypeRequest)
205+
returns (FetchBackupsForResourceTypeResponse) {
206+
option (google.api.http) = {
207+
get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType"
208+
};
209+
option (google.api.method_signature) = "parent,resource_type";
210+
}
211+
203212
// Gets details of a Backup.
204213
rpc GetBackup(GetBackupRequest) returns (Backup) {
205214
option (google.api.http) = {
@@ -417,6 +426,15 @@ service BackupDR {
417426
option (google.api.method_signature) = "name";
418427
}
419428

429+
// Lists DataSourceReferences for a given project and location.
430+
rpc ListDataSourceReferences(ListDataSourceReferencesRequest)
431+
returns (ListDataSourceReferencesResponse) {
432+
option (google.api.http) = {
433+
get: "/v1/{parent=projects/*/locations/*}/dataSourceReferences"
434+
};
435+
option (google.api.method_signature) = "parent";
436+
}
437+
420438
// Fetch DataSourceReferences for a given project, location and resource type.
421439
rpc FetchDataSourceReferencesForResourceType(
422440
FetchDataSourceReferencesForResourceTypeRequest)

packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,14 @@ message Backup {
637637
(google.api.field_behavior) = OUTPUT_ONLY,
638638
(google.api.field_behavior) = OPTIONAL
639639
];
640+
641+
// Resource that is being backed up.
642+
oneof source_resource {
643+
// Output only. Unique identifier of the GCP resource that is being backed
644+
// up.
645+
BackupGcpResource gcp_resource = 31
646+
[(google.api.field_behavior) = OUTPUT_ONLY];
647+
}
640648
}
641649

642650
// Message for creating a BackupVault.
@@ -780,6 +788,62 @@ message FetchUsableBackupVaultsResponse {
780788
repeated string unreachable = 3;
781789
}
782790

791+
// Request for the FetchBackupsForResourceType method.
792+
message FetchBackupsForResourceTypeRequest {
793+
// Required. Datasources are the parent resource for the backups.
794+
// Format:
795+
// projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}
796+
string parent = 1 [
797+
(google.api.field_behavior) = REQUIRED,
798+
(google.api.resource_reference) = {
799+
child_type: "backupdr.googleapis.com/Backup"
800+
}
801+
];
802+
803+
// Required. The type of the GCP resource.
804+
// Ex: sqladmin.googleapis.com/Instance
805+
string resource_type = 2 [(google.api.field_behavior) = REQUIRED];
806+
807+
// Optional. The maximum number of Backups to return. The service may
808+
// return fewer than this value. If unspecified, at most 50
809+
// Backups will be returned. The maximum value is 100; values
810+
// above 100 will be coerced to 100.
811+
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
812+
813+
// Optional. A page token, received from a previous call of
814+
// `FetchBackupsForResourceType`.
815+
// Provide this to retrieve the subsequent page.
816+
//
817+
// When paginating, all other parameters provided to
818+
// `FetchBackupsForResourceType` must match
819+
// the call that provided the page token.
820+
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
821+
822+
// Optional. A filter expression that filters the results fetched in the
823+
// response. The expression must specify the field name, a comparison
824+
// operator, and the value that you want to use for filtering. Supported
825+
// fields:
826+
string filter = 5 [(google.api.field_behavior) = OPTIONAL];
827+
828+
// Optional. A comma-separated list of fields to order by, sorted in ascending
829+
// order. Use "desc" after a field name for descending.
830+
string order_by = 6 [(google.api.field_behavior) = OPTIONAL];
831+
832+
// Optional. This parameter is used to specify the view of the backup.
833+
// If not specified, the default view is BASIC.
834+
BackupView view = 7 [(google.api.field_behavior) = OPTIONAL];
835+
}
836+
837+
// Response for the FetchBackupsForResourceType method.
838+
message FetchBackupsForResourceTypeResponse {
839+
// The Backups from the specified parent.
840+
repeated Backup backups = 1;
841+
842+
// A token, which can be sent as `page_token` to retrieve the next page.
843+
// If this field is omitted, there are no subsequent pages.
844+
string next_page_token = 2;
845+
}
846+
783847
// Request message for getting a BackupVault.
784848
message GetBackupVaultRequest {
785849
// Required. Name of the backupvault store resource name, in the format
@@ -1189,6 +1253,19 @@ message GcpResource {
11891253
string type = 3;
11901254
}
11911255

1256+
// Minimum details to identify a Google Cloud resource for a backup.
1257+
message BackupGcpResource {
1258+
// Name of the Google Cloud resource.
1259+
string gcp_resourcename = 1;
1260+
1261+
// Location of the resource: <region>/<zone>/"global"/"unspecified".
1262+
string location = 2;
1263+
1264+
// Type of the resource. Use the Unified Resource Type,
1265+
// eg. compute.googleapis.com/Instance.
1266+
string type = 3;
1267+
}
1268+
11921269
// Backup configuration state. Is the resource configured for backup?
11931270
enum BackupConfigState {
11941271
// The possible states of backup configuration.

packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@ message CloudSqlInstanceBackupProperties {
7979
}
8080
];
8181

82+
// Output only. The instance creation timestamp.
83+
google.protobuf.Timestamp instance_create_time = 5
84+
[(google.api.field_behavior) = OUTPUT_ONLY];
85+
8286
// Output only. The tier (or machine type) for this instance. Example:
8387
// `db-custom-1-3840`
8488
string instance_tier = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
89+
90+
// Output only. The instance delete timestamp.
91+
google.protobuf.Timestamp instance_delete_time = 8
92+
[(google.api.field_behavior) = OUTPUT_ONLY];
8593
}
8694

8795
// CloudSqlInstanceDataSourceReferenceProperties represents the properties of a

packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ message DataSourceReference {
7373
// Output only. The GCP resource that the DataSource is associated with.
7474
DataSourceGcpResourceInfo data_source_gcp_resource_info = 7
7575
[(google.api.field_behavior) = OUTPUT_ONLY];
76+
77+
// Output only. Total size of the storage used by all backup resources for the
78+
// referenced datasource.
79+
optional int64 total_stored_bytes = 8
80+
[(google.api.field_behavior) = OUTPUT_ONLY];
7681
}
7782

7883
// Information of backup configuration on the DataSource.
@@ -122,6 +127,64 @@ message GetDataSourceReferenceRequest {
122127
];
123128
}
124129

130+
// Request for the ListDataSourceReferences method.
131+
message ListDataSourceReferencesRequest {
132+
// Required. The parent resource name.
133+
// Format: projects/{project}/locations/{location}
134+
string parent = 1 [
135+
(google.api.field_behavior) = REQUIRED,
136+
(google.api.resource_reference) = {
137+
child_type: "backupdr.googleapis.com/DataSourceReference"
138+
}
139+
];
140+
141+
// Optional. The maximum number of DataSourceReferences to return. The service
142+
// may return fewer than this value. If unspecified, at most 50
143+
// DataSourceReferences will be returned. The maximum value is 100; values
144+
// above 100 will be coerced to 100.
145+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
146+
147+
// Optional. A page token, received from a previous `ListDataSourceReferences`
148+
// call. Provide this to retrieve the subsequent page.
149+
//
150+
// When paginating, all other parameters provided to
151+
// `ListDataSourceReferences` must match the call that provided the page
152+
// token.
153+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
154+
155+
// Optional. A filter expression that filters the results listed in the
156+
// response. The expression must specify the field name, a comparison
157+
// operator, and the value that you want to use for filtering.
158+
//
159+
// The following field and operator combinations are supported:
160+
//
161+
// * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=`
162+
// * data_source_gcp_resource_info.type with `=`, `!=`
163+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
164+
165+
// Optional. A comma-separated list of fields to order by, sorted in ascending
166+
// order. Use "desc" after a field name for descending.
167+
//
168+
// Supported fields:
169+
//
170+
// * data_source
171+
// * data_source_gcp_resource_info.gcp_resourcename
172+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
173+
}
174+
175+
// Response for the ListDataSourceReferences method.
176+
message ListDataSourceReferencesResponse {
177+
// The DataSourceReferences from the specified parent.
178+
repeated DataSourceReference data_source_references = 1;
179+
180+
// A token, which can be sent as `page_token` to retrieve the next page.
181+
// If this field is omitted, there are no subsequent pages.
182+
string next_page_token = 2;
183+
184+
// Locations that could not be reached.
185+
repeated string unreachable = 3;
186+
}
187+
125188
// Request for the FetchDataSourceReferencesForResourceType method.
126189
message FetchDataSourceReferencesForResourceTypeRequest {
127190
// Required. The parent resource name.

0 commit comments

Comments
 (0)