Move 'functions' folder to bitnami-labs

This commit is contained in:
Beltran Rueda
2018-06-04 13:29:50 +00:00
parent 7080dc6295
commit 9dbd80b6b7
3 changed files with 0 additions and 48 deletions
-11
View File
@@ -1,11 +0,0 @@
apiVersion: v1
description: Get a Crypto currency price
home: https://bitnami.com
keywords:
- cryptocurrency
- crypto
- bitcoin
name: crypto
sources:
- https://github.com/kubeless/functions
version: 0.0.2
-18
View File
@@ -1,18 +0,0 @@
# Function to get price of Cryptocurrencies
```
kubeless function deploy crypto --from-file crypto.py --handler crypto.handler --runtime python2.7 --trigger-http --dependencies requirements.txt
```
Then call the function, specifying with crypto currency you want to get the price of:
```
kubeless function call crypto --data '{"crypto": "bitcoin"}'
Connecting to function...
Forwarding from 127.0.0.1:30000 -> 8080
Forwarding from [::1]:30000 -> 8080
Handling connection for 30000
10074.8
```
-19
View File
@@ -1,19 +0,0 @@
apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
name: crypto
namespace: default
spec:
deps: |
requests
function: |
import requests
import urlparse
def handler(event):
ticker = event.json['crypto']
path = urlparse.urljoin('https://api.coinmarketcap.com/v1/ticker/',ticker)
return requests.get(path).json()[0]['price_usd']
handler: crypto.handler
runtime: python2.7
type: HTTP