# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
  - ALPHA
  auto_generated: true
  help_text:
    brief: Update the configuration of a Memorystore instance.
    description: Update the configuration of a Memorystore instance.
    examples: |-
      To update Memorystore instance `my-instance` in project `my-project` and location
      `us-central1` to six shards, run:

      $ {command} `my-instance` --project=my-project --location=us-central1 --shard-count=6

      To update Memorystore instance `my-instance` in project `my-project` and location
      `us-central1` to use a maxmemory-policy of `allkeys-lru`, run:

      $ {command} `my-instance` --project=my-project --location=us-central1
        --update-engine-configs=maxmemory-policy=allkeys-lru
  arguments:
    params:
    - group:
        mutex: true
        help_text: |-
          Arguments for the  replica count.
        params:
        - arg_name: replica-count
          api_field: instance.replicaCount
          required: false
          repeated: false
          type: int
          help_text: |-
            Number of replica nodes per shard. If omitted the default is 0 replicas.
    - group:
        mutex: true
        help_text: |-
          Arguments for the  deletion protection enabled.
        params:
        - arg_name: deletion-protection-enabled
          api_field: instance.deletionProtectionEnabled
          action: store_true_false
          required: false
          type: bool
          help_text: |-
            If set to true deletion of the instance will fail.
    - group:
        mutex: true
        help_text: |-
          Arguments for the  simulate maintenance event.
        params:
        - arg_name: simulate-maintenance-event
          api_field: instance.simulateMaintenanceEvent
          action: store_true_false
          required: false
          type: bool
          help_text: |-
            Simulate a maintenance event.
    - group:
        mutex: true
        help_text: |-
          Arguments for the  ondemand maintenance.
        params:
        - arg_name: ondemand-maintenance
          api_field: instance.ondemandMaintenance
          action: store_true_false
          required: false
          type: bool
          help_text: |-
            Ondemand maintenance for the instance.
    - group:
        mutex: true
        help_text: |-
          Arguments for the  async instance endpoints deletion enabled.
        params:
        - arg_name: async-instance-endpoints-deletion-enabled
          api_field: instance.asyncInstanceEndpointsDeletionEnabled
          action: store_true_false
          required: false
          type: bool
          help_text: |-
            If true, instance endpoints that are created and registered by customers
            can be deleted asynchronously. That is, such an instance endpoint can be
            de-registered before the forwarding rules in the instance endpoint are
            deleted.
    - group:
        mutex: true
        help_text: |-
          Arguments for the  kms key.
        params:
        - arg_name: kms-key
          help_text: |-
            The KMS key used to encrypt the at-rest data of the cluster.
          is_positional: false
          is_primary_resource: false
          resource_spec: !REF googlecloudsdk.command_lib.memorystore.v1alpha_resources:projects_locations_key_rings_crypto_keys
          resource_method_params:
            instance.kmsKey: '{__relative_name__}'
          required: false
          clearable: true
    - help_text: |-
        Identifier. Unique name of the instance.
        Format: projects/{project}/locations/{location}/instances/{instance}
      is_positional: true
      is_primary_resource: true
      resource_spec: !REF googlecloudsdk.command_lib.memorystore.v1alpha_resources:projects_locations_instances
      required: true
    - arg_name: labels
      api_field: instance.labels
      required: false
      repeated: true
      help_text: |-
        Labels to represent user-provided metadata.
      clearable: true
      spec:
      - api_field: key
      - api_field: value
    - arg_name: shard-count
      api_field: instance.shardCount
      required: false
      repeated: false
      type: int
      help_text: |-
        Number of shards for the instance.
    - arg_name: node-type
      api_field: instance.nodeType
      required: false
      help_text: |-
        Machine type for individual nodes of the instance.
      choices:
      - arg_value: shared-core-nano
        enum_value: SHARED_CORE_NANO
        help_text: |-
          Shared core nano.
      - arg_value: highmem-medium
        enum_value: HIGHMEM_MEDIUM
        help_text: |-
          High memory medium.
      - arg_value: highmem-xlarge
        enum_value: HIGHMEM_XLARGE
        help_text: |-
          High memory extra large.
      - arg_value: standard-small
        enum_value: STANDARD_SMALL
        help_text: |-
          Standard small.
    - group:
        api_field: instance.persistenceConfig
        arg_name: persistence-config
        clearable: true
        required: false
        help_text: |-
          Represents persistence configuration for a instance.
        params:
        - arg_name: persistence-config-mode
          api_field: instance.persistenceConfig.mode
          required: false
          help_text: |-
            Current persistence mode.
          choices:
          - arg_value: disabled
            enum_value: DISABLED
            help_text: |-
              Persistence is disabled, and any snapshot data is deleted.
          - arg_value: rdb
            enum_value: RDB
            help_text: |-
              RDB based persistence is enabled.
          - arg_value: aof
            enum_value: AOF
            help_text: |-
              AOF based persistence is enabled.
        - group:
            api_field: instance.persistenceConfig.rdbConfig
            required: false
            help_text: |-
              Configuration for RDB based persistence.
            params:
            - arg_name: rdb-config-snapshot-period
              api_field: instance.persistenceConfig.rdbConfig.rdbSnapshotPeriod
              required: false
              help_text: |-
                Period between RDB snapshots.
              choices:
              - arg_value: one-hour
                enum_value: ONE_HOUR
                help_text: |-
                  One hour.
              - arg_value: six-hours
                enum_value: SIX_HOURS
                help_text: |-
                  Six hours.
              - arg_value: twelve-hours
                enum_value: TWELVE_HOURS
                help_text: |-
                  Twelve hours.
              - arg_value: twenty-four-hours
                enum_value: TWENTY_FOUR_HOURS
                help_text: |-
                  Twenty four hours.
            - arg_name: rdb-config-snapshot-start-time
              api_field: instance.persistenceConfig.rdbConfig.rdbSnapshotStartTime
              required: false
              repeated: false
              type: googlecloudsdk.core.util.times:ParseDateTime
              processor: googlecloudsdk.core.util.times:FormatDateTime
              help_text: |-
                Time that the first snapshot was/will be attempted, and to which future
                snapshots will be aligned. If not provided, the current time will be
                used.
        - group:
            api_field: instance.persistenceConfig.aofConfig
            required: false
            help_text: |-
              Configuration for AOF based persistence.
            params:
            - arg_name: aof-config-append-fsync
              api_field: instance.persistenceConfig.aofConfig.appendFsync
              required: false
              help_text: |-
                The fsync mode.
              choices:
              - arg_value: never
                enum_value: NEVER
                help_text: |-
                  Never fsync. Normally Linux will flush data every 30 seconds with this
                  configuration, but it's up to the kernel's exact tuning.
              - arg_value: every-sec
                enum_value: EVERY_SEC
                help_text: |-
                  Fsync every second. You may lose 1 second of data if there is a
                  disaster.
              - arg_value: always
                enum_value: ALWAYS
                help_text: |-
                  Fsync every time new write commands are appended to the AOF. The best
                  data loss protection at the cost of performance.
    - arg_name: engine-version
      api_field: instance.engineVersion
      required: false
      repeated: false
      help_text: |-
        Engine version of the instance.
    - arg_name: engine-configs
      api_field: instance.engineConfigs
      required: false
      repeated: true
      help_text: |-
        User-provided engine configurations for the instance.
      clearable: true
      spec:
      - api_field: key
      - api_field: value
    - arg_name: endpoints
      api_field: instance.endpoints
      required: false
      repeated: true
      help_text: |-
        Endpoints for the instance.
      clearable: true
      spec:
      - api_field: connections
        help_text: |-
          A group of PSC connections. They are created in the same VPC network, one
          for each service attachment in the cluster.
        spec:
        - api_field: pscConnection
          one_of_index: 0
          help_text: |-
            Detailed information of a PSC connection that is created by the user.
          spec:
          - api_field: port
            one_of_index: 0
            help_text: |-
              port will only be set for Primary/Reader or Discovery endpoint.
          - api_field: pscConnectionId
            help_text: |-
              The PSC connection id of the forwarding rule connected to the
              service attachment.
          - api_field: ipAddress
            help_text: |-
              The IP allocated on the consumer network for the PSC forwarding rule.
          - api_field: forwardingRule
            resource_pattern: projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
            help_text: |-
              The URI of the consumer side forwarding rule.
              Format:
              projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
          - api_field: network
            resource_pattern: projects/{project}/global/networks/{network}
            help_text: |-
              The consumer network where the IP address resides, in the form of
              projects/{project_id}/global/networks/{network_id}.
          - api_field: serviceAttachment
            resource_pattern: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
            help_text: |-
              The service attachment which is the target of the PSC connection,
              in the form of
              projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
    - arg_name: mode
      api_field: instance.mode
      required: false
      help_text: |-
        The mode config for the instance.
      choices:
      - arg_value: standalone
        enum_value: STANDALONE
        help_text: |-
          Deprecated: Use CLUSTER_DISABLED instead.
      - arg_value: cluster
        enum_value: CLUSTER
        help_text: |-
          Instance is in cluster mode.
      - arg_value: cluster-disabled
        enum_value: CLUSTER_DISABLED
        help_text: |-
          Cluster mode is disabled for the instance.
    - group:
        api_field: instance.maintenancePolicy
        arg_name: maintenance-policy
        clearable: true
        required: false
        help_text: |-
          Maintenance policy per instance.
        params:
        - arg_name: maintenance-policy-weekly-window
          api_field: instance.maintenancePolicy.weeklyMaintenanceWindow
          required: false
          repeated: true
          help_text: |-
            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.
          clearable: true
          spec:
          - api_field: day
            help_text: |-
              Allows to define schedule that runs specified day of the week.
          - api_field: startTime
            help_text: |-
              Start time of the window in UTC.
            spec:
            - api_field: hours
              help_text: |-
                Hours of a day in 24 hour format. Must be greater than or equal to 0 and
                typically must be less than or equal to 23. An API may choose to allow the
                value "24:00:00" for scenarios like business closing time.
            - api_field: minutes
              help_text: |-
                Minutes of an hour. Must be greater than or equal to 0 and less than or
                equal to 59.
            - api_field: seconds
              help_text: |-
                Seconds of a minute. Must be greater than or equal to 0 and typically must
                be less than or equal to 59. An API may allow the value 60 if it allows
                leap-seconds.
            - api_field: nanos
              help_text: |-
                Fractions of seconds, in nanoseconds. Must be greater than or equal to 0
                and less than or equal to 999,999,999.
    - group:
        api_field: instance.crossInstanceReplicationConfig
        arg_name: cross-instance-replication-config
        clearable: true
        required: false
        help_text: |-
          Cross instance replication config.
        params:
        - arg_name: cross-instance-replication-config-role
          api_field: instance.crossInstanceReplicationConfig.instanceRole
          required: false
          help_text: |-
            The role of the instance in cross instance replication.
          choices:
          - arg_value: none
            enum_value: NONE
            help_text: |-
              This instance does not participate in cross instance replication. It is
              an independent instance and does not replicate to or from any other
              instances.
          - arg_value: primary
            enum_value: PRIMARY
            help_text: |-
              A instance that allows both reads and writes. Any data written to this
              instance is also replicated to the attached secondary instances.
          - arg_value: secondary
            enum_value: SECONDARY
            help_text: |-
              A instance that allows only reads and replicates data from a primary
              instance.
        - group:
            api_field: instance.crossInstanceReplicationConfig.primaryInstance
            required: false
            help_text: |-
              Details of the remote instance associated with this instance in a cross
              instance replication setup.
            params:
            - arg_name: primary-instance
              help_text: |-
                The full resource path of the remote instance in
                the format: projects/<project>/locations/<region>/instances/<instance-id>
              is_positional: false
              is_primary_resource: false
              resource_spec: !REF googlecloudsdk.command_lib.memorystore.v1alpha_resources:projects_locations_instances
              resource_method_params:
                instance.crossInstanceReplicationConfig.primaryInstance.instance: '{__relative_name__}'
              required: false
              clearable: true
        - arg_name: cross-instance-replication-config-secondary-instances
          api_field: instance.crossInstanceReplicationConfig.secondaryInstances
          required: false
          repeated: true
          help_text: |-
            List of secondary instances that are replicating from this primary
            instance.

            This field is only set for a primary instance.
          clearable: true
          spec:
          - api_field: instance
            resource_pattern: projects/{project}/locations/{location}/instances/{instance}
            help_text: |-
              The full resource path of the remote instance in
              the format: projects/<project>/locations/<region>/instances/<instance-id>
    - group:
        api_field: instance.automatedBackupConfig
        arg_name: automated-backup-config
        clearable: true
        required: false
        help_text: |-
          The automated backup config for an instance.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the schedule.
            params:
            - group:
                api_field: instance.automatedBackupConfig.fixedFrequencySchedule
                required: false
                help_text: |-
                  This schedule allows the backup to be triggered at a fixed frequency
                  (currently only daily is supported).
                params:
                - group:
                    api_field: instance.automatedBackupConfig.fixedFrequencySchedule.startTime
                    required: false
                    help_text: |-
                      Represents a time of day. The date and time zone are either not significant
                      or are specified elsewhere. An API may choose to allow leap seconds. Related
                      types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`.
                    params:
                    - arg_name: fixed-frequency-schedule-start-time-hours
                      api_field: instance.automatedBackupConfig.fixedFrequencySchedule.startTime.hours
                      required: false
                      repeated: false
                      type: int
                      help_text: |-
                        Hours of a day in 24 hour format. Must be greater than or equal to 0 and
                        typically must be less than or equal to 23. An API may choose to allow the
                        value "24:00:00" for scenarios like business closing time.
                    - arg_name: fixed-frequency-schedule-start-time-minutes
                      api_field: instance.automatedBackupConfig.fixedFrequencySchedule.startTime.minutes
                      required: false
                      repeated: false
                      type: int
                      help_text: |-
                        Minutes of an hour. Must be greater than or equal to 0 and less than or
                        equal to 59.
                    - arg_name: fixed-frequency-schedule-start-time-seconds
                      api_field: instance.automatedBackupConfig.fixedFrequencySchedule.startTime.seconds
                      required: false
                      repeated: false
                      type: int
                      help_text: |-
                        Seconds of a minute. Must be greater than or equal to 0 and typically must
                        be less than or equal to 59. An API may allow the value 60 if it allows
                        leap-seconds.
                    - arg_name: fixed-frequency-schedule-start-time-nanos
                      api_field: instance.automatedBackupConfig.fixedFrequencySchedule.startTime.nanos
                      required: false
                      repeated: false
                      type: int
                      help_text: |-
                        Fractions of seconds, in nanoseconds. Must be greater than or equal to 0
                        and less than or equal to 999,999,999.
        - arg_name: automated-backup-config-mode
          api_field: instance.automatedBackupConfig.automatedBackupMode
          required: false
          help_text: |-
            The automated backup mode. If the mode is disabled, the other fields will
            be ignored.
          choices:
          - arg_value: disabled
            enum_value: DISABLED
            help_text: |-
              Automated backup config disabled.
          - arg_value: enabled
            enum_value: ENABLED
            help_text: |-
              Automated backup config enabled.
        - arg_name: automated-backup-config-retention
          api_field: instance.automatedBackupConfig.retention
          required: false
          repeated: false
          type: googlecloudsdk.core.util.times:ParseDuration
          processor: googlecloudsdk.core.util.times:FormatDurationForJson
          help_text: |-
            How long to keep automated backups before the backups are deleted. The
            value should be between 1 day and 365 days. If not specified, the default
            value is 35 days.
    - arg_name: request-id
      api_field: requestId
      required: false
      repeated: false
      help_text: |-
        An optional request ID to identify requests. Specify a unique request ID
        so that if you must retry your request, the server will know to ignore
        the request if it has already been completed. The server will guarantee
        that for at least 60 minutes since the first request.

        For example, consider a situation where you make an initial request and the
        request times out. If you make the request again with the same request
        ID, the server can check if original operation with the same request ID
        was received, and if so, will ignore the second request. This prevents
        clients from accidentally creating duplicate commitments.

        The request ID must be a valid UUID with the exception that zero UUID is
        not supported (00000000-0000-0000-0000-000000000000).
  request:
    api_version: v1alpha
    collection:
    - memorystore.projects.locations.instances
  async:
    collection:
    - memorystore.projects.locations.operations
  update:
    read_modify_update: true
