# I need to call my server xxx.xx.xx.xxx:xxxxx using elasticsearch api in python

**URL:** <https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733>\
**Category:** Elasticsearch\
**Created:** [September 11, 2014, 9:14am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733 "2014-09-11T09:14:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 11, 2014, 9:14am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/1 "2014-09-11T09:14:32Z")

</div>

Hi All,  
I need I need to call my server xxx.xx.xx.xxx:xxxxx using elasticsearch api  
in python but I am not able to get the proper code to run that. Below is  
that I have done yet.

from datetime import datetime  
from elasticsearch import Elasticsearch

es = Elasticsearch("10.120.xx.xxx:6xxx8")  
print(es.cluster)  
print(es.cat)  
print(es.indices)  
print(es.nodes)  
print(es.snapshot)

# but not deserialized

es.get(index="logstash-2014.09.11", doc\_type="syslog",  
id='iFP2D8nHSKeqevBWrm1Hgg')['\_source']  
{u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}

print(es)

Please tell me what to do from here so I am doing wrong.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Honza\_Kral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honza_kral/32/876_2.png) [@Honza\_Kral](https://discuss.elastic.co/u/Honza_Kral)\
**Post date:** [September 11, 2014, 9:25am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/2 "2014-09-11T09:25:58Z")

</div>

Hi,

the code you have here should work, what do you get when you try:

from elasticsearch import Elasticsearch

es = Elasticsearch("10.120.xx.xxx:6xxx8")  
print(es.info())

Thanks

On Thu, Sep 11, 2014 at 11:14 AM, Nimit Jain [online.nimit@gmail.com](mailto:online.nimit@gmail.com) wrote:

> Hi All,  
> I need I need to call my server xxx.xx.xx.xxx:xxxxx using elasticsearch api  
> in python but I am not able to get the proper code to run that. Below is  
> that I have done yet.
> 
> from datetime import datetime  
> from elasticsearch import Elasticsearch
> 
> es = Elasticsearch("10.120.xx.xxx:6xxx8")  
> print(es.cluster)  
> print(es.cat)  
> print(es.indices)  
> print(es.nodes)  
> print(es.snapshot)
> 
> # but not deserialized
> 
> es.get(index="logstash-2014.09.11", doc\_type="syslog",  
> id='iFP2D8nHSKeqevBWrm1Hgg')['\_source']  
> {u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}
> 
> print(es)
> 
> Please tell me what to do from here so I am doing wrong.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CABfdDir0PTP%3D%3DW14ikyMk33zBj%3DJgqcfokxZBPiXg8wM8oDFsQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDir0PTP%3D%3DW14ikyMk33zBj%3DJgqcfokxZBPiXg8wM8oDFsQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 12, 2014, 2:45am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/3 "2014-09-12T02:45:06Z")

</div>

Thanks Honza for your reply. While trying the below code with  
print(es.info()) I am getting the below error.

pydev debugger: starting (pid: 9652)  
GET / [status:401 request:0.563s]  
Traceback (most recent call last):  
File  
"C:\Users\nimitja\Downloads\adt-bundle-windows-x86\_64-20140702\adt-bundle-windows-x86\_64-20140702\eclipse\plugins\org.python.pydev\_3.6.0.201406232321\pysrc\pydevd.py",  
line 1845, in   
debugger.run(setup['file'], None, None)  
File  
"C:\Users\nimitja\Downloads\adt-bundle-windows-x86\_64-20140702\adt-bundle-windows-x86\_64-20140702\eclipse\plugins\org.python.pydev\_3.6.0.201406232321\pysrc\pydevd.py",  
line 1373, in run  
pydev\_imports.execfile(file, globals, locals) # execute the script  
File  
"C:\Users\nimitja\Downloads\adt-bundle-windows-x86\_64-20140702\adt-bundle-windows-x86\_64-20140702\eclipse\plugins\org.python.pydev\_3.6.0.201406232321\pysrc\_pydev\_execfile.py",  
line 18, in execfile  
exec(compile(contents+"\n", file, 'exec'), glob, loc)  
File  
"C:\Users\nimitja\workspace\ParsingClientAndServerLogs\serverlog\KibanaRestAPIConnection.py",  
line 12, in   
print(es.info())  
File "C:\Python34\lib\site-packages\elasticsearch\client\utils.py", line  
68, in _wrapped  
return func(\*args, params=params, \*\*kwargs)  
File "C:\Python34\lib\site-packages\elasticsearch\client\_init_.py",  
line 159, in info  
\_, data = self.transport.perform\_request('GET', '/', params=params)  
File "C:\Python34\lib\site-packages\elasticsearch\transport.py", line  
284, in perform\_request  
status, headers, data = connection.perform\_request(method, url, params,  
body, ignore=ignore, timeout=timeout)  
File  
"C:\Python34\lib\site-packages\elasticsearch\connection\http\_urllib3.py",  
line 55, in perform\_request  
self.\_raise\_error(response.status, raw\_data)  
File "C:\Python34\lib\site-packages\elasticsearch\connection\base.py",  
line 97, in \_raise\_error  
raise HTTP\_EXCEPTIONS.get(status\_code, TransportError)(status\_code,  
error\_message, additional\_info)  
elasticsearch.exceptions.TransportError: TransportError(401, '')

Here the status is 401. Please help.

Regards,  
Nimit Jain

On Thursday, 11 September 2014 14:56:10 UTC+5:30, Honza Král wrote:

> Hi,
> 
> the code you have here should work, what do you get when you try:
> 
> from elasticsearch import Elasticsearch
> 
> es = Elasticsearch("10.120.xx.xxx:6xxx8")  
> print(es.info())
> 
> Thanks
> 
> On Thu, Sep 11, 2014 at 11:14 AM, Nimit Jain \<[online...@gmail.com](mailto:online...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi All,  
> > I need I need to call my server xxx.xx.xx.xxx:xxxxx using elasticsearch  
> > api  
> > in python but I am not able to get the proper code to run that. Below is  
> > that I have done yet.
> > 
> > from datetime import datetime  
> > from elasticsearch import Elasticsearch
> > 
> > es = Elasticsearch("10.120.xx.xxx:6xxx8")  
> > print(es.cluster)  
> > print(es.cat)  
> > print(es.indices)  
> > print(es.nodes)  
> > print(es.snapshot)
> > 
> > # but not deserialized
> > 
> > es.get(index="logstash-2014.09.11", doc\_type="syslog",  
> > id='iFP2D8nHSKeqevBWrm1Hgg')['\_source']  
> > {u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}
> > 
> > print(es)
> > 
> > Please tell me what to do from here so I am doing wrong.
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com).
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7b51ba00-66e8-4ba8-9415-c49ea868ea0a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7b51ba00-66e8-4ba8-9415-c49ea868ea0a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 12, 2014, 6:59am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/4 "2014-09-12T06:59:29Z")

</div>

On Friday, September 12, 2014 at 04:45 CEST,  
Nimit Jain [online.nimit@gmail.com](mailto:online.nimit@gmail.com) wrote:

> Thanks Honza for your reply. While trying the below code with  
> print(es.info()) I am getting the below error.  
> pydev debugger: starting (pid: 9652)  
> GET / [status:401 request:0.563s]  
> Traceback (most recent call last):

[...]

> elasticsearch.exceptions.TransportError: TransportError(401, '')  
> Here the status is 401. Please help.

HTTP status 401 is "Unauthorized". Do you have a proxy that  
expects authentication between your host and Elasticsearch?  
I suspect Elasticsearch itself isn't capable of returning 401.

--  
Magnus Bäck | Software Engineer, Development Tools  
[magnus.back@sonymobile.com](mailto:magnus.back@sonymobile.com) | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20140912065928.GD3212%40seldlx20533.corpusers.net](https://groups.google.com/d/msgid/elasticsearch/20140912065928.GD3212%40seldlx20533.corpusers.net).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 12, 2014, 9:51am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/5 "2014-09-12T09:51:48Z")

</div>

With the same URL I am able to get the json from curl command.  
Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but with  
elasticsearch the Status is N/A. I don't know why this is happening.

Regards,  
Nimit

On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:

> On Friday, September 12, 2014 at 04:45 CEST,  
> Nimit Jain \<[online...@gmail.com](mailto:online...@gmail.com) \<javascript:\>\> wrote:
> 
> > Thanks Honza for your reply. While trying the below code with  
> > print(es.info()) I am getting the below error.  
> > pydev debugger: starting (pid: 9652)  
> > GET / [status:401 request:0.563s]  
> > Traceback (most recent call last):
> 
> [...]
> 
> > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > Here the status is 401. Please help.
> 
> HTTP status 401 is "Unauthorized". Do you have a proxy that  
> expects authentication between your host and Elasticsearch?  
> I suspect Elasticsearch itself isn't capable of returning 401.
> 
> --  
> Magnus Bäck | Software Engineer, Development Tools  
> [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) \<javascript:\> | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 12, 2014, 10:00am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/6 "2014-09-12T10:00:43Z")

</div>

Also, can we mention the username and password of the url from python in  
Elasticsearch.

On Friday, 12 September 2014 15:21:50 UTC+5:30, Nimit Jain wrote:

> With the same URL I am able to get the json from curl command.  
> Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but with  
> elasticsearch the Status is N/A. I don't know why this is happening.
> 
> Regards,  
> Nimit
> 
> On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:
> 
> > On Friday, September 12, 2014 at 04:45 CEST,  
> > Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > 
> > > Thanks Honza for your reply. While trying the below code with  
> > > print(es.info()) I am getting the below error.  
> > > pydev debugger: starting (pid: 9652)  
> > > GET / [status:401 request:0.563s]  
> > > Traceback (most recent call last):
> > 
> > [...]
> > 
> > > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > > Here the status is 401. Please help.
> > 
> > HTTP status 401 is "Unauthorized". Do you have a proxy that  
> > expects authentication between your host and Elasticsearch?  
> > I suspect Elasticsearch itself isn't capable of returning 401.
> > 
> > --  
> > Magnus Bäck | Software Engineer, Development Tools  
> > [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e5ed8eb3-4ab8-40fc-ba92-8d8222b9abb2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e5ed8eb3-4ab8-40fc-ba92-8d8222b9abb2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Honza\_Kral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honza_kral/32/876_2.png) [@Honza\_Kral](https://discuss.elastic.co/u/Honza_Kral)\
**Post date:** [September 12, 2014, 10:09am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/7 "2014-09-12T10:09:20Z")

</div>

what is the curl comman you use to reach elasticsearch?

On Fri, Sep 12, 2014 at 11:51 AM, Nimit Jain [online.nimit@gmail.com](mailto:online.nimit@gmail.com) wrote:

> With the same URL I am able to get the json from curl command.  
> Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but with  
> elasticsearch the Status is N/A. I don't know why this is happening.
> 
> Regards,  
> Nimit
> 
> On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:
> 
> > On Friday, September 12, 2014 at 04:45 CEST,  
> > Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > 
> > > Thanks Honza for your reply. While trying the below code with  
> > > print(es.info()) I am getting the below error.  
> > > pydev debugger: starting (pid: 9652)  
> > > GET / [status:401 request:0.563s]  
> > > Traceback (most recent call last):
> > 
> > [...]
> > 
> > > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > > Here the status is 401. Please help.
> > 
> > HTTP status 401 is "Unauthorized". Do you have a proxy that  
> > expects authentication between your host and Elasticsearch?  
> > I suspect Elasticsearch itself isn't capable of returning 401.
> > 
> > --  
> > Magnus Bäck | Software Engineer, Development Tools  
> > [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) | Sony Mobile Communications
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CABfdDir7Q%3DWg\_jpMvmtixYArsPWSmm148Z%3DtttAX4HLs\_H75kg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDir7Q%3DWg_jpMvmtixYArsPWSmm148Z%3DtttAX4HLs_H75kg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 12, 2014, 11:01am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/8 "2014-09-12T11:01:27Z")

</div>

I am not think so that I have reached Elasticsearch using this. But below  
is the command that I have used.

curl -i -XGET 10.xxx.66.xxx:6xxx8/ea/api/discovery.json -d '

There is no proxy in between the client and server but yes it do have the  
login which we are not doing right now. Could you please tell me the way to  
provide username and password using elasticsearch.

It would be very helpful.

Regards,  
Nimit

On Friday, 12 September 2014 15:39:28 UTC+5:30, Honza Král wrote:

> what is the curl comman you use to reach elasticsearch?
> 
> On Fri, Sep 12, 2014 at 11:51 AM, Nimit Jain \<[online...@gmail.com](mailto:online...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > With the same URL I am able to get the json from curl command.  
> > Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but with  
> > elasticsearch the Status is N/A. I don't know why this is happening.
> > 
> > Regards,  
> > Nimit
> > 
> > On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:
> > 
> > > On Friday, September 12, 2014 at 04:45 CEST,  
> > > Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > > 
> > > > Thanks Honza for your reply. While trying the below code with  
> > > > print(es.info()) I am getting the below error.  
> > > > pydev debugger: starting (pid: 9652)  
> > > > GET / [status:401 request:0.563s]  
> > > > Traceback (most recent call last):
> > > 
> > > [...]
> > > 
> > > > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > > > Here the status is 401. Please help.
> > > 
> > > HTTP status 401 is "Unauthorized". Do you have a proxy that  
> > > expects authentication between your host and Elasticsearch?  
> > > I suspect Elasticsearch itself isn't capable of returning 401.
> > > 
> > > --  
> > > Magnus Bäck | Software Engineer, Development Tools  
> > > [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) | Sony Mobile Communications
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com).
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Honza\_Kral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honza_kral/32/876_2.png) [@Honza\_Kral](https://discuss.elastic.co/u/Honza_Kral)\
**Post date:** [September 12, 2014, 11:05am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/9 "2014-09-12T11:05:00Z")

</div>

I am sorry, I cannot help you. Elasticsearch requires no password and  
the URL you supplied doesn't correspond to any API in Elasticsearch  
(unless you are pointing to a single document). I assume there is  
something weird with your setup.

On Fri, Sep 12, 2014 at 1:01 PM, Nimit Jain [online.nimit@gmail.com](mailto:online.nimit@gmail.com) wrote:

> I am not think so that I have reached Elasticsearch using this. But below is  
> the command that I have used.
> 
> curl -i -XGET 10.xxx.66.xxx:6xxx8/ea/api/discovery.json -d '
> 
> There is no proxy in between the client and server but yes it do have the  
> login which we are not doing right now. Could you please tell me the way to  
> provide username and password using elasticsearch.
> 
> It would be very helpful.
> 
> Regards,  
> Nimit
> 
> On Friday, 12 September 2014 15:39:28 UTC+5:30, Honza Král wrote:
> 
> > what is the curl comman you use to reach elasticsearch?
> > 
> > On Fri, Sep 12, 2014 at 11:51 AM, Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > 
> > > With the same URL I am able to get the json from curl command.  
> > > Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but with  
> > > elasticsearch the Status is N/A. I don't know why this is happening.
> > > 
> > > Regards,  
> > > Nimit
> > > 
> > > On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:
> > > 
> > > > On Friday, September 12, 2014 at 04:45 CEST,  
> > > > Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > > > 
> > > > > Thanks Honza for your reply. While trying the below code with  
> > > > > print(es.info()) I am getting the below error.  
> > > > > pydev debugger: starting (pid: 9652)  
> > > > > GET / [status:401 request:0.563s]  
> > > > > Traceback (most recent call last):
> > > > 
> > > > [...]
> > > > 
> > > > > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > > > > Here the status is 401. Please help.
> > > > 
> > > > HTTP status 401 is "Unauthorized". Do you have a proxy that  
> > > > expects authentication between your host and Elasticsearch?  
> > > > I suspect Elasticsearch itself isn't capable of returning 401.
> > > > 
> > > > --  
> > > > Magnus Bäck | Software Engineer, Development Tools  
> > > > [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) | Sony Mobile Communications
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit
> > > 
> > > [https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CABfdDir1UxRxz%2BW3LH%3D40YfafJarDwN7W%2B0gE-8Div3HAbjSfA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDir1UxRxz%2BW3LH%3D40YfafJarDwN7W%2B0gE-8Div3HAbjSfA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nimit\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@Nimit\_Jain](https://discuss.elastic.co/u/Nimit_Jain)\
**Post date:** [September 12, 2014, 11:16am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/10 "2014-09-12T11:16:12Z")

</div>

Can you please tell me the step to do that from starting. That will be a  
great help.

Regards,  
Nimit

On Friday, 12 September 2014 16:35:11 UTC+5:30, Honza Král wrote:

> I am sorry, I cannot help you. Elasticsearch requires no password and  
> the URL you supplied doesn't correspond to any API in Elasticsearch  
> (unless you are pointing to a single document). I assume there is  
> something weird with your setup.
> 
> On Fri, Sep 12, 2014 at 1:01 PM, Nimit Jain \<[online...@gmail.com](mailto:online...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I am not think so that I have reached Elasticsearch using this. But  
> > below is  
> > the command that I have used.
> > 
> > curl -i -XGET 10.xxx.66.xxx:6xxx8/ea/api/discovery.json -d '
> > 
> > There is no proxy in between the client and server but yes it do have  
> > the  
> > login which we are not doing right now. Could you please tell me the way  
> > to  
> > provide username and password using elasticsearch.
> > 
> > It would be very helpful.
> > 
> > Regards,  
> > Nimit
> > 
> > On Friday, 12 September 2014 15:39:28 UTC+5:30, Honza Král wrote:
> > 
> > > what is the curl comman you use to reach elasticsearch?
> > > 
> > > On Fri, Sep 12, 2014 at 11:51 AM, Nimit Jain [online...@gmail.com](mailto:online...@gmail.com)  
> > > wrote:
> > > 
> > > > With the same URL I am able to get the json from curl command.  
> > > > Full url is http://10.xxx.66.xxx:6xxx8/ea/api/discovery.json but  
> > > > with  
> > > > elasticsearch the Status is N/A. I don't know why this is happening.
> > > > 
> > > > Regards,  
> > > > Nimit
> > > > 
> > > > On Friday, 12 September 2014 12:29:39 UTC+5:30, Magnus Bäck wrote:
> > > > 
> > > > > On Friday, September 12, 2014 at 04:45 CEST,  
> > > > > Nimit Jain [online...@gmail.com](mailto:online...@gmail.com) wrote:
> > > > > 
> > > > > > Thanks Honza for your reply. While trying the below code with  
> > > > > > print(es.info()) I am getting the below error.  
> > > > > > pydev debugger: starting (pid: 9652)  
> > > > > > GET / [status:401 request:0.563s]  
> > > > > > Traceback (most recent call last):
> > > > > 
> > > > > [...]
> > > > > 
> > > > > > elasticsearch.exceptions.TransportError: TransportError(401, '')  
> > > > > > Here the status is 401. Please help.
> > > > > 
> > > > > HTTP status 401 is "Unauthorized". Do you have a proxy that  
> > > > > expects authentication between your host and Elasticsearch?  
> > > > > I suspect Elasticsearch itself isn't capable of returning 401.
> > > > > 
> > > > > --  
> > > > > Magnus Bäck | Software Engineer, Development Tools  
> > > > > [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) | Sony Mobile Communications
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups  
> > > > "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > send  
> > > > an  
> > > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3657ab99-706f-4bfb-af74-44d55c618902%40googlegroups.com).
> 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3eec423-9cee-4fbf-90a8-60d4f79ffa23%40googlegroups.com).
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf06fa28-2bbc-4055-b943-9f94bd08d434%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf06fa28-2bbc-4055-b943-9f94bd08d434%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:02am UTC](https://discuss.elastic.co/t/i-need-to-call-my-server-xxx-xx-xx-xxx-xxxxx-using-elasticsearch-api-in-python/19733/11 "2017-07-06T01:02:47Z")

</div>


