Skip to content

Commit

Permalink
Add support for composable index templates (opensearch-project#437)
Browse files Browse the repository at this point in the history
* Allow renaming URL path parts in generator

Signed-off-by: Thomas Farr <[email protected]>

* Generate {delete,exists,get,put}_index_template as *ComposableTemplate

Signed-off-by: Thomas Farr <[email protected]>

* Add resp/req bodies for *ComposableIndexTemplate

Signed-off-by: Thomas Farr <[email protected]>

* Fix tests

Signed-off-by: Thomas Farr <[email protected]>

* Add ComposableIndexTemplateCrudTests

Signed-off-by: Thomas Farr <[email protected]>

* Add ComposableIndexTemplateExists tests

Signed-off-by: Thomas Farr <[email protected]>

* Add DeleteComposableIndexTemplate tests

Signed-off-by: Thomas Farr <[email protected]>

* Add GetComposableIndexTemplate tests

Signed-off-by: Thomas Farr <[email protected]>

* Add PutComposableIndexTemplate tests

Signed-off-by: Thomas Farr <[email protected]>

* Non-overlapping templates

Signed-off-by: Thomas Farr <[email protected]>

* Fix tests

Signed-off-by: Thomas Farr <[email protected]>

* Test data_stream template mapping serialization

Signed-off-by: Thomas Farr <[email protected]>

* Update guide and add sample

Signed-off-by: Thomas Farr <[email protected]>

* Add changelog entry

Signed-off-by: Thomas Farr <[email protected]>

* Tidy generated code

Signed-off-by: Thomas Farr <[email protected]>

* Review feedback

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia authored Nov 21, 2023
1 parent 57e26e0 commit dc8612c
Show file tree
Hide file tree
Showing 65 changed files with 2,804 additions and 507 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.?sproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- run: "./build.sh integrate ${{ matrix.version }} readonly,writable random:test_only_one --report"
name: Integration Tests
working-directory: client

- name: Upload test report
if: failure()
uses: actions/upload-artifact@v3
Expand All @@ -62,12 +62,13 @@ jobs:
path: client/build/output/*

integration-opensearch-unreleased:
if: false # TODO: Temporarily disabled due to failures building & running OpenSearch from source, pending investigation & fixes (https://github.com/opensearch-project/opensearch-net/issues/268)
name: Integration OpenSearch Unreleased
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opensearch_ref:
opensearch_ref:
- '1.x'
- '2.x'
- 'main'
Expand All @@ -77,7 +78,7 @@ jobs:
uses: actions/checkout@v3
with:
path: client

- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
Expand All @@ -90,7 +91,7 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.?sproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore or Build OpenSearch
id: opensearch
uses: ./client/.github/actions/build-opensearch
Expand All @@ -99,14 +100,14 @@ jobs:
security_plugin: ${{ matrix.opensearch_ref == '1.x' }}
knn_plugin: true
plugins_output_directory: ${{ env.OPENSEARCH_PLUGINS_DIRECTORY }}

- run: "./build.sh integrate $OPENSEARCH_VERSION readonly,writable random:test_only_one --report"
name: Integration Tests
working-directory: client
env:
OPENSEARCH_VERSION: ${{ steps.opensearch.outputs.version }}
OPENSEARCH_DISTRIBUTION: ${{ steps.opensearch.outputs.distribution }}

- name: Upload test report
if: failure()
uses: actions/upload-artifact@v3
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- Added support for point-in-time search and associated APIs ([#405](https://github.com/opensearch-project/opensearch-net/pull/405))
- Added support for the component template APIs ([#411](https://github.com/opensearch-project/opensearch-net/pull/411))
- Added support for the composable index template APIs ([#437](https://github.com/opensearch-project/opensearch-net/pull/437))

### Removed
- Removed the `Features` API which is not supported by OpenSearch from the low-level client ([#331](https://github.com/opensearch-project/opensearch-net/pull/331))
Expand Down Expand Up @@ -115,4 +116,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[Unreleased]: https://github.com/opensearch-project/opensearch-net/compare/v1.5.0...main
[1.5.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
27 changes: 0 additions & 27 deletions OpenSearch.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,6 @@
&amp;lt;inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" /&amp;gt;
&amp;lt;inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" /&amp;gt;
&amp;lt;/profile&amp;gt;&lt;/IDEA_SETTINGS&gt;&lt;VBReformatCode&gt;True&lt;/VBReformatCode&gt;&lt;HtmlReformatCode&gt;True&lt;/HtmlReformatCode&gt;&lt;CSUpdateFileHeader&gt;True&lt;/CSUpdateFileHeader&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;/Profile&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">/* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
</s:String>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/GeneratedFilesAndFolders/=56A87048_002D9065_002D459B_002D826D_002D3DF68B409845_002Fd_003AViews/@EntryIndexedValue">56A87048-9065-459B-826D-3DF68B409845/d:Views</s:String>
<s:String x:Key="/Default/CodeInspection/GeneratedCode/GeneratedFileMasks/=_002A_002Edoc_002Ecs/@EntryIndexedValue"></s:String>
Expand Down
Loading

0 comments on commit dc8612c

Please sign in to comment.