-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request Priority API #2245
Request Priority API #2245
Changes from 2 commits
76ca715
c380a79
3094640
301e9ba
6c32783
4d1c41b
f6d445f
ee9e89a
1bf776a
17e0bca
6a739a7
6bcab5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,9 @@ public enum RequestHistoryType { | |
DEPLOYED_TO_UNPAUSE, | ||
BOUNCED, | ||
SCALED, | ||
SCALE_REVERTED | ||
SCALE_REVERTED, | ||
PRIORITIZED, | ||
PRIORITY_REVERTED | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we able to maybe fold these into UPDATED instead somehow? these fields come through on things that a lot of other systems pull in and the roll out can be a pain with the deployer/etc having to know about all the new fields first. If the purpose is just to indicate the action more easily, we can always have the messge text reflect that, which will also show in the UI |
||
} | ||
|
||
@JsonCreator | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.hubspot.singularity.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.hubspot.singularity.SingularityRequest; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.Optional; | ||
|
||
@Schema(description = "Describes the new priority (0 to 1) for a request") | ||
public class SingularityPriorityRequest extends SingularityExpiringRequestParent { | ||
/** see {@link SingularityRequest#getTaskPriorityLevel()} */ | ||
private final Optional<Double> priority; | ||
|
||
public SingularityPriorityRequest( | ||
@JsonProperty("durationMillis") Optional<Long> durationMillis, | ||
@JsonProperty("actionId") Optional<String> actionId, | ||
@JsonProperty("message") Optional<String> message, | ||
@JsonProperty("priority") Optional<Double> priority, | ||
@JsonProperty("skipEmailNotification") Optional<Boolean> skipEmailNotification | ||
) { | ||
super(durationMillis, actionId, message); | ||
this.priority = priority; | ||
} | ||
|
||
public Optional<Double> getPriority() { | ||
return priority; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.hubspot.singularity.expiring; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.hubspot.singularity.api.SingularityPriorityRequest; | ||
import com.hubspot.singularity.api.SingularityScaleRequest; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.Optional; | ||
|
||
@Schema(description = "Details about a scale action that will eventually revert") | ||
public class SingularityExpiringPriority | ||
extends SingularityExpiringRequestActionParent<SingularityPriorityRequest> { | ||
private final Optional<Double> revertToPriority; | ||
|
||
public SingularityExpiringPriority( | ||
@JsonProperty("requestId") String requestId, | ||
@JsonProperty("user") Optional<String> user, | ||
@JsonProperty("startMillis") long startMillis, | ||
@JsonProperty("expiringAPIRequestObject") SingularityPriorityRequest request, | ||
@JsonProperty("revertToPriority") Optional<Double> revertToPriority, | ||
@JsonProperty("actionId") String actionId | ||
) { | ||
super(request, user, startMillis, actionId, requestId); | ||
this.revertToPriority = revertToPriority; | ||
} | ||
|
||
@Schema( | ||
description = "The scheduling priority to update to when time has elapsed", | ||
nullable = true | ||
) | ||
public Optional<Double> getRevertToPriority() { | ||
return revertToPriority; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SingularityExpiringPriority{" + "revertToPriority=" + revertToPriority + '}'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick note, there is an equivalent list in SingularityUI code that mirrors this enum