-
Notifications
You must be signed in to change notification settings - Fork 185
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
[FEATURE] Add support for OpenSearch Serverless #259
Comments
I modified the issue to delay addressing the API incompatibilities |
This is doable today with the following invocation style: from opensearchpy import OpenSearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
import boto3
host = '' # The collection endpoint without https://. For example, 07tjusf2h91cunochc.us-east-1.aoss.amazonaws.com
region = '' # e.g. us-east-1
service = 'aoss'
credentials = boto3.Session().get_credentials()
awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)
# Build the OpenSearch client
client = OpenSearch(
hosts = [{'host': host, 'port': 443}],
http_auth = awsauth,
use_ssl = True,
verify_certs = True,
connection_class = RequestsHttpConnection
)
# Create an index
index_name = 'my-index'
index_body = {
"mappings": {
"properties": {
"title": {"type": "text"},
"director": {"type": "text"},
"year": {"type": "integer"}
}
}
}
response = client.indices.create(index_name, body=index_body)
print('\nCreating index:')
print(response) The question is, is it better to incorporate this logic into AWSV4SignerAuth? The downside is that it would make something opaque and magical that is relatively straightforward. |
@dblock thoughts? |
Also, what's a good strategy for doing an integration test for this? |
And, is it possible that someone could make it unnecessary to specify a service name and that the client would try aoss and es and it would find one that works? |
I think the code that a developer has to write to talk to Managed OpenSearch should be identical to OpenSearch Serverless minus the service name. This looks like a good current workaround, but I definitely think we want to expose service name in |
Is your feature request related to a problem?
es
toaoss
What solution would you like?
Document support for OpenSearch Serverless in the compatibility matrix, add integration tests.
Do you have any additional context?
Coming from opensearch-project/opensearch-clients#44
The text was updated successfully, but these errors were encountered: