Skip to content

Commit

Permalink
Regenerate client from commit 9cbf6566 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jan 5, 2024
1 parent 7df4ed2 commit 4b9b908
Show file tree
Hide file tree
Showing 38 changed files with 1,211 additions and 82 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-04 15:18:00.927828",
"spec_repo_commit": "e7cfa56f"
"regenerated": "2024-01-05 15:09:39.104630",
"spec_repo_commit": "9cbf6566"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-04 15:18:00.942781",
"spec_repo_commit": "e7cfa56f"
"regenerated": "2024-01-05 15:09:39.125252",
"spec_repo_commit": "9cbf6566"
}
}
}
136 changes: 136 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10244,6 +10244,13 @@ components:
nullable: true
type: string
type: object
SLODataSourceQueryDefinition:
description: A formula and function query.
example:
data_source: metrics
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
oneOf:
- $ref: '#/components/schemas/FormulaAndFunctionMetricQueryDefinition'
SLODeleteResponse:
description: A response list of all service level objective deleted.
properties:
Expand Down Expand Up @@ -10287,6 +10294,20 @@ components:
- THIRTY_DAYS
- NINETY_DAYS
- ALL
SLOFormula:
description: A formula that specifies how to combine the results of multiple
queries.
example:
formula: query1 - default_zero(query2)
properties:
formula:
description: The formula string, which is an expression involving named
queries.
example: query1 - default_zero(query2)
type: string
required:
- formula
type: object
SLOHistoryMetrics:
description: 'A `metric` based SLO history response.

Expand Down Expand Up @@ -11016,6 +11037,8 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down Expand Up @@ -11070,6 +11093,11 @@ components:
format: double
type: number
type: object
SLOSliSpec:
description: A generic SLI specification. This is currently used for time-slice
SLOs only.
oneOf:
- $ref: '#/components/schemas/SLOTimeSliceSpec'
SLOState:
description: State of the SLO.
enum:
Expand Down Expand Up @@ -11170,6 +11198,106 @@ components:
- timeframe
- target
type: object
SLOTimeSliceComparator:
description: The comparator used to compare the SLI value to the threshold.
enum:
- '>'
- '>='
- <
- <=
example: '>'
type: string
x-enum-varnames:
- GREATER
- GREATER_EQUAL
- LESS
- LESS_EQUAL
SLOTimeSliceCondition:
description: 'The time-slice condition, composed of 3 parts: 1. the metric timeseries
query, 2. the comparator,

and 3. the threshold.'
example:
comparator: <
query:
formulas:
- formula: query2/query1
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
- data_source: metrics
name: query1
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
threshold: 5
properties:
comparator:
$ref: '#/components/schemas/SLOTimeSliceComparator'
query:
$ref: '#/components/schemas/SLOTimeSliceQuery'
threshold:
description: The threshold value to which each SLI value will be compared.
example: 5
format: double
type: number
required:
- comparator
- threshold
- query
type: object
SLOTimeSliceQuery:
description: The queries and formula used to calculate the SLI value.
example:
formulas:
- formula: query2/query1
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
- data_source: metrics
name: query1
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
properties:
formulas:
description: A list that contains exactly one formula, as only a single
formula may be used in a time-slice SLO.
items:
$ref: '#/components/schemas/SLOFormula'
maxItems: 1
minItems: 1
type: array
queries:
description: A list of queries that are used to calculate the SLI value.
items:
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
type: array
required:
- formulas
- queries
type: object
SLOTimeSliceSpec:
additionalProperties: false
description: A time-slice SLI specification.
example:
time_slice:
comparator: <
query:
formulas:
- formula: query2/query1
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
- data_source: metrics
name: query1
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
threshold: 5
properties:
time_slice:
$ref: '#/components/schemas/SLOTimeSliceCondition'
required:
- time_slice
type: object
SLOTimeframe:
description: The SLO time window options.
enum:
Expand All @@ -11189,11 +11317,13 @@ components:
enum:
- metric
- monitor
- time_slice
example: metric
type: string
x-enum-varnames:
- METRIC
- MONITOR
- TIME_SLICE
SLOTypeNumeric:
description: 'A numeric representation of the type of the service level objective
(`0` for
Expand All @@ -11204,12 +11334,14 @@ components:
enum:
- 0
- 1
- 2
example: 0
format: int32
type: integer
x-enum-varnames:
- MONITOR
- METRIC
- TIME_SLICE
SLOWidgetDefinition:
description: Use the SLO and uptime widget to track your SLOs (Service Level
Objectives) and uptime on screenboards and timeboards.
Expand Down Expand Up @@ -12019,6 +12151,8 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down Expand Up @@ -12148,6 +12282,8 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down
37 changes: 36 additions & 1 deletion api/datadogV1/model_service_level_objective.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type ServiceLevelObjective struct {
// to be used because this will sum up all request counts instead of averaging them, or taking the max or
// min of all of those requests.
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
// A generic SLI specification. This is currently used for time-slice SLOs only.
SliSpecification *SLOSliSpec `json:"sli_specification,omitempty"`
// A list of tags associated with this service level objective.
// Always included in service level objective responses (but may be empty).
// Optional in create/update requests.
Expand Down Expand Up @@ -384,6 +386,34 @@ func (o *ServiceLevelObjective) SetQuery(v ServiceLevelObjectiveQuery) {
o.Query = &v
}

// GetSliSpecification returns the SliSpecification field value if set, zero value otherwise.
func (o *ServiceLevelObjective) GetSliSpecification() SLOSliSpec {
if o == nil || o.SliSpecification == nil {
var ret SLOSliSpec
return ret
}
return *o.SliSpecification
}

// GetSliSpecificationOk returns a tuple with the SliSpecification field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServiceLevelObjective) GetSliSpecificationOk() (*SLOSliSpec, bool) {
if o == nil || o.SliSpecification == nil {
return nil, false
}
return o.SliSpecification, true
}

// HasSliSpecification returns a boolean if a field has been set.
func (o *ServiceLevelObjective) HasSliSpecification() bool {
return o != nil && o.SliSpecification != nil
}

// SetSliSpecification gets a reference to the given SLOSliSpec and assigns it to the SliSpecification field.
func (o *ServiceLevelObjective) SetSliSpecification(v SLOSliSpec) {
o.SliSpecification = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ServiceLevelObjective) GetTags() []string {
if o == nil || o.Tags == nil {
Expand Down Expand Up @@ -576,6 +606,9 @@ func (o ServiceLevelObjective) MarshalJSON() ([]byte, error) {
if o.Query != nil {
toSerialize["query"] = o.Query
}
if o.SliSpecification != nil {
toSerialize["sli_specification"] = o.SliSpecification
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
Expand Down Expand Up @@ -610,6 +643,7 @@ func (o *ServiceLevelObjective) UnmarshalJSON(bytes []byte) (err error) {
MonitorTags []string `json:"monitor_tags,omitempty"`
Name *string `json:"name"`
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
SliSpecification *SLOSliSpec `json:"sli_specification,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetThreshold *float64 `json:"target_threshold,omitempty"`
Thresholds *[]SLOThreshold `json:"thresholds"`
Expand All @@ -631,7 +665,7 @@ func (o *ServiceLevelObjective) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "creator", "description", "groups", "id", "modified_at", "monitor_ids", "monitor_tags", "name", "query", "tags", "target_threshold", "thresholds", "timeframe", "type", "warning_threshold"})
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "creator", "description", "groups", "id", "modified_at", "monitor_ids", "monitor_tags", "name", "query", "sli_specification", "tags", "target_threshold", "thresholds", "timeframe", "type", "warning_threshold"})
} else {
return err
}
Expand All @@ -653,6 +687,7 @@ func (o *ServiceLevelObjective) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Query = all.Query
o.SliSpecification = all.SliSpecification
o.Tags = all.Tags
o.TargetThreshold = all.TargetThreshold
o.Thresholds = *all.Thresholds
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV1/model_service_level_objective_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type ServiceLevelObjectiveRequest struct {
// to be used because this will sum up all request counts instead of averaging them, or taking the max or
// min of all of those requests.
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
// A generic SLI specification. This is currently used for time-slice SLOs only.
SliSpecification *SLOSliSpec `json:"sli_specification,omitempty"`
// A list of tags associated with this service level objective.
// Always included in service level objective responses (but may be empty).
// Optional in create/update requests.
Expand Down Expand Up @@ -223,6 +225,34 @@ func (o *ServiceLevelObjectiveRequest) SetQuery(v ServiceLevelObjectiveQuery) {
o.Query = &v
}

// GetSliSpecification returns the SliSpecification field value if set, zero value otherwise.
func (o *ServiceLevelObjectiveRequest) GetSliSpecification() SLOSliSpec {
if o == nil || o.SliSpecification == nil {
var ret SLOSliSpec
return ret
}
return *o.SliSpecification
}

// GetSliSpecificationOk returns a tuple with the SliSpecification field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServiceLevelObjectiveRequest) GetSliSpecificationOk() (*SLOSliSpec, bool) {
if o == nil || o.SliSpecification == nil {
return nil, false
}
return o.SliSpecification, true
}

// HasSliSpecification returns a boolean if a field has been set.
func (o *ServiceLevelObjectiveRequest) HasSliSpecification() bool {
return o != nil && o.SliSpecification != nil
}

// SetSliSpecification gets a reference to the given SLOSliSpec and assigns it to the SliSpecification field.
func (o *ServiceLevelObjectiveRequest) SetSliSpecification(v SLOSliSpec) {
o.SliSpecification = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ServiceLevelObjectiveRequest) GetTags() []string {
if o == nil || o.Tags == nil {
Expand Down Expand Up @@ -400,6 +430,9 @@ func (o ServiceLevelObjectiveRequest) MarshalJSON() ([]byte, error) {
if o.Query != nil {
toSerialize["query"] = o.Query
}
if o.SliSpecification != nil {
toSerialize["sli_specification"] = o.SliSpecification
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
Expand Down Expand Up @@ -429,6 +462,7 @@ func (o *ServiceLevelObjectiveRequest) UnmarshalJSON(bytes []byte) (err error) {
MonitorIds []int64 `json:"monitor_ids,omitempty"`
Name *string `json:"name"`
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
SliSpecification *SLOSliSpec `json:"sli_specification,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetThreshold *float64 `json:"target_threshold,omitempty"`
Thresholds *[]SLOThreshold `json:"thresholds"`
Expand All @@ -450,7 +484,7 @@ func (o *ServiceLevelObjectiveRequest) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"description", "groups", "monitor_ids", "name", "query", "tags", "target_threshold", "thresholds", "timeframe", "type", "warning_threshold"})
datadog.DeleteKeys(additionalProperties, &[]string{"description", "groups", "monitor_ids", "name", "query", "sli_specification", "tags", "target_threshold", "thresholds", "timeframe", "type", "warning_threshold"})
} else {
return err
}
Expand All @@ -464,6 +498,7 @@ func (o *ServiceLevelObjectiveRequest) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Query = all.Query
o.SliSpecification = all.SliSpecification
o.Tags = all.Tags
o.TargetThreshold = all.TargetThreshold
o.Thresholds = *all.Thresholds
Expand Down
Loading

0 comments on commit 4b9b908

Please sign in to comment.