Browse Source

remove hello-lambda example script

Derek Schultz 2 years ago
parent
commit
5c558120ba
2 changed files with 0 additions and 116 deletions
  1. 0
    20
      README.md
  2. 0
    96
      examples/hello-lambda.sh

+ 0
- 20
README.md View File

@@ -125,26 +125,6 @@ or using the CLI:
125 125
 
126 126
     curl -X GET http://<docker-host>:10001/api/swagger.json | python -mjson.tool
127 127
 
128
-### Examining the API
129
-
130
-In [examples](examples/) folder you can find a script that examines available API endpoints.
131
-
132
-Note that this script depends on the following env vars:
133
-
134
-* `PICASSO_API_URL` - Picasso API endpoint
135
-* `OS_AUTH_URL` - OpenStack Auth URL
136
-* `OS_PROJECT_ID` - it can be found in OpenStack Dashboard or in CLI
137
-* `OS_USERNAME` - OpenStack project-aligned username
138
-* `OS_PASSWORD` - OpenStack project-aligned user password
139
-* `OS_DOMAIN` - OpenStack project domain name
140
-* `OS_PROJECT_NAME` - OpenStack project name
141
-
142
-To run the script:
143
-
144
-    OS_AUTH_URL=http://192.168.0.112:5000/v3 OS_PROJECT_ID=8fb76785313a4500ac5367eb44a31677 OS_USERNAME=admin OS_PASSWORD=root OS_DOMAIN=default OS_PROJECT_NAME=admin ./examples/hello-lambda.sh
145
-
146
-Please note that values provided are project-specific, so they can't be reused.
147
-
148 128
 ### API docs
149 129
 
150 130
 API docs are discoverable via Swagger. Just launch the Picasso API and browse to:

+ 0
- 96
examples/hello-lambda.sh View File

@@ -1,96 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-set +x
4
-set +e
5
-
6
-export LAOS_API_URL=${LAOS_API_URL:-http://localhost:10001}
7
-
8
-export OS_AUTH_URL=${OS_AUTH_URL:-http://localhost:5000/v3}
9
-export OS_USERNAME=${OS_USERNAME:-admin}
10
-export OS_PASSOWRD=${OS_PASSWORD:-root}
11
-export OS_DOMAIN=${OS_DOMAIN:-default}
12
-export OS_PROJECT_ID=${OS_PROJECT_ID:-"dummy_project_id"}
13
-
14
-
15
-rm -fr examples/token_request.json
16
-echo -e "{
17
-  \"auth\": {
18
-    \"identity\": {
19
-      \"methods\": [\"password\"],
20
-      \"password\": {
21
-        \"user\": {
22
-          \"name\": \"${OS_USERNAME:-admin}\",
23
-          \"domain\": { \"id\": \"${OS_DOMAIN:-default}\" },
24
-          \"password\": \"${OS_PASSWORD:-root}\"
25
-        }
26
-      }
27
-    },
28
-    \"scope\": {
29
-      \"project\": {
30
-        \"name\": \"${OS_PROJECT_NAME:-admin}\",
31
-        \"domain\": {\"id\": \"${OS_DOMAIN:-default}\" }
32
-      }
33
-    }
34
-  }
35
-}" >> examples/token_request.json
36
-
37
-
38
-export OS_TOKEN=`curl -si -d @examples/token_request.json -H "Content-type: application/json" ${OS_AUTH_URL}/auth/tokens | awk '/X-Subject-Token/ {print $2}'`
39
-
40
-echo -e "Listing apps\n"
41
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
42
-
43
-echo -e "Creating app\n"
44
-curl -X POST -d '{"app":{"name": "testapp"}}' ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
45
-
46
-echo -e "Listing apps\n"
47
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
48
-
49
-echo -e "Showing app info\n"
50
-export raw_app_info=`curl localhost:10001/v1/${OS_PROJECT_ID}/apps -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool | grep name | awk '{print $2}'`
51
-export app_name=${raw_app_info:1:30}
52
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name} -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
53
-
54
-echo -e "Listing app routes\n"
55
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
56
-
57
-echo -e "Creating app sync private route\n"
58
-curl -X POST -d '{"route":{"type": "sync", "path": "/hello-sync-private", "image": "iron/hello", "is_public": "false" }}' ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${APP_NAME}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
59
-
60
-echo -e "Creating app sync public route\n"
61
-curl -X POST -d '{"route":{"type": "sync", "path": "/hello-sync-public", "image": "iron/hello", "is_public": "true" }}' ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${APP_NAME}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
62
-
63
-echo -e "Listing app routes\n"
64
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
65
-
66
-echo -e "Show app private route\n"
67
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes/hello-sync-private -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
68
-
69
-echo -e "Show app public route\n"
70
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes/hello-sync-public -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
71
-
72
-echo -e "Running app sync private route\n"
73
-curl -X POST -d '{"name": "Johnny"}' ${LAOS_API_URL}/v1/r/${OS_PROJECT_ID}/${app_name}/hello-sync-private -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
74
-
75
-echo -e "Running app sync public route\n"
76
-curl -X POST -d '{"name": "Johnny"}' ${LAOS_API_URL}/r/${app_name}/hello-sync-public -H "Content-Type: application/json" | python3 -mjson.tool
77
-
78
-echo -e "Creating app async route\n"
79
-curl -X POST -d '{"route":{"type": "async", "path": "/hello-async-private", "image": "iron/hello", "is_public": "false"}}' ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
80
-
81
-echo -e "Running app async route\n"
82
-curl -X POST -d '{"name": "Johnny"}' ${LAOS_API_URL}/v1/r/${OS_PROJECT_ID}/${app_name}/hello-async-private -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
83
-
84
-echo -e "Deleting app route\n"
85
-curl -X DELETE ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes/hello-sync-public -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
86
-curl -X DELETE ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes/hello-sync-private -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
87
-curl -X DELETE ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes/hello-async-private -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
88
-
89
-echo -e "Listing app routes\n"
90
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name}/routes -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
91
-
92
-echo -e "Deleting app\n"
93
-curl -X DELETE ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps/${app_name} -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool
94
-
95
-echo -e "Listing apps\n"
96
-curl ${LAOS_API_URL}/v1/${OS_PROJECT_ID}/apps -H "X-Auth-Token:${OS_TOKEN}" -H "Content-Type: application/json" | python3 -mjson.tool

Loading…
Cancel
Save