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.cloud.netapp.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/duration.proto"; 22import "google/protobuf/field_mask.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.NetApp.V1"; 26option go_package = "cloud.google.com/go/netapp/apiv1/netapppb;netapppb"; 27option java_multiple_files = true; 28option java_outer_classname = "ReplicationProto"; 29option java_package = "com.google.cloud.netapp.v1"; 30option php_namespace = "Google\\Cloud\\NetApp\\V1"; 31option ruby_package = "Google::Cloud::NetApp::V1"; 32 33// TransferStats reports all statistics related to replication transfer. 34message TransferStats { 35 // bytes trasferred so far in current transfer. 36 optional int64 transfer_bytes = 1; 37 38 // Total time taken during transfer. 39 optional google.protobuf.Duration total_transfer_duration = 2; 40 41 // Last transfer size in bytes. 42 optional int64 last_transfer_bytes = 3; 43 44 // Time taken during last transfer. 45 optional google.protobuf.Duration last_transfer_duration = 4; 46 47 // Lag duration indicates the duration by which Destination region volume 48 // content lags behind the primary region volume content. 49 optional google.protobuf.Duration lag_duration = 5; 50 51 // Time when progress was updated last. 52 optional google.protobuf.Timestamp update_time = 6; 53 54 // Time when last transfer completed. 55 optional google.protobuf.Timestamp last_transfer_end_time = 7; 56 57 // A message describing the cause of the last transfer failure. 58 optional string last_transfer_error = 8; 59} 60 61// Replication is a nested resource under Volume, that describes a 62// cross-region replication relationship between 2 volumes in different 63// regions. 64message Replication { 65 option (google.api.resource) = { 66 type: "netapp.googleapis.com/Replication" 67 pattern: "projects/{project}/locations/{location}/volumes/{volume}/replications/{replication}" 68 plural: "replications" 69 singular: "replication" 70 }; 71 72 // The replication states 73 // New enum values may be added in future to indicate possible new states. 74 enum State { 75 // Unspecified replication State 76 STATE_UNSPECIFIED = 0; 77 78 // Replication is creating. 79 CREATING = 1; 80 81 // Replication is ready. 82 READY = 2; 83 84 // Replication is updating. 85 UPDATING = 3; 86 87 // Replication is deleting. 88 DELETING = 5; 89 90 // Replication is in error state. 91 ERROR = 6; 92 } 93 94 // New enum values may be added in future to support different replication 95 // topology. 96 enum ReplicationRole { 97 // Unspecified replication role 98 REPLICATION_ROLE_UNSPECIFIED = 0; 99 100 // Indicates Source volume. 101 SOURCE = 1; 102 103 // Indicates Destination volume. 104 DESTINATION = 2; 105 } 106 107 // Schedule for Replication. 108 // New enum values may be added in future to support different frequency of 109 // replication. 110 enum ReplicationSchedule { 111 // Unspecified ReplicationSchedule 112 REPLICATION_SCHEDULE_UNSPECIFIED = 0; 113 114 // Replication happens once every 10 minutes. 115 EVERY_10_MINUTES = 1; 116 117 // Replication happens once every hour. 118 HOURLY = 2; 119 120 // Replication happens once every day. 121 DAILY = 3; 122 } 123 124 // Mirroring states. 125 // No new value is expected to be added in future. 126 enum MirrorState { 127 // Unspecified MirrorState 128 MIRROR_STATE_UNSPECIFIED = 0; 129 130 // Destination volume is being prepared. 131 PREPARING = 1; 132 133 // Destination volume has been initialized and is ready to receive 134 // replication transfers. 135 MIRRORED = 2; 136 137 // Destination volume is not receiving replication transfers. 138 STOPPED = 3; 139 140 // Replication is in progress. 141 TRANSFERRING = 4; 142 } 143 144 // Identifier. The resource name of the Replication. 145 // Format: 146 // `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`. 147 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 148 149 // Output only. State of the replication. 150 State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 151 152 // Output only. State details of the replication. 153 string state_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 154 155 // Output only. Indicates whether this points to source or destination. 156 ReplicationRole role = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 157 158 // Required. Indicates the schedule for replication. 159 ReplicationSchedule replication_schedule = 5 160 [(google.api.field_behavior) = REQUIRED]; 161 162 // Output only. Indicates the state of mirroring. 163 MirrorState mirror_state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 164 165 // Output only. Condition of the relationship. Can be one of the following: 166 // - true: The replication relationship is healthy. It has not missed the most 167 // recent scheduled transfer. 168 // - false: The replication relationship is not healthy. It has missed the 169 // most recent scheduled transfer. 170 optional bool healthy = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 171 172 // Output only. Replication create time. 173 google.protobuf.Timestamp create_time = 9 174 [(google.api.field_behavior) = OUTPUT_ONLY]; 175 176 // Output only. Full name of destination volume resource. 177 // Example : "projects/{project}/locations/{location}/volumes/{volume_id}" 178 string destination_volume = 10 [ 179 (google.api.field_behavior) = OUTPUT_ONLY, 180 (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } 181 ]; 182 183 // Output only. Replication transfer statistics. 184 TransferStats transfer_stats = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 185 186 // Resource labels to represent user provided metadata. 187 map<string, string> labels = 12; 188 189 // A description about this replication relationship. 190 optional string description = 13; 191 192 // Required. Input only. Destination volume parameters 193 DestinationVolumeParameters destination_volume_parameters = 14 [ 194 (google.api.field_behavior) = INPUT_ONLY, 195 (google.api.field_behavior) = REQUIRED 196 ]; 197 198 // Output only. Full name of source volume resource. 199 // Example : "projects/{project}/locations/{location}/volumes/{volume_id}" 200 string source_volume = 15 [ 201 (google.api.field_behavior) = OUTPUT_ONLY, 202 (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } 203 ]; 204} 205 206// ListReplications lists replications. 207message ListReplicationsRequest { 208 // Required. The volume for which to retrieve replication information, 209 // in the format 210 // `projects/{project_id}/locations/{location}/volumes/{volume_id}`. 211 string parent = 1 [ 212 (google.api.field_behavior) = REQUIRED, 213 (google.api.resource_reference) = { 214 child_type: "netapp.googleapis.com/Replication" 215 } 216 ]; 217 218 // The maximum number of items to return. 219 int32 page_size = 2; 220 221 // The next_page_token value to use if there are additional 222 // results to retrieve for this list request. 223 string page_token = 3; 224 225 // Sort results. Supported values are "name", "name desc" or "" (unsorted). 226 string order_by = 4; 227 228 // List filter. 229 string filter = 5; 230} 231 232// ListReplicationsResponse is the result of ListReplicationsRequest. 233message ListReplicationsResponse { 234 // A list of replications in the project for the specified volume. 235 repeated Replication replications = 1; 236 237 // The token you can use to retrieve the next page of results. Not returned 238 // if there are no more results in the list. 239 string next_page_token = 2; 240 241 // Locations that could not be reached. 242 repeated string unreachable = 3; 243} 244 245// GetReplicationRequest gets the state of a replication. 246message GetReplicationRequest { 247 // Required. The replication resource name, in the format 248 // `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}` 249 string name = 1 [ 250 (google.api.field_behavior) = REQUIRED, 251 (google.api.resource_reference) = { 252 type: "netapp.googleapis.com/Replication" 253 } 254 ]; 255} 256 257// DestinationVolumeParameters specify input parameters used for creating 258// destination volume. 259message DestinationVolumeParameters { 260 // Required. Existing destination StoragePool name. 261 string storage_pool = 1 [ 262 (google.api.field_behavior) = REQUIRED, 263 (google.api.resource_reference) = { 264 type: "netapp.googleapis.com/StoragePool" 265 } 266 ]; 267 268 // Desired destination volume resource id. If not specified, source volume's 269 // resource id will be used. 270 // This value must start with a lowercase letter followed by up to 62 271 // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. 272 string volume_id = 2; 273 274 // Destination volume's share name. If not specified, source volume's share 275 // name will be used. 276 string share_name = 3; 277 278 // Description for the destination volume. 279 optional string description = 4; 280} 281 282// CreateReplicationRequest creates a replication. 283message CreateReplicationRequest { 284 // Required. The NetApp volume to create the replications of, in the format 285 // `projects/{project_id}/locations/{location}/volumes/{volume_id}` 286 string parent = 1 [ 287 (google.api.field_behavior) = REQUIRED, 288 (google.api.resource_reference) = { 289 child_type: "netapp.googleapis.com/Replication" 290 } 291 ]; 292 293 // Required. A replication resource 294 Replication replication = 2 [(google.api.field_behavior) = REQUIRED]; 295 296 // Required. ID of the replication to create. 297 // This value must start with a lowercase letter followed by up to 62 298 // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. 299 string replication_id = 3 [(google.api.field_behavior) = REQUIRED]; 300} 301 302// DeleteReplicationRequest deletes a replication. 303message DeleteReplicationRequest { 304 // Required. The replication resource name, in the format 305 // `projects/*/locations/*/volumes/*/replications/{replication_id}` 306 string name = 1 [ 307 (google.api.field_behavior) = REQUIRED, 308 (google.api.resource_reference) = { 309 type: "netapp.googleapis.com/Replication" 310 } 311 ]; 312} 313 314// UpdateReplicationRequest updates description and/or labels for a replication. 315message UpdateReplicationRequest { 316 // Required. Mask of fields to update. At least one path must be supplied in 317 // this field. 318 google.protobuf.FieldMask update_mask = 1 319 [(google.api.field_behavior) = REQUIRED]; 320 321 // Required. A replication resource 322 Replication replication = 2 [(google.api.field_behavior) = REQUIRED]; 323} 324 325// StopReplicationRequest stops a replication until resumed. 326message StopReplicationRequest { 327 // Required. The resource name of the replication, in the format of 328 // projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}. 329 string name = 1 [ 330 (google.api.field_behavior) = REQUIRED, 331 (google.api.resource_reference) = { 332 type: "netapp.googleapis.com/Replication" 333 } 334 ]; 335 336 // Indicates whether to stop replication forcefully while data transfer is in 337 // progress. 338 // Warning! if force is true, this will abort any current transfers 339 // and can lead to data loss due to partial transfer. 340 // If force is false, stop replication will fail while data transfer is in 341 // progress and you will need to retry later. 342 bool force = 2; 343} 344 345// ResumeReplicationRequest resumes a stopped replication. 346message ResumeReplicationRequest { 347 // Required. The resource name of the replication, in the format of 348 // projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}. 349 string name = 1 [ 350 (google.api.field_behavior) = REQUIRED, 351 (google.api.resource_reference) = { 352 type: "netapp.googleapis.com/Replication" 353 } 354 ]; 355} 356 357// ReverseReplicationDirectionRequest reverses direction of replication. Source 358// becomes destination and destination becomes source. 359message ReverseReplicationDirectionRequest { 360 // Required. The resource name of the replication, in the format of 361 // projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}. 362 string name = 1 [ 363 (google.api.field_behavior) = REQUIRED, 364 (google.api.resource_reference) = { 365 type: "netapp.googleapis.com/Replication" 366 } 367 ]; 368} 369