-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI.http
More file actions
97 lines (86 loc) · 2.13 KB
/
API.http
File metadata and controls
97 lines (86 loc) · 2.13 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
94
95
96
97
### Transfer
### Use the proto contract from this repo.
### Start the server with:
### HTTP_STREAM_LISTEN_ADDR=:7080 go run ./cmd/http-streamd
###
### If GoLand does not auto-detect the proto via reflection,
### configure this file/request to use:
### api/httpstream/v1/httpstream.proto
###
### Response fields now include:
### transferId, bytesTransferred, sourceStatusCode, targetStatusCode,
### sourceContentLength, durationMillis, averageBytesPerSecond, progressPercent
###
### For continuous UI updates, call TransferStream instead of Transfer.
### Transfer without pipeline
GRPC localhost:7080/httpstream.v1.StreamService/Transfer
{
"source": {
"method": "GET",
"url": "https://source.example/object",
"headers": {
"Authorization": "Bearer source-token"
}
},
"target": {
"method": "PUT",
"url": "https://target.example/object",
"headers": {
"Authorization": "Bearer target-token",
"Content-Type": "application/octet-stream"
}
}
}
### Transfer to local disk
GRPC localhost:7080/httpstream.v1.StreamService/Transfer
{
"source": {
"method": "GET",
"url": "https://github.com/OpenProjectX"
},
"target": {
"localPath": "/tmp/http-stream/object.bin"
}
}
###
### Transfer with AES-CTR encryption pipeline
GRPC localhost:7080/httpstream.v1.StreamService/Transfer
{
"source": {
"method": "GET",
"url": "https://source.example/object",
"headers": {
"Authorization": "Bearer source-token"
}
},
"target": {
"method": "PUT",
"url": "https://target.example/object",
"headers": {
"Authorization": "Bearer target-token",
"Content-Type": "application/octet-stream"
},
"contentLength": 0
},
"pipeline": [
{
"name": "encrypt.aes_ctr",
"config": {
"key_b64": "<base64-encoded-16-24-or-32-byte-key>",
"iv_b64": "<base64-encoded-16-byte-iv>"
}
}
]
}
###
### TransferStream for UI progress
GRPC localhost:7080/httpstream.v1.StreamService/TransferStream
{
"source": {
"method": "GET",
"url": "https://source.example/object"
},
"target": {
"localPath": "/tmp/http-stream/object.bin"
}
}