Skip to content

Commit

Permalink
Regenerate client from commit b069fa01 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Dec 20, 2023
1 parent 08b8c07 commit f643b10
Show file tree
Hide file tree
Showing 17 changed files with 1,300 additions and 56 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": "2023-12-18 13:47:04.512930",
"spec_repo_commit": "f363f7b4"
"regenerated": "2023-12-20 16:43:05.937358",
"spec_repo_commit": "b069fa01"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-18 13:47:04.528272",
"spec_repo_commit": "f363f7b4"
"regenerated": "2023-12-20 16:43:05.951876",
"spec_repo_commit": "b069fa01"
}
}
}
173 changes: 173 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11018,6 +11018,8 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
sli_specification:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecification'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down Expand Up @@ -11191,11 +11193,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 @@ -11206,12 +11210,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 @@ -12021,6 +12027,8 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
sli_specification:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecification'
tags:
description: 'A list of tags associated with this service level objective.

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

Expand Down Expand Up @@ -12208,6 +12218,169 @@ components:
- thresholds
- type
type: object
ServiceLevelObjectiveSliSpecification:
description: A generic SLI specification. This is currently used for time-slice
SLOs only.
oneOf:
- $ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationTimeSlice'
ServiceLevelObjectiveSliSpecificationComparator:
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
ServiceLevelObjectiveSliSpecificationDataSourceMetricsQuery:
description: An individual metrics query.
example:
data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
properties:
data_source:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationMetricsDataSource'
name:
description: The variable name for use in formulas.
example: query1
type: string
query:
description: A classic metrics query string.
example: sum:trace.servlet.request.hits{*} by {env}.as_count()
type: string
required:
- data_source
- query
- name
type: object
ServiceLevelObjectiveSliSpecificationDataSourceQueries:
description: A list of queries that can be used in formulas.
example:
- 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()
items:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationDataSourceQuery'
minItems: 1
type: array
ServiceLevelObjectiveSliSpecificationDataSourceQuery:
description: A formula and function query.
example:
data_source: metrics
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
oneOf:
- $ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationDataSourceMetricsQuery'
ServiceLevelObjectiveSliSpecificationFormula:
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
ServiceLevelObjectiveSliSpecificationMetricsDataSource:
description: The metrics data source.
enum:
- metrics
example: metrics
type: string
x-enum-varnames:
- METRICS
ServiceLevelObjectiveSliSpecificationTimeSlice:
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/ServiceLevelObjectiveSliSpecificationTimeSliceComponents'
required:
- time_slice
type: object
ServiceLevelObjectiveSliSpecificationTimeSliceComponents:
description: The time slice SLI specification components.
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/ServiceLevelObjectiveSliSpecificationComparator'
query:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationTimeSliceQuery'
threshold:
description: The threshold value to compare the SLI value to.
example: 5
format: double
type: number
required:
- comparator
- threshold
- query
type: object
ServiceLevelObjectiveSliSpecificationTimeSliceQuery:
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/ServiceLevelObjectiveSliSpecificationFormula'
maxItems: 1
minItems: 1
type: array
queries:
$ref: '#/components/schemas/ServiceLevelObjectiveSliSpecificationDataSourceQueries'
required:
- formulas
- queries
type: object
ServiceMapWidgetDefinition:
description: This widget displays a map of a service to all of the services
that call it, and all of the services that it calls.
Expand Down
69 changes: 52 additions & 17 deletions 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 *ServiceLevelObjectiveSliSpecification `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() ServiceLevelObjectiveSliSpecification {
if o == nil || o.SliSpecification == nil {
var ret ServiceLevelObjectiveSliSpecification
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() (*ServiceLevelObjectiveSliSpecification, 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 ServiceLevelObjectiveSliSpecification and assigns it to the SliSpecification field.
func (o *ServiceLevelObjective) SetSliSpecification(v ServiceLevelObjectiveSliSpecification) {
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 All @@ -600,22 +633,23 @@ func (o ServiceLevelObjective) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *ServiceLevelObjective) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CreatedAt *int64 `json:"created_at,omitempty"`
Creator *Creator `json:"creator,omitempty"`
Description datadog.NullableString `json:"description,omitempty"`
Groups []string `json:"groups,omitempty"`
Id *string `json:"id,omitempty"`
ModifiedAt *int64 `json:"modified_at,omitempty"`
MonitorIds []int64 `json:"monitor_ids,omitempty"`
MonitorTags []string `json:"monitor_tags,omitempty"`
Name *string `json:"name"`
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetThreshold *float64 `json:"target_threshold,omitempty"`
Thresholds *[]SLOThreshold `json:"thresholds"`
Timeframe *SLOTimeframe `json:"timeframe,omitempty"`
Type *SLOType `json:"type"`
WarningThreshold *float64 `json:"warning_threshold,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty"`
Creator *Creator `json:"creator,omitempty"`
Description datadog.NullableString `json:"description,omitempty"`
Groups []string `json:"groups,omitempty"`
Id *string `json:"id,omitempty"`
ModifiedAt *int64 `json:"modified_at,omitempty"`
MonitorIds []int64 `json:"monitor_ids,omitempty"`
MonitorTags []string `json:"monitor_tags,omitempty"`
Name *string `json:"name"`
Query *ServiceLevelObjectiveQuery `json:"query,omitempty"`
SliSpecification *ServiceLevelObjectiveSliSpecification `json:"sli_specification,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetThreshold *float64 `json:"target_threshold,omitempty"`
Thresholds *[]SLOThreshold `json:"thresholds"`
Timeframe *SLOTimeframe `json:"timeframe,omitempty"`
Type *SLOType `json:"type"`
WarningThreshold *float64 `json:"warning_threshold,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
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
Loading

0 comments on commit f643b10

Please sign in to comment.