|
322 | 322 | - match: { data_streams.0.effective_mappings: null } |
323 | 323 | - set: { data_streams.0.indices.0.index_name: oldIndexName } |
324 | 324 | - set: { data_streams.0.indices.1.index_name: newIndexName } |
| 325 | + |
| 326 | +--- |
| 327 | +"Test change data stream from standard to time_series with no routing_path": |
| 328 | + # This test makes sure that if we change the index mode of a data stream from standard to time_series without a |
| 329 | + # configured routing_path, the get data stream and get data stream mappings APIs do not blow up before or after |
| 330 | + # rollover. |
| 331 | + - do: |
| 332 | + indices.put_index_template: |
| 333 | + name: my-template |
| 334 | + body: |
| 335 | + index_patterns: [ test-data-stream-* ] |
| 336 | + data_stream: { } |
| 337 | + template: |
| 338 | + settings: |
| 339 | + number_of_replicas: 0 |
| 340 | + mappings: |
| 341 | + properties: |
| 342 | + field1: |
| 343 | + type: keyword |
| 344 | + |
| 345 | + - do: |
| 346 | + indices.create_data_stream: |
| 347 | + name: test-data-stream-1 |
| 348 | + |
| 349 | + - do: |
| 350 | + indices.put_index_template: |
| 351 | + name: my-template |
| 352 | + body: |
| 353 | + index_patterns: [ test-data-stream-* ] |
| 354 | + data_stream: { } |
| 355 | + template: |
| 356 | + settings: |
| 357 | + number_of_replicas: 0 |
| 358 | + mode: time_series |
| 359 | + mappings: |
| 360 | + properties: |
| 361 | + field1: |
| 362 | + type: keyword |
| 363 | + time_series_dimension: true |
| 364 | + |
| 365 | + - do: |
| 366 | + cluster.health: |
| 367 | + index: "test-data-stream-1" |
| 368 | + wait_for_status: green |
| 369 | + |
| 370 | + - do: |
| 371 | + indices.get_data_stream_mappings: |
| 372 | + name: test-data-stream-1 |
| 373 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 374 | + - match: { data_streams.0.mappings: {} } |
| 375 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 376 | + |
| 377 | + - do: |
| 378 | + indices.get_data_stream: |
| 379 | + name: test-data-stream-1 |
| 380 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 381 | + - match: { data_streams.0.mappings: {} } |
| 382 | + - match: { data_streams.0.effective_mappings: null } |
| 383 | + |
| 384 | + - do: |
| 385 | + indices.rollover: |
| 386 | + alias: "test-data-stream-1" |
| 387 | + |
| 388 | + - do: |
| 389 | + cluster.health: |
| 390 | + index: "test-data-stream-1" |
| 391 | + wait_for_status: green |
| 392 | + |
| 393 | + - do: |
| 394 | + indices.get_data_stream_mappings: |
| 395 | + name: test-data-stream-1 |
| 396 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 397 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 398 | + - match: { data_streams.0.effective_mappings.properties.field1.type: "keyword" } |
| 399 | + |
| 400 | + - do: |
| 401 | + indices.get_data_stream: |
| 402 | + name: test-data-stream-1 |
| 403 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 404 | + - match: { data_streams.0.mappings: { } } |
| 405 | + - match: { data_streams.0.effective_mappings: null } |
| 406 | + - set: { data_streams.0.indices.0.index_name: oldIndexName } |
| 407 | + - set: { data_streams.0.indices.1.index_name: newIndexName } |
| 408 | + |
| 409 | +--- |
| 410 | +"Test change data stream from time_series to standard with no routing_path": |
| 411 | + # This test makes sure that if we change the index mode of a data stream from time_series without a configured |
| 412 | + # routing_path to standard, the get data stream and get data stream mappings APIs do not blow up before or after |
| 413 | + # rollover. |
| 414 | + - do: |
| 415 | + indices.put_index_template: |
| 416 | + name: my-template |
| 417 | + body: |
| 418 | + index_patterns: [ my-data-stream-* ] |
| 419 | + data_stream: { } |
| 420 | + template: |
| 421 | + settings: |
| 422 | + number_of_replicas: 0 |
| 423 | + mode: time_series |
| 424 | + mappings: |
| 425 | + properties: |
| 426 | + field1: |
| 427 | + type: keyword |
| 428 | + time_series_dimension: true |
| 429 | + |
| 430 | + - do: |
| 431 | + indices.create_data_stream: |
| 432 | + name: my-data-stream-1 |
| 433 | + |
| 434 | + - do: |
| 435 | + cluster.health: |
| 436 | + index: "my-data-stream-1" |
| 437 | + wait_for_status: green |
| 438 | + |
| 439 | + - do: |
| 440 | + indices.get_data_stream_mappings: |
| 441 | + name: my-data-stream-1 |
| 442 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 443 | + - match: { data_streams.0.mappings: {} } |
| 444 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 445 | + |
| 446 | + - do: |
| 447 | + indices.get_data_stream: |
| 448 | + name: my-data-stream-1 |
| 449 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 450 | + - match: { data_streams.0.mappings: {} } |
| 451 | + - match: { data_streams.0.effective_mappings: null } |
| 452 | + |
| 453 | + - do: |
| 454 | + indices.put_index_template: |
| 455 | + name: my-template |
| 456 | + body: |
| 457 | + index_patterns: [ my-data-stream-* ] |
| 458 | + data_stream: { } |
| 459 | + template: |
| 460 | + settings: |
| 461 | + number_of_replicas: 0 |
| 462 | + mappings: |
| 463 | + properties: |
| 464 | + field1: |
| 465 | + type: keyword |
| 466 | + |
| 467 | + - do: |
| 468 | + indices.get_data_stream_mappings: |
| 469 | + name: my-data-stream-1 |
| 470 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 471 | + - match: { data_streams.0.mappings: {} } |
| 472 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 473 | + |
| 474 | + - do: |
| 475 | + indices.get_data_stream: |
| 476 | + name: my-data-stream-1 |
| 477 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 478 | + - match: { data_streams.0.mappings: {} } |
| 479 | + - match: { data_streams.0.effective_mappings: null } |
| 480 | + |
| 481 | + - do: |
| 482 | + indices.rollover: |
| 483 | + alias: "my-data-stream-1" |
| 484 | + |
| 485 | + - do: |
| 486 | + cluster.health: |
| 487 | + index: "my-data-stream-1" |
| 488 | + wait_for_status: green |
| 489 | + |
| 490 | + - do: |
| 491 | + indices.get_data_stream_mappings: |
| 492 | + name: my-data-stream-1 |
| 493 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 494 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 495 | + - match: { data_streams.0.effective_mappings.properties.field1.type: "keyword" } |
| 496 | + |
| 497 | + - do: |
| 498 | + indices.get_data_stream: |
| 499 | + name: my-data-stream-1 |
| 500 | + - match: { data_streams.0.name: my-data-stream-1 } |
| 501 | + - match: { data_streams.0.mappings: { } } |
| 502 | + - match: { data_streams.0.effective_mappings: null } |
| 503 | + - set: { data_streams.0.indices.0.index_name: oldIndexName } |
| 504 | + - set: { data_streams.0.indices.1.index_name: newIndexName } |
| 505 | + |
| 506 | +--- |
| 507 | +"Test change data stream from standard to time_series with routing_path": |
| 508 | + # This test makes sure that if we change the index mode of a data stream from standard to time_series with a |
| 509 | + # configured routing_path, the get data stream and get data stream mappings APIs do not blow up before or after |
| 510 | + # rollover. |
| 511 | + - do: |
| 512 | + indices.put_index_template: |
| 513 | + name: my-template |
| 514 | + body: |
| 515 | + index_patterns: [ test-data-stream-* ] |
| 516 | + data_stream: { } |
| 517 | + template: |
| 518 | + settings: |
| 519 | + number_of_replicas: 0 |
| 520 | + mappings: |
| 521 | + properties: |
| 522 | + field1: |
| 523 | + type: keyword |
| 524 | + |
| 525 | + - do: |
| 526 | + indices.create_data_stream: |
| 527 | + name: test-data-stream-1 |
| 528 | + |
| 529 | + - do: |
| 530 | + indices.put_index_template: |
| 531 | + name: my-template |
| 532 | + body: |
| 533 | + index_patterns: [ test-data-stream-* ] |
| 534 | + data_stream: { } |
| 535 | + template: |
| 536 | + settings: |
| 537 | + number_of_replicas: 0 |
| 538 | + routing_path: field1 |
| 539 | + mode: time_series |
| 540 | + mappings: |
| 541 | + properties: |
| 542 | + field1: |
| 543 | + type: keyword |
| 544 | + time_series_dimension: true |
| 545 | + |
| 546 | + - do: |
| 547 | + cluster.health: |
| 548 | + index: "test-data-stream-1" |
| 549 | + wait_for_status: green |
| 550 | + |
| 551 | + - do: |
| 552 | + indices.get_data_stream_mappings: |
| 553 | + name: test-data-stream-1 |
| 554 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 555 | + - match: { data_streams.0.mappings: {} } |
| 556 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 557 | + |
| 558 | + - do: |
| 559 | + indices.get_data_stream: |
| 560 | + name: test-data-stream-1 |
| 561 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 562 | + - match: { data_streams.0.mappings: {} } |
| 563 | + - match: { data_streams.0.effective_mappings: null } |
| 564 | + |
| 565 | + - do: |
| 566 | + indices.rollover: |
| 567 | + alias: "test-data-stream-1" |
| 568 | + |
| 569 | + - do: |
| 570 | + cluster.health: |
| 571 | + index: "test-data-stream-1" |
| 572 | + wait_for_status: green |
| 573 | + |
| 574 | + - do: |
| 575 | + indices.get_data_stream_mappings: |
| 576 | + name: test-data-stream-1 |
| 577 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 578 | + - length: { data_streams.0.effective_mappings.properties: 2 } |
| 579 | + - match: { data_streams.0.effective_mappings.properties.field1.type: "keyword" } |
| 580 | + |
| 581 | + - do: |
| 582 | + indices.get_data_stream: |
| 583 | + name: test-data-stream-1 |
| 584 | + - match: { data_streams.0.name: test-data-stream-1 } |
| 585 | + - match: { data_streams.0.mappings: { } } |
| 586 | + - match: { data_streams.0.effective_mappings: null } |
| 587 | + - set: { data_streams.0.indices.0.index_name: oldIndexName } |
| 588 | + - set: { data_streams.0.indices.1.index_name: newIndexName } |
0 commit comments