| 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 sourceId = 1; |
| string sourceType = 2; |
| string sourceToken = 3; |
| string sourceResourceBackend = 4; |
| string sourceCredentialBackend = 5; |
| string destinationId = 6; |
| string destinationType = 7; |
| string destinationToken = 8; |
| string destResourceBackend = 9; |
| string destCredentialBackend = 10; |
| bool affinityTransfer = 11; |
| map<string, int32> targetAgents = 12; |
| string mftAuthorizationToken = 13; |
| } |
| |
| message TransferApiResponse { |
| string transferId = 1; |
| } |
| |
| 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 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" |
| }; |
| } |
| } |