How to use "" in python client?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch 2.7.0
python module “opensearch-py” 2.2.0

Describe the issue:
I did “pip3 install opensearch-py”
and then

rom opensearch import OpenSearch

host = 'localhost'
port = 9200
auth = ('admin', 'admin')
ca_certs_path = 'root_ca.pem'

 client = OpenSearch(
     hosts = [{'host': host, 'port': port}],
     http_auth = auth,
     use_ssl = True,
     verify_certs = True,
     ssl_assert_hostname = False,
     ssl_show_warn = False,
     ca_certs = ca_certs_path

I run this .py then gave this error

AttributeError: 'OpenSearch' object has no attribute 'security'

how to solve it?

and also there are no in Opensearch
there is only alerting in opensearch.plugins

refer) opensearch-py/ at main · opensearch-project/opensearch-py · GitHub

@cucukaka As far as I can see, this has not been released yet.

The latest opensearch-py version is 2.2.0 and was released on March 1st. The security plugin support in the Python client was merged 2 weeks ago.

1 Like