mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-20 02:25:53 +10:00
20 lines
439 B
YAML
20 lines
439 B
YAML
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
|