From db9aa740f20f4ebe967b34be251609aff50a16dc Mon Sep 17 00:00:00 2001 From: Google APIs Date: Tue, 15 Mar 2022 12:11:27 -0700 Subject: [PATCH] feat: [Cloud Memorystore for Redis] Support Maintenance Window PiperOrigin-RevId: 434820669 --- google/cloud/redis/v1/BUILD.bazel | 6 + google/cloud/redis/v1/cloud_redis.proto | 116 ++++++++++++++++++ .../redis/v1/redis_grpc_service_config.json | 4 + 3 files changed, 126 insertions(+) diff --git a/google/cloud/redis/v1/BUILD.bazel b/google/cloud/redis/v1/BUILD.bazel index ce398d6c0f447..e15f27ca82418 100644 --- a/google/cloud/redis/v1/BUILD.bazel +++ b/google/cloud/redis/v1/BUILD.bazel @@ -29,6 +29,9 @@ proto_library( "//google/api:field_behavior_proto", "//google/api:resource_proto", "//google/longrunning:operations_proto", + "//google/type:dayofweek_proto", + "//google/type:timeofday_proto", + "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:timestamp_proto", ], @@ -118,6 +121,8 @@ go_proto_library( deps = [ "//google/api:annotations_go_proto", "//google/longrunning:longrunning_go_proto", + "//google/type:dayofweek_go_proto", + "//google/type:timeofday_go_proto", ], ) @@ -133,6 +138,7 @@ go_gapic_library( "//google/longrunning:longrunning_go_proto", "@com_google_cloud_go//longrunning:go_default_library", "@com_google_cloud_go//longrunning/autogen:go_default_library", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", ], ) diff --git a/google/cloud/redis/v1/cloud_redis.proto b/google/cloud/redis/v1/cloud_redis.proto index f092502b78053..f0ba2f43fbfdb 100644 --- a/google/cloud/redis/v1/cloud_redis.proto +++ b/google/cloud/redis/v1/cloud_redis.proto @@ -21,8 +21,11 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1;redis"; option java_multiple_files = true; @@ -201,6 +204,20 @@ service CloudRedis { metadata_type: "google.cloud.redis.v1.OperationMetadata" }; } + + // Reschedule maintenance for a given instance in a given project and + // location. + rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance" + body: "*" + }; + option (google.api.method_signature) = "name, reschedule_type, schedule_time"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.redis.v1.Instance" + metadata_type: "google.cloud.redis.v1.OperationMetadata" + }; + } } // Node specific properties. @@ -441,6 +458,20 @@ message Instance { // If not provided, TLS is disabled for the instance. TransitEncryptionMode transit_encryption_mode = 26 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The number of replica nodes. The valid range for the Standard Tier with + // read replicas enabled is [1-5] and defaults to 2. If read replicas are not + // enabled for a Standard Tier instance, the only valid value is 1 and the + // default is 1. The valid value for basic tier is 0 and the default is also + // 0. + + // Optional. The maintenance policy for the instance. If not provided, + // maintenance events can be performed at any time. + MaintenancePolicy maintenance_policy = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Date and time of upcoming maintenance events which have been + // scheduled. + MaintenanceSchedule maintenance_schedule = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The number of replica nodes. The valid range for the Standard Tier with // read replicas enabled is [1-5] and defaults to 2. If read replicas are not // enabled for a Standard Tier instance, the only valid value is 1 and the @@ -465,6 +496,91 @@ message Instance { ReadReplicasMode read_replicas_mode = 35 [(google.api.field_behavior) = OPTIONAL]; } +// Request for [RescheduleMaintenance][google.cloud.redis.v1.CloudRedis.RescheduleMaintenance]. +message RescheduleMaintenanceRequest { + // Reschedule options. + enum RescheduleType { + // Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0; + + // If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1; + + // If the user wants to use the existing maintenance policy to find the + // next available window. + NEXT_AVAILABLE_WINDOW = 2; + + // If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3; + } + + // Required. Redis instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } + ]; + + // Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + RescheduleType reschedule_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Timestamp when the maintenance shall be rescheduled to if + // reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + // example `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp schedule_time = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Maintenance policy for an instance. +message MaintenancePolicy { + // Output only. The time when the policy was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the policy was last updated. + google.protobuf.Timestamp update_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Description of what this policy is for. Create/Update methods + // return INVALID_ARGUMENT if the length is greater than 512. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maintenance window that is applied to resources covered by this + // policy. Minimum 1. For the current version, the maximum number of + // weekly_window is expected to be one. + repeated WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Time window in which disruptive maintenance updates occur. Non-disruptive +// updates can occur inside or outside this window. +message WeeklyMaintenanceWindow { + // Required. The day of week that maintenance updates occur. + google.type.DayOfWeek day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Start time of the window in UTC time. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Duration of the maintenance window. The current window is fixed at 1 hour. + google.protobuf.Duration duration = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Upcoming maintenance schedule. If no maintenance is scheduled, fields are not +// populated. +message MaintenanceSchedule { + // Output only. The start time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If the scheduled maintenance can be rescheduled, default is true. + bool can_reschedule = 3 [deprecated = true]; + + // Output only. The deadline that the maintenance schedule start time can not go beyond, + // including reschedule. + google.protobuf.Timestamp schedule_deadline_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. message ListInstancesRequest { // Required. The resource name of the instance location using the form: diff --git a/google/cloud/redis/v1/redis_grpc_service_config.json b/google/cloud/redis/v1/redis_grpc_service_config.json index 77201fd2540e3..1537253c81b9b 100755 --- a/google/cloud/redis/v1/redis_grpc_service_config.json +++ b/google/cloud/redis/v1/redis_grpc_service_config.json @@ -14,6 +14,10 @@ "service": "google.cloud.redis.v1.CloudRedis", "method": "GetInstanceAuthString" }, + { + "service": "google.cloud.redis.v1.CloudRedis", + "method": "RescheduleMaintenance" + }, { "service": "google.cloud.redis.v1.CloudRedis", "method": "CreateInstance"