Skip to content
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 Basics Scenario for OpenSearch #6865

Merged
merged 9 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .doc_gen/metadata/opensearch_metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# zexi 0.4.0
opensearch_Hello:
title: Hello &ES;
title_abbrev: Hello &ES;
synopsis: get started using &ES;.
category: Hello
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/opensearch
sdkguide:
excerpts:
- description:
snippet_tags:
- opensearch.java2.hello.main
services:
opensearch: {ListVersions}
opensearch_CreateDomain:
languages:
Kotlin:
Expand Down Expand Up @@ -65,6 +82,58 @@ opensearch_ListDomainNames:
- opensearch.java2.list_domains.main
services:
opensearch: {ListDomainNames}
opensearch_ListTags:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/opensearch
sdkguide:
excerpts:
- description:
snippet_tags:
- opensearch.java2.add_tags.main
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
services:
opensearch: {ListTags}
opensearch_AddTags:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/opensearch
sdkguide:
excerpts:
- description:
snippet_tags:
- opensearch.java2.add_tags.main
services:
opensearch: {AddTags}
opensearch_ChangeProgress:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/opensearch
sdkguide:
excerpts:
- description:
snippet_tags:
- opensearch.java2.change_process.main
services:
opensearch: {ChangeProgress}
opensearch_DescribeDomain:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/opensearch
sdkguide:
excerpts:
- description:
snippet_tags:
- opensearch.java2.update_domain.main
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
services:
opensearch: {DescribeDomain}
opensearch_UpdateDomainConfig:
languages:
Kotlin:
Expand All @@ -87,3 +156,32 @@ opensearch_UpdateDomainConfig:
- opensearch.java2.update_domain.main
services:
opensearch: {UpdateDomainConfig}
opensearch_Scenario:
title: Learn core operations for &ESlong; using an &AWS; SDK
title_abbrev: Learn &ES; core operations
synopsis_list:
- Create an &ES; domain.
- Provides detailed information about a specific &ES; domain.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Lists all the &ES; domains owned by the account.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Waits until the &ES; domain's change status reaches a completed state.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Modifies the configuration of an existing &ES; domain.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Add a tag to the &ES; domain.
- Lists the tags associated with an &ES; domain.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Removes tags from an &ES; domain.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Deletes the &ES; domain.
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
category: Basics
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/batch
sdkguide:
excerpts:
- description: Run an interactive scenario demonstrating &ES; features.
snippet_tags:
- opensearch.java2.scenario.main
- description: A wrapper class for &ES; SDK methods.
snippet_tags:
- opensearch.java2.actions.main
services:
opensearch: {CreateDomain, DeleteDomain, DescribeDomain, ListDomainNames, UpdateDomainConfig, DescribeDomainChangeProgress, AddTags, ListTags}
51 changes: 51 additions & 0 deletions basics_scenarios/opensearch_scenario/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Amazon OpenSearch Service Basic Scenario

## Overview

This Amazon OpenSearch Service basic scenario demonstrates how to interact with the Amazon OpenSearch service using an AWS SDK. The scenario covers various operations such as creating an OpenSearch domain, modifying a domain, waiting for changes to the domain to enter a complete state, and so on.

Here are the top five service operations this scenario covers.

**Create an Amazon OpenSearch Domain**:
- Description: This operation creates a new Amazon OpenSearch domain, which is a managed instance of the OpenSearch engine.

2. **Describe the Amazon OpenSearch Domain**:
- Description: This operation retrieves information about the specified Amazon OpenSearch domain.
- The method `describeDomain(domainName)` is called to obtain the Amazon Resource Name (ARN) of the specified OpenSearch domain.

3. **List the Domains in Your Account**:
- Description: This operation lists all the Amazon OpenSearch domains in the current AWS account.
- The method `listAllDomains()` is called to retrieve a list of all the OpenSearch domains available in the account.

4. **Wait until the Domain's Change Status Reaches a Completed State**:
- Description: This operation waits until the change status of the specified Amazon OpenSearch domain reaches a completed state.
- When making changes to an OpenSearch domain, such as scaling the number of data nodes or updating the OpenSearch version, the domain goes through a change process. This method, `domainChangeProgress(domainName)`, waits until the change status of the specified domain reaches a completed state, which can take several minutes to several hours, depending on the complexity of the change and the current load on the OpenSearch service.
Note this operation may take up to 20 minutes.

5. **Modify the Domain**:
- Description: This operation modifies the cluster configuration of the specified Amazon OpenSearch domain, such as the instance count.
- The flexibility to modify the OpenSearch domain's configuration is particularly useful when the data or usage patterns change over time, as you can easily scale the domain to meet the new requirements without having to recreate the entire domain.
- The method `updateSpecificDomain(domainName)` is called to update the configuration of the specified OpenSearch domain.

Note: These steps are not the complete program, but summarizes the 5 high-level steps. See the Eng Spec for a complete listing of operations.

### Resources

This scenario does not require any additional AWS resources to run.


## Implementations

This scenario example will be implemented in the following languages:

- Java
- Python
- JavaScript

## Additional reading

- [Amazon OpenSearch](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html)

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Loading
Loading