All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rest-api-spec.test.indices.shrink.20_source_mapping.yml Maven / Gradle / Ivy

The newest version!
---
"Shrink index ignores target template mapping":
    - skip:
        version: " - 6.9.99"
        reason: expects warnings that pre-7.0.0 will not send
        features: [warnings, arbitrary_key, allowed_warnings]

    - do:
        nodes.info:
          node_id: data:true
    - set:
        nodes._arbitrary_key_: node_id

  # create index
    - do:
        indices.create:
          index: source
          wait_for_active_shards: 1
          body:
            settings:
              # ensure everything is allocated on a single node
              index.routing.allocation.include._id: $node_id
              index.number_of_shards: 2
              index.number_of_replicas: 0
            mappings:
              properties:
                count:
                  type: text

    # index document
    - do:
        index:
          index: source
          id:    "1"
          body:  { "count": "1" }

    # create template matching shrink target
    - do:
        indices.put_template:
          name: tpl1
          body:
            index_patterns: targ*
            mappings:
              properties:
                count:
                  type: integer

    # make it read-only
    - do:
        indices.put_settings:
          index: source
          body:
            index.blocks.write: true
            index.number_of_replicas: 0

    - do:
        cluster.health:
          wait_for_status: green
          index: source

    # now we do the actual shrink
    - do:
        allowed_warnings:
          - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."
        indices.shrink:
          index: "source"
          target: "target"
          wait_for_active_shards: 1
          master_timeout: 10s
          body:
            settings:
              index.number_of_replicas: 0

    - do:
        cluster.health:
          wait_for_status: green




© 2015 - 2025 Weber Informatics LLC | Privacy Policy