@@ -12,13 +12,15 @@ type Slos struct {
1212 Slos []Slo `json:"slos"`
1313}
1414
15+ // Defines values for QueryType.
1516const (
1617 QueryTypeFreeform QueryType = "freeform"
1718 QueryTypeHistogram QueryType = "histogram"
1819 QueryTypeRatio QueryType = "ratio"
1920 QueryTypeThreshold QueryType = "threshold"
2021)
2122
23+ // Defines values for ThresholdOperator.
2224const (
2325 ThresholdOperatorEmpty ThresholdOperator = "<"
2426 ThresholdOperatorEqualEqual ThresholdOperator = "=="
@@ -27,48 +29,63 @@ const (
2729 ThresholdOperatorN3 ThresholdOperator = ">"
2830)
2931
32+ // Alerting defines model for Alerting.
3033type Alerting struct {
3134 Annotations []Label `json:"annotations,omitempty"`
3235 FastBurn * AlertingMetadata `json:"fastBurn,omitempty"`
3336 Labels []Label `json:"labels,omitempty"`
3437 SlowBurn * AlertingMetadata `json:"slowBurn,omitempty"`
3538}
3639
40+ // AlertingMetadata defines model for AlertingMetadata.
3741type AlertingMetadata struct {
3842 Annotations []Label `json:"annotations,omitempty"`
3943 Labels []Label `json:"labels,omitempty"`
4044}
4145
46+ // DashboardRef defines model for DashboardRef.
4247type DashboardRef struct {
4348 UID string `json:"UID"`
4449}
4550
51+ // DestinationDatasource defines model for DestinationDatasource.
52+ type DestinationDatasource struct {
53+ Type string `json:"type,omitempty"`
54+ UID string `json:"uid,omitempty"`
55+ }
56+
57+ // FreeformQuery defines model for FreeformQuery.
4658type FreeformQuery struct {
4759 Query string `json:"query"`
4860}
4961
62+ // HistogramQuery defines model for HistogramQuery.
5063type HistogramQuery struct {
5164 GroupByLabels []string `json:"groupByLabels,omitempty"`
5265 Metric MetricDef `json:"metric"`
5366 Percentile float64 `json:"percentile"`
5467 Threshold Threshold `json:"threshold"`
5568}
5669
70+ // Label defines model for Label.
5771type Label struct {
5872 Key string `json:"key"`
5973 Value string `json:"value"`
6074}
6175
76+ // MetricDef defines model for MetricDef.
6277type MetricDef struct {
63- PrometheusMetric string `json:"prometheusMetric"`
64- Type * string `json:"type,omitempty"`
78+ PrometheusMetric string `json:"prometheusMetric"`
79+ Type string `json:"type,omitempty"`
6580}
6681
82+ // Objective defines model for Objective.
6783type Objective struct {
6884 Value float64 `json:"value"`
6985 Window string `json:"window"`
7086}
7187
88+ // Query defines model for Query.
7289type Query struct {
7390 Freeform * FreeformQuery `json:"freeform,omitempty"`
7491 Histogram * HistogramQuery `json:"histogram,omitempty"`
@@ -77,32 +94,52 @@ type Query struct {
7794 Type QueryType `json:"type"`
7895}
7996
97+ // QueryType defines model for Query.Type.
8098type QueryType string
8199
100+ // RatioQuery defines model for RatioQuery.
82101type RatioQuery struct {
83102 GroupByLabels []string `json:"groupByLabels,omitempty"`
84103 SuccessMetric MetricDef `json:"successMetric"`
85104 TotalMetric MetricDef `json:"totalMetric"`
86105}
87106
88- type Slo struct {
89- Alerting * Alerting `json:"alerting,omitempty"`
90- Description string `json:"description"`
107+ // ReadOnly defines model for ReadOnly.
108+ type ReadOnly struct {
91109 DrillDownDashboardRef * DashboardRef `json:"drillDownDashboardRef,omitempty"`
92- Labels []Label `json:"labels,omitempty"`
93- Name string `json:"name"`
94- Objectives []Objective `json:"objectives"`
95- Query Query `json:"query"`
96- UUID string `json:"uuid"`
110+ Provenance string `json:"provenance,omitempty"`
111+ Status * Status `json:"status,omitempty"`
112+ }
113+
114+ // Slo defines model for Slo.
115+ type Slo struct {
116+ Alerting * Alerting `json:"alerting,omitempty"`
117+ Description string `json:"description"`
118+ DestinationDatasource * DestinationDatasource `json:"destinationDatasource,omitempty"`
119+ Labels []Label `json:"labels,omitempty"`
120+ Name string `json:"name"`
121+ Objectives []Objective `json:"objectives"`
122+ Query Query `json:"query"`
123+ ReadOnly * ReadOnly `json:"readOnly,omitempty"`
124+ UUID string `json:"uuid"`
125+ }
126+
127+ // Status defines model for Status.
128+ type Status struct {
129+ Message string `json:"message,omitempty"`
130+ Type string `json:"type"`
97131}
98132
133+ // Threshold defines model for Threshold.
99134type Threshold struct {
100135 Operator ThresholdOperator `json:"operator"`
101136 Value float64 `json:"value"`
102137}
103138
139+ // ThresholdOperator defines model for Threshold.Operator.
104140type ThresholdOperator string
105141
142+ // ThresholdQuery defines model for ThresholdQuery.
106143type ThresholdQuery struct {
107144 GroupByLabels []string `json:"groupByLabels,omitempty"`
108145 Metric MetricDef `json:"metric"`
0 commit comments