blob: 891413cbf9a95a1cc033eeb2558804fa51d9b3ae [file] [log] [blame]
syntax = "proto3";
option java_multiple_files = true;
package org.apache.airavata.mft.api.service;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
message TransferApiRequest {
string sourceStorageId = 1;
string sourcePath = 2;
string sourceType = 3;
string sourceToken = 4;
string sourceResourceBackend = 5;
string sourceCredentialBackend = 6;
string destinationStorageId = 7;
string destinationPath = 8;
string destinationType = 9;
string destinationToken = 10;
string destResourceBackend = 11;
string destCredentialBackend = 12;
bool affinityTransfer = 13;
map<string, int32> targetAgents = 14;
string mftAuthorizationToken = 15;
}
message TransferApiResponse {
string transferId = 1;
}
message HttpUploadApiRequest {
string destinationStoreId = 1;
string destinationPath = 2;
string destinationToken = 3;
string destinationType = 4;
string targetAgent = 5;
string mftAuthorizationToken = 6;
}
message HttpUploadApiResponse {
string url = 1;
string targetAgent = 2;
}
message HttpDownloadApiRequest {
string sourceStoreId = 1;
string sourcePath = 2;
string sourceToken = 3;
string sourceType = 4;
string targetAgent = 5;
string mftAuthorizationToken = 6;
}
message HttpDownloadApiResponse {
string url = 1;
string targetAgent = 2;
}
message TransferStateApiRequest {
string transferId = 1;
string mftAuthorizationToken = 2;
}
message TransferStateApiResponse {
string state = 1;
int64 updateTimeMils = 2;
double percentage = 3;
string description = 4;
}
message ResourceAvailabilityRequest {
string resourceId = 1;
string resourceType = 2;
string resourceToken = 3;
string resourceBackend = 4;
string resourceCredentialBackend = 5;
string mftAuthorizationToken = 6;
}
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 resourceType = 2;
string resourceToken = 3;
string resourceBackend = 4;
string resourceCredentialBackend = 5;
string targetAgentId = 7;
string childPath = 8; // if the child entities of the parent resource are required, set this field
string mftAuthorizationToken = 9;
}
service MFTApiService {
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"
};
}
}