Skip to content

Commit 8441415

Browse files
committed
Update all the things
1 parent 67ca479 commit 8441415

File tree

114 files changed

+2360
-8360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2360
-8360
lines changed

generated/slo-spec.yml

Lines changed: 711 additions & 141 deletions
Large diffs are not rendered by default.

generated/slo-spec2.yml

Lines changed: 0 additions & 2029 deletions
This file was deleted.

generated/slo/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gitignore
2+
.openapi-generator-ignore
23
.travis.yml
34
README.md
45
api/openapi.yaml
@@ -140,4 +141,5 @@ model_timeslice_metric_doc_count_metric.go
140141
model_timeslice_metric_percentile_metric.go
141142
model_update_slo_request.go
142143
response.go
144+
test/api_slo_test.go
143145
utils.go
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.13.0
1+
7.0.1

generated/slo/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,26 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
77

88
- API version: 1.1
99
- Package version: 1.0.0
10-
- Generator version: 7.13.0
1110
- Build package: org.openapitools.codegen.languages.GoClientCodegen
1211

1312
## Installation
1413

1514
Install the following dependencies:
1615

17-
```sh
16+
```shell
1817
go get github.com/stretchr/testify/assert
1918
go get golang.org/x/net/context
2019
```
2120

2221
Put the package under your project folder and add the following in import:
2322

24-
```go
25-
import slo "github.com/GIT_USER_ID/GIT_REPO_ID"
23+
```golang
24+
import slo "github.com/elastic/terraform-provider-elasticstack/slo"
2625
```
2726

2827
To use a proxy, set the environment variable `HTTP_PROXY`:
2928

30-
```go
29+
```golang
3130
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
3231
```
3332

@@ -37,17 +36,17 @@ Default configuration comes with `Servers` field that contains server objects as
3736

3837
### Select Server Configuration
3938

40-
For using other server than the one defined on index 0 set context value `slo.ContextServerIndex` of type `int`.
39+
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
4140

42-
```go
41+
```golang
4342
ctx := context.WithValue(context.Background(), slo.ContextServerIndex, 1)
4443
```
4544

4645
### Templated Server URL
4746

48-
Templated server URL is formatted using default variables from configuration or from context value `slo.ContextServerVariables` of type `map[string]string`.
47+
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.
4948

50-
```go
49+
```golang
5150
ctx := context.WithValue(context.Background(), slo.ContextServerVariables, map[string]string{
5251
"basePath": "v2",
5352
})
@@ -59,9 +58,9 @@ Note, enum values are always validated and all unused variables are silently ign
5958

6059
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
6160
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
62-
Similar rules for overriding default operation server index and variables applies by using `slo.ContextOperationServerIndices` and `slo.ContextOperationServerVariables` context maps.
61+
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
6362

64-
```go
63+
```golang
6564
ctx := context.WithValue(context.Background(), slo.ContextOperationServerIndices, map[string]int{
6665
"{classname}Service.{nickname}": 2,
6766
})

generated/slo/api/openapi.yaml

Lines changed: 4 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,15 +1074,6 @@ components:
10741074
title: KQL query for all events
10751075
indicator_properties_custom_kql:
10761076
description: Defines properties for a custom query indicator type
1077-
example:
1078-
params:
1079-
filter: "field.environment : \"production\" and service.name : \"my-service\""
1080-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
1081-
total: "field.environment : \"production\" and service.name : \"my-service\""
1082-
index: my-service-*
1083-
timestampField: timestamp
1084-
good: "request.latency <= 150 and request.status_code : \"2xx\""
1085-
type: sli.kql.custom
10861077
properties:
10871078
params:
10881079
$ref: '#/components/schemas/indicator_properties_custom_kql_params'
@@ -1423,15 +1414,7 @@ components:
14231414
title: Group by
14241415
slo_with_summary_response:
14251416
example:
1426-
indicator:
1427-
params:
1428-
filter: "field.environment : \"production\" and service.name : \"my-service\""
1429-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
1430-
total: "field.environment : \"production\" and service.name : \"my-service\""
1431-
index: my-service-*
1432-
timestampField: timestamp
1433-
good: "request.latency <= 150 and request.status_code : \"2xx\""
1434-
type: sli.kql.custom
1417+
indicator: null
14351418
summary:
14361419
errorBudget:
14371420
consumed: 0.8
@@ -1557,15 +1540,7 @@ components:
15571540
searchAfter: searchAfter
15581541
page: 1
15591542
results:
1560-
- indicator:
1561-
params:
1562-
filter: "field.environment : \"production\" and service.name : \"my-service\""
1563-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
1564-
total: "field.environment : \"production\" and service.name : \"my-service\""
1565-
index: my-service-*
1566-
timestampField: timestamp
1567-
good: "request.latency <= 150 and request.status_code : \"2xx\""
1568-
type: sli.kql.custom
1543+
- indicator: null
15691544
summary:
15701545
errorBudget:
15711546
consumed: 0.8
@@ -1604,15 +1579,7 @@ components:
16041579
id: 8853df00-ae2e-11ed-90af-09bb6422b258
16051580
budgetingMethod: occurrences
16061581
updatedAt: 2023-01-12T10:03:19.000Z
1607-
- indicator:
1608-
params:
1609-
filter: "field.environment : \"production\" and service.name : \"my-service\""
1610-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
1611-
total: "field.environment : \"production\" and service.name : \"my-service\""
1612-
index: my-service-*
1613-
timestampField: timestamp
1614-
good: "request.latency <= 150 and request.status_code : \"2xx\""
1615-
type: sli.kql.custom
1582+
- indicator: null
16161583
summary:
16171584
errorBudget:
16181585
consumed: 0.8
@@ -1674,10 +1641,6 @@ components:
16741641
title: Find SLO response
16751642
type: object
16761643
"400_response":
1677-
example:
1678-
error: Bad Request
1679-
message: "Invalid value 'foo' supplied to: [...]"
1680-
statusCode: 400
16811644
properties:
16821645
statusCode:
16831646
example: 400
@@ -1695,12 +1658,6 @@ components:
16951658
title: Bad request
16961659
type: object
16971660
"401_response":
1698-
example:
1699-
error: Unauthorized
1700-
message: "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable\
1701-
\ to authenticate user [elastics] for REST request [/_security/_authenticate]]:\
1702-
\ unable to authenticate user [elastics] for REST request [/_security/_authenticate]"
1703-
statusCode: 401
17041661
properties:
17051662
statusCode:
17061663
example: 401
@@ -1720,12 +1677,6 @@ components:
17201677
title: Unauthorized
17211678
type: object
17221679
"403_response":
1723-
example:
1724-
error: Unauthorized
1725-
message: "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable\
1726-
\ to authenticate user [elastics] for REST request [/_security/_authenticate]]:\
1727-
\ unable to authenticate user [elastics] for REST request [/_security/_authenticate]"
1728-
statusCode: 403
17291680
properties:
17301681
statusCode:
17311682
example: 403
@@ -1745,10 +1696,6 @@ components:
17451696
title: Unauthorized
17461697
type: object
17471698
"404_response":
1748-
example:
1749-
error: Not Found
1750-
message: "SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found"
1751-
statusCode: 404
17521699
properties:
17531700
statusCode:
17541701
example: 404
@@ -1818,10 +1765,6 @@ components:
18181765
title: Create SLO response
18191766
type: object
18201767
"409_response":
1821-
example:
1822-
error: Conflict
1823-
message: "SLO [d077e940-1515-11ee-9c50-9d096392f520] already exists"
1824-
statusCode: 409
18251768
properties:
18261769
statusCode:
18271770
example: 409
@@ -1869,15 +1812,7 @@ components:
18691812
type: object
18701813
slo_definition_response:
18711814
example:
1872-
indicator:
1873-
params:
1874-
filter: "field.environment : \"production\" and service.name : \"my-service\""
1875-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
1876-
total: "field.environment : \"production\" and service.name : \"my-service\""
1877-
index: my-service-*
1878-
timestampField: timestamp
1879-
good: "request.latency <= 150 and request.status_code : \"2xx\""
1880-
type: sli.kql.custom
1815+
indicator: null
18811816
settings:
18821817
syncField: event.ingested
18831818
preventInitialBackfill: true
@@ -2129,13 +2064,6 @@ components:
21292064
type: object
21302065
indicator_properties_custom_kql_params:
21312066
description: An object containing the indicator parameters.
2132-
example:
2133-
filter: "field.environment : \"production\" and service.name : \"my-service\""
2134-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
2135-
total: "field.environment : \"production\" and service.name : \"my-service\""
2136-
index: my-service-*
2137-
timestampField: timestamp
2138-
good: "request.latency <= 150 and request.status_code : \"2xx\""
21392067
nullable: false
21402068
properties:
21412069
index:
@@ -2554,105 +2482,6 @@ components:
25542482
- $ref: '#/components/schemas/bulk_purge_rollup_request_purgePolicy_oneOf_1'
25552483
type: object
25562484
find_slo_definitions_response_oneOf:
2557-
example:
2558-
total: 34
2559-
perPage: 25
2560-
page: 1
2561-
results:
2562-
- indicator:
2563-
params:
2564-
filter: "field.environment : \"production\" and service.name : \"my-service\""
2565-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
2566-
total: "field.environment : \"production\" and service.name : \"my-service\""
2567-
index: my-service-*
2568-
timestampField: timestamp
2569-
good: "request.latency <= 150 and request.status_code : \"2xx\""
2570-
type: sli.kql.custom
2571-
summary:
2572-
errorBudget:
2573-
consumed: 0.8
2574-
isEstimated: true
2575-
initial: 0.02
2576-
remaining: 0.2
2577-
status: HEALTHY
2578-
sliValue: 0.9836
2579-
settings:
2580-
syncField: event.ingested
2581-
preventInitialBackfill: true
2582-
syncDelay: 5m
2583-
frequency: 5m
2584-
timeWindow:
2585-
duration: 30d
2586-
type: rolling
2587-
description: My SLO description
2588-
groupBy:
2589-
- - service.name
2590-
- service.name
2591-
- - service.name
2592-
- service.environment
2593-
version: 2
2594-
enabled: true
2595-
objective:
2596-
timesliceWindow: 5m
2597-
timesliceTarget: 0.995
2598-
target: 0.99
2599-
revision: 2
2600-
tags:
2601-
- tags
2602-
- tags
2603-
createdAt: 2023-01-12T10:03:19.000Z
2604-
instanceId: host-abcde
2605-
name: My Service SLO
2606-
id: 8853df00-ae2e-11ed-90af-09bb6422b258
2607-
budgetingMethod: occurrences
2608-
updatedAt: 2023-01-12T10:03:19.000Z
2609-
- indicator:
2610-
params:
2611-
filter: "field.environment : \"production\" and service.name : \"my-service\""
2612-
dataViewId: 03b80ab3-003d-498b-881c-3beedbaf1162
2613-
total: "field.environment : \"production\" and service.name : \"my-service\""
2614-
index: my-service-*
2615-
timestampField: timestamp
2616-
good: "request.latency <= 150 and request.status_code : \"2xx\""
2617-
type: sli.kql.custom
2618-
summary:
2619-
errorBudget:
2620-
consumed: 0.8
2621-
isEstimated: true
2622-
initial: 0.02
2623-
remaining: 0.2
2624-
status: HEALTHY
2625-
sliValue: 0.9836
2626-
settings:
2627-
syncField: event.ingested
2628-
preventInitialBackfill: true
2629-
syncDelay: 5m
2630-
frequency: 5m
2631-
timeWindow:
2632-
duration: 30d
2633-
type: rolling
2634-
description: My SLO description
2635-
groupBy:
2636-
- - service.name
2637-
- service.name
2638-
- - service.name
2639-
- service.environment
2640-
version: 2
2641-
enabled: true
2642-
objective:
2643-
timesliceWindow: 5m
2644-
timesliceTarget: 0.995
2645-
target: 0.99
2646-
revision: 2
2647-
tags:
2648-
- tags
2649-
- tags
2650-
createdAt: 2023-01-12T10:03:19.000Z
2651-
instanceId: host-abcde
2652-
name: My Service SLO
2653-
id: 8853df00-ae2e-11ed-90af-09bb6422b258
2654-
budgetingMethod: occurrences
2655-
updatedAt: 2023-01-12T10:03:19.000Z
26562485
properties:
26572486
page:
26582487
example: 1

0 commit comments

Comments
 (0)