mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-22 19:48:25 +10:00
Move 'functions' folder to bitnami-labs
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user