-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add higher-level HTTP DSL methods #447
Conversation
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need .LowLevel
at all?
@@ -1,5 +1,5 @@ | |||
# Document Lifecycle | |||
This guide covers OpenSearch Ruby Client API actions for Document Lifecycle. You'll learn how to create, read, update, and delete documents in your OpenSearch cluster. Whether you're new to OpenSearch or an experienced user, this guide provides the information you need to manage your document lifecycle effectively. | |||
This guide covers OpenSearch .NET Client API actions for Document Lifecycle. You'll learn how to create, read, update, and delete documents in your OpenSearch cluster. Whether you're new to OpenSearch or an experienced user, this guide provides the information you need to manage your document lifecycle effectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this :)
guides/json.md
Outdated
|
||
## HTTP Methods | ||
|
||
### GET | ||
The following example returns the server version information via `GET /`. | ||
|
||
```csharp | ||
var info = await client.LowLevel.DoRequestAsync<DynamicResponse>(HttpMethod.GET, "/", CancellationToken.None); | ||
var info = await client.Http.GetAsync<DynamicResponse>("/"); | ||
// OR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove client.LowLevel
from the documentation. There's no reason to use that.
Signed-off-by: Thomas Farr <[email protected]>
All requests are eventually handled via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK. I think I'd remove any mention of LowLevel
from the documentation and samples. In my opinion writing client.Http.GetAsync
is 100x better.
Converting to draft as there's some naming conventions that need fixing or excluding from conventions tests |
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Only failing test now, is a known flakey test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retry tests till they pass? 😢
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-447-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9054705954d5f763ed6a8707dc8c925ec4b2e3a8
# Push it to GitHub
git push --set-upstream origin backport/backport-447-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
* Lay foundations Signed-off-by: Thomas Farr <[email protected]> * Implement generation Signed-off-by: Thomas Farr <[email protected]> * Run generator Signed-off-by: Thomas Farr <[email protected]> * Update samples Signed-off-by: Thomas Farr <[email protected]> * Update guide Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * PR comments Signed-off-by: Thomas Farr <[email protected]> * Fix naming tests Signed-off-by: Thomas Farr <[email protected]> * Why is the ordering of these statements load-bearing??? Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> (cherry picked from commit 9054705)
* Lay foundations Signed-off-by: Thomas Farr <[email protected]> * Implement generation Signed-off-by: Thomas Farr <[email protected]> * Run generator Signed-off-by: Thomas Farr <[email protected]> * Update samples Signed-off-by: Thomas Farr <[email protected]> * Update guide Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * PR comments Signed-off-by: Thomas Farr <[email protected]> * Fix naming tests Signed-off-by: Thomas Farr <[email protected]> * Why is the ordering of these statements load-bearing??? Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> (cherry picked from commit 9054705)
* Lay foundations Signed-off-by: Thomas Farr <[email protected]> * Implement generation Signed-off-by: Thomas Farr <[email protected]> * Run generator Signed-off-by: Thomas Farr <[email protected]> * Update samples Signed-off-by: Thomas Farr <[email protected]> * Update guide Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * PR comments Signed-off-by: Thomas Farr <[email protected]> * Fix naming tests Signed-off-by: Thomas Farr <[email protected]> * Why is the ordering of these statements load-bearing??? Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]>
* Revert "Remove ApiGenerator (#156)" (#222) * Revert "Remove ApiGenerator (#156)" This reverts commit 7db02e9. Signed-off-by: Thomas Farr <[email protected]> * Update packages.lock.json Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Bump Spectre.Console from 0.30.0 to 0.47.0 (#227) Signed-off-by: Thomas Farr <[email protected]> * Implement parsing OpenAPI to internal model (#228) Signed-off-by: Thomas Farr <[email protected]> * Bump Newtonsoft.Json from 13.0.1 to 13.0.3 (#232) * Bump Newtonsoft.Json from 13.0.1 to 13.0.3 Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.3. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](JamesNK/Newtonsoft.Json@13.0.1...13.0.3) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog & packages.lock.json Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Upgrade RazorLight and use embedded resource project (#233) Signed-off-by: Thomas Farr <[email protected]> * Remove support for the `net461` target (#256) * Remove support for the `net461` target Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Bump Microsoft.CodeAnalysis.CSharp from 4.2.0 to 4.6.0 (#270) * Bump Microsoft.CodeAnalysis.CSharp from 4.2.0 to 4.6.0 Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 4.2.0 to 4.6.0. - [Release notes](https://github.com/dotnet/roslyn/releases) - [Changelog](https://github.com/dotnet/roslyn/blob/main/docs/Breaking%20API%20Changes.md) - [Commits](https://github.com/dotnet/roslyn/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog & packages.lock.json Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Remove packages.lock.json & fix CI caching (#265) * Remove packages.lock.json & remove redundant caching Signed-off-by: Thomas Farr <[email protected]> * Re-add caching Signed-off-by: Thomas Farr <[email protected]> * Include all proj files in caching Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Add ability to generate only a subset of operations (#278) Signed-off-by: Thomas Farr <[email protected]> * Clean up old rest specification files (#319) Signed-off-by: Thomas Farr <[email protected]> * Re-generate tasks namespace (#320) Signed-off-by: Thomas Farr <[email protected]> * Bump NSwag.Core.Yaml from 13.19.0 to 13.20.0 (#336) * Bump NSwag.Core.Yaml from 13.19.0 to 13.20.0 Bumps [NSwag.Core.Yaml](https://github.com/RicoSuter/NSwag) from 13.19.0 to 13.20.0. - [Release notes](https://github.com/RicoSuter/NSwag/releases) - [Changelog](https://github.com/RicoSuter/NSwag/blob/master/CHANGELOG.md) - [Commits](RicoSuter/NSwag@v13.19.0...v13.20.0) --- updated-dependencies: - dependency-name: NSwag.Core.Yaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Re-generate `dangling_indices` namespace (#333) * Correct handling of deprecated parameters Signed-off-by: Thomas Farr <[email protected]> * Re-generate `dangling_indices` namespace Signed-off-by: Thomas Farr <[email protected]> * Add remarks about when cluster_manager_timeout is supported Signed-off-by: Thomas Farr <[email protected]> * Delete missed old file Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Re-generate `ingest` namespace (#340) Signed-off-by: Thomas Farr <[email protected]> * Re-generate `snapshot` namespace (#351) Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes` namespace (#352) * Use specification naming for enums Signed-off-by: Thomas Farr <[email protected]> * Handle deprecated paths Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes.hot_threads` Signed-off-by: Thomas Farr <[email protected]> * Handle overloaded param Signed-off-by: Thomas Farr <[email protected]> * Better sorting Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes.info` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes.reload_secure_settings` Signed-off-by: Thomas Farr <[email protected]> * Sort URL parts Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes.stats` Signed-off-by: Thomas Farr <[email protected]> * Correctly handle URL part enum options Signed-off-by: Thomas Farr <[email protected]> * Make ApiUrls readonly Signed-off-by: Thomas Farr <[email protected]> * Re-generate `nodes.usage` Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster` namespace (part 1) (#356) * Re-generate `cluster.allocation_explain` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.delete_component_template` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.delete_voting_config_exclusions` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.exists_component_template` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.get_component_template` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.get_settings` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.health` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.pending_tasks` Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Support deprecation and added versions for API methods in ApiGenerator (#402) * Handle generating deprecation notices on high-level API methods Signed-off-by: Thomas Farr <[email protected]> * Improve formatting Signed-off-by: Thomas Farr <[email protected]> * Better URL path handling and support x-version-added on APIs Signed-off-by: Thomas Farr <[email protected]> * Re-generate Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Add support for Point In Time APIs (#405) * Add `CreatePit` & `DeletePit` methods Signed-off-by: Thomas Farr <[email protected]> * Add `DeleteAllPits` and `GetAllPits` methods Signed-off-by: Thomas Farr <[email protected]> * Add PIT search support Signed-off-by: Thomas Farr <[email protected]> * Add integration tests Signed-off-by: Thomas Farr <[email protected]> * Add docs Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * Correct Signed-off-by: Thomas Farr <[email protected]> * Fix changelog typo Signed-off-by: Thomas Farr <[email protected]> * Add tests for CreatePit Signed-off-by: Thomas Farr <[email protected]> * Add tests for DeletePit Signed-off-by: Thomas Farr <[email protected]> * Fixing tests Signed-off-by: Thomas Farr <[email protected]> * Cleanup Signed-off-by: Thomas Farr <[email protected]> * Add tests for GetAllPits & DeleteAllPits Signed-off-by: Thomas Farr <[email protected]> * PitSearch tests Signed-off-by: Thomas Farr <[email protected]> * call isolated Signed-off-by: Thomas Farr <[email protected]> * writable cluster Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Revert breaking namespace changes (#425) Reverts #200, #202, #203, #205, #206, #207, #208, #209 Signed-off-by: Thomas Farr <[email protected]> * Bump CSharpier.Core from 0.25.0 to 0.26.1 (#430) * Bump CSharpier.Core from 0.25.0 to 0.26.1 Bumps [CSharpier.Core](https://github.com/belav/csharpier) from 0.25.0 to 0.26.1. - [Release notes](https://github.com/belav/csharpier/releases) - [Changelog](https://github.com/belav/csharpier/blob/main/CHANGELOG.md) - [Commits](belav/csharpier@0.25.0...0.26.1) --- updated-dependencies: - dependency-name: CSharpier.Core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Add support for component template APIs (#411) * Generate `cluster.put_component_template` Signed-off-by: Thomas Farr <[email protected]> * Implement high-level DeleteComponentTemplate Signed-off-by: Thomas Farr <[email protected]> * Implement high-level ComponentTemplateExists Signed-off-by: Thomas Farr <[email protected]> * Fix license Signed-off-by: Thomas Farr <[email protected]> * Remove old put_component_template Signed-off-by: Thomas Farr <[email protected]> * Implement high-level GetComponentTemplate Signed-off-by: Thomas Farr <[email protected]> * Add tests for ComponentTemplateExists Signed-off-by: Thomas Farr <[email protected]> * Add tests for DeleteComponentTemplate Signed-off-by: Thomas Farr <[email protected]> * Add tests for GetComponentTemplate Signed-off-by: Thomas Farr <[email protected]> * Implement high-level PutComponentTemplate Signed-off-by: Thomas Farr <[email protected]> * Add component template CRUD tests Signed-off-by: Thomas Farr <[email protected]> * Add naming convention exception for ComponentTemplateExists Signed-off-by: Thomas Farr <[email protected]> * Update guide Signed-off-by: Thomas Farr <[email protected]> * Formatting Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * Fix license header Signed-off-by: Thomas Farr <[email protected]> * Fix namespaces Signed-off-by: Thomas Farr <[email protected]> * Fix license header Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Add support for composable index templates (#437) * 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]> * Re-generate `cluster` namespace (part 2) (#385) * Re-generate `cluster.post_voting_config_exclusions` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.put_settings` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.remote_info` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.reroute` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.state` Signed-off-by: Thomas Farr <[email protected]> * Re-generate `cluster.stats` Signed-off-by: Thomas Farr <[email protected]> * Generate missing cluster weighted routing & decommission awareness operations Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> * Bump Spectre.Console from 0.47.0 to 0.48.0 (#450) * Bump Spectre.Console from 0.47.0 to 0.48.0 Bumps [Spectre.Console](https://github.com/spectreconsole/spectre.console) from 0.47.0 to 0.48.0. - [Release notes](https://github.com/spectreconsole/spectre.console/releases) - [Commits](spectreconsole/spectre.console@0.47.0...0.48.0) --- updated-dependencies: - dependency-name: Spectre.Console dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Bump CSharpier.Core from 0.26.1 to 0.26.3 (#448) * Bump CSharpier.Core from 0.26.1 to 0.26.3 Bumps [CSharpier.Core](https://github.com/belav/csharpier) from 0.26.1 to 0.26.3. - [Release notes](https://github.com/belav/csharpier/releases) - [Changelog](https://github.com/belav/csharpier/blob/main/CHANGELOG.md) - [Commits](belav/csharpier@0.26.1...0.26.3) --- updated-dependencies: - dependency-name: CSharpier.Core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> * Add higher-level HTTP DSL methods (#447) * Lay foundations Signed-off-by: Thomas Farr <[email protected]> * Implement generation Signed-off-by: Thomas Farr <[email protected]> * Run generator Signed-off-by: Thomas Farr <[email protected]> * Update samples Signed-off-by: Thomas Farr <[email protected]> * Update guide Signed-off-by: Thomas Farr <[email protected]> * Add changelog entry Signed-off-by: Thomas Farr <[email protected]> * PR comments Signed-off-by: Thomas Farr <[email protected]> * Fix naming tests Signed-off-by: Thomas Farr <[email protected]> * Why is the ordering of these statements load-bearing??? Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Description
Adds the higher-level HTTP DSL methods to wrap
DoRequest
and allow better ergonomics.Issues Resolved
Closes #403
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.