-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add -%/--format output remove --json, defer to RD_FORMAT allow RD_FORMAT=xml or --xml
- Loading branch information
Showing
4 changed files
with
146 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
rd-api-client/src/main/java/org/rundeck/client/api/model/executions/MetricsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.rundeck.client.api.model.executions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import org.rundeck.client.util.DataOutput; | ||
import org.simpleframework.xml.Element; | ||
import org.simpleframework.xml.Root; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
|
||
@Root(strict = false, name = "result") | ||
@Data | ||
public class MetricsResponse | ||
implements DataOutput | ||
{ | ||
private Long total; | ||
private Long failed; | ||
@JsonProperty(value = "failed-with-retry") | ||
@Element(name = "failed-with-retry") | ||
private Long failedWithRetry; | ||
private Long succeeded; | ||
@JsonProperty(value = "duration-avg") | ||
@Element(name = "duration-avg") | ||
private String durationAvg; | ||
@JsonProperty(value = "duration-min") | ||
@Element(name = "duration-min") | ||
private String durationMin; | ||
@JsonProperty(value = "duration-max") | ||
@Element(name = "duration-max") | ||
private String durationMax; | ||
|
||
@Override | ||
public Map<?, ?> asMap() { | ||
HashMap<String, Object> data = new HashMap<>(); | ||
data.put("total", total); | ||
data.put("failed-with-retry", failedWithRetry); | ||
data.put("succeeded", succeeded); | ||
data.put("failed", failed); | ||
data.put("duration-avg", durationAvg); | ||
data.put("duration-min", durationMin); | ||
data.put("duration-max", durationMax); | ||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters