/
MFTTransferApi.proto
172 lines (147 loc) · 4.69 KB
/
MFTTransferApi.proto
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
syntax = "proto3";
option java_multiple_files = true;
package org.apache.airavata.mft.api.service;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "CredCommon.proto";
message CallbackEndpoint {
enum CallbackType {
HTTP = 0;
KAFKA = 1;
}
CallbackType type = 1;
string endpoint = 2;
}
message TransferApiRequest {
string sourceResourceId = 1;
string sourceChildResourcePath = 2;
string sourceType = 3;
string sourceToken = 4;
string destinationResourceId = 5;
string destinationChildResourcePath = 6;
string destinationType = 7;
string destinationToken = 8;
bool affinityTransfer = 9;
map<string, int32> targetAgents = 10;
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 11;
repeated CallbackEndpoint callbackEndpoints = 12;
}
message TransferApiResponse {
string transferId = 1;
}
message HttpUploadApiRequest {
string destinationResourceId = 1;
string destinationResourceChildPath = 2;
string destinationToken = 3;
string destinationType = 4;
string targetAgent = 5;
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 6;
}
message HttpUploadApiResponse {
string url = 1;
string targetAgent = 2;
}
message HttpDownloadApiRequest {
string sourceResourceId = 1;
string sourceResourceChildPath = 2;
string sourceToken = 3;
string sourceType = 4;
string targetAgent = 5;
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 6;
}
message HttpDownloadApiResponse {
string url = 1;
string targetAgent = 2;
}
message TransferStateApiRequest {
string transferId = 1;
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 2;
}
message TransferStateApiResponse {
string state = 1;
int64 updateTimeMils = 2;
double percentage = 3;
string description = 4;
}
message ResourceAvailabilityRequest {
string resourceId = 1;
string childResourcePath = 2;
string resourceType = 3;
string resourceToken = 4;
string resourceBackend = 5;
string resourceCredentialBackend = 6;
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 7;
}
message ResourceAvailabilityResponse {
bool available = 1;
}
message FileMetadataResponse {
string friendlyName = 1;
int64 resourceSize = 2;
int64 createdTime = 3;
int64 updateTime = 4;
string md5sum = 5;
string resourcePath = 6;
string parentResourceId = 7;
string parentResourceType = 8;
}
message DirectoryMetadataResponse {
string friendlyName = 1;
int64 createdTime = 2;
int64 updateTime = 3;
string resourcePath = 4;
string parentResourceId = 5;
string parentResourceType = 6;
repeated DirectoryMetadataResponse directories = 7;
repeated FileMetadataResponse files = 8;
bool lazyInitialized = 9;
}
message FetchResourceMetadataRequest {
string resourceId = 1;
string childResourcePath = 2;
string resourceType = 3;
string resourceToken = 4;
string resourceBackend = 5;
string resourceCredentialBackend = 6;
string targetAgentId = 7;
string childPath = 8; // if the child entities of the parent resource are required, set this field
org.apache.airavata.mft.common.AuthToken mftAuthorizationToken = 9;
}
service MFTTransferService {
rpc submitTransfer(TransferApiRequest) returns (TransferApiResponse) {
option (google.api.http) = {
post: "/v1.0/api/transfer"
};
}
rpc submitHttpUpload(HttpUploadApiRequest) returns (HttpUploadApiResponse) {
option (google.api.http) = {
post: "/v1.0/api/http-upload"
};
}
rpc submitHttpDownload(HttpDownloadApiRequest) returns (HttpDownloadApiResponse) {
option (google.api.http) = {
post: "/v1.0/api/http-download"
};
}
rpc getTransferStates(TransferStateApiRequest) returns (stream TransferStateApiResponse) {
option (google.api.http) = {
get: "/v1.0/api/transfer/states"
};
}
rpc getTransferState(TransferStateApiRequest) returns (TransferStateApiResponse) {
option (google.api.http) = {
get: "/v1.0/api/transfer/state"
};
}
rpc getResourceAvailability(ResourceAvailabilityRequest) returns (ResourceAvailabilityResponse) {}
rpc getFileResourceMetadata(FetchResourceMetadataRequest) returns (FileMetadataResponse) {
option (google.api.http) = {
get: "/v1.0/api/resource/metadata/file"
};
}
rpc getDirectoryResourceMetadata(FetchResourceMetadataRequest) returns (DirectoryMetadataResponse) {
option (google.api.http) = {
get: "/v1.0/api/resource/metadata/directory"
};
}
}