/  Yamcs HTTP API  /  File Transfer  /  Create Transfer

Create TransferΒΆ

Create a transfer

URI Template

POST /api/filetransfer/{instance}/{serviceName}/transfers
{instance}

Yamcs instance name

{serviceName}

File transfer service name

Request Body

interface CreateTransferRequest {

  // **Required** One of ``UPLOAD`` or ``DOWNLOAD``.
  direction: TransferDirection;

  // **Required** The bucket containing the local Yamcs object.
  bucket: string;

  // **Required** The object name in Yamcs bucket storage. For UPLOAD transfers,
  // this object must exist and is what Yamcs will transfer to the remote
  // entity. For DOWNLOAD transfers, it refers to the object that
  // Yamcs will write to when downloading from a remote entity.
  objectName: string;

  // **Required** The path at the remote entity. Example: ``a/local/path/some_filename``.
  remotePath: string;

  //used to derive the source entity id
  source: string;

  //used to derive the destination entity id
  destination: string;

  // Options for the transfer
  options: {[key: string]: any};
}

Response Type

interface TransferInfo {

  //unique identifier assigned by the file transfer service
  id: string;  // String decimal

  //when the transfer has started. Note that this will not be set for QUEUED transfers.
  startTime: string;  // RFC 3339 timestamp
  state: TransferState;
  bucket: string;
  objectName: string;
  remotePath: string;
  direction: TransferDirection;
  totalSize: string;  // String decimal
  sizeTransferred: string;  // String decimal

  //reliable = true -> class 2 transfer
  //reliable = false -> class 1 transfer
  reliable: boolean;

  //in case the transcation is failed, this provides more information
  failureReason: string;

  // valid for CFDP: transaction id;
  // for the incoming transfers it is assigned by the remote peer so therefore might not be unique
  transactionId: TransactionId;

  // when the transfer has been created.
  creationTime: string;  // RFC 3339 timestamp

  // depending on the implementation, can mean normal file transfer, directory listing request, file download request, etc.
  transferType: string;

  // Local entity, may be empty if there is only one such entity.
  localEntity: EntityInfo;

  // Remote entity, may be empty if there is only one such entity.
  remoteEntity: EntityInfo;
}

Related Types

interface TransactionId {
  sequenceNumber: number;
  initiatorEntity: string;  // String decimal
}

interface EntityInfo {
  name: string;
  id: string;  // String decimal
}

enum TransferDirection {
  UPLOAD = "UPLOAD",
  DOWNLOAD = "DOWNLOAD",
}

enum TransferState {
  RUNNING = "RUNNING",
  PAUSED = "PAUSED",
  FAILED = "FAILED",
  COMPLETED = "COMPLETED",
  QUEUED = "QUEUED",
  CANCELLING = "CANCELLING",
}