Skip to content

Commit 8cd8706

Browse files
Google APIscopybara-github
authored andcommitted
feat: add InitializeServiceAPI
feat: Update field behavior of `networks` field in message `ManagementServer` to `OPTIONAL` feat: add enum to Backup Vault Access Restriction field feat: `ignore_backup_plan_references` added to the DeleteBackupVaultRequest fix!: Update field behavior of `resource_type` field in message `BackupPlanAssociation` to `REQUIRED` docs: A comment for field `networks` in message `.google.cloud.backupdr.v1.ManagementServer` is changed docs: A comment for field `requested_cancellation` in message `.google.cloud.backupdr.v1.OperationMetadata` is changed docs: A comment for field `resource_type` in message `.google.cloud.backupdr.v1.BackupPlan` is changed docs: A comment for field `backup_retention_days` in message `.google.cloud.backupdr.v1.BackupRule` is changed docs: A comment for field `resource_type` in message `.google.cloud.backupdr.v1.BackupPlanAssociation` is changed docs: A comment for field `data_source` in message `.google.cloud.backupdr.v1.BackupPlanAssociation` is changed docs: A comment for field `rule_id` in message `.google.cloud.backupdr.v1.RuleConfigInfo` is changed docs: A comment for field `last_backup_error` in message `.google.cloud.backupdr.v1.RuleConfigInfo` is changed docs: A comment for enum value `ACCESS_RESTRICTION_UNSPECIFIED` in enum `AccessRestriction` is changed docs: A comment for field `uid` in message `.google.cloud.backupdr.v1.BackupVault` is changed docs: A comment for field `access_restriction` in message `.google.cloud.backupdr.v1.BackupVault` is changed PiperOrigin-RevId: 713528070
1 parent 00196e2 commit 8cd8706

5 files changed

Lines changed: 99 additions & 28 deletions

File tree

google/cloud/backupdr/v1/backupdr.proto

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,19 @@ service BackupDR {
348348
metadata_type: "OperationMetadata"
349349
};
350350
}
351+
352+
// Initializes the service related config for a project.
353+
rpc InitializeService(InitializeServiceRequest)
354+
returns (google.longrunning.Operation) {
355+
option (google.api.http) = {
356+
post: "/v1/{name=projects/*/locations/*/serviceConfig}:initialize"
357+
body: "*"
358+
};
359+
option (google.longrunning.operation_info) = {
360+
response_type: "InitializeServiceResponse"
361+
metadata_type: "OperationMetadata"
362+
};
363+
}
351364
}
352365

353366
// Network configuration for ManagementServer instance.
@@ -490,9 +503,10 @@ message ManagementServer {
490503
// Output only. The ManagementServer state.
491504
InstanceState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
492505

493-
// Required. VPC networks to which the ManagementServer instance is connected.
494-
// For this version, only a single network is supported.
495-
repeated NetworkConfig networks = 8 [(google.api.field_behavior) = REQUIRED];
506+
// Optional. VPC networks to which the ManagementServer instance is connected.
507+
// For this version, only a single network is supported. This field is
508+
// optional if MS is created without PSA
509+
repeated NetworkConfig networks = 8 [(google.api.field_behavior) = OPTIONAL];
496510

497511
// Optional. Server specified ETag for the ManagementServer resource to
498512
// prevent simultaneous updates from overwiting each other.
@@ -645,6 +659,50 @@ message DeleteManagementServerRequest {
645659
string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
646660
}
647661

662+
// Request message for initializing the service.
663+
message InitializeServiceRequest {
664+
// Required. The resource name of the serviceConfig used to initialize the
665+
// service. Format:
666+
// `projects/{project_id}/locations/{location}/serviceConfig`.
667+
string name = 1 [(google.api.field_behavior) = REQUIRED];
668+
669+
// Required. The resource type to which the default service config will be
670+
// applied. Examples include, "compute.googleapis.com/Instance" and
671+
// "storage.googleapis.com/Bucket".
672+
string resource_type = 2 [(google.api.field_behavior) = REQUIRED];
673+
674+
// Optional. An optional request ID to identify requests. Specify a unique
675+
// request ID so that if you must retry your request, the server will know to
676+
// ignore the request if it has already been completed. The server will
677+
// guarantee that for at least 60 minutes since the first request.
678+
//
679+
// For example, consider a situation where you make an initial request and t
680+
// he request times out. If you make the request again with the same request
681+
// ID, the server can check if original operation with the same request ID
682+
// was received, and if so, will ignore the second request. This prevents
683+
// clients from accidentally creating duplicate commitments.
684+
//
685+
// The request ID must be a valid UUID with the exception that zero UUID is
686+
// not supported (00000000-0000-0000-0000-000000000000).
687+
string request_id = 3 [
688+
(google.api.field_info).format = UUID4,
689+
(google.api.field_behavior) = OPTIONAL
690+
];
691+
}
692+
693+
// Response message for initializing the service.
694+
message InitializeServiceResponse {
695+
// The resource name of the default `BackupVault` created.
696+
// Format:
697+
// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
698+
string backup_vault_name = 1;
699+
700+
// The resource name of the default `BackupPlan` created.
701+
// Format:
702+
// `projects/{project_id}/locations/{location}/backupPlans/{backup_plan_id}`.
703+
string backup_plan_name = 2;
704+
}
705+
648706
// Represents the metadata of the long-running operation.
649707
message OperationMetadata {
650708
// Output only. The time the operation was created.
@@ -666,9 +724,10 @@ message OperationMetadata {
666724

667725
// Output only. Identifies whether the user has requested cancellation
668726
// of the operation. Operations that have successfully been cancelled
669-
// have [Operation.error][] value with a
670-
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
671-
// 'Code.CANCELLED'.
727+
// have
728+
// [google.longrunning.Operation.error][google.longrunning.Operation.error]
729+
// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
730+
// corresponding to 'Code.CANCELLED'.
672731
bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
673732

674733
// Output only. API version used to start the operation.

google/cloud/backupdr/v1/backupdr_grpc_service_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
{
4646
"service": "google.cloud.backupdr.v1.BackupDR",
4747
"method": "GetBackup"
48+
},
49+
{
50+
"service": "google.cloud.backupdr.v1.BackupDR",
51+
"method": "InitializeService"
4852
}
4953
],
5054
"timeout": "60s",

google/cloud/backupdr/v1/backupplan.proto

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ message BackupPlan {
9797
State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
9898

9999
// Required. The resource type to which the `BackupPlan` will be applied.
100-
// Examples include, "compute.googleapis.com/Instance" and
101-
// "storage.googleapis.com/Bucket".
100+
// Examples include, "compute.googleapis.com/Instance",
101+
// "sqladmin.googleapis.com/Instance", or "alloydb.googleapis.com/Cluster".
102102
string resource_type = 8 [(google.api.field_behavior) = REQUIRED];
103103

104104
// Optional. `etag` is returned from the service in the response. As a user of
@@ -137,10 +137,14 @@ message BackupRule {
137137
// Required. Configures the duration for which backup data will be kept. It is
138138
// defined in “days”. The value should be greater than or equal to minimum
139139
// enforced retention of the backup vault.
140+
//
141+
// Minimum value is 1 and maximum value is 90 for hourly backups.
142+
// Minimum value is 1 and maximum value is 90 for daily backups.
143+
// Minimum value is 7 and maximum value is 186 for weekly backups.
144+
// Minimum value is 30 and maximum value is 732 for monthly backups.
145+
// Minimum value is 365 and maximum value is 36159 for yearly backups.
140146
int32 backup_retention_days = 4 [(google.api.field_behavior) = REQUIRED];
141147

142-
// Required.
143-
//
144148
// The schedule that defines the automated backup workloads for this
145149
// `BackupRule`.
146150
oneof backup_schedule_oneof {

google/cloud/backupdr/v1/backupplanassociation.proto

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ message BackupPlanAssociation {
6666
(google.api.field_behavior) = OUTPUT_ONLY
6767
];
6868

69-
// Optional. Resource type of workload on which backupplan is applied
70-
string resource_type = 2 [(google.api.field_behavior) = OPTIONAL];
69+
// Required. Immutable. Resource type of workload on which backupplan is
70+
// applied
71+
string resource_type = 2 [
72+
(google.api.field_behavior) = IMMUTABLE,
73+
(google.api.field_behavior) = REQUIRED
74+
];
7175

7276
// Required. Immutable. Resource name of workload on which backupplan is
7377
// applied
@@ -101,11 +105,8 @@ message BackupPlanAssociation {
101105
repeated RuleConfigInfo rules_config_info = 8
102106
[(google.api.field_behavior) = OUTPUT_ONLY];
103107

104-
// Output only. Output Only.
105-
//
106-
// Resource name of data source which will be used as storage location for
107-
// backups taken.
108-
// Format :
108+
// Output only. Resource name of data source which will be used as storage
109+
// location for backups taken. Format :
109110
// projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
110111
string data_source = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
111112
}
@@ -131,18 +132,14 @@ message RuleConfigInfo {
131132
FAILED = 4;
132133
}
133134

134-
// Output only. Output Only.
135-
//
136-
// Backup Rule id fetched from backup plan.
135+
// Output only. Backup Rule id fetched from backup plan.
137136
string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
138137

139138
// Output only. The last backup state for rule.
140139
LastBackupState last_backup_state = 3
141140
[(google.api.field_behavior) = OUTPUT_ONLY];
142141

143-
// Output only. Output Only.
144-
//
145-
// google.rpc.Status object to store the last backup error.
142+
// Output only. google.rpc.Status object to store the last backup error.
146143
google.rpc.Status last_backup_error = 4
147144
[(google.api.field_behavior) = OUTPUT_ONLY];
148145

google/cloud/backupdr/v1/backupvault.proto

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ message BackupVault {
6363

6464
// Holds the access restriction for the backup vault.
6565
enum AccessRestriction {
66-
// Access restriction not set.
66+
// Access restriction not set. If user does not provide any value or pass
67+
// this value, it will be changed to WITHIN_ORGANIZATION.
6768
ACCESS_RESTRICTION_UNSPECIFIED = 0;
6869

6970
// Access to or from resources outside your current project will be denied.
@@ -75,6 +76,10 @@ message BackupVault {
7576

7677
// No access restriction.
7778
UNRESTRICTED = 3;
79+
80+
// Access to or from resources outside your current organization will be
81+
// denied except for backup appliance.
82+
WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4;
7883
}
7984

8085
// Output only. Identifier. Name of the backup vault to create. It must have
@@ -134,8 +139,7 @@ message BackupVault {
134139
// Output only. Total size of the storage used by all backup resources.
135140
int64 total_stored_bytes = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
136141

137-
// Output only. Output only
138-
// Immutable after resource creation until resource deletion.
142+
// Output only. Immutable after resource creation until resource deletion.
139143
string uid = 21 [
140144
(google.api.field_info).format = UUID4,
141145
(google.api.field_behavior) = OUTPUT_ONLY
@@ -148,8 +152,6 @@ message BackupVault {
148152
// Optional. Note: This field is added for future use case and will not be
149153
// supported in the current release.
150154
//
151-
// Optional.
152-
//
153155
// Access restriction for the backup vault.
154156
// Default value is WITHIN_ORGANIZATION if not provided during creation.
155157
AccessRestriction access_restriction = 24
@@ -815,6 +817,11 @@ message DeleteBackupVaultRequest {
815817
// Optional. If true and the BackupVault is not found, the request will
816818
// succeed but no action will be taken.
817819
bool allow_missing = 6 [(google.api.field_behavior) = OPTIONAL];
820+
821+
// Optional. If set to true, backupvault deletion will proceed even if there
822+
// are backup plans referencing the backupvault. The default is 'false'.
823+
bool ignore_backup_plan_references = 7
824+
[(google.api.field_behavior) = OPTIONAL];
818825
}
819826

820827
// Request message for listing DataSources.

0 commit comments

Comments
 (0)