-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwasm-test.http
More file actions
93 lines (72 loc) · 1.92 KB
/
Copy pathwasm-test.http
File metadata and controls
93 lines (72 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Local
@host=http://localhost:8083
@tokenScope=openid edge:mcm edge:clusters edge:account:associate
@wtarName=wasm-example-v1-1.0.1.tar
@developerIdToken={{$dotenv DEVELOPER_ID_TOKEN}}
@clientId={{$dotenv CLIENT_ID}}
####
POST {{host}}/jsonrpc/v1
Content-Content-Type: application/json
{"jsonrpc": "2.0", "method": "getMe", "params": [], "id": 1}
#### Get EdgeIdToken
# @name jsonrpc
POST {{host}}/jsonrpc/v1
Content-Content-Type: application/json
{"jsonrpc": "2.0", "method": "getEdgeIdToken", "params": [], "id": 1}
####
@edgeIdToken={{jsonrpc.response.body.$.result.id_token}}
####
# @name mid
POST https://devconsole-mid.mimik.com/token
Content-Type: application/x-www-form-urlencoded
client_id={{clientId}}
&grant_type=id_token_signin
&id_token={{developerIdToken}}
&scope={{tokenScope}}
&edge_id_token={{edgeIdToken}}
###
@edgeToken={{mid.response.body.$.access_token}}
####
POST {{host}}/jsonrpc/v1
Content-Content-Type: application/json
{"jsonrpc": "2.0", "method": "associateAccount", "params": ["{{edgeToken}}"], "id": 1}
####
GET {{host}}/mcm/v1/images
Authorization: Bearer {{edgeToken}}
####
GET {{host}}/mcm/v1/containers
Authorization: Bearer {{edgeToken}}
###
# WASM
####
POST {{host}}/mcm/v1/images
Content-Type: multipart/form-data; boundary=$Boundary$
Authorization: Bearer {{edgeToken}}
--$Boundary$
Content-Disposition: form-data; name="image"; filename="{{wtarName}}"
< ./deploy/{{wtarName}}
--$Boundary$--
####
# @name container
POST {{host}}/mcm/v1/containers
Authorization: Bearer {{edgeToken}}
{
"name": "wasm-example-v1",
"image": "wasm-example-v1",
"env": {
"MCM.BASE_API_PATH": "/wasm-example/v1",
"MCM.CHILD_RUNTIME": "true"
}
}
###
POST {{host}}/mcm/v1/containers
Authorization: Bearer {{edgeToken}}
{
"name": "wasm-example-v1",
"image": "wasm-example-v1",
"env": {
"MCM.BASE_API_PATH": "/wasm-example/v1"
}
}
####
GET {{host}}/{{clientId}}/wasm-example/v1/time