Skip to content

Commit

Permalink
Fix POST /transfers endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thebe14 committed Feb 6, 2025
1 parent 4b6e714 commit 3b6b06c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
9 changes: 4 additions & 5 deletions src/main/java/egi/fts/model/JobFileSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ public class JobFileSet {
// Multiple destination where to transfer the same file
public List<String> destinations;

@Schema(title="Overrides transfer priority for this set of files, from 1 to 5, 1 being the lowest priority")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public int priority = 0;

@Schema(title="User defined checksum in the form 'algorithm:value'")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
public String checksum;


Expand All @@ -47,5 +43,8 @@ public JobFileSet(TransferPayload payload) {
this.destinations = new ArrayList<>(payload.destinations.size());
this.sources.addAll(payload.sources);
this.destinations.addAll(payload.destinations);

if(null != payload.checksum)
this.checksum = payload.checksum;
}
}
26 changes: 5 additions & 21 deletions src/main/java/egi/fts/model/JobParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,17 @@
public class JobParameters {

public boolean overwrite = false;

@Schema(title="If set to true, the transfer will be a multihop transfer")
public boolean multihop = false;

@Schema(title="Number of retries")
public int retry = 1;
public boolean verify_checksum = false;

@Schema(title="Transfer priority from 1 to 5, 1 being the lowest priority")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public int priority = 0;

@Schema(title="Disable all checks, just copy the file")
public boolean strict_copy = false;

@Schema(title="Force IPv4 if the underlying protocol supports it")
public boolean ipv4 = false;

@Schema(title="Force IPv6 if the underlying protocol supports it")
public boolean ipv6 = false;

@Schema(title="Set to true when transferring to S3 destinations")
@JsonInclude(JsonInclude.Include.NON_NULL)
public Optional<Boolean> s3alternate;


/**
* Constructor
Expand All @@ -48,13 +39,6 @@ public JobParameters() {}
public JobParameters(TransferParameters params) {
this.overwrite = params.overwrite;
this.retry = params.retry;
this.verify_checksum = params.verifyChecksum;
this.priority = params.priority;
this.strict_copy = params.strictCopy;
this.ipv4 = params.ipv4;
this.ipv6 = params.ipv6;

if(params.hasS3Destinations())
this.s3alternate = Optional.of(true);
}
}
10 changes: 0 additions & 10 deletions src/main/java/eosc/eu/model/TransferParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ public class TransferParameters {
@Schema(description="Transfer priority from 1 to 5, 1 being the lowest priority")
public int priority;

@Schema(description="Disable all checks, just copy the file")
public boolean strictCopy = false;

@Schema(description="Force IPv4 if the underlying protocol supports it")
public boolean ipv4 = false;

@Schema(description="Force IPv6 if the underlying protocol supports it")
public boolean ipv6 = false;


/**
* Constructor
*/
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/eosc/eu/model/TransferPayload.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public class TransferPayload {
@Schema(description="Multiple destinations where to transfer the file")
public List<String> destinations;

@Schema(description="Transfer priority for this file, from 1 to 5, 1 being the lowest priority")
public int priority = 0;

@Schema(description="User defined checksum in the form 'algorithm:value'")
public String checksum;

Expand Down

0 comments on commit 3b6b06c

Please sign in to comment.