# File fetching from cloud

**URL:** <https://discourse.nodered.org/t/file-fetching-from-cloud/10158>\
**Category:** General\
**Created:** [15 April 2019 09:58 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158 "2019-04-15T09:58:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ApiAsylum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/apiasylum/32/7486_2.png) [@ApiAsylum](https://discourse.nodered.org/u/ApiAsylum)\
**Post date:** [15 April 2019 09:58 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/1 "2019-04-15T09:58:22Z")

</div>

I have a file in git repository,

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/dda99143e16b8b4712c7bbe6a31cbdfcbee830c8.png)

and i want to map that file in python function node,

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f79ecaafc4d303c4f67c4d32296c83a6b9f1c6d5.png)

Can someone help me with this?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 April 2019 10:02 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/2 "2019-04-15T10:02:38Z")

</div>

I think that would be:

```auto
/home/vcap/app/get_ticket.py

```

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [15 April 2019 10:09 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/3 "2019-04-15T10:09:40Z")

</div>

If you are using Node-RED on bluemix or any other cloud environment it’s useful to state that in your post.

---

<div class="post-metadata">

**Author:** ![ApiAsylum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/apiasylum/32/7486_2.png) [@ApiAsylum](https://discourse.nodered.org/u/ApiAsylum)\
**Post date:** [15 April 2019 10:16 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/4 "2019-04-15T10:16:23Z")

</div>

Yes I'm on Node-RED on bluemix

---

<div class="post-metadata">

**Author:** ![ApiAsylum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/apiasylum/32/7486_2.png) [@ApiAsylum](https://discourse.nodered.org/u/ApiAsylum)\
**Post date:** [15 April 2019 11:27 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/5 "2019-04-15T11:27:49Z")

</div>

Thank you nick it really did work but i get this error message,

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e3c885408f241e50241d7e3a363c066194576bae.png)

Here is the script in that file,

* * *

import requests  
import json

requests.packages.urllib3.disable\_warnings()

apic\_em\_ip = "[https://sandboxapicem.cisco.com/api/v1/ticket](https://sandboxapicem.cisco.com/api/v1/ticket)"

def get\_token(url):

```
#Payload contains authentication information
payload = { "username": " ******", "password": "*********" }

#Header information
headers = {"content-type" : "application/json"}

#Combine URL, API call and parameters variables
response = requests.post(url, data=json.dumps(payload), headers=headers).json()

# Return authentication token from respond body
return response["response"]["serviceTicket"]

```

def main():

```
#Assign obtained authentication token to a variable. Provide APIC-EM's URL address
auth_token = get_token(apic_em_ip)
print("\n")		
print("Service Ticket:", auth_token)

```

if **name** == " **main**":  
main()

* * *

How can i install the **REQUEST** module to bluemix in order to run that python script

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 April 2019 11:42 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/6 "2019-04-15T11:42:23Z")

</div>

> [@ApiAsylum](#):
>
> How can i install the **REQUEST** module to bluemix in order to run that python script

You cannot easily do that. The application is a node.js app and the buildpack that creates it only knows how to do things with node. There is no mechanism for installing extra python modules.

But you really should be doing such a straightforward http request using the HTTP Request node in a flow.

---

<div class="post-metadata">

**Author:** ![ApiAsylum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/apiasylum/32/7486_2.png) [@ApiAsylum](https://discourse.nodered.org/u/ApiAsylum)\
**Post date:** [15 April 2019 12:03 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/7 "2019-04-15T12:03:24Z")

</div>

I'm doing all these alternate approach is because of **SSL handshake error** arised in HTTP Request node

---

<div class="post-metadata">

**Author:** ![ApiAsylum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/apiasylum/32/7486_2.png) [@ApiAsylum](https://discourse.nodered.org/u/ApiAsylum)\
**Post date:** [16 April 2019 04:55 UTC](https://discourse.nodered.org/t/file-fetching-from-cloud/10158/8 "2019-04-16T04:55:23Z")

</div>

Hello Nick, we tried the same by deploying node-red from our local environment rather using cloud environment and the script was executed successfully without the **Request** module being installed.
