From 192094646f452012da1f119b0afd7da6e29da2cd Mon Sep 17 00:00:00 2001 From: Boris Ilyushonak <57406418+biscout42@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:07:58 +0200 Subject: [PATCH 1/4] fix: move all resources in one namespace for tcp monitor acc tests (#717) * fix: move all resources in one namespace for tcp monitor acc tests * add mutex in kibana API client and move tests to same package to run test in single golang process due-to https://github.com/elastic/kibana/issues/190801 --- .../acc_test.go => acc_pl_test.go} | 21 +++++----- internal/kibana/synthetics/acc_test.go | 10 ++--- libs/go-kibana-rest/docker-compose.yml | 1 + .../kbapi/api.kibana_synthetics.go | 39 +++++++++++-------- .../kbapi/api.kibana_synthetics_test.go | 3 +- 5 files changed, 43 insertions(+), 31 deletions(-) rename internal/kibana/synthetics/{private_location/acc_test.go => acc_pl_test.go} (92%) diff --git a/internal/kibana/synthetics/private_location/acc_test.go b/internal/kibana/synthetics/acc_pl_test.go similarity index 92% rename from internal/kibana/synthetics/private_location/acc_test.go rename to internal/kibana/synthetics/acc_pl_test.go index 57995d7f5..f4279a525 100644 --- a/internal/kibana/synthetics/private_location/acc_test.go +++ b/internal/kibana/synthetics/acc_pl_test.go @@ -1,4 +1,7 @@ -package private_location_test +package synthetics_test + +// this test is in synthetics_test package, because of https://github.com/elastic/kibana/issues/190801 +// having both tests in same package allows to use mutex in kibana API client and workaround the issue import ( "fmt" @@ -21,10 +24,10 @@ provider "elasticstack" { ) var ( - minKibanaVersion = version.Must(version.NewVersion("8.12.0")) + minKibanaPrivateLocationAPIVersion = version.Must(version.NewVersion("8.12.0")) ) -func TestPrivateLocationResource(t *testing.T) { +func TestSyntheticPrivateLocationResource(t *testing.T) { resourceId := "elasticstack_kibana_synthetics_private_location.test" resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -32,7 +35,7 @@ func TestPrivateLocationResource(t *testing.T) { Steps: []resource.TestStep{ // Create and Read testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), Config: testConfig("testacc", "test_policy") + ` resource "elasticstack_kibana_synthetics_private_location" "test" { label = "pl-test-label" @@ -58,7 +61,7 @@ resource "elasticstack_kibana_synthetics_private_location" "test" { }, // ImportState testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), ResourceName: resourceId, ImportState: true, ImportStateVerify: true, @@ -77,7 +80,7 @@ resource "elasticstack_kibana_synthetics_private_location" "test" { }, // Update and Read testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), Config: testConfig("default", "test_policy_default") + ` resource "elasticstack_kibana_synthetics_private_location" "test" { label = "pl-test-label-2" @@ -104,7 +107,7 @@ resource "elasticstack_kibana_synthetics_private_location" "test" { }, // Update and Read testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), Config: testConfig("default", "test_policy_default") + ` resource "elasticstack_kibana_synthetics_private_location" "test" { label = "pl-test-label-2" @@ -122,7 +125,7 @@ resource "elasticstack_kibana_synthetics_private_location" "test" { }, // Update and Read testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), Config: testConfig("default", "test_policy_default") + ` resource "elasticstack_kibana_synthetics_private_location" "test" { label = "pl-test-label-2" @@ -144,7 +147,7 @@ resource "elasticstack_kibana_synthetics_private_location" "test" { }, // Update and Read testing { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaVersion), + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minKibanaPrivateLocationAPIVersion), Config: testConfig("default", "test_policy_default") + ` resource "elasticstack_kibana_synthetics_private_location" "test" { label = "pl-test-label-2" diff --git a/internal/kibana/synthetics/acc_test.go b/internal/kibana/synthetics/acc_test.go index 264ba04c4..dce29e5fb 100644 --- a/internal/kibana/synthetics/acc_test.go +++ b/internal/kibana/synthetics/acc_test.go @@ -112,7 +112,7 @@ resource "elasticstack_kibana_synthetics_monitor" "%s" { resource "elasticstack_kibana_synthetics_monitor" "%s" { name = "TestTcpMonitorResource - %s" - space_id = "default" + space_id = "testacc" schedule = 5 private_locations = [elasticstack_kibana_synthetics_private_location.%s.label] enabled = true @@ -140,7 +140,7 @@ resource "elasticstack_kibana_synthetics_monitor" "%s" { tcpMonitorUpdated = ` resource "elasticstack_kibana_synthetics_monitor" "%s" { name = "TestTcpMonitorResource Updated - %s" - space_id = "default" + space_id = "testacc" schedule = 10 private_locations = [elasticstack_kibana_synthetics_private_location.%s.label] enabled = false @@ -285,7 +285,7 @@ func TestSyntheticMonitorTCPResource(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet(tcpMonitorId, "id"), resource.TestCheckResourceAttr(tcpMonitorId, "name", "TestTcpMonitorResource - "+name), - resource.TestCheckResourceAttr(tcpMonitorId, "space_id", "default"), + resource.TestCheckResourceAttr(tcpMonitorId, "space_id", "testacc"), resource.TestCheckResourceAttr(tcpMonitorId, "schedule", "5"), resource.TestCheckResourceAttr(tcpMonitorId, "private_locations.#", "1"), resource.TestCheckResourceAttrSet(tcpMonitorId, "private_locations.0"), @@ -323,7 +323,7 @@ func TestSyntheticMonitorTCPResource(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet(tcpMonitorId, "id"), resource.TestCheckResourceAttr(tcpMonitorId, "name", "TestTcpMonitorResource Updated - "+name), - resource.TestCheckResourceAttr(tcpMonitorId, "space_id", "default"), + resource.TestCheckResourceAttr(tcpMonitorId, "space_id", "testacc"), resource.TestCheckResourceAttr(tcpMonitorId, "schedule", "10"), resource.TestCheckResourceAttr(tcpMonitorId, "private_locations.#", "1"), resource.TestCheckResourceAttrSet(tcpMonitorId, "private_locations.0"), @@ -377,7 +377,7 @@ resource "elasticstack_fleet_agent_policy" "%s" { } resource "elasticstack_kibana_synthetics_private_location" "%s" { - label = "TestMonitorResource-label-%s" + label = "monitor-pll-%s" space_id = "testacc" agent_policy_id = elasticstack_fleet_agent_policy.%s.policy_id } diff --git a/libs/go-kibana-rest/docker-compose.yml b/libs/go-kibana-rest/docker-compose.yml index e0c6ac37b..1f14ad454 100644 --- a/libs/go-kibana-rest/docker-compose.yml +++ b/libs/go-kibana-rest/docker-compose.yml @@ -29,6 +29,7 @@ services: ELASTICSEARCH_USERNAME: kibana_system ELASTICSEARCH_PASSWORD: changeme XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: min-32-byte-long-strong-encryption-key +# LOGGING_ROOT_LEVEL: debug links: - elasticsearch:es ports: diff --git a/libs/go-kibana-rest/kbapi/api.kibana_synthetics.go b/libs/go-kibana-rest/kbapi/api.kibana_synthetics.go index 44193dede..578cae340 100644 --- a/libs/go-kibana-rest/kbapi/api.kibana_synthetics.go +++ b/libs/go-kibana-rest/kbapi/api.kibana_synthetics.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "sync" "time" "github.com/go-resty/resty/v2" @@ -47,6 +48,8 @@ const ( ModeAny = "any" ) +var plMu sync.Mutex + type MonitorFields interface { APIRequest(cfg SyntheticsMonitorConfig) interface{} } @@ -260,8 +263,7 @@ type KibanaSyntheticsPrivateLocationGet func(ctx context.Context, idOrLabel stri type KibanaSyntheticsPrivateLocationDelete func(ctx context.Context, id string, namespace string) error func newKibanaSyntheticsPrivateLocationGetFunc(c *resty.Client) KibanaSyntheticsPrivateLocationGet { - return func(ctx context.Context, idOrLabel string, namespace string) (*PrivateLocation, error) { - + return func(ctx context.Context, idOrLabel string, _ string) (*PrivateLocation, error) { if idOrLabel == "" { return nil, APIError{ Code: 404, @@ -269,7 +271,7 @@ func newKibanaSyntheticsPrivateLocationGetFunc(c *resty.Client) KibanaSynthetics } } - path := basePathWithId(namespace, privateLocationsSuffix, idOrLabel) + path := basePathWithId("", privateLocationsSuffix, idOrLabel) log.Debugf("URL to get private locations: %s", path) resp, err := c.R().SetContext(ctx).Get(path) if err = handleKibanaError(err, resp); err != nil { @@ -279,8 +281,26 @@ func newKibanaSyntheticsPrivateLocationGetFunc(c *resty.Client) KibanaSynthetics } } +func newKibanaSyntheticsPrivateLocationCreateFunc(c *resty.Client) KibanaSyntheticsPrivateLocationCreate { + return func(ctx context.Context, pLoc PrivateLocationConfig, namespace string) (*PrivateLocation, error) { + plMu.Lock() + defer plMu.Unlock() + + path := basePath(namespace, privateLocationsSuffix) + log.Debugf("URL to create private locations: %s", path) + resp, err := c.R().SetContext(ctx).SetBody(pLoc).Post(path) + if err = handleKibanaError(err, resp); err != nil { + return nil, err + } + return unmarshal(resp, PrivateLocation{}) + } +} + func newKibanaSyntheticsPrivateLocationDeleteFunc(c *resty.Client) KibanaSyntheticsPrivateLocationDelete { return func(ctx context.Context, id string, namespace string) error { + plMu.Lock() + defer plMu.Unlock() + path := basePathWithId(namespace, privateLocationsSuffix, id) log.Debugf("URL to delete private locations: %s", path) resp, err := c.R().SetContext(ctx).Delete(path) @@ -319,19 +339,6 @@ func newKibanaSyntheticsMonitorDeleteFunc(c *resty.Client) KibanaSyntheticsMonit } } -func newKibanaSyntheticsPrivateLocationCreateFunc(c *resty.Client) KibanaSyntheticsPrivateLocationCreate { - return func(ctx context.Context, pLoc PrivateLocationConfig, namespace string) (*PrivateLocation, error) { - - path := basePath(namespace, privateLocationsSuffix) - log.Debugf("URL to create private locations: %s", path) - resp, err := c.R().SetContext(ctx).SetBody(pLoc).Post(path) - if err = handleKibanaError(err, resp); err != nil { - return nil, err - } - return unmarshal(resp, PrivateLocation{}) - } -} - func newKibanaSyntheticsMonitorUpdateFunc(c *resty.Client) KibanaSyntheticsMonitorUpdate { return func(ctx context.Context, id MonitorID, config SyntheticsMonitorConfig, fields MonitorFields, namespace string) (*SyntheticsMonitor, error) { diff --git a/libs/go-kibana-rest/kbapi/api.kibana_synthetics_test.go b/libs/go-kibana-rest/kbapi/api.kibana_synthetics_test.go index 22df4891b..265057a8a 100644 --- a/libs/go-kibana-rest/kbapi/api.kibana_synthetics_test.go +++ b/libs/go-kibana-rest/kbapi/api.kibana_synthetics_test.go @@ -313,7 +313,7 @@ func (s *KBAPITestSuite) TestKibanaSyntheticsPrivateLocationAPI() { testWithPolicy(s.T(), s.client, space, func(policyId string) { cfg := PrivateLocationConfig{ - Label: fmt.Sprintf("TestKibanaSyntheticsPrivateLocationAPI %s", testUuid), + Label: fmt.Sprintf("TestKibanaSyntheticsPrivateLocationAPI-%s", testUuid), AgentPolicyId: policyId, Tags: []string{"a", "b"}, Geo: &SyntheticGeoConfig{ @@ -322,6 +322,7 @@ func (s *KBAPITestSuite) TestKibanaSyntheticsPrivateLocationAPI() { }, } created, err := pAPI.Create(ctx, cfg, space) + assert.NoError(s.T(), err) assert.Equal(s.T(), created.Label, cfg.Label) assert.Equal(s.T(), created.AgentPolicyId, cfg.AgentPolicyId) From 890e65dff809b47805ae1195c1ec837409db9120 Mon Sep 17 00:00:00 2001 From: Toby Brain Date: Wed, 21 Aug 2024 19:15:33 +1000 Subject: [PATCH 2/4] Validate that mappings are a JSON object, not just valid json (#719) * Validate that mappings are a JSON object, not just valid json * Docs * Changelog * Update internal/elasticsearch/index/validation_test.go Co-authored-by: Boris Ilyushonak <57406418+biscout42@users.noreply.github.com> --------- Co-authored-by: Boris Ilyushonak <57406418+biscout42@users.noreply.github.com> --- CHANGELOG.md | 3 +- .../elasticsearch_component_template.md | 2 +- .../resources/elasticsearch_index_template.md | 2 +- .../elasticsearch/index/component_template.go | 10 ++-- internal/elasticsearch/index/index.go | 6 ++- internal/elasticsearch/index/template.go | 10 ++-- internal/elasticsearch/index/validation.go | 22 ++++++++ .../elasticsearch/index/validation_test.go | 51 +++++++++++++++++++ 8 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 internal/elasticsearch/index/validation.go create mode 100644 internal/elasticsearch/index/validation_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f2b99897..2aa9f468e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased] -- Add support for Kibana synthetics http and tcp monitors ([#699](https://github.com/elastic/terraform-provider-elasticstack/pull/699)) +- Improve validation for index settings and mappings ([#719](https://github.com/elastic/terraform-provider-elasticstack/pull/719)) +- Add support for Kibana synthetics http and tcp monitors ([#699](https://github.com/elastic/terraform-provider-elasticstack/pull/699)) - Add `elasticstack_kibana_spaces` data source ([#682](https://github.com/elastic/terraform-provider-elasticstack/pull/682)) ## [0.11.5] - 2024-08-12 diff --git a/docs/resources/elasticsearch_component_template.md b/docs/resources/elasticsearch_component_template.md index 5908917ba..0e150b797 100644 --- a/docs/resources/elasticsearch_component_template.md +++ b/docs/resources/elasticsearch_component_template.md @@ -63,7 +63,7 @@ resource "elasticstack_elasticsearch_index_template" "my_template" { Optional: - `alias` (Block Set) Alias to add. (see [below for nested schema](#nestedblock--template--alias)) -- `mappings` (String) Mapping for fields in the index. +- `mappings` (String) Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details - `settings` (String) Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings diff --git a/docs/resources/elasticsearch_index_template.md b/docs/resources/elasticsearch_index_template.md index 4eae1398e..f93dfbe6f 100644 --- a/docs/resources/elasticsearch_index_template.md +++ b/docs/resources/elasticsearch_index_template.md @@ -102,7 +102,7 @@ Optional: Optional: - `alias` (Block Set) Alias to add. (see [below for nested schema](#nestedblock--template--alias)) -- `mappings` (String) Mapping for fields in the index. +- `mappings` (String) Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details - `settings` (String) Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings diff --git a/internal/elasticsearch/index/component_template.go b/internal/elasticsearch/index/component_template.go index 52f419e44..f129d6fa6 100644 --- a/internal/elasticsearch/index/component_template.go +++ b/internal/elasticsearch/index/component_template.go @@ -93,18 +93,22 @@ func ResourceComponentTemplate() *schema.Resource { }, }, "mappings": { - Description: "Mapping for fields in the index.", + Description: "Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details", Type: schema.TypeString, Optional: true, DiffSuppressFunc: utils.DiffJsonSuppress, - ValidateFunc: validation.StringIsJSON, + ValidateFunc: validation.All( + validation.StringIsJSON, stringIsJSONObject, + ), }, "settings": { Description: "Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings", Type: schema.TypeString, Optional: true, DiffSuppressFunc: utils.DiffIndexSettingSuppress, - ValidateFunc: validation.StringIsJSON, + ValidateFunc: validation.All( + validation.StringIsJSON, stringIsJSONObject, + ), }, }, }, diff --git a/internal/elasticsearch/index/index.go b/internal/elasticsearch/index/index.go index 5a861a03e..27591e4c2 100644 --- a/internal/elasticsearch/index/index.go +++ b/internal/elasticsearch/index/index.go @@ -489,8 +489,10 @@ If specified, this mapping can include: field names, [field data types](https:// Type: schema.TypeString, Optional: true, DiffSuppressFunc: utils.DiffJsonSuppress, - ValidateFunc: validation.StringIsJSON, - Default: "{}", + ValidateFunc: validation.All( + validation.StringIsJSON, stringIsJSONObject, + ), + Default: "{}", }, // Deprecated: individual setting field should be used instead "settings": { diff --git a/internal/elasticsearch/index/template.go b/internal/elasticsearch/index/template.go index 3d079dcd1..834565096 100644 --- a/internal/elasticsearch/index/template.go +++ b/internal/elasticsearch/index/template.go @@ -140,18 +140,22 @@ func ResourceTemplate() *schema.Resource { }, }, "mappings": { - Description: "Mapping for fields in the index.", + Description: "Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details", Type: schema.TypeString, Optional: true, DiffSuppressFunc: utils.DiffJsonSuppress, - ValidateFunc: validation.StringIsJSON, + ValidateFunc: validation.All( + validation.StringIsJSON, stringIsJSONObject, + ), }, "settings": { Description: "Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings", Type: schema.TypeString, Optional: true, DiffSuppressFunc: utils.DiffIndexSettingSuppress, - ValidateFunc: validation.StringIsJSON, + ValidateFunc: validation.All( + validation.StringIsJSON, stringIsJSONObject, + ), }, }, }, diff --git a/internal/elasticsearch/index/validation.go b/internal/elasticsearch/index/validation.go new file mode 100644 index 000000000..0d5d8601f --- /dev/null +++ b/internal/elasticsearch/index/validation.go @@ -0,0 +1,22 @@ +package index + +import ( + "encoding/json" + "fmt" +) + +func stringIsJSONObject(i interface{}, s string) (warnings []string, errors []error) { + iStr, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", s)) + return warnings, errors + } + + m := map[string]interface{}{} + if err := json.Unmarshal([]byte(iStr), &m); err != nil { + errors = append(errors, fmt.Errorf("expected %s to be a JSON object. Check the documentation for the expected format. %w", s, err)) + return + } + + return +} diff --git a/internal/elasticsearch/index/validation_test.go b/internal/elasticsearch/index/validation_test.go new file mode 100644 index 000000000..2637f3cd9 --- /dev/null +++ b/internal/elasticsearch/index/validation_test.go @@ -0,0 +1,51 @@ +package index + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_stringIsJSONObject(t *testing.T) { + tests := []struct { + name string + fieldVal interface{} + expectedErrsToContain []string + }{ + { + name: "should not return an error for a valid json object", + fieldVal: "{}", + }, + { + name: "should not return an error for a null", + fieldVal: "null", + }, + + { + name: "should return an error if the field is not a string", + fieldVal: true, + expectedErrsToContain: []string{ + "expected type of field-name to be string", + }, + }, + { + name: "should return an error if the field is valid json, but not an object", + fieldVal: "[]", + expectedErrsToContain: []string{ + "expected field-name to be a JSON object. Check the documentation for the expected format.", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + warnings, errors := stringIsJSONObject(tt.fieldVal, "field-name") + require.Empty(t, warnings) + + require.Equal(t, len(tt.expectedErrsToContain), len(errors)) + for i, err := range errors { + require.ErrorContains(t, err, tt.expectedErrsToContain[i]) + } + }) + } +} From 0118d48ecf7015bc6b441c144c29a70072b58dfc Mon Sep 17 00:00:00 2001 From: Boris Ilyushonak <57406418+biscout42@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:59:48 +0200 Subject: [PATCH 3/4] chore: prepare release v0.11.6 (#716) --- CHANGELOG.md | 4 +++- Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aa9f468e..7ec27bcdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased] +## [0.11.6] - 2024-08-20 - Improve validation for index settings and mappings ([#719](https://github.com/elastic/terraform-provider-elasticstack/pull/719)) - Add support for Kibana synthetics http and tcp monitors ([#699](https://github.com/elastic/terraform-provider-elasticstack/pull/699)) - Add `elasticstack_kibana_spaces` data source ([#682](https://github.com/elastic/terraform-provider-elasticstack/pull/682)) @@ -319,7 +320,8 @@ - Initial set of docs - CI integration -[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.5...HEAD +[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.6...HEAD +[0.11.6]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.5...v0.11.6 [0.11.5]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.4...v0.11.5 [0.11.4]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.3...v0.11.4 [0.11.3]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.2...v0.11.3 diff --git a/Makefile b/Makefile index 32ca0af18..6cace2caa 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/bash -VERSION ?= 0.11.5 +VERSION ?= 0.11.6 NAME = elasticstack BINARY = terraform-provider-${NAME} From ffa5f172778016cf8f6d955be216b50adad1bb52 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 22 Aug 2024 10:07:31 +0100 Subject: [PATCH 4/4] Add support for the `alert_delay` param in the Create Rule API (#715) * Initial commit. * Small change * Fix docs. * Add version check * Updated tests * more tests and version checks * Improve error message. Co-authored-by: Toby Brain * Update version check Co-authored-by: Toby Brain * PR comments * Changelog * Final changes --------- Co-authored-by: Toby Brain --- CHANGELOG.md | 9 +- Makefile | 1 + docs/resources/kibana_alerting_rule.md | 1 + generated/alerting/.openapi-generator/FILES | 41 +- generated/alerting/README.md | 199 +- generated/alerting/api/openapi.yaml | 3507 ++++++++++------- generated/alerting/api_alerting.go | 619 ++- generated/alerting/api_alerting_mocks.go | 121 +- generated/alerting/bundled.yaml | 1906 ++++++--- generated/alerting/client.go | 4 +- generated/alerting/configuration.go | 165 +- generated/alerting/docs/ActionsInner.md | 71 +- .../alerting/docs/ActionsInnerAlertsFilter.md | 82 + .../docs/ActionsInnerAlertsFilterQuery.md | 82 + .../docs/ActionsInnerAlertsFilterTimeframe.md | 108 + .../ActionsInnerAlertsFilterTimeframeHours.md | 82 + .../alerting/docs/ActionsInnerFrequency.md | 12 +- generated/alerting/docs/AlertDelay.md | 51 + .../alerting/docs/AlertResponseProperties.md | 10 - generated/alerting/docs/AlertingApi.md | 441 ++- generated/alerting/docs/CreateRuleRequest.md | 42 +- generated/alerting/docs/FieldmapProperties.md | 300 ++ .../docs/FieldmapPropertiesPropertiesValue.md | 56 + generated/alerting/docs/Filter.md | 108 + generated/alerting/docs/FilterMeta.md | 352 ++ .../docs/FindRulesHasReferenceParameter.md | 24 +- .../docs/GetAlertingHealth200Response.md | 26 - .../docs/GetRuleTypes200ResponseInner.md | 106 +- ...eTypes200ResponseInnerActionGroupsInner.md | 24 +- ...uleTypes200ResponseInnerActionVariables.md | 8 +- ...esponseInnerActionVariablesContextInner.md | 24 +- ...ResponseInnerActionVariablesParamsInner.md | 24 +- ...0ResponseInnerActionVariablesStateInner.md | 82 + .../GetRuleTypes200ResponseInnerAlerts.md | 238 ++ ...RuleTypes200ResponseInnerAlertsMappings.md | 66 + ...ypes200ResponseInnerAuthorizedConsumers.md | 26 + ...ypes200ResponseInnerRecoveryActionGroup.md | 24 +- .../LegacyCreateAlertRequestProperties.md | 12 +- .../LegacyFindAlertsHasReferenceParameter.md | 82 + .../LegacyGetAlertTypes200ResponseInner.md | 8 +- ...tTypes200ResponseInnerActionGroupsInner.md | 82 + ...ertTypes200ResponseInnerActionVariables.md | 44 +- ...ypes200ResponseInnerRecoveryActionGroup.md | 24 +- .../LegacyUpdateAlertRequestProperties.md | 8 +- generated/alerting/docs/Model400Response.md | 93 + generated/alerting/docs/NotifyWhenAction.md | 15 + .../alerting/docs/RuleResponseProperties.md | 116 +- .../docs/RuleResponsePropertiesLastRun.md | 36 +- generated/alerting/docs/UpdateRuleRequest.md | 34 +- generated/alerting/model_400_response.go | 169 + generated/alerting/model_401_response.go | 2 +- generated/alerting/model_404_response.go | 2 +- generated/alerting/model_actions_inner.go | 164 +- .../model_actions_inner_alerts_filter.go | 160 + ...model_actions_inner_alerts_filter_query.go | 161 + ...l_actions_inner_alerts_filter_timeframe.go | 197 + ...ons_inner_alerts_filter_timeframe_hours.go | 162 + .../alerting/model_actions_inner_frequency.go | 6 +- generated/alerting/model_alert_delay.go | 116 + .../model_alert_response_properties.go | 11 +- ...rt_response_properties_execution_status.go | 2 +- ...odel_alert_response_properties_schedule.go | 2 +- .../alerting/model_create_rule_request.go | 64 +- .../alerting/model_fieldmap_properties.go | 459 +++ ...el_fieldmap_properties_properties_value.go | 125 + generated/alerting/model_filter.go | 196 + generated/alerting/model_filter_meta.go | 531 +++ .../alerting/model_find_rules_200_response.go | 2 +- ...odel_find_rules_has_reference_parameter.go | 68 +- .../model_get_alerting_health_200_response.go | 42 +- ..._200_response_alerting_framework_health.go | 2 +- ...ting_framework_health_decryption_health.go | 2 +- ...rting_framework_health_execution_health.go | 2 +- ...e_alerting_framework_health_read_health.go | 2 +- ...model_get_rule_types_200_response_inner.go | 149 +- ..._200_response_inner_action_groups_inner.go | 68 +- ...pes_200_response_inner_action_variables.go | 14 +- ...se_inner_action_variables_context_inner.go | 70 +- ...nse_inner_action_variables_params_inner.go | 68 +- ...onse_inner_action_variables_state_inner.go | 160 + ...et_rule_types_200_response_inner_alerts.go | 387 ++ ...ypes_200_response_inner_alerts_mappings.go | 126 + ...200_response_inner_authorized_consumers.go | 38 +- ...ponse_inner_authorized_consumers_alerts.go | 2 +- ...00_response_inner_recovery_action_group.go | 68 +- ..._legacy_create_alert_request_properties.go | 17 +- .../model_legacy_find_alerts_200_response.go | 2 +- ...acy_find_alerts_has_reference_parameter.go | 160 + ...gacy_get_alert_types_200_response_inner.go | 17 +- ..._200_response_inner_action_groups_inner.go | 160 + ...pes_200_response_inner_action_variables.go | 60 +- ...00_response_inner_recovery_action_group.go | 68 +- ...legacy_get_alerting_health_200_response.go | 2 +- ..._200_response_alerting_framework_health.go | 2 +- ...ting_framework_health_decryption_health.go | 2 +- ...rting_framework_health_execution_health.go | 2 +- ...e_alerting_framework_health_read_health.go | 2 +- ..._legacy_update_alert_request_properties.go | 15 +- ..._alert_request_properties_actions_inner.go | 2 +- ...pdate_alert_request_properties_schedule.go | 2 +- generated/alerting/model_notify_when.go | 4 +- .../model_rule_response_properties.go | 184 +- ...le_response_properties_execution_status.go | 2 +- ...model_rule_response_properties_last_run.go | 77 +- ...sponse_properties_last_run_alerts_count.go | 2 +- generated/alerting/model_schedule.go | 2 +- .../alerting/model_update_rule_request.go | 64 +- generated/alerting/response.go | 2 +- generated/alerting/utils.go | 2 +- internal/clients/kibana/alerting.go | 54 +- internal/clients/kibana/alerting_test.go | 28 +- internal/kibana/alerting.go | 44 +- internal/kibana/alerting_test.go | 98 + internal/models/alert_rule.go | 3 +- 114 files changed, 11413 insertions(+), 3061 deletions(-) create mode 100644 generated/alerting/docs/ActionsInnerAlertsFilter.md create mode 100644 generated/alerting/docs/ActionsInnerAlertsFilterQuery.md create mode 100644 generated/alerting/docs/ActionsInnerAlertsFilterTimeframe.md create mode 100644 generated/alerting/docs/ActionsInnerAlertsFilterTimeframeHours.md create mode 100644 generated/alerting/docs/AlertDelay.md create mode 100644 generated/alerting/docs/FieldmapProperties.md create mode 100644 generated/alerting/docs/FieldmapPropertiesPropertiesValue.md create mode 100644 generated/alerting/docs/Filter.md create mode 100644 generated/alerting/docs/FilterMeta.md create mode 100644 generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md create mode 100644 generated/alerting/docs/GetRuleTypes200ResponseInnerAlerts.md create mode 100644 generated/alerting/docs/GetRuleTypes200ResponseInnerAlertsMappings.md create mode 100644 generated/alerting/docs/LegacyFindAlertsHasReferenceParameter.md create mode 100644 generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md create mode 100644 generated/alerting/docs/Model400Response.md create mode 100644 generated/alerting/docs/NotifyWhenAction.md create mode 100644 generated/alerting/model_400_response.go create mode 100644 generated/alerting/model_actions_inner_alerts_filter.go create mode 100644 generated/alerting/model_actions_inner_alerts_filter_query.go create mode 100644 generated/alerting/model_actions_inner_alerts_filter_timeframe.go create mode 100644 generated/alerting/model_actions_inner_alerts_filter_timeframe_hours.go create mode 100644 generated/alerting/model_alert_delay.go create mode 100644 generated/alerting/model_fieldmap_properties.go create mode 100644 generated/alerting/model_fieldmap_properties_properties_value.go create mode 100644 generated/alerting/model_filter.go create mode 100644 generated/alerting/model_filter_meta.go create mode 100644 generated/alerting/model_get_rule_types_200_response_inner_action_variables_state_inner.go create mode 100644 generated/alerting/model_get_rule_types_200_response_inner_alerts.go create mode 100644 generated/alerting/model_get_rule_types_200_response_inner_alerts_mappings.go create mode 100644 generated/alerting/model_legacy_find_alerts_has_reference_parameter.go create mode 100644 generated/alerting/model_legacy_get_alert_types_200_response_inner_action_groups_inner.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ec27bcdd..a8ec9806d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## [Unreleased] +- Add the `alert_delay` field to the Create Rule API ([#715](https://github.com/elastic/terraform-provider-elasticstack/pull/715)) + ## [0.11.6] - 2024-08-20 + - Improve validation for index settings and mappings ([#719](https://github.com/elastic/terraform-provider-elasticstack/pull/719)) - Add support for Kibana synthetics http and tcp monitors ([#699](https://github.com/elastic/terraform-provider-elasticstack/pull/699)) - Add `elasticstack_kibana_spaces` data source ([#682](https://github.com/elastic/terraform-provider-elasticstack/pull/682)) @@ -16,6 +19,7 @@ ## [0.11.4] - 2024-06-13 ### Breaking changes + - The `title` attribute is now required in the elasticstack_kibana_data_view resource. In practice the resource didn't work without this set, the schema now enforces it's correctly configured. ### Fixed @@ -40,7 +44,7 @@ ### Added -- Added datasource for alerting connectors. ([#607](https://github.com/elastic/terraform-provider-elasticstack/pull/607)) +- Added datasource for alerting connectors. ([#607](https://github.com/elastic/terraform-provider-elasticstack/pull/607)) ## [0.11.2] - 2024-03-13 @@ -152,6 +156,7 @@ - Add 'min\_\*' conditions to ILM rollover ([#250](https://github.com/elastic/terraform-provider-elasticstack/pull/250)) - Add support for Kibana connections ([#226](https://github.com/elastic/terraform-provider-elasticstack/pull/226)) - **[Breaking Change] Add 'deletion_protection' field to index resource** to avoid unintentional deletion. ([#167](https://github.com/elastic/terraform-provider-elasticstack/pull/167)) + - To delete index resource, you'll need to explicitly set `deletion_protection = false` as follows. ```terraform @@ -186,6 +191,7 @@ - Correctly handle empty logstash pipeline metadata in plan diffs ([#256](https://github.com/elastic/terraform-provider-elasticstack/pull/256)) - Fix error when logging API requests in debug mode ([#259](https://github.com/elastic/terraform-provider-elasticstack/pull/259)) - **[Breaking Change] Change `pipeline_metadata` type from schema.TypeMap to schema.TypeString**. This is to fix an error caused by updates to Logstash Pipelines outside of TF ([#278](https://github.com/elastic/terraform-provider-elasticstack/issues/278)) + - To use the updated `pipeline_metadata` field, you'll need to encapsulate any Terraform configuration with **jsonencode{}** as follows: ```terraform @@ -211,6 +217,7 @@ - run `terraform apply` - OR - reimport the resources into state using `terraform import` () + - Fix order of `indices` field in SLM ([#326](https://github.com/elastic/terraform-provider-elasticstack/pull/326)) ## [0.5.0] - 2022-12-07 diff --git a/Makefile b/Makefile index 6cace2caa..8bc3eeb3b 100644 --- a/Makefile +++ b/Makefile @@ -216,6 +216,7 @@ tools: $(GOBIN) ## Install useful tools for linting, docs generation and develop @ cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint @ cd tools && go install github.com/goreleaser/goreleaser @ cd tools && go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen + @ cd tools && go install go.uber.org/mock/mockgen .PHONY: misspell misspell: diff --git a/docs/resources/kibana_alerting_rule.md b/docs/resources/kibana_alerting_rule.md index 66dcb1aa6..496ad077d 100644 --- a/docs/resources/kibana_alerting_rule.md +++ b/docs/resources/kibana_alerting_rule.md @@ -62,6 +62,7 @@ Could not create API key - Unsupported scheme "ApiKey" for granting API Key ### Optional - `actions` (Block List) An action that runs under defined conditions. (see [below for nested schema](#nestedblock--actions)) +- `alert_delay` (Number) A number that indicates how many consecutive runs need to meet the rule conditions for an alert to occur. - `enabled` (Boolean) Indicates if you want to run the rule on an interval basis. - `rule_id` (String) A UUID v1 or v4 to use instead of a randomly generated ID. - `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used. diff --git a/generated/alerting/.openapi-generator/FILES b/generated/alerting/.openapi-generator/FILES index 07ea4bbb3..33e02dee5 100644 --- a/generated/alerting/.openapi-generator/FILES +++ b/generated/alerting/.openapi-generator/FILES @@ -6,36 +6,45 @@ api_alerting.go client.go configuration.go docs/ActionsInner.md +docs/ActionsInnerAlertsFilter.md +docs/ActionsInnerAlertsFilterQuery.md +docs/ActionsInnerAlertsFilterTimeframe.md +docs/ActionsInnerAlertsFilterTimeframeHours.md docs/ActionsInnerFrequency.md +docs/AlertDelay.md docs/AlertResponseProperties.md docs/AlertResponsePropertiesExecutionStatus.md docs/AlertResponsePropertiesSchedule.md docs/AlertingAPI.md docs/CreateRuleRequest.md +docs/FieldmapProperties.md +docs/FieldmapPropertiesPropertiesValue.md +docs/Filter.md +docs/FilterMeta.md docs/FindRules200Response.md docs/FindRulesHasReferenceParameter.md -docs/FindRulesSearchFieldsParameter.md docs/GetAlertingHealth200Response.md docs/GetAlertingHealth200ResponseAlertingFrameworkHealth.md docs/GetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth.md docs/GetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth.md docs/GetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md -docs/GetAlertingHealth200ResponseAlertingFrameworkHeath.md -docs/GetAlertingHealth200ResponseAlertingFrameworkHeathDecryptionHealth.md docs/GetRuleTypes200ResponseInner.md docs/GetRuleTypes200ResponseInnerActionGroupsInner.md docs/GetRuleTypes200ResponseInnerActionVariables.md docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md +docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md +docs/GetRuleTypes200ResponseInnerAlerts.md +docs/GetRuleTypes200ResponseInnerAlertsMappings.md docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md docs/GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md docs/LegacyCreateAlertRequestProperties.md -docs/LegacyCreateAlertRequestPropertiesSchedule.md docs/LegacyFindAlerts200Response.md +docs/LegacyFindAlertsHasReferenceParameter.md docs/LegacyGetAlertTypes200ResponseInner.md +docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md -docs/LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner.md docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md docs/LegacyGetAlertingHealth200Response.md docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealth.md @@ -45,6 +54,7 @@ docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md docs/LegacyUpdateAlertRequestProperties.md docs/LegacyUpdateAlertRequestPropertiesActionsInner.md docs/LegacyUpdateAlertRequestPropertiesSchedule.md +docs/Model400Response.md docs/Model401Response.md docs/Model404Response.md docs/NotifyWhen.md @@ -57,38 +67,48 @@ docs/UpdateRuleRequest.md git_push.sh go.mod go.sum +model_400_response.go model_401_response.go model_404_response.go model_actions_inner.go +model_actions_inner_alerts_filter.go +model_actions_inner_alerts_filter_query.go +model_actions_inner_alerts_filter_timeframe.go +model_actions_inner_alerts_filter_timeframe_hours.go model_actions_inner_frequency.go +model_alert_delay.go model_alert_response_properties.go model_alert_response_properties_execution_status.go model_alert_response_properties_schedule.go model_create_rule_request.go +model_fieldmap_properties.go +model_fieldmap_properties_properties_value.go +model_filter.go +model_filter_meta.go model_find_rules_200_response.go model_find_rules_has_reference_parameter.go -model_find_rules_search_fields_parameter.go model_get_alerting_health_200_response.go model_get_alerting_health_200_response_alerting_framework_health.go model_get_alerting_health_200_response_alerting_framework_health_decryption_health.go model_get_alerting_health_200_response_alerting_framework_health_execution_health.go model_get_alerting_health_200_response_alerting_framework_health_read_health.go -model_get_alerting_health_200_response_alerting_framework_heath.go -model_get_alerting_health_200_response_alerting_framework_heath_decryption_health.go model_get_rule_types_200_response_inner.go model_get_rule_types_200_response_inner_action_groups_inner.go model_get_rule_types_200_response_inner_action_variables.go model_get_rule_types_200_response_inner_action_variables_context_inner.go model_get_rule_types_200_response_inner_action_variables_params_inner.go +model_get_rule_types_200_response_inner_action_variables_state_inner.go +model_get_rule_types_200_response_inner_alerts.go +model_get_rule_types_200_response_inner_alerts_mappings.go model_get_rule_types_200_response_inner_authorized_consumers.go model_get_rule_types_200_response_inner_authorized_consumers_alerts.go model_get_rule_types_200_response_inner_recovery_action_group.go model_legacy_create_alert_request_properties.go -model_legacy_create_alert_request_properties_schedule.go model_legacy_find_alerts_200_response.go +model_legacy_find_alerts_has_reference_parameter.go model_legacy_get_alert_types_200_response_inner.go +model_legacy_get_alert_types_200_response_inner_action_groups_inner.go model_legacy_get_alert_types_200_response_inner_action_variables.go -model_legacy_get_alert_types_200_response_inner_action_variables_context_inner.go model_legacy_get_alert_types_200_response_inner_recovery_action_group.go model_legacy_get_alerting_health_200_response.go model_legacy_get_alerting_health_200_response_alerting_framework_health.go @@ -99,6 +119,7 @@ model_legacy_update_alert_request_properties.go model_legacy_update_alert_request_properties_actions_inner.go model_legacy_update_alert_request_properties_schedule.go model_notify_when.go +model_notify_when_action.go model_rule_response_properties.go model_rule_response_properties_execution_status.go model_rule_response_properties_last_run.go diff --git a/generated/alerting/README.md b/generated/alerting/README.md index 2688d437c..434adaeee 100644 --- a/generated/alerting/README.md +++ b/generated/alerting/README.md @@ -3,9 +3,10 @@ OpenAPI schema for alerting endpoints ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 0.1 +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 0.2 - Package version: 1.0.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -73,94 +74,104 @@ ctx = context.WithValue(context.Background(), alerting.ContextOperationServerVar ## Documentation for API Endpoints -All URIs are relative to *http://localhost:5601* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AlertingAPI* | [**CreateRule**](docs/AlertingAPI.md#createrule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId} | Creates a rule. -*AlertingAPI* | [**DeleteRule**](docs/AlertingAPI.md#deleterule) | **Delete** /s/{spaceId}/api/alerting/rule/{ruleId} | Deletes a rule. -*AlertingAPI* | [**DisableRule**](docs/AlertingAPI.md#disablerule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_disable | Disables a rule. -*AlertingAPI* | [**EnableRule**](docs/AlertingAPI.md#enablerule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_enable | Enables a rule. -*AlertingAPI* | [**FindRules**](docs/AlertingAPI.md#findrules) | **Get** /s/{spaceId}/api/alerting/rules/_find | Retrieves information about rules. -*AlertingAPI* | [**GetAlertingHealth**](docs/AlertingAPI.md#getalertinghealth) | **Get** /s/{spaceId}/api/alerting/_health | Retrieves the health status of the alerting framework. -*AlertingAPI* | [**GetRule**](docs/AlertingAPI.md#getrule) | **Get** /s/{spaceId}/api/alerting/rule/{ruleId} | Retrieves a rule by its identifier. -*AlertingAPI* | [**GetRuleTypes**](docs/AlertingAPI.md#getruletypes) | **Get** /s/{spaceId}/api/alerting/rule_types | Retrieves a list of rule types. -*AlertingAPI* | [**LegacyCreateAlert**](docs/AlertingAPI.md#legacycreatealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId} | Create an alert. -*AlertingAPI* | [**LegacyDisableAlert**](docs/AlertingAPI.md#legacydisablealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/_disable | Disables an alert. -*AlertingAPI* | [**LegacyEnableAlert**](docs/AlertingAPI.md#legacyenablealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/_enable | Enables an alert. -*AlertingAPI* | [**LegacyFindAlerts**](docs/AlertingAPI.md#legacyfindalerts) | **Get** /s/{spaceId}/api/alerts/alerts/_find | Retrieves a paginated set of alerts. -*AlertingAPI* | [**LegacyGetAlert**](docs/AlertingAPI.md#legacygetalert) | **Get** /s/{spaceId}/api/alerts/alert/{alertId} | Retrieves an alert by its identifier. -*AlertingAPI* | [**LegacyGetAlertTypes**](docs/AlertingAPI.md#legacygetalerttypes) | **Get** /s/{spaceId}/api/alerts/alerts/list_alert_types | Retrieves a list of alert types. -*AlertingAPI* | [**LegacyGetAlertingHealth**](docs/AlertingAPI.md#legacygetalertinghealth) | **Get** /s/{spaceId}/api/alerts/alerts/_health | Retrieves the health status of the alerting framework. -*AlertingAPI* | [**LegacyMuteAlertInstance**](docs/AlertingAPI.md#legacymutealertinstance) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute | Mutes an alert instance. -*AlertingAPI* | [**LegacyMuteAllAlertInstances**](docs/AlertingAPI.md#legacymuteallalertinstances) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/_mute_all | Mutes all alert instances. -*AlertingAPI* | [**LegacyUnmuteAlertInstance**](docs/AlertingAPI.md#legacyunmutealertinstance) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute | Unmutes an alert instance. -*AlertingAPI* | [**LegacyUnmuteAllAlertInstances**](docs/AlertingAPI.md#legacyunmuteallalertinstances) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/_unmute_all | Unmutes all alert instances. -*AlertingAPI* | [**LegacyUpdateAlert**](docs/AlertingAPI.md#legacyupdatealert) | **Put** /s/{spaceId}/api/alerts/alert/{alertId} | Updates the attributes for an alert. -*AlertingAPI* | [**LegaryDeleteAlert**](docs/AlertingAPI.md#legarydeletealert) | **Delete** /s/{spaceId}/api/alerts/alert/{alertId} | Permanently removes an alert. -*AlertingAPI* | [**MuteAlert**](docs/AlertingAPI.md#mutealert) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_mute | Mutes an alert. -*AlertingAPI* | [**MuteAllAlerts**](docs/AlertingAPI.md#muteallalerts) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_mute_all | Mutes all alerts. -*AlertingAPI* | [**UnmuteAlert**](docs/AlertingAPI.md#unmutealert) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute | Unmutes an alert. -*AlertingAPI* | [**UnmuteAllAlerts**](docs/AlertingAPI.md#unmuteallalerts) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all | Unmutes all alerts. -*AlertingAPI* | [**UpdateRule**](docs/AlertingAPI.md#updaterule) | **Put** /s/{spaceId}/api/alerting/rule/{ruleId} | Updates the attributes for a rule. - +All URIs are relative to _http://localhost_ + +| Class | Method | HTTP request | Description | +| ------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------- | +| _AlertingAPI_ | [**CreateRule**](docs/AlertingAPI.md#createrule) | **Post** /s/{spaceId}/api/alerting/rule | Creates a rule with a randomly generated rule identifier. | +| _AlertingAPI_ | [**CreateRuleId**](docs/AlertingAPI.md#createruleid) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId} | Creates a rule with a specific rule identifier. | +| _AlertingAPI_ | [**DeleteRule**](docs/AlertingAPI.md#deleterule) | **Delete** /s/{spaceId}/api/alerting/rule/{ruleId} | Deletes a rule. | +| _AlertingAPI_ | [**DisableRule**](docs/AlertingAPI.md#disablerule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/\_disable | Disables a rule. | +| _AlertingAPI_ | [**EnableRule**](docs/AlertingAPI.md#enablerule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/\_enable | Enables a rule. | +| _AlertingAPI_ | [**FindRules**](docs/AlertingAPI.md#findrules) | **Get** /s/{spaceId}/api/alerting/rules/\_find | Retrieves information about rules. | +| _AlertingAPI_ | [**GetAlertingHealth**](docs/AlertingAPI.md#getalertinghealth) | **Get** /s/{spaceId}/api/alerting/\_health | Retrieves the health status of the alerting framework. | +| _AlertingAPI_ | [**GetRule**](docs/AlertingAPI.md#getrule) | **Get** /s/{spaceId}/api/alerting/rule/{ruleId} | Retrieves a rule by its identifier. | +| _AlertingAPI_ | [**GetRuleTypes**](docs/AlertingAPI.md#getruletypes) | **Get** /s/{spaceId}/api/alerting/rule_types | Retrieves a list of rule types. | +| _AlertingAPI_ | [**LegacyCreateAlert**](docs/AlertingAPI.md#legacycreatealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId} | Create an alert. | +| _AlertingAPI_ | [**LegacyDisableAlert**](docs/AlertingAPI.md#legacydisablealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/\_disable | Disables an alert. | +| _AlertingAPI_ | [**LegacyEnableAlert**](docs/AlertingAPI.md#legacyenablealert) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/\_enable | Enables an alert. | +| _AlertingAPI_ | [**LegacyFindAlerts**](docs/AlertingAPI.md#legacyfindalerts) | **Get** /s/{spaceId}/api/alerts/alerts/\_find | Retrieves a paginated set of alerts. | +| _AlertingAPI_ | [**LegacyGetAlert**](docs/AlertingAPI.md#legacygetalert) | **Get** /s/{spaceId}/api/alerts/alert/{alertId} | Retrieves an alert by its identifier. | +| _AlertingAPI_ | [**LegacyGetAlertTypes**](docs/AlertingAPI.md#legacygetalerttypes) | **Get** /s/{spaceId}/api/alerts/alerts/list_alert_types | Retrieves a list of alert types. | +| _AlertingAPI_ | [**LegacyGetAlertingHealth**](docs/AlertingAPI.md#legacygetalertinghealth) | **Get** /s/{spaceId}/api/alerts/alerts/\_health | Retrieves the health status of the alerting framework. | +| _AlertingAPI_ | [**LegacyMuteAlertInstance**](docs/AlertingAPI.md#legacymutealertinstance) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/\_mute | Mutes an alert instance. | +| _AlertingAPI_ | [**LegacyMuteAllAlertInstances**](docs/AlertingAPI.md#legacymuteallalertinstances) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/\_mute_all | Mutes all alert instances. | +| _AlertingAPI_ | [**LegacyUnmuteAlertInstance**](docs/AlertingAPI.md#legacyunmutealertinstance) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/\_unmute | Unmutes an alert instance. | +| _AlertingAPI_ | [**LegacyUnmuteAllAlertInstances**](docs/AlertingAPI.md#legacyunmuteallalertinstances) | **Post** /s/{spaceId}/api/alerts/alert/{alertId}/\_unmute_all | Unmutes all alert instances. | +| _AlertingAPI_ | [**LegacyUpdateAlert**](docs/AlertingAPI.md#legacyupdatealert) | **Put** /s/{spaceId}/api/alerts/alert/{alertId} | Updates the attributes for an alert. | +| _AlertingAPI_ | [**LegaryDeleteAlert**](docs/AlertingAPI.md#legarydeletealert) | **Delete** /s/{spaceId}/api/alerts/alert/{alertId} | Permanently removes an alert. | +| _AlertingAPI_ | [**MuteAlert**](docs/AlertingAPI.md#mutealert) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/\_mute | Mutes an alert. | +| _AlertingAPI_ | [**MuteAllAlerts**](docs/AlertingAPI.md#muteallalerts) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/\_mute_all | Mutes all alerts. | +| _AlertingAPI_ | [**UnmuteAlert**](docs/AlertingAPI.md#unmutealert) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/\_unmute | Unmutes an alert. | +| _AlertingAPI_ | [**UnmuteAllAlerts**](docs/AlertingAPI.md#unmuteallalerts) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/\_unmute_all | Unmutes all alerts. | +| _AlertingAPI_ | [**UpdateRule**](docs/AlertingAPI.md#updaterule) | **Put** /s/{spaceId}/api/alerting/rule/{ruleId} | Updates the attributes for a rule. | +| _AlertingAPI_ | [**UpdateRuleAPIKey**](docs/AlertingAPI.md#updateruleapikey) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/\_update_api_key | Updates the API key for a rule. | ## Documentation For Models - - [ActionsInner](docs/ActionsInner.md) - - [ActionsInnerFrequency](docs/ActionsInnerFrequency.md) - - [AlertResponseProperties](docs/AlertResponseProperties.md) - - [AlertResponsePropertiesExecutionStatus](docs/AlertResponsePropertiesExecutionStatus.md) - - [AlertResponsePropertiesSchedule](docs/AlertResponsePropertiesSchedule.md) - - [CreateRuleRequest](docs/CreateRuleRequest.md) - - [FindRules200Response](docs/FindRules200Response.md) - - [FindRulesHasReferenceParameter](docs/FindRulesHasReferenceParameter.md) - - [FindRulesSearchFieldsParameter](docs/FindRulesSearchFieldsParameter.md) - - [GetAlertingHealth200Response](docs/GetAlertingHealth200Response.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealth.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHeath](docs/GetAlertingHealth200ResponseAlertingFrameworkHeath.md) - - [GetAlertingHealth200ResponseAlertingFrameworkHeathDecryptionHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHeathDecryptionHealth.md) - - [GetRuleTypes200ResponseInner](docs/GetRuleTypes200ResponseInner.md) - - [GetRuleTypes200ResponseInnerActionGroupsInner](docs/GetRuleTypes200ResponseInnerActionGroupsInner.md) - - [GetRuleTypes200ResponseInnerActionVariables](docs/GetRuleTypes200ResponseInnerActionVariables.md) - - [GetRuleTypes200ResponseInnerActionVariablesContextInner](docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md) - - [GetRuleTypes200ResponseInnerActionVariablesParamsInner](docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) - - [GetRuleTypes200ResponseInnerAuthorizedConsumers](docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md) - - [GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts](docs/GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) - - [GetRuleTypes200ResponseInnerRecoveryActionGroup](docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md) - - [LegacyCreateAlertRequestProperties](docs/LegacyCreateAlertRequestProperties.md) - - [LegacyCreateAlertRequestPropertiesSchedule](docs/LegacyCreateAlertRequestPropertiesSchedule.md) - - [LegacyFindAlerts200Response](docs/LegacyFindAlerts200Response.md) - - [LegacyGetAlertTypes200ResponseInner](docs/LegacyGetAlertTypes200ResponseInner.md) - - [LegacyGetAlertTypes200ResponseInnerActionVariables](docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md) - - [LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner](docs/LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner.md) - - [LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup](docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md) - - [LegacyGetAlertingHealth200Response](docs/LegacyGetAlertingHealth200Response.md) - - [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealth.md) - - [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth.md) - - [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth.md) - - [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md) - - [LegacyUpdateAlertRequestProperties](docs/LegacyUpdateAlertRequestProperties.md) - - [LegacyUpdateAlertRequestPropertiesActionsInner](docs/LegacyUpdateAlertRequestPropertiesActionsInner.md) - - [LegacyUpdateAlertRequestPropertiesSchedule](docs/LegacyUpdateAlertRequestPropertiesSchedule.md) - - [Model401Response](docs/Model401Response.md) - - [Model404Response](docs/Model404Response.md) - - [NotifyWhen](docs/NotifyWhen.md) - - [RuleResponseProperties](docs/RuleResponseProperties.md) - - [RuleResponsePropertiesExecutionStatus](docs/RuleResponsePropertiesExecutionStatus.md) - - [RuleResponsePropertiesLastRun](docs/RuleResponsePropertiesLastRun.md) - - [RuleResponsePropertiesLastRunAlertsCount](docs/RuleResponsePropertiesLastRunAlertsCount.md) - - [Schedule](docs/Schedule.md) - - [UpdateRuleRequest](docs/UpdateRuleRequest.md) - +- [ActionsInner](docs/ActionsInner.md) +- [ActionsInnerAlertsFilter](docs/ActionsInnerAlertsFilter.md) +- [ActionsInnerAlertsFilterQuery](docs/ActionsInnerAlertsFilterQuery.md) +- [ActionsInnerAlertsFilterTimeframe](docs/ActionsInnerAlertsFilterTimeframe.md) +- [ActionsInnerAlertsFilterTimeframeHours](docs/ActionsInnerAlertsFilterTimeframeHours.md) +- [ActionsInnerFrequency](docs/ActionsInnerFrequency.md) +- [AlertDelay](docs/AlertDelay.md) +- [AlertResponseProperties](docs/AlertResponseProperties.md) +- [AlertResponsePropertiesExecutionStatus](docs/AlertResponsePropertiesExecutionStatus.md) +- [AlertResponsePropertiesSchedule](docs/AlertResponsePropertiesSchedule.md) +- [CreateRuleRequest](docs/CreateRuleRequest.md) +- [FieldmapProperties](docs/FieldmapProperties.md) +- [FieldmapPropertiesPropertiesValue](docs/FieldmapPropertiesPropertiesValue.md) +- [Filter](docs/Filter.md) +- [FilterMeta](docs/FilterMeta.md) +- [FindRules200Response](docs/FindRules200Response.md) +- [FindRulesHasReferenceParameter](docs/FindRulesHasReferenceParameter.md) +- [GetAlertingHealth200Response](docs/GetAlertingHealth200Response.md) +- [GetAlertingHealth200ResponseAlertingFrameworkHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealth.md) +- [GetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth.md) +- [GetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth.md) +- [GetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth](docs/GetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md) +- [GetRuleTypes200ResponseInner](docs/GetRuleTypes200ResponseInner.md) +- [GetRuleTypes200ResponseInnerActionGroupsInner](docs/GetRuleTypes200ResponseInnerActionGroupsInner.md) +- [GetRuleTypes200ResponseInnerActionVariables](docs/GetRuleTypes200ResponseInnerActionVariables.md) +- [GetRuleTypes200ResponseInnerActionVariablesContextInner](docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md) +- [GetRuleTypes200ResponseInnerActionVariablesParamsInner](docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) +- [GetRuleTypes200ResponseInnerActionVariablesStateInner](docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md) +- [GetRuleTypes200ResponseInnerAlerts](docs/GetRuleTypes200ResponseInnerAlerts.md) +- [GetRuleTypes200ResponseInnerAlertsMappings](docs/GetRuleTypes200ResponseInnerAlertsMappings.md) +- [GetRuleTypes200ResponseInnerAuthorizedConsumers](docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md) +- [GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts](docs/GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) +- [GetRuleTypes200ResponseInnerRecoveryActionGroup](docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md) +- [LegacyCreateAlertRequestProperties](docs/LegacyCreateAlertRequestProperties.md) +- [LegacyFindAlerts200Response](docs/LegacyFindAlerts200Response.md) +- [LegacyFindAlertsHasReferenceParameter](docs/LegacyFindAlertsHasReferenceParameter.md) +- [LegacyGetAlertTypes200ResponseInner](docs/LegacyGetAlertTypes200ResponseInner.md) +- [LegacyGetAlertTypes200ResponseInnerActionGroupsInner](docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md) +- [LegacyGetAlertTypes200ResponseInnerActionVariables](docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md) +- [LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup](docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md) +- [LegacyGetAlertingHealth200Response](docs/LegacyGetAlertingHealth200Response.md) +- [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealth.md) +- [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthDecryptionHealth.md) +- [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthExecutionHealth.md) +- [LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth](docs/LegacyGetAlertingHealth200ResponseAlertingFrameworkHealthReadHealth.md) +- [LegacyUpdateAlertRequestProperties](docs/LegacyUpdateAlertRequestProperties.md) +- [LegacyUpdateAlertRequestPropertiesActionsInner](docs/LegacyUpdateAlertRequestPropertiesActionsInner.md) +- [LegacyUpdateAlertRequestPropertiesSchedule](docs/LegacyUpdateAlertRequestPropertiesSchedule.md) +- [Model400Response](docs/Model400Response.md) +- [Model401Response](docs/Model401Response.md) +- [Model404Response](docs/Model404Response.md) +- [NotifyWhen](docs/NotifyWhen.md) +- [RuleResponseProperties](docs/RuleResponseProperties.md) +- [RuleResponsePropertiesExecutionStatus](docs/RuleResponsePropertiesExecutionStatus.md) +- [RuleResponsePropertiesLastRun](docs/RuleResponsePropertiesLastRun.md) +- [RuleResponsePropertiesLastRunAlertsCount](docs/RuleResponsePropertiesLastRunAlertsCount.md) +- [Schedule](docs/Schedule.md) +- [UpdateRuleRequest](docs/UpdateRuleRequest.md) ## Documentation For Authorization - Authentication schemes defined for the API: + ### basicAuth - **Type**: HTTP basic authentication @@ -196,24 +207,20 @@ auth := context.WithValue( r, err := client.Service.Operation(auth, args) ``` - ## Documentation for Utility Methods Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it: -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` +- `PtrBool` +- `PtrInt` +- `PtrInt32` +- `PtrInt64` +- `PtrFloat` +- `PtrFloat32` +- `PtrFloat64` +- `PtrString` +- `PtrTime` ## Author - - - diff --git a/generated/alerting/api/openapi.yaml b/generated/alerting/api/openapi.yaml index 653895aae..81becda9d 100644 --- a/generated/alerting/api/openapi.yaml +++ b/generated/alerting/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.1.0 info: contact: name: Alerting Team @@ -7,10 +7,9 @@ info: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license title: Alerting - version: "0.1" + version: "0.2" servers: -- description: local - url: http://localhost:5601 +- url: / security: - basicAuth: [] - apiKeyAuth: [] @@ -18,39 +17,73 @@ tags: - description: Alerting APIs enable you to create and manage rules and alerts. name: alerting paths: + /s/{spaceId}/api/alerting/rule: + post: + description: | + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + operationId: createRule + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + examples: + createEsQueryEsqlRuleRequest: + $ref: '#/components/examples/create_es_query_esql_rule_request' + createEsQueryRuleRequest: + $ref: '#/components/examples/create_es_query_rule_request' + createEsQueryKqlRuleRequest: + $ref: '#/components/examples/create_es_query_kql_rule_request' + createIndexThresholdRuleRequest: + $ref: '#/components/examples/create_index_threshold_rule_request' + createTrackingContainmentRuleRequest: + $ref: '#/components/examples/create_tracking_containment_rule_request' + schema: + $ref: '#/components/schemas/create_rule_request' + required: true + responses: + "200": + content: + application/json: + examples: + createEsQueryEsqlRuleResponse: + $ref: '#/components/examples/create_es_query_esql_rule_response' + createEsQueryRuleResponse: + $ref: '#/components/examples/create_es_query_rule_response' + createEsQueryKqlRuleResponse: + $ref: '#/components/examples/create_es_query_kql_rule_response' + createIndexThresholdRuleResponse: + $ref: '#/components/examples/create_index_threshold_rule_response' + createTrackingContainmentRuleResponse: + $ref: '#/components/examples/create_tracking_containment_rule_response' + schema: + $ref: '#/components/schemas/rule_response_properties' + description: Indicates a successful call. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + description: Authorization information is missing or invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + description: Object is not found. + summary: Creates a rule with a randomly generated rule identifier. + tags: + - alerting /s/{spaceId}/api/alerting/rule/{ruleId}: delete: description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. + To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted. operationId: deleteRule parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -66,8 +99,6 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Object is not found. - servers: - - url: https://localhost:5601 summary: Deletes a rule. tags: - alerting @@ -76,25 +107,8 @@ paths: You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To get rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. operationId: getRule parameters: - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "200": content: @@ -117,34 +131,16 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Object is not found. - servers: - - url: https://localhost:5601 summary: Retrieves a rule by its identifier. tags: - alerting post: description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you create a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If a user with different privileges updates the rule, its behavior might change. - operationId: createRule + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + operationId: createRuleId parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: | An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. explode: false @@ -152,15 +148,20 @@ paths: name: ruleId required: true schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 type: string style: simple requestBody: content: application/json: examples: - createCaseRequest: - $ref: '#/components/examples/create_rule_request' + createEsQueryEsqlRuleIdRequest: + $ref: '#/components/examples/create_es_query_esql_rule_request' + createEsQueryRuleIdRequest: + $ref: '#/components/examples/create_es_query_rule_request' + createEsQueryKqlRuleIdRequest: + $ref: '#/components/examples/create_es_query_kql_rule_request' + createIndexThreholdRuleIdRequest: + $ref: '#/components/examples/create_index_threshold_rule_request' schema: $ref: '#/components/schemas/create_rule_request' required: true @@ -169,8 +170,14 @@ paths: content: application/json: examples: - createRuleResponse: - $ref: '#/components/examples/create_rule_response' + createEsQueryEsqlRuleIdResponse: + $ref: '#/components/examples/create_es_query_esql_rule_response' + createEsQueryRuleIdResponse: + $ref: '#/components/examples/create_es_query_rule_response' + createEsQueryKqlRuleIdResponse: + $ref: '#/components/examples/create_es_query_kql_rule_response' + createIndexThresholdRuleIdResponse: + $ref: '#/components/examples/create_index_threshold_rule_response' schema: $ref: '#/components/schemas/rule_response_properties' description: Indicates a successful call. @@ -186,48 +193,22 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Object is not found. - servers: - - url: https://localhost:5601 - summary: Creates a rule. + summary: Creates a rule with a specific rule identifier. tags: - alerting put: description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you update a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If you have different privileges than the user that created or most recently updated the rule, you might change its behavior. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. + To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. operationId: updateRule parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' requestBody: content: application/json: examples: - updateCaseRequest: + updateRuleRequest: $ref: '#/components/examples/update_rule_request' schema: $ref: '#/components/schemas/update_rule_request' @@ -254,46 +235,18 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Object is not found. - servers: - - url: https://localhost:5601 summary: Updates the attributes for a rule. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_disable: post: description: | You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. operationId: disableRule parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -309,46 +262,18 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Object is not found. - servers: - - url: https://localhost:5601 summary: Disables a rule. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_enable: post: description: | - This API supports token-based authentication only. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. + To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. operationId: enableRule parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -364,31 +289,17 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Object is not found. - servers: - - url: https://localhost:5601 summary: Enables a rule. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rules/_find: get: description: | You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To find rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. operationId: findRules parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' - description: The default operator to use for the simple_query_string. - example: OR explode: true in: query name: default_search_operator @@ -404,6 +315,7 @@ paths: required: false schema: items: + nullable: true type: string type: array style: form @@ -414,6 +326,7 @@ paths: name: filter required: false schema: + nullable: true type: string style: form - description: Filters the rules that have a relation with the reference objects @@ -426,7 +339,6 @@ paths: $ref: '#/components/schemas/findRules_has_reference_parameter' style: form - description: The page number to return. - example: 1 explode: true in: query name: page @@ -436,7 +348,6 @@ paths: type: integer style: form - description: The number of rules to return per page. - example: 20 explode: true in: query name: per_page @@ -460,7 +371,8 @@ paths: name: search_fields required: false schema: - $ref: '#/components/schemas/findRules_search_fields_parameter' + nullable: true + type: string style: form - description: | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. @@ -469,10 +381,10 @@ paths: name: sort_field required: false schema: + nullable: true type: string style: form - description: Determines the sort order. - example: asc explode: true in: query name: sort_order @@ -491,6 +403,8 @@ paths: examples: findRulesResponse: $ref: '#/components/examples/find_rules_response' + findConditionalActionRulesResponse: + $ref: '#/components/examples/find_rules_response_conditional_action' schema: $ref: '#/components/schemas/findRules_200_response' description: Indicates a successful call. @@ -500,29 +414,16 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Retrieves information about rules. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/_health: get: description: | You must have `read` privileges for the **Management > Stack Rules** feature or for at least one of the **Analytics > Discover**, **Analytics > Machine Learning**, **Observability**, or **Security** features. operationId: getAlertingHealth parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' responses: "200": content: @@ -542,24 +443,13 @@ paths: summary: Retrieves the health status of the alerting framework. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule_types: get: description: | If you have `read` privileges for one or more Kibana features, the API response contains information about the appropriate rule types. For example, there are rule types associated with the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, and **Security** features. To get rule types associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. operationId: getRuleTypes parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' responses: "200": content: @@ -581,41 +471,15 @@ paths: summary: Retrieves a list of rule types. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_mute_all: post: description: | This API snoozes the notifications for the rule indefinitely. The rule checks continue to occur but alerts will not trigger any actions. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. operationId: muteAllAlerts parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -625,46 +489,18 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Mutes all alerts. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all: post: description: | If the rule has its notifications snoozed indefinitely, this API cancels the snooze. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. operationId: unmuteAllAlerts parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -674,60 +510,40 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Unmutes all alerts. tags: - alerting - servers: - - url: https://localhost:5601 + /s/{spaceId}/api/alerting/rule/{ruleId}/_update_api_key: + post: + description: The new API key has the credentials of the user that submits the + request. + operationId: updateRuleAPIKey + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' + responses: + "200": + description: Indicates a successful call. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + description: Bad request + summary: Updates the API key for a rule. + tags: + - alerting /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_mute: post: - description: "You must have `all` privileges for the appropriate Kibana features,\ - \ depending on the `consumer` and `rule_type_id` of the rule. For example,\ - \ the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine\ - \ Learning** features, **Observability**, and **Security** features. If the\ - \ rule has actions, you must also have `read` privileges for the **Management\ - \ > Actions and Connectors** feature. \n" + description: | + You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. operationId: muteAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the alert. The identifier is generated by the - rule and might be any arbitrary string. - explode: false - in: path - name: alertId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/alert_id' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -737,60 +553,19 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Mutes an alert. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute: post: - description: "You must have `all` privileges for the appropriate Kibana features,\ - \ depending on the `consumer` and `rule_type_id` of the rule. For example,\ - \ the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine\ - \ Learning** features, **Observability**, and **Security** features. If the\ - \ rule has actions, you must also have `read` privileges for the **Management\ - \ > Actions and Connectors** feature. \n" + description: | + You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. operationId: unmuteAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: An identifier for the alert. The identifier is generated by the - rule and might be any arbitrary string. - explode: false - in: path - name: alertId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: An identifier for the rule. - explode: false - in: path - name: ruleId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/alert_id' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' responses: "204": description: Indicates a successful call. @@ -800,13 +575,9 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Unmutes an alert. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}: delete: deprecated: true @@ -814,33 +585,16 @@ paths: Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After you delete an alert, you cannot recover it. operationId: legaryDeleteAlert parameters: - - description: Cross-site request forgery protection + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + - description: The identifier for the alert. explode: false - in: header - name: kbn-xsrf + in: path + name: alertId required: true schema: type: string style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple - - description: The identifier for the alert. - explode: false - in: path - name: alertId - required: true - schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 - type: string - style: simple responses: "204": description: Indicates a successful call. @@ -850,8 +604,6 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Permanently removes an alert. tags: - alerting @@ -860,23 +612,13 @@ paths: description: Deprecated in 7.13.0. Use the get rule API instead. operationId: legacyGetAlert parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple responses: @@ -892,8 +634,6 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Retrieves an alert by its identifier. tags: - alerting @@ -902,14 +642,7 @@ paths: description: Deprecated in 7.13.0. Use the create rule API instead. operationId: legacyCreateAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' - description: "An UUID v1 or v4 identifier for the alert. If this parameter\ \ is omitted, the identifier is randomly generated." explode: false @@ -917,19 +650,9 @@ paths: name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default type: string style: simple + - $ref: '#/components/parameters/space_id' requestBody: content: application/json: @@ -949,8 +672,6 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Create an alert. tags: - alerting @@ -959,31 +680,14 @@ paths: description: Deprecated in 7.13.0. Use the update rule API instead. operationId: legacyUpdateAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple requestBody: @@ -1005,44 +709,23 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Updates the attributes for an alert. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_disable: post: deprecated: true description: Deprecated in 7.13.0. Use the disable rule API instead. operationId: legacyDisableAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple responses: @@ -1054,44 +737,23 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Disables an alert. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_enable: post: deprecated: true description: Deprecated in 7.13.0. Use the enable rule API instead. operationId: legacyEnableAlert parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple responses: @@ -1103,44 +765,23 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Enables an alert. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_mute_all: post: deprecated: true description: Deprecated in 7.13.0. Use the mute all alerts API instead. operationId: legacyMuteAllAlertInstances parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple responses: @@ -1152,44 +793,23 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Mutes all alert instances. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_unmute_all: post: deprecated: true description: Deprecated in 7.13.0. Use the unmute all alerts API instead. operationId: legacyUnmuteAllAlertInstances parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: The identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple responses: @@ -1201,13 +821,9 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Unmutes all alert instances. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/_find: get: deprecated: true @@ -1215,18 +831,8 @@ paths: Deprecated in 7.13.0. Use the find rules API instead. NOTE: Alert `params` are stored as a flattened field type and analyzed as keywords. As alerts change in Kibana, the results on each page of the response also change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data. operationId: legacyFindAlerts parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' - description: The default operator to use for the `simple_query_string`. - example: OR explode: true in: query name: default_search_operator @@ -1261,10 +867,9 @@ paths: name: has_reference required: false schema: - $ref: '#/components/schemas/findRules_has_reference_parameter' + $ref: '#/components/schemas/legacyFindAlerts_has_reference_parameter' style: form - description: The page number to return. - example: 1 explode: true in: query name: page @@ -1274,7 +879,6 @@ paths: type: integer style: form - description: The number of alerts to return per page. - example: 20 explode: true in: query name: per_page @@ -1290,6 +894,7 @@ paths: name: search required: false schema: + nullable: true type: string style: form - description: The fields to perform the `simple_query_string` parsed query @@ -1299,7 +904,8 @@ paths: name: search_fields required: false schema: - $ref: '#/components/schemas/findRules_search_fields_parameter' + nullable: true + type: string style: form - description: | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. @@ -1311,7 +917,6 @@ paths: type: string style: form - description: Determines the sort order. - example: asc explode: true in: query name: sort_order @@ -1336,13 +941,9 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Retrieves a paginated set of alerts. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/_health: get: deprecated: true @@ -1350,16 +951,7 @@ paths: instead. operationId: legacyGetAlertingHealth parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' responses: "200": content: @@ -1376,24 +968,13 @@ paths: summary: Retrieves the health status of the alerting framework. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/list_alert_types: get: deprecated: true description: Deprecated in 7.13.0. Use the get rule types API instead. operationId: legacyGetAlertTypes parameters: - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/space_id' responses: "200": content: @@ -1412,39 +993,20 @@ paths: summary: Retrieves a list of alert types. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute: post: deprecated: true description: Deprecated in 7.13.0. Use the mute alert API instead. operationId: legacyMuteAlertInstance parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: An identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple - description: An identifier for the alert instance. @@ -1453,7 +1015,6 @@ paths: name: alertInstanceId required: true schema: - example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 type: string style: simple responses: @@ -1465,44 +1026,23 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Mutes an alert instance. tags: - alerting - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute: post: deprecated: true description: Deprecated in 7.13.0. Use the unmute alert API instead. operationId: legacyUnmuteAlertInstance parameters: - - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - - description: "An identifier for the space. If `/s/` and the identifier are\ - \ omitted from the path, the default space is used." - explode: false - in: path - name: spaceId - required: true - schema: - example: default - type: string - style: simple + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - description: An identifier for the alert. explode: false in: path name: alertId required: true schema: - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string style: simple - description: An identifier for the alert instance. @@ -1511,7 +1051,6 @@ paths: name: alertInstanceId required: true schema: - example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 type: string style: simple responses: @@ -1523,225 +1062,347 @@ paths: schema: $ref: '#/components/schemas/401_response' description: Authorization information is missing or invalid. - servers: - - url: https://localhost:5601 summary: Unmutes an alert instance. tags: - alerting - servers: - - url: https://localhost:5601 components: examples: - get_rule_response: - summary: The get rule API returns a JSON object that contains details about - the rule. + create_es_query_esql_rule_request: + summary: Create an Elasticsearch query rule that uses Elasticsearch Query Language + (ES|QL). value: - id: 31697a40-7b36-11ed-aa79-f742c05329b2 - consumer: alerts - tags: - - cpu - name: my alert - enabled: true - throttle: null - schedule: - interval: 1m + name: my Elasticsearch query ESQL rule params: - aggType: avg - termSize: 6 + searchType: esqlQuery + esqlQuery: + esql: "FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest\ + \ | where geo.dest != \"GB\" | STATS sumbytes = sum(bytes) by clientip,\ + \ host | WHERE sumbytes > 5000 | SORT sumbytes desc | LIMIT 10" + timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + size: 0 thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top threshold: - - 1000 - index: - - test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - rule_type_id: .index-threshold - created_by: elastic - updated_by: elastic - created_at: 2022-12-13T22:33:41.163Z - updated_at: 2022-12-13T22:33:41.163Z - api_key_owner: elastic - notify_when: onActionGroupChange - muted_alert_ids: [] - mute_all: false - scheduled_task_id: 31697a40-7b36-11ed-aa79-f742c05329b2 - execution_status: - status: ok - last_execution_date: 2022-12-13T22:33:44.388Z - last_duration: 83 + - 0 + consumer: stackAlerts + rule_type_id: .es-query + schedule: + interval: 1d actions: - - group: threshold met - id: 1007a0c0-7a6e-11ed-89d5-abec321c0def + - group: query matched + id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date} - connector_type_id: .server-log - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: null - warning: null - outcome: succeeded - next_run: 2022-12-13T22:34:44.314Z - update_rule_request: - summary: Update an index threshold rule. + Elasticsearch query rule '{{rule.name}}' is active: + - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} + frequency: + summary: false + notify_when: onActiveAlert + create_es_query_rule_request: + summary: Create an Elasticsearch query rule that uses Elasticsearch query domain + specific language (DSL) to define its query and a server log connector to + send notifications. value: actions: - - frequency: - summary: false - notify_when: onActionGroupChange - group: threshold met - id: 96b668d0-a1b6-11ed-afdf-d39a49596974 + - group: query matched params: level: info - message: |- - alert {{alertName}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date}} + message: "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}}\ + \ ongoing, and {{alerts.recovered.count}} recovered alerts." + id: fdbece50-406c-11ee-850e-c71febc4ca7f + frequency: + throttle: 1d + summary: true + notify_when: onThrottleInterval + - group: recovered + params: + level: info + message: Recovered + id: fdbece50-406c-11ee-850e-c71febc4ca7f + frequency: + summary: false + notify_when: onActionGroupChange + consumer: alerts + name: my Elasticsearch query rule params: - aggField: sheet.version - aggType: avg + esQuery: "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"" index: - - .test-index - groupBy: top - termField: name.keyword - termSize: 6 + - kibana_sample_data_logs + size: 100 threshold: - - 1000 + - 100 thresholdComparator: '>' timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + rule_type_id: .es-query + schedule: + interval: 1d + create_es_query_kql_rule_request: + summary: Create an Elasticsearch query rule that uses Kibana query language + (KQL). + value: + consumer: alerts + name: my Elasticsearch query KQL rule + params: + aggType: count + excludeHitsFromPreviousRun: true + groupBy: all + searchConfiguration: + query: + query: "\"\"geo.src : \"US\" \"\"" + language: kuery + index: 90943e30-9a47-11e8-b64d-95841ca0b247 + searchType: searchSource + size: 100 + threshold: + - 1000 + thresholdComparator: '>' timeWindowSize: 5 timeWindowUnit: m - name: new name + rule_type_id: .es-query schedule: interval: 1m - tags: [] - throttle: null - update_rule_response: - summary: The update rule API returns a JSON object that contains details about - the rule. + create_index_threshold_rule_request: + summary: Create an index threshold rule. value: - id: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + actions: + - id: 48de3460-f401-11ed-9f8e-399c75a2deeb + frequency: + notify_when: onActionGroupChange + summary: false + group: threshold met + params: + level: info + message: |- + Rule '{{rule.name}}' is active for group '{{context.group}}': + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date}} + alert_delay: + active: 3 consumer: alerts - tags: [] - name: new name - enabled: true - throttle: null - running: false - schedule: - interval: 10m + name: my rule params: - index: - - .updated-index - timeField: '@timestamp' - groupBy: top aggType: avg + termSize: 6 + thresholdComparator: '>' timeWindowSize: 5 timeWindowUnit: m - thresholdComparator: '>' + groupBy: top threshold: - 1000 + index: + - .test-index + timeField: '@timestamp' aggField: sheet.version termField: name.keyword - termSize: 6 - api_key_owner: elastic - created_by: elastic - updated_by: elastic rule_type_id: .index-threshold - scheduled_task_id: 4c5eda00-e74f-11ec-b72f-5b18752ff9ea - created_at: 2023-01-31T23:03:33.127Z - updated_at: 2023-01-31T23:55:27.314Z - mute_all: false - muted_alert_ids: [] - execution_status: - status: ok - last_execution_date: 2023-01-31T23:48:42.499Z - last_duration: 52 + schedule: + interval: 1m + tags: + - cpu + create_tracking_containment_rule_request: + summary: Create a tracking containment rule. + value: + consumer: alerts + name: my tracking rule + params: + index: kibana_sample_data_logs + dateField": '@timestamp' + geoField: geo.coordinates + entity: agent.keyword + boundaryType: entireIndex + boundaryIndexTitle: boundary* + boundaryGeoField: location + boundaryNameField: name + indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 + boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc + rule_type_id: .geo-containment + schedule: + interval: 1h + create_es_query_esql_rule_response: + summary: The create rule API returns a JSON object that contains details about + the rule. + value: + id: e0d62360-78e8-11ee-9177-f7d404c8c945 + enabled: true + name: my Elasticsearch query ESQL rule + tags: [] + rule_type_id: .es-query + consumer: stackAlerts + schedule: + interval: 1d actions: - - group: threshold met + - group: query matched + id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date} - id: 96b668d0-a1b6-11ed-afdf-d39a49596974 + Elasticsearch query rule '{{rule.name}}' is active: + - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} connector_type_id: .server-log frequency: summary: false + notify_when: onActiveAlert throttle: null - notify_when: onActionGroupChange - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: null - warning: null - outcome: succeeded - next_run: 2023-01-31T23:49:42.432Z - create_rule_request: - summary: Create an index threshold rule. + uuid: bfe370a3-531b-4855-bbe6-ad739f578844 + params: + searchType: esqlQuery + esqlQuery: + esql: "FROM kibana_sample_data_logs | keep bytes, clientip, host, geo.dest\ + \ | WHERE geo.dest != \"GB\" | stats sumbytes = sum(bytes) by clientip,\ + \ host | WHERE sumbytes > 5000 | sort sumbytes desc | limit 10" + timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + size: 0 + thresholdComparator: '>' + threshold: + - 0 + excludeHitsFromPreviousRun": "true," + aggType: count + groupBy: all + scheduled_task_id: e0d62360-78e8-11ee-9177-f7d404c8c945 + created_by: elastic + updated_by: "elastic\"," + created_at: 2023-11-01T19:00:10.453Z + updated_at: 2023-11-01T19:00:10.453Z + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + mute_all: false + notify_when: null + muted_alert_ids: [] + execution_status: + status: pending + last_execution_date: 2023-11-01T19:00:10.453Z + revision: 0 + running: false + create_es_query_rule_response: + summary: The create rule API returns a JSON object that contains details about + the rule. value: + id: 58148c70-407f-11ee-850e-c71febc4ca7f + enabled: true + name: my Elasticsearch query rule + tags: [] + rule_type_id: .es-query + consumer: alerts + schedule: + interval: 1d actions: - - id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + - group: query matched + id: fdbece50-406c-11ee-850e-c71febc4ca7f + params: + level: info + message: "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}}\ + \ ongoing, and {{alerts.recovered.count}} recovered alerts." + connector_type_id: .server-log frequency: - notify_when: onActionGroupChange - summary: false - group: threshold met + summary: true + notify_when: onThrottleInterval + throttle: 1d + uuid: 53f3c2a3-e5d0-4cfa-af3b-6f0881385e78 + - group: recovered + id: fdbece50-406c-11ee-850e-c71febc4ca7f params: level: info - message: |- - alert '{{alertName}}' is active for group '{{context.group}}': - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date}} - consumer: alerts - name: my rule + message: Recovered + connector_type_id: .server-log + frequency: + summary: false + notify_when: onActionGroupChange + throttle: null + uuid: 2324e45b-c0df-45c7-9d70-4993e30be758 params: - aggType: avg - termSize: 6 thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top + timeWindowSize: 1 + timeWindowUnit: d threshold: - - 1000 - index: - - .test-index + - 100 + size: 100 timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - rule_type_id: .index-threshold + index: + - kibana_sample_data_logs + esQuery: "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"" + excludeHitsFromPreviousRun: true + aggType: count + groupBy: all + searchType: esQuery + scheduled_task_id: 58148c70-407f-11ee-850e-c71febc4ca7f + created_by: elastic + updated_by: elastic + created_at: 2023-08-22T00:03:38.263Z + updated_at: 2023-08-22T00:03:38.263Z + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + mute_all: false + notify_when: null + muted_alert_ids: [] + execution_status: + status: pending + last_execution_date: 2023-08-22T00:03:38.263Z + revision: 0 + running: false + create_es_query_kql_rule_response: + summary: The create rule API returns a JSON object that contains details about + the rule. + value: + id: 7bd506d0-2284-11ee-8fad-6101956ced88 + enabled: true + name: my Elasticsearch query KQL rule" + tags: [] + rule_type_id: .es-query + consumer: alerts schedule: interval: 1m - tags: - - cpu - create_rule_response: + actions: [] + params: + searchConfiguration: + query: + query: "\"\"geo.src : \"US\" \"\"" + language: kuery + index: 90943e30-9a47-11e8-b64d-95841ca0b247 + searchType: searchSource + timeWindowSize: 5 + timeWindowUnit: m + threshold: + - 1000 + thresholdComparator: '>' + size: 100 + aggType: count + groupBy: all + excludeHitsFromPreviousRun: true + created_by: elastic + updated_by: elastic + created_at: 2023-07-14T20:24:50.729Z + updated_at: 2023-07-14T20:24:50.729Z + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: 7bd506d0-2284-11ee-8fad-6101956ced88 + execution_status: + status: pending + last_execution_date: 2023-07-14T20:24:50.729Z + revision: 0 + running: false + create_index_threshold_rule_response: summary: The create rule API returns a JSON object that contains details about the rule. value: actions: - group: threshold met id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d + connector_type_id: .server-log frequency: notify_when: onActionGroupChange summary: false @@ -1749,11 +1410,14 @@ components: params: level: info message: |- - alert {{alertName}} is active for group {{context.group} : + Rule {{rule.name}} is active for group {{context.group} : - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} + alert_delay: + active: 3 + api_key_created_by_user: false api_key_owner: elastic consumer: alerts created_at: 2022-06-08T17:20:31.632Z @@ -1766,7 +1430,7 @@ components: muted_alert_ids: [] mute_all: false name: my rule - notify_when: onActionGroupChange + notify_when: null params: aggType: avg termSize: 6 @@ -1781,6 +1445,7 @@ components: timeField: '@timestamp' aggField: sheet.version termField: name.keyword + revision: 0 rule_type_id: .index-threshold running: false schedule: @@ -1791,6 +1456,233 @@ components: throttle: null updated_at: 2022-06-08T17:20:31.632Z updated_by: elastic + create_tracking_containment_rule_response: + summary: The create rule API returns a JSON object that contains details about + the rule. + value: + id: b6883f9d-5f70-4758-a66e-369d7c26012f + name: my tracking rule + tags: [] + enabled: true + consumer: alerts + throttle: null + revision: 1 + running: false + schedule: + interval: 1h + params: + index: kibana_sample_data_logs + dateField: '@timestamp' + geoField: geo.coordinates + entity: agent.keyword + boundaryType: entireIndex + boundaryIndexTitle: boundary* + boundaryGeoField: location + boundaryNameField: name + indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 + boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc + rule_type_id: .geo-containment + created_by: elastic + updated_by: elastic + created_at: 2024-02-14T19:52:55.920Z + updated_at: 2024-02-15T03:24:32.574Z + api_key_owner: elastic + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: b6883f9d-5f70-4758-a66e-369d7c26012f + execution_status: + status: ok + last_execution_date: 2024-02-15T03:25:38.125Z + last_duration: 74 + actions: [] + last_run: + alerts_count: + active: 0 + new: 0 + recovered: 0 + ignored: 0 + outcome_msg: null + outcome_order: 0 + outcome: succeeded + warning: null + next_run: 2024-02-15T03:26:38.033Z + api_key_created_by_user: false + get_rule_response: + summary: The get rule API returns a JSON object that contains details about + the rule. + value: + id: 31697a40-7b36-11ed-aa79-f742c05329b2 + consumer: alerts + tags: + - cpu + name: my alert + enabled: true + throttle: null + schedule: + interval: 1m + params: + aggType: avg + termSize: 6 + thresholdComparator: '>' + timeWindowSize: 5 + timeWindowUnit: m + groupBy: top + threshold: + - 1000 + index: + - test-index + timeField: '@timestamp' + aggField: sheet.version + termField: name.keyword + revision: 1 + rule_type_id: .index-threshold + created_by: elastic + updated_by: elastic + created_at: 2022-12-13T22:33:41.163Z + updated_at: 2022-12-13T22:33:41.163Z + api_key_owner: elastic + notify_when: null + muted_alert_ids: [] + mute_all: false + scheduled_task_id: 31697a40-7b36-11ed-aa79-f742c05329b2 + execution_status: + status: ok + last_execution_date: 2022-12-13T22:33:44.388Z + last_duration: 83 + actions: + - group: threshold met + id: 1007a0c0-7a6e-11ed-89d5-abec321c0def + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 + params: + level: info + message: |- + Rule {{rule.name}} is active for group {{context.group}}: + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date} + connector_type_id: .server-log + connector_type_id: .server-log + frequency: + throttle: null + summary: false + notify_when: onActionGroupChange + last_run: + alerts_count: + new: 0 + ignored: 0 + recovered: 0 + active: 0 + outcome_msg: null + warning: null + outcome: succeeded + next_run: 2022-12-13T22:34:44.314Z + api_key_created_by_user: false + update_rule_request: + summary: Update an index threshold rule. + value: + actions: + - frequency: + summary: false + notify_when: onActionGroupChange + group: threshold met + id: 96b668d0-a1b6-11ed-afdf-d39a49596974 + params: + level: info + message: |- + Rule {{rule.name}} is active for group {{context.group}}: + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date}} + params: + aggField: sheet.version + aggType: avg + index: + - .updated-index + groupBy: top + termField: name.keyword + termSize: 6 + threshold: + - 1000 + thresholdComparator: '>' + timeField: '@timestamp' + timeWindowSize: 5 + timeWindowUnit: m + name: new name + schedule: + interval: 1m + tags: [] + update_rule_response: + summary: The update rule API returns a JSON object that contains details about + the rule. + value: + id: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + consumer: alerts + tags: [] + name: new name + enabled: true + throttle: null + revision: 1 + running: false + schedule: + interval: 1m + params: + index: + - .updated-index + timeField: '@timestamp' + groupBy: top + aggType: avg + timeWindowSize: 5 + timeWindowUnit: m + thresholdComparator: '>' + threshold: + - 1000 + aggField: sheet.version + termField: name.keyword + termSize: 6 + api_key_owner: elastic + created_by: elastic + updated_by: elastic + rule_type_id: .index-threshold + scheduled_task_id: 4c5eda00-e74f-11ec-b72f-5b18752ff9ea + created_at: 2024-03-26T23:13:20.985Z + updated_at: 2024-03-26T23:22:59.949Z + mute_all: false + muted_alert_ids: [] + execution_status: + status: ok + last_execution_date: 2024-03-26T23:22:51.390Z + last_duration: 52 + actions: + - group: threshold met + params: + level: info + message: |- + Rule {{rule.name}} is active for group {{context.group}}: + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date} + id: 96b668d0-a1b6-11ed-afdf-d39a49596974 + uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d + connector_type_id: .server-log + frequency: + summary: false + throttle: null + notify_when: onActionGroupChange + last_run: + alerts_count: + new: 0 + ignored: 0 + recovered: 0 + active: 0 + outcome_msg: null + warning: null + outcome: succeeded + next_run: 2024-03-26T23:23:51.316Z + api_key_created_by_user: false find_rules_response: summary: Retrieve information about a rule. value: @@ -1821,13 +1713,13 @@ components: timeField: '@timestamp' aggField: sheet.version termField: name.keyword + revision: 1 rule_type_id: .index-threshold created_by: elastic updated_by: elastic created_at: 2022-12-05T23:40:33.132Z updated_at: 2022-12-05T23:40:33.132Z api_key_owner: elastic - notify_when: onActionGroupChange mute_all: false muted_alert_ids: [] scheduled_task_id: 3583a470-74f6-11ed-9801-35303b735aef @@ -1838,15 +1730,20 @@ components: actions: - id: 9dca3e00-74f5-11ed-9801-35303b735aef group: threshold met + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: + Rule {{rule.name}} is active for group {{context.group}}: - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} connector_type_id: .server-log + frequency: + summary: false + notify_when: onActionGroupChange + throttle: null last_run: alerts_count: new: 0 @@ -1857,6 +1754,129 @@ components: warning: null outcome: succeeded next_run: 2022-12-06T01:45:23.912Z + api_key_created_by_user: false + find_rules_response_conditional_action: + summary: Retrieve information about a rule that has conditional actions. + value: + page: 1 + total: 1 + per_page: 10 + data: + - id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb + name: security_rule + consumer: siem + enabled: true + tags: [] + throttle: null + revision: 1 + running: false + schedule: + interval: 1m + params: + author: [] + description: A security threshold rule. + ruleId: an_internal_rule_id + falsePositives: [] + from: now-3660s + immutable: false + license: "" + outputIndex: "" + meta: + from: 1h + kibana_siem_app_url: https://localhost:5601/app/security + maxSignals: 100 + riskScore: 21 + riskScoreMapping: [] + severity: low + severityMapping: [] + threat: [] + to: now + references: [] + version: 1 + exceptionsList: [] + type: threshold + language: kuery + index: + - kibana_sample_data_logs + query: '*' + filters: [] + threshold: + field: + - bytes + value: 1 + cardinality: [] + rule_type_id: siem.thresholdRule + created_by: elastic + updated_by: elastic + created_at: 2023-05-16T15:50:28.358Z + updated_at: 2023-05-16T20:25:42.559Z + api_key_owner: elastic + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb + execution_status: + status: ok + last_execution_date: 2023-05-16T20:26:49.590Z + last_duration: 166 + actions: + - group: default + id: 49eae970-f401-11ed-9f8e-399c75a2deeb + params: + documents: + - rule_id: + '[object Object]': null + rule_name: + '[object Object]': null + alert_id: + '[object Object]': null + context_message: + '[object Object]': null + connector_type_id: .index + frequency: + summary: true + notify_when: onActiveAlert + throttle: null + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 + alerts_filter: + timeframe: + days: + - 7 + timezone: UTC + hours: + start: 08:00 + end: 17:00 + query: + kql: "" + filters: + - meta: + disabled: false + negate: false + alias: null + index: c4bdca79-e69e-4d80-82a1-e5192c621bea + key: client.geo.region_iso_code + field: client.geo.region_iso_code + params: + query: CA-QC + type: phrase + $state: + store: appState + query: + match_phrase: + client.geo.region_iso_code: CA-QC + last_run: + alerts_count: + new: 0 + ignored: 0 + recovered: 0 + active: 0 + outcome_msg: + - Rule execution completed successfully + outcome_order: 0 + warning: null + outcome: succeeded + next_run: 2023-05-16T20:27:49.507Z + api_key_created_by_user: false get_health_response: summary: Retrieve information about the health of the alerting framework. value: @@ -1872,27 +1892,105 @@ components: read_health: status: ok timestamp: 2023-01-13T01:28:00.280Z - alerting_framework_heath: - _deprecated: "This state property has a typo, use \"alerting_framework_health\"\ - \ instead." - decryption_health: - status: ok - timestamp: 2023-01-13T01:28:00.280Z - execution_health: - status: ok - timestamp: 2023-01-13T01:28:00.280Z - read_health: - status: ok - timestamp: 2023-01-13T01:28:00.280Z get_rule_types_response: summary: Retrieve rule types associated with Kibana machine learning features value: - id: xpack.ml.anomaly_detection_alert + name: Anomaly detection alert + category: management + producer: ml + alerts: + context: ml.anomaly-detection + mappings: + fieldMap: + kibana.alert.job_id: + type: keyword + array: false + required: true + kibana.alert.anomaly_score: + type: double + array: false + required: false + kibana.alert.is_interim: + type: boolean + array: false + required: false + kibana.alert.anomaly_timestamp: + type: date + array: false + required: false + kibana.alert.top_records: + type: object + array: true + required: false + dynamic: false + properties: + job_id: + type: keyword + record_score: + type: double + initial_record_score: + type: double + detector_index: + type: integer + is_interim: + type: boolean + timestamp: + type: date + partition_field_name: + type: keyword + partition_field_value: + type: keyword + over_field_name: + type: keyword + over_field_value: + type: keyword + by_field_name: + type: keyword + by_field_value: + type: keyword + function: + type: keyword + typical: + type: double + actual: + type: double + field_name: + type: keyword + kibana.alert.top_influencers: + type: object + array: true + required: false + dynamic: false + properties: + job_id: + type: keyword + influencer_field_name: + type: keyword + influencer_field_value: + type: keyword + influencer_score: + type: double + initial_influencer_score: + type: double + is_interim: + type: boolean + timestamp: + type: date + shouldWrite: true + enabled_in_license: true + recovery_action_group: + id: recovered + name: Recovered action_groups: - id: anomaly_score_match name: Anomaly score matched the condition - id: recovered name: Recovered + default_action_group_id: anomaly_score_match + minimum_license_required: platinum + is_exportable: true + rule_task_timeout: 5m action_variables: context: - name: timestamp @@ -1914,68 +2012,115 @@ components: - name: anomalyExplorerUrl description: URL to open in the Anomaly Explorer useWithTripleBracesInTemplates: true - params: [] state: [] + params: [] authorized_consumers: alerts: + read: true + all: true + stackAlerts: + read: true + all: true + slo: + read: true + all: true + ml: + read: true + all: true + uptime: + read: true + all: true + infrastructure: + read: true + all: true + logs: + read: true + all: true + monitoring: + read: true + all: true + siem: + read: true all: true + apm: read: true - ml: all: true + discover: read: true - default_action_group_id: anomaly_score_match + all: true does_set_recovery_context: true - enabled_in_license: true - is_exportable: true - minimum_license_required: platinum - name: Anomaly detection alert + has_alerts_mappings: true + has_fields_for_a_a_d: false + - id: xpack.ml.anomaly_detection_jobs_health + name: Anomaly detection jobs health + category: management producer: ml + enabled_in_license: true recovery_action_group: id: recovered name: Recovered - rule_task_timeout: 5m - - id: xpack.ml.anomaly_detection_jobs_health action_groups: - id: anomaly_detection_realtime_issue name: Issue detected - id: recovered name: Recovered + default_action_group_id: anomaly_detection_realtime_issue + minimum_license_required: platinum + is_exportable: true + rule_task_timeout: 5m action_variables: context: - name: results description: Results of the rule execution - name: message description: Alert info message - params: [] state: [] + params: [] authorized_consumers: alerts: + read: true + all: true + stackAlerts: + read: true all: true + slo: read: true + all: true ml: + read: true all: true + uptime: read: true - default_action_group_id: anomaly_detection_realtime_issue + all: true + infrastructure: + read: true + all: true + logs: + read: true + all: true + monitoring: + read: true + all: true + siem: + read: true + all: true + apm: + read: true + all: true + discover: + read: true + all: true does_set_recovery_context: true - enabled_in_license: true - is_exportable: true - minimum_license_required: platinum - name: Anomaly detection jobs health - producer: ml - recovery_action_group: - id: recovered - name: Recovered - rule_task_timeout: 5m + has_alerts_mappings: false + has_fields_for_a_a_d: false parameters: - rule_id: - description: An identifier for the rule. + kbn_xsrf: + description: Cross-site request forgery protection explode: false - in: path - name: ruleId + in: header + name: kbn-xsrf required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string + schema: {} style: simple space_id: description: "An identifier for the space. If `/s/` and the identifier are omitted\ @@ -1984,18 +2129,15 @@ components: in: path name: spaceId required: true - schema: - example: default - type: string + schema: {} style: simple - kbn_xsrf: - description: Cross-site request forgery protection + rule_id: + description: An identifier for the rule. explode: false - in: header - name: kbn-xsrf + in: path + name: ruleId required: true - schema: - type: string + schema: {} style: simple alert_id: description: An identifier for the alert. The identifier is generated by the @@ -2004,183 +2146,362 @@ components: in: path name: alertId required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string + schema: {} style: simple schemas: - notify_when: + filter: + description: A filter written in Elasticsearch Query Domain Specific Language + (DSL) as defined in the `kbn-es-query` package. + example: + $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + properties: + meta: + $ref: '#/components/schemas/filter_meta' + query: + type: object + $state: + type: object + notify_when_action: description: | - Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. + Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. enum: - onActionGroupChange - onActiveAlert - onThrottleInterval - example: onActiveAlert type: string - throttle: - description: "The throttle interval, which defines how often an alert generates\ - \ repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`.\ - \ It is specified in seconds, minutes, hours, or days." - example: 10m + throttle_action: + description: | + The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. nullable: true type: string actions: - default: [] items: $ref: '#/components/schemas/actions_inner' - nullable: true - required: - - group - - id - - params type: array + notify_when: + deprecated: true + description: | + Deprecated in 8.13.0. Use the `notify_when` property in the action `frequency` object instead. Indicates how often alerts generate actions. NOTE: You cannot specify `notify_when` at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string schedule: description: "The check interval, which specifies how frequently the rule conditions\ \ are checked. The interval is specified in seconds, minutes, hours, or days." example: - interval: 1m + interval: interval properties: interval: - example: 1m type: string - type: object tags: - default: [] - description: The tags for the rule. items: type: string type: array + throttle: + deprecated: true + description: | + Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + nullable: true + type: string + alert_delay: + description: Indicates that an alert occurs only when the specified number of + consecutive runs met the rule conditions. + example: + active: 3 + properties: + active: + description: The number of consecutive runs that must meet the rule conditions. + example: 3 + type: number + required: + - active + create_rule_request: + description: The create rule API request body varies depending on the type of + rule and actions. + properties: + actions: + items: + $ref: '#/components/schemas/actions_inner' + type: array + consumer: + description: | + The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + enabled: + description: Indicates whether you want to run the rule on an interval basis + after it is created. + type: boolean + name: + description: "The name of the rule. While this name does not have to be\ + \ unique, a distinctive name can help you identify a rule." + example: cluster_health_rule + type: string + notify_when: + $ref: '#/components/schemas/notify_when' + params: + additionalProperties: true + description: The parameters for the rule. + type: object + rule_type_id: + description: | + The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. + type: string + schedule: + $ref: '#/components/schemas/schedule' + tags: + items: + type: string + type: array + throttle: + deprecated: true + description: | + Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + nullable: true + type: string + alert_delay: + $ref: '#/components/schemas/alert_delay' + required: + - consumer + - name + - params + - rule_type_id + - schedule + title: Create rule request rule_response_properties: example: - throttle: 10m - created_at: 2022-12-05T23:36:58.284Z + throttle: throttle + created_at: 2000-01-23T04:56:07.000+00:00 + api_key_created_by_user: true + enabled: true + running: true + notify_when: notify_when + next_run: 2000-01-23T04:56:07.000+00:00 + updated_at: updated_at + execution_status: + last_execution_date: 2000-01-23T04:56:07.000+00:00 + last_duration: 6 + status: status + scheduled_task_id: scheduled_task_id + id: id + consumer: consumer + alert_delay: + active: 3 last_run: alerts_count: - ignored: 6 - new: 1 - recovered: 5 - active: 0 - outcome_msg: outcome_msg + ignored: 5 + new: 5 + recovered: 2 + active: 1 + outcome_msg: + - outcome_msg + - outcome_msg + outcome_order: 7 warning: warning - outcome: succeeded + outcome: outcome params: key: "" - created_by: elastic - enabled: true + created_by: created_by muted_alert_ids: - muted_alert_ids - muted_alert_ids - rule_type_id: monitoring_alert_cluster_health + rule_type_id: rule_type_id + revision: 9 tags: - tags - tags - running: true - api_key_owner: elastic + api_key_owner: api_key_owner schedule: - interval: 1m - notify_when: onActiveAlert - next_run: 2022-12-06T00:14:43.818Z - updated_at: 2022-12-05T23:36:58.284Z - execution_status: - last_execution_date: 2022-12-06T00:13:43.89Z - last_duration: 55 - status: ok - name: cluster_health_rule - updated_by: elastic - scheduled_task_id: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef - mute_all: false + interval: interval + name: name + updated_by: updated_by + mute_all: true actions: - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + throttle: throttle + notify_when: null + group: group + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - consumer: alerts + throttle: throttle + notify_when: null + group: group properties: actions: - default: [] items: $ref: '#/components/schemas/actions_inner' - nullable: true - required: - - group - - id - - params type: array + alert_delay: + $ref: '#/components/schemas/alert_delay' + api_key_created_by_user: + description: Indicates whether the API key that is associated with the rule + was created by the user. + type: boolean api_key_owner: - example: elastic + description: | + The owner of the API key that is associated with the rule and used to run background tasks. nullable: true type: string consumer: description: "The application or feature that owns the rule. For example,\ \ `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`,\ \ `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`." - example: alerts type: string created_at: description: The date and time that the rule was created. - example: 2022-12-05T23:36:58.284Z format: date-time type: string created_by: description: The identifier for the user that created the rule. - example: elastic nullable: true type: string enabled: description: Indicates whether the rule is currently enabled. - example: true type: boolean execution_status: $ref: '#/components/schemas/rule_response_properties_execution_status' id: description: The identifier for the rule. - example: b530fed0-74f5-11ed-9801-35303b735aef type: string last_run: $ref: '#/components/schemas/rule_response_properties_last_run' muted_alert_ids: items: type: string - nullable: true type: array mute_all: - example: false type: boolean name: description: The name of the rule. - example: cluster_health_rule type: string next_run: - example: 2022-12-06T00:14:43.818Z format: date-time nullable: true type: string notify_when: - $ref: '#/components/schemas/notify_when' + description: Indicates how often alerts generate actions. + nullable: true + type: string params: additionalProperties: true description: The parameters for the rule. type: object + revision: + description: The rule revision number. + type: integer rule_type_id: description: | The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. - example: monitoring_alert_cluster_health type: string running: description: Indicates whether the rule is running. @@ -2188,28 +2509,22 @@ components: schedule: $ref: '#/components/schemas/schedule' scheduled_task_id: - example: b530fed0-74f5-11ed-9801-35303b735aef type: string tags: - default: [] - description: The tags for the rule. items: type: string type: array throttle: - description: "The throttle interval, which defines how often an alert generates\ - \ repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`.\ - \ It is specified in seconds, minutes, hours, or days." - example: 10m + deprecated: true + description: | + Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. nullable: true type: string updated_at: description: The date and time that the rule was updated most recently. - example: 2022-12-05T23:36:58.284Z type: string updated_by: description: The identifier for the user that updated this rule most recently. - example: elastic nullable: true type: string required: @@ -2232,57 +2547,43 @@ components: - updated_at - updated_by title: Rule response properties - type: object "401_response": properties: error: enum: - Unauthorized - example: Unauthorized type: string message: type: string statusCode: enum: - 401 - example: 401 type: integer title: Unsuccessful rule API response - type: object "404_response": properties: error: enum: - Not Found - example: Not Found type: string message: - example: "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not\ - \ found" type: string statusCode: enum: - 404 - example: 404 type: integer - type: object update_rule_request: - description: The update rule API request body varies depending on the type of - rule and actions. + description: | + The update rule API request body varies depending on the type of rule and actions. properties: actions: - default: [] items: $ref: '#/components/schemas/actions_inner' - nullable: true - required: - - group - - id - - params type: array + alert_delay: + $ref: '#/components/schemas/alert_delay' name: description: The name of the rule. - example: cluster_health_rule type: string notify_when: $ref: '#/components/schemas/notify_when' @@ -2293,16 +2594,13 @@ components: schedule: $ref: '#/components/schemas/schedule' tags: - default: [] - description: The tags for the rule. items: type: string type: array throttle: - description: "The throttle interval, which defines how often an alert generates\ - \ repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`.\ - \ It is specified in seconds, minutes, hours, or days." - example: 10m + deprecated: true + description: | + Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. nullable: true type: string required: @@ -2310,75 +2608,85 @@ components: - params - schedule title: Update rule request - type: object - create_rule_request: - description: The create rule API request body varies depending on the type of - rule and actions. + fieldmap_properties: + example: + path: path + array: true + format: format + ignore_above: 0 + index: true + dynamic: true + scaling_factor: 6 + type: scaled_float + properties: + key: + type: type + required: true properties: - actions: - default: [] - items: - $ref: '#/components/schemas/actions_inner' - nullable: true - required: - - group - - id - - params - type: array - consumer: + array: + description: Indicates whether the field is an array. + type: boolean + dynamic: + description: Indicates whether it is a dynamic field mapping. + type: boolean + format: description: | - The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. type: string - enabled: - description: Indicates whether you want to run the rule on an interval basis - after it is created. + ignore_above: + description: Specifies the maximum length of a string field. Longer strings + are not indexed or stored. + type: integer + index: + description: Indicates whether field values are indexed. type: boolean - name: - description: "The name of the rule. While this name does not have to be\ - \ unique, a distinctive name can help you identify a rule." - example: cluster_health_rule + path: + description: TBD type: string - notify_when: - $ref: '#/components/schemas/notify_when' - params: - additionalProperties: true - description: The parameters for the rule. - type: object - rule_type_id: + properties: + additionalProperties: + $ref: '#/components/schemas/fieldmap_properties_properties_value' description: | - The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. + Details about the object properties. This property is applicable when `type` is `object`. + required: + description: Indicates whether the field is required. + type: boolean + scaling_factor: + description: "The scaling factor to use when encoding values. This property\ + \ is applicable when `type` is `scaled_float`. Values will be multiplied\ + \ by this factor at index time and rounded to the closest long value.\ + \ \n" + type: integer + type: + description: Specifies the data type for the field. + example: scaled_float type: string - schedule: - $ref: '#/components/schemas/schedule' - tags: - default: [] - description: The tags for the rule. - items: - type: string - type: array - throttle: - description: "The throttle interval, which defines how often an alert generates\ - \ repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`.\ - \ It is specified in seconds, minutes, hours, or days." - example: 10m - nullable: true + title: Field map objects in the get rule types response + "400_response": + properties: + error: + enum: + - Bad Request type: string + message: + type: string + statusCode: + enum: + - 400 + type: integer required: - - consumer - - name - - params - - rule_type_id - - schedule - title: Create rule request - type: object + - error + - message + - statusCode + title: Bad request alert_response_properties: example: - alertTypeId: .index-threshold + alertTypeId: alertTypeId throttle: throttle - updatedBy: elastic + updatedBy: updatedBy executionStatus: - lastExecutionDate: 2022-12-06T00:13:43.89Z - status: ok + lastExecutionDate: 2000-01-23T04:56:07.000+00:00 + status: status params: key: "" enabled: true @@ -2388,65 +2696,55 @@ components: tags: - tags - tags - createdAt: 2022-12-05T23:36:58.284Z + createdAt: 2000-01-23T04:56:07.000+00:00 schedule: interval: interval - notifyWhen: onActionGroupChange - createdBy: elastic - muteAll: false - name: my alert - scheduledTaskId: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef + notifyWhen: notifyWhen + createdBy: createdBy + muteAll: true + name: name + scheduledTaskId: scheduledTaskId + id: id actions: - "{}" - "{}" - apiKeyOwner: elastic - updatedAt: 2022-12-05T23:36:58.284Z + apiKeyOwner: apiKeyOwner + updatedAt: updatedAt properties: actions: items: type: object type: array alertTypeId: - example: .index-threshold type: string apiKeyOwner: - example: elastic nullable: true type: string createdAt: description: The date and time that the alert was created. - example: 2022-12-05T23:36:58.284Z format: date-time type: string createdBy: description: The identifier for the user that created the alert. - example: elastic type: string enabled: description: Indicates whether the alert is currently enabled. - example: true type: boolean executionStatus: $ref: '#/components/schemas/alert_response_properties_executionStatus' id: description: The identifier for the alert. - example: b530fed0-74f5-11ed-9801-35303b735aef type: string muteAll: - example: false type: boolean mutedInstanceIds: items: type: string - nullable: true type: array name: description: The name of the alert. - example: my alert type: string notifyWhen: - example: onActionGroupChange type: string params: additionalProperties: true @@ -2454,7 +2752,6 @@ components: schedule: $ref: '#/components/schemas/alert_response_properties_schedule' scheduledTaskId: - example: b530fed0-74f5-11ed-9801-35303b735aef type: string tags: items: @@ -2464,149 +2761,327 @@ components: nullable: true type: string updatedAt: - example: 2022-12-05T23:36:58.284Z type: string updatedBy: description: The identifier for the user that updated this alert most recently. - example: elastic nullable: true type: string title: Legacy alert response properties - type: object findRules_has_reference_parameter: properties: id: + nullable: true type: string type: + nullable: true type: string - type: object - findRules_search_fields_parameter: - oneOf: - - type: string - - items: - type: string - type: array findRules_200_response: example: per_page: 6 total: 1 data: - - throttle: 10m - created_at: 2022-12-05T23:36:58.284Z + - throttle: throttle + created_at: 2000-01-23T04:56:07.000+00:00 + api_key_created_by_user: true + enabled: true + running: true + notify_when: notify_when + next_run: 2000-01-23T04:56:07.000+00:00 + updated_at: updated_at + execution_status: + last_execution_date: 2000-01-23T04:56:07.000+00:00 + last_duration: 6 + status: status + scheduled_task_id: scheduled_task_id + id: id + consumer: consumer + alert_delay: + active: 3 last_run: alerts_count: - ignored: 6 - new: 1 - recovered: 5 - active: 0 - outcome_msg: outcome_msg + ignored: 5 + new: 5 + recovered: 2 + active: 1 + outcome_msg: + - outcome_msg + - outcome_msg + outcome_order: 7 warning: warning - outcome: succeeded + outcome: outcome params: key: "" - created_by: elastic - enabled: true + created_by: created_by muted_alert_ids: - muted_alert_ids - muted_alert_ids - rule_type_id: monitoring_alert_cluster_health + rule_type_id: rule_type_id + revision: 9 tags: - tags - tags - running: true - api_key_owner: elastic + api_key_owner: api_key_owner schedule: - interval: 1m - notify_when: onActiveAlert - next_run: 2022-12-06T00:14:43.818Z - updated_at: 2022-12-05T23:36:58.284Z - execution_status: - last_execution_date: 2022-12-06T00:13:43.89Z - last_duration: 55 - status: ok - name: cluster_health_rule - updated_by: elastic - scheduled_task_id: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef - mute_all: false + interval: interval + name: name + updated_by: updated_by + mute_all: true actions: - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + throttle: throttle + notify_when: null + group: group + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - consumer: alerts - - throttle: 10m - created_at: 2022-12-05T23:36:58.284Z + throttle: throttle + notify_when: null + group: group + - throttle: throttle + created_at: 2000-01-23T04:56:07.000+00:00 + api_key_created_by_user: true + enabled: true + running: true + notify_when: notify_when + next_run: 2000-01-23T04:56:07.000+00:00 + updated_at: updated_at + execution_status: + last_execution_date: 2000-01-23T04:56:07.000+00:00 + last_duration: 6 + status: status + scheduled_task_id: scheduled_task_id + id: id + consumer: consumer + alert_delay: + active: 3 last_run: alerts_count: - ignored: 6 - new: 1 - recovered: 5 - active: 0 - outcome_msg: outcome_msg + ignored: 5 + new: 5 + recovered: 2 + active: 1 + outcome_msg: + - outcome_msg + - outcome_msg + outcome_order: 7 warning: warning - outcome: succeeded + outcome: outcome params: key: "" - created_by: elastic - enabled: true + created_by: created_by muted_alert_ids: - muted_alert_ids - muted_alert_ids - rule_type_id: monitoring_alert_cluster_health + rule_type_id: rule_type_id + revision: 9 tags: - tags - tags - running: true - api_key_owner: elastic + api_key_owner: api_key_owner schedule: - interval: 1m - notify_when: onActiveAlert - next_run: 2022-12-06T00:14:43.818Z - updated_at: 2022-12-05T23:36:58.284Z - execution_status: - last_execution_date: 2022-12-06T00:13:43.89Z - last_duration: 55 - status: ok - name: cluster_health_rule - updated_by: elastic - scheduled_task_id: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef - mute_all: false + interval: interval + name: name + updated_by: updated_by + mute_all: true actions: - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - - id: 9dca3e00-74f5-11ed-9801-35303b735aef + throttle: throttle + notify_when: null + group: group + - alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default - consumer: alerts + throttle: throttle + notify_when: null + group: group page: 0 properties: data: @@ -2619,114 +3094,64 @@ components: type: integer total: type: integer - type: object - getAlertingHealth_200_response_alerting_framework_heath_decryption_health: - example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - properties: - status: - example: ok - type: string - timestamp: - example: 2023-01-13T01:28:00.28Z - format: date-time - type: string - type: object - getAlertingHealth_200_response_alerting_framework_heath: - deprecated: true - description: This property has a typo. Use `alerting_framework_health` instead. - example: - _deprecated: "This state property has a typo, use \"alerting_framework_health\"\ - \ instead." - execution_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - read_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - decryption_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - properties: - _deprecated: - example: "This state property has a typo, use \"alerting_framework_health\"\ - \ instead." - type: string - decryption_health: - $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_heath_decryption_health' - execution_health: - $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_heath_decryption_health' - read_health: - $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_heath_decryption_health' - type: object getAlertingHealth_200_response_alerting_framework_health_decryption_health: description: The timestamp and status of the rule decryption. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object getAlertingHealth_200_response_alerting_framework_health_execution_health: description: The timestamp and status of the rule run. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object getAlertingHealth_200_response_alerting_framework_health_read_health: description: The timestamp and status of the rule reading events. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object getAlertingHealth_200_response_alerting_framework_health: description: | Three substates identify the health of the alerting framework: `decryption_health`, `execution_health`, and `read_health`. example: execution_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 read_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 decryption_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: decryption_health: $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_health_decryption_health' @@ -2734,58 +3159,41 @@ components: $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_health_execution_health' read_health: $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_health_read_health' - type: object getAlertingHealth_200_response: example: alerting_framework_health: execution_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - read_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - decryption_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z - alerting_framework_heath: - _deprecated: "This state property has a typo, use \"alerting_framework_health\"\ - \ instead." - execution_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 read_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 decryption_health: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 has_permanent_encryption_key: true is_sufficiently_secure: true properties: - alerting_framework_heath: - $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_heath' alerting_framework_health: $ref: '#/components/schemas/getAlertingHealth_200_response_alerting_framework_health' has_permanent_encryption_key: description: "If `false`, the encrypted saved object plugin does not have\ \ a permanent encryption key." - example: true type: boolean is_sufficiently_secure: description: "If `false`, security is enabled but TLS is not." - example: true type: boolean - type: object getRuleTypes_200_response_inner_action_groups_inner: example: name: name id: id properties: id: + nullable: true type: string name: + nullable: true type: string - type: object getRuleTypes_200_response_inner_action_variables_context_inner: example: name: name @@ -2793,13 +3201,25 @@ components: useWithTripleBracesInTemplates: true properties: name: + nullable: true type: string description: + nullable: true type: string useWithTripleBracesInTemplates: type: boolean - type: object getRuleTypes_200_response_inner_action_variables_params_inner: + example: + name: name + description: description + properties: + description: + nullable: true + type: string + name: + nullable: true + type: string + getRuleTypes_200_response_inner_action_variables_state_inner: example: name: name description: description @@ -2808,7 +3228,6 @@ components: type: string name: type: string - type: object getRuleTypes_200_response_inner_action_variables: description: | A list of action variables that the rule type makes available via context and state in action parameter templates, and a short human readable description. When you create a rule in Kibana, it uses this information to prompt you for these variables in action parameter editors. @@ -2841,9 +3260,102 @@ components: type: array state: items: - $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables_params_inner' + $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables_state_inner' type: array - type: object + getRuleTypes_200_response_inner_alerts_mappings: + example: + fieldMap: + key: + path: path + array: true + format: format + ignore_above: 0 + index: true + dynamic: true + scaling_factor: 6 + type: scaled_float + properties: + key: + type: type + required: true + properties: + fieldMap: + additionalProperties: + $ref: '#/components/schemas/fieldmap_properties' + description: | + Mapping information for each field supported in alerts as data documents for this rule type. For more information about mapping parameters, refer to the Elasticsearch documentation. + getRuleTypes_200_response_inner_alerts: + description: | + Details for writing alerts as data documents for this rule type. + example: + shouldWrite: true + mappings: + fieldMap: + key: + path: path + array: true + format: format + ignore_above: 0 + index: true + dynamic: true + scaling_factor: 6 + type: scaled_float + properties: + key: + type: type + required: true + useEcs: true + context: ml.anomaly-detection + useLegacyAlerts: false + dynamic: "false" + isSpaceAware: true + secondaryAlias: secondaryAlias + properties: + context: + description: | + The namespace for this rule type. + enum: + - ml.anomaly-detection + - observability.apm + - observability.logs + - observability.metrics + - observability.slo + - observability.threshold + - observability.uptime + - security + - stack + type: string + dynamic: + description: Indicates whether new fields are added dynamically. + enum: + - "false" + - runtime + - strict + - "true" + type: string + isSpaceAware: + description: | + Indicates whether the alerts are space-aware. If true, space-specific alert indices are used. + type: boolean + mappings: + $ref: '#/components/schemas/getRuleTypes_200_response_inner_alerts_mappings' + secondaryAlias: + description: | + A secondary alias. It is typically used to support the signals alias for detection rules. + type: string + shouldWrite: + description: | + Indicates whether the rule should write out alerts as data. + type: boolean + useEcs: + description: | + Indicates whether to include the ECS component template for the alerts. + type: boolean + useLegacyAlerts: + default: false + description: | + Indicates whether to include the legacy component template for the alerts. + type: boolean getRuleTypes_200_response_inner_authorized_consumers_alerts: example: all: true @@ -2853,7 +3365,6 @@ components: type: boolean read: type: boolean - type: object getRuleTypes_200_response_inner_authorized_consumers: description: The list of the plugins IDs that have access to the rule type. example: @@ -2869,6 +3380,9 @@ components: infrastructure: all: true read: true + slo: + all: true + read: true siem: all: true read: true @@ -2904,11 +3418,12 @@ components: $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers_alerts' siem: $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers_alerts' + slo: + $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers_alerts' stackAlerts: $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers_alerts' uptime: $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers_alerts' - type: object getRuleTypes_200_response_inner_recovery_action_group: description: An action group to use when an alert goes from an active state to an inactive one. @@ -2917,12 +3432,15 @@ components: id: id properties: id: + nullable: true type: string name: + nullable: true type: string - type: object getRuleTypes_200_response_inner: example: + has_alerts_mappings: true + has_fields_for_a_a_d: true recovery_action_group: name: name id: id @@ -2941,6 +3459,9 @@ components: infrastructure: all: true read: true + slo: + all: true + read: true siem: all: true read: true @@ -2964,7 +3485,7 @@ components: id: id - name: name id: id - minimum_license_required: basic + minimum_license_required: minimum_license_required action_variables: context: - name: name @@ -2983,23 +3504,55 @@ components: description: description - name: name description: description - rule_task_timeout: 5m + alerts: + shouldWrite: true + mappings: + fieldMap: + key: + path: path + array: true + format: format + ignore_above: 0 + index: true + dynamic: true + scaling_factor: 6 + type: scaled_float + properties: + key: + type: type + required: true + useEcs: true + context: ml.anomaly-detection + useLegacyAlerts: false + dynamic: "false" + isSpaceAware: true + secondaryAlias: secondaryAlias + rule_task_timeout: rule_task_timeout name: name enabled_in_license: true - producer: stackAlerts + producer: producer id: id + category: management default_action_group_id: default_action_group_id properties: action_groups: - description: | - An explicit list of groups for which the rule type can schedule actions, each with the action group's unique ID and human readable name. Rule actions validation uses this configuration to ensure that groups are valid. items: $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_groups_inner' type: array action_variables: $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables' + alerts: + $ref: '#/components/schemas/getRuleTypes_200_response_inner_alerts' authorized_consumers: $ref: '#/components/schemas/getRuleTypes_200_response_inner_authorized_consumers' + category: + description: "The rule category, which is used by features such as category-specific\ + \ maintenance windows." + enum: + - management + - observability + - securitySolution + type: string default_action_group_id: description: The default identifier for the rule type group. type: string @@ -3011,6 +3564,12 @@ components: description: Indicates whether the rule type is enabled or disabled based on the subscription. type: boolean + has_alerts_mappings: + description: Indicates whether the rule type has custom mappings for the + alert data. + type: boolean + has_fields_for_a_a_d: + type: boolean id: description: The unique identifier for the rule type. type: string @@ -3020,21 +3579,17 @@ components: type: boolean minimum_license_required: description: The subscriptions required to use the rule type. - example: basic type: string name: description: The descriptive name of the rule type. type: string producer: description: An identifier for the application that produces this rule type. - example: stackAlerts type: string recovery_action_group: $ref: '#/components/schemas/getRuleTypes_200_response_inner_recovery_action_group' rule_task_timeout: - example: 5m type: string - type: object Legacy_update_alert_request_properties_actions_inner: properties: actionTypeId: @@ -3056,7 +3611,6 @@ components: - group - id - params - type: object Legacy_update_alert_request_properties_schedule: description: | The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule. @@ -3064,9 +3618,7 @@ components: interval: description: "The interval format specifies the interval in seconds, minutes,\ \ hours or days at which the alert should execute." - example: 1d type: string - type: object Legacy_update_alert_request_properties: properties: actions: @@ -3091,8 +3643,8 @@ components: schedule: $ref: '#/components/schemas/Legacy_update_alert_request_properties_schedule' tags: - description: A list of keywords to reference and search. items: + nullable: true type: string type: array throttle: @@ -3105,17 +3657,6 @@ components: - params - schedule title: Legacy update alert request properties - type: object - Legacy_create_alert_request_properties_schedule: - description: | - The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule. - properties: - interval: - description: "The interval format specifies the interval in seconds, minutes,\ - \ hours or days at which the alert should execute." - example: 10s - type: string - type: object Legacy_create_alert_request_properties: properties: actions: @@ -3151,9 +3692,8 @@ components: \ if defined." type: object schedule: - $ref: '#/components/schemas/Legacy_create_alert_request_properties_schedule' + $ref: '#/components/schemas/Legacy_update_alert_request_properties_schedule' tags: - description: A list of keywords to reference and search. items: type: string type: array @@ -3169,18 +3709,23 @@ components: - params - schedule title: Legacy create alert request properties - type: object + legacyFindAlerts_has_reference_parameter: + properties: + id: + type: string + type: + type: string legacyFindAlerts_200_response: example: total: 1 perPage: 6 data: - - alertTypeId: .index-threshold + - alertTypeId: alertTypeId throttle: throttle - updatedBy: elastic + updatedBy: updatedBy executionStatus: - lastExecutionDate: 2022-12-06T00:13:43.89Z - status: ok + lastExecutionDate: 2000-01-23T04:56:07.000+00:00 + status: status params: key: "" enabled: true @@ -3190,26 +3735,26 @@ components: tags: - tags - tags - createdAt: 2022-12-05T23:36:58.284Z + createdAt: 2000-01-23T04:56:07.000+00:00 schedule: interval: interval - notifyWhen: onActionGroupChange - createdBy: elastic - muteAll: false - name: my alert - scheduledTaskId: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef + notifyWhen: notifyWhen + createdBy: createdBy + muteAll: true + name: name + scheduledTaskId: scheduledTaskId + id: id actions: - "{}" - "{}" - apiKeyOwner: elastic - updatedAt: 2022-12-05T23:36:58.284Z - - alertTypeId: .index-threshold + apiKeyOwner: apiKeyOwner + updatedAt: updatedAt + - alertTypeId: alertTypeId throttle: throttle - updatedBy: elastic + updatedBy: updatedBy executionStatus: - lastExecutionDate: 2022-12-06T00:13:43.89Z - status: ok + lastExecutionDate: 2000-01-23T04:56:07.000+00:00 + status: status params: key: "" enabled: true @@ -3219,20 +3764,20 @@ components: tags: - tags - tags - createdAt: 2022-12-05T23:36:58.284Z + createdAt: 2000-01-23T04:56:07.000+00:00 schedule: interval: interval - notifyWhen: onActionGroupChange - createdBy: elastic - muteAll: false - name: my alert - scheduledTaskId: b530fed0-74f5-11ed-9801-35303b735aef - id: b530fed0-74f5-11ed-9801-35303b735aef + notifyWhen: notifyWhen + createdBy: createdBy + muteAll: true + name: name + scheduledTaskId: scheduledTaskId + id: id actions: - "{}" - "{}" - apiKeyOwner: elastic - updatedAt: 2022-12-05T23:36:58.284Z + apiKeyOwner: apiKeyOwner + updatedAt: updatedAt page: 0 properties: data: @@ -3245,74 +3790,64 @@ components: type: integer total: type: integer - type: object legacyGetAlertingHealth_200_response_alertingFrameworkHealth_decryptionHealth: description: The timestamp and status of the alert decryption. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object legacyGetAlertingHealth_200_response_alertingFrameworkHealth_executionHealth: description: The timestamp and status of the alert execution. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object legacyGetAlertingHealth_200_response_alertingFrameworkHealth_readHealth: description: The timestamp and status of the alert reading events. example: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: status: enum: - error - ok - warn - example: ok type: string timestamp: - example: 2023-01-13T01:28:00.28Z format: date-time type: string - type: object legacyGetAlertingHealth_200_response_alertingFrameworkHealth: description: | Three substates identify the health of the alerting framework: `decryptionHealth`, `executionHealth`, and `readHealth`. example: executionHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 decryptionHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 readHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 properties: decryptionHealth: $ref: '#/components/schemas/legacyGetAlertingHealth_200_response_alertingFrameworkHealth_decryptionHealth' @@ -3320,20 +3855,19 @@ components: $ref: '#/components/schemas/legacyGetAlertingHealth_200_response_alertingFrameworkHealth_executionHealth' readHealth: $ref: '#/components/schemas/legacyGetAlertingHealth_200_response_alertingFrameworkHealth_readHealth' - type: object legacyGetAlertingHealth_200_response: example: hasPermanentEncryptionKey: true alertingFrameworkHealth: executionHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 decryptionHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 readHealth: - status: ok - timestamp: 2023-01-13T01:28:00.28Z + status: error + timestamp: 2000-01-23T04:56:07.000+00:00 isSufficientlySecure: true properties: alertingFrameworkHealth: @@ -3341,23 +3875,19 @@ components: hasPermanentEncryptionKey: description: "If `false`, the encrypted saved object plugin does not have\ \ a permanent encryption key." - example: true type: boolean isSufficientlySecure: description: "If `false`, security is enabled but TLS is not." - example: true type: boolean - type: object - legacyGetAlertTypes_200_response_inner_actionVariables_context_inner: + legacyGetAlertTypes_200_response_inner_actionGroups_inner: example: name: name - description: description + id: id properties: - name: + id: type: string - description: + name: type: string - type: object legacyGetAlertTypes_200_response_inner_actionVariables: description: | A list of action variables that the alert type makes available via context and state in action parameter templates, and a short human readable description. The Alert UI will use this information to prompt users for these variables in action parameter editors. @@ -3367,30 +3897,33 @@ components: description: description - name: name description: description - state: - - name: name - description: description - - name: name - description: description - params: - - name: name - description: description - - name: name - description: description + state: "" + params: "" properties: context: items: - $ref: '#/components/schemas/legacyGetAlertTypes_200_response_inner_actionVariables_context_inner' + $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables_state_inner' type: array params: items: - $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables_params_inner' - type: array + example: + name: name + description: description + properties: + description: + type: string + name: + type: string state: items: - $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_variables_params_inner' - type: array - type: object + example: + name: name + description: description + properties: + description: + type: string + name: + type: string legacyGetAlertTypes_200_response_inner_recoveryActionGroup: description: | An action group to use when an alert instance goes from an active state to an inactive one. If it is not specified, the default recovered action group is used. @@ -3399,10 +3932,11 @@ components: id: id properties: id: + nullable: true type: string name: + nullable: true type: string - type: object legacyGetAlertTypes_200_response_inner: example: defaultActionGroupId: defaultActionGroupId @@ -3413,16 +3947,8 @@ components: description: description - name: name description: description - state: - - name: name - description: description - - name: name - description: description - params: - - name: name - description: description - - name: name - description: description + state: "" + params: "" actionGroups: - name: name id: id @@ -3439,10 +3965,8 @@ components: minimumLicenseRequired: minimumLicenseRequired properties: actionGroups: - description: | - An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert actions validation uses this configuration to ensure that groups are valid. items: - $ref: '#/components/schemas/getRuleTypes_200_response_inner_action_groups_inner' + $ref: '#/components/schemas/legacyGetAlertTypes_200_response_inner_actionGroups_inner' type: array actionVariables: $ref: '#/components/schemas/legacyGetAlertTypes_200_response_inner_actionVariables' @@ -3474,59 +3998,266 @@ components: type: string recoveryActionGroup: $ref: '#/components/schemas/legacyGetAlertTypes_200_response_inner_recoveryActionGroup' - type: object + filter_meta: + example: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + properties: + alias: + nullable: true + type: string + controlledBy: + type: string + disabled: + type: boolean + field: + type: string + group: + type: string + index: + type: string + isMultiIndex: + type: boolean + key: + type: string + negate: + type: boolean + params: + type: object + type: + type: string + value: + type: string + actions_inner_alerts_filter_query: + description: Defines a query filter that determines whether the action runs. + example: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + properties: + kql: + description: A filter written in Kibana Query Language (KQL). + type: string + filters: + items: + $ref: '#/components/schemas/filter' + type: array + actions_inner_alerts_filter_timeframe_hours: + description: | + Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day. + example: + start: start + end: end + properties: + end: + description: The end of the time frame in 24-hour notation (`hh:mm`). + type: string + start: + description: The start of the time frame in 24-hour notation (`hh:mm`). + type: string + actions_inner_alerts_filter_timeframe: + description: Defines a period that limits whether the action runs. + example: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + properties: + days: + items: + type: integer + type: array + hours: + $ref: '#/components/schemas/actions_inner_alerts_filter_timeframe_hours' + timezone: + description: | + The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended. + type: string + actions_inner_alerts_filter: + description: | + Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs. + example: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + properties: + query: + $ref: '#/components/schemas/actions_inner_alerts_filter_query' + timeframe: + $ref: '#/components/schemas/actions_inner_alerts_filter_timeframe' actions_inner_frequency: description: | - The parameters that affect how often actions are generated. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. + The properties that affect how often actions are generated. If the rule type supports setting `summary` to `true`, the action can be a summary of alerts at the specified notification interval. Otherwise, an action runs for each alert at the specified notification interval. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. example: summary: true - throttle: 10m - notify_when: onActiveAlert + throttle: throttle + notify_when: null properties: notify_when: - $ref: '#/components/schemas/notify_when' + $ref: '#/components/schemas/notify_when_action' summary: description: Indicates whether the action is a summary. type: boolean throttle: - description: "The throttle interval, which defines how often an alert generates\ - \ repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`.\ - \ It is specified in seconds, minutes, hours, or days." - example: 10m + description: | + The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. nullable: true type: string required: - notify_when - summary - type: object actions_inner: + description: | + An action that runs under defined conditions. example: - id: 9dca3e00-74f5-11ed-9801-35303b735aef + alerts_filter: + timeframe: + hours: + start: start + end: end + timezone: timezone + days: + - 0 + - 0 + query: + kql: kql + filters: + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + - $state: "{}" + meta: + field: field + controlledBy: controlledBy + negate: true + alias: alias + index: index + disabled: true + params: "{}" + type: type + value: value + isMultiIndex: true + key: key + group: group + query: "{}" + id: id params: key: "" - connector_type_id: .server-log + uuid: uuid + connector_type_id: connector_type_id frequency: summary: true - throttle: 10m - notify_when: onActiveAlert - group: default + throttle: throttle + notify_when: null + group: group properties: + alerts_filter: + $ref: '#/components/schemas/actions_inner_alerts_filter' connector_type_id: description: The type of connector. This property appears in responses but cannot be set in requests. - example: .server-log readOnly: true type: string frequency: $ref: '#/components/schemas/actions_inner_frequency' group: - description: "The group name for the actions. If you don't need to group\ - \ actions, set to `default`." - example: default + description: | + The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`. type: string id: description: The identifier for the connector saved object. - example: 9dca3e00-74f5-11ed-9801-35303b735aef type: string params: additionalProperties: true @@ -3534,30 +4265,32 @@ components: \ The `params` are handled as Mustache templates and passed a default\ \ set of context." type: object - type: object + uuid: + description: A universally unique identifier (UUID) for the action. + type: string + required: + - group + - id + - params rule_response_properties_execution_status: example: - last_execution_date: 2022-12-06T00:13:43.89Z - last_duration: 55 - status: ok + last_execution_date: 2000-01-23T04:56:07.000+00:00 + last_duration: 6 + status: status properties: last_duration: - example: 55 type: integer last_execution_date: - example: 2022-12-06T00:13:43.89Z format: date-time type: string status: - example: ok type: string - type: object rule_response_properties_last_run_alerts_count: example: - ignored: 6 - new: 1 - recovered: 5 - active: 0 + ignored: 5 + new: 5 + recovered: 2 + active: 1 properties: active: type: integer @@ -3567,52 +4300,56 @@ components: type: integer recovered: type: integer - type: object rule_response_properties_last_run: example: alerts_count: - ignored: 6 - new: 1 - recovered: 5 - active: 0 - outcome_msg: outcome_msg + ignored: 5 + new: 5 + recovered: 2 + active: 1 + outcome_msg: + - outcome_msg + - outcome_msg + outcome_order: 7 warning: warning - outcome: succeeded + outcome: outcome properties: alerts_count: $ref: '#/components/schemas/rule_response_properties_last_run_alerts_count' outcome: - example: succeeded type: string outcome_msg: - nullable: true - type: string - example: null + items: + type: string + type: array + outcome_order: + type: integer warning: nullable: true type: string - example: null - type: object + fieldmap_properties_properties_value: + example: + type: type + properties: + type: + description: The data type for each object property. + type: string alert_response_properties_executionStatus: example: - lastExecutionDate: 2022-12-06T00:13:43.89Z - status: ok + lastExecutionDate: 2000-01-23T04:56:07.000+00:00 + status: status properties: lastExecutionDate: - example: 2022-12-06T00:13:43.89Z format: date-time type: string status: - example: ok type: string - type: object alert_response_properties_schedule: example: interval: interval properties: interval: type: string - type: object securitySchemes: basicAuth: scheme: basic diff --git a/generated/alerting/api_alerting.go b/generated/alerting/api_alerting.go index 965a0d993..57a4ce27c 100644 --- a/generated/alerting/api_alerting.go +++ b/generated/alerting/api_alerting.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,26 +23,42 @@ import ( type AlertingAPI interface { /* - CreateRule Creates a rule. + CreateRule Creates a rule with a randomly generated rule identifier. - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you create a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If a user with different privileges updates the rule, its behavior might change. + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @param ruleId An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. @return ApiCreateRuleRequest */ - CreateRule(ctx context.Context, spaceId string, ruleId string) ApiCreateRuleRequest + CreateRule(ctx context.Context, spaceId interface{}) ApiCreateRuleRequest // CreateRuleExecute executes the request // @return RuleResponseProperties CreateRuleExecute(r ApiCreateRuleRequest) (*RuleResponseProperties, *http.Response, error) + /* + CreateRuleId Creates a rule with a specific rule identifier. + + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @param ruleId An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. + @return ApiCreateRuleIdRequest + */ + CreateRuleId(ctx context.Context, spaceId interface{}, ruleId string) ApiCreateRuleIdRequest + + // CreateRuleIdExecute executes the request + // @return RuleResponseProperties + CreateRuleIdExecute(r ApiCreateRuleIdRequest) (*RuleResponseProperties, *http.Response, error) + /* DeleteRule Deletes a rule. - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. + To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -50,7 +66,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiDeleteRuleRequest */ - DeleteRule(ctx context.Context, ruleId string, spaceId string) ApiDeleteRuleRequest + DeleteRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiDeleteRuleRequest // DeleteRuleExecute executes the request DeleteRuleExecute(r ApiDeleteRuleRequest) (*http.Response, error) @@ -66,7 +82,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiDisableRuleRequest */ - DisableRule(ctx context.Context, ruleId string, spaceId string) ApiDisableRuleRequest + DisableRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiDisableRuleRequest // DisableRuleExecute executes the request DisableRuleExecute(r ApiDisableRuleRequest) (*http.Response, error) @@ -74,7 +90,7 @@ type AlertingAPI interface { /* EnableRule Enables a rule. - This API supports token-based authentication only. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. + To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -82,7 +98,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiEnableRuleRequest */ - EnableRule(ctx context.Context, ruleId string, spaceId string) ApiEnableRuleRequest + EnableRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiEnableRuleRequest // EnableRuleExecute executes the request EnableRuleExecute(r ApiEnableRuleRequest) (*http.Response, error) @@ -97,7 +113,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiFindRulesRequest */ - FindRules(ctx context.Context, spaceId string) ApiFindRulesRequest + FindRules(ctx context.Context, spaceId interface{}) ApiFindRulesRequest // FindRulesExecute executes the request // @return FindRules200Response @@ -113,7 +129,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetAlertingHealthRequest */ - GetAlertingHealth(ctx context.Context, spaceId string) ApiGetAlertingHealthRequest + GetAlertingHealth(ctx context.Context, spaceId interface{}) ApiGetAlertingHealthRequest // GetAlertingHealthExecute executes the request // @return GetAlertingHealth200Response @@ -130,7 +146,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetRuleRequest */ - GetRule(ctx context.Context, ruleId string, spaceId string) ApiGetRuleRequest + GetRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiGetRuleRequest // GetRuleExecute executes the request // @return RuleResponseProperties @@ -146,7 +162,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetRuleTypesRequest */ - GetRuleTypes(ctx context.Context, spaceId string) ApiGetRuleTypesRequest + GetRuleTypes(ctx context.Context, spaceId interface{}) ApiGetRuleTypesRequest // GetRuleTypesExecute executes the request // @return []GetRuleTypes200ResponseInner @@ -164,7 +180,7 @@ type AlertingAPI interface { Deprecated */ - LegacyCreateAlert(ctx context.Context, alertId string, spaceId string) ApiLegacyCreateAlertRequest + LegacyCreateAlert(ctx context.Context, alertId string, spaceId interface{}) ApiLegacyCreateAlertRequest // LegacyCreateAlertExecute executes the request // @return AlertResponseProperties @@ -183,7 +199,7 @@ type AlertingAPI interface { Deprecated */ - LegacyDisableAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyDisableAlertRequest + LegacyDisableAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyDisableAlertRequest // LegacyDisableAlertExecute executes the request // Deprecated @@ -201,7 +217,7 @@ type AlertingAPI interface { Deprecated */ - LegacyEnableAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyEnableAlertRequest + LegacyEnableAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyEnableAlertRequest // LegacyEnableAlertExecute executes the request // Deprecated @@ -219,7 +235,7 @@ type AlertingAPI interface { Deprecated */ - LegacyFindAlerts(ctx context.Context, spaceId string) ApiLegacyFindAlertsRequest + LegacyFindAlerts(ctx context.Context, spaceId interface{}) ApiLegacyFindAlertsRequest // LegacyFindAlertsExecute executes the request // @return LegacyFindAlerts200Response @@ -238,7 +254,7 @@ type AlertingAPI interface { Deprecated */ - LegacyGetAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyGetAlertRequest + LegacyGetAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyGetAlertRequest // LegacyGetAlertExecute executes the request // @return AlertResponseProperties @@ -256,7 +272,7 @@ type AlertingAPI interface { Deprecated */ - LegacyGetAlertTypes(ctx context.Context, spaceId string) ApiLegacyGetAlertTypesRequest + LegacyGetAlertTypes(ctx context.Context, spaceId interface{}) ApiLegacyGetAlertTypesRequest // LegacyGetAlertTypesExecute executes the request // @return []LegacyGetAlertTypes200ResponseInner @@ -274,7 +290,7 @@ type AlertingAPI interface { Deprecated */ - LegacyGetAlertingHealth(ctx context.Context, spaceId string) ApiLegacyGetAlertingHealthRequest + LegacyGetAlertingHealth(ctx context.Context, spaceId interface{}) ApiLegacyGetAlertingHealthRequest // LegacyGetAlertingHealthExecute executes the request // @return LegacyGetAlertingHealth200Response @@ -294,7 +310,7 @@ type AlertingAPI interface { Deprecated */ - LegacyMuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest + LegacyMuteAlertInstance(ctx context.Context, spaceId interface{}, alertId string, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest // LegacyMuteAlertInstanceExecute executes the request // Deprecated @@ -312,7 +328,7 @@ type AlertingAPI interface { Deprecated */ - LegacyMuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) ApiLegacyMuteAllAlertInstancesRequest + LegacyMuteAllAlertInstances(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyMuteAllAlertInstancesRequest // LegacyMuteAllAlertInstancesExecute executes the request // Deprecated @@ -331,7 +347,7 @@ type AlertingAPI interface { Deprecated */ - LegacyUnmuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest + LegacyUnmuteAlertInstance(ctx context.Context, spaceId interface{}, alertId string, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest // LegacyUnmuteAlertInstanceExecute executes the request // Deprecated @@ -349,7 +365,7 @@ type AlertingAPI interface { Deprecated */ - LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest + LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest // LegacyUnmuteAllAlertInstancesExecute executes the request // Deprecated @@ -367,7 +383,7 @@ type AlertingAPI interface { Deprecated */ - LegacyUpdateAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyUpdateAlertRequest + LegacyUpdateAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyUpdateAlertRequest // LegacyUpdateAlertExecute executes the request // @return AlertResponseProperties @@ -387,7 +403,7 @@ type AlertingAPI interface { Deprecated */ - LegaryDeleteAlert(ctx context.Context, spaceId string, alertId string) ApiLegaryDeleteAlertRequest + LegaryDeleteAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegaryDeleteAlertRequest // LegaryDeleteAlertExecute executes the request // Deprecated @@ -405,7 +421,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiMuteAlertRequest */ - MuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) ApiMuteAlertRequest + MuteAlert(ctx context.Context, alertId interface{}, ruleId interface{}, spaceId interface{}) ApiMuteAlertRequest // MuteAlertExecute executes the request MuteAlertExecute(r ApiMuteAlertRequest) (*http.Response, error) @@ -421,7 +437,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiMuteAllAlertsRequest */ - MuteAllAlerts(ctx context.Context, ruleId string, spaceId string) ApiMuteAllAlertsRequest + MuteAllAlerts(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiMuteAllAlertsRequest // MuteAllAlertsExecute executes the request MuteAllAlertsExecute(r ApiMuteAllAlertsRequest) (*http.Response, error) @@ -438,7 +454,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUnmuteAlertRequest */ - UnmuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) ApiUnmuteAlertRequest + UnmuteAlert(ctx context.Context, alertId interface{}, ruleId interface{}, spaceId interface{}) ApiUnmuteAlertRequest // UnmuteAlertExecute executes the request UnmuteAlertExecute(r ApiUnmuteAlertRequest) (*http.Response, error) @@ -454,7 +470,7 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUnmuteAllAlertsRequest */ - UnmuteAllAlerts(ctx context.Context, ruleId string, spaceId string) ApiUnmuteAllAlertsRequest + UnmuteAllAlerts(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUnmuteAllAlertsRequest // UnmuteAllAlertsExecute executes the request UnmuteAllAlertsExecute(r ApiUnmuteAllAlertsRequest) (*http.Response, error) @@ -462,7 +478,7 @@ type AlertingAPI interface { /* UpdateRule Updates the attributes for a rule. - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you update a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If you have different privileges than the user that created or most recently updated the rule, you might change its behavior. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. + To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -470,11 +486,26 @@ type AlertingAPI interface { @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUpdateRuleRequest */ - UpdateRule(ctx context.Context, ruleId string, spaceId string) ApiUpdateRuleRequest + UpdateRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUpdateRuleRequest // UpdateRuleExecute executes the request // @return RuleResponseProperties UpdateRuleExecute(r ApiUpdateRuleRequest) (*RuleResponseProperties, *http.Response, error) + + /* + UpdateRuleAPIKey Updates the API key for a rule. + + The new API key has the credentials of the user that submits the request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ruleId An identifier for the rule. + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @return ApiUpdateRuleAPIKeyRequest + */ + UpdateRuleAPIKey(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUpdateRuleAPIKeyRequest + + // UpdateRuleAPIKeyExecute executes the request + UpdateRuleAPIKeyExecute(r ApiUpdateRuleAPIKeyRequest) (*http.Response, error) } // AlertingAPIService AlertingAPI service @@ -483,14 +514,13 @@ type AlertingAPIService service type ApiCreateRuleRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string - ruleId string + kbnXsrf *interface{} + spaceId interface{} createRuleRequest *CreateRuleRequest } // Cross-site request forgery protection -func (r ApiCreateRuleRequest) KbnXsrf(kbnXsrf string) ApiCreateRuleRequest { +func (r ApiCreateRuleRequest) KbnXsrf(kbnXsrf interface{}) ApiCreateRuleRequest { r.kbnXsrf = &kbnXsrf return r } @@ -505,21 +535,19 @@ func (r ApiCreateRuleRequest) Execute() (*RuleResponseProperties, *http.Response } /* -CreateRule Creates a rule. +CreateRule Creates a rule with a randomly generated rule identifier. -You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you create a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If a user with different privileges updates the rule, its behavior might change. +To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @param ruleId An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. @return ApiCreateRuleRequest */ -func (a *AlertingAPIService) CreateRule(ctx context.Context, spaceId string, ruleId string) ApiCreateRuleRequest { +func (a *AlertingAPIService) CreateRule(ctx context.Context, spaceId interface{}) ApiCreateRuleRequest { return ApiCreateRuleRequest{ ApiService: a, ctx: ctx, spaceId: spaceId, - ruleId: ruleId, } } @@ -539,6 +567,170 @@ func (a *AlertingAPIService) CreateRuleExecute(r ApiCreateRuleRequest) (*RuleRes return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } + localVarPath := localBasePath + "/s/{spaceId}/api/alerting/rule" + localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kbnXsrf == nil { + return localVarReturnValue, nil, reportError("kbnXsrf is required and must be specified") + } + if r.createRuleRequest == nil { + return localVarReturnValue, nil, reportError("createRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") + // body params + localVarPostBody = r.createRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Model401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Model404Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateRuleIdRequest struct { + ctx context.Context + ApiService AlertingAPI + kbnXsrf *interface{} + spaceId interface{} + ruleId string + createRuleRequest *CreateRuleRequest +} + +// Cross-site request forgery protection +func (r ApiCreateRuleIdRequest) KbnXsrf(kbnXsrf interface{}) ApiCreateRuleIdRequest { + r.kbnXsrf = &kbnXsrf + return r +} + +func (r ApiCreateRuleIdRequest) CreateRuleRequest(createRuleRequest CreateRuleRequest) ApiCreateRuleIdRequest { + r.createRuleRequest = &createRuleRequest + return r +} + +func (r ApiCreateRuleIdRequest) Execute() (*RuleResponseProperties, *http.Response, error) { + return r.ApiService.CreateRuleIdExecute(r) +} + +/* +CreateRuleId Creates a rule with a specific rule identifier. + +To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @param ruleId An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. + @return ApiCreateRuleIdRequest +*/ +func (a *AlertingAPIService) CreateRuleId(ctx context.Context, spaceId interface{}, ruleId string) ApiCreateRuleIdRequest { + return ApiCreateRuleIdRequest{ + ApiService: a, + ctx: ctx, + spaceId: spaceId, + ruleId: ruleId, + } +} + +// Execute executes the request +// +// @return RuleResponseProperties +func (a *AlertingAPIService) CreateRuleIdExecute(r ApiCreateRuleIdRequest) (*RuleResponseProperties, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RuleResponseProperties + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertingAPIService.CreateRuleId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + localVarPath := localBasePath + "/s/{spaceId}/api/alerting/rule/{ruleId}" localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", url.PathEscape(parameterValueToString(r.ruleId, "ruleId")), -1) @@ -648,13 +840,13 @@ func (a *AlertingAPIService) CreateRuleExecute(r ApiCreateRuleRequest) (*RuleRes type ApiDeleteRuleRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiDeleteRuleRequest) KbnXsrf(kbnXsrf string) ApiDeleteRuleRequest { +func (r ApiDeleteRuleRequest) KbnXsrf(kbnXsrf interface{}) ApiDeleteRuleRequest { r.kbnXsrf = &kbnXsrf return r } @@ -666,14 +858,14 @@ func (r ApiDeleteRuleRequest) Execute() (*http.Response, error) { /* DeleteRule Deletes a rule. -You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. +To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param ruleId An identifier for the rule. @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiDeleteRuleRequest */ -func (a *AlertingAPIService) DeleteRule(ctx context.Context, ruleId string, spaceId string) ApiDeleteRuleRequest { +func (a *AlertingAPIService) DeleteRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiDeleteRuleRequest { return ApiDeleteRuleRequest{ ApiService: a, ctx: ctx, @@ -790,13 +982,13 @@ func (a *AlertingAPIService) DeleteRuleExecute(r ApiDeleteRuleRequest) (*http.Re type ApiDisableRuleRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiDisableRuleRequest) KbnXsrf(kbnXsrf string) ApiDisableRuleRequest { +func (r ApiDisableRuleRequest) KbnXsrf(kbnXsrf interface{}) ApiDisableRuleRequest { r.kbnXsrf = &kbnXsrf return r } @@ -815,7 +1007,7 @@ You must have `all` privileges for the appropriate Kibana features, depending on @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiDisableRuleRequest */ -func (a *AlertingAPIService) DisableRule(ctx context.Context, ruleId string, spaceId string) ApiDisableRuleRequest { +func (a *AlertingAPIService) DisableRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiDisableRuleRequest { return ApiDisableRuleRequest{ ApiService: a, ctx: ctx, @@ -932,13 +1124,13 @@ func (a *AlertingAPIService) DisableRuleExecute(r ApiDisableRuleRequest) (*http. type ApiEnableRuleRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiEnableRuleRequest) KbnXsrf(kbnXsrf string) ApiEnableRuleRequest { +func (r ApiEnableRuleRequest) KbnXsrf(kbnXsrf interface{}) ApiEnableRuleRequest { r.kbnXsrf = &kbnXsrf return r } @@ -950,14 +1142,14 @@ func (r ApiEnableRuleRequest) Execute() (*http.Response, error) { /* EnableRule Enables a rule. -This API supports token-based authentication only. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. +To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param ruleId An identifier for the rule. @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiEnableRuleRequest */ -func (a *AlertingAPIService) EnableRule(ctx context.Context, ruleId string, spaceId string) ApiEnableRuleRequest { +func (a *AlertingAPIService) EnableRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiEnableRuleRequest { return ApiEnableRuleRequest{ ApiService: a, ctx: ctx, @@ -1074,15 +1266,15 @@ func (a *AlertingAPIService) EnableRuleExecute(r ApiEnableRuleRequest) (*http.Re type ApiFindRulesRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} defaultSearchOperator *string - fields *[]string + fields *[]*string filter *string hasReference *FindRulesHasReferenceParameter page *int32 perPage *int32 search *string - searchFields *FindRulesSearchFieldsParameter + searchFields *string sortField *string sortOrder *string } @@ -1094,7 +1286,7 @@ func (r ApiFindRulesRequest) DefaultSearchOperator(defaultSearchOperator string) } // The fields to return in the `attributes` key of the response. -func (r ApiFindRulesRequest) Fields(fields []string) ApiFindRulesRequest { +func (r ApiFindRulesRequest) Fields(fields []*string) ApiFindRulesRequest { r.fields = &fields return r } @@ -1130,7 +1322,7 @@ func (r ApiFindRulesRequest) Search(search string) ApiFindRulesRequest { } // The fields to perform the simple_query_string parsed query against. -func (r ApiFindRulesRequest) SearchFields(searchFields FindRulesSearchFieldsParameter) ApiFindRulesRequest { +func (r ApiFindRulesRequest) SearchFields(searchFields string) ApiFindRulesRequest { r.searchFields = &searchFields return r } @@ -1160,7 +1352,7 @@ You must have `read` privileges for the appropriate Kibana features, depending o @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiFindRulesRequest */ -func (a *AlertingAPIService) FindRules(ctx context.Context, spaceId string) ApiFindRulesRequest { +func (a *AlertingAPIService) FindRules(ctx context.Context, spaceId interface{}) ApiFindRulesRequest { return ApiFindRulesRequest{ ApiService: a, ctx: ctx, @@ -1322,7 +1514,7 @@ func (a *AlertingAPIService) FindRulesExecute(r ApiFindRulesRequest) (*FindRules type ApiGetAlertingHealthRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} } func (r ApiGetAlertingHealthRequest) Execute() (*GetAlertingHealth200Response, *http.Response, error) { @@ -1338,7 +1530,7 @@ You must have `read` privileges for the **Management > Stack Rules** feature or @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetAlertingHealthRequest */ -func (a *AlertingAPIService) GetAlertingHealth(ctx context.Context, spaceId string) ApiGetAlertingHealthRequest { +func (a *AlertingAPIService) GetAlertingHealth(ctx context.Context, spaceId interface{}) ApiGetAlertingHealthRequest { return ApiGetAlertingHealthRequest{ ApiService: a, ctx: ctx, @@ -1450,8 +1642,8 @@ func (a *AlertingAPIService) GetAlertingHealthExecute(r ApiGetAlertingHealthRequ type ApiGetRuleRequest struct { ctx context.Context ApiService AlertingAPI - ruleId string - spaceId string + ruleId interface{} + spaceId interface{} } func (r ApiGetRuleRequest) Execute() (*RuleResponseProperties, *http.Response, error) { @@ -1468,7 +1660,7 @@ You must have `read` privileges for the appropriate Kibana features, depending o @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetRuleRequest */ -func (a *AlertingAPIService) GetRule(ctx context.Context, ruleId string, spaceId string) ApiGetRuleRequest { +func (a *AlertingAPIService) GetRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiGetRuleRequest { return ApiGetRuleRequest{ ApiService: a, ctx: ctx, @@ -1593,7 +1785,7 @@ func (a *AlertingAPIService) GetRuleExecute(r ApiGetRuleRequest) (*RuleResponseP type ApiGetRuleTypesRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} } func (r ApiGetRuleTypesRequest) Execute() ([]GetRuleTypes200ResponseInner, *http.Response, error) { @@ -1609,7 +1801,7 @@ If you have `read` privileges for one or more Kibana features, the API response @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiGetRuleTypesRequest */ -func (a *AlertingAPIService) GetRuleTypes(ctx context.Context, spaceId string) ApiGetRuleTypesRequest { +func (a *AlertingAPIService) GetRuleTypes(ctx context.Context, spaceId interface{}) ApiGetRuleTypesRequest { return ApiGetRuleTypesRequest{ ApiService: a, ctx: ctx, @@ -1721,14 +1913,14 @@ func (a *AlertingAPIService) GetRuleTypesExecute(r ApiGetRuleTypesRequest) ([]Ge type ApiLegacyCreateAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string + kbnXsrf *interface{} alertId string - spaceId string + spaceId interface{} legacyCreateAlertRequestProperties *LegacyCreateAlertRequestProperties } // Cross-site request forgery protection -func (r ApiLegacyCreateAlertRequest) KbnXsrf(kbnXsrf string) ApiLegacyCreateAlertRequest { +func (r ApiLegacyCreateAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyCreateAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -1754,7 +1946,7 @@ Deprecated in 7.13.0. Use the create rule API instead. Deprecated */ -func (a *AlertingAPIService) LegacyCreateAlert(ctx context.Context, alertId string, spaceId string) ApiLegacyCreateAlertRequest { +func (a *AlertingAPIService) LegacyCreateAlert(ctx context.Context, alertId string, spaceId interface{}) ApiLegacyCreateAlertRequest { return ApiLegacyCreateAlertRequest{ ApiService: a, ctx: ctx, @@ -1879,13 +2071,13 @@ func (a *AlertingAPIService) LegacyCreateAlertExecute(r ApiLegacyCreateAlertRequ type ApiLegacyDisableAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string } // Cross-site request forgery protection -func (r ApiLegacyDisableAlertRequest) KbnXsrf(kbnXsrf string) ApiLegacyDisableAlertRequest { +func (r ApiLegacyDisableAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyDisableAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -1906,7 +2098,7 @@ Deprecated in 7.13.0. Use the disable rule API instead. Deprecated */ -func (a *AlertingAPIService) LegacyDisableAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyDisableAlertRequest { +func (a *AlertingAPIService) LegacyDisableAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyDisableAlertRequest { return ApiLegacyDisableAlertRequest{ ApiService: a, ctx: ctx, @@ -2013,13 +2205,13 @@ func (a *AlertingAPIService) LegacyDisableAlertExecute(r ApiLegacyDisableAlertRe type ApiLegacyEnableAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string } // Cross-site request forgery protection -func (r ApiLegacyEnableAlertRequest) KbnXsrf(kbnXsrf string) ApiLegacyEnableAlertRequest { +func (r ApiLegacyEnableAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyEnableAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -2040,7 +2232,7 @@ Deprecated in 7.13.0. Use the enable rule API instead. Deprecated */ -func (a *AlertingAPIService) LegacyEnableAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyEnableAlertRequest { +func (a *AlertingAPIService) LegacyEnableAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyEnableAlertRequest { return ApiLegacyEnableAlertRequest{ ApiService: a, ctx: ctx, @@ -2147,15 +2339,15 @@ func (a *AlertingAPIService) LegacyEnableAlertExecute(r ApiLegacyEnableAlertRequ type ApiLegacyFindAlertsRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} defaultSearchOperator *string fields *[]string filter *string - hasReference *FindRulesHasReferenceParameter + hasReference *LegacyFindAlertsHasReferenceParameter page *int32 perPage *int32 search *string - searchFields *FindRulesSearchFieldsParameter + searchFields *string sortField *string sortOrder *string } @@ -2179,7 +2371,7 @@ func (r ApiLegacyFindAlertsRequest) Filter(filter string) ApiLegacyFindAlertsReq } // Filters the rules that have a relation with the reference objects with a specific type and identifier. -func (r ApiLegacyFindAlertsRequest) HasReference(hasReference FindRulesHasReferenceParameter) ApiLegacyFindAlertsRequest { +func (r ApiLegacyFindAlertsRequest) HasReference(hasReference LegacyFindAlertsHasReferenceParameter) ApiLegacyFindAlertsRequest { r.hasReference = &hasReference return r } @@ -2203,7 +2395,7 @@ func (r ApiLegacyFindAlertsRequest) Search(search string) ApiLegacyFindAlertsReq } // The fields to perform the `simple_query_string` parsed query against. -func (r ApiLegacyFindAlertsRequest) SearchFields(searchFields FindRulesSearchFieldsParameter) ApiLegacyFindAlertsRequest { +func (r ApiLegacyFindAlertsRequest) SearchFields(searchFields string) ApiLegacyFindAlertsRequest { r.searchFields = &searchFields return r } @@ -2235,7 +2427,7 @@ Deprecated in 7.13.0. Use the find rules API instead. NOTE: Alert `params` are s Deprecated */ -func (a *AlertingAPIService) LegacyFindAlerts(ctx context.Context, spaceId string) ApiLegacyFindAlertsRequest { +func (a *AlertingAPIService) LegacyFindAlerts(ctx context.Context, spaceId interface{}) ApiLegacyFindAlertsRequest { return ApiLegacyFindAlertsRequest{ ApiService: a, ctx: ctx, @@ -2399,7 +2591,7 @@ func (a *AlertingAPIService) LegacyFindAlertsExecute(r ApiLegacyFindAlertsReques type ApiLegacyGetAlertRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} alertId string } @@ -2419,7 +2611,7 @@ Deprecated in 7.13.0. Use the get rule API instead. Deprecated */ -func (a *AlertingAPIService) LegacyGetAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyGetAlertRequest { +func (a *AlertingAPIService) LegacyGetAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyGetAlertRequest { return ApiLegacyGetAlertRequest{ ApiService: a, ctx: ctx, @@ -2535,7 +2727,7 @@ func (a *AlertingAPIService) LegacyGetAlertExecute(r ApiLegacyGetAlertRequest) ( type ApiLegacyGetAlertTypesRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} } func (r ApiLegacyGetAlertTypesRequest) Execute() ([]LegacyGetAlertTypes200ResponseInner, *http.Response, error) { @@ -2553,7 +2745,7 @@ Deprecated in 7.13.0. Use the get rule types API instead. Deprecated */ -func (a *AlertingAPIService) LegacyGetAlertTypes(ctx context.Context, spaceId string) ApiLegacyGetAlertTypesRequest { +func (a *AlertingAPIService) LegacyGetAlertTypes(ctx context.Context, spaceId interface{}) ApiLegacyGetAlertTypesRequest { return ApiLegacyGetAlertTypesRequest{ ApiService: a, ctx: ctx, @@ -2667,7 +2859,7 @@ func (a *AlertingAPIService) LegacyGetAlertTypesExecute(r ApiLegacyGetAlertTypes type ApiLegacyGetAlertingHealthRequest struct { ctx context.Context ApiService AlertingAPI - spaceId string + spaceId interface{} } func (r ApiLegacyGetAlertingHealthRequest) Execute() (*LegacyGetAlertingHealth200Response, *http.Response, error) { @@ -2685,7 +2877,7 @@ Deprecated in 7.13.0. Use the get alerting framework health API instead. Deprecated */ -func (a *AlertingAPIService) LegacyGetAlertingHealth(ctx context.Context, spaceId string) ApiLegacyGetAlertingHealthRequest { +func (a *AlertingAPIService) LegacyGetAlertingHealth(ctx context.Context, spaceId interface{}) ApiLegacyGetAlertingHealthRequest { return ApiLegacyGetAlertingHealthRequest{ ApiService: a, ctx: ctx, @@ -2799,14 +2991,14 @@ func (a *AlertingAPIService) LegacyGetAlertingHealthExecute(r ApiLegacyGetAlerti type ApiLegacyMuteAlertInstanceRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string alertInstanceId string } // Cross-site request forgery protection -func (r ApiLegacyMuteAlertInstanceRequest) KbnXsrf(kbnXsrf string) ApiLegacyMuteAlertInstanceRequest { +func (r ApiLegacyMuteAlertInstanceRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyMuteAlertInstanceRequest { r.kbnXsrf = &kbnXsrf return r } @@ -2828,7 +3020,7 @@ Deprecated in 7.13.0. Use the mute alert API instead. Deprecated */ -func (a *AlertingAPIService) LegacyMuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest { +func (a *AlertingAPIService) LegacyMuteAlertInstance(ctx context.Context, spaceId interface{}, alertId string, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest { return ApiLegacyMuteAlertInstanceRequest{ ApiService: a, ctx: ctx, @@ -2937,13 +3129,13 @@ func (a *AlertingAPIService) LegacyMuteAlertInstanceExecute(r ApiLegacyMuteAlert type ApiLegacyMuteAllAlertInstancesRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string } // Cross-site request forgery protection -func (r ApiLegacyMuteAllAlertInstancesRequest) KbnXsrf(kbnXsrf string) ApiLegacyMuteAllAlertInstancesRequest { +func (r ApiLegacyMuteAllAlertInstancesRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyMuteAllAlertInstancesRequest { r.kbnXsrf = &kbnXsrf return r } @@ -2964,7 +3156,7 @@ Deprecated in 7.13.0. Use the mute all alerts API instead. Deprecated */ -func (a *AlertingAPIService) LegacyMuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) ApiLegacyMuteAllAlertInstancesRequest { +func (a *AlertingAPIService) LegacyMuteAllAlertInstances(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyMuteAllAlertInstancesRequest { return ApiLegacyMuteAllAlertInstancesRequest{ ApiService: a, ctx: ctx, @@ -3071,14 +3263,14 @@ func (a *AlertingAPIService) LegacyMuteAllAlertInstancesExecute(r ApiLegacyMuteA type ApiLegacyUnmuteAlertInstanceRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string alertInstanceId string } // Cross-site request forgery protection -func (r ApiLegacyUnmuteAlertInstanceRequest) KbnXsrf(kbnXsrf string) ApiLegacyUnmuteAlertInstanceRequest { +func (r ApiLegacyUnmuteAlertInstanceRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyUnmuteAlertInstanceRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3100,7 +3292,7 @@ Deprecated in 7.13.0. Use the unmute alert API instead. Deprecated */ -func (a *AlertingAPIService) LegacyUnmuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest { +func (a *AlertingAPIService) LegacyUnmuteAlertInstance(ctx context.Context, spaceId interface{}, alertId string, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest { return ApiLegacyUnmuteAlertInstanceRequest{ ApiService: a, ctx: ctx, @@ -3209,13 +3401,13 @@ func (a *AlertingAPIService) LegacyUnmuteAlertInstanceExecute(r ApiLegacyUnmuteA type ApiLegacyUnmuteAllAlertInstancesRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string } // Cross-site request forgery protection -func (r ApiLegacyUnmuteAllAlertInstancesRequest) KbnXsrf(kbnXsrf string) ApiLegacyUnmuteAllAlertInstancesRequest { +func (r ApiLegacyUnmuteAllAlertInstancesRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyUnmuteAllAlertInstancesRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3236,7 +3428,7 @@ Deprecated in 7.13.0. Use the unmute all alerts API instead. Deprecated */ -func (a *AlertingAPIService) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest { +func (a *AlertingAPIService) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest { return ApiLegacyUnmuteAllAlertInstancesRequest{ ApiService: a, ctx: ctx, @@ -3343,14 +3535,14 @@ func (a *AlertingAPIService) LegacyUnmuteAllAlertInstancesExecute(r ApiLegacyUnm type ApiLegacyUpdateAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string legacyUpdateAlertRequestProperties *LegacyUpdateAlertRequestProperties } // Cross-site request forgery protection -func (r ApiLegacyUpdateAlertRequest) KbnXsrf(kbnXsrf string) ApiLegacyUpdateAlertRequest { +func (r ApiLegacyUpdateAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiLegacyUpdateAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3376,7 +3568,7 @@ Deprecated in 7.13.0. Use the update rule API instead. Deprecated */ -func (a *AlertingAPIService) LegacyUpdateAlert(ctx context.Context, spaceId string, alertId string) ApiLegacyUpdateAlertRequest { +func (a *AlertingAPIService) LegacyUpdateAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegacyUpdateAlertRequest { return ApiLegacyUpdateAlertRequest{ ApiService: a, ctx: ctx, @@ -3501,13 +3693,13 @@ func (a *AlertingAPIService) LegacyUpdateAlertExecute(r ApiLegacyUpdateAlertRequ type ApiLegaryDeleteAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - spaceId string + kbnXsrf *interface{} + spaceId interface{} alertId string } // Cross-site request forgery protection -func (r ApiLegaryDeleteAlertRequest) KbnXsrf(kbnXsrf string) ApiLegaryDeleteAlertRequest { +func (r ApiLegaryDeleteAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiLegaryDeleteAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3528,7 +3720,7 @@ Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After you delete Deprecated */ -func (a *AlertingAPIService) LegaryDeleteAlert(ctx context.Context, spaceId string, alertId string) ApiLegaryDeleteAlertRequest { +func (a *AlertingAPIService) LegaryDeleteAlert(ctx context.Context, spaceId interface{}, alertId string) ApiLegaryDeleteAlertRequest { return ApiLegaryDeleteAlertRequest{ ApiService: a, ctx: ctx, @@ -3635,14 +3827,14 @@ func (a *AlertingAPIService) LegaryDeleteAlertExecute(r ApiLegaryDeleteAlertRequ type ApiMuteAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - alertId string - ruleId string - spaceId string + kbnXsrf *interface{} + alertId interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiMuteAlertRequest) KbnXsrf(kbnXsrf string) ApiMuteAlertRequest { +func (r ApiMuteAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiMuteAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3662,7 +3854,7 @@ You must have `all` privileges for the appropriate Kibana features, depending on @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiMuteAlertRequest */ -func (a *AlertingAPIService) MuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) ApiMuteAlertRequest { +func (a *AlertingAPIService) MuteAlert(ctx context.Context, alertId interface{}, ruleId interface{}, spaceId interface{}) ApiMuteAlertRequest { return ApiMuteAlertRequest{ ApiService: a, ctx: ctx, @@ -3770,13 +3962,13 @@ func (a *AlertingAPIService) MuteAlertExecute(r ApiMuteAlertRequest) (*http.Resp type ApiMuteAllAlertsRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiMuteAllAlertsRequest) KbnXsrf(kbnXsrf string) ApiMuteAllAlertsRequest { +func (r ApiMuteAllAlertsRequest) KbnXsrf(kbnXsrf interface{}) ApiMuteAllAlertsRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3795,7 +3987,7 @@ This API snoozes the notifications for the rule indefinitely. The rule checks co @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiMuteAllAlertsRequest */ -func (a *AlertingAPIService) MuteAllAlerts(ctx context.Context, ruleId string, spaceId string) ApiMuteAllAlertsRequest { +func (a *AlertingAPIService) MuteAllAlerts(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiMuteAllAlertsRequest { return ApiMuteAllAlertsRequest{ ApiService: a, ctx: ctx, @@ -3901,14 +4093,14 @@ func (a *AlertingAPIService) MuteAllAlertsExecute(r ApiMuteAllAlertsRequest) (*h type ApiUnmuteAlertRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - alertId string - ruleId string - spaceId string + kbnXsrf *interface{} + alertId interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiUnmuteAlertRequest) KbnXsrf(kbnXsrf string) ApiUnmuteAlertRequest { +func (r ApiUnmuteAlertRequest) KbnXsrf(kbnXsrf interface{}) ApiUnmuteAlertRequest { r.kbnXsrf = &kbnXsrf return r } @@ -3928,7 +4120,7 @@ You must have `all` privileges for the appropriate Kibana features, depending on @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUnmuteAlertRequest */ -func (a *AlertingAPIService) UnmuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) ApiUnmuteAlertRequest { +func (a *AlertingAPIService) UnmuteAlert(ctx context.Context, alertId interface{}, ruleId interface{}, spaceId interface{}) ApiUnmuteAlertRequest { return ApiUnmuteAlertRequest{ ApiService: a, ctx: ctx, @@ -4036,13 +4228,13 @@ func (a *AlertingAPIService) UnmuteAlertExecute(r ApiUnmuteAlertRequest) (*http. type ApiUnmuteAllAlertsRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} } // Cross-site request forgery protection -func (r ApiUnmuteAllAlertsRequest) KbnXsrf(kbnXsrf string) ApiUnmuteAllAlertsRequest { +func (r ApiUnmuteAllAlertsRequest) KbnXsrf(kbnXsrf interface{}) ApiUnmuteAllAlertsRequest { r.kbnXsrf = &kbnXsrf return r } @@ -4061,7 +4253,7 @@ If the rule has its notifications snoozed indefinitely, this API cancels the sno @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUnmuteAllAlertsRequest */ -func (a *AlertingAPIService) UnmuteAllAlerts(ctx context.Context, ruleId string, spaceId string) ApiUnmuteAllAlertsRequest { +func (a *AlertingAPIService) UnmuteAllAlerts(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUnmuteAllAlertsRequest { return ApiUnmuteAllAlertsRequest{ ApiService: a, ctx: ctx, @@ -4167,14 +4359,14 @@ func (a *AlertingAPIService) UnmuteAllAlertsExecute(r ApiUnmuteAllAlertsRequest) type ApiUpdateRuleRequest struct { ctx context.Context ApiService AlertingAPI - kbnXsrf *string - ruleId string - spaceId string + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} updateRuleRequest *UpdateRuleRequest } // Cross-site request forgery protection -func (r ApiUpdateRuleRequest) KbnXsrf(kbnXsrf string) ApiUpdateRuleRequest { +func (r ApiUpdateRuleRequest) KbnXsrf(kbnXsrf interface{}) ApiUpdateRuleRequest { r.kbnXsrf = &kbnXsrf return r } @@ -4191,14 +4383,14 @@ func (r ApiUpdateRuleRequest) Execute() (*RuleResponseProperties, *http.Response /* UpdateRule Updates the attributes for a rule. -You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you update a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If you have different privileges than the user that created or most recently updated the rule, you might change its behavior. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. +To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param ruleId An identifier for the rule. @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @return ApiUpdateRuleRequest */ -func (a *AlertingAPIService) UpdateRule(ctx context.Context, ruleId string, spaceId string) ApiUpdateRuleRequest { +func (a *AlertingAPIService) UpdateRule(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUpdateRuleRequest { return ApiUpdateRuleRequest{ ApiService: a, ctx: ctx, @@ -4328,3 +4520,134 @@ func (a *AlertingAPIService) UpdateRuleExecute(r ApiUpdateRuleRequest) (*RuleRes return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiUpdateRuleAPIKeyRequest struct { + ctx context.Context + ApiService AlertingAPI + kbnXsrf *interface{} + ruleId interface{} + spaceId interface{} +} + +// Cross-site request forgery protection +func (r ApiUpdateRuleAPIKeyRequest) KbnXsrf(kbnXsrf interface{}) ApiUpdateRuleAPIKeyRequest { + r.kbnXsrf = &kbnXsrf + return r +} + +func (r ApiUpdateRuleAPIKeyRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateRuleAPIKeyExecute(r) +} + +/* +UpdateRuleAPIKey Updates the API key for a rule. + +The new API key has the credentials of the user that submits the request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ruleId An identifier for the rule. + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @return ApiUpdateRuleAPIKeyRequest +*/ +func (a *AlertingAPIService) UpdateRuleAPIKey(ctx context.Context, ruleId interface{}, spaceId interface{}) ApiUpdateRuleAPIKeyRequest { + return ApiUpdateRuleAPIKeyRequest{ + ApiService: a, + ctx: ctx, + ruleId: ruleId, + spaceId: spaceId, + } +} + +// Execute executes the request +func (a *AlertingAPIService) UpdateRuleAPIKeyExecute(r ApiUpdateRuleAPIKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertingAPIService.UpdateRuleAPIKey") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/s/{spaceId}/api/alerting/rule/{ruleId}/_update_api_key" + localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", url.PathEscape(parameterValueToString(r.ruleId, "ruleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kbnXsrf == nil { + return nil, reportError("kbnXsrf is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Model400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/generated/alerting/api_alerting_mocks.go b/generated/alerting/api_alerting_mocks.go index 6b5c46555..ffab4e81f 100644 --- a/generated/alerting/api_alerting_mocks.go +++ b/generated/alerting/api_alerting_mocks.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: ../generated/alerting/api_alerting.go +// Source: ./api_alerting.go // // Generated by this command: // -// mockgen -destination=../generated/alerting/api_alerting_mocks.go -package=alerting -source ../generated/alerting/api_alerting.go AlertingAPI +// mockgen -destination=./api_alerting_mocks.go -package=alerting -source ./api_alerting.go AlertingAPI // // Package alerting is a generated GoMock package. @@ -41,17 +41,17 @@ func (m *MockAlertingAPI) EXPECT() *MockAlertingAPIMockRecorder { } // CreateRule mocks base method. -func (m *MockAlertingAPI) CreateRule(ctx context.Context, spaceId, ruleId string) ApiCreateRuleRequest { +func (m *MockAlertingAPI) CreateRule(ctx context.Context, spaceId any) ApiCreateRuleRequest { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateRule", ctx, spaceId, ruleId) + ret := m.ctrl.Call(m, "CreateRule", ctx, spaceId) ret0, _ := ret[0].(ApiCreateRuleRequest) return ret0 } // CreateRule indicates an expected call of CreateRule. -func (mr *MockAlertingAPIMockRecorder) CreateRule(ctx, spaceId, ruleId any) *gomock.Call { +func (mr *MockAlertingAPIMockRecorder) CreateRule(ctx, spaceId any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRule", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRule), ctx, spaceId, ruleId) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRule", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRule), ctx, spaceId) } // CreateRuleExecute mocks base method. @@ -70,8 +70,38 @@ func (mr *MockAlertingAPIMockRecorder) CreateRuleExecute(r any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRuleExecute), r) } +// CreateRuleId mocks base method. +func (m *MockAlertingAPI) CreateRuleId(ctx context.Context, spaceId any, ruleId string) ApiCreateRuleIdRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRuleId", ctx, spaceId, ruleId) + ret0, _ := ret[0].(ApiCreateRuleIdRequest) + return ret0 +} + +// CreateRuleId indicates an expected call of CreateRuleId. +func (mr *MockAlertingAPIMockRecorder) CreateRuleId(ctx, spaceId, ruleId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRuleId", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRuleId), ctx, spaceId, ruleId) +} + +// CreateRuleIdExecute mocks base method. +func (m *MockAlertingAPI) CreateRuleIdExecute(r ApiCreateRuleIdRequest) (*RuleResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRuleIdExecute", r) + ret0, _ := ret[0].(*RuleResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CreateRuleIdExecute indicates an expected call of CreateRuleIdExecute. +func (mr *MockAlertingAPIMockRecorder) CreateRuleIdExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRuleIdExecute", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRuleIdExecute), r) +} + // DeleteRule mocks base method. -func (m *MockAlertingAPI) DeleteRule(ctx context.Context, ruleId, spaceId string) ApiDeleteRuleRequest { +func (m *MockAlertingAPI) DeleteRule(ctx context.Context, ruleId, spaceId any) ApiDeleteRuleRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteRule", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiDeleteRuleRequest) @@ -100,7 +130,7 @@ func (mr *MockAlertingAPIMockRecorder) DeleteRuleExecute(r any) *gomock.Call { } // DisableRule mocks base method. -func (m *MockAlertingAPI) DisableRule(ctx context.Context, ruleId, spaceId string) ApiDisableRuleRequest { +func (m *MockAlertingAPI) DisableRule(ctx context.Context, ruleId, spaceId any) ApiDisableRuleRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DisableRule", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiDisableRuleRequest) @@ -129,7 +159,7 @@ func (mr *MockAlertingAPIMockRecorder) DisableRuleExecute(r any) *gomock.Call { } // EnableRule mocks base method. -func (m *MockAlertingAPI) EnableRule(ctx context.Context, ruleId, spaceId string) ApiEnableRuleRequest { +func (m *MockAlertingAPI) EnableRule(ctx context.Context, ruleId, spaceId any) ApiEnableRuleRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EnableRule", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiEnableRuleRequest) @@ -158,7 +188,7 @@ func (mr *MockAlertingAPIMockRecorder) EnableRuleExecute(r any) *gomock.Call { } // FindRules mocks base method. -func (m *MockAlertingAPI) FindRules(ctx context.Context, spaceId string) ApiFindRulesRequest { +func (m *MockAlertingAPI) FindRules(ctx context.Context, spaceId any) ApiFindRulesRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindRules", ctx, spaceId) ret0, _ := ret[0].(ApiFindRulesRequest) @@ -188,7 +218,7 @@ func (mr *MockAlertingAPIMockRecorder) FindRulesExecute(r any) *gomock.Call { } // GetAlertingHealth mocks base method. -func (m *MockAlertingAPI) GetAlertingHealth(ctx context.Context, spaceId string) ApiGetAlertingHealthRequest { +func (m *MockAlertingAPI) GetAlertingHealth(ctx context.Context, spaceId any) ApiGetAlertingHealthRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAlertingHealth", ctx, spaceId) ret0, _ := ret[0].(ApiGetAlertingHealthRequest) @@ -218,7 +248,7 @@ func (mr *MockAlertingAPIMockRecorder) GetAlertingHealthExecute(r any) *gomock.C } // GetRule mocks base method. -func (m *MockAlertingAPI) GetRule(ctx context.Context, ruleId, spaceId string) ApiGetRuleRequest { +func (m *MockAlertingAPI) GetRule(ctx context.Context, ruleId, spaceId any) ApiGetRuleRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRule", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiGetRuleRequest) @@ -248,7 +278,7 @@ func (mr *MockAlertingAPIMockRecorder) GetRuleExecute(r any) *gomock.Call { } // GetRuleTypes mocks base method. -func (m *MockAlertingAPI) GetRuleTypes(ctx context.Context, spaceId string) ApiGetRuleTypesRequest { +func (m *MockAlertingAPI) GetRuleTypes(ctx context.Context, spaceId any) ApiGetRuleTypesRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRuleTypes", ctx, spaceId) ret0, _ := ret[0].(ApiGetRuleTypesRequest) @@ -278,7 +308,7 @@ func (mr *MockAlertingAPIMockRecorder) GetRuleTypesExecute(r any) *gomock.Call { } // LegacyCreateAlert mocks base method. -func (m *MockAlertingAPI) LegacyCreateAlert(ctx context.Context, alertId, spaceId string) ApiLegacyCreateAlertRequest { +func (m *MockAlertingAPI) LegacyCreateAlert(ctx context.Context, alertId string, spaceId any) ApiLegacyCreateAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyCreateAlert", ctx, alertId, spaceId) ret0, _ := ret[0].(ApiLegacyCreateAlertRequest) @@ -308,7 +338,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyCreateAlertExecute(r any) *gomock.C } // LegacyDisableAlert mocks base method. -func (m *MockAlertingAPI) LegacyDisableAlert(ctx context.Context, spaceId, alertId string) ApiLegacyDisableAlertRequest { +func (m *MockAlertingAPI) LegacyDisableAlert(ctx context.Context, spaceId any, alertId string) ApiLegacyDisableAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyDisableAlert", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyDisableAlertRequest) @@ -337,7 +367,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyDisableAlertExecute(r any) *gomock. } // LegacyEnableAlert mocks base method. -func (m *MockAlertingAPI) LegacyEnableAlert(ctx context.Context, spaceId, alertId string) ApiLegacyEnableAlertRequest { +func (m *MockAlertingAPI) LegacyEnableAlert(ctx context.Context, spaceId any, alertId string) ApiLegacyEnableAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyEnableAlert", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyEnableAlertRequest) @@ -366,7 +396,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyEnableAlertExecute(r any) *gomock.C } // LegacyFindAlerts mocks base method. -func (m *MockAlertingAPI) LegacyFindAlerts(ctx context.Context, spaceId string) ApiLegacyFindAlertsRequest { +func (m *MockAlertingAPI) LegacyFindAlerts(ctx context.Context, spaceId any) ApiLegacyFindAlertsRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyFindAlerts", ctx, spaceId) ret0, _ := ret[0].(ApiLegacyFindAlertsRequest) @@ -396,7 +426,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyFindAlertsExecute(r any) *gomock.Ca } // LegacyGetAlert mocks base method. -func (m *MockAlertingAPI) LegacyGetAlert(ctx context.Context, spaceId, alertId string) ApiLegacyGetAlertRequest { +func (m *MockAlertingAPI) LegacyGetAlert(ctx context.Context, spaceId any, alertId string) ApiLegacyGetAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyGetAlert", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyGetAlertRequest) @@ -426,7 +456,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertExecute(r any) *gomock.Call } // LegacyGetAlertTypes mocks base method. -func (m *MockAlertingAPI) LegacyGetAlertTypes(ctx context.Context, spaceId string) ApiLegacyGetAlertTypesRequest { +func (m *MockAlertingAPI) LegacyGetAlertTypes(ctx context.Context, spaceId any) ApiLegacyGetAlertTypesRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyGetAlertTypes", ctx, spaceId) ret0, _ := ret[0].(ApiLegacyGetAlertTypesRequest) @@ -456,7 +486,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertTypesExecute(r any) *gomock } // LegacyGetAlertingHealth mocks base method. -func (m *MockAlertingAPI) LegacyGetAlertingHealth(ctx context.Context, spaceId string) ApiLegacyGetAlertingHealthRequest { +func (m *MockAlertingAPI) LegacyGetAlertingHealth(ctx context.Context, spaceId any) ApiLegacyGetAlertingHealthRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyGetAlertingHealth", ctx, spaceId) ret0, _ := ret[0].(ApiLegacyGetAlertingHealthRequest) @@ -486,7 +516,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertingHealthExecute(r any) *go } // LegacyMuteAlertInstance mocks base method. -func (m *MockAlertingAPI) LegacyMuteAlertInstance(ctx context.Context, spaceId, alertId, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest { +func (m *MockAlertingAPI) LegacyMuteAlertInstance(ctx context.Context, spaceId any, alertId, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyMuteAlertInstance", ctx, spaceId, alertId, alertInstanceId) ret0, _ := ret[0].(ApiLegacyMuteAlertInstanceRequest) @@ -515,7 +545,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyMuteAlertInstanceExecute(r any) *go } // LegacyMuteAllAlertInstances mocks base method. -func (m *MockAlertingAPI) LegacyMuteAllAlertInstances(ctx context.Context, spaceId, alertId string) ApiLegacyMuteAllAlertInstancesRequest { +func (m *MockAlertingAPI) LegacyMuteAllAlertInstances(ctx context.Context, spaceId any, alertId string) ApiLegacyMuteAllAlertInstancesRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyMuteAllAlertInstances", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyMuteAllAlertInstancesRequest) @@ -544,7 +574,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyMuteAllAlertInstancesExecute(r any) } // LegacyUnmuteAlertInstance mocks base method. -func (m *MockAlertingAPI) LegacyUnmuteAlertInstance(ctx context.Context, spaceId, alertId, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest { +func (m *MockAlertingAPI) LegacyUnmuteAlertInstance(ctx context.Context, spaceId any, alertId, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyUnmuteAlertInstance", ctx, spaceId, alertId, alertInstanceId) ret0, _ := ret[0].(ApiLegacyUnmuteAlertInstanceRequest) @@ -573,7 +603,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAlertInstanceExecute(r any) * } // LegacyUnmuteAllAlertInstances mocks base method. -func (m *MockAlertingAPI) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest { +func (m *MockAlertingAPI) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId any, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyUnmuteAllAlertInstances", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyUnmuteAllAlertInstancesRequest) @@ -602,7 +632,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAllAlertInstancesExecute(r an } // LegacyUpdateAlert mocks base method. -func (m *MockAlertingAPI) LegacyUpdateAlert(ctx context.Context, spaceId, alertId string) ApiLegacyUpdateAlertRequest { +func (m *MockAlertingAPI) LegacyUpdateAlert(ctx context.Context, spaceId any, alertId string) ApiLegacyUpdateAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegacyUpdateAlert", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegacyUpdateAlertRequest) @@ -632,7 +662,7 @@ func (mr *MockAlertingAPIMockRecorder) LegacyUpdateAlertExecute(r any) *gomock.C } // LegaryDeleteAlert mocks base method. -func (m *MockAlertingAPI) LegaryDeleteAlert(ctx context.Context, spaceId, alertId string) ApiLegaryDeleteAlertRequest { +func (m *MockAlertingAPI) LegaryDeleteAlert(ctx context.Context, spaceId any, alertId string) ApiLegaryDeleteAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LegaryDeleteAlert", ctx, spaceId, alertId) ret0, _ := ret[0].(ApiLegaryDeleteAlertRequest) @@ -661,7 +691,7 @@ func (mr *MockAlertingAPIMockRecorder) LegaryDeleteAlertExecute(r any) *gomock.C } // MuteAlert mocks base method. -func (m *MockAlertingAPI) MuteAlert(ctx context.Context, alertId, ruleId, spaceId string) ApiMuteAlertRequest { +func (m *MockAlertingAPI) MuteAlert(ctx context.Context, alertId, ruleId, spaceId any) ApiMuteAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MuteAlert", ctx, alertId, ruleId, spaceId) ret0, _ := ret[0].(ApiMuteAlertRequest) @@ -690,7 +720,7 @@ func (mr *MockAlertingAPIMockRecorder) MuteAlertExecute(r any) *gomock.Call { } // MuteAllAlerts mocks base method. -func (m *MockAlertingAPI) MuteAllAlerts(ctx context.Context, ruleId, spaceId string) ApiMuteAllAlertsRequest { +func (m *MockAlertingAPI) MuteAllAlerts(ctx context.Context, ruleId, spaceId any) ApiMuteAllAlertsRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MuteAllAlerts", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiMuteAllAlertsRequest) @@ -719,7 +749,7 @@ func (mr *MockAlertingAPIMockRecorder) MuteAllAlertsExecute(r any) *gomock.Call } // UnmuteAlert mocks base method. -func (m *MockAlertingAPI) UnmuteAlert(ctx context.Context, alertId, ruleId, spaceId string) ApiUnmuteAlertRequest { +func (m *MockAlertingAPI) UnmuteAlert(ctx context.Context, alertId, ruleId, spaceId any) ApiUnmuteAlertRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UnmuteAlert", ctx, alertId, ruleId, spaceId) ret0, _ := ret[0].(ApiUnmuteAlertRequest) @@ -748,7 +778,7 @@ func (mr *MockAlertingAPIMockRecorder) UnmuteAlertExecute(r any) *gomock.Call { } // UnmuteAllAlerts mocks base method. -func (m *MockAlertingAPI) UnmuteAllAlerts(ctx context.Context, ruleId, spaceId string) ApiUnmuteAllAlertsRequest { +func (m *MockAlertingAPI) UnmuteAllAlerts(ctx context.Context, ruleId, spaceId any) ApiUnmuteAllAlertsRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UnmuteAllAlerts", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiUnmuteAllAlertsRequest) @@ -777,7 +807,7 @@ func (mr *MockAlertingAPIMockRecorder) UnmuteAllAlertsExecute(r any) *gomock.Cal } // UpdateRule mocks base method. -func (m *MockAlertingAPI) UpdateRule(ctx context.Context, ruleId, spaceId string) ApiUpdateRuleRequest { +func (m *MockAlertingAPI) UpdateRule(ctx context.Context, ruleId, spaceId any) ApiUpdateRuleRequest { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateRule", ctx, ruleId, spaceId) ret0, _ := ret[0].(ApiUpdateRuleRequest) @@ -790,6 +820,35 @@ func (mr *MockAlertingAPIMockRecorder) UpdateRule(ctx, ruleId, spaceId any) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRule", reflect.TypeOf((*MockAlertingAPI)(nil).UpdateRule), ctx, ruleId, spaceId) } +// UpdateRuleAPIKey mocks base method. +func (m *MockAlertingAPI) UpdateRuleAPIKey(ctx context.Context, ruleId, spaceId any) ApiUpdateRuleAPIKeyRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRuleAPIKey", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiUpdateRuleAPIKeyRequest) + return ret0 +} + +// UpdateRuleAPIKey indicates an expected call of UpdateRuleAPIKey. +func (mr *MockAlertingAPIMockRecorder) UpdateRuleAPIKey(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRuleAPIKey", reflect.TypeOf((*MockAlertingAPI)(nil).UpdateRuleAPIKey), ctx, ruleId, spaceId) +} + +// UpdateRuleAPIKeyExecute mocks base method. +func (m *MockAlertingAPI) UpdateRuleAPIKeyExecute(r ApiUpdateRuleAPIKeyRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRuleAPIKeyExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateRuleAPIKeyExecute indicates an expected call of UpdateRuleAPIKeyExecute. +func (mr *MockAlertingAPIMockRecorder) UpdateRuleAPIKeyExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRuleAPIKeyExecute", reflect.TypeOf((*MockAlertingAPI)(nil).UpdateRuleAPIKeyExecute), r) +} + // UpdateRuleExecute mocks base method. func (m *MockAlertingAPI) UpdateRuleExecute(r ApiUpdateRuleRequest) (*RuleResponseProperties, *http.Response, error) { m.ctrl.T.Helper() diff --git a/generated/alerting/bundled.yaml b/generated/alerting/bundled.yaml index f544423f3..07c6e06a8 100644 --- a/generated/alerting/bundled.yaml +++ b/generated/alerting/bundled.yaml @@ -1,20 +1,80 @@ -openapi: 3.0.1 +openapi: 3.1.0 info: title: Alerting description: OpenAPI schema for alerting endpoints - version: '0.1' + version: '0.2' contact: name: Alerting Team license: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license +servers: + - url: / +security: + - basicAuth: [] + - apiKeyAuth: [] tags: - name: alerting description: Alerting APIs enable you to create and manage rules and alerts. -servers: - - url: http://localhost:5601 - description: local paths: + /s/{spaceId}/api/alerting/rule: + post: + summary: Creates a rule with a randomly generated rule identifier. + operationId: createRule + description: | + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + tags: + - alerting + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/create_rule_request' + examples: + createEsQueryEsqlRuleRequest: + $ref: '#/components/examples/create_es_query_esql_rule_request' + createEsQueryRuleRequest: + $ref: '#/components/examples/create_es_query_rule_request' + createEsQueryKqlRuleRequest: + $ref: '#/components/examples/create_es_query_kql_rule_request' + createIndexThresholdRuleRequest: + $ref: '#/components/examples/create_index_threshold_rule_request' + createTrackingContainmentRuleRequest: + $ref: '#/components/examples/create_tracking_containment_rule_request' + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + $ref: '#/components/schemas/rule_response_properties' + examples: + createEsQueryEsqlRuleResponse: + $ref: '#/components/examples/create_es_query_esql_rule_response' + createEsQueryRuleResponse: + $ref: '#/components/examples/create_es_query_rule_response' + createEsQueryKqlRuleResponse: + $ref: '#/components/examples/create_es_query_kql_rule_response' + createIndexThresholdRuleResponse: + $ref: '#/components/examples/create_index_threshold_rule_response' + createTrackingContainmentRuleResponse: + $ref: '#/components/examples/create_tracking_containment_rule_response' + '401': + description: Authorization information is missing or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Object is not found. + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' /s/{spaceId}/api/alerting/rule/{ruleId}: get: summary: Retrieves a rule by its identifier. @@ -48,13 +108,11 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - servers: - - url: https://localhost:5601 delete: summary: Deletes a rule. operationId: deleteRule description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. + To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted. tags: - alerting parameters: @@ -76,13 +134,11 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - servers: - - url: https://localhost:5601 post: - summary: Creates a rule. - operationId: createRule + summary: Creates a rule with a specific rule identifier. + operationId: createRuleId description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you create a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If a user with different privileges updates the rule, its behavior might change. + To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. tags: - alerting parameters: @@ -95,7 +151,8 @@ paths: required: true schema: type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + examples: + - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -103,8 +160,14 @@ paths: schema: $ref: '#/components/schemas/create_rule_request' examples: - createCaseRequest: - $ref: '#/components/examples/create_rule_request' + createEsQueryEsqlRuleIdRequest: + $ref: '#/components/examples/create_es_query_esql_rule_request' + createEsQueryRuleIdRequest: + $ref: '#/components/examples/create_es_query_rule_request' + createEsQueryKqlRuleIdRequest: + $ref: '#/components/examples/create_es_query_kql_rule_request' + createIndexThreholdRuleIdRequest: + $ref: '#/components/examples/create_index_threshold_rule_request' responses: '200': description: Indicates a successful call. @@ -113,8 +176,14 @@ paths: schema: $ref: '#/components/schemas/rule_response_properties' examples: - createRuleResponse: - $ref: '#/components/examples/create_rule_response' + createEsQueryEsqlRuleIdResponse: + $ref: '#/components/examples/create_es_query_esql_rule_response' + createEsQueryRuleIdResponse: + $ref: '#/components/examples/create_es_query_rule_response' + createEsQueryKqlRuleIdResponse: + $ref: '#/components/examples/create_es_query_kql_rule_response' + createIndexThresholdRuleIdResponse: + $ref: '#/components/examples/create_index_threshold_rule_response' '401': description: Authorization information is missing or invalid. content: @@ -127,13 +196,11 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - servers: - - url: https://localhost:5601 put: summary: Updates the attributes for a rule. operationId: updateRule description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. NOTE: This API supports only token-based authentication. When you update a rule, it identifies which roles you have at that point in time. Thereafter, when the rule performs queries, it uses those security privileges. If you have different privileges than the user that created or most recently updated the rule, you might change its behavior. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. + To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. tags: - alerting parameters: @@ -147,7 +214,7 @@ paths: schema: $ref: '#/components/schemas/update_rule_request' examples: - updateCaseRequest: + updateRuleRequest: $ref: '#/components/examples/update_rule_request' responses: '200': @@ -171,10 +238,6 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_disable: post: summary: Disables a rule. @@ -202,16 +265,12 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_enable: post: summary: Enables a rule. operationId: enableRule description: | - This API supports token-based authentication only. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. + To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. tags: - alerting parameters: @@ -233,10 +292,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rules/_find: get: summary: Retrieves information about rules. @@ -253,7 +308,8 @@ paths: schema: type: string default: OR - example: OR + examples: + - AND - name: fields in: query description: The fields to return in the `attributes` key of the response. @@ -283,25 +339,31 @@ paths: schema: type: integer default: 1 - example: 1 + examples: + - 1 - name: per_page in: query description: The number of rules to return per page. schema: type: integer default: 20 - example: 20 + examples: + - 20 - name: search in: query description: An Elasticsearch simple_query_string query that filters the objects in the response. schema: type: string + examples: + - threshold +-test* - name: search_fields in: query description: The fields to perform the simple_query_string parsed query against. schema: oneOf: - type: string + examples: + - name - type: array items: type: string @@ -320,7 +382,8 @@ paths: - asc - desc default: desc - example: asc + examples: + - asc responses: '200': description: Indicates a successful call. @@ -342,16 +405,14 @@ paths: examples: findRulesResponse: $ref: '#/components/examples/find_rules_response' + findConditionalActionRulesResponse: + $ref: '#/components/examples/find_rules_response_conditional_action' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/_health: get: summary: Retrieves the health status of the alerting framework. @@ -370,44 +431,6 @@ paths: schema: type: object properties: - alerting_framework_heath: - type: object - description: This property has a typo. Use `alerting_framework_health` instead. - deprecated: true - properties: - _deprecated: - type: string - example: This state property has a typo, use "alerting_framework_health" instead. - decryption_health: - type: object - properties: - status: - type: string - example: ok - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' - execution_health: - type: object - properties: - status: - type: string - example: ok - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' - read_health: - type: object - properties: - status: - type: string - example: ok - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' alerting_framework_health: type: object description: | @@ -419,7 +442,8 @@ paths: properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -427,14 +451,16 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' execution_health: type: object description: The timestamp and status of the rule run. properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -442,14 +468,16 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' read_health: type: object description: The timestamp and status of the rule reading events. properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -457,15 +485,18 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' has_permanent_encryption_key: type: boolean description: If `false`, the encrypted saved object plugin does not have a permanent encryption key. - example: true + examples: + - true is_sufficiently_secure: type: boolean description: If `false`, security is enabled but TLS is not. - example: true + examples: + - true examples: getAlertingHealthResponse: $ref: '#/components/examples/get_health_response' @@ -475,8 +506,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule_types: get: summary: Retrieves a list of rule types. @@ -542,6 +571,63 @@ paths: type: string name: type: string + alerts: + type: object + description: | + Details for writing alerts as data documents for this rule type. + properties: + context: + type: string + description: | + The namespace for this rule type. + enum: + - ml.anomaly-detection + - observability.apm + - observability.logs + - observability.metrics + - observability.slo + - observability.threshold + - observability.uptime + - security + - stack + dynamic: + type: string + description: Indicates whether new fields are added dynamically. + enum: + - 'false' + - runtime + - strict + - 'true' + isSpaceAware: + type: boolean + description: | + Indicates whether the alerts are space-aware. If true, space-specific alert indices are used. + mappings: + type: object + properties: + fieldMap: + type: object + description: | + Mapping information for each field supported in alerts as data documents for this rule type. For more information about mapping parameters, refer to the Elasticsearch documentation. + additionalProperties: + $ref: '#/components/schemas/fieldmap_properties' + secondaryAlias: + type: string + description: | + A secondary alias. It is typically used to support the signals alias for detection rules. + shouldWrite: + type: boolean + description: | + Indicates whether the rule should write out alerts as data. + useEcs: + type: boolean + description: | + Indicates whether to include the ECS component template for the alerts. + useLegacyAlerts: + type: boolean + default: false + description: | + Indicates whether to include the legacy component template for the alerts. authorized_consumers: description: The list of the plugins IDs that have access to the rule type. type: object @@ -602,6 +688,13 @@ paths: type: boolean read: type: boolean + slo: + type: object + properties: + all: + type: boolean + read: + type: boolean stackAlerts: type: object properties: @@ -616,6 +709,13 @@ paths: type: boolean read: type: boolean + category: + type: string + description: The rule category, which is used by features such as category-specific maintenance windows. + enum: + - management + - observability + - securitySolution default_action_group_id: description: The default identifier for the rule type group. type: string @@ -625,6 +725,11 @@ paths: enabled_in_license: description: Indicates whether the rule type is enabled or disabled based on the subscription. type: boolean + has_alerts_mappings: + type: boolean + description: Indicates whether the rule type has custom mappings for the alert data. + has_fields_for_a_a_d: + type: boolean id: description: The unique identifier for the rule type. type: string @@ -634,14 +739,16 @@ paths: minimum_license_required: description: The subscriptions required to use the rule type. type: string - example: basic + examples: + - basic name: description: The descriptive name of the rule type. type: string producer: description: An identifier for the application that produces this rule type. type: string - example: stackAlerts + examples: + - stackAlerts recovery_action_group: description: An action group to use when an alert goes from an active state to an inactive one. type: object @@ -652,7 +759,8 @@ paths: type: string rule_task_timeout: type: string - example: 5m + examples: + - 5m examples: getRuleTypesResponse: $ref: '#/components/examples/get_rule_types_response' @@ -662,8 +770,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_mute_all: post: summary: Mutes all alerts. @@ -685,10 +791,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all: post: summary: Unmutes all alerts. @@ -710,16 +812,32 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 + /s/{spaceId}/api/alerting/rule/{ruleId}/_update_api_key: + post: + summary: Updates the API key for a rule. + operationId: updateRuleAPIKey + description: The new API key has the credentials of the user that submits the request. + tags: + - alerting + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/rule_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_mute: post: summary: Mutes an alert. operationId: muteAlert description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. + You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. tags: - alerting parameters: @@ -736,16 +854,12 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute: post: summary: Unmutes an alert. operationId: unmuteAlert description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. + You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. tags: - alerting parameters: @@ -762,10 +876,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}: delete: summary: Permanently removes an alert. @@ -784,7 +894,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '204': description: Indicates a successful call. @@ -794,8 +905,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 get: summary: Retrieves an alert by its identifier. operationId: legacyGetAlert @@ -811,7 +920,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '200': description: Indicates a successful call. @@ -825,8 +935,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 post: summary: Create an alert. operationId: legacyCreateAlert @@ -842,7 +950,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 - $ref: '#/components/parameters/space_id' requestBody: required: true @@ -913,7 +1022,8 @@ paths: interval: type: string description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute. - example: 10s + examples: + - 10s tags: type: array items: @@ -936,8 +1046,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 put: summary: Updates the attributes for an alert. operationId: legacyUpdateAlert @@ -954,7 +1062,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 requestBody: required: true content: @@ -1013,7 +1122,8 @@ paths: interval: type: string description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute. - example: 1d + examples: + - 1d tags: type: array items: @@ -1036,10 +1146,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_disable: post: summary: Disables an alert. @@ -1057,7 +1163,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '204': description: Indicates a successful call. @@ -1067,10 +1174,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_enable: post: summary: Enables an alert. @@ -1088,7 +1191,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '204': description: Indicates a successful call. @@ -1098,10 +1202,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_mute_all: post: summary: Mutes all alert instances. @@ -1119,7 +1219,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '204': description: Indicates a successful call. @@ -1129,10 +1230,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/_unmute_all: post: summary: Unmutes all alert instances. @@ -1150,7 +1247,8 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 responses: '204': description: Indicates a successful call. @@ -1160,10 +1258,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/_find: get: summary: Retrieves a paginated set of alerts. @@ -1181,7 +1275,8 @@ paths: schema: type: string default: OR - example: OR + examples: + - OR - name: fields in: query description: The fields to return in the `attributes` key of the response. @@ -1211,14 +1306,16 @@ paths: schema: type: integer default: 1 - example: 1 + examples: + - 1 - name: per_page in: query description: The number of alerts to return per page. schema: type: integer default: 20 - example: 20 + examples: + - 20 - name: search in: query description: An Elasticsearch `simple_query_string` query that filters the alerts in the response. @@ -1248,7 +1345,8 @@ paths: - asc - desc default: desc - example: asc + examples: + - asc responses: '200': description: Indicates a successful call. @@ -1273,10 +1371,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/_health: get: summary: Retrieves the health status of the alerting framework. @@ -1306,7 +1400,8 @@ paths: properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -1314,14 +1409,16 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' executionHealth: type: object description: The timestamp and status of the alert execution. properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -1329,14 +1426,16 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' readHealth: type: object description: The timestamp and status of the alert reading events. properties: status: type: string - example: ok + examples: + - ok enum: - error - ok @@ -1344,23 +1443,24 @@ paths: timestamp: type: string format: date-time - example: '2023-01-13T01:28:00.280Z' + examples: + - '2023-01-13T01:28:00.280Z' hasPermanentEncryptionKey: type: boolean description: If `false`, the encrypted saved object plugin does not have a permanent encryption key. - example: true + examples: + - true isSufficientlySecure: type: boolean description: If `false`, security is enabled but TLS is not. - example: true + examples: + - true '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alerts/list_alert_types: get: summary: Retrieves a list of alert types. @@ -1463,8 +1563,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute: post: summary: Mutes an alert instance. @@ -1482,14 +1580,16 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 - in: path name: alertInstanceId description: An identifier for the alert instance. required: true schema: type: string - example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + examples: + - dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 responses: '204': description: Indicates a successful call. @@ -1499,10 +1599,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute: post: summary: Unmutes an alert instance. @@ -1520,14 +1616,16 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + examples: + - 41893910-6bca-11eb-9e0d-85d233e3ee35 - in: path name: alertInstanceId description: An identifier for the alert instance. required: true schema: type: string - example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + examples: + - dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 responses: '204': description: Indicates a successful call. @@ -1537,10 +1635,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 components: securitySchemes: basicAuth: @@ -1552,14 +1646,13 @@ components: name: Authorization description: 'e.g. Authorization: ApiKey base64AccessApiKey' parameters: - rule_id: - in: path - name: ruleId - description: An identifier for the rule. - required: true + kbn_xsrf: schema: type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + in: header + name: kbn-xsrf + description: Cross-site request forgery protection + required: true space_id: in: path name: spaceId @@ -1567,14 +1660,17 @@ components: required: true schema: type: string - example: default - kbn_xsrf: + examples: + - default + rule_id: + in: path + name: ruleId + description: An identifier for the rule. + required: true schema: type: string - in: header - name: kbn-xsrf - description: Cross-site request forgery protection - required: true + examples: + - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 alert_id: in: path name: alertId @@ -1582,79 +1678,259 @@ components: required: true schema: type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + examples: + - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 schemas: - notify_when: + filter: + type: object + description: A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package. + properties: + meta: + type: object + properties: + alias: + type: + - string + - 'null' + controlledBy: + type: string + disabled: + type: boolean + field: + type: string + group: + type: string + index: + type: string + isMultiIndex: + type: boolean + key: + type: string + negate: + type: boolean + params: + type: object + type: + type: string + value: + type: string + query: + type: object + $state: + type: object + notify_when_action: type: string description: | - Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. + Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. enum: - onActionGroupChange - onActiveAlert - onThrottleInterval - example: onActiveAlert - throttle: - type: string - description: The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. - nullable: true + examples: + - onActiveAlert + throttle_action: + type: + - string + - 'null' + description: | + The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. default: null - example: 10m + examples: + - 10m actions: - type: array + type: + - array + - 'null' default: [] - required: - - group - - id - - params - nullable: true items: type: object + required: + - group + - id + - params + description: | + An action that runs under defined conditions. properties: + alerts_filter: + type: object + description: | + Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs. + properties: + query: + type: object + description: Defines a query filter that determines whether the action runs. + properties: + kql: + type: string + description: A filter written in Kibana Query Language (KQL). + filters: + type: array + items: + $ref: '#/components/schemas/filter' + timeframe: + type: object + description: Defines a period that limits whether the action runs. + properties: + days: + type: array + description: Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week. + items: + type: integer + examples: + - - 1 + - 2 + - 3 + - 4 + - 5 + hours: + type: object + description: | + Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day. + properties: + end: + type: string + description: The end of the time frame in 24-hour notation (`hh:mm`). + examples: + - '17:00' + start: + type: string + description: The start of the time frame in 24-hour notation (`hh:mm`). + examples: + - '08:00' + timezone: + type: string + description: | + The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended. + examples: + - Europe/Madrid connector_type_id: type: string description: The type of connector. This property appears in responses but cannot be set in requests. - example: .server-log + examples: + - .server-log readOnly: true frequency: type: object description: | - The parameters that affect how often actions are generated. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. + The properties that affect how often actions are generated. If the rule type supports setting `summary` to `true`, the action can be a summary of alerts at the specified notification interval. Otherwise, an action runs for each alert at the specified notification interval. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. required: - notify_when - summary properties: notify_when: - $ref: '#/components/schemas/notify_when' + $ref: '#/components/schemas/notify_when_action' summary: type: boolean description: Indicates whether the action is a summary. throttle: - $ref: '#/components/schemas/throttle' + $ref: '#/components/schemas/throttle_action' group: type: string - description: The group name for the actions. If you don't need to group actions, set to `default`. - example: default + description: | + The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`. + examples: + - default id: type: string description: The identifier for the connector saved object. - example: 9dca3e00-74f5-11ed-9801-35303b735aef + examples: + - 9dca3e00-74f5-11ed-9801-35303b735aef params: type: object description: The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context. additionalProperties: true + uuid: + type: string + description: A universally unique identifier (UUID) for the action. + examples: + - 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 + notify_when: + type: string + description: | + Deprecated in 8.13.0. Use the `notify_when` property in the action `frequency` object instead. Indicates how often alerts generate actions. NOTE: You cannot specify `notify_when` at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + deprecated: true + examples: + - onActiveAlert schedule: type: object description: The check interval, which specifies how frequently the rule conditions are checked. The interval is specified in seconds, minutes, hours, or days. properties: interval: type: string - example: 1m + examples: + - 1m tags: type: array description: The tags for the rule. items: type: string default: [] + throttle: + type: + - string + - 'null' + description: | + Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + default: null + deprecated: true + examples: + - 10m + alert_delay: + type: object + description: Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions. + required: + - active + properties: + active: + type: number + description: The number of consecutive runs that must meet the rule conditions. + example: 3 + create_rule_request: + title: Create rule request + description: The create rule API request body varies depending on the type of rule and actions. + type: object + required: + - consumer + - name + - params + - rule_type_id + - schedule + properties: + actions: + $ref: '#/components/schemas/actions' + consumer: + type: string + description: | + The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + enabled: + type: boolean + description: Indicates whether you want to run the rule on an interval basis after it is created. + name: + type: string + description: The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule. + example: cluster_health_rule + notify_when: + $ref: '#/components/schemas/notify_when' + params: + type: object + description: The parameters for the rule. + additionalProperties: true + rule_type_id: + type: string + description: | + The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. + schedule: + $ref: '#/components/schemas/schedule' + tags: + $ref: '#/components/schemas/tags' + throttle: + $ref: '#/components/schemas/throttle' + alert_delay: + $ref: '#/components/schemas/alert_delay' rule_response_properties: title: Rule response properties type: object @@ -1680,45 +1956,65 @@ components: properties: actions: $ref: '#/components/schemas/actions' + alert_delay: + $ref: '#/components/schemas/alert_delay' + api_key_created_by_user: + type: boolean + description: Indicates whether the API key that is associated with the rule was created by the user. + examples: + - false api_key_owner: - type: string - nullable: true - example: elastic + type: + - string + - 'null' + description: | + The owner of the API key that is associated with the rule and used to run background tasks. + examples: + - elastic consumer: type: string description: The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. - example: alerts + examples: + - alerts created_at: type: string description: The date and time that the rule was created. format: date-time - example: '2022-12-05T23:36:58.284Z' + examples: + - '2022-12-05T23:36:58.284Z' created_by: - type: string + type: + - string + - 'null' description: The identifier for the user that created the rule. - nullable: true - example: elastic + examples: + - elastic enabled: type: boolean description: Indicates whether the rule is currently enabled. - example: true + examples: + - true execution_status: type: object properties: last_duration: type: integer - example: 55 + examples: + - 55 last_execution_date: type: string format: date-time - example: '2022-12-06T00:13:43.890Z' + examples: + - '2022-12-06T00:13:43.890Z' status: type: string - example: ok + examples: + - ok id: type: string description: The identifier for the rule. - example: b530fed0-74f5-11ed-9801-35303b735aef + examples: + - b530fed0-74f5-11ed-9801-35303b735aef last_run: type: object properties: @@ -1735,43 +2031,62 @@ components: type: integer outcome: type: string - example: succeeded + examples: + - succeeded outcome_msg: - type: string - nullable: true - example: null + type: + - array + - 'null' + items: + type: string + outcome_order: + type: integer warning: - type: string - nullable: true - example: null + type: + - string + - 'null' + examples: + - null muted_alert_ids: - type: array - nullable: true + type: + - array + - 'null' items: type: string mute_all: type: boolean - example: false + examples: + - false name: type: string description: The name of the rule. - example: cluster_health_rule + examples: + - cluster_health_rule next_run: - type: string + type: + - string + - 'null' format: date-time - nullable: true - example: '2022-12-06T00:14:43.818Z' + examples: + - '2022-12-06T00:14:43.818Z' notify_when: - $ref: '#/components/schemas/notify_when' + type: + - string + - 'null' + description: Indicates how often alerts generate actions. params: type: object description: The parameters for the rule. additionalProperties: true + revision: + type: integer + description: The rule revision number. rule_type_id: type: string description: | The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. - example: monitoring_alert_cluster_health + examples: + - monitoring_alert_cluster_health running: type: boolean description: Indicates whether the rule is running. @@ -1779,7 +2094,8 @@ components: $ref: '#/components/schemas/schedule' scheduled_task_id: type: string - example: b530fed0-74f5-11ed-9801-35303b735aef + examples: + - b530fed0-74f5-11ed-9801-35303b735aef tags: $ref: '#/components/schemas/tags' throttle: @@ -1787,26 +2103,31 @@ components: updated_at: type: string description: The date and time that the rule was updated most recently. - example: '2022-12-05T23:36:58.284Z' + examples: + - '2022-12-05T23:36:58.284Z' updated_by: - type: string + type: + - string + - 'null' description: The identifier for the user that updated this rule most recently. - nullable: true - example: elastic + examples: + - elastic 401_response: type: object title: Unsuccessful rule API response properties: error: type: string - example: Unauthorized + examples: + - Unauthorized enum: - Unauthorized message: type: string statusCode: type: integer - example: 401 + examples: + - 401 enum: - 401 404_response: @@ -1814,20 +2135,24 @@ components: properties: error: type: string - example: Not Found + examples: + - Not Found enum: - Not Found message: type: string - example: Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found + examples: + - Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found statusCode: type: integer - example: 404 + examples: + - 404 enum: - 404 update_rule_request: title: Update rule request - description: The update rule API request body varies depending on the type of rule and actions. + description: | + The update rule API request body varies depending on the type of rule and actions. type: object required: - name @@ -1836,10 +2161,13 @@ components: properties: actions: $ref: '#/components/schemas/actions' + alert_delay: + $ref: '#/components/schemas/alert_delay' name: type: string description: The name of the rule. - example: cluster_health_rule + examples: + - cluster_health_rule notify_when: $ref: '#/components/schemas/notify_when' params: @@ -1852,46 +2180,68 @@ components: $ref: '#/components/schemas/tags' throttle: $ref: '#/components/schemas/throttle' - create_rule_request: - title: Create rule request - description: The create rule API request body varies depending on the type of rule and actions. + fieldmap_properties: + title: Field map objects in the get rule types response type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule properties: - actions: - $ref: '#/components/schemas/actions' - consumer: + array: + type: boolean + description: Indicates whether the field is an array. + dynamic: + type: boolean + description: Indicates whether it is a dynamic field mapping. + format: type: string description: | - The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. - enabled: + Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. + ignore_above: + type: integer + description: Specifies the maximum length of a string field. Longer strings are not indexed or stored. + index: type: boolean - description: Indicates whether you want to run the rule on an interval basis after it is created. - name: + description: Indicates whether field values are indexed. + path: type: string - description: The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule. - example: cluster_health_rule - notify_when: - $ref: '#/components/schemas/notify_when' - params: + description: TBD + properties: type: object - description: The parameters for the rule. - additionalProperties: true - rule_type_id: - type: string description: | - The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' + Details about the object properties. This property is applicable when `type` is `object`. + additionalProperties: + type: object + properties: + type: + type: string + description: The data type for each object property. + required: + type: boolean + description: Indicates whether the field is required. + scaling_factor: + type: integer + description: | + The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. + type: + type: string + description: Specifies the data type for the field. + example: scaled_float + 400_response: + title: Bad request + type: object + required: + - error + - message + - statusCode + properties: + error: + type: string + enum: + - Bad Request + message: + type: string + statusCode: + type: integer + enum: + - 400 alert_response_properties: title: Legacy alert response properties type: object @@ -1902,80 +2252,524 @@ components: type: object alertTypeId: type: string - example: .index-threshold + examples: + - .index-threshold apiKeyOwner: - type: string - nullable: true - example: elastic + type: + - string + - 'null' + examples: + - elastic createdAt: type: string description: The date and time that the alert was created. format: date-time - example: '2022-12-05T23:36:58.284Z' + examples: + - '2022-12-05T23:36:58.284Z' createdBy: type: string description: The identifier for the user that created the alert. - example: elastic + examples: + - elastic enabled: type: boolean description: Indicates whether the alert is currently enabled. - example: true + examples: + - true executionStatus: type: object properties: lastExecutionDate: type: string format: date-time - example: '2022-12-06T00:13:43.890Z' + examples: + - '2022-12-06T00:13:43.890Z' status: type: string - example: ok + examples: + - ok id: type: string description: The identifier for the alert. - example: b530fed0-74f5-11ed-9801-35303b735aef + examples: + - b530fed0-74f5-11ed-9801-35303b735aef muteAll: type: boolean - example: false + examples: + - false mutedInstanceIds: - type: array - nullable: true + type: + - array + - 'null' items: type: string name: type: string description: The name of the alert. - example: my alert + examples: + - my alert notifyWhen: type: string - example: onActionGroupChange + examples: + - onActionGroupChange params: type: object additionalProperties: true schedule: - type: object - properties: - interval: - type: string - scheduledTaskId: - type: string - example: b530fed0-74f5-11ed-9801-35303b735aef - tags: - type: array - items: - type: string - throttle: - type: string - nullable: true - updatedAt: - type: string - example: '2022-12-05T23:36:58.284Z' - updatedBy: - type: string - description: The identifier for the user that updated this alert most recently. - nullable: true - example: elastic - examples: + type: object + properties: + interval: + type: string + scheduledTaskId: + type: string + examples: + - b530fed0-74f5-11ed-9801-35303b735aef + tags: + type: array + items: + type: string + throttle: + type: + - string + - 'null' + updatedAt: + type: string + examples: + - '2022-12-05T23:36:58.284Z' + updatedBy: + type: + - string + - 'null' + description: The identifier for the user that updated this alert most recently. + examples: + - elastic + examples: + create_es_query_esql_rule_request: + summary: Create an Elasticsearch query rule that uses Elasticsearch Query Language (ES|QL). + value: + name: my Elasticsearch query ESQL rule + params: + searchType: esqlQuery + esqlQuery: + esql: FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest | where geo.dest != "GB" | STATS sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | SORT sumbytes desc | LIMIT 10 + timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + size: 0 + thresholdComparator: '>' + threshold: + - 0 + consumer: stackAlerts + rule_type_id: .es-query + schedule: + interval: 1d + actions: + - group: query matched + id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 + params: + level: info + message: |- + Elasticsearch query rule '{{rule.name}}' is active: + - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} + frequency: + summary: false + notify_when: onActiveAlert + create_es_query_rule_request: + summary: Create an Elasticsearch query rule that uses Elasticsearch query domain specific language (DSL) to define its query and a server log connector to send notifications. + value: + actions: + - group: query matched + params: + level: info + message: The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts. + id: fdbece50-406c-11ee-850e-c71febc4ca7f + frequency: + throttle: 1d + summary: true + notify_when: onThrottleInterval + - group: recovered + params: + level: info + message: Recovered + id: fdbece50-406c-11ee-850e-c71febc4ca7f + frequency: + summary: false + notify_when: onActionGroupChange + consumer: alerts + name: my Elasticsearch query rule + params: + esQuery: '"""{"query":{"match_all" : {}}}"""' + index: + - kibana_sample_data_logs + size: 100 + threshold: + - 100 + thresholdComparator: '>' + timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + rule_type_id: .es-query + schedule: + interval: 1d + create_es_query_kql_rule_request: + summary: Create an Elasticsearch query rule that uses Kibana query language (KQL). + value: + consumer: alerts + name: my Elasticsearch query KQL rule + params: + aggType: count + excludeHitsFromPreviousRun: true + groupBy: all + searchConfiguration: + query: + query: '""geo.src : "US" ""' + language: kuery + index: 90943e30-9a47-11e8-b64d-95841ca0b247 + searchType: searchSource + size: 100 + threshold: + - 1000 + thresholdComparator: '>' + timeWindowSize: 5 + timeWindowUnit: m + rule_type_id: .es-query + schedule: + interval: 1m + create_index_threshold_rule_request: + summary: Create an index threshold rule. + value: + actions: + - id: 48de3460-f401-11ed-9f8e-399c75a2deeb + frequency: + notify_when: onActionGroupChange + summary: false + group: threshold met + params: + level: info + message: |- + Rule '{{rule.name}}' is active for group '{{context.group}}': + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date}} + alert_delay: + active: 3 + consumer: alerts + name: my rule + params: + aggType: avg + termSize: 6 + thresholdComparator: '>' + timeWindowSize: 5 + timeWindowUnit: m + groupBy: top + threshold: + - 1000 + index: + - .test-index + timeField: '@timestamp' + aggField: sheet.version + termField: name.keyword + rule_type_id: .index-threshold + schedule: + interval: 1m + tags: + - cpu + create_tracking_containment_rule_request: + summary: Create a tracking containment rule. + value: + consumer: alerts + name: my tracking rule + params: + index: kibana_sample_data_logs + dateField": '@timestamp' + geoField: geo.coordinates + entity: agent.keyword + boundaryType: entireIndex + boundaryIndexTitle: boundary* + boundaryGeoField: location + boundaryNameField: name + indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 + boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc + rule_type_id: .geo-containment + schedule: + interval: 1h + create_es_query_esql_rule_response: + summary: The create rule API returns a JSON object that contains details about the rule. + value: + id: e0d62360-78e8-11ee-9177-f7d404c8c945 + enabled: true + name: my Elasticsearch query ESQL rule + tags: [] + rule_type_id: .es-query + consumer: stackAlerts + schedule: + interval: 1d + actions: + - group: query matched + id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 + params: + level: info + message: |- + Elasticsearch query rule '{{rule.name}}' is active: + - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} + connector_type_id: .server-log + frequency: + summary: false + notify_when: onActiveAlert + throttle: null + uuid: bfe370a3-531b-4855-bbe6-ad739f578844 + params: + searchType: esqlQuery + esqlQuery: + esql: FROM kibana_sample_data_logs | keep bytes, clientip, host, geo.dest | WHERE geo.dest != "GB" | stats sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | sort sumbytes desc | limit 10 + timeField: '@timestamp' + timeWindowSize: 1 + timeWindowUnit: d + size: 0 + thresholdComparator: '>' + threshold: + - 0 + excludeHitsFromPreviousRun": true, + aggType: count + groupBy: all + scheduled_task_id: e0d62360-78e8-11ee-9177-f7d404c8c945 + created_by: elastic + updated_by: elastic", + created_at: '2023-11-01T19:00:10.453Z' + updated_at: '2023-11-01T19:00:10.453Z' + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + mute_all: false + notify_when: null + muted_alert_ids: [] + execution_status: + status: pending + last_execution_date: '2023-11-01T19:00:10.453Z' + revision: 0 + running: false + create_es_query_rule_response: + summary: The create rule API returns a JSON object that contains details about the rule. + value: + id: 58148c70-407f-11ee-850e-c71febc4ca7f + enabled: true + name: my Elasticsearch query rule + tags: [] + rule_type_id: .es-query + consumer: alerts + schedule: + interval: 1d + actions: + - group: query matched + id: fdbece50-406c-11ee-850e-c71febc4ca7f + params: + level: info + message: The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts. + connector_type_id: .server-log + frequency: + summary: true + notify_when: onThrottleInterval + throttle: 1d + uuid: 53f3c2a3-e5d0-4cfa-af3b-6f0881385e78 + - group: recovered + id: fdbece50-406c-11ee-850e-c71febc4ca7f + params: + level: info + message: Recovered + connector_type_id: .server-log + frequency: + summary: false + notify_when: onActionGroupChange + throttle: null + uuid: 2324e45b-c0df-45c7-9d70-4993e30be758 + params: + thresholdComparator: '>' + timeWindowSize: 1 + timeWindowUnit: d + threshold: + - 100 + size: 100 + timeField: '@timestamp' + index: + - kibana_sample_data_logs + esQuery: '"""{"query":{"match_all" : {}}}"""' + excludeHitsFromPreviousRun: true + aggType: count + groupBy: all + searchType: esQuery + scheduled_task_id: 58148c70-407f-11ee-850e-c71febc4ca7f + created_by: elastic + updated_by: elastic + created_at: '2023-08-22T00:03:38.263Z' + updated_at: '2023-08-22T00:03:38.263Z' + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + mute_all: false + notify_when: null + muted_alert_ids: [] + execution_status: + status: pending + last_execution_date: '2023-08-22T00:03:38.263Z' + revision: 0 + running: false + create_es_query_kql_rule_response: + summary: The create rule API returns a JSON object that contains details about the rule. + value: + id: 7bd506d0-2284-11ee-8fad-6101956ced88 + enabled: true + name: my Elasticsearch query KQL rule" + tags: [] + rule_type_id: .es-query + consumer: alerts + schedule: + interval: 1m + actions: [] + params: + searchConfiguration: + query: + query: '""geo.src : "US" ""' + language: kuery + index: 90943e30-9a47-11e8-b64d-95841ca0b247 + searchType: searchSource + timeWindowSize: 5 + timeWindowUnit: m + threshold: + - 1000 + thresholdComparator: '>' + size: 100 + aggType: count + groupBy: all + excludeHitsFromPreviousRun: true + created_by: elastic + updated_by: elastic + created_at: '2023-07-14T20:24:50.729Z' + updated_at: '2023-07-14T20:24:50.729Z' + api_key_owner: elastic + api_key_created_by_user: false + throttle: null + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: 7bd506d0-2284-11ee-8fad-6101956ced88 + execution_status: + status: pending + last_execution_date: '2023-07-14T20:24:50.729Z' + revision: 0 + running: false + create_index_threshold_rule_response: + summary: The create rule API returns a JSON object that contains details about the rule. + value: + actions: + - group: threshold met + id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d + connector_type_id: .server-log + frequency: + notify_when: onActionGroupChange + summary: false + throttle: null + params: + level: info + message: |- + Rule {{rule.name}} is active for group {{context.group} : + + - Value: {{context.value}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} + - Timestamp: {{context.date}} + alert_delay: + active: 3 + api_key_created_by_user: false + api_key_owner: elastic + consumer: alerts + created_at: '2022-06-08T17:20:31.632Z' + created_by: elastic + enabled: true + execution_status: + last_execution_date: '2022-06-08T17:20:31.632Z' + status: pending + id: 41893910-6bca-11eb-9e0d-85d233e3ee35 + muted_alert_ids: [] + mute_all: false + name: my rule + notify_when: null + params: + aggType: avg + termSize: 6 + thresholdComparator: '>' + timeWindowSize: 5 + timeWindowUnit: m + groupBy: top + threshold: + - 1000 + index: + - .test-index + timeField: '@timestamp' + aggField: sheet.version + termField: name.keyword + revision: 0 + rule_type_id: .index-threshold + running: false + schedule: + interval: 1m + scheduled_task_id: 425b0800-6bca-11eb-9e0d-85d233e3ee35 + tags: + - cpu + throttle: null + updated_at: '2022-06-08T17:20:31.632Z' + updated_by: elastic + create_tracking_containment_rule_response: + summary: The create rule API returns a JSON object that contains details about the rule. + value: + id: b6883f9d-5f70-4758-a66e-369d7c26012f + name: my tracking rule + tags: [] + enabled: true + consumer: alerts + throttle: null + revision: 1 + running: false + schedule: + interval: 1h + params: + index: kibana_sample_data_logs + dateField: '@timestamp' + geoField: geo.coordinates + entity: agent.keyword + boundaryType: entireIndex + boundaryIndexTitle: boundary* + boundaryGeoField: location + boundaryNameField: name + indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 + boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc + rule_type_id: .geo-containment + created_by: elastic + updated_by: elastic + created_at: '2024-02-14T19:52:55.920Z' + updated_at: '2024-02-15T03:24:32.574Z' + api_key_owner: elastic + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: b6883f9d-5f70-4758-a66e-369d7c26012f + execution_status: + status: ok + last_execution_date: '2024-02-15T03:25:38.125Z' + last_duration: 74 + actions: [] + last_run: + alerts_count: + active: 0 + new: 0 + recovered: 0 + ignored: 0 + outcome_msg: null + outcome_order: 0 + outcome: succeeded + warning: null + next_run: '2024-02-15T03:26:38.033Z' + api_key_created_by_user: false get_rule_response: summary: The get rule API returns a JSON object that contains details about the rule. value: @@ -2002,13 +2796,14 @@ components: timeField: '@timestamp' aggField: sheet.version termField: name.keyword + revision: 1 rule_type_id: .index-threshold created_by: elastic updated_by: elastic created_at: '2022-12-13T22:33:41.163Z' updated_at: '2022-12-13T22:33:41.163Z' api_key_owner: elastic - notify_when: onActionGroupChange + notify_when: null muted_alert_ids: [] mute_all: false scheduled_task_id: 31697a40-7b36-11ed-aa79-f742c05329b2 @@ -2019,15 +2814,21 @@ components: actions: - group: threshold met id: 1007a0c0-7a6e-11ed-89d5-abec321c0def + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: + Rule {{rule.name}} is active for group {{context.group}}: - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date} connector_type_id: .server-log + connector_type_id: .server-log + frequency: + throttle: null + summary: false + notify_when: onActionGroupChange last_run: alerts_count: new: 0 @@ -2038,6 +2839,7 @@ components: warning: null outcome: succeeded next_run: '2022-12-13T22:34:44.314Z' + api_key_created_by_user: false update_rule_request: summary: Update an index threshold rule. value: @@ -2050,16 +2852,16 @@ components: params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: + Rule {{rule.name}} is active for group {{context.group}}: - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} params: aggField: sheet.version aggType: avg index: - - .test-index + - .updated-index groupBy: top termField: name.keyword termSize: 6 @@ -2073,7 +2875,6 @@ components: schedule: interval: 1m tags: [] - throttle: null update_rule_response: summary: The update rule API returns a JSON object that contains details about the rule. value: @@ -2083,9 +2884,10 @@ components: name: new name enabled: true throttle: null + revision: 1 running: false schedule: - interval: 10m + interval: 1m params: index: - .updated-index @@ -2105,25 +2907,26 @@ components: updated_by: elastic rule_type_id: .index-threshold scheduled_task_id: 4c5eda00-e74f-11ec-b72f-5b18752ff9ea - created_at: '2023-01-31T23:03:33.127Z' - updated_at: '2023-01-31T23:55:27.314Z' + created_at: '2024-03-26T23:13:20.985Z' + updated_at: '2024-03-26T23:22:59.949Z' mute_all: false muted_alert_ids: [] execution_status: status: ok - last_execution_date: '2023-01-31T23:48:42.499Z' + last_execution_date: '2024-03-26T23:22:51.390Z' last_duration: 52 actions: - group: threshold met params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: + Rule {{rule.name}} is active for group {{context.group}}: - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date} id: 96b668d0-a1b6-11ed-afdf-d39a49596974 + uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d connector_type_id: .server-log frequency: summary: false @@ -2138,100 +2941,8 @@ components: outcome_msg: null warning: null outcome: succeeded - next_run: '2023-01-31T23:49:42.432Z' - create_rule_request: - summary: Create an index threshold rule. - value: - actions: - - id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 - frequency: - notify_when: onActionGroupChange - summary: false - group: threshold met - params: - level: info - message: |- - alert '{{alertName}}' is active for group '{{context.group}}': - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date}} - consumer: alerts - name: my rule - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - .test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - rule_type_id: .index-threshold - schedule: - interval: 1m - tags: - - cpu - create_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - actions: - - group: threshold met - id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 - frequency: - notify_when: onActionGroupChange - summary: false - throttle: null - params: - level: info - message: |- - alert {{alertName}} is active for group {{context.group} : - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} - - Timestamp: {{context.date}} - api_key_owner: elastic - consumer: alerts - created_at: '2022-06-08T17:20:31.632Z' - created_by: elastic - enabled: true - execution_status: - last_execution_date: '2022-06-08T17:20:31.632Z' - status: pending - id: 41893910-6bca-11eb-9e0d-85d233e3ee35 - muted_alert_ids: [] - mute_all: false - name: my rule - notify_when: onActionGroupChange - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - .test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - rule_type_id: .index-threshold - running: false - schedule: - interval: 1m - scheduled_task_id: 425b0800-6bca-11eb-9e0d-85d233e3ee35 - tags: - - cpu - throttle: null - updated_at: '2022-06-08T17:20:31.632Z' - updated_by: elastic + next_run: '2024-03-26T23:23:51.316Z' + api_key_created_by_user: false find_rules_response: summary: Retrieve information about a rule. value: @@ -2262,13 +2973,13 @@ components: timeField: '@timestamp' aggField: sheet.version termField: name.keyword + revision: 1 rule_type_id: .index-threshold created_by: elastic updated_by: elastic created_at: '2022-12-05T23:40:33.132Z' updated_at: '2022-12-05T23:40:33.132Z' api_key_owner: elastic - notify_when: onActionGroupChange mute_all: false muted_alert_ids: [] scheduled_task_id: 3583a470-74f6-11ed-9801-35303b735aef @@ -2279,15 +2990,20 @@ components: actions: - id: 9dca3e00-74f5-11ed-9801-35303b735aef group: threshold met + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 params: level: info message: |- - alert {{alertName}} is active for group {{context.group}}: + Rule {{rule.name}} is active for group {{context.group}}: - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}} + - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} connector_type_id: .server-log + frequency: + summary: false + notify_when: onActionGroupChange + throttle: null last_run: alerts_count: new: 0 @@ -2298,6 +3014,129 @@ components: warning: null outcome: succeeded next_run: '2022-12-06T01:45:23.912Z' + api_key_created_by_user: false + find_rules_response_conditional_action: + summary: Retrieve information about a rule that has conditional actions. + value: + page: 1 + total: 1 + per_page: 10 + data: + - id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb + name: security_rule + consumer: siem + enabled: true + tags: [] + throttle: null + revision: 1 + running: false + schedule: + interval: 1m + params: + author: [] + description: A security threshold rule. + ruleId: an_internal_rule_id + falsePositives: [] + from: now-3660s + immutable: false + license: '' + outputIndex: '' + meta: + from: 1h + kibana_siem_app_url: https://localhost:5601/app/security + maxSignals: 100 + riskScore: 21 + riskScoreMapping: [] + severity: low + severityMapping: [] + threat: [] + to: now + references: [] + version: 1 + exceptionsList: [] + type: threshold + language: kuery + index: + - kibana_sample_data_logs + query: '*' + filters: [] + threshold: + field: + - bytes + value: 1 + cardinality: [] + rule_type_id: siem.thresholdRule + created_by: elastic + updated_by: elastic + created_at: '2023-05-16T15:50:28.358Z' + updated_at: '2023-05-16T20:25:42.559Z' + api_key_owner: elastic + notify_when: null + mute_all: false + muted_alert_ids: [] + scheduled_task_id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb + execution_status: + status: ok + last_execution_date: '2023-05-16T20:26:49.590Z' + last_duration: 166 + actions: + - group: default + id: 49eae970-f401-11ed-9f8e-399c75a2deeb + params: + documents: + - rule_id: + '[object Object]': null + rule_name: + '[object Object]': null + alert_id: + '[object Object]': null + context_message: + '[object Object]': null + connector_type_id: .index + frequency: + summary: true + notify_when: onActiveAlert + throttle: null + uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 + alerts_filter: + timeframe: + days: + - 7 + timezone: UTC + hours: + start: '08:00' + end: '17:00' + query: + kql: '' + filters: + - meta: + disabled: false + negate: false + alias: null + index: c4bdca79-e69e-4d80-82a1-e5192c621bea + key: client.geo.region_iso_code + field: client.geo.region_iso_code + params: + query: CA-QC + type: phrase + $state: + store: appState + query: + match_phrase: + client.geo.region_iso_code: CA-QC + last_run: + alerts_count: + new: 0 + ignored: 0 + recovered: 0 + active: 0 + outcome_msg: + - Rule execution completed successfully + outcome_order: 0 + warning: null + outcome: succeeded + next_run: '2023-05-16T20:27:49.507Z' + api_key_created_by_user: false get_health_response: summary: Retrieve information about the health of the alerting framework. value: @@ -2313,26 +3152,105 @@ components: read_health: status: ok timestamp: '2023-01-13T01:28:00.280Z' - alerting_framework_heath: - _deprecated: This state property has a typo, use "alerting_framework_health" instead. - decryption_health: - status: ok - timestamp: '2023-01-13T01:28:00.280Z' - execution_health: - status: ok - timestamp: '2023-01-13T01:28:00.280Z' - read_health: - status: ok - timestamp: '2023-01-13T01:28:00.280Z' get_rule_types_response: summary: Retrieve rule types associated with Kibana machine learning features value: - id: xpack.ml.anomaly_detection_alert + name: Anomaly detection alert + category: management + producer: ml + alerts: + context: ml.anomaly-detection + mappings: + fieldMap: + kibana.alert.job_id: + type: keyword + array: false + required: true + kibana.alert.anomaly_score: + type: double + array: false + required: false + kibana.alert.is_interim: + type: boolean + array: false + required: false + kibana.alert.anomaly_timestamp: + type: date + array: false + required: false + kibana.alert.top_records: + type: object + array: true + required: false + dynamic: false + properties: + job_id: + type: keyword + record_score: + type: double + initial_record_score: + type: double + detector_index: + type: integer + is_interim: + type: boolean + timestamp: + type: date + partition_field_name: + type: keyword + partition_field_value: + type: keyword + over_field_name: + type: keyword + over_field_value: + type: keyword + by_field_name: + type: keyword + by_field_value: + type: keyword + function: + type: keyword + typical: + type: double + actual: + type: double + field_name: + type: keyword + kibana.alert.top_influencers: + type: object + array: true + required: false + dynamic: false + properties: + job_id: + type: keyword + influencer_field_name: + type: keyword + influencer_field_value: + type: keyword + influencer_score: + type: double + initial_influencer_score: + type: double + is_interim: + type: boolean + timestamp: + type: date + shouldWrite: true + enabled_in_license: true + recovery_action_group: + id: recovered + name: Recovered action_groups: - id: anomaly_score_match name: Anomaly score matched the condition - id: recovered name: Recovered + default_action_group_id: anomaly_score_match + minimum_license_required: platinum + is_exportable: true + rule_task_timeout: 5m action_variables: context: - name: timestamp @@ -2354,58 +3272,104 @@ components: - name: anomalyExplorerUrl description: URL to open in the Anomaly Explorer useWithTripleBracesInTemplates: true - params: [] state: [] + params: [] authorized_consumers: alerts: + read: true all: true + stackAlerts: read: true + all: true + slo: + read: true + all: true ml: + read: true all: true + uptime: read: true - default_action_group_id: anomaly_score_match + all: true + infrastructure: + read: true + all: true + logs: + read: true + all: true + monitoring: + read: true + all: true + siem: + read: true + all: true + apm: + read: true + all: true + discover: + read: true + all: true does_set_recovery_context: true - enabled_in_license: true - is_exportable: true - minimum_license_required: platinum - name: Anomaly detection alert + has_alerts_mappings: true + has_fields_for_a_a_d: false + - id: xpack.ml.anomaly_detection_jobs_health + name: Anomaly detection jobs health + category: management producer: ml + enabled_in_license: true recovery_action_group: id: recovered name: Recovered - rule_task_timeout: 5m - - id: xpack.ml.anomaly_detection_jobs_health action_groups: - id: anomaly_detection_realtime_issue name: Issue detected - id: recovered name: Recovered + default_action_group_id: anomaly_detection_realtime_issue + minimum_license_required: platinum + is_exportable: true + rule_task_timeout: 5m action_variables: context: - name: results description: Results of the rule execution - name: message description: Alert info message - params: [] state: [] + params: [] authorized_consumers: alerts: + read: true + all: true + stackAlerts: + read: true all: true + slo: read: true + all: true ml: + read: true all: true + uptime: read: true - default_action_group_id: anomaly_detection_realtime_issue + all: true + infrastructure: + read: true + all: true + logs: + read: true + all: true + monitoring: + read: true + all: true + siem: + read: true + all: true + apm: + read: true + all: true + discover: + read: true + all: true does_set_recovery_context: true - enabled_in_license: true - is_exportable: true - minimum_license_required: platinum - name: Anomaly detection jobs health - producer: ml - recovery_action_group: - id: recovered - name: Recovered - rule_task_timeout: 5m -security: - - basicAuth: [] - - apiKeyAuth: [] + has_alerts_mappings: false + has_fields_for_a_a_d: false diff --git a/generated/alerting/client.go b/generated/alerting/client.go index 57ce60a5d..8fe0acd0d 100644 --- a/generated/alerting/client.go +++ b/generated/alerting/client.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -40,7 +40,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Alerting API v0.1 +// APIClient manages communication with the Alerting API v0.2 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/generated/alerting/configuration.go b/generated/alerting/configuration.go index 9194a2ee2..e911bf7c0 100644 --- a/generated/alerting/configuration.go +++ b/generated/alerting/configuration.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -96,168 +96,11 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "http://localhost:5601", - Description: "local", - }, - }, - OperationServers: map[string]ServerConfigurations{ - "AlertingAPIService.CreateRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.DeleteRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.DisableRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.EnableRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.FindRules": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.GetAlertingHealth": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.GetRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.GetRuleTypes": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyCreateAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyDisableAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyEnableAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyFindAlerts": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyGetAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyGetAlertTypes": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyGetAlertingHealth": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyMuteAlertInstance": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyMuteAllAlertInstances": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyUnmuteAlertInstance": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyUnmuteAllAlertInstances": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegacyUpdateAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.LegaryDeleteAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.MuteAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.MuteAllAlerts": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.UnmuteAlert": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.UnmuteAllAlerts": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "AlertingAPIService.UpdateRule": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, + URL: "", + Description: "No description provided", }, }, + OperationServers: map[string]ServerConfigurations{}, } return cfg } diff --git a/generated/alerting/docs/ActionsInner.md b/generated/alerting/docs/ActionsInner.md index 1f3f97df9..7b0eb0ac4 100644 --- a/generated/alerting/docs/ActionsInner.md +++ b/generated/alerting/docs/ActionsInner.md @@ -4,17 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**AlertsFilter** | Pointer to [**ActionsInnerAlertsFilter**](ActionsInnerAlertsFilter.md) | | [optional] **ConnectorTypeId** | Pointer to **string** | The type of connector. This property appears in responses but cannot be set in requests. | [optional] [readonly] **Frequency** | Pointer to [**ActionsInnerFrequency**](ActionsInnerFrequency.md) | | [optional] -**Group** | Pointer to **string** | The group name for the actions. If you don't need to group actions, set to `default`. | [optional] -**Id** | Pointer to **string** | The identifier for the connector saved object. | [optional] -**Params** | Pointer to **map[string]interface{}** | The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context. | [optional] +**Group** | **string** | The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`. | +**Id** | **string** | The identifier for the connector saved object. | +**Params** | **map[string]interface{}** | The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context. | +**Uuid** | Pointer to **string** | A universally unique identifier (UUID) for the action. | [optional] ## Methods ### NewActionsInner -`func NewActionsInner() *ActionsInner` +`func NewActionsInner(group string, id string, params map[string]interface{}, ) *ActionsInner` NewActionsInner instantiates a new ActionsInner object This constructor will assign default values to properties that have it defined, @@ -29,6 +31,31 @@ NewActionsInnerWithDefaults instantiates a new ActionsInner object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetAlertsFilter + +`func (o *ActionsInner) GetAlertsFilter() ActionsInnerAlertsFilter` + +GetAlertsFilter returns the AlertsFilter field if non-nil, zero value otherwise. + +### GetAlertsFilterOk + +`func (o *ActionsInner) GetAlertsFilterOk() (*ActionsInnerAlertsFilter, bool)` + +GetAlertsFilterOk returns a tuple with the AlertsFilter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlertsFilter + +`func (o *ActionsInner) SetAlertsFilter(v ActionsInnerAlertsFilter)` + +SetAlertsFilter sets AlertsFilter field to given value. + +### HasAlertsFilter + +`func (o *ActionsInner) HasAlertsFilter() bool` + +HasAlertsFilter returns a boolean if a field has been set. + ### GetConnectorTypeId `func (o *ActionsInner) GetConnectorTypeId() string` @@ -98,11 +125,6 @@ and a boolean to check if the value has been set. SetGroup sets Group field to given value. -### HasGroup - -`func (o *ActionsInner) HasGroup() bool` - -HasGroup returns a boolean if a field has been set. ### GetId @@ -123,11 +145,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *ActionsInner) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetParams @@ -148,11 +165,31 @@ and a boolean to check if the value has been set. SetParams sets Params field to given value. -### HasParams -`func (o *ActionsInner) HasParams() bool` +### GetUuid + +`func (o *ActionsInner) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *ActionsInner) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *ActionsInner) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *ActionsInner) HasUuid() bool` -HasParams returns a boolean if a field has been set. +HasUuid returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/ActionsInnerAlertsFilter.md b/generated/alerting/docs/ActionsInnerAlertsFilter.md new file mode 100644 index 000000000..252ea36a3 --- /dev/null +++ b/generated/alerting/docs/ActionsInnerAlertsFilter.md @@ -0,0 +1,82 @@ +# ActionsInnerAlertsFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Query** | Pointer to [**ActionsInnerAlertsFilterQuery**](ActionsInnerAlertsFilterQuery.md) | | [optional] +**Timeframe** | Pointer to [**ActionsInnerAlertsFilterTimeframe**](ActionsInnerAlertsFilterTimeframe.md) | | [optional] + +## Methods + +### NewActionsInnerAlertsFilter + +`func NewActionsInnerAlertsFilter() *ActionsInnerAlertsFilter` + +NewActionsInnerAlertsFilter instantiates a new ActionsInnerAlertsFilter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionsInnerAlertsFilterWithDefaults + +`func NewActionsInnerAlertsFilterWithDefaults() *ActionsInnerAlertsFilter` + +NewActionsInnerAlertsFilterWithDefaults instantiates a new ActionsInnerAlertsFilter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQuery + +`func (o *ActionsInnerAlertsFilter) GetQuery() ActionsInnerAlertsFilterQuery` + +GetQuery returns the Query field if non-nil, zero value otherwise. + +### GetQueryOk + +`func (o *ActionsInnerAlertsFilter) GetQueryOk() (*ActionsInnerAlertsFilterQuery, bool)` + +GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuery + +`func (o *ActionsInnerAlertsFilter) SetQuery(v ActionsInnerAlertsFilterQuery)` + +SetQuery sets Query field to given value. + +### HasQuery + +`func (o *ActionsInnerAlertsFilter) HasQuery() bool` + +HasQuery returns a boolean if a field has been set. + +### GetTimeframe + +`func (o *ActionsInnerAlertsFilter) GetTimeframe() ActionsInnerAlertsFilterTimeframe` + +GetTimeframe returns the Timeframe field if non-nil, zero value otherwise. + +### GetTimeframeOk + +`func (o *ActionsInnerAlertsFilter) GetTimeframeOk() (*ActionsInnerAlertsFilterTimeframe, bool)` + +GetTimeframeOk returns a tuple with the Timeframe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeframe + +`func (o *ActionsInnerAlertsFilter) SetTimeframe(v ActionsInnerAlertsFilterTimeframe)` + +SetTimeframe sets Timeframe field to given value. + +### HasTimeframe + +`func (o *ActionsInnerAlertsFilter) HasTimeframe() bool` + +HasTimeframe returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/ActionsInnerAlertsFilterQuery.md b/generated/alerting/docs/ActionsInnerAlertsFilterQuery.md new file mode 100644 index 000000000..b707bc504 --- /dev/null +++ b/generated/alerting/docs/ActionsInnerAlertsFilterQuery.md @@ -0,0 +1,82 @@ +# ActionsInnerAlertsFilterQuery + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kql** | Pointer to **string** | A filter written in Kibana Query Language (KQL). | [optional] +**Filters** | Pointer to [**[]Filter**](Filter.md) | | [optional] + +## Methods + +### NewActionsInnerAlertsFilterQuery + +`func NewActionsInnerAlertsFilterQuery() *ActionsInnerAlertsFilterQuery` + +NewActionsInnerAlertsFilterQuery instantiates a new ActionsInnerAlertsFilterQuery object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionsInnerAlertsFilterQueryWithDefaults + +`func NewActionsInnerAlertsFilterQueryWithDefaults() *ActionsInnerAlertsFilterQuery` + +NewActionsInnerAlertsFilterQueryWithDefaults instantiates a new ActionsInnerAlertsFilterQuery object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKql + +`func (o *ActionsInnerAlertsFilterQuery) GetKql() string` + +GetKql returns the Kql field if non-nil, zero value otherwise. + +### GetKqlOk + +`func (o *ActionsInnerAlertsFilterQuery) GetKqlOk() (*string, bool)` + +GetKqlOk returns a tuple with the Kql field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKql + +`func (o *ActionsInnerAlertsFilterQuery) SetKql(v string)` + +SetKql sets Kql field to given value. + +### HasKql + +`func (o *ActionsInnerAlertsFilterQuery) HasKql() bool` + +HasKql returns a boolean if a field has been set. + +### GetFilters + +`func (o *ActionsInnerAlertsFilterQuery) GetFilters() []Filter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *ActionsInnerAlertsFilterQuery) GetFiltersOk() (*[]Filter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *ActionsInnerAlertsFilterQuery) SetFilters(v []Filter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *ActionsInnerAlertsFilterQuery) HasFilters() bool` + +HasFilters returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/ActionsInnerAlertsFilterTimeframe.md b/generated/alerting/docs/ActionsInnerAlertsFilterTimeframe.md new file mode 100644 index 000000000..97b327bdb --- /dev/null +++ b/generated/alerting/docs/ActionsInnerAlertsFilterTimeframe.md @@ -0,0 +1,108 @@ +# ActionsInnerAlertsFilterTimeframe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Days** | Pointer to **[]int32** | | [optional] +**Hours** | Pointer to [**ActionsInnerAlertsFilterTimeframeHours**](ActionsInnerAlertsFilterTimeframeHours.md) | | [optional] +**Timezone** | Pointer to **string** | The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended. | [optional] + +## Methods + +### NewActionsInnerAlertsFilterTimeframe + +`func NewActionsInnerAlertsFilterTimeframe() *ActionsInnerAlertsFilterTimeframe` + +NewActionsInnerAlertsFilterTimeframe instantiates a new ActionsInnerAlertsFilterTimeframe object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionsInnerAlertsFilterTimeframeWithDefaults + +`func NewActionsInnerAlertsFilterTimeframeWithDefaults() *ActionsInnerAlertsFilterTimeframe` + +NewActionsInnerAlertsFilterTimeframeWithDefaults instantiates a new ActionsInnerAlertsFilterTimeframe object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDays + +`func (o *ActionsInnerAlertsFilterTimeframe) GetDays() []int32` + +GetDays returns the Days field if non-nil, zero value otherwise. + +### GetDaysOk + +`func (o *ActionsInnerAlertsFilterTimeframe) GetDaysOk() (*[]int32, bool)` + +GetDaysOk returns a tuple with the Days field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDays + +`func (o *ActionsInnerAlertsFilterTimeframe) SetDays(v []int32)` + +SetDays sets Days field to given value. + +### HasDays + +`func (o *ActionsInnerAlertsFilterTimeframe) HasDays() bool` + +HasDays returns a boolean if a field has been set. + +### GetHours + +`func (o *ActionsInnerAlertsFilterTimeframe) GetHours() ActionsInnerAlertsFilterTimeframeHours` + +GetHours returns the Hours field if non-nil, zero value otherwise. + +### GetHoursOk + +`func (o *ActionsInnerAlertsFilterTimeframe) GetHoursOk() (*ActionsInnerAlertsFilterTimeframeHours, bool)` + +GetHoursOk returns a tuple with the Hours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHours + +`func (o *ActionsInnerAlertsFilterTimeframe) SetHours(v ActionsInnerAlertsFilterTimeframeHours)` + +SetHours sets Hours field to given value. + +### HasHours + +`func (o *ActionsInnerAlertsFilterTimeframe) HasHours() bool` + +HasHours returns a boolean if a field has been set. + +### GetTimezone + +`func (o *ActionsInnerAlertsFilterTimeframe) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *ActionsInnerAlertsFilterTimeframe) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *ActionsInnerAlertsFilterTimeframe) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *ActionsInnerAlertsFilterTimeframe) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/ActionsInnerAlertsFilterTimeframeHours.md b/generated/alerting/docs/ActionsInnerAlertsFilterTimeframeHours.md new file mode 100644 index 000000000..f1a5ca305 --- /dev/null +++ b/generated/alerting/docs/ActionsInnerAlertsFilterTimeframeHours.md @@ -0,0 +1,82 @@ +# ActionsInnerAlertsFilterTimeframeHours + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**End** | Pointer to **string** | The end of the time frame in 24-hour notation (`hh:mm`). | [optional] +**Start** | Pointer to **string** | The start of the time frame in 24-hour notation (`hh:mm`). | [optional] + +## Methods + +### NewActionsInnerAlertsFilterTimeframeHours + +`func NewActionsInnerAlertsFilterTimeframeHours() *ActionsInnerAlertsFilterTimeframeHours` + +NewActionsInnerAlertsFilterTimeframeHours instantiates a new ActionsInnerAlertsFilterTimeframeHours object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionsInnerAlertsFilterTimeframeHoursWithDefaults + +`func NewActionsInnerAlertsFilterTimeframeHoursWithDefaults() *ActionsInnerAlertsFilterTimeframeHours` + +NewActionsInnerAlertsFilterTimeframeHoursWithDefaults instantiates a new ActionsInnerAlertsFilterTimeframeHours object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnd + +`func (o *ActionsInnerAlertsFilterTimeframeHours) GetEnd() string` + +GetEnd returns the End field if non-nil, zero value otherwise. + +### GetEndOk + +`func (o *ActionsInnerAlertsFilterTimeframeHours) GetEndOk() (*string, bool)` + +GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnd + +`func (o *ActionsInnerAlertsFilterTimeframeHours) SetEnd(v string)` + +SetEnd sets End field to given value. + +### HasEnd + +`func (o *ActionsInnerAlertsFilterTimeframeHours) HasEnd() bool` + +HasEnd returns a boolean if a field has been set. + +### GetStart + +`func (o *ActionsInnerAlertsFilterTimeframeHours) GetStart() string` + +GetStart returns the Start field if non-nil, zero value otherwise. + +### GetStartOk + +`func (o *ActionsInnerAlertsFilterTimeframeHours) GetStartOk() (*string, bool)` + +GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStart + +`func (o *ActionsInnerAlertsFilterTimeframeHours) SetStart(v string)` + +SetStart sets Start field to given value. + +### HasStart + +`func (o *ActionsInnerAlertsFilterTimeframeHours) HasStart() bool` + +HasStart returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/ActionsInnerFrequency.md b/generated/alerting/docs/ActionsInnerFrequency.md index cd9b8c805..18c23a725 100644 --- a/generated/alerting/docs/ActionsInnerFrequency.md +++ b/generated/alerting/docs/ActionsInnerFrequency.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NotifyWhen** | [**NotifyWhen**](NotifyWhen.md) | | +**NotifyWhen** | [**NotifyWhenAction**](NotifyWhenAction.md) | | **Summary** | **bool** | Indicates whether the action is a summary. | -**Throttle** | Pointer to **NullableString** | The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. | [optional] +**Throttle** | Pointer to **NullableString** | The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. | [optional] ## Methods ### NewActionsInnerFrequency -`func NewActionsInnerFrequency(notifyWhen NotifyWhen, summary bool, ) *ActionsInnerFrequency` +`func NewActionsInnerFrequency(notifyWhen NotifyWhenAction, summary bool, ) *ActionsInnerFrequency` NewActionsInnerFrequency instantiates a new ActionsInnerFrequency object This constructor will assign default values to properties that have it defined, @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetNotifyWhen -`func (o *ActionsInnerFrequency) GetNotifyWhen() NotifyWhen` +`func (o *ActionsInnerFrequency) GetNotifyWhen() NotifyWhenAction` GetNotifyWhen returns the NotifyWhen field if non-nil, zero value otherwise. ### GetNotifyWhenOk -`func (o *ActionsInnerFrequency) GetNotifyWhenOk() (*NotifyWhen, bool)` +`func (o *ActionsInnerFrequency) GetNotifyWhenOk() (*NotifyWhenAction, bool)` GetNotifyWhenOk returns a tuple with the NotifyWhen field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNotifyWhen -`func (o *ActionsInnerFrequency) SetNotifyWhen(v NotifyWhen)` +`func (o *ActionsInnerFrequency) SetNotifyWhen(v NotifyWhenAction)` SetNotifyWhen sets NotifyWhen field to given value. diff --git a/generated/alerting/docs/AlertDelay.md b/generated/alerting/docs/AlertDelay.md new file mode 100644 index 000000000..678108d7e --- /dev/null +++ b/generated/alerting/docs/AlertDelay.md @@ -0,0 +1,51 @@ +# AlertDelay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Active** | **float32** | The number of consecutive runs that must meet the rule conditions. | + +## Methods + +### NewAlertDelay + +`func NewAlertDelay(active float32, ) *AlertDelay` + +NewAlertDelay instantiates a new AlertDelay object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAlertDelayWithDefaults + +`func NewAlertDelayWithDefaults() *AlertDelay` + +NewAlertDelayWithDefaults instantiates a new AlertDelay object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActive + +`func (o *AlertDelay) GetActive() float32` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *AlertDelay) GetActiveOk() (*float32, bool)` + +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActive + +`func (o *AlertDelay) SetActive(v float32)` + +SetActive sets Active field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/AlertResponseProperties.md b/generated/alerting/docs/AlertResponseProperties.md index 38dc6c941..57d64d15e 100644 --- a/generated/alerting/docs/AlertResponseProperties.md +++ b/generated/alerting/docs/AlertResponseProperties.md @@ -303,16 +303,6 @@ SetMutedInstanceIds sets MutedInstanceIds field to given value. HasMutedInstanceIds returns a boolean if a field has been set. -### SetMutedInstanceIdsNil - -`func (o *AlertResponseProperties) SetMutedInstanceIdsNil(b bool)` - - SetMutedInstanceIdsNil sets the value for MutedInstanceIds to be an explicit nil - -### UnsetMutedInstanceIds -`func (o *AlertResponseProperties) UnsetMutedInstanceIds()` - -UnsetMutedInstanceIds ensures that no value is present for MutedInstanceIds, not even an explicit nil ### GetName `func (o *AlertResponseProperties) GetName() string` diff --git a/generated/alerting/docs/AlertingApi.md b/generated/alerting/docs/AlertingApi.md index 66196f2b9..a13039c35 100644 --- a/generated/alerting/docs/AlertingApi.md +++ b/generated/alerting/docs/AlertingApi.md @@ -1,10 +1,11 @@ # \AlertingAPI -All URIs are relative to *http://localhost:5601* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CreateRule**](AlertingAPI.md#CreateRule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId} | Creates a rule. +[**CreateRule**](AlertingAPI.md#CreateRule) | **Post** /s/{spaceId}/api/alerting/rule | Creates a rule with a randomly generated rule identifier. +[**CreateRuleId**](AlertingAPI.md#CreateRuleId) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId} | Creates a rule with a specific rule identifier. [**DeleteRule**](AlertingAPI.md#DeleteRule) | **Delete** /s/{spaceId}/api/alerting/rule/{ruleId} | Deletes a rule. [**DisableRule**](AlertingAPI.md#DisableRule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_disable | Disables a rule. [**EnableRule**](AlertingAPI.md#EnableRule) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_enable | Enables a rule. @@ -30,14 +31,15 @@ Method | HTTP request | Description [**UnmuteAlert**](AlertingAPI.md#UnmuteAlert) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute | Unmutes an alert. [**UnmuteAllAlerts**](AlertingAPI.md#UnmuteAllAlerts) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all | Unmutes all alerts. [**UpdateRule**](AlertingAPI.md#UpdateRule) | **Put** /s/{spaceId}/api/alerting/rule/{ruleId} | Updates the attributes for a rule. +[**UpdateRuleAPIKey**](AlertingAPI.md#UpdateRuleAPIKey) | **Post** /s/{spaceId}/api/alerting/rule/{ruleId}/_update_api_key | Updates the API key for a rule. ## CreateRule -> RuleResponseProperties CreateRule(ctx, spaceId, ruleId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() +> RuleResponseProperties CreateRule(ctx, spaceId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() -Creates a rule. +Creates a rule with a randomly generated rule identifier. @@ -54,14 +56,13 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. createRuleRequest := *openapiclient.NewCreateRuleRequest("Consumer_example", "cluster_health_rule", map[string]interface{}{"key": interface{}(123)}, "RuleTypeId_example", *openapiclient.NewSchedule()) // CreateRuleRequest | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AlertingAPI.CreateRule(context.Background(), spaceId, ruleId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() + resp, r, err := apiClient.AlertingAPI.CreateRule(context.Background(), spaceId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AlertingAPI.CreateRule``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -77,8 +78,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | -**ruleId** | **string** | An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -87,7 +87,83 @@ Other parameters are passed through a pointer to a apiCreateRuleRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | + + **createRuleRequest** | [**CreateRuleRequest**](CreateRuleRequest.md) | | + +### Return type + +[**RuleResponseProperties**](RuleResponseProperties.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateRuleId + +> RuleResponseProperties CreateRuleId(ctx, spaceId, ruleId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() + +Creates a rule with a specific rule identifier. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/elastic/terraform-provider-elasticstack/alerting" +) + +func main() { + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + ruleId := "ruleId_example" // string | An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. + createRuleRequest := *openapiclient.NewCreateRuleRequest("Consumer_example", "cluster_health_rule", map[string]interface{}{"key": interface{}(123)}, "RuleTypeId_example", *openapiclient.NewSchedule()) // CreateRuleRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AlertingAPI.CreateRuleId(context.Background(), spaceId, ruleId).KbnXsrf(kbnXsrf).CreateRuleRequest(createRuleRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AlertingAPI.CreateRuleId``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRuleId`: RuleResponseProperties + fmt.Fprintf(os.Stdout, "Response from `AlertingAPI.CreateRuleId`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | **string** | An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRuleIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | **createRuleRequest** | [**CreateRuleRequest**](CreateRuleRequest.md) | | @@ -131,9 +207,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -151,8 +227,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -161,7 +237,7 @@ Other parameters are passed through a pointer to a apiDeleteRuleRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -204,9 +280,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -224,8 +300,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -234,7 +310,7 @@ Other parameters are passed through a pointer to a apiDisableRuleRequest struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -277,9 +353,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -297,8 +373,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -307,7 +383,7 @@ Other parameters are passed through a pointer to a apiEnableRuleRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -350,17 +426,17 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - defaultSearchOperator := "OR" // string | The default operator to use for the simple_query_string. (optional) (default to "OR") - fields := []string{"Inner_example"} // []string | The fields to return in the `attributes` key of the response. (optional) + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + defaultSearchOperator := "defaultSearchOperator_example" // string | The default operator to use for the simple_query_string. (optional) (default to "OR") + fields := []*string{"Inner_example"} // []*string | The fields to return in the `attributes` key of the response. (optional) filter := "filter_example" // string | A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`. (optional) hasReference := *openapiclient.NewFindRulesHasReferenceParameter() // FindRulesHasReferenceParameter | Filters the rules that have a relation with the reference objects with a specific type and identifier. (optional) - page := int32(1) // int32 | The page number to return. (optional) (default to 1) - perPage := int32(20) // int32 | The number of rules to return per page. (optional) (default to 20) + page := int32(56) // int32 | The page number to return. (optional) (default to 1) + perPage := int32(56) // int32 | The number of rules to return per page. (optional) (default to 20) search := "search_example" // string | An Elasticsearch simple_query_string query that filters the objects in the response. (optional) - searchFields := openapiclient.findRules_search_fields_parameter{ArrayOfString: new([]string)} // FindRulesSearchFieldsParameter | The fields to perform the simple_query_string parsed query against. (optional) + searchFields := "searchFields_example" // string | The fields to perform the simple_query_string parsed query against. (optional) sortField := "sortField_example" // string | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. (optional) - sortOrder := "asc" // string | Determines the sort order. (optional) (default to "desc") + sortOrder := "sortOrder_example" // string | Determines the sort order. (optional) (default to "desc") configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -380,7 +456,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -397,7 +473,7 @@ Name | Type | Description | Notes **page** | **int32** | The page number to return. | [default to 1] **perPage** | **int32** | The number of rules to return per page. | [default to 20] **search** | **string** | An Elasticsearch simple_query_string query that filters the objects in the response. | - **searchFields** | [**FindRulesSearchFieldsParameter**](FindRulesSearchFieldsParameter.md) | The fields to perform the simple_query_string parsed query against. | + **searchFields** | **string** | The fields to perform the simple_query_string parsed query against. | **sortField** | **string** | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. | **sortOrder** | **string** | Determines the sort order. | [default to "desc"] @@ -440,7 +516,7 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -460,7 +536,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -510,8 +586,8 @@ import ( ) func main() { - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -531,8 +607,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -583,7 +659,7 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -603,7 +679,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -653,10 +729,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | An UUID v1 or v4 identifier for the alert. If this parameter is omitted, the identifier is randomly generated. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - legacyCreateAlertRequestProperties := *openapiclient.NewLegacyCreateAlertRequestProperties("AlertTypeId_example", "Consumer_example", "Name_example", "NotifyWhen_example", map[string]interface{}(123), *openapiclient.NewLegacyCreateAlertRequestPropertiesSchedule()) // LegacyCreateAlertRequestProperties | + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + alertId := "alertId_example" // string | An UUID v1 or v4 identifier for the alert. If this parameter is omitted, the identifier is randomly generated. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + legacyCreateAlertRequestProperties := *openapiclient.NewLegacyCreateAlertRequestProperties("AlertTypeId_example", "Consumer_example", "Name_example", "NotifyWhen_example", map[string]interface{}(123), *openapiclient.NewLegacyUpdateAlertRequestPropertiesSchedule()) // LegacyCreateAlertRequestProperties | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -677,7 +753,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **alertId** | **string** | An UUID v1 or v4 identifier for the alert. If this parameter is omitted, the identifier is randomly generated. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -686,7 +762,7 @@ Other parameters are passed through a pointer to a apiLegacyCreateAlertRequest s Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | **legacyCreateAlertRequestProperties** | [**LegacyCreateAlertRequestProperties**](LegacyCreateAlertRequestProperties.md) | | @@ -730,9 +806,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -750,7 +826,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -760,7 +836,7 @@ Other parameters are passed through a pointer to a apiLegacyDisableAlertRequest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -803,9 +879,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -823,7 +899,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -833,7 +909,7 @@ Other parameters are passed through a pointer to a apiLegacyEnableAlertRequest s Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -876,17 +952,17 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - defaultSearchOperator := "OR" // string | The default operator to use for the `simple_query_string`. (optional) (default to "OR") + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + defaultSearchOperator := "defaultSearchOperator_example" // string | The default operator to use for the `simple_query_string`. (optional) (default to "OR") fields := []string{"Inner_example"} // []string | The fields to return in the `attributes` key of the response. (optional) filter := "filter_example" // string | A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`. (optional) - hasReference := *openapiclient.NewFindRulesHasReferenceParameter() // FindRulesHasReferenceParameter | Filters the rules that have a relation with the reference objects with a specific type and identifier. (optional) - page := int32(1) // int32 | The page number to return. (optional) (default to 1) - perPage := int32(20) // int32 | The number of alerts to return per page. (optional) (default to 20) + hasReference := *openapiclient.NewLegacyFindAlertsHasReferenceParameter() // LegacyFindAlertsHasReferenceParameter | Filters the rules that have a relation with the reference objects with a specific type and identifier. (optional) + page := int32(56) // int32 | The page number to return. (optional) (default to 1) + perPage := int32(56) // int32 | The number of alerts to return per page. (optional) (default to 20) search := "search_example" // string | An Elasticsearch `simple_query_string` query that filters the alerts in the response. (optional) - searchFields := openapiclient.findRules_search_fields_parameter{ArrayOfString: new([]string)} // FindRulesSearchFieldsParameter | The fields to perform the `simple_query_string` parsed query against. (optional) + searchFields := "searchFields_example" // string | The fields to perform the `simple_query_string` parsed query against. (optional) sortField := "sortField_example" // string | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. (optional) - sortOrder := "asc" // string | Determines the sort order. (optional) (default to "desc") + sortOrder := "sortOrder_example" // string | Determines the sort order. (optional) (default to "desc") configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -906,7 +982,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -919,11 +995,11 @@ Name | Type | Description | Notes **defaultSearchOperator** | **string** | The default operator to use for the `simple_query_string`. | [default to "OR"] **fields** | **[]string** | The fields to return in the `attributes` key of the response. | **filter** | **string** | A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`. | - **hasReference** | [**FindRulesHasReferenceParameter**](FindRulesHasReferenceParameter.md) | Filters the rules that have a relation with the reference objects with a specific type and identifier. | + **hasReference** | [**LegacyFindAlertsHasReferenceParameter**](LegacyFindAlertsHasReferenceParameter.md) | Filters the rules that have a relation with the reference objects with a specific type and identifier. | **page** | **int32** | The page number to return. | [default to 1] **perPage** | **int32** | The number of alerts to return per page. | [default to 20] **search** | **string** | An Elasticsearch `simple_query_string` query that filters the alerts in the response. | - **searchFields** | [**FindRulesSearchFieldsParameter**](FindRulesSearchFieldsParameter.md) | The fields to perform the `simple_query_string` parsed query against. | + **searchFields** | **string** | The fields to perform the `simple_query_string` parsed query against. | **sortField** | **string** | Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. | **sortOrder** | **string** | Determines the sort order. | [default to "desc"] @@ -966,8 +1042,8 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -987,7 +1063,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -1039,7 +1115,7 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1059,7 +1135,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1109,7 +1185,7 @@ import ( ) func main() { - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1129,7 +1205,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1179,10 +1255,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | An identifier for the alert. - alertInstanceId := "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" // string | An identifier for the alert instance. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | An identifier for the alert. + alertInstanceId := "alertInstanceId_example" // string | An identifier for the alert instance. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1200,7 +1276,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | An identifier for the alert. | **alertInstanceId** | **string** | An identifier for the alert instance. | @@ -1211,7 +1287,7 @@ Other parameters are passed through a pointer to a apiLegacyMuteAlertInstanceReq Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1255,9 +1331,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1275,7 +1351,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -1285,7 +1361,7 @@ Other parameters are passed through a pointer to a apiLegacyMuteAllAlertInstance Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1328,10 +1404,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | An identifier for the alert. - alertInstanceId := "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" // string | An identifier for the alert instance. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | An identifier for the alert. + alertInstanceId := "alertInstanceId_example" // string | An identifier for the alert instance. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1349,7 +1425,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | An identifier for the alert. | **alertInstanceId** | **string** | An identifier for the alert instance. | @@ -1360,7 +1436,7 @@ Other parameters are passed through a pointer to a apiLegacyUnmuteAlertInstanceR Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1404,9 +1480,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1424,7 +1500,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -1434,7 +1510,7 @@ Other parameters are passed through a pointer to a apiLegacyUnmuteAllAlertInstan Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1477,9 +1553,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. legacyUpdateAlertRequestProperties := *openapiclient.NewLegacyUpdateAlertRequestProperties("Name_example", "NotifyWhen_example", map[string]interface{}(123), *openapiclient.NewLegacyUpdateAlertRequestPropertiesSchedule()) // LegacyUpdateAlertRequestProperties | configuration := openapiclient.NewConfiguration() @@ -1500,7 +1576,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -1510,7 +1586,7 @@ Other parameters are passed through a pointer to a apiLegacyUpdateAlertRequest s Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | **legacyUpdateAlertRequestProperties** | [**LegacyUpdateAlertRequestProperties**](LegacyUpdateAlertRequestProperties.md) | | @@ -1554,9 +1630,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - alertId := "41893910-6bca-11eb-9e0d-85d233e3ee35" // string | The identifier for the alert. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + alertId := "alertId_example" // string | The identifier for the alert. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1574,7 +1650,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | **alertId** | **string** | The identifier for the alert. | ### Other Parameters @@ -1584,7 +1660,7 @@ Other parameters are passed through a pointer to a apiLegaryDeleteAlertRequest s Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1627,10 +1703,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - alertId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + alertId := TODO // interface{} | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1648,9 +1724,9 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**alertId** | **string** | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. | -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**alertId** | [**interface{}**](.md) | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1659,7 +1735,7 @@ Other parameters are passed through a pointer to a apiMuteAlertRequest struct vi Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1703,9 +1779,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1723,8 +1799,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1733,7 +1809,7 @@ Other parameters are passed through a pointer to a apiMuteAllAlertsRequest struc Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1776,10 +1852,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - alertId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + alertId := TODO // interface{} | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1797,9 +1873,9 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**alertId** | **string** | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. | -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**alertId** | [**interface{}**](.md) | An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1808,7 +1884,7 @@ Other parameters are passed through a pointer to a apiUnmuteAlertRequest struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1852,9 +1928,9 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1872,8 +1948,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1882,7 +1958,7 @@ Other parameters are passed through a pointer to a apiUnmuteAllAlertsRequest str Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | @@ -1925,10 +2001,10 @@ import ( ) func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - ruleId := "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" // string | An identifier for the rule. - spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - updateRuleRequest := *openapiclient.NewUpdateRuleRequest("cluster_health_rule", map[string]interface{}{"key": interface{}(123)}, *openapiclient.NewSchedule()) // UpdateRuleRequest | + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + updateRuleRequest := *openapiclient.NewUpdateRuleRequest("Name_example", map[string]interface{}{"key": interface{}(123)}, *openapiclient.NewSchedule()) // UpdateRuleRequest | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1948,8 +2024,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**ruleId** | **string** | An identifier for the rule. | -**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | ### Other Parameters @@ -1958,7 +2034,7 @@ Other parameters are passed through a pointer to a apiUpdateRuleRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | **updateRuleRequest** | [**UpdateRuleRequest**](UpdateRuleRequest.md) | | @@ -1980,3 +2056,76 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## UpdateRuleAPIKey + +> UpdateRuleAPIKey(ctx, ruleId, spaceId).KbnXsrf(kbnXsrf).Execute() + +Updates the API key for a rule. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/elastic/terraform-provider-elasticstack/alerting" +) + +func main() { + kbnXsrf := TODO // interface{} | Cross-site request forgery protection + ruleId := TODO // interface{} | An identifier for the rule. + spaceId := TODO // interface{} | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AlertingAPI.UpdateRuleAPIKey(context.Background(), ruleId, spaceId).KbnXsrf(kbnXsrf).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AlertingAPI.UpdateRuleAPIKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ruleId** | [**interface{}**](.md) | An identifier for the rule. | +**spaceId** | [**interface{}**](.md) | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateRuleAPIKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kbnXsrf** | [**interface{}**](interface{}.md) | Cross-site request forgery protection | + + + +### Return type + + (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/generated/alerting/docs/CreateRuleRequest.md b/generated/alerting/docs/CreateRuleRequest.md index f08b6d98b..b2d11f093 100644 --- a/generated/alerting/docs/CreateRuleRequest.md +++ b/generated/alerting/docs/CreateRuleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Actions** | Pointer to [**[]ActionsInner**](ActionsInner.md) | | [optional] [default to []] +**Actions** | Pointer to [**[]ActionsInner**](ActionsInner.md) | | [optional] **Consumer** | **string** | The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. | **Enabled** | Pointer to **bool** | Indicates whether you want to run the rule on an interval basis after it is created. | [optional] **Name** | **string** | The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule. | @@ -12,8 +12,9 @@ Name | Type | Description | Notes **Params** | **map[string]interface{}** | The parameters for the rule. | **RuleTypeId** | **string** | The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. | **Schedule** | [**Schedule**](Schedule.md) | | -**Tags** | Pointer to **[]string** | The tags for the rule. | [optional] [default to []] -**Throttle** | Pointer to **NullableString** | The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Throttle** | Pointer to **NullableString** | Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. | [optional] +**AlertDelay** | Pointer to [**AlertDelay**](AlertDelay.md) | | [optional] ## Methods @@ -59,16 +60,6 @@ SetActions sets Actions field to given value. HasActions returns a boolean if a field has been set. -### SetActionsNil - -`func (o *CreateRuleRequest) SetActionsNil(b bool)` - - SetActionsNil sets the value for Actions to be an explicit nil - -### UnsetActions -`func (o *CreateRuleRequest) UnsetActions()` - -UnsetActions ensures that no value is present for Actions, not even an explicit nil ### GetConsumer `func (o *CreateRuleRequest) GetConsumer() string` @@ -279,6 +270,31 @@ HasThrottle returns a boolean if a field has been set. `func (o *CreateRuleRequest) UnsetThrottle()` UnsetThrottle ensures that no value is present for Throttle, not even an explicit nil +### GetAlertDelay + +`func (o *CreateRuleRequest) GetAlertDelay() AlertDelay` + +GetAlertDelay returns the AlertDelay field if non-nil, zero value otherwise. + +### GetAlertDelayOk + +`func (o *CreateRuleRequest) GetAlertDelayOk() (*AlertDelay, bool)` + +GetAlertDelayOk returns a tuple with the AlertDelay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlertDelay + +`func (o *CreateRuleRequest) SetAlertDelay(v AlertDelay)` + +SetAlertDelay sets AlertDelay field to given value. + +### HasAlertDelay + +`func (o *CreateRuleRequest) HasAlertDelay() bool` + +HasAlertDelay returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/FieldmapProperties.md b/generated/alerting/docs/FieldmapProperties.md new file mode 100644 index 000000000..32d32a814 --- /dev/null +++ b/generated/alerting/docs/FieldmapProperties.md @@ -0,0 +1,300 @@ +# FieldmapProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Array** | Pointer to **bool** | Indicates whether the field is an array. | [optional] +**Dynamic** | Pointer to **bool** | Indicates whether it is a dynamic field mapping. | [optional] +**Format** | Pointer to **string** | Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. | [optional] +**IgnoreAbove** | Pointer to **int32** | Specifies the maximum length of a string field. Longer strings are not indexed or stored. | [optional] +**Index** | Pointer to **bool** | Indicates whether field values are indexed. | [optional] +**Path** | Pointer to **string** | TBD | [optional] +**Properties** | Pointer to | Details about the object properties. This property is applicable when `type` is `object`. | [optional] +**Required** | Pointer to **bool** | Indicates whether the field is required. | [optional] +**ScalingFactor** | Pointer to **int32** | The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. | [optional] +**Type** | Pointer to **string** | Specifies the data type for the field. | [optional] + +## Methods + +### NewFieldmapProperties + +`func NewFieldmapProperties() *FieldmapProperties` + +NewFieldmapProperties instantiates a new FieldmapProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFieldmapPropertiesWithDefaults + +`func NewFieldmapPropertiesWithDefaults() *FieldmapProperties` + +NewFieldmapPropertiesWithDefaults instantiates a new FieldmapProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArray + +`func (o *FieldmapProperties) GetArray() bool` + +GetArray returns the Array field if non-nil, zero value otherwise. + +### GetArrayOk + +`func (o *FieldmapProperties) GetArrayOk() (*bool, bool)` + +GetArrayOk returns a tuple with the Array field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArray + +`func (o *FieldmapProperties) SetArray(v bool)` + +SetArray sets Array field to given value. + +### HasArray + +`func (o *FieldmapProperties) HasArray() bool` + +HasArray returns a boolean if a field has been set. + +### GetDynamic + +`func (o *FieldmapProperties) GetDynamic() bool` + +GetDynamic returns the Dynamic field if non-nil, zero value otherwise. + +### GetDynamicOk + +`func (o *FieldmapProperties) GetDynamicOk() (*bool, bool)` + +GetDynamicOk returns a tuple with the Dynamic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDynamic + +`func (o *FieldmapProperties) SetDynamic(v bool)` + +SetDynamic sets Dynamic field to given value. + +### HasDynamic + +`func (o *FieldmapProperties) HasDynamic() bool` + +HasDynamic returns a boolean if a field has been set. + +### GetFormat + +`func (o *FieldmapProperties) GetFormat() string` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *FieldmapProperties) GetFormatOk() (*string, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *FieldmapProperties) SetFormat(v string)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *FieldmapProperties) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetIgnoreAbove + +`func (o *FieldmapProperties) GetIgnoreAbove() int32` + +GetIgnoreAbove returns the IgnoreAbove field if non-nil, zero value otherwise. + +### GetIgnoreAboveOk + +`func (o *FieldmapProperties) GetIgnoreAboveOk() (*int32, bool)` + +GetIgnoreAboveOk returns a tuple with the IgnoreAbove field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreAbove + +`func (o *FieldmapProperties) SetIgnoreAbove(v int32)` + +SetIgnoreAbove sets IgnoreAbove field to given value. + +### HasIgnoreAbove + +`func (o *FieldmapProperties) HasIgnoreAbove() bool` + +HasIgnoreAbove returns a boolean if a field has been set. + +### GetIndex + +`func (o *FieldmapProperties) GetIndex() bool` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *FieldmapProperties) GetIndexOk() (*bool, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *FieldmapProperties) SetIndex(v bool)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *FieldmapProperties) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetPath + +`func (o *FieldmapProperties) GetPath() string` + +GetPath returns the Path field if non-nil, zero value otherwise. + +### GetPathOk + +`func (o *FieldmapProperties) GetPathOk() (*string, bool)` + +GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPath + +`func (o *FieldmapProperties) SetPath(v string)` + +SetPath sets Path field to given value. + +### HasPath + +`func (o *FieldmapProperties) HasPath() bool` + +HasPath returns a boolean if a field has been set. + +### GetProperties + +`func (o *FieldmapProperties) GetProperties() map[string]FieldmapPropertiesPropertiesValue` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *FieldmapProperties) GetPropertiesOk() (*map[string]FieldmapPropertiesPropertiesValue, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *FieldmapProperties) SetProperties(v map[string]FieldmapPropertiesPropertiesValue)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *FieldmapProperties) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + +### SetPropertiesNil + +`func (o *FieldmapProperties) SetPropertiesNil(b bool)` + + SetPropertiesNil sets the value for Properties to be an explicit nil + +### UnsetProperties +`func (o *FieldmapProperties) UnsetProperties()` + +UnsetProperties ensures that no value is present for Properties, not even an explicit nil +### GetRequired + +`func (o *FieldmapProperties) GetRequired() bool` + +GetRequired returns the Required field if non-nil, zero value otherwise. + +### GetRequiredOk + +`func (o *FieldmapProperties) GetRequiredOk() (*bool, bool)` + +GetRequiredOk returns a tuple with the Required field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequired + +`func (o *FieldmapProperties) SetRequired(v bool)` + +SetRequired sets Required field to given value. + +### HasRequired + +`func (o *FieldmapProperties) HasRequired() bool` + +HasRequired returns a boolean if a field has been set. + +### GetScalingFactor + +`func (o *FieldmapProperties) GetScalingFactor() int32` + +GetScalingFactor returns the ScalingFactor field if non-nil, zero value otherwise. + +### GetScalingFactorOk + +`func (o *FieldmapProperties) GetScalingFactorOk() (*int32, bool)` + +GetScalingFactorOk returns a tuple with the ScalingFactor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScalingFactor + +`func (o *FieldmapProperties) SetScalingFactor(v int32)` + +SetScalingFactor sets ScalingFactor field to given value. + +### HasScalingFactor + +`func (o *FieldmapProperties) HasScalingFactor() bool` + +HasScalingFactor returns a boolean if a field has been set. + +### GetType + +`func (o *FieldmapProperties) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FieldmapProperties) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *FieldmapProperties) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *FieldmapProperties) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/FieldmapPropertiesPropertiesValue.md b/generated/alerting/docs/FieldmapPropertiesPropertiesValue.md new file mode 100644 index 000000000..3c18fbb00 --- /dev/null +++ b/generated/alerting/docs/FieldmapPropertiesPropertiesValue.md @@ -0,0 +1,56 @@ +# FieldmapPropertiesPropertiesValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **string** | The data type for each object property. | [optional] + +## Methods + +### NewFieldmapPropertiesPropertiesValue + +`func NewFieldmapPropertiesPropertiesValue() *FieldmapPropertiesPropertiesValue` + +NewFieldmapPropertiesPropertiesValue instantiates a new FieldmapPropertiesPropertiesValue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFieldmapPropertiesPropertiesValueWithDefaults + +`func NewFieldmapPropertiesPropertiesValueWithDefaults() *FieldmapPropertiesPropertiesValue` + +NewFieldmapPropertiesPropertiesValueWithDefaults instantiates a new FieldmapPropertiesPropertiesValue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *FieldmapPropertiesPropertiesValue) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FieldmapPropertiesPropertiesValue) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *FieldmapPropertiesPropertiesValue) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *FieldmapPropertiesPropertiesValue) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/Filter.md b/generated/alerting/docs/Filter.md new file mode 100644 index 000000000..0d7f7c326 --- /dev/null +++ b/generated/alerting/docs/Filter.md @@ -0,0 +1,108 @@ +# Filter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Meta** | Pointer to [**FilterMeta**](FilterMeta.md) | | [optional] +**Query** | Pointer to **map[string]interface{}** | | [optional] +**State** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewFilter + +`func NewFilter() *Filter` + +NewFilter instantiates a new Filter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFilterWithDefaults + +`func NewFilterWithDefaults() *Filter` + +NewFilterWithDefaults instantiates a new Filter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMeta + +`func (o *Filter) GetMeta() FilterMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *Filter) GetMetaOk() (*FilterMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *Filter) SetMeta(v FilterMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *Filter) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetQuery + +`func (o *Filter) GetQuery() map[string]interface{}` + +GetQuery returns the Query field if non-nil, zero value otherwise. + +### GetQueryOk + +`func (o *Filter) GetQueryOk() (*map[string]interface{}, bool)` + +GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuery + +`func (o *Filter) SetQuery(v map[string]interface{})` + +SetQuery sets Query field to given value. + +### HasQuery + +`func (o *Filter) HasQuery() bool` + +HasQuery returns a boolean if a field has been set. + +### GetState + +`func (o *Filter) GetState() map[string]interface{}` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Filter) GetStateOk() (*map[string]interface{}, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Filter) SetState(v map[string]interface{})` + +SetState sets State field to given value. + +### HasState + +`func (o *Filter) HasState() bool` + +HasState returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/FilterMeta.md b/generated/alerting/docs/FilterMeta.md new file mode 100644 index 000000000..d6dc10a0b --- /dev/null +++ b/generated/alerting/docs/FilterMeta.md @@ -0,0 +1,352 @@ +# FilterMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Alias** | Pointer to **NullableString** | | [optional] +**ControlledBy** | Pointer to **string** | | [optional] +**Disabled** | Pointer to **bool** | | [optional] +**Field** | Pointer to **string** | | [optional] +**Group** | Pointer to **string** | | [optional] +**Index** | Pointer to **string** | | [optional] +**IsMultiIndex** | Pointer to **bool** | | [optional] +**Key** | Pointer to **string** | | [optional] +**Negate** | Pointer to **bool** | | [optional] +**Params** | Pointer to **map[string]interface{}** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Value** | Pointer to **string** | | [optional] + +## Methods + +### NewFilterMeta + +`func NewFilterMeta() *FilterMeta` + +NewFilterMeta instantiates a new FilterMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFilterMetaWithDefaults + +`func NewFilterMetaWithDefaults() *FilterMeta` + +NewFilterMetaWithDefaults instantiates a new FilterMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlias + +`func (o *FilterMeta) GetAlias() string` + +GetAlias returns the Alias field if non-nil, zero value otherwise. + +### GetAliasOk + +`func (o *FilterMeta) GetAliasOk() (*string, bool)` + +GetAliasOk returns a tuple with the Alias field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlias + +`func (o *FilterMeta) SetAlias(v string)` + +SetAlias sets Alias field to given value. + +### HasAlias + +`func (o *FilterMeta) HasAlias() bool` + +HasAlias returns a boolean if a field has been set. + +### SetAliasNil + +`func (o *FilterMeta) SetAliasNil(b bool)` + + SetAliasNil sets the value for Alias to be an explicit nil + +### UnsetAlias +`func (o *FilterMeta) UnsetAlias()` + +UnsetAlias ensures that no value is present for Alias, not even an explicit nil +### GetControlledBy + +`func (o *FilterMeta) GetControlledBy() string` + +GetControlledBy returns the ControlledBy field if non-nil, zero value otherwise. + +### GetControlledByOk + +`func (o *FilterMeta) GetControlledByOk() (*string, bool)` + +GetControlledByOk returns a tuple with the ControlledBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetControlledBy + +`func (o *FilterMeta) SetControlledBy(v string)` + +SetControlledBy sets ControlledBy field to given value. + +### HasControlledBy + +`func (o *FilterMeta) HasControlledBy() bool` + +HasControlledBy returns a boolean if a field has been set. + +### GetDisabled + +`func (o *FilterMeta) GetDisabled() bool` + +GetDisabled returns the Disabled field if non-nil, zero value otherwise. + +### GetDisabledOk + +`func (o *FilterMeta) GetDisabledOk() (*bool, bool)` + +GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisabled + +`func (o *FilterMeta) SetDisabled(v bool)` + +SetDisabled sets Disabled field to given value. + +### HasDisabled + +`func (o *FilterMeta) HasDisabled() bool` + +HasDisabled returns a boolean if a field has been set. + +### GetField + +`func (o *FilterMeta) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *FilterMeta) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *FilterMeta) SetField(v string)` + +SetField sets Field field to given value. + +### HasField + +`func (o *FilterMeta) HasField() bool` + +HasField returns a boolean if a field has been set. + +### GetGroup + +`func (o *FilterMeta) GetGroup() string` + +GetGroup returns the Group field if non-nil, zero value otherwise. + +### GetGroupOk + +`func (o *FilterMeta) GetGroupOk() (*string, bool)` + +GetGroupOk returns a tuple with the Group field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroup + +`func (o *FilterMeta) SetGroup(v string)` + +SetGroup sets Group field to given value. + +### HasGroup + +`func (o *FilterMeta) HasGroup() bool` + +HasGroup returns a boolean if a field has been set. + +### GetIndex + +`func (o *FilterMeta) GetIndex() string` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *FilterMeta) GetIndexOk() (*string, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *FilterMeta) SetIndex(v string)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *FilterMeta) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetIsMultiIndex + +`func (o *FilterMeta) GetIsMultiIndex() bool` + +GetIsMultiIndex returns the IsMultiIndex field if non-nil, zero value otherwise. + +### GetIsMultiIndexOk + +`func (o *FilterMeta) GetIsMultiIndexOk() (*bool, bool)` + +GetIsMultiIndexOk returns a tuple with the IsMultiIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsMultiIndex + +`func (o *FilterMeta) SetIsMultiIndex(v bool)` + +SetIsMultiIndex sets IsMultiIndex field to given value. + +### HasIsMultiIndex + +`func (o *FilterMeta) HasIsMultiIndex() bool` + +HasIsMultiIndex returns a boolean if a field has been set. + +### GetKey + +`func (o *FilterMeta) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *FilterMeta) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *FilterMeta) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *FilterMeta) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetNegate + +`func (o *FilterMeta) GetNegate() bool` + +GetNegate returns the Negate field if non-nil, zero value otherwise. + +### GetNegateOk + +`func (o *FilterMeta) GetNegateOk() (*bool, bool)` + +GetNegateOk returns a tuple with the Negate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNegate + +`func (o *FilterMeta) SetNegate(v bool)` + +SetNegate sets Negate field to given value. + +### HasNegate + +`func (o *FilterMeta) HasNegate() bool` + +HasNegate returns a boolean if a field has been set. + +### GetParams + +`func (o *FilterMeta) GetParams() map[string]interface{}` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *FilterMeta) GetParamsOk() (*map[string]interface{}, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *FilterMeta) SetParams(v map[string]interface{})` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *FilterMeta) HasParams() bool` + +HasParams returns a boolean if a field has been set. + +### GetType + +`func (o *FilterMeta) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FilterMeta) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *FilterMeta) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *FilterMeta) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetValue + +`func (o *FilterMeta) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *FilterMeta) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *FilterMeta) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *FilterMeta) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/FindRulesHasReferenceParameter.md b/generated/alerting/docs/FindRulesHasReferenceParameter.md index ab8543458..b16abea81 100644 --- a/generated/alerting/docs/FindRulesHasReferenceParameter.md +++ b/generated/alerting/docs/FindRulesHasReferenceParameter.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Type** | Pointer to **string** | | [optional] +**Id** | Pointer to **NullableString** | | [optional] +**Type** | Pointer to **NullableString** | | [optional] ## Methods @@ -51,6 +51,16 @@ SetId sets Id field to given value. HasId returns a boolean if a field has been set. +### SetIdNil + +`func (o *FindRulesHasReferenceParameter) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *FindRulesHasReferenceParameter) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetType `func (o *FindRulesHasReferenceParameter) GetType() string` @@ -76,6 +86,16 @@ SetType sets Type field to given value. HasType returns a boolean if a field has been set. +### SetTypeNil + +`func (o *FindRulesHasReferenceParameter) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *FindRulesHasReferenceParameter) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/GetAlertingHealth200Response.md b/generated/alerting/docs/GetAlertingHealth200Response.md index 8d00bc93e..fe959d1c0 100644 --- a/generated/alerting/docs/GetAlertingHealth200Response.md +++ b/generated/alerting/docs/GetAlertingHealth200Response.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AlertingFrameworkHeath** | Pointer to [**GetAlertingHealth200ResponseAlertingFrameworkHeath**](GetAlertingHealth200ResponseAlertingFrameworkHeath.md) | | [optional] **AlertingFrameworkHealth** | Pointer to [**GetAlertingHealth200ResponseAlertingFrameworkHealth**](GetAlertingHealth200ResponseAlertingFrameworkHealth.md) | | [optional] **HasPermanentEncryptionKey** | Pointer to **bool** | If `false`, the encrypted saved object plugin does not have a permanent encryption key. | [optional] **IsSufficientlySecure** | Pointer to **bool** | If `false`, security is enabled but TLS is not. | [optional] @@ -28,31 +27,6 @@ NewGetAlertingHealth200ResponseWithDefaults instantiates a new GetAlertingHealth This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetAlertingFrameworkHeath - -`func (o *GetAlertingHealth200Response) GetAlertingFrameworkHeath() GetAlertingHealth200ResponseAlertingFrameworkHeath` - -GetAlertingFrameworkHeath returns the AlertingFrameworkHeath field if non-nil, zero value otherwise. - -### GetAlertingFrameworkHeathOk - -`func (o *GetAlertingHealth200Response) GetAlertingFrameworkHeathOk() (*GetAlertingHealth200ResponseAlertingFrameworkHeath, bool)` - -GetAlertingFrameworkHeathOk returns a tuple with the AlertingFrameworkHeath field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAlertingFrameworkHeath - -`func (o *GetAlertingHealth200Response) SetAlertingFrameworkHeath(v GetAlertingHealth200ResponseAlertingFrameworkHeath)` - -SetAlertingFrameworkHeath sets AlertingFrameworkHeath field to given value. - -### HasAlertingFrameworkHeath - -`func (o *GetAlertingHealth200Response) HasAlertingFrameworkHeath() bool` - -HasAlertingFrameworkHeath returns a boolean if a field has been set. - ### GetAlertingFrameworkHealth `func (o *GetAlertingHealth200Response) GetAlertingFrameworkHealth() GetAlertingHealth200ResponseAlertingFrameworkHealth` diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInner.md b/generated/alerting/docs/GetRuleTypes200ResponseInner.md index 2c2eefdd6..9d5e42e0d 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInner.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInner.md @@ -4,12 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ActionGroups** | Pointer to [**[]GetRuleTypes200ResponseInnerActionGroupsInner**](GetRuleTypes200ResponseInnerActionGroupsInner.md) | An explicit list of groups for which the rule type can schedule actions, each with the action group's unique ID and human readable name. Rule actions validation uses this configuration to ensure that groups are valid. | [optional] +**ActionGroups** | Pointer to [**[]GetRuleTypes200ResponseInnerActionGroupsInner**](GetRuleTypes200ResponseInnerActionGroupsInner.md) | | [optional] **ActionVariables** | Pointer to [**GetRuleTypes200ResponseInnerActionVariables**](GetRuleTypes200ResponseInnerActionVariables.md) | | [optional] +**Alerts** | Pointer to [**GetRuleTypes200ResponseInnerAlerts**](GetRuleTypes200ResponseInnerAlerts.md) | | [optional] **AuthorizedConsumers** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumers**](GetRuleTypes200ResponseInnerAuthorizedConsumers.md) | | [optional] +**Category** | Pointer to **string** | The rule category, which is used by features such as category-specific maintenance windows. | [optional] **DefaultActionGroupId** | Pointer to **string** | The default identifier for the rule type group. | [optional] **DoesSetRecoveryContext** | Pointer to **bool** | Indicates whether the rule passes context variables to its recovery action. | [optional] **EnabledInLicense** | Pointer to **bool** | Indicates whether the rule type is enabled or disabled based on the subscription. | [optional] +**HasAlertsMappings** | Pointer to **bool** | Indicates whether the rule type has custom mappings for the alert data. | [optional] +**HasFieldsForAAD** | Pointer to **bool** | | [optional] **Id** | Pointer to **string** | The unique identifier for the rule type. | [optional] **IsExportable** | Pointer to **bool** | Indicates whether the rule type is exportable in **Stack Management > Saved Objects**. | [optional] **MinimumLicenseRequired** | Pointer to **string** | The subscriptions required to use the rule type. | [optional] @@ -87,6 +91,31 @@ SetActionVariables sets ActionVariables field to given value. HasActionVariables returns a boolean if a field has been set. +### GetAlerts + +`func (o *GetRuleTypes200ResponseInner) GetAlerts() GetRuleTypes200ResponseInnerAlerts` + +GetAlerts returns the Alerts field if non-nil, zero value otherwise. + +### GetAlertsOk + +`func (o *GetRuleTypes200ResponseInner) GetAlertsOk() (*GetRuleTypes200ResponseInnerAlerts, bool)` + +GetAlertsOk returns a tuple with the Alerts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlerts + +`func (o *GetRuleTypes200ResponseInner) SetAlerts(v GetRuleTypes200ResponseInnerAlerts)` + +SetAlerts sets Alerts field to given value. + +### HasAlerts + +`func (o *GetRuleTypes200ResponseInner) HasAlerts() bool` + +HasAlerts returns a boolean if a field has been set. + ### GetAuthorizedConsumers `func (o *GetRuleTypes200ResponseInner) GetAuthorizedConsumers() GetRuleTypes200ResponseInnerAuthorizedConsumers` @@ -112,6 +141,31 @@ SetAuthorizedConsumers sets AuthorizedConsumers field to given value. HasAuthorizedConsumers returns a boolean if a field has been set. +### GetCategory + +`func (o *GetRuleTypes200ResponseInner) GetCategory() string` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *GetRuleTypes200ResponseInner) GetCategoryOk() (*string, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *GetRuleTypes200ResponseInner) SetCategory(v string)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *GetRuleTypes200ResponseInner) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + ### GetDefaultActionGroupId `func (o *GetRuleTypes200ResponseInner) GetDefaultActionGroupId() string` @@ -187,6 +241,56 @@ SetEnabledInLicense sets EnabledInLicense field to given value. HasEnabledInLicense returns a boolean if a field has been set. +### GetHasAlertsMappings + +`func (o *GetRuleTypes200ResponseInner) GetHasAlertsMappings() bool` + +GetHasAlertsMappings returns the HasAlertsMappings field if non-nil, zero value otherwise. + +### GetHasAlertsMappingsOk + +`func (o *GetRuleTypes200ResponseInner) GetHasAlertsMappingsOk() (*bool, bool)` + +GetHasAlertsMappingsOk returns a tuple with the HasAlertsMappings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasAlertsMappings + +`func (o *GetRuleTypes200ResponseInner) SetHasAlertsMappings(v bool)` + +SetHasAlertsMappings sets HasAlertsMappings field to given value. + +### HasHasAlertsMappings + +`func (o *GetRuleTypes200ResponseInner) HasHasAlertsMappings() bool` + +HasHasAlertsMappings returns a boolean if a field has been set. + +### GetHasFieldsForAAD + +`func (o *GetRuleTypes200ResponseInner) GetHasFieldsForAAD() bool` + +GetHasFieldsForAAD returns the HasFieldsForAAD field if non-nil, zero value otherwise. + +### GetHasFieldsForAADOk + +`func (o *GetRuleTypes200ResponseInner) GetHasFieldsForAADOk() (*bool, bool)` + +GetHasFieldsForAADOk returns a tuple with the HasFieldsForAAD field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasFieldsForAAD + +`func (o *GetRuleTypes200ResponseInner) SetHasFieldsForAAD(v bool)` + +SetHasFieldsForAAD sets HasFieldsForAAD field to given value. + +### HasHasFieldsForAAD + +`func (o *GetRuleTypes200ResponseInner) HasHasFieldsForAAD() bool` + +HasHasFieldsForAAD returns a boolean if a field has been set. + ### GetId `func (o *GetRuleTypes200ResponseInner) GetId() string` diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionGroupsInner.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionGroupsInner.md index 124925b72..58e518e5c 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionGroupsInner.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionGroupsInner.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **NullableString** | | [optional] +**Name** | Pointer to **NullableString** | | [optional] ## Methods @@ -51,6 +51,16 @@ SetId sets Id field to given value. HasId returns a boolean if a field has been set. +### SetIdNil + +`func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *GetRuleTypes200ResponseInnerActionGroupsInner) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetName `func (o *GetRuleTypes200ResponseInnerActionGroupsInner) GetName() string` @@ -76,6 +86,16 @@ SetName sets Name field to given value. HasName returns a boolean if a field has been set. +### SetNameNil + +`func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *GetRuleTypes200ResponseInnerActionGroupsInner) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariables.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariables.md index 3e615305e..1313e8743 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariables.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariables.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Context** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesContextInner**](GetRuleTypes200ResponseInnerActionVariablesContextInner.md) | | [optional] **Params** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesParamsInner**](GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) | | [optional] -**State** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesParamsInner**](GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) | | [optional] +**State** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesStateInner**](GetRuleTypes200ResponseInnerActionVariablesStateInner.md) | | [optional] ## Methods @@ -79,20 +79,20 @@ HasParams returns a boolean if a field has been set. ### GetState -`func (o *GetRuleTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesParamsInner` +`func (o *GetRuleTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesStateInner` GetState returns the State field if non-nil, zero value otherwise. ### GetStateOk -`func (o *GetRuleTypes200ResponseInnerActionVariables) GetStateOk() (*[]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool)` +`func (o *GetRuleTypes200ResponseInnerActionVariables) GetStateOk() (*[]GetRuleTypes200ResponseInnerActionVariablesStateInner, bool)` GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetState -`func (o *GetRuleTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner)` +`func (o *GetRuleTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesStateInner)` SetState sets State field to given value. diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md index 077082ff4..78de23870 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesContextInner.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] -**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] **UseWithTripleBracesInTemplates** | Pointer to **bool** | | [optional] ## Methods @@ -52,6 +52,16 @@ SetName sets Name field to given value. HasName returns a boolean if a field has been set. +### SetNameNil + +`func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil ### GetDescription `func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetDescription() string` @@ -77,6 +87,16 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### SetDescriptionNil + +`func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetUseWithTripleBracesInTemplates `func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetUseWithTripleBracesInTemplates() bool` diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md index 0997fd56c..cedbaaa81 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesParamsInner.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Description** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**Name** | Pointer to **NullableString** | | [optional] ## Methods @@ -51,6 +51,16 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### SetDescriptionNil + +`func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetName `func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) GetName() string` @@ -76,6 +86,16 @@ SetName sets Name field to given value. HasName returns a boolean if a field has been set. +### SetNameNil + +`func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md new file mode 100644 index 000000000..063c10077 --- /dev/null +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerActionVariablesStateInner.md @@ -0,0 +1,82 @@ +# GetRuleTypes200ResponseInnerActionVariablesStateInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewGetRuleTypes200ResponseInnerActionVariablesStateInner + +`func NewGetRuleTypes200ResponseInnerActionVariablesStateInner() *GetRuleTypes200ResponseInnerActionVariablesStateInner` + +NewGetRuleTypes200ResponseInnerActionVariablesStateInner instantiates a new GetRuleTypes200ResponseInnerActionVariablesStateInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRuleTypes200ResponseInnerActionVariablesStateInnerWithDefaults + +`func NewGetRuleTypes200ResponseInnerActionVariablesStateInnerWithDefaults() *GetRuleTypes200ResponseInnerActionVariablesStateInner` + +NewGetRuleTypes200ResponseInnerActionVariablesStateInnerWithDefaults instantiates a new GetRuleTypes200ResponseInnerActionVariablesStateInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerAlerts.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerAlerts.md new file mode 100644 index 000000000..09848dfa3 --- /dev/null +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerAlerts.md @@ -0,0 +1,238 @@ +# GetRuleTypes200ResponseInnerAlerts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Context** | Pointer to **string** | The namespace for this rule type. | [optional] +**Dynamic** | Pointer to **string** | Indicates whether new fields are added dynamically. | [optional] +**IsSpaceAware** | Pointer to **bool** | Indicates whether the alerts are space-aware. If true, space-specific alert indices are used. | [optional] +**Mappings** | Pointer to [**GetRuleTypes200ResponseInnerAlertsMappings**](GetRuleTypes200ResponseInnerAlertsMappings.md) | | [optional] +**SecondaryAlias** | Pointer to **string** | A secondary alias. It is typically used to support the signals alias for detection rules. | [optional] +**ShouldWrite** | Pointer to **bool** | Indicates whether the rule should write out alerts as data. | [optional] +**UseEcs** | Pointer to **bool** | Indicates whether to include the ECS component template for the alerts. | [optional] +**UseLegacyAlerts** | Pointer to **bool** | Indicates whether to include the legacy component template for the alerts. | [optional] [default to false] + +## Methods + +### NewGetRuleTypes200ResponseInnerAlerts + +`func NewGetRuleTypes200ResponseInnerAlerts() *GetRuleTypes200ResponseInnerAlerts` + +NewGetRuleTypes200ResponseInnerAlerts instantiates a new GetRuleTypes200ResponseInnerAlerts object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRuleTypes200ResponseInnerAlertsWithDefaults + +`func NewGetRuleTypes200ResponseInnerAlertsWithDefaults() *GetRuleTypes200ResponseInnerAlerts` + +NewGetRuleTypes200ResponseInnerAlertsWithDefaults instantiates a new GetRuleTypes200ResponseInnerAlerts object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContext + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetContext() string` + +GetContext returns the Context field if non-nil, zero value otherwise. + +### GetContextOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetContextOk() (*string, bool)` + +GetContextOk returns a tuple with the Context field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContext + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetContext(v string)` + +SetContext sets Context field to given value. + +### HasContext + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasContext() bool` + +HasContext returns a boolean if a field has been set. + +### GetDynamic + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetDynamic() string` + +GetDynamic returns the Dynamic field if non-nil, zero value otherwise. + +### GetDynamicOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetDynamicOk() (*string, bool)` + +GetDynamicOk returns a tuple with the Dynamic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDynamic + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetDynamic(v string)` + +SetDynamic sets Dynamic field to given value. + +### HasDynamic + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasDynamic() bool` + +HasDynamic returns a boolean if a field has been set. + +### GetIsSpaceAware + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetIsSpaceAware() bool` + +GetIsSpaceAware returns the IsSpaceAware field if non-nil, zero value otherwise. + +### GetIsSpaceAwareOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetIsSpaceAwareOk() (*bool, bool)` + +GetIsSpaceAwareOk returns a tuple with the IsSpaceAware field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsSpaceAware + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetIsSpaceAware(v bool)` + +SetIsSpaceAware sets IsSpaceAware field to given value. + +### HasIsSpaceAware + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasIsSpaceAware() bool` + +HasIsSpaceAware returns a boolean if a field has been set. + +### GetMappings + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetMappings() GetRuleTypes200ResponseInnerAlertsMappings` + +GetMappings returns the Mappings field if non-nil, zero value otherwise. + +### GetMappingsOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetMappingsOk() (*GetRuleTypes200ResponseInnerAlertsMappings, bool)` + +GetMappingsOk returns a tuple with the Mappings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMappings + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetMappings(v GetRuleTypes200ResponseInnerAlertsMappings)` + +SetMappings sets Mappings field to given value. + +### HasMappings + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasMappings() bool` + +HasMappings returns a boolean if a field has been set. + +### GetSecondaryAlias + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetSecondaryAlias() string` + +GetSecondaryAlias returns the SecondaryAlias field if non-nil, zero value otherwise. + +### GetSecondaryAliasOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetSecondaryAliasOk() (*string, bool)` + +GetSecondaryAliasOk returns a tuple with the SecondaryAlias field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecondaryAlias + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetSecondaryAlias(v string)` + +SetSecondaryAlias sets SecondaryAlias field to given value. + +### HasSecondaryAlias + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasSecondaryAlias() bool` + +HasSecondaryAlias returns a boolean if a field has been set. + +### GetShouldWrite + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetShouldWrite() bool` + +GetShouldWrite returns the ShouldWrite field if non-nil, zero value otherwise. + +### GetShouldWriteOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetShouldWriteOk() (*bool, bool)` + +GetShouldWriteOk returns a tuple with the ShouldWrite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldWrite + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetShouldWrite(v bool)` + +SetShouldWrite sets ShouldWrite field to given value. + +### HasShouldWrite + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasShouldWrite() bool` + +HasShouldWrite returns a boolean if a field has been set. + +### GetUseEcs + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetUseEcs() bool` + +GetUseEcs returns the UseEcs field if non-nil, zero value otherwise. + +### GetUseEcsOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetUseEcsOk() (*bool, bool)` + +GetUseEcsOk returns a tuple with the UseEcs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseEcs + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetUseEcs(v bool)` + +SetUseEcs sets UseEcs field to given value. + +### HasUseEcs + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasUseEcs() bool` + +HasUseEcs returns a boolean if a field has been set. + +### GetUseLegacyAlerts + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetUseLegacyAlerts() bool` + +GetUseLegacyAlerts returns the UseLegacyAlerts field if non-nil, zero value otherwise. + +### GetUseLegacyAlertsOk + +`func (o *GetRuleTypes200ResponseInnerAlerts) GetUseLegacyAlertsOk() (*bool, bool)` + +GetUseLegacyAlertsOk returns a tuple with the UseLegacyAlerts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseLegacyAlerts + +`func (o *GetRuleTypes200ResponseInnerAlerts) SetUseLegacyAlerts(v bool)` + +SetUseLegacyAlerts sets UseLegacyAlerts field to given value. + +### HasUseLegacyAlerts + +`func (o *GetRuleTypes200ResponseInnerAlerts) HasUseLegacyAlerts() bool` + +HasUseLegacyAlerts returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerAlertsMappings.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerAlertsMappings.md new file mode 100644 index 000000000..57c147545 --- /dev/null +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerAlertsMappings.md @@ -0,0 +1,66 @@ +# GetRuleTypes200ResponseInnerAlertsMappings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FieldMap** | Pointer to | Mapping information for each field supported in alerts as data documents for this rule type. For more information about mapping parameters, refer to the Elasticsearch documentation. | [optional] + +## Methods + +### NewGetRuleTypes200ResponseInnerAlertsMappings + +`func NewGetRuleTypes200ResponseInnerAlertsMappings() *GetRuleTypes200ResponseInnerAlertsMappings` + +NewGetRuleTypes200ResponseInnerAlertsMappings instantiates a new GetRuleTypes200ResponseInnerAlertsMappings object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRuleTypes200ResponseInnerAlertsMappingsWithDefaults + +`func NewGetRuleTypes200ResponseInnerAlertsMappingsWithDefaults() *GetRuleTypes200ResponseInnerAlertsMappings` + +NewGetRuleTypes200ResponseInnerAlertsMappingsWithDefaults instantiates a new GetRuleTypes200ResponseInnerAlertsMappings object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFieldMap + +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) GetFieldMap() map[string]FieldmapProperties` + +GetFieldMap returns the FieldMap field if non-nil, zero value otherwise. + +### GetFieldMapOk + +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) GetFieldMapOk() (*map[string]FieldmapProperties, bool)` + +GetFieldMapOk returns a tuple with the FieldMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFieldMap + +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) SetFieldMap(v map[string]FieldmapProperties)` + +SetFieldMap sets FieldMap field to given value. + +### HasFieldMap + +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) HasFieldMap() bool` + +HasFieldMap returns a boolean if a field has been set. + +### SetFieldMapNil + +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) SetFieldMapNil(b bool)` + + SetFieldMapNil sets the value for FieldMap to be an explicit nil + +### UnsetFieldMap +`func (o *GetRuleTypes200ResponseInnerAlertsMappings) UnsetFieldMap()` + +UnsetFieldMap ensures that no value is present for FieldMap, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md index c50a2edab..fcacd3653 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerAuthorizedConsumers.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **Ml** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] **Monitoring** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] **Siem** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] +**Slo** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] **StackAlerts** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] **Uptime** | Pointer to [**GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts**](GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts.md) | | [optional] @@ -234,6 +235,31 @@ SetSiem sets Siem field to given value. HasSiem returns a boolean if a field has been set. +### GetSlo + +`func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetSlo() GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts` + +GetSlo returns the Slo field if non-nil, zero value otherwise. + +### GetSloOk + +`func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetSloOk() (*GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts, bool)` + +GetSloOk returns a tuple with the Slo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSlo + +`func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) SetSlo(v GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts)` + +SetSlo sets Slo field to given value. + +### HasSlo + +`func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) HasSlo() bool` + +HasSlo returns a boolean if a field has been set. + ### GetStackAlerts `func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetStackAlerts() GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts` diff --git a/generated/alerting/docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md b/generated/alerting/docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md index 25068aa0e..5ffe4fe59 100644 --- a/generated/alerting/docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md +++ b/generated/alerting/docs/GetRuleTypes200ResponseInnerRecoveryActionGroup.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **NullableString** | | [optional] +**Name** | Pointer to **NullableString** | | [optional] ## Methods @@ -51,6 +51,16 @@ SetId sets Id field to given value. HasId returns a boolean if a field has been set. +### SetIdNil + +`func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetName `func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) GetName() string` @@ -76,6 +86,16 @@ SetName sets Name field to given value. HasName returns a boolean if a field has been set. +### SetNameNil + +`func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/LegacyCreateAlertRequestProperties.md b/generated/alerting/docs/LegacyCreateAlertRequestProperties.md index 03759dad0..e4da33723 100644 --- a/generated/alerting/docs/LegacyCreateAlertRequestProperties.md +++ b/generated/alerting/docs/LegacyCreateAlertRequestProperties.md @@ -11,15 +11,15 @@ Name | Type | Description | Notes **Name** | **string** | A name to reference and search. | **NotifyWhen** | **string** | The condition for throttling the notification. | **Params** | **map[string]interface{}** | The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. | -**Schedule** | [**LegacyCreateAlertRequestPropertiesSchedule**](LegacyCreateAlertRequestPropertiesSchedule.md) | | -**Tags** | Pointer to **[]string** | A list of keywords to reference and search. | [optional] +**Schedule** | [**LegacyUpdateAlertRequestPropertiesSchedule**](LegacyUpdateAlertRequestPropertiesSchedule.md) | | +**Tags** | Pointer to **[]string** | | [optional] **Throttle** | Pointer to **string** | How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period. | [optional] ## Methods ### NewLegacyCreateAlertRequestProperties -`func NewLegacyCreateAlertRequestProperties(alertTypeId string, consumer string, name string, notifyWhen string, params map[string]interface{}, schedule LegacyCreateAlertRequestPropertiesSchedule, ) *LegacyCreateAlertRequestProperties` +`func NewLegacyCreateAlertRequestProperties(alertTypeId string, consumer string, name string, notifyWhen string, params map[string]interface{}, schedule LegacyUpdateAlertRequestPropertiesSchedule, ) *LegacyCreateAlertRequestProperties` NewLegacyCreateAlertRequestProperties instantiates a new LegacyCreateAlertRequestProperties object This constructor will assign default values to properties that have it defined, @@ -186,20 +186,20 @@ SetParams sets Params field to given value. ### GetSchedule -`func (o *LegacyCreateAlertRequestProperties) GetSchedule() LegacyCreateAlertRequestPropertiesSchedule` +`func (o *LegacyCreateAlertRequestProperties) GetSchedule() LegacyUpdateAlertRequestPropertiesSchedule` GetSchedule returns the Schedule field if non-nil, zero value otherwise. ### GetScheduleOk -`func (o *LegacyCreateAlertRequestProperties) GetScheduleOk() (*LegacyCreateAlertRequestPropertiesSchedule, bool)` +`func (o *LegacyCreateAlertRequestProperties) GetScheduleOk() (*LegacyUpdateAlertRequestPropertiesSchedule, bool)` GetScheduleOk returns a tuple with the Schedule field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSchedule -`func (o *LegacyCreateAlertRequestProperties) SetSchedule(v LegacyCreateAlertRequestPropertiesSchedule)` +`func (o *LegacyCreateAlertRequestProperties) SetSchedule(v LegacyUpdateAlertRequestPropertiesSchedule)` SetSchedule sets Schedule field to given value. diff --git a/generated/alerting/docs/LegacyFindAlertsHasReferenceParameter.md b/generated/alerting/docs/LegacyFindAlertsHasReferenceParameter.md new file mode 100644 index 000000000..8eca24399 --- /dev/null +++ b/generated/alerting/docs/LegacyFindAlertsHasReferenceParameter.md @@ -0,0 +1,82 @@ +# LegacyFindAlertsHasReferenceParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Type** | Pointer to **string** | | [optional] + +## Methods + +### NewLegacyFindAlertsHasReferenceParameter + +`func NewLegacyFindAlertsHasReferenceParameter() *LegacyFindAlertsHasReferenceParameter` + +NewLegacyFindAlertsHasReferenceParameter instantiates a new LegacyFindAlertsHasReferenceParameter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLegacyFindAlertsHasReferenceParameterWithDefaults + +`func NewLegacyFindAlertsHasReferenceParameterWithDefaults() *LegacyFindAlertsHasReferenceParameter` + +NewLegacyFindAlertsHasReferenceParameterWithDefaults instantiates a new LegacyFindAlertsHasReferenceParameter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *LegacyFindAlertsHasReferenceParameter) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *LegacyFindAlertsHasReferenceParameter) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *LegacyFindAlertsHasReferenceParameter) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *LegacyFindAlertsHasReferenceParameter) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetType + +`func (o *LegacyFindAlertsHasReferenceParameter) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *LegacyFindAlertsHasReferenceParameter) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *LegacyFindAlertsHasReferenceParameter) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *LegacyFindAlertsHasReferenceParameter) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInner.md b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInner.md index ca6616f35..1779036c6 100644 --- a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInner.md +++ b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInner.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ActionGroups** | Pointer to [**[]GetRuleTypes200ResponseInnerActionGroupsInner**](GetRuleTypes200ResponseInnerActionGroupsInner.md) | An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert actions validation uses this configuration to ensure that groups are valid. | [optional] +**ActionGroups** | Pointer to [**[]LegacyGetAlertTypes200ResponseInnerActionGroupsInner**](LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md) | | [optional] **ActionVariables** | Pointer to [**LegacyGetAlertTypes200ResponseInnerActionVariables**](LegacyGetAlertTypes200ResponseInnerActionVariables.md) | | [optional] **AuthorizedConsumers** | Pointer to **map[string]interface{}** | The list of the plugins IDs that have access to the alert type. | [optional] **DefaultActionGroupId** | Pointer to **string** | The default identifier for the alert type group. | [optional] @@ -37,20 +37,20 @@ but it doesn't guarantee that properties required by API are set ### GetActionGroups -`func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroups() []GetRuleTypes200ResponseInnerActionGroupsInner` +`func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroups() []LegacyGetAlertTypes200ResponseInnerActionGroupsInner` GetActionGroups returns the ActionGroups field if non-nil, zero value otherwise. ### GetActionGroupsOk -`func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroupsOk() (*[]GetRuleTypes200ResponseInnerActionGroupsInner, bool)` +`func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroupsOk() (*[]LegacyGetAlertTypes200ResponseInnerActionGroupsInner, bool)` GetActionGroupsOk returns a tuple with the ActionGroups field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetActionGroups -`func (o *LegacyGetAlertTypes200ResponseInner) SetActionGroups(v []GetRuleTypes200ResponseInnerActionGroupsInner)` +`func (o *LegacyGetAlertTypes200ResponseInner) SetActionGroups(v []LegacyGetAlertTypes200ResponseInnerActionGroupsInner)` SetActionGroups sets ActionGroups field to given value. diff --git a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md new file mode 100644 index 000000000..060a45798 --- /dev/null +++ b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionGroupsInner.md @@ -0,0 +1,82 @@ +# LegacyGetAlertTypes200ResponseInnerActionGroupsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewLegacyGetAlertTypes200ResponseInnerActionGroupsInner + +`func NewLegacyGetAlertTypes200ResponseInnerActionGroupsInner() *LegacyGetAlertTypes200ResponseInnerActionGroupsInner` + +NewLegacyGetAlertTypes200ResponseInnerActionGroupsInner instantiates a new LegacyGetAlertTypes200ResponseInnerActionGroupsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLegacyGetAlertTypes200ResponseInnerActionGroupsInnerWithDefaults + +`func NewLegacyGetAlertTypes200ResponseInnerActionGroupsInnerWithDefaults() *LegacyGetAlertTypes200ResponseInnerActionGroupsInner` + +NewLegacyGetAlertTypes200ResponseInnerActionGroupsInnerWithDefaults instantiates a new LegacyGetAlertTypes200ResponseInnerActionGroupsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md index 2d0cd2311..17fe9c091 100644 --- a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md +++ b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerActionVariables.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Context** | Pointer to [**[]LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner**](LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner.md) | | [optional] -**Params** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesParamsInner**](GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) | | [optional] -**State** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesParamsInner**](GetRuleTypes200ResponseInnerActionVariablesParamsInner.md) | | [optional] +**Context** | Pointer to [**[]GetRuleTypes200ResponseInnerActionVariablesStateInner**](GetRuleTypes200ResponseInnerActionVariablesStateInner.md) | | [optional] +**Params** | Pointer to **interface{}** | | [optional] +**State** | Pointer to **interface{}** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetContext -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContext() []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContext() []GetRuleTypes200ResponseInnerActionVariablesStateInner` GetContext returns the Context field if non-nil, zero value otherwise. ### GetContextOk -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContextOk() (*[]LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner, bool)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContextOk() (*[]GetRuleTypes200ResponseInnerActionVariablesStateInner, bool)` GetContextOk returns a tuple with the Context field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetContext -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetContext(v []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetContext(v []GetRuleTypes200ResponseInnerActionVariablesStateInner)` SetContext sets Context field to given value. @@ -54,20 +54,20 @@ HasContext returns a boolean if a field has been set. ### GetParams -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParams() []GetRuleTypes200ResponseInnerActionVariablesParamsInner` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParams() interface{}` GetParams returns the Params field if non-nil, zero value otherwise. ### GetParamsOk -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParamsOk() (*[]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParamsOk() (*interface{}, bool)` GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetParams -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetParams(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetParams(v interface{})` SetParams sets Params field to given value. @@ -77,22 +77,32 @@ SetParams sets Params field to given value. HasParams returns a boolean if a field has been set. +### SetParamsNil + +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetParamsNil(b bool)` + + SetParamsNil sets the value for Params to be an explicit nil + +### UnsetParams +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) UnsetParams()` + +UnsetParams ensures that no value is present for Params, not even an explicit nil ### GetState -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesParamsInner` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetState() interface{}` GetState returns the State field if non-nil, zero value otherwise. ### GetStateOk -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetStateOk() (*[]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetStateOk() (*interface{}, bool)` GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetState -`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner)` +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetState(v interface{})` SetState sets State field to given value. @@ -102,6 +112,16 @@ SetState sets State field to given value. HasState returns a boolean if a field has been set. +### SetStateNil + +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetStateNil(b bool)` + + SetStateNil sets the value for State to be an explicit nil + +### UnsetState +`func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) UnsetState()` + +UnsetState ensures that no value is present for State, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md index b7db23757..64c9a7b76 100644 --- a/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md +++ b/generated/alerting/docs/LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **NullableString** | | [optional] +**Name** | Pointer to **NullableString** | | [optional] ## Methods @@ -51,6 +51,16 @@ SetId sets Id field to given value. HasId returns a boolean if a field has been set. +### SetIdNil + +`func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetName `func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) GetName() string` @@ -76,6 +86,16 @@ SetName sets Name field to given value. HasName returns a boolean if a field has been set. +### SetNameNil + +`func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/alerting/docs/LegacyUpdateAlertRequestProperties.md b/generated/alerting/docs/LegacyUpdateAlertRequestProperties.md index bfbd6833e..75ada43f7 100644 --- a/generated/alerting/docs/LegacyUpdateAlertRequestProperties.md +++ b/generated/alerting/docs/LegacyUpdateAlertRequestProperties.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **NotifyWhen** | **string** | The condition for throttling the notification. | **Params** | **map[string]interface{}** | The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. | **Schedule** | [**LegacyUpdateAlertRequestPropertiesSchedule**](LegacyUpdateAlertRequestPropertiesSchedule.md) | | -**Tags** | Pointer to **[]string** | A list of keywords to reference and search. | [optional] +**Tags** | Pointer to **[]string** | | [optional] **Throttle** | Pointer to **string** | How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period. | [optional] ## Methods @@ -138,20 +138,20 @@ SetSchedule sets Schedule field to given value. ### GetTags -`func (o *LegacyUpdateAlertRequestProperties) GetTags() []string` +`func (o *LegacyUpdateAlertRequestProperties) GetTags() []*string` GetTags returns the Tags field if non-nil, zero value otherwise. ### GetTagsOk -`func (o *LegacyUpdateAlertRequestProperties) GetTagsOk() (*[]string, bool)` +`func (o *LegacyUpdateAlertRequestProperties) GetTagsOk() (*[]*string, bool)` GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTags -`func (o *LegacyUpdateAlertRequestProperties) SetTags(v []string)` +`func (o *LegacyUpdateAlertRequestProperties) SetTags(v []*string)` SetTags sets Tags field to given value. diff --git a/generated/alerting/docs/Model400Response.md b/generated/alerting/docs/Model400Response.md new file mode 100644 index 000000000..41202218a --- /dev/null +++ b/generated/alerting/docs/Model400Response.md @@ -0,0 +1,93 @@ +# Model400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | | +**Message** | **string** | | +**StatusCode** | **int32** | | + +## Methods + +### NewModel400Response + +`func NewModel400Response(error_ string, message string, statusCode int32, ) *Model400Response` + +NewModel400Response instantiates a new Model400Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewModel400ResponseWithDefaults + +`func NewModel400ResponseWithDefaults() *Model400Response` + +NewModel400ResponseWithDefaults instantiates a new Model400Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *Model400Response) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *Model400Response) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *Model400Response) SetError(v string)` + +SetError sets Error field to given value. + + +### GetMessage + +`func (o *Model400Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *Model400Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *Model400Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetStatusCode + +`func (o *Model400Response) GetStatusCode() int32` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *Model400Response) GetStatusCodeOk() (*int32, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *Model400Response) SetStatusCode(v int32)` + +SetStatusCode sets StatusCode field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/NotifyWhenAction.md b/generated/alerting/docs/NotifyWhenAction.md new file mode 100644 index 000000000..d141ce652 --- /dev/null +++ b/generated/alerting/docs/NotifyWhenAction.md @@ -0,0 +1,15 @@ +# NotifyWhenAction + +## Enum + + +* `ON_ACTION_GROUP_CHANGE` (value: `"onActionGroupChange"`) + +* `ON_ACTIVE_ALERT` (value: `"onActiveAlert"`) + +* `ON_THROTTLE_INTERVAL` (value: `"onThrottleInterval"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/alerting/docs/RuleResponseProperties.md b/generated/alerting/docs/RuleResponseProperties.md index 757234a31..70cd6af57 100644 --- a/generated/alerting/docs/RuleResponseProperties.md +++ b/generated/alerting/docs/RuleResponseProperties.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Actions** | [**[]ActionsInner**](ActionsInner.md) | | [default to []] -**ApiKeyOwner** | **NullableString** | | +**Actions** | [**[]ActionsInner**](ActionsInner.md) | | +**AlertDelay** | Pointer to [**AlertDelay**](AlertDelay.md) | | [optional] +**ApiKeyCreatedByUser** | Pointer to **bool** | Indicates whether the API key that is associated with the rule was created by the user. | [optional] +**ApiKeyOwner** | **NullableString** | The owner of the API key that is associated with the rule and used to run background tasks. | **Consumer** | **string** | The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. | **CreatedAt** | **time.Time** | The date and time that the rule was created. | **CreatedBy** | **NullableString** | The identifier for the user that created the rule. | @@ -17,14 +19,15 @@ Name | Type | Description | Notes **MuteAll** | **bool** | | **Name** | **string** | The name of the rule. | **NextRun** | Pointer to **NullableTime** | | [optional] -**NotifyWhen** | Pointer to [**NotifyWhen**](NotifyWhen.md) | | [optional] +**NotifyWhen** | Pointer to **NullableString** | Indicates how often alerts generate actions. | [optional] **Params** | **map[string]interface{}** | The parameters for the rule. | +**Revision** | Pointer to **int32** | The rule revision number. | [optional] **RuleTypeId** | **string** | The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. | **Running** | Pointer to **bool** | Indicates whether the rule is running. | [optional] **Schedule** | [**Schedule**](Schedule.md) | | **ScheduledTaskId** | Pointer to **string** | | [optional] -**Tags** | **[]string** | The tags for the rule. | [default to []] -**Throttle** | **NullableString** | The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. | +**Tags** | **[]string** | | +**Throttle** | **NullableString** | Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. | **UpdatedAt** | **string** | The date and time that the rule was updated most recently. | **UpdatedBy** | **NullableString** | The identifier for the user that updated this rule most recently. | @@ -67,16 +70,56 @@ and a boolean to check if the value has been set. SetActions sets Actions field to given value. -### SetActionsNil +### GetAlertDelay -`func (o *RuleResponseProperties) SetActionsNil(b bool)` +`func (o *RuleResponseProperties) GetAlertDelay() AlertDelay` - SetActionsNil sets the value for Actions to be an explicit nil +GetAlertDelay returns the AlertDelay field if non-nil, zero value otherwise. -### UnsetActions -`func (o *RuleResponseProperties) UnsetActions()` +### GetAlertDelayOk + +`func (o *RuleResponseProperties) GetAlertDelayOk() (*AlertDelay, bool)` + +GetAlertDelayOk returns a tuple with the AlertDelay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlertDelay + +`func (o *RuleResponseProperties) SetAlertDelay(v AlertDelay)` + +SetAlertDelay sets AlertDelay field to given value. + +### HasAlertDelay + +`func (o *RuleResponseProperties) HasAlertDelay() bool` + +HasAlertDelay returns a boolean if a field has been set. + +### GetApiKeyCreatedByUser + +`func (o *RuleResponseProperties) GetApiKeyCreatedByUser() bool` + +GetApiKeyCreatedByUser returns the ApiKeyCreatedByUser field if non-nil, zero value otherwise. + +### GetApiKeyCreatedByUserOk + +`func (o *RuleResponseProperties) GetApiKeyCreatedByUserOk() (*bool, bool)` + +GetApiKeyCreatedByUserOk returns a tuple with the ApiKeyCreatedByUser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApiKeyCreatedByUser + +`func (o *RuleResponseProperties) SetApiKeyCreatedByUser(v bool)` + +SetApiKeyCreatedByUser sets ApiKeyCreatedByUser field to given value. + +### HasApiKeyCreatedByUser + +`func (o *RuleResponseProperties) HasApiKeyCreatedByUser() bool` + +HasApiKeyCreatedByUser returns a boolean if a field has been set. -UnsetActions ensures that no value is present for Actions, not even an explicit nil ### GetApiKeyOwner `func (o *RuleResponseProperties) GetApiKeyOwner() string` @@ -282,16 +325,6 @@ and a boolean to check if the value has been set. SetMutedAlertIds sets MutedAlertIds field to given value. -### SetMutedAlertIdsNil - -`func (o *RuleResponseProperties) SetMutedAlertIdsNil(b bool)` - - SetMutedAlertIdsNil sets the value for MutedAlertIds to be an explicit nil - -### UnsetMutedAlertIds -`func (o *RuleResponseProperties) UnsetMutedAlertIds()` - -UnsetMutedAlertIds ensures that no value is present for MutedAlertIds, not even an explicit nil ### GetMuteAll `func (o *RuleResponseProperties) GetMuteAll() bool` @@ -369,20 +402,20 @@ HasNextRun returns a boolean if a field has been set. UnsetNextRun ensures that no value is present for NextRun, not even an explicit nil ### GetNotifyWhen -`func (o *RuleResponseProperties) GetNotifyWhen() NotifyWhen` +`func (o *RuleResponseProperties) GetNotifyWhen() string` GetNotifyWhen returns the NotifyWhen field if non-nil, zero value otherwise. ### GetNotifyWhenOk -`func (o *RuleResponseProperties) GetNotifyWhenOk() (*NotifyWhen, bool)` +`func (o *RuleResponseProperties) GetNotifyWhenOk() (*string, bool)` GetNotifyWhenOk returns a tuple with the NotifyWhen field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNotifyWhen -`func (o *RuleResponseProperties) SetNotifyWhen(v NotifyWhen)` +`func (o *RuleResponseProperties) SetNotifyWhen(v string)` SetNotifyWhen sets NotifyWhen field to given value. @@ -392,6 +425,16 @@ SetNotifyWhen sets NotifyWhen field to given value. HasNotifyWhen returns a boolean if a field has been set. +### SetNotifyWhenNil + +`func (o *RuleResponseProperties) SetNotifyWhenNil(b bool)` + + SetNotifyWhenNil sets the value for NotifyWhen to be an explicit nil + +### UnsetNotifyWhen +`func (o *RuleResponseProperties) UnsetNotifyWhen()` + +UnsetNotifyWhen ensures that no value is present for NotifyWhen, not even an explicit nil ### GetParams `func (o *RuleResponseProperties) GetParams() map[string]interface{}` @@ -412,6 +455,31 @@ and a boolean to check if the value has been set. SetParams sets Params field to given value. +### GetRevision + +`func (o *RuleResponseProperties) GetRevision() int32` + +GetRevision returns the Revision field if non-nil, zero value otherwise. + +### GetRevisionOk + +`func (o *RuleResponseProperties) GetRevisionOk() (*int32, bool)` + +GetRevisionOk returns a tuple with the Revision field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRevision + +`func (o *RuleResponseProperties) SetRevision(v int32)` + +SetRevision sets Revision field to given value. + +### HasRevision + +`func (o *RuleResponseProperties) HasRevision() bool` + +HasRevision returns a boolean if a field has been set. + ### GetRuleTypeId `func (o *RuleResponseProperties) GetRuleTypeId() string` diff --git a/generated/alerting/docs/RuleResponsePropertiesLastRun.md b/generated/alerting/docs/RuleResponsePropertiesLastRun.md index 029c4cce7..4f0f637da 100644 --- a/generated/alerting/docs/RuleResponsePropertiesLastRun.md +++ b/generated/alerting/docs/RuleResponsePropertiesLastRun.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AlertsCount** | Pointer to [**RuleResponsePropertiesLastRunAlertsCount**](RuleResponsePropertiesLastRunAlertsCount.md) | | [optional] **Outcome** | Pointer to **string** | | [optional] -**OutcomeMsg** | Pointer to **NullableString** | | [optional] +**OutcomeMsg** | Pointer to **[]string** | | [optional] +**OutcomeOrder** | Pointer to **int32** | | [optional] **Warning** | Pointer to **NullableString** | | [optional] ## Methods @@ -80,20 +81,20 @@ HasOutcome returns a boolean if a field has been set. ### GetOutcomeMsg -`func (o *RuleResponsePropertiesLastRun) GetOutcomeMsg() string` +`func (o *RuleResponsePropertiesLastRun) GetOutcomeMsg() []string` GetOutcomeMsg returns the OutcomeMsg field if non-nil, zero value otherwise. ### GetOutcomeMsgOk -`func (o *RuleResponsePropertiesLastRun) GetOutcomeMsgOk() (*string, bool)` +`func (o *RuleResponsePropertiesLastRun) GetOutcomeMsgOk() (*[]string, bool)` GetOutcomeMsgOk returns a tuple with the OutcomeMsg field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetOutcomeMsg -`func (o *RuleResponsePropertiesLastRun) SetOutcomeMsg(v string)` +`func (o *RuleResponsePropertiesLastRun) SetOutcomeMsg(v []string)` SetOutcomeMsg sets OutcomeMsg field to given value. @@ -103,16 +104,31 @@ SetOutcomeMsg sets OutcomeMsg field to given value. HasOutcomeMsg returns a boolean if a field has been set. -### SetOutcomeMsgNil +### GetOutcomeOrder -`func (o *RuleResponsePropertiesLastRun) SetOutcomeMsgNil(b bool)` +`func (o *RuleResponsePropertiesLastRun) GetOutcomeOrder() int32` - SetOutcomeMsgNil sets the value for OutcomeMsg to be an explicit nil +GetOutcomeOrder returns the OutcomeOrder field if non-nil, zero value otherwise. -### UnsetOutcomeMsg -`func (o *RuleResponsePropertiesLastRun) UnsetOutcomeMsg()` +### GetOutcomeOrderOk + +`func (o *RuleResponsePropertiesLastRun) GetOutcomeOrderOk() (*int32, bool)` + +GetOutcomeOrderOk returns a tuple with the OutcomeOrder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutcomeOrder + +`func (o *RuleResponsePropertiesLastRun) SetOutcomeOrder(v int32)` + +SetOutcomeOrder sets OutcomeOrder field to given value. + +### HasOutcomeOrder + +`func (o *RuleResponsePropertiesLastRun) HasOutcomeOrder() bool` + +HasOutcomeOrder returns a boolean if a field has been set. -UnsetOutcomeMsg ensures that no value is present for OutcomeMsg, not even an explicit nil ### GetWarning `func (o *RuleResponsePropertiesLastRun) GetWarning() string` diff --git a/generated/alerting/docs/UpdateRuleRequest.md b/generated/alerting/docs/UpdateRuleRequest.md index ce0f42682..ccf40b3f3 100644 --- a/generated/alerting/docs/UpdateRuleRequest.md +++ b/generated/alerting/docs/UpdateRuleRequest.md @@ -4,13 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Actions** | Pointer to [**[]ActionsInner**](ActionsInner.md) | | [optional] [default to []] +**Actions** | Pointer to [**[]ActionsInner**](ActionsInner.md) | | [optional] +**AlertDelay** | Pointer to [**AlertDelay**](AlertDelay.md) | | [optional] **Name** | **string** | The name of the rule. | **NotifyWhen** | Pointer to [**NotifyWhen**](NotifyWhen.md) | | [optional] **Params** | **map[string]interface{}** | The parameters for the rule. | **Schedule** | [**Schedule**](Schedule.md) | | -**Tags** | Pointer to **[]string** | The tags for the rule. | [optional] [default to []] -**Throttle** | Pointer to **NullableString** | The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Throttle** | Pointer to **NullableString** | Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. | [optional] ## Methods @@ -56,16 +57,31 @@ SetActions sets Actions field to given value. HasActions returns a boolean if a field has been set. -### SetActionsNil +### GetAlertDelay -`func (o *UpdateRuleRequest) SetActionsNil(b bool)` +`func (o *UpdateRuleRequest) GetAlertDelay() AlertDelay` - SetActionsNil sets the value for Actions to be an explicit nil +GetAlertDelay returns the AlertDelay field if non-nil, zero value otherwise. -### UnsetActions -`func (o *UpdateRuleRequest) UnsetActions()` +### GetAlertDelayOk + +`func (o *UpdateRuleRequest) GetAlertDelayOk() (*AlertDelay, bool)` + +GetAlertDelayOk returns a tuple with the AlertDelay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlertDelay + +`func (o *UpdateRuleRequest) SetAlertDelay(v AlertDelay)` + +SetAlertDelay sets AlertDelay field to given value. + +### HasAlertDelay + +`func (o *UpdateRuleRequest) HasAlertDelay() bool` + +HasAlertDelay returns a boolean if a field has been set. -UnsetActions ensures that no value is present for Actions, not even an explicit nil ### GetName `func (o *UpdateRuleRequest) GetName() string` diff --git a/generated/alerting/model_400_response.go b/generated/alerting/model_400_response.go new file mode 100644 index 000000000..b7050c1f8 --- /dev/null +++ b/generated/alerting/model_400_response.go @@ -0,0 +1,169 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the Model400Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Model400Response{} + +// Model400Response struct for Model400Response +type Model400Response struct { + Error string `json:"error"` + Message string `json:"message"` + StatusCode int32 `json:"statusCode"` +} + +// NewModel400Response instantiates a new Model400Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModel400Response(error_ string, message string, statusCode int32) *Model400Response { + this := Model400Response{} + this.Error = error_ + this.Message = message + this.StatusCode = statusCode + return &this +} + +// NewModel400ResponseWithDefaults instantiates a new Model400Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModel400ResponseWithDefaults() *Model400Response { + this := Model400Response{} + return &this +} + +// GetError returns the Error field value +func (o *Model400Response) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Model400Response) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Model400Response) SetError(v string) { + o.Error = v +} + +// GetMessage returns the Message field value +func (o *Model400Response) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *Model400Response) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *Model400Response) SetMessage(v string) { + o.Message = v +} + +// GetStatusCode returns the StatusCode field value +func (o *Model400Response) GetStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *Model400Response) GetStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *Model400Response) SetStatusCode(v int32) { + o.StatusCode = v +} + +func (o Model400Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Model400Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + toSerialize["message"] = o.Message + toSerialize["statusCode"] = o.StatusCode + return toSerialize, nil +} + +type NullableModel400Response struct { + value *Model400Response + isSet bool +} + +func (v NullableModel400Response) Get() *Model400Response { + return v.value +} + +func (v *NullableModel400Response) Set(val *Model400Response) { + v.value = val + v.isSet = true +} + +func (v NullableModel400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableModel400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModel400Response(val *Model400Response) *NullableModel400Response { + return &NullableModel400Response{value: val, isSet: true} +} + +func (v NullableModel400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModel400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_401_response.go b/generated/alerting/model_401_response.go index 333e0bf27..c5c156507 100644 --- a/generated/alerting/model_401_response.go +++ b/generated/alerting/model_401_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_404_response.go b/generated/alerting/model_404_response.go index 17116ccf3..d7f845db5 100644 --- a/generated/alerting/model_404_response.go +++ b/generated/alerting/model_404_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_actions_inner.go b/generated/alerting/model_actions_inner.go index 38fdb9aef..abb7f93e9 100644 --- a/generated/alerting/model_actions_inner.go +++ b/generated/alerting/model_actions_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,25 +17,31 @@ import ( // checks if the ActionsInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ActionsInner{} -// ActionsInner struct for ActionsInner +// ActionsInner An action that runs under defined conditions. type ActionsInner struct { + AlertsFilter *ActionsInnerAlertsFilter `json:"alerts_filter,omitempty"` // The type of connector. This property appears in responses but cannot be set in requests. ConnectorTypeId *string `json:"connector_type_id,omitempty"` Frequency *ActionsInnerFrequency `json:"frequency,omitempty"` - // The group name for the actions. If you don't need to group actions, set to `default`. - Group *string `json:"group,omitempty"` + // The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`. + Group string `json:"group"` // The identifier for the connector saved object. - Id *string `json:"id,omitempty"` + Id string `json:"id"` // The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context. - Params map[string]interface{} `json:"params,omitempty"` + Params map[string]interface{} `json:"params"` + // A universally unique identifier (UUID) for the action. + Uuid *string `json:"uuid,omitempty"` } // NewActionsInner instantiates a new ActionsInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewActionsInner() *ActionsInner { +func NewActionsInner(group string, id string, params map[string]interface{}) *ActionsInner { this := ActionsInner{} + this.Group = group + this.Id = id + this.Params = params return &this } @@ -47,6 +53,38 @@ func NewActionsInnerWithDefaults() *ActionsInner { return &this } +// GetAlertsFilter returns the AlertsFilter field value if set, zero value otherwise. +func (o *ActionsInner) GetAlertsFilter() ActionsInnerAlertsFilter { + if o == nil || IsNil(o.AlertsFilter) { + var ret ActionsInnerAlertsFilter + return ret + } + return *o.AlertsFilter +} + +// GetAlertsFilterOk returns a tuple with the AlertsFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInner) GetAlertsFilterOk() (*ActionsInnerAlertsFilter, bool) { + if o == nil || IsNil(o.AlertsFilter) { + return nil, false + } + return o.AlertsFilter, true +} + +// HasAlertsFilter returns a boolean if a field has been set. +func (o *ActionsInner) HasAlertsFilter() bool { + if o != nil && !IsNil(o.AlertsFilter) { + return true + } + + return false +} + +// SetAlertsFilter gets a reference to the given ActionsInnerAlertsFilter and assigns it to the AlertsFilter field. +func (o *ActionsInner) SetAlertsFilter(v ActionsInnerAlertsFilter) { + o.AlertsFilter = &v +} + // GetConnectorTypeId returns the ConnectorTypeId field value if set, zero value otherwise. func (o *ActionsInner) GetConnectorTypeId() string { if o == nil || IsNil(o.ConnectorTypeId) { @@ -111,100 +149,108 @@ func (o *ActionsInner) SetFrequency(v ActionsInnerFrequency) { o.Frequency = &v } -// GetGroup returns the Group field value if set, zero value otherwise. +// GetGroup returns the Group field value func (o *ActionsInner) GetGroup() string { - if o == nil || IsNil(o.Group) { + if o == nil { var ret string return ret } - return *o.Group + + return o.Group } -// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// GetGroupOk returns a tuple with the Group field value // and a boolean to check if the value has been set. func (o *ActionsInner) GetGroupOk() (*string, bool) { - if o == nil || IsNil(o.Group) { + if o == nil { return nil, false } - return o.Group, true + return &o.Group, true } -// HasGroup returns a boolean if a field has been set. -func (o *ActionsInner) HasGroup() bool { - if o != nil && !IsNil(o.Group) { - return true - } - - return false -} - -// SetGroup gets a reference to the given string and assigns it to the Group field. +// SetGroup sets field value func (o *ActionsInner) SetGroup(v string) { - o.Group = &v + o.Group = v } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *ActionsInner) GetId() string { - if o == nil || IsNil(o.Id) { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ActionsInner) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true + return &o.Id, true } -// HasId returns a boolean if a field has been set. -func (o *ActionsInner) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *ActionsInner) SetId(v string) { - o.Id = &v + o.Id = v } -// GetParams returns the Params field value if set, zero value otherwise. +// GetParams returns the Params field value func (o *ActionsInner) GetParams() map[string]interface{} { - if o == nil || IsNil(o.Params) { + if o == nil { var ret map[string]interface{} return ret } + return o.Params } -// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// GetParamsOk returns a tuple with the Params field value // and a boolean to check if the value has been set. func (o *ActionsInner) GetParamsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Params) { + if o == nil { return map[string]interface{}{}, false } return o.Params, true } -// HasParams returns a boolean if a field has been set. -func (o *ActionsInner) HasParams() bool { - if o != nil && !IsNil(o.Params) { +// SetParams sets field value +func (o *ActionsInner) SetParams(v map[string]interface{}) { + o.Params = v +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *ActionsInner) GetUuid() string { + if o == nil || IsNil(o.Uuid) { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInner) GetUuidOk() (*string, bool) { + if o == nil || IsNil(o.Uuid) { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *ActionsInner) HasUuid() bool { + if o != nil && !IsNil(o.Uuid) { return true } return false } -// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. -func (o *ActionsInner) SetParams(v map[string]interface{}) { - o.Params = v +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *ActionsInner) SetUuid(v string) { + o.Uuid = &v } func (o ActionsInner) MarshalJSON() ([]byte, error) { @@ -217,20 +263,20 @@ func (o ActionsInner) MarshalJSON() ([]byte, error) { func (o ActionsInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.AlertsFilter) { + toSerialize["alerts_filter"] = o.AlertsFilter + } if !IsNil(o.ConnectorTypeId) { toSerialize["connector_type_id"] = o.ConnectorTypeId } if !IsNil(o.Frequency) { toSerialize["frequency"] = o.Frequency } - if !IsNil(o.Group) { - toSerialize["group"] = o.Group - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Params) { - toSerialize["params"] = o.Params + toSerialize["group"] = o.Group + toSerialize["id"] = o.Id + toSerialize["params"] = o.Params + if !IsNil(o.Uuid) { + toSerialize["uuid"] = o.Uuid } return toSerialize, nil } diff --git a/generated/alerting/model_actions_inner_alerts_filter.go b/generated/alerting/model_actions_inner_alerts_filter.go new file mode 100644 index 000000000..b53edaafb --- /dev/null +++ b/generated/alerting/model_actions_inner_alerts_filter.go @@ -0,0 +1,160 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the ActionsInnerAlertsFilter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionsInnerAlertsFilter{} + +// ActionsInnerAlertsFilter Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs. +type ActionsInnerAlertsFilter struct { + Query *ActionsInnerAlertsFilterQuery `json:"query,omitempty"` + Timeframe *ActionsInnerAlertsFilterTimeframe `json:"timeframe,omitempty"` +} + +// NewActionsInnerAlertsFilter instantiates a new ActionsInnerAlertsFilter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionsInnerAlertsFilter() *ActionsInnerAlertsFilter { + this := ActionsInnerAlertsFilter{} + return &this +} + +// NewActionsInnerAlertsFilterWithDefaults instantiates a new ActionsInnerAlertsFilter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionsInnerAlertsFilterWithDefaults() *ActionsInnerAlertsFilter { + this := ActionsInnerAlertsFilter{} + return &this +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilter) GetQuery() ActionsInnerAlertsFilterQuery { + if o == nil || IsNil(o.Query) { + var ret ActionsInnerAlertsFilterQuery + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilter) GetQueryOk() (*ActionsInnerAlertsFilterQuery, bool) { + if o == nil || IsNil(o.Query) { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilter) HasQuery() bool { + if o != nil && !IsNil(o.Query) { + return true + } + + return false +} + +// SetQuery gets a reference to the given ActionsInnerAlertsFilterQuery and assigns it to the Query field. +func (o *ActionsInnerAlertsFilter) SetQuery(v ActionsInnerAlertsFilterQuery) { + o.Query = &v +} + +// GetTimeframe returns the Timeframe field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilter) GetTimeframe() ActionsInnerAlertsFilterTimeframe { + if o == nil || IsNil(o.Timeframe) { + var ret ActionsInnerAlertsFilterTimeframe + return ret + } + return *o.Timeframe +} + +// GetTimeframeOk returns a tuple with the Timeframe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilter) GetTimeframeOk() (*ActionsInnerAlertsFilterTimeframe, bool) { + if o == nil || IsNil(o.Timeframe) { + return nil, false + } + return o.Timeframe, true +} + +// HasTimeframe returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilter) HasTimeframe() bool { + if o != nil && !IsNil(o.Timeframe) { + return true + } + + return false +} + +// SetTimeframe gets a reference to the given ActionsInnerAlertsFilterTimeframe and assigns it to the Timeframe field. +func (o *ActionsInnerAlertsFilter) SetTimeframe(v ActionsInnerAlertsFilterTimeframe) { + o.Timeframe = &v +} + +func (o ActionsInnerAlertsFilter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionsInnerAlertsFilter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Query) { + toSerialize["query"] = o.Query + } + if !IsNil(o.Timeframe) { + toSerialize["timeframe"] = o.Timeframe + } + return toSerialize, nil +} + +type NullableActionsInnerAlertsFilter struct { + value *ActionsInnerAlertsFilter + isSet bool +} + +func (v NullableActionsInnerAlertsFilter) Get() *ActionsInnerAlertsFilter { + return v.value +} + +func (v *NullableActionsInnerAlertsFilter) Set(val *ActionsInnerAlertsFilter) { + v.value = val + v.isSet = true +} + +func (v NullableActionsInnerAlertsFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableActionsInnerAlertsFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionsInnerAlertsFilter(val *ActionsInnerAlertsFilter) *NullableActionsInnerAlertsFilter { + return &NullableActionsInnerAlertsFilter{value: val, isSet: true} +} + +func (v NullableActionsInnerAlertsFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionsInnerAlertsFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_actions_inner_alerts_filter_query.go b/generated/alerting/model_actions_inner_alerts_filter_query.go new file mode 100644 index 000000000..2782dc978 --- /dev/null +++ b/generated/alerting/model_actions_inner_alerts_filter_query.go @@ -0,0 +1,161 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the ActionsInnerAlertsFilterQuery type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionsInnerAlertsFilterQuery{} + +// ActionsInnerAlertsFilterQuery Defines a query filter that determines whether the action runs. +type ActionsInnerAlertsFilterQuery struct { + // A filter written in Kibana Query Language (KQL). + Kql *string `json:"kql,omitempty"` + Filters []Filter `json:"filters,omitempty"` +} + +// NewActionsInnerAlertsFilterQuery instantiates a new ActionsInnerAlertsFilterQuery object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionsInnerAlertsFilterQuery() *ActionsInnerAlertsFilterQuery { + this := ActionsInnerAlertsFilterQuery{} + return &this +} + +// NewActionsInnerAlertsFilterQueryWithDefaults instantiates a new ActionsInnerAlertsFilterQuery object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionsInnerAlertsFilterQueryWithDefaults() *ActionsInnerAlertsFilterQuery { + this := ActionsInnerAlertsFilterQuery{} + return &this +} + +// GetKql returns the Kql field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterQuery) GetKql() string { + if o == nil || IsNil(o.Kql) { + var ret string + return ret + } + return *o.Kql +} + +// GetKqlOk returns a tuple with the Kql field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterQuery) GetKqlOk() (*string, bool) { + if o == nil || IsNil(o.Kql) { + return nil, false + } + return o.Kql, true +} + +// HasKql returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterQuery) HasKql() bool { + if o != nil && !IsNil(o.Kql) { + return true + } + + return false +} + +// SetKql gets a reference to the given string and assigns it to the Kql field. +func (o *ActionsInnerAlertsFilterQuery) SetKql(v string) { + o.Kql = &v +} + +// GetFilters returns the Filters field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterQuery) GetFilters() []Filter { + if o == nil || IsNil(o.Filters) { + var ret []Filter + return ret + } + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterQuery) GetFiltersOk() ([]Filter, bool) { + if o == nil || IsNil(o.Filters) { + return nil, false + } + return o.Filters, true +} + +// HasFilters returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterQuery) HasFilters() bool { + if o != nil && !IsNil(o.Filters) { + return true + } + + return false +} + +// SetFilters gets a reference to the given []Filter and assigns it to the Filters field. +func (o *ActionsInnerAlertsFilterQuery) SetFilters(v []Filter) { + o.Filters = v +} + +func (o ActionsInnerAlertsFilterQuery) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionsInnerAlertsFilterQuery) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Kql) { + toSerialize["kql"] = o.Kql + } + if !IsNil(o.Filters) { + toSerialize["filters"] = o.Filters + } + return toSerialize, nil +} + +type NullableActionsInnerAlertsFilterQuery struct { + value *ActionsInnerAlertsFilterQuery + isSet bool +} + +func (v NullableActionsInnerAlertsFilterQuery) Get() *ActionsInnerAlertsFilterQuery { + return v.value +} + +func (v *NullableActionsInnerAlertsFilterQuery) Set(val *ActionsInnerAlertsFilterQuery) { + v.value = val + v.isSet = true +} + +func (v NullableActionsInnerAlertsFilterQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableActionsInnerAlertsFilterQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionsInnerAlertsFilterQuery(val *ActionsInnerAlertsFilterQuery) *NullableActionsInnerAlertsFilterQuery { + return &NullableActionsInnerAlertsFilterQuery{value: val, isSet: true} +} + +func (v NullableActionsInnerAlertsFilterQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionsInnerAlertsFilterQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_actions_inner_alerts_filter_timeframe.go b/generated/alerting/model_actions_inner_alerts_filter_timeframe.go new file mode 100644 index 000000000..4bd68eb00 --- /dev/null +++ b/generated/alerting/model_actions_inner_alerts_filter_timeframe.go @@ -0,0 +1,197 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the ActionsInnerAlertsFilterTimeframe type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionsInnerAlertsFilterTimeframe{} + +// ActionsInnerAlertsFilterTimeframe Defines a period that limits whether the action runs. +type ActionsInnerAlertsFilterTimeframe struct { + Days []int32 `json:"days,omitempty"` + Hours *ActionsInnerAlertsFilterTimeframeHours `json:"hours,omitempty"` + // The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended. + Timezone *string `json:"timezone,omitempty"` +} + +// NewActionsInnerAlertsFilterTimeframe instantiates a new ActionsInnerAlertsFilterTimeframe object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionsInnerAlertsFilterTimeframe() *ActionsInnerAlertsFilterTimeframe { + this := ActionsInnerAlertsFilterTimeframe{} + return &this +} + +// NewActionsInnerAlertsFilterTimeframeWithDefaults instantiates a new ActionsInnerAlertsFilterTimeframe object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionsInnerAlertsFilterTimeframeWithDefaults() *ActionsInnerAlertsFilterTimeframe { + this := ActionsInnerAlertsFilterTimeframe{} + return &this +} + +// GetDays returns the Days field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterTimeframe) GetDays() []int32 { + if o == nil || IsNil(o.Days) { + var ret []int32 + return ret + } + return o.Days +} + +// GetDaysOk returns a tuple with the Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterTimeframe) GetDaysOk() ([]int32, bool) { + if o == nil || IsNil(o.Days) { + return nil, false + } + return o.Days, true +} + +// HasDays returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterTimeframe) HasDays() bool { + if o != nil && !IsNil(o.Days) { + return true + } + + return false +} + +// SetDays gets a reference to the given []int32 and assigns it to the Days field. +func (o *ActionsInnerAlertsFilterTimeframe) SetDays(v []int32) { + o.Days = v +} + +// GetHours returns the Hours field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterTimeframe) GetHours() ActionsInnerAlertsFilterTimeframeHours { + if o == nil || IsNil(o.Hours) { + var ret ActionsInnerAlertsFilterTimeframeHours + return ret + } + return *o.Hours +} + +// GetHoursOk returns a tuple with the Hours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterTimeframe) GetHoursOk() (*ActionsInnerAlertsFilterTimeframeHours, bool) { + if o == nil || IsNil(o.Hours) { + return nil, false + } + return o.Hours, true +} + +// HasHours returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterTimeframe) HasHours() bool { + if o != nil && !IsNil(o.Hours) { + return true + } + + return false +} + +// SetHours gets a reference to the given ActionsInnerAlertsFilterTimeframeHours and assigns it to the Hours field. +func (o *ActionsInnerAlertsFilterTimeframe) SetHours(v ActionsInnerAlertsFilterTimeframeHours) { + o.Hours = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterTimeframe) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterTimeframe) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterTimeframe) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *ActionsInnerAlertsFilterTimeframe) SetTimezone(v string) { + o.Timezone = &v +} + +func (o ActionsInnerAlertsFilterTimeframe) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionsInnerAlertsFilterTimeframe) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Days) { + toSerialize["days"] = o.Days + } + if !IsNil(o.Hours) { + toSerialize["hours"] = o.Hours + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + return toSerialize, nil +} + +type NullableActionsInnerAlertsFilterTimeframe struct { + value *ActionsInnerAlertsFilterTimeframe + isSet bool +} + +func (v NullableActionsInnerAlertsFilterTimeframe) Get() *ActionsInnerAlertsFilterTimeframe { + return v.value +} + +func (v *NullableActionsInnerAlertsFilterTimeframe) Set(val *ActionsInnerAlertsFilterTimeframe) { + v.value = val + v.isSet = true +} + +func (v NullableActionsInnerAlertsFilterTimeframe) IsSet() bool { + return v.isSet +} + +func (v *NullableActionsInnerAlertsFilterTimeframe) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionsInnerAlertsFilterTimeframe(val *ActionsInnerAlertsFilterTimeframe) *NullableActionsInnerAlertsFilterTimeframe { + return &NullableActionsInnerAlertsFilterTimeframe{value: val, isSet: true} +} + +func (v NullableActionsInnerAlertsFilterTimeframe) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionsInnerAlertsFilterTimeframe) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_actions_inner_alerts_filter_timeframe_hours.go b/generated/alerting/model_actions_inner_alerts_filter_timeframe_hours.go new file mode 100644 index 000000000..21efa4959 --- /dev/null +++ b/generated/alerting/model_actions_inner_alerts_filter_timeframe_hours.go @@ -0,0 +1,162 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the ActionsInnerAlertsFilterTimeframeHours type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionsInnerAlertsFilterTimeframeHours{} + +// ActionsInnerAlertsFilterTimeframeHours Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day. +type ActionsInnerAlertsFilterTimeframeHours struct { + // The end of the time frame in 24-hour notation (`hh:mm`). + End *string `json:"end,omitempty"` + // The start of the time frame in 24-hour notation (`hh:mm`). + Start *string `json:"start,omitempty"` +} + +// NewActionsInnerAlertsFilterTimeframeHours instantiates a new ActionsInnerAlertsFilterTimeframeHours object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionsInnerAlertsFilterTimeframeHours() *ActionsInnerAlertsFilterTimeframeHours { + this := ActionsInnerAlertsFilterTimeframeHours{} + return &this +} + +// NewActionsInnerAlertsFilterTimeframeHoursWithDefaults instantiates a new ActionsInnerAlertsFilterTimeframeHours object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionsInnerAlertsFilterTimeframeHoursWithDefaults() *ActionsInnerAlertsFilterTimeframeHours { + this := ActionsInnerAlertsFilterTimeframeHours{} + return &this +} + +// GetEnd returns the End field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterTimeframeHours) GetEnd() string { + if o == nil || IsNil(o.End) { + var ret string + return ret + } + return *o.End +} + +// GetEndOk returns a tuple with the End field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterTimeframeHours) GetEndOk() (*string, bool) { + if o == nil || IsNil(o.End) { + return nil, false + } + return o.End, true +} + +// HasEnd returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterTimeframeHours) HasEnd() bool { + if o != nil && !IsNil(o.End) { + return true + } + + return false +} + +// SetEnd gets a reference to the given string and assigns it to the End field. +func (o *ActionsInnerAlertsFilterTimeframeHours) SetEnd(v string) { + o.End = &v +} + +// GetStart returns the Start field value if set, zero value otherwise. +func (o *ActionsInnerAlertsFilterTimeframeHours) GetStart() string { + if o == nil || IsNil(o.Start) { + var ret string + return ret + } + return *o.Start +} + +// GetStartOk returns a tuple with the Start field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionsInnerAlertsFilterTimeframeHours) GetStartOk() (*string, bool) { + if o == nil || IsNil(o.Start) { + return nil, false + } + return o.Start, true +} + +// HasStart returns a boolean if a field has been set. +func (o *ActionsInnerAlertsFilterTimeframeHours) HasStart() bool { + if o != nil && !IsNil(o.Start) { + return true + } + + return false +} + +// SetStart gets a reference to the given string and assigns it to the Start field. +func (o *ActionsInnerAlertsFilterTimeframeHours) SetStart(v string) { + o.Start = &v +} + +func (o ActionsInnerAlertsFilterTimeframeHours) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionsInnerAlertsFilterTimeframeHours) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.End) { + toSerialize["end"] = o.End + } + if !IsNil(o.Start) { + toSerialize["start"] = o.Start + } + return toSerialize, nil +} + +type NullableActionsInnerAlertsFilterTimeframeHours struct { + value *ActionsInnerAlertsFilterTimeframeHours + isSet bool +} + +func (v NullableActionsInnerAlertsFilterTimeframeHours) Get() *ActionsInnerAlertsFilterTimeframeHours { + return v.value +} + +func (v *NullableActionsInnerAlertsFilterTimeframeHours) Set(val *ActionsInnerAlertsFilterTimeframeHours) { + v.value = val + v.isSet = true +} + +func (v NullableActionsInnerAlertsFilterTimeframeHours) IsSet() bool { + return v.isSet +} + +func (v *NullableActionsInnerAlertsFilterTimeframeHours) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionsInnerAlertsFilterTimeframeHours(val *ActionsInnerAlertsFilterTimeframeHours) *NullableActionsInnerAlertsFilterTimeframeHours { + return &NullableActionsInnerAlertsFilterTimeframeHours{value: val, isSet: true} +} + +func (v NullableActionsInnerAlertsFilterTimeframeHours) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionsInnerAlertsFilterTimeframeHours) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_actions_inner_frequency.go b/generated/alerting/model_actions_inner_frequency.go index b33da8787..2bf2be63d 100644 --- a/generated/alerting/model_actions_inner_frequency.go +++ b/generated/alerting/model_actions_inner_frequency.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,12 +17,12 @@ import ( // checks if the ActionsInnerFrequency type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ActionsInnerFrequency{} -// ActionsInnerFrequency The parameters that affect how often actions are generated. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. +// ActionsInnerFrequency The properties that affect how often actions are generated. If the rule type supports setting `summary` to `true`, the action can be a summary of alerts at the specified notification interval. Otherwise, an action runs for each alert at the specified notification interval. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. type ActionsInnerFrequency struct { NotifyWhen NotifyWhen `json:"notify_when"` // Indicates whether the action is a summary. Summary bool `json:"summary"` - // The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. + // The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. Throttle NullableString `json:"throttle,omitempty"` } diff --git a/generated/alerting/model_alert_delay.go b/generated/alerting/model_alert_delay.go new file mode 100644 index 000000000..afd273b72 --- /dev/null +++ b/generated/alerting/model_alert_delay.go @@ -0,0 +1,116 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the AlertDelay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertDelay{} + +// AlertDelay Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions. +type AlertDelay struct { + // The number of consecutive runs that must meet the rule conditions. + Active float32 `json:"active"` +} + +// NewAlertDelay instantiates a new AlertDelay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertDelay(active float32) *AlertDelay { + this := AlertDelay{} + this.Active = active + return &this +} + +// NewAlertDelayWithDefaults instantiates a new AlertDelay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertDelayWithDefaults() *AlertDelay { + this := AlertDelay{} + return &this +} + +// GetActive returns the Active field value +func (o *AlertDelay) GetActive() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Active +} + +// GetActiveOk returns a tuple with the Active field value +// and a boolean to check if the value has been set. +func (o *AlertDelay) GetActiveOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Active, true +} + +// SetActive sets field value +func (o *AlertDelay) SetActive(v float32) { + o.Active = v +} + +func (o AlertDelay) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AlertDelay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["active"] = o.Active + return toSerialize, nil +} + +type NullableAlertDelay struct { + value *AlertDelay + isSet bool +} + +func (v NullableAlertDelay) Get() *AlertDelay { + return v.value +} + +func (v *NullableAlertDelay) Set(val *AlertDelay) { + v.value = val + v.isSet = true +} + +func (v NullableAlertDelay) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertDelay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertDelay(val *AlertDelay) *NullableAlertDelay { + return &NullableAlertDelay{value: val, isSet: true} +} + +func (v NullableAlertDelay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertDelay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_alert_response_properties.go b/generated/alerting/model_alert_response_properties.go index d5866d1db..ab4d3e0f2 100644 --- a/generated/alerting/model_alert_response_properties.go +++ b/generated/alerting/model_alert_response_properties.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -363,9 +363,9 @@ func (o *AlertResponseProperties) SetMuteAll(v bool) { o.MuteAll = &v } -// GetMutedInstanceIds returns the MutedInstanceIds field value if set, zero value otherwise (both if not set or set to explicit null). +// GetMutedInstanceIds returns the MutedInstanceIds field value if set, zero value otherwise. func (o *AlertResponseProperties) GetMutedInstanceIds() []string { - if o == nil { + if o == nil || IsNil(o.MutedInstanceIds) { var ret []string return ret } @@ -374,7 +374,6 @@ func (o *AlertResponseProperties) GetMutedInstanceIds() []string { // GetMutedInstanceIdsOk returns a tuple with the MutedInstanceIds field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AlertResponseProperties) GetMutedInstanceIdsOk() ([]string, bool) { if o == nil || IsNil(o.MutedInstanceIds) { return nil, false @@ -384,7 +383,7 @@ func (o *AlertResponseProperties) GetMutedInstanceIdsOk() ([]string, bool) { // HasMutedInstanceIds returns a boolean if a field has been set. func (o *AlertResponseProperties) HasMutedInstanceIds() bool { - if o != nil && IsNil(o.MutedInstanceIds) { + if o != nil && !IsNil(o.MutedInstanceIds) { return true } @@ -743,7 +742,7 @@ func (o AlertResponseProperties) ToMap() (map[string]interface{}, error) { if !IsNil(o.MuteAll) { toSerialize["muteAll"] = o.MuteAll } - if o.MutedInstanceIds != nil { + if !IsNil(o.MutedInstanceIds) { toSerialize["mutedInstanceIds"] = o.MutedInstanceIds } if !IsNil(o.Name) { diff --git a/generated/alerting/model_alert_response_properties_execution_status.go b/generated/alerting/model_alert_response_properties_execution_status.go index 49ccab9db..feb16111f 100644 --- a/generated/alerting/model_alert_response_properties_execution_status.go +++ b/generated/alerting/model_alert_response_properties_execution_status.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_alert_response_properties_schedule.go b/generated/alerting/model_alert_response_properties_schedule.go index 90d8ce2e4..506c2b883 100644 --- a/generated/alerting/model_alert_response_properties_schedule.go +++ b/generated/alerting/model_alert_response_properties_schedule.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_create_rule_request.go b/generated/alerting/model_create_rule_request.go index 3b03004fa..6f818dc99 100644 --- a/generated/alerting/model_create_rule_request.go +++ b/generated/alerting/model_create_rule_request.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -25,17 +25,19 @@ type CreateRuleRequest struct { // Indicates whether you want to run the rule on an interval basis after it is created. Enabled *bool `json:"enabled,omitempty"` // The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule. - Name string `json:"name"` + Name string `json:"name"` + // Deprecated NotifyWhen *NotifyWhen `json:"notify_when,omitempty"` // The parameters for the rule. Params map[string]interface{} `json:"params"` // The ID of the rule type that you want to call when the rule is scheduled to run. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. RuleTypeId string `json:"rule_type_id"` Schedule Schedule `json:"schedule"` - // The tags for the rule. - Tags []string `json:"tags,omitempty"` - // The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. - Throttle NullableString `json:"throttle,omitempty"` + Tags []string `json:"tags,omitempty"` + // Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + // Deprecated + Throttle NullableString `json:"throttle,omitempty"` + AlertDelay *AlertDelay `json:"alert_delay,omitempty"` } // NewCreateRuleRequest instantiates a new CreateRuleRequest object @@ -60,9 +62,9 @@ func NewCreateRuleRequestWithDefaults() *CreateRuleRequest { return &this } -// GetActions returns the Actions field value if set, zero value otherwise (both if not set or set to explicit null). +// GetActions returns the Actions field value if set, zero value otherwise. func (o *CreateRuleRequest) GetActions() []ActionsInner { - if o == nil { + if o == nil || IsNil(o.Actions) { var ret []ActionsInner return ret } @@ -71,7 +73,6 @@ func (o *CreateRuleRequest) GetActions() []ActionsInner { // GetActionsOk returns a tuple with the Actions field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateRuleRequest) GetActionsOk() ([]ActionsInner, bool) { if o == nil || IsNil(o.Actions) { return nil, false @@ -81,7 +82,7 @@ func (o *CreateRuleRequest) GetActionsOk() ([]ActionsInner, bool) { // HasActions returns a boolean if a field has been set. func (o *CreateRuleRequest) HasActions() bool { - if o != nil && IsNil(o.Actions) { + if o != nil && !IsNil(o.Actions) { return true } @@ -174,6 +175,7 @@ func (o *CreateRuleRequest) SetName(v string) { } // GetNotifyWhen returns the NotifyWhen field value if set, zero value otherwise. +// Deprecated func (o *CreateRuleRequest) GetNotifyWhen() NotifyWhen { if o == nil || IsNil(o.NotifyWhen) { var ret NotifyWhen @@ -184,6 +186,7 @@ func (o *CreateRuleRequest) GetNotifyWhen() NotifyWhen { // GetNotifyWhenOk returns a tuple with the NotifyWhen field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *CreateRuleRequest) GetNotifyWhenOk() (*NotifyWhen, bool) { if o == nil || IsNil(o.NotifyWhen) { return nil, false @@ -201,6 +204,7 @@ func (o *CreateRuleRequest) HasNotifyWhen() bool { } // SetNotifyWhen gets a reference to the given NotifyWhen and assigns it to the NotifyWhen field. +// Deprecated func (o *CreateRuleRequest) SetNotifyWhen(v NotifyWhen) { o.NotifyWhen = &v } @@ -310,6 +314,7 @@ func (o *CreateRuleRequest) SetTags(v []string) { } // GetThrottle returns the Throttle field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *CreateRuleRequest) GetThrottle() string { if o == nil || IsNil(o.Throttle.Get()) { var ret string @@ -321,6 +326,7 @@ func (o *CreateRuleRequest) GetThrottle() string { // GetThrottleOk returns a tuple with the Throttle field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *CreateRuleRequest) GetThrottleOk() (*string, bool) { if o == nil { return nil, false @@ -338,6 +344,7 @@ func (o *CreateRuleRequest) HasThrottle() bool { } // SetThrottle gets a reference to the given NullableString and assigns it to the Throttle field. +// Deprecated func (o *CreateRuleRequest) SetThrottle(v string) { o.Throttle.Set(&v) } @@ -352,6 +359,38 @@ func (o *CreateRuleRequest) UnsetThrottle() { o.Throttle.Unset() } +// GetAlertDelay returns the AlertDelay field value if set, zero value otherwise. +func (o *CreateRuleRequest) GetAlertDelay() AlertDelay { + if o == nil || IsNil(o.AlertDelay) { + var ret AlertDelay + return ret + } + return *o.AlertDelay +} + +// GetAlertDelayOk returns a tuple with the AlertDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRuleRequest) GetAlertDelayOk() (*AlertDelay, bool) { + if o == nil || IsNil(o.AlertDelay) { + return nil, false + } + return o.AlertDelay, true +} + +// HasAlertDelay returns a boolean if a field has been set. +func (o *CreateRuleRequest) HasAlertDelay() bool { + if o != nil && !IsNil(o.AlertDelay) { + return true + } + + return false +} + +// SetAlertDelay gets a reference to the given AlertDelay and assigns it to the AlertDelay field. +func (o *CreateRuleRequest) SetAlertDelay(v AlertDelay) { + o.AlertDelay = &v +} + func (o CreateRuleRequest) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -362,7 +401,7 @@ func (o CreateRuleRequest) MarshalJSON() ([]byte, error) { func (o CreateRuleRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Actions != nil { + if !IsNil(o.Actions) { toSerialize["actions"] = o.Actions } toSerialize["consumer"] = o.Consumer @@ -382,6 +421,9 @@ func (o CreateRuleRequest) ToMap() (map[string]interface{}, error) { if o.Throttle.IsSet() { toSerialize["throttle"] = o.Throttle.Get() } + if !IsNil(o.AlertDelay) { + toSerialize["alert_delay"] = o.AlertDelay + } return toSerialize, nil } diff --git a/generated/alerting/model_fieldmap_properties.go b/generated/alerting/model_fieldmap_properties.go new file mode 100644 index 000000000..7fa79c286 --- /dev/null +++ b/generated/alerting/model_fieldmap_properties.go @@ -0,0 +1,459 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the FieldmapProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FieldmapProperties{} + +// FieldmapProperties struct for FieldmapProperties +type FieldmapProperties struct { + // Indicates whether the field is an array. + Array *bool `json:"array,omitempty"` + // Indicates whether it is a dynamic field mapping. + Dynamic *bool `json:"dynamic,omitempty"` + // Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. + Format *string `json:"format,omitempty"` + // Specifies the maximum length of a string field. Longer strings are not indexed or stored. + IgnoreAbove *int32 `json:"ignore_above,omitempty"` + // Indicates whether field values are indexed. + Index *bool `json:"index,omitempty"` + // TBD + Path *string `json:"path,omitempty"` + // Details about the object properties. This property is applicable when `type` is `object`. + Properties map[string]FieldmapPropertiesPropertiesValue `json:"properties,omitempty"` + // Indicates whether the field is required. + Required *bool `json:"required,omitempty"` + // The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. + ScalingFactor *int32 `json:"scaling_factor,omitempty"` + // Specifies the data type for the field. + Type *string `json:"type,omitempty"` +} + +// NewFieldmapProperties instantiates a new FieldmapProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFieldmapProperties() *FieldmapProperties { + this := FieldmapProperties{} + return &this +} + +// NewFieldmapPropertiesWithDefaults instantiates a new FieldmapProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFieldmapPropertiesWithDefaults() *FieldmapProperties { + this := FieldmapProperties{} + return &this +} + +// GetArray returns the Array field value if set, zero value otherwise. +func (o *FieldmapProperties) GetArray() bool { + if o == nil || IsNil(o.Array) { + var ret bool + return ret + } + return *o.Array +} + +// GetArrayOk returns a tuple with the Array field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetArrayOk() (*bool, bool) { + if o == nil || IsNil(o.Array) { + return nil, false + } + return o.Array, true +} + +// HasArray returns a boolean if a field has been set. +func (o *FieldmapProperties) HasArray() bool { + if o != nil && !IsNil(o.Array) { + return true + } + + return false +} + +// SetArray gets a reference to the given bool and assigns it to the Array field. +func (o *FieldmapProperties) SetArray(v bool) { + o.Array = &v +} + +// GetDynamic returns the Dynamic field value if set, zero value otherwise. +func (o *FieldmapProperties) GetDynamic() bool { + if o == nil || IsNil(o.Dynamic) { + var ret bool + return ret + } + return *o.Dynamic +} + +// GetDynamicOk returns a tuple with the Dynamic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetDynamicOk() (*bool, bool) { + if o == nil || IsNil(o.Dynamic) { + return nil, false + } + return o.Dynamic, true +} + +// HasDynamic returns a boolean if a field has been set. +func (o *FieldmapProperties) HasDynamic() bool { + if o != nil && !IsNil(o.Dynamic) { + return true + } + + return false +} + +// SetDynamic gets a reference to the given bool and assigns it to the Dynamic field. +func (o *FieldmapProperties) SetDynamic(v bool) { + o.Dynamic = &v +} + +// GetFormat returns the Format field value if set, zero value otherwise. +func (o *FieldmapProperties) GetFormat() string { + if o == nil || IsNil(o.Format) { + var ret string + return ret + } + return *o.Format +} + +// GetFormatOk returns a tuple with the Format field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetFormatOk() (*string, bool) { + if o == nil || IsNil(o.Format) { + return nil, false + } + return o.Format, true +} + +// HasFormat returns a boolean if a field has been set. +func (o *FieldmapProperties) HasFormat() bool { + if o != nil && !IsNil(o.Format) { + return true + } + + return false +} + +// SetFormat gets a reference to the given string and assigns it to the Format field. +func (o *FieldmapProperties) SetFormat(v string) { + o.Format = &v +} + +// GetIgnoreAbove returns the IgnoreAbove field value if set, zero value otherwise. +func (o *FieldmapProperties) GetIgnoreAbove() int32 { + if o == nil || IsNil(o.IgnoreAbove) { + var ret int32 + return ret + } + return *o.IgnoreAbove +} + +// GetIgnoreAboveOk returns a tuple with the IgnoreAbove field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetIgnoreAboveOk() (*int32, bool) { + if o == nil || IsNil(o.IgnoreAbove) { + return nil, false + } + return o.IgnoreAbove, true +} + +// HasIgnoreAbove returns a boolean if a field has been set. +func (o *FieldmapProperties) HasIgnoreAbove() bool { + if o != nil && !IsNil(o.IgnoreAbove) { + return true + } + + return false +} + +// SetIgnoreAbove gets a reference to the given int32 and assigns it to the IgnoreAbove field. +func (o *FieldmapProperties) SetIgnoreAbove(v int32) { + o.IgnoreAbove = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *FieldmapProperties) GetIndex() bool { + if o == nil || IsNil(o.Index) { + var ret bool + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetIndexOk() (*bool, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *FieldmapProperties) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given bool and assigns it to the Index field. +func (o *FieldmapProperties) SetIndex(v bool) { + o.Index = &v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *FieldmapProperties) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *FieldmapProperties) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *FieldmapProperties) SetPath(v string) { + o.Path = &v +} + +// GetProperties returns the Properties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FieldmapProperties) GetProperties() map[string]FieldmapPropertiesPropertiesValue { + if o == nil { + var ret map[string]FieldmapPropertiesPropertiesValue + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FieldmapProperties) GetPropertiesOk() (*map[string]FieldmapPropertiesPropertiesValue, bool) { + if o == nil || IsNil(o.Properties) { + return nil, false + } + return &o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *FieldmapProperties) HasProperties() bool { + if o != nil && IsNil(o.Properties) { + return true + } + + return false +} + +// SetProperties gets a reference to the given map[string]FieldmapPropertiesPropertiesValue and assigns it to the Properties field. +func (o *FieldmapProperties) SetProperties(v map[string]FieldmapPropertiesPropertiesValue) { + o.Properties = v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *FieldmapProperties) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *FieldmapProperties) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *FieldmapProperties) SetRequired(v bool) { + o.Required = &v +} + +// GetScalingFactor returns the ScalingFactor field value if set, zero value otherwise. +func (o *FieldmapProperties) GetScalingFactor() int32 { + if o == nil || IsNil(o.ScalingFactor) { + var ret int32 + return ret + } + return *o.ScalingFactor +} + +// GetScalingFactorOk returns a tuple with the ScalingFactor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetScalingFactorOk() (*int32, bool) { + if o == nil || IsNil(o.ScalingFactor) { + return nil, false + } + return o.ScalingFactor, true +} + +// HasScalingFactor returns a boolean if a field has been set. +func (o *FieldmapProperties) HasScalingFactor() bool { + if o != nil && !IsNil(o.ScalingFactor) { + return true + } + + return false +} + +// SetScalingFactor gets a reference to the given int32 and assigns it to the ScalingFactor field. +func (o *FieldmapProperties) SetScalingFactor(v int32) { + o.ScalingFactor = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FieldmapProperties) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapProperties) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FieldmapProperties) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *FieldmapProperties) SetType(v string) { + o.Type = &v +} + +func (o FieldmapProperties) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FieldmapProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Array) { + toSerialize["array"] = o.Array + } + if !IsNil(o.Dynamic) { + toSerialize["dynamic"] = o.Dynamic + } + if !IsNil(o.Format) { + toSerialize["format"] = o.Format + } + if !IsNil(o.IgnoreAbove) { + toSerialize["ignore_above"] = o.IgnoreAbove + } + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.ScalingFactor) { + toSerialize["scaling_factor"] = o.ScalingFactor + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableFieldmapProperties struct { + value *FieldmapProperties + isSet bool +} + +func (v NullableFieldmapProperties) Get() *FieldmapProperties { + return v.value +} + +func (v *NullableFieldmapProperties) Set(val *FieldmapProperties) { + v.value = val + v.isSet = true +} + +func (v NullableFieldmapProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableFieldmapProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFieldmapProperties(val *FieldmapProperties) *NullableFieldmapProperties { + return &NullableFieldmapProperties{value: val, isSet: true} +} + +func (v NullableFieldmapProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFieldmapProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_fieldmap_properties_properties_value.go b/generated/alerting/model_fieldmap_properties_properties_value.go new file mode 100644 index 000000000..2a9ca344e --- /dev/null +++ b/generated/alerting/model_fieldmap_properties_properties_value.go @@ -0,0 +1,125 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the FieldmapPropertiesPropertiesValue type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FieldmapPropertiesPropertiesValue{} + +// FieldmapPropertiesPropertiesValue struct for FieldmapPropertiesPropertiesValue +type FieldmapPropertiesPropertiesValue struct { + // The data type for each object property. + Type *string `json:"type,omitempty"` +} + +// NewFieldmapPropertiesPropertiesValue instantiates a new FieldmapPropertiesPropertiesValue object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFieldmapPropertiesPropertiesValue() *FieldmapPropertiesPropertiesValue { + this := FieldmapPropertiesPropertiesValue{} + return &this +} + +// NewFieldmapPropertiesPropertiesValueWithDefaults instantiates a new FieldmapPropertiesPropertiesValue object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFieldmapPropertiesPropertiesValueWithDefaults() *FieldmapPropertiesPropertiesValue { + this := FieldmapPropertiesPropertiesValue{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FieldmapPropertiesPropertiesValue) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FieldmapPropertiesPropertiesValue) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FieldmapPropertiesPropertiesValue) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *FieldmapPropertiesPropertiesValue) SetType(v string) { + o.Type = &v +} + +func (o FieldmapPropertiesPropertiesValue) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FieldmapPropertiesPropertiesValue) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableFieldmapPropertiesPropertiesValue struct { + value *FieldmapPropertiesPropertiesValue + isSet bool +} + +func (v NullableFieldmapPropertiesPropertiesValue) Get() *FieldmapPropertiesPropertiesValue { + return v.value +} + +func (v *NullableFieldmapPropertiesPropertiesValue) Set(val *FieldmapPropertiesPropertiesValue) { + v.value = val + v.isSet = true +} + +func (v NullableFieldmapPropertiesPropertiesValue) IsSet() bool { + return v.isSet +} + +func (v *NullableFieldmapPropertiesPropertiesValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFieldmapPropertiesPropertiesValue(val *FieldmapPropertiesPropertiesValue) *NullableFieldmapPropertiesPropertiesValue { + return &NullableFieldmapPropertiesPropertiesValue{value: val, isSet: true} +} + +func (v NullableFieldmapPropertiesPropertiesValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFieldmapPropertiesPropertiesValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_filter.go b/generated/alerting/model_filter.go new file mode 100644 index 000000000..56d1a5f3e --- /dev/null +++ b/generated/alerting/model_filter.go @@ -0,0 +1,196 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the Filter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Filter{} + +// Filter A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package. +type Filter struct { + Meta *FilterMeta `json:"meta,omitempty"` + Query map[string]interface{} `json:"query,omitempty"` + State map[string]interface{} `json:"$state,omitempty"` +} + +// NewFilter instantiates a new Filter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFilter() *Filter { + this := Filter{} + return &this +} + +// NewFilterWithDefaults instantiates a new Filter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFilterWithDefaults() *Filter { + this := Filter{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *Filter) GetMeta() FilterMeta { + if o == nil || IsNil(o.Meta) { + var ret FilterMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Filter) GetMetaOk() (*FilterMeta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *Filter) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given FilterMeta and assigns it to the Meta field. +func (o *Filter) SetMeta(v FilterMeta) { + o.Meta = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *Filter) GetQuery() map[string]interface{} { + if o == nil || IsNil(o.Query) { + var ret map[string]interface{} + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Filter) GetQueryOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Query) { + return map[string]interface{}{}, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *Filter) HasQuery() bool { + if o != nil && !IsNil(o.Query) { + return true + } + + return false +} + +// SetQuery gets a reference to the given map[string]interface{} and assigns it to the Query field. +func (o *Filter) SetQuery(v map[string]interface{}) { + o.Query = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Filter) GetState() map[string]interface{} { + if o == nil || IsNil(o.State) { + var ret map[string]interface{} + return ret + } + return o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Filter) GetStateOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.State) { + return map[string]interface{}{}, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Filter) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given map[string]interface{} and assigns it to the State field. +func (o *Filter) SetState(v map[string]interface{}) { + o.State = v +} + +func (o Filter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Filter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !IsNil(o.Query) { + toSerialize["query"] = o.Query + } + if !IsNil(o.State) { + toSerialize["$state"] = o.State + } + return toSerialize, nil +} + +type NullableFilter struct { + value *Filter + isSet bool +} + +func (v NullableFilter) Get() *Filter { + return v.value +} + +func (v *NullableFilter) Set(val *Filter) { + v.value = val + v.isSet = true +} + +func (v NullableFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFilter(val *Filter) *NullableFilter { + return &NullableFilter{value: val, isSet: true} +} + +func (v NullableFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_filter_meta.go b/generated/alerting/model_filter_meta.go new file mode 100644 index 000000000..74d9f7e57 --- /dev/null +++ b/generated/alerting/model_filter_meta.go @@ -0,0 +1,531 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the FilterMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FilterMeta{} + +// FilterMeta struct for FilterMeta +type FilterMeta struct { + Alias NullableString `json:"alias,omitempty"` + ControlledBy *string `json:"controlledBy,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Field *string `json:"field,omitempty"` + Group *string `json:"group,omitempty"` + Index *string `json:"index,omitempty"` + IsMultiIndex *bool `json:"isMultiIndex,omitempty"` + Key *string `json:"key,omitempty"` + Negate *bool `json:"negate,omitempty"` + Params map[string]interface{} `json:"params,omitempty"` + Type *string `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +// NewFilterMeta instantiates a new FilterMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFilterMeta() *FilterMeta { + this := FilterMeta{} + return &this +} + +// NewFilterMetaWithDefaults instantiates a new FilterMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFilterMetaWithDefaults() *FilterMeta { + this := FilterMeta{} + return &this +} + +// GetAlias returns the Alias field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FilterMeta) GetAlias() string { + if o == nil || IsNil(o.Alias.Get()) { + var ret string + return ret + } + return *o.Alias.Get() +} + +// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FilterMeta) GetAliasOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Alias.Get(), o.Alias.IsSet() +} + +// HasAlias returns a boolean if a field has been set. +func (o *FilterMeta) HasAlias() bool { + if o != nil && o.Alias.IsSet() { + return true + } + + return false +} + +// SetAlias gets a reference to the given NullableString and assigns it to the Alias field. +func (o *FilterMeta) SetAlias(v string) { + o.Alias.Set(&v) +} + +// SetAliasNil sets the value for Alias to be an explicit nil +func (o *FilterMeta) SetAliasNil() { + o.Alias.Set(nil) +} + +// UnsetAlias ensures that no value is present for Alias, not even an explicit nil +func (o *FilterMeta) UnsetAlias() { + o.Alias.Unset() +} + +// GetControlledBy returns the ControlledBy field value if set, zero value otherwise. +func (o *FilterMeta) GetControlledBy() string { + if o == nil || IsNil(o.ControlledBy) { + var ret string + return ret + } + return *o.ControlledBy +} + +// GetControlledByOk returns a tuple with the ControlledBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetControlledByOk() (*string, bool) { + if o == nil || IsNil(o.ControlledBy) { + return nil, false + } + return o.ControlledBy, true +} + +// HasControlledBy returns a boolean if a field has been set. +func (o *FilterMeta) HasControlledBy() bool { + if o != nil && !IsNil(o.ControlledBy) { + return true + } + + return false +} + +// SetControlledBy gets a reference to the given string and assigns it to the ControlledBy field. +func (o *FilterMeta) SetControlledBy(v string) { + o.ControlledBy = &v +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise. +func (o *FilterMeta) GetDisabled() bool { + if o == nil || IsNil(o.Disabled) { + var ret bool + return ret + } + return *o.Disabled +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetDisabledOk() (*bool, bool) { + if o == nil || IsNil(o.Disabled) { + return nil, false + } + return o.Disabled, true +} + +// HasDisabled returns a boolean if a field has been set. +func (o *FilterMeta) HasDisabled() bool { + if o != nil && !IsNil(o.Disabled) { + return true + } + + return false +} + +// SetDisabled gets a reference to the given bool and assigns it to the Disabled field. +func (o *FilterMeta) SetDisabled(v bool) { + o.Disabled = &v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *FilterMeta) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *FilterMeta) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *FilterMeta) SetField(v string) { + o.Field = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *FilterMeta) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *FilterMeta) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *FilterMeta) SetGroup(v string) { + o.Group = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *FilterMeta) GetIndex() string { + if o == nil || IsNil(o.Index) { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetIndexOk() (*string, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *FilterMeta) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *FilterMeta) SetIndex(v string) { + o.Index = &v +} + +// GetIsMultiIndex returns the IsMultiIndex field value if set, zero value otherwise. +func (o *FilterMeta) GetIsMultiIndex() bool { + if o == nil || IsNil(o.IsMultiIndex) { + var ret bool + return ret + } + return *o.IsMultiIndex +} + +// GetIsMultiIndexOk returns a tuple with the IsMultiIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetIsMultiIndexOk() (*bool, bool) { + if o == nil || IsNil(o.IsMultiIndex) { + return nil, false + } + return o.IsMultiIndex, true +} + +// HasIsMultiIndex returns a boolean if a field has been set. +func (o *FilterMeta) HasIsMultiIndex() bool { + if o != nil && !IsNil(o.IsMultiIndex) { + return true + } + + return false +} + +// SetIsMultiIndex gets a reference to the given bool and assigns it to the IsMultiIndex field. +func (o *FilterMeta) SetIsMultiIndex(v bool) { + o.IsMultiIndex = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *FilterMeta) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *FilterMeta) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *FilterMeta) SetKey(v string) { + o.Key = &v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *FilterMeta) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *FilterMeta) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *FilterMeta) SetNegate(v bool) { + o.Negate = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *FilterMeta) GetParams() map[string]interface{} { + if o == nil || IsNil(o.Params) { + var ret map[string]interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return map[string]interface{}{}, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *FilterMeta) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. +func (o *FilterMeta) SetParams(v map[string]interface{}) { + o.Params = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FilterMeta) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FilterMeta) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *FilterMeta) SetType(v string) { + o.Type = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *FilterMeta) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *FilterMeta) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *FilterMeta) SetValue(v string) { + o.Value = &v +} + +func (o FilterMeta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FilterMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Alias.IsSet() { + toSerialize["alias"] = o.Alias.Get() + } + if !IsNil(o.ControlledBy) { + toSerialize["controlledBy"] = o.ControlledBy + } + if !IsNil(o.Disabled) { + toSerialize["disabled"] = o.Disabled + } + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.IsMultiIndex) { + toSerialize["isMultiIndex"] = o.IsMultiIndex + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableFilterMeta struct { + value *FilterMeta + isSet bool +} + +func (v NullableFilterMeta) Get() *FilterMeta { + return v.value +} + +func (v *NullableFilterMeta) Set(val *FilterMeta) { + v.value = val + v.isSet = true +} + +func (v NullableFilterMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableFilterMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFilterMeta(val *FilterMeta) *NullableFilterMeta { + return &NullableFilterMeta{value: val, isSet: true} +} + +func (v NullableFilterMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFilterMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_find_rules_200_response.go b/generated/alerting/model_find_rules_200_response.go index 61c8a54eb..f462321e0 100644 --- a/generated/alerting/model_find_rules_200_response.go +++ b/generated/alerting/model_find_rules_200_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_find_rules_has_reference_parameter.go b/generated/alerting/model_find_rules_has_reference_parameter.go index 03945b239..4fa75f8bf 100644 --- a/generated/alerting/model_find_rules_has_reference_parameter.go +++ b/generated/alerting/model_find_rules_has_reference_parameter.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ var _ MappedNullable = &FindRulesHasReferenceParameter{} // FindRulesHasReferenceParameter struct for FindRulesHasReferenceParameter type FindRulesHasReferenceParameter struct { - Id *string `json:"id,omitempty"` - Type *string `json:"type,omitempty"` + Id NullableString `json:"id,omitempty"` + Type NullableString `json:"type,omitempty"` } // NewFindRulesHasReferenceParameter instantiates a new FindRulesHasReferenceParameter object @@ -40,68 +40,90 @@ func NewFindRulesHasReferenceParameterWithDefaults() *FindRulesHasReferenceParam return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FindRulesHasReferenceParameter) GetId() string { - if o == nil || IsNil(o.Id) { + if o == nil || IsNil(o.Id.Get()) { var ret string return ret } - return *o.Id + return *o.Id.Get() } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FindRulesHasReferenceParameter) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true + return o.Id.Get(), o.Id.IsSet() } // HasId returns a boolean if a field has been set. func (o *FindRulesHasReferenceParameter) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && o.Id.IsSet() { return true } return false } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId gets a reference to the given NullableString and assigns it to the Id field. func (o *FindRulesHasReferenceParameter) SetId(v string) { - o.Id = &v + o.Id.Set(&v) } -// GetType returns the Type field value if set, zero value otherwise. +// SetIdNil sets the value for Id to be an explicit nil +func (o *FindRulesHasReferenceParameter) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil +func (o *FindRulesHasReferenceParameter) UnsetId() { + o.Id.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FindRulesHasReferenceParameter) GetType() string { - if o == nil || IsNil(o.Type) { + if o == nil || IsNil(o.Type.Get()) { var ret string return ret } - return *o.Type + return *o.Type.Get() } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FindRulesHasReferenceParameter) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + return o.Type.Get(), o.Type.IsSet() } // HasType returns a boolean if a field has been set. func (o *FindRulesHasReferenceParameter) HasType() bool { - if o != nil && !IsNil(o.Type) { + if o != nil && o.Type.IsSet() { return true } return false } -// SetType gets a reference to the given string and assigns it to the Type field. +// SetType gets a reference to the given NullableString and assigns it to the Type field. func (o *FindRulesHasReferenceParameter) SetType(v string) { - o.Type = &v + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *FindRulesHasReferenceParameter) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *FindRulesHasReferenceParameter) UnsetType() { + o.Type.Unset() } func (o FindRulesHasReferenceParameter) MarshalJSON() ([]byte, error) { @@ -114,11 +136,11 @@ func (o FindRulesHasReferenceParameter) MarshalJSON() ([]byte, error) { func (o FindRulesHasReferenceParameter) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() } return toSerialize, nil } diff --git a/generated/alerting/model_get_alerting_health_200_response.go b/generated/alerting/model_get_alerting_health_200_response.go index a8df7a576..eb8617e26 100644 --- a/generated/alerting/model_get_alerting_health_200_response.go +++ b/generated/alerting/model_get_alerting_health_200_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,6 @@ var _ MappedNullable = &GetAlertingHealth200Response{} // GetAlertingHealth200Response struct for GetAlertingHealth200Response type GetAlertingHealth200Response struct { - // Deprecated - AlertingFrameworkHeath *GetAlertingHealth200ResponseAlertingFrameworkHeath `json:"alerting_framework_heath,omitempty"` AlertingFrameworkHealth *GetAlertingHealth200ResponseAlertingFrameworkHealth `json:"alerting_framework_health,omitempty"` // If `false`, the encrypted saved object plugin does not have a permanent encryption key. HasPermanentEncryptionKey *bool `json:"has_permanent_encryption_key,omitempty"` @@ -45,41 +43,6 @@ func NewGetAlertingHealth200ResponseWithDefaults() *GetAlertingHealth200Response return &this } -// GetAlertingFrameworkHeath returns the AlertingFrameworkHeath field value if set, zero value otherwise. -// Deprecated -func (o *GetAlertingHealth200Response) GetAlertingFrameworkHeath() GetAlertingHealth200ResponseAlertingFrameworkHeath { - if o == nil || IsNil(o.AlertingFrameworkHeath) { - var ret GetAlertingHealth200ResponseAlertingFrameworkHeath - return ret - } - return *o.AlertingFrameworkHeath -} - -// GetAlertingFrameworkHeathOk returns a tuple with the AlertingFrameworkHeath field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *GetAlertingHealth200Response) GetAlertingFrameworkHeathOk() (*GetAlertingHealth200ResponseAlertingFrameworkHeath, bool) { - if o == nil || IsNil(o.AlertingFrameworkHeath) { - return nil, false - } - return o.AlertingFrameworkHeath, true -} - -// HasAlertingFrameworkHeath returns a boolean if a field has been set. -func (o *GetAlertingHealth200Response) HasAlertingFrameworkHeath() bool { - if o != nil && !IsNil(o.AlertingFrameworkHeath) { - return true - } - - return false -} - -// SetAlertingFrameworkHeath gets a reference to the given GetAlertingHealth200ResponseAlertingFrameworkHeath and assigns it to the AlertingFrameworkHeath field. -// Deprecated -func (o *GetAlertingHealth200Response) SetAlertingFrameworkHeath(v GetAlertingHealth200ResponseAlertingFrameworkHeath) { - o.AlertingFrameworkHeath = &v -} - // GetAlertingFrameworkHealth returns the AlertingFrameworkHealth field value if set, zero value otherwise. func (o *GetAlertingHealth200Response) GetAlertingFrameworkHealth() GetAlertingHealth200ResponseAlertingFrameworkHealth { if o == nil || IsNil(o.AlertingFrameworkHealth) { @@ -186,9 +149,6 @@ func (o GetAlertingHealth200Response) MarshalJSON() ([]byte, error) { func (o GetAlertingHealth200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AlertingFrameworkHeath) { - toSerialize["alerting_framework_heath"] = o.AlertingFrameworkHeath - } if !IsNil(o.AlertingFrameworkHealth) { toSerialize["alerting_framework_health"] = o.AlertingFrameworkHealth } diff --git a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health.go b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health.go index 02ee51b11..c97fac4a1 100644 --- a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health.go +++ b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_decryption_health.go b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_decryption_health.go index 882b578cc..883874aba 100644 --- a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_decryption_health.go +++ b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_decryption_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_execution_health.go b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_execution_health.go index 16eaf8ebe..1d4037253 100644 --- a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_execution_health.go +++ b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_execution_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_read_health.go b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_read_health.go index 4683fba54..20adbe417 100644 --- a/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_read_health.go +++ b/generated/alerting/model_get_alerting_health_200_response_alerting_framework_health_read_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_get_rule_types_200_response_inner.go b/generated/alerting/model_get_rule_types_200_response_inner.go index 98f7b944f..0cb0a4e8d 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner.go +++ b/generated/alerting/model_get_rule_types_200_response_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,16 +19,21 @@ var _ MappedNullable = &GetRuleTypes200ResponseInner{} // GetRuleTypes200ResponseInner struct for GetRuleTypes200ResponseInner type GetRuleTypes200ResponseInner struct { - // An explicit list of groups for which the rule type can schedule actions, each with the action group's unique ID and human readable name. Rule actions validation uses this configuration to ensure that groups are valid. ActionGroups []GetRuleTypes200ResponseInnerActionGroupsInner `json:"action_groups,omitempty"` ActionVariables *GetRuleTypes200ResponseInnerActionVariables `json:"action_variables,omitempty"` + Alerts *GetRuleTypes200ResponseInnerAlerts `json:"alerts,omitempty"` AuthorizedConsumers *GetRuleTypes200ResponseInnerAuthorizedConsumers `json:"authorized_consumers,omitempty"` + // The rule category, which is used by features such as category-specific maintenance windows. + Category *string `json:"category,omitempty"` // The default identifier for the rule type group. DefaultActionGroupId *string `json:"default_action_group_id,omitempty"` // Indicates whether the rule passes context variables to its recovery action. DoesSetRecoveryContext *bool `json:"does_set_recovery_context,omitempty"` // Indicates whether the rule type is enabled or disabled based on the subscription. EnabledInLicense *bool `json:"enabled_in_license,omitempty"` + // Indicates whether the rule type has custom mappings for the alert data. + HasAlertsMappings *bool `json:"has_alerts_mappings,omitempty"` + HasFieldsForAAD *bool `json:"has_fields_for_a_a_d,omitempty"` // The unique identifier for the rule type. Id *string `json:"id,omitempty"` // Indicates whether the rule type is exportable in **Stack Management > Saved Objects**. @@ -124,6 +129,38 @@ func (o *GetRuleTypes200ResponseInner) SetActionVariables(v GetRuleTypes200Respo o.ActionVariables = &v } +// GetAlerts returns the Alerts field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInner) GetAlerts() GetRuleTypes200ResponseInnerAlerts { + if o == nil || IsNil(o.Alerts) { + var ret GetRuleTypes200ResponseInnerAlerts + return ret + } + return *o.Alerts +} + +// GetAlertsOk returns a tuple with the Alerts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInner) GetAlertsOk() (*GetRuleTypes200ResponseInnerAlerts, bool) { + if o == nil || IsNil(o.Alerts) { + return nil, false + } + return o.Alerts, true +} + +// HasAlerts returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInner) HasAlerts() bool { + if o != nil && !IsNil(o.Alerts) { + return true + } + + return false +} + +// SetAlerts gets a reference to the given GetRuleTypes200ResponseInnerAlerts and assigns it to the Alerts field. +func (o *GetRuleTypes200ResponseInner) SetAlerts(v GetRuleTypes200ResponseInnerAlerts) { + o.Alerts = &v +} + // GetAuthorizedConsumers returns the AuthorizedConsumers field value if set, zero value otherwise. func (o *GetRuleTypes200ResponseInner) GetAuthorizedConsumers() GetRuleTypes200ResponseInnerAuthorizedConsumers { if o == nil || IsNil(o.AuthorizedConsumers) { @@ -156,6 +193,38 @@ func (o *GetRuleTypes200ResponseInner) SetAuthorizedConsumers(v GetRuleTypes200R o.AuthorizedConsumers = &v } +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInner) GetCategory() string { + if o == nil || IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInner) GetCategoryOk() (*string, bool) { + if o == nil || IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInner) HasCategory() bool { + if o != nil && !IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *GetRuleTypes200ResponseInner) SetCategory(v string) { + o.Category = &v +} + // GetDefaultActionGroupId returns the DefaultActionGroupId field value if set, zero value otherwise. func (o *GetRuleTypes200ResponseInner) GetDefaultActionGroupId() string { if o == nil || IsNil(o.DefaultActionGroupId) { @@ -252,6 +321,70 @@ func (o *GetRuleTypes200ResponseInner) SetEnabledInLicense(v bool) { o.EnabledInLicense = &v } +// GetHasAlertsMappings returns the HasAlertsMappings field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInner) GetHasAlertsMappings() bool { + if o == nil || IsNil(o.HasAlertsMappings) { + var ret bool + return ret + } + return *o.HasAlertsMappings +} + +// GetHasAlertsMappingsOk returns a tuple with the HasAlertsMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInner) GetHasAlertsMappingsOk() (*bool, bool) { + if o == nil || IsNil(o.HasAlertsMappings) { + return nil, false + } + return o.HasAlertsMappings, true +} + +// HasHasAlertsMappings returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInner) HasHasAlertsMappings() bool { + if o != nil && !IsNil(o.HasAlertsMappings) { + return true + } + + return false +} + +// SetHasAlertsMappings gets a reference to the given bool and assigns it to the HasAlertsMappings field. +func (o *GetRuleTypes200ResponseInner) SetHasAlertsMappings(v bool) { + o.HasAlertsMappings = &v +} + +// GetHasFieldsForAAD returns the HasFieldsForAAD field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInner) GetHasFieldsForAAD() bool { + if o == nil || IsNil(o.HasFieldsForAAD) { + var ret bool + return ret + } + return *o.HasFieldsForAAD +} + +// GetHasFieldsForAADOk returns a tuple with the HasFieldsForAAD field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInner) GetHasFieldsForAADOk() (*bool, bool) { + if o == nil || IsNil(o.HasFieldsForAAD) { + return nil, false + } + return o.HasFieldsForAAD, true +} + +// HasHasFieldsForAAD returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInner) HasHasFieldsForAAD() bool { + if o != nil && !IsNil(o.HasFieldsForAAD) { + return true + } + + return false +} + +// SetHasFieldsForAAD gets a reference to the given bool and assigns it to the HasFieldsForAAD field. +func (o *GetRuleTypes200ResponseInner) SetHasFieldsForAAD(v bool) { + o.HasFieldsForAAD = &v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *GetRuleTypes200ResponseInner) GetId() string { if o == nil || IsNil(o.Id) { @@ -492,9 +625,15 @@ func (o GetRuleTypes200ResponseInner) ToMap() (map[string]interface{}, error) { if !IsNil(o.ActionVariables) { toSerialize["action_variables"] = o.ActionVariables } + if !IsNil(o.Alerts) { + toSerialize["alerts"] = o.Alerts + } if !IsNil(o.AuthorizedConsumers) { toSerialize["authorized_consumers"] = o.AuthorizedConsumers } + if !IsNil(o.Category) { + toSerialize["category"] = o.Category + } if !IsNil(o.DefaultActionGroupId) { toSerialize["default_action_group_id"] = o.DefaultActionGroupId } @@ -504,6 +643,12 @@ func (o GetRuleTypes200ResponseInner) ToMap() (map[string]interface{}, error) { if !IsNil(o.EnabledInLicense) { toSerialize["enabled_in_license"] = o.EnabledInLicense } + if !IsNil(o.HasAlertsMappings) { + toSerialize["has_alerts_mappings"] = o.HasAlertsMappings + } + if !IsNil(o.HasFieldsForAAD) { + toSerialize["has_fields_for_a_a_d"] = o.HasFieldsForAAD + } if !IsNil(o.Id) { toSerialize["id"] = o.Id } diff --git a/generated/alerting/model_get_rule_types_200_response_inner_action_groups_inner.go b/generated/alerting/model_get_rule_types_200_response_inner_action_groups_inner.go index 12bd6bfbe..fc9da6c02 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_action_groups_inner.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_action_groups_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ var _ MappedNullable = &GetRuleTypes200ResponseInnerActionGroupsInner{} // GetRuleTypes200ResponseInnerActionGroupsInner struct for GetRuleTypes200ResponseInnerActionGroupsInner type GetRuleTypes200ResponseInnerActionGroupsInner struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id NullableString `json:"id,omitempty"` + Name NullableString `json:"name,omitempty"` } // NewGetRuleTypes200ResponseInnerActionGroupsInner instantiates a new GetRuleTypes200ResponseInnerActionGroupsInner object @@ -40,68 +40,90 @@ func NewGetRuleTypes200ResponseInnerActionGroupsInnerWithDefaults() *GetRuleType return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionGroupsInner) GetId() string { - if o == nil || IsNil(o.Id) { + if o == nil || IsNil(o.Id.Get()) { var ret string return ret } - return *o.Id + return *o.Id.Get() } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionGroupsInner) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true + return o.Id.Get(), o.Id.IsSet() } // HasId returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionGroupsInner) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && o.Id.IsSet() { return true } return false } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId gets a reference to the given NullableString and assigns it to the Id field. func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetId(v string) { - o.Id = &v + o.Id.Set(&v) } -// GetName returns the Name field value if set, zero value otherwise. +// SetIdNil sets the value for Id to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionGroupsInner) UnsetId() { + o.Id.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionGroupsInner) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil || IsNil(o.Name.Get()) { var ret string return ret } - return *o.Name + return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionGroupsInner) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionGroupsInner) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && o.Name.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetName(v string) { - o.Name = &v + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionGroupsInner) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionGroupsInner) UnsetName() { + o.Name.Unset() } func (o GetRuleTypes200ResponseInnerActionGroupsInner) MarshalJSON() ([]byte, error) { @@ -114,11 +136,11 @@ func (o GetRuleTypes200ResponseInnerActionGroupsInner) MarshalJSON() ([]byte, er func (o GetRuleTypes200ResponseInnerActionGroupsInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() } return toSerialize, nil } diff --git a/generated/alerting/model_get_rule_types_200_response_inner_action_variables.go b/generated/alerting/model_get_rule_types_200_response_inner_action_variables.go index 6406265d0..5173c7574 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_action_variables.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_action_variables.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ var _ MappedNullable = &GetRuleTypes200ResponseInnerActionVariables{} type GetRuleTypes200ResponseInnerActionVariables struct { Context []GetRuleTypes200ResponseInnerActionVariablesContextInner `json:"context,omitempty"` Params []GetRuleTypes200ResponseInnerActionVariablesParamsInner `json:"params,omitempty"` - State []GetRuleTypes200ResponseInnerActionVariablesParamsInner `json:"state,omitempty"` + State []GetRuleTypes200ResponseInnerActionVariablesStateInner `json:"state,omitempty"` } // NewGetRuleTypes200ResponseInnerActionVariables instantiates a new GetRuleTypes200ResponseInnerActionVariables object @@ -106,9 +106,9 @@ func (o *GetRuleTypes200ResponseInnerActionVariables) SetParams(v []GetRuleTypes } // GetState returns the State field value if set, zero value otherwise. -func (o *GetRuleTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesParamsInner { +func (o *GetRuleTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesStateInner { if o == nil || IsNil(o.State) { - var ret []GetRuleTypes200ResponseInnerActionVariablesParamsInner + var ret []GetRuleTypes200ResponseInnerActionVariablesStateInner return ret } return o.State @@ -116,7 +116,7 @@ func (o *GetRuleTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes2 // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetRuleTypes200ResponseInnerActionVariables) GetStateOk() ([]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool) { +func (o *GetRuleTypes200ResponseInnerActionVariables) GetStateOk() ([]GetRuleTypes200ResponseInnerActionVariablesStateInner, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -132,8 +132,8 @@ func (o *GetRuleTypes200ResponseInnerActionVariables) HasState() bool { return false } -// SetState gets a reference to the given []GetRuleTypes200ResponseInnerActionVariablesParamsInner and assigns it to the State field. -func (o *GetRuleTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner) { +// SetState gets a reference to the given []GetRuleTypes200ResponseInnerActionVariablesStateInner and assigns it to the State field. +func (o *GetRuleTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesStateInner) { o.State = v } diff --git a/generated/alerting/model_get_rule_types_200_response_inner_action_variables_context_inner.go b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_context_inner.go index 59eaccc0a..f1010c09c 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_action_variables_context_inner.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_context_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ var _ MappedNullable = &GetRuleTypes200ResponseInnerActionVariablesContextInner{ // GetRuleTypes200ResponseInnerActionVariablesContextInner struct for GetRuleTypes200ResponseInnerActionVariablesContextInner type GetRuleTypes200ResponseInnerActionVariablesContextInner struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - UseWithTripleBracesInTemplates *bool `json:"useWithTripleBracesInTemplates,omitempty"` + Name NullableString `json:"name,omitempty"` + Description NullableString `json:"description,omitempty"` + UseWithTripleBracesInTemplates *bool `json:"useWithTripleBracesInTemplates,omitempty"` } // NewGetRuleTypes200ResponseInnerActionVariablesContextInner instantiates a new GetRuleTypes200ResponseInnerActionVariablesContextInner object @@ -41,68 +41,90 @@ func NewGetRuleTypes200ResponseInnerActionVariablesContextInnerWithDefaults() *G return &this } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil || IsNil(o.Name.Get()) { var ret string return ret } - return *o.Name + return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && o.Name.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetName(v string) { - o.Name = &v + o.Name.Set(&v) } -// GetDescription returns the Description field value if set, zero value otherwise. +// SetNameNil sets the value for Name to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) UnsetName() { + o.Name.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetDescription() string { - if o == nil || IsNil(o.Description) { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } - return *o.Description + return *o.Description.Get() } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { + if o == nil { return nil, false } - return o.Description, true + return o.Description.Get(), o.Description.IsSet() } // HasDescription returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && o.Description.IsSet() { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetDescription(v string) { - o.Description = &v + o.Description.Set(&v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesContextInner) UnsetDescription() { + o.Description.Unset() } // GetUseWithTripleBracesInTemplates returns the UseWithTripleBracesInTemplates field value if set, zero value otherwise. @@ -147,11 +169,11 @@ func (o GetRuleTypes200ResponseInnerActionVariablesContextInner) MarshalJSON() ( func (o GetRuleTypes200ResponseInnerActionVariablesContextInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() } if !IsNil(o.UseWithTripleBracesInTemplates) { toSerialize["useWithTripleBracesInTemplates"] = o.UseWithTripleBracesInTemplates diff --git a/generated/alerting/model_get_rule_types_200_response_inner_action_variables_params_inner.go b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_params_inner.go index 5136020cb..f8ea2131a 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_action_variables_params_inner.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_params_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ var _ MappedNullable = &GetRuleTypes200ResponseInnerActionVariablesParamsInner{} // GetRuleTypes200ResponseInnerActionVariablesParamsInner struct for GetRuleTypes200ResponseInnerActionVariablesParamsInner type GetRuleTypes200ResponseInnerActionVariablesParamsInner struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` + Description NullableString `json:"description,omitempty"` + Name NullableString `json:"name,omitempty"` } // NewGetRuleTypes200ResponseInnerActionVariablesParamsInner instantiates a new GetRuleTypes200ResponseInnerActionVariablesParamsInner object @@ -40,68 +40,90 @@ func NewGetRuleTypes200ResponseInnerActionVariablesParamsInnerWithDefaults() *Ge return &this } -// GetDescription returns the Description field value if set, zero value otherwise. +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) GetDescription() string { - if o == nil || IsNil(o.Description) { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } - return *o.Description + return *o.Description.Get() } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { + if o == nil { return nil, false } - return o.Description, true + return o.Description.Get(), o.Description.IsSet() } // HasDescription returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && o.Description.IsSet() { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetDescription(v string) { - o.Description = &v + o.Description.Set(&v) } -// GetName returns the Name field value if set, zero value otherwise. +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) UnsetDescription() { + o.Description.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil || IsNil(o.Name.Get()) { var ret string return ret } - return *o.Name + return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && o.Name.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetName(v string) { - o.Name = &v + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerActionVariablesParamsInner) UnsetName() { + o.Name.Unset() } func (o GetRuleTypes200ResponseInnerActionVariablesParamsInner) MarshalJSON() ([]byte, error) { @@ -114,11 +136,11 @@ func (o GetRuleTypes200ResponseInnerActionVariablesParamsInner) MarshalJSON() ([ func (o GetRuleTypes200ResponseInnerActionVariablesParamsInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() } return toSerialize, nil } diff --git a/generated/alerting/model_get_rule_types_200_response_inner_action_variables_state_inner.go b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_state_inner.go new file mode 100644 index 000000000..773c15f58 --- /dev/null +++ b/generated/alerting/model_get_rule_types_200_response_inner_action_variables_state_inner.go @@ -0,0 +1,160 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the GetRuleTypes200ResponseInnerActionVariablesStateInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRuleTypes200ResponseInnerActionVariablesStateInner{} + +// GetRuleTypes200ResponseInnerActionVariablesStateInner struct for GetRuleTypes200ResponseInnerActionVariablesStateInner +type GetRuleTypes200ResponseInnerActionVariablesStateInner struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewGetRuleTypes200ResponseInnerActionVariablesStateInner instantiates a new GetRuleTypes200ResponseInnerActionVariablesStateInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRuleTypes200ResponseInnerActionVariablesStateInner() *GetRuleTypes200ResponseInnerActionVariablesStateInner { + this := GetRuleTypes200ResponseInnerActionVariablesStateInner{} + return &this +} + +// NewGetRuleTypes200ResponseInnerActionVariablesStateInnerWithDefaults instantiates a new GetRuleTypes200ResponseInnerActionVariablesStateInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRuleTypes200ResponseInnerActionVariablesStateInnerWithDefaults() *GetRuleTypes200ResponseInnerActionVariablesStateInner { + this := GetRuleTypes200ResponseInnerActionVariablesStateInner{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetRuleTypes200ResponseInnerActionVariablesStateInner) SetName(v string) { + o.Name = &v +} + +func (o GetRuleTypes200ResponseInnerActionVariablesStateInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRuleTypes200ResponseInnerActionVariablesStateInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableGetRuleTypes200ResponseInnerActionVariablesStateInner struct { + value *GetRuleTypes200ResponseInnerActionVariablesStateInner + isSet bool +} + +func (v NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) Get() *GetRuleTypes200ResponseInnerActionVariablesStateInner { + return v.value +} + +func (v *NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) Set(val *GetRuleTypes200ResponseInnerActionVariablesStateInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRuleTypes200ResponseInnerActionVariablesStateInner(val *GetRuleTypes200ResponseInnerActionVariablesStateInner) *NullableGetRuleTypes200ResponseInnerActionVariablesStateInner { + return &NullableGetRuleTypes200ResponseInnerActionVariablesStateInner{value: val, isSet: true} +} + +func (v NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRuleTypes200ResponseInnerActionVariablesStateInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_get_rule_types_200_response_inner_alerts.go b/generated/alerting/model_get_rule_types_200_response_inner_alerts.go new file mode 100644 index 000000000..496c1f25c --- /dev/null +++ b/generated/alerting/model_get_rule_types_200_response_inner_alerts.go @@ -0,0 +1,387 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the GetRuleTypes200ResponseInnerAlerts type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRuleTypes200ResponseInnerAlerts{} + +// GetRuleTypes200ResponseInnerAlerts Details for writing alerts as data documents for this rule type. +type GetRuleTypes200ResponseInnerAlerts struct { + // The namespace for this rule type. + Context *string `json:"context,omitempty"` + // Indicates whether new fields are added dynamically. + Dynamic *string `json:"dynamic,omitempty"` + // Indicates whether the alerts are space-aware. If true, space-specific alert indices are used. + IsSpaceAware *bool `json:"isSpaceAware,omitempty"` + Mappings *GetRuleTypes200ResponseInnerAlertsMappings `json:"mappings,omitempty"` + // A secondary alias. It is typically used to support the signals alias for detection rules. + SecondaryAlias *string `json:"secondaryAlias,omitempty"` + // Indicates whether the rule should write out alerts as data. + ShouldWrite *bool `json:"shouldWrite,omitempty"` + // Indicates whether to include the ECS component template for the alerts. + UseEcs *bool `json:"useEcs,omitempty"` + // Indicates whether to include the legacy component template for the alerts. + UseLegacyAlerts *bool `json:"useLegacyAlerts,omitempty"` +} + +// NewGetRuleTypes200ResponseInnerAlerts instantiates a new GetRuleTypes200ResponseInnerAlerts object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRuleTypes200ResponseInnerAlerts() *GetRuleTypes200ResponseInnerAlerts { + this := GetRuleTypes200ResponseInnerAlerts{} + var useLegacyAlerts bool = false + this.UseLegacyAlerts = &useLegacyAlerts + return &this +} + +// NewGetRuleTypes200ResponseInnerAlertsWithDefaults instantiates a new GetRuleTypes200ResponseInnerAlerts object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRuleTypes200ResponseInnerAlertsWithDefaults() *GetRuleTypes200ResponseInnerAlerts { + this := GetRuleTypes200ResponseInnerAlerts{} + var useLegacyAlerts bool = false + this.UseLegacyAlerts = &useLegacyAlerts + return &this +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetContext() string { + if o == nil || IsNil(o.Context) { + var ret string + return ret + } + return *o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetContextOk() (*string, bool) { + if o == nil || IsNil(o.Context) { + return nil, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given string and assigns it to the Context field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetContext(v string) { + o.Context = &v +} + +// GetDynamic returns the Dynamic field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetDynamic() string { + if o == nil || IsNil(o.Dynamic) { + var ret string + return ret + } + return *o.Dynamic +} + +// GetDynamicOk returns a tuple with the Dynamic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetDynamicOk() (*string, bool) { + if o == nil || IsNil(o.Dynamic) { + return nil, false + } + return o.Dynamic, true +} + +// HasDynamic returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasDynamic() bool { + if o != nil && !IsNil(o.Dynamic) { + return true + } + + return false +} + +// SetDynamic gets a reference to the given string and assigns it to the Dynamic field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetDynamic(v string) { + o.Dynamic = &v +} + +// GetIsSpaceAware returns the IsSpaceAware field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetIsSpaceAware() bool { + if o == nil || IsNil(o.IsSpaceAware) { + var ret bool + return ret + } + return *o.IsSpaceAware +} + +// GetIsSpaceAwareOk returns a tuple with the IsSpaceAware field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetIsSpaceAwareOk() (*bool, bool) { + if o == nil || IsNil(o.IsSpaceAware) { + return nil, false + } + return o.IsSpaceAware, true +} + +// HasIsSpaceAware returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasIsSpaceAware() bool { + if o != nil && !IsNil(o.IsSpaceAware) { + return true + } + + return false +} + +// SetIsSpaceAware gets a reference to the given bool and assigns it to the IsSpaceAware field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetIsSpaceAware(v bool) { + o.IsSpaceAware = &v +} + +// GetMappings returns the Mappings field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetMappings() GetRuleTypes200ResponseInnerAlertsMappings { + if o == nil || IsNil(o.Mappings) { + var ret GetRuleTypes200ResponseInnerAlertsMappings + return ret + } + return *o.Mappings +} + +// GetMappingsOk returns a tuple with the Mappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetMappingsOk() (*GetRuleTypes200ResponseInnerAlertsMappings, bool) { + if o == nil || IsNil(o.Mappings) { + return nil, false + } + return o.Mappings, true +} + +// HasMappings returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasMappings() bool { + if o != nil && !IsNil(o.Mappings) { + return true + } + + return false +} + +// SetMappings gets a reference to the given GetRuleTypes200ResponseInnerAlertsMappings and assigns it to the Mappings field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetMappings(v GetRuleTypes200ResponseInnerAlertsMappings) { + o.Mappings = &v +} + +// GetSecondaryAlias returns the SecondaryAlias field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetSecondaryAlias() string { + if o == nil || IsNil(o.SecondaryAlias) { + var ret string + return ret + } + return *o.SecondaryAlias +} + +// GetSecondaryAliasOk returns a tuple with the SecondaryAlias field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetSecondaryAliasOk() (*string, bool) { + if o == nil || IsNil(o.SecondaryAlias) { + return nil, false + } + return o.SecondaryAlias, true +} + +// HasSecondaryAlias returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasSecondaryAlias() bool { + if o != nil && !IsNil(o.SecondaryAlias) { + return true + } + + return false +} + +// SetSecondaryAlias gets a reference to the given string and assigns it to the SecondaryAlias field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetSecondaryAlias(v string) { + o.SecondaryAlias = &v +} + +// GetShouldWrite returns the ShouldWrite field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetShouldWrite() bool { + if o == nil || IsNil(o.ShouldWrite) { + var ret bool + return ret + } + return *o.ShouldWrite +} + +// GetShouldWriteOk returns a tuple with the ShouldWrite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetShouldWriteOk() (*bool, bool) { + if o == nil || IsNil(o.ShouldWrite) { + return nil, false + } + return o.ShouldWrite, true +} + +// HasShouldWrite returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasShouldWrite() bool { + if o != nil && !IsNil(o.ShouldWrite) { + return true + } + + return false +} + +// SetShouldWrite gets a reference to the given bool and assigns it to the ShouldWrite field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetShouldWrite(v bool) { + o.ShouldWrite = &v +} + +// GetUseEcs returns the UseEcs field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetUseEcs() bool { + if o == nil || IsNil(o.UseEcs) { + var ret bool + return ret + } + return *o.UseEcs +} + +// GetUseEcsOk returns a tuple with the UseEcs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetUseEcsOk() (*bool, bool) { + if o == nil || IsNil(o.UseEcs) { + return nil, false + } + return o.UseEcs, true +} + +// HasUseEcs returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasUseEcs() bool { + if o != nil && !IsNil(o.UseEcs) { + return true + } + + return false +} + +// SetUseEcs gets a reference to the given bool and assigns it to the UseEcs field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetUseEcs(v bool) { + o.UseEcs = &v +} + +// GetUseLegacyAlerts returns the UseLegacyAlerts field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAlerts) GetUseLegacyAlerts() bool { + if o == nil || IsNil(o.UseLegacyAlerts) { + var ret bool + return ret + } + return *o.UseLegacyAlerts +} + +// GetUseLegacyAlertsOk returns a tuple with the UseLegacyAlerts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) GetUseLegacyAlertsOk() (*bool, bool) { + if o == nil || IsNil(o.UseLegacyAlerts) { + return nil, false + } + return o.UseLegacyAlerts, true +} + +// HasUseLegacyAlerts returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlerts) HasUseLegacyAlerts() bool { + if o != nil && !IsNil(o.UseLegacyAlerts) { + return true + } + + return false +} + +// SetUseLegacyAlerts gets a reference to the given bool and assigns it to the UseLegacyAlerts field. +func (o *GetRuleTypes200ResponseInnerAlerts) SetUseLegacyAlerts(v bool) { + o.UseLegacyAlerts = &v +} + +func (o GetRuleTypes200ResponseInnerAlerts) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRuleTypes200ResponseInnerAlerts) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if !IsNil(o.Dynamic) { + toSerialize["dynamic"] = o.Dynamic + } + if !IsNil(o.IsSpaceAware) { + toSerialize["isSpaceAware"] = o.IsSpaceAware + } + if !IsNil(o.Mappings) { + toSerialize["mappings"] = o.Mappings + } + if !IsNil(o.SecondaryAlias) { + toSerialize["secondaryAlias"] = o.SecondaryAlias + } + if !IsNil(o.ShouldWrite) { + toSerialize["shouldWrite"] = o.ShouldWrite + } + if !IsNil(o.UseEcs) { + toSerialize["useEcs"] = o.UseEcs + } + if !IsNil(o.UseLegacyAlerts) { + toSerialize["useLegacyAlerts"] = o.UseLegacyAlerts + } + return toSerialize, nil +} + +type NullableGetRuleTypes200ResponseInnerAlerts struct { + value *GetRuleTypes200ResponseInnerAlerts + isSet bool +} + +func (v NullableGetRuleTypes200ResponseInnerAlerts) Get() *GetRuleTypes200ResponseInnerAlerts { + return v.value +} + +func (v *NullableGetRuleTypes200ResponseInnerAlerts) Set(val *GetRuleTypes200ResponseInnerAlerts) { + v.value = val + v.isSet = true +} + +func (v NullableGetRuleTypes200ResponseInnerAlerts) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRuleTypes200ResponseInnerAlerts) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRuleTypes200ResponseInnerAlerts(val *GetRuleTypes200ResponseInnerAlerts) *NullableGetRuleTypes200ResponseInnerAlerts { + return &NullableGetRuleTypes200ResponseInnerAlerts{value: val, isSet: true} +} + +func (v NullableGetRuleTypes200ResponseInnerAlerts) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRuleTypes200ResponseInnerAlerts) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_get_rule_types_200_response_inner_alerts_mappings.go b/generated/alerting/model_get_rule_types_200_response_inner_alerts_mappings.go new file mode 100644 index 000000000..a88253f92 --- /dev/null +++ b/generated/alerting/model_get_rule_types_200_response_inner_alerts_mappings.go @@ -0,0 +1,126 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the GetRuleTypes200ResponseInnerAlertsMappings type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRuleTypes200ResponseInnerAlertsMappings{} + +// GetRuleTypes200ResponseInnerAlertsMappings struct for GetRuleTypes200ResponseInnerAlertsMappings +type GetRuleTypes200ResponseInnerAlertsMappings struct { + // Mapping information for each field supported in alerts as data documents for this rule type. For more information about mapping parameters, refer to the Elasticsearch documentation. + FieldMap map[string]FieldmapProperties `json:"fieldMap,omitempty"` +} + +// NewGetRuleTypes200ResponseInnerAlertsMappings instantiates a new GetRuleTypes200ResponseInnerAlertsMappings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRuleTypes200ResponseInnerAlertsMappings() *GetRuleTypes200ResponseInnerAlertsMappings { + this := GetRuleTypes200ResponseInnerAlertsMappings{} + return &this +} + +// NewGetRuleTypes200ResponseInnerAlertsMappingsWithDefaults instantiates a new GetRuleTypes200ResponseInnerAlertsMappings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRuleTypes200ResponseInnerAlertsMappingsWithDefaults() *GetRuleTypes200ResponseInnerAlertsMappings { + this := GetRuleTypes200ResponseInnerAlertsMappings{} + return &this +} + +// GetFieldMap returns the FieldMap field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetRuleTypes200ResponseInnerAlertsMappings) GetFieldMap() map[string]FieldmapProperties { + if o == nil { + var ret map[string]FieldmapProperties + return ret + } + return o.FieldMap +} + +// GetFieldMapOk returns a tuple with the FieldMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetRuleTypes200ResponseInnerAlertsMappings) GetFieldMapOk() (*map[string]FieldmapProperties, bool) { + if o == nil || IsNil(o.FieldMap) { + return nil, false + } + return &o.FieldMap, true +} + +// HasFieldMap returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAlertsMappings) HasFieldMap() bool { + if o != nil && IsNil(o.FieldMap) { + return true + } + + return false +} + +// SetFieldMap gets a reference to the given map[string]FieldmapProperties and assigns it to the FieldMap field. +func (o *GetRuleTypes200ResponseInnerAlertsMappings) SetFieldMap(v map[string]FieldmapProperties) { + o.FieldMap = v +} + +func (o GetRuleTypes200ResponseInnerAlertsMappings) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRuleTypes200ResponseInnerAlertsMappings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.FieldMap != nil { + toSerialize["fieldMap"] = o.FieldMap + } + return toSerialize, nil +} + +type NullableGetRuleTypes200ResponseInnerAlertsMappings struct { + value *GetRuleTypes200ResponseInnerAlertsMappings + isSet bool +} + +func (v NullableGetRuleTypes200ResponseInnerAlertsMappings) Get() *GetRuleTypes200ResponseInnerAlertsMappings { + return v.value +} + +func (v *NullableGetRuleTypes200ResponseInnerAlertsMappings) Set(val *GetRuleTypes200ResponseInnerAlertsMappings) { + v.value = val + v.isSet = true +} + +func (v NullableGetRuleTypes200ResponseInnerAlertsMappings) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRuleTypes200ResponseInnerAlertsMappings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRuleTypes200ResponseInnerAlertsMappings(val *GetRuleTypes200ResponseInnerAlertsMappings) *NullableGetRuleTypes200ResponseInnerAlertsMappings { + return &NullableGetRuleTypes200ResponseInnerAlertsMappings{value: val, isSet: true} +} + +func (v NullableGetRuleTypes200ResponseInnerAlertsMappings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRuleTypes200ResponseInnerAlertsMappings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers.go b/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers.go index 21f8675a4..b10c72a8b 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -27,6 +27,7 @@ type GetRuleTypes200ResponseInnerAuthorizedConsumers struct { Ml *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"ml,omitempty"` Monitoring *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"monitoring,omitempty"` Siem *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"siem,omitempty"` + Slo *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"slo,omitempty"` StackAlerts *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"stackAlerts,omitempty"` Uptime *GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts `json:"uptime,omitempty"` } @@ -304,6 +305,38 @@ func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) SetSiem(v GetRuleTypes o.Siem = &v } +// GetSlo returns the Slo field value if set, zero value otherwise. +func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetSlo() GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts { + if o == nil || IsNil(o.Slo) { + var ret GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts + return ret + } + return *o.Slo +} + +// GetSloOk returns a tuple with the Slo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetSloOk() (*GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts, bool) { + if o == nil || IsNil(o.Slo) { + return nil, false + } + return o.Slo, true +} + +// HasSlo returns a boolean if a field has been set. +func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) HasSlo() bool { + if o != nil && !IsNil(o.Slo) { + return true + } + + return false +} + +// SetSlo gets a reference to the given GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts and assigns it to the Slo field. +func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) SetSlo(v GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts) { + o.Slo = &v +} + // GetStackAlerts returns the StackAlerts field value if set, zero value otherwise. func (o *GetRuleTypes200ResponseInnerAuthorizedConsumers) GetStackAlerts() GetRuleTypes200ResponseInnerAuthorizedConsumersAlerts { if o == nil || IsNil(o.StackAlerts) { @@ -402,6 +435,9 @@ func (o GetRuleTypes200ResponseInnerAuthorizedConsumers) ToMap() (map[string]int if !IsNil(o.Siem) { toSerialize["siem"] = o.Siem } + if !IsNil(o.Slo) { + toSerialize["slo"] = o.Slo + } if !IsNil(o.StackAlerts) { toSerialize["stackAlerts"] = o.StackAlerts } diff --git a/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers_alerts.go b/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers_alerts.go index 58d382e84..560f41194 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers_alerts.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_authorized_consumers_alerts.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_get_rule_types_200_response_inner_recovery_action_group.go b/generated/alerting/model_get_rule_types_200_response_inner_recovery_action_group.go index 53e9243bb..f68eb4428 100644 --- a/generated/alerting/model_get_rule_types_200_response_inner_recovery_action_group.go +++ b/generated/alerting/model_get_rule_types_200_response_inner_recovery_action_group.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ var _ MappedNullable = &GetRuleTypes200ResponseInnerRecoveryActionGroup{} // GetRuleTypes200ResponseInnerRecoveryActionGroup An action group to use when an alert goes from an active state to an inactive one. type GetRuleTypes200ResponseInnerRecoveryActionGroup struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id NullableString `json:"id,omitempty"` + Name NullableString `json:"name,omitempty"` } // NewGetRuleTypes200ResponseInnerRecoveryActionGroup instantiates a new GetRuleTypes200ResponseInnerRecoveryActionGroup object @@ -40,68 +40,90 @@ func NewGetRuleTypes200ResponseInnerRecoveryActionGroupWithDefaults() *GetRuleTy return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) GetId() string { - if o == nil || IsNil(o.Id) { + if o == nil || IsNil(o.Id.Get()) { var ret string return ret } - return *o.Id + return *o.Id.Get() } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true + return o.Id.Get(), o.Id.IsSet() } // HasId returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && o.Id.IsSet() { return true } return false } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId gets a reference to the given NullableString and assigns it to the Id field. func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetId(v string) { - o.Id = &v + o.Id.Set(&v) } -// GetName returns the Name field value if set, zero value otherwise. +// SetIdNil sets the value for Id to be an explicit nil +func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) UnsetId() { + o.Id.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil || IsNil(o.Name.Get()) { var ret string return ret } - return *o.Name + return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && o.Name.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetName(v string) { - o.Name = &v + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *GetRuleTypes200ResponseInnerRecoveryActionGroup) UnsetName() { + o.Name.Unset() } func (o GetRuleTypes200ResponseInnerRecoveryActionGroup) MarshalJSON() ([]byte, error) { @@ -114,11 +136,11 @@ func (o GetRuleTypes200ResponseInnerRecoveryActionGroup) MarshalJSON() ([]byte, func (o GetRuleTypes200ResponseInnerRecoveryActionGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() } return toSerialize, nil } diff --git a/generated/alerting/model_legacy_create_alert_request_properties.go b/generated/alerting/model_legacy_create_alert_request_properties.go index df02db423..abbe2897f 100644 --- a/generated/alerting/model_legacy_create_alert_request_properties.go +++ b/generated/alerting/model_legacy_create_alert_request_properties.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -32,9 +32,8 @@ type LegacyCreateAlertRequestProperties struct { NotifyWhen string `json:"notifyWhen"` // The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. Params map[string]interface{} `json:"params"` - Schedule LegacyCreateAlertRequestPropertiesSchedule `json:"schedule"` - // A list of keywords to reference and search. - Tags []string `json:"tags,omitempty"` + Schedule LegacyUpdateAlertRequestPropertiesSchedule `json:"schedule"` + Tags []string `json:"tags,omitempty"` // How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period. Throttle *string `json:"throttle,omitempty"` } @@ -43,7 +42,7 @@ type LegacyCreateAlertRequestProperties struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewLegacyCreateAlertRequestProperties(alertTypeId string, consumer string, name string, notifyWhen string, params map[string]interface{}, schedule LegacyCreateAlertRequestPropertiesSchedule) *LegacyCreateAlertRequestProperties { +func NewLegacyCreateAlertRequestProperties(alertTypeId string, consumer string, name string, notifyWhen string, params map[string]interface{}, schedule LegacyUpdateAlertRequestPropertiesSchedule) *LegacyCreateAlertRequestProperties { this := LegacyCreateAlertRequestProperties{} this.AlertTypeId = alertTypeId this.Consumer = consumer @@ -247,9 +246,9 @@ func (o *LegacyCreateAlertRequestProperties) SetParams(v map[string]interface{}) } // GetSchedule returns the Schedule field value -func (o *LegacyCreateAlertRequestProperties) GetSchedule() LegacyCreateAlertRequestPropertiesSchedule { +func (o *LegacyCreateAlertRequestProperties) GetSchedule() LegacyUpdateAlertRequestPropertiesSchedule { if o == nil { - var ret LegacyCreateAlertRequestPropertiesSchedule + var ret LegacyUpdateAlertRequestPropertiesSchedule return ret } @@ -258,7 +257,7 @@ func (o *LegacyCreateAlertRequestProperties) GetSchedule() LegacyCreateAlertRequ // GetScheduleOk returns a tuple with the Schedule field value // and a boolean to check if the value has been set. -func (o *LegacyCreateAlertRequestProperties) GetScheduleOk() (*LegacyCreateAlertRequestPropertiesSchedule, bool) { +func (o *LegacyCreateAlertRequestProperties) GetScheduleOk() (*LegacyUpdateAlertRequestPropertiesSchedule, bool) { if o == nil { return nil, false } @@ -266,7 +265,7 @@ func (o *LegacyCreateAlertRequestProperties) GetScheduleOk() (*LegacyCreateAlert } // SetSchedule sets field value -func (o *LegacyCreateAlertRequestProperties) SetSchedule(v LegacyCreateAlertRequestPropertiesSchedule) { +func (o *LegacyCreateAlertRequestProperties) SetSchedule(v LegacyUpdateAlertRequestPropertiesSchedule) { o.Schedule = v } diff --git a/generated/alerting/model_legacy_find_alerts_200_response.go b/generated/alerting/model_legacy_find_alerts_200_response.go index 25ba62714..deb744cf3 100644 --- a/generated/alerting/model_legacy_find_alerts_200_response.go +++ b/generated/alerting/model_legacy_find_alerts_200_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_find_alerts_has_reference_parameter.go b/generated/alerting/model_legacy_find_alerts_has_reference_parameter.go new file mode 100644 index 000000000..8f52bc6c5 --- /dev/null +++ b/generated/alerting/model_legacy_find_alerts_has_reference_parameter.go @@ -0,0 +1,160 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the LegacyFindAlertsHasReferenceParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LegacyFindAlertsHasReferenceParameter{} + +// LegacyFindAlertsHasReferenceParameter struct for LegacyFindAlertsHasReferenceParameter +type LegacyFindAlertsHasReferenceParameter struct { + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` +} + +// NewLegacyFindAlertsHasReferenceParameter instantiates a new LegacyFindAlertsHasReferenceParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLegacyFindAlertsHasReferenceParameter() *LegacyFindAlertsHasReferenceParameter { + this := LegacyFindAlertsHasReferenceParameter{} + return &this +} + +// NewLegacyFindAlertsHasReferenceParameterWithDefaults instantiates a new LegacyFindAlertsHasReferenceParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLegacyFindAlertsHasReferenceParameterWithDefaults() *LegacyFindAlertsHasReferenceParameter { + this := LegacyFindAlertsHasReferenceParameter{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LegacyFindAlertsHasReferenceParameter) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegacyFindAlertsHasReferenceParameter) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LegacyFindAlertsHasReferenceParameter) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LegacyFindAlertsHasReferenceParameter) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LegacyFindAlertsHasReferenceParameter) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegacyFindAlertsHasReferenceParameter) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LegacyFindAlertsHasReferenceParameter) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LegacyFindAlertsHasReferenceParameter) SetType(v string) { + o.Type = &v +} + +func (o LegacyFindAlertsHasReferenceParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LegacyFindAlertsHasReferenceParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableLegacyFindAlertsHasReferenceParameter struct { + value *LegacyFindAlertsHasReferenceParameter + isSet bool +} + +func (v NullableLegacyFindAlertsHasReferenceParameter) Get() *LegacyFindAlertsHasReferenceParameter { + return v.value +} + +func (v *NullableLegacyFindAlertsHasReferenceParameter) Set(val *LegacyFindAlertsHasReferenceParameter) { + v.value = val + v.isSet = true +} + +func (v NullableLegacyFindAlertsHasReferenceParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableLegacyFindAlertsHasReferenceParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLegacyFindAlertsHasReferenceParameter(val *LegacyFindAlertsHasReferenceParameter) *NullableLegacyFindAlertsHasReferenceParameter { + return &NullableLegacyFindAlertsHasReferenceParameter{value: val, isSet: true} +} + +func (v NullableLegacyFindAlertsHasReferenceParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLegacyFindAlertsHasReferenceParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_legacy_get_alert_types_200_response_inner.go b/generated/alerting/model_legacy_get_alert_types_200_response_inner.go index 4b78046ff..9e215f7a5 100644 --- a/generated/alerting/model_legacy_get_alert_types_200_response_inner.go +++ b/generated/alerting/model_legacy_get_alert_types_200_response_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,8 @@ var _ MappedNullable = &LegacyGetAlertTypes200ResponseInner{} // LegacyGetAlertTypes200ResponseInner struct for LegacyGetAlertTypes200ResponseInner type LegacyGetAlertTypes200ResponseInner struct { - // An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert actions validation uses this configuration to ensure that groups are valid. - ActionGroups []GetRuleTypes200ResponseInnerActionGroupsInner `json:"actionGroups,omitempty"` - ActionVariables *LegacyGetAlertTypes200ResponseInnerActionVariables `json:"actionVariables,omitempty"` + ActionGroups []LegacyGetAlertTypes200ResponseInnerActionGroupsInner `json:"actionGroups,omitempty"` + ActionVariables *LegacyGetAlertTypes200ResponseInnerActionVariables `json:"actionVariables,omitempty"` // The list of the plugins IDs that have access to the alert type. AuthorizedConsumers map[string]interface{} `json:"authorizedConsumers,omitempty"` // The default identifier for the alert type group. @@ -59,9 +58,9 @@ func NewLegacyGetAlertTypes200ResponseInnerWithDefaults() *LegacyGetAlertTypes20 } // GetActionGroups returns the ActionGroups field value if set, zero value otherwise. -func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroups() []GetRuleTypes200ResponseInnerActionGroupsInner { +func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroups() []LegacyGetAlertTypes200ResponseInnerActionGroupsInner { if o == nil || IsNil(o.ActionGroups) { - var ret []GetRuleTypes200ResponseInnerActionGroupsInner + var ret []LegacyGetAlertTypes200ResponseInnerActionGroupsInner return ret } return o.ActionGroups @@ -69,7 +68,7 @@ func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroups() []GetRuleTypes20 // GetActionGroupsOk returns a tuple with the ActionGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroupsOk() ([]GetRuleTypes200ResponseInnerActionGroupsInner, bool) { +func (o *LegacyGetAlertTypes200ResponseInner) GetActionGroupsOk() ([]LegacyGetAlertTypes200ResponseInnerActionGroupsInner, bool) { if o == nil || IsNil(o.ActionGroups) { return nil, false } @@ -85,8 +84,8 @@ func (o *LegacyGetAlertTypes200ResponseInner) HasActionGroups() bool { return false } -// SetActionGroups gets a reference to the given []GetRuleTypes200ResponseInnerActionGroupsInner and assigns it to the ActionGroups field. -func (o *LegacyGetAlertTypes200ResponseInner) SetActionGroups(v []GetRuleTypes200ResponseInnerActionGroupsInner) { +// SetActionGroups gets a reference to the given []LegacyGetAlertTypes200ResponseInnerActionGroupsInner and assigns it to the ActionGroups field. +func (o *LegacyGetAlertTypes200ResponseInner) SetActionGroups(v []LegacyGetAlertTypes200ResponseInnerActionGroupsInner) { o.ActionGroups = v } diff --git a/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_groups_inner.go b/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_groups_inner.go new file mode 100644 index 000000000..4868d427b --- /dev/null +++ b/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_groups_inner.go @@ -0,0 +1,160 @@ +/* +Alerting + +OpenAPI schema for alerting endpoints + +API version: 0.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package alerting + +import ( + "encoding/json" +) + +// checks if the LegacyGetAlertTypes200ResponseInnerActionGroupsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LegacyGetAlertTypes200ResponseInnerActionGroupsInner{} + +// LegacyGetAlertTypes200ResponseInnerActionGroupsInner struct for LegacyGetAlertTypes200ResponseInnerActionGroupsInner +type LegacyGetAlertTypes200ResponseInnerActionGroupsInner struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewLegacyGetAlertTypes200ResponseInnerActionGroupsInner instantiates a new LegacyGetAlertTypes200ResponseInnerActionGroupsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLegacyGetAlertTypes200ResponseInnerActionGroupsInner() *LegacyGetAlertTypes200ResponseInnerActionGroupsInner { + this := LegacyGetAlertTypes200ResponseInnerActionGroupsInner{} + return &this +} + +// NewLegacyGetAlertTypes200ResponseInnerActionGroupsInnerWithDefaults instantiates a new LegacyGetAlertTypes200ResponseInnerActionGroupsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLegacyGetAlertTypes200ResponseInnerActionGroupsInnerWithDefaults() *LegacyGetAlertTypes200ResponseInnerActionGroupsInner { + this := LegacyGetAlertTypes200ResponseInnerActionGroupsInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) SetName(v string) { + o.Name = &v +} + +func (o LegacyGetAlertTypes200ResponseInnerActionGroupsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LegacyGetAlertTypes200ResponseInnerActionGroupsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner struct { + value *LegacyGetAlertTypes200ResponseInnerActionGroupsInner + isSet bool +} + +func (v NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) Get() *LegacyGetAlertTypes200ResponseInnerActionGroupsInner { + return v.value +} + +func (v *NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) Set(val *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) { + v.value = val + v.isSet = true +} + +func (v NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner(val *LegacyGetAlertTypes200ResponseInnerActionGroupsInner) *NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner { + return &NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner{value: val, isSet: true} +} + +func (v NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLegacyGetAlertTypes200ResponseInnerActionGroupsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_variables.go b/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_variables.go index b6d12648c..34049df19 100644 --- a/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_variables.go +++ b/generated/alerting/model_legacy_get_alert_types_200_response_inner_action_variables.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ var _ MappedNullable = &LegacyGetAlertTypes200ResponseInnerActionVariables{} // LegacyGetAlertTypes200ResponseInnerActionVariables A list of action variables that the alert type makes available via context and state in action parameter templates, and a short human readable description. The Alert UI will use this information to prompt users for these variables in action parameter editors. type LegacyGetAlertTypes200ResponseInnerActionVariables struct { - Context []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner `json:"context,omitempty"` - Params []GetRuleTypes200ResponseInnerActionVariablesParamsInner `json:"params,omitempty"` - State []GetRuleTypes200ResponseInnerActionVariablesParamsInner `json:"state,omitempty"` + Context []GetRuleTypes200ResponseInnerActionVariablesStateInner `json:"context,omitempty"` + Params interface{} `json:"params,omitempty"` + State interface{} `json:"state,omitempty"` } // NewLegacyGetAlertTypes200ResponseInnerActionVariables instantiates a new LegacyGetAlertTypes200ResponseInnerActionVariables object @@ -42,9 +42,9 @@ func NewLegacyGetAlertTypes200ResponseInnerActionVariablesWithDefaults() *Legacy } // GetContext returns the Context field value if set, zero value otherwise. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContext() []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner { +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContext() []GetRuleTypes200ResponseInnerActionVariablesStateInner { if o == nil || IsNil(o.Context) { - var ret []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner + var ret []GetRuleTypes200ResponseInnerActionVariablesStateInner return ret } return o.Context @@ -52,7 +52,7 @@ func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContext() []Lega // GetContextOk returns a tuple with the Context field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContextOk() ([]LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner, bool) { +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetContextOk() ([]GetRuleTypes200ResponseInnerActionVariablesStateInner, bool) { if o == nil || IsNil(o.Context) { return nil, false } @@ -68,15 +68,15 @@ func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) HasContext() bool { return false } -// SetContext gets a reference to the given []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner and assigns it to the Context field. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetContext(v []LegacyGetAlertTypes200ResponseInnerActionVariablesContextInner) { +// SetContext gets a reference to the given []GetRuleTypes200ResponseInnerActionVariablesStateInner and assigns it to the Context field. +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetContext(v []GetRuleTypes200ResponseInnerActionVariablesStateInner) { o.Context = v } -// GetParams returns the Params field value if set, zero value otherwise. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParams() []GetRuleTypes200ResponseInnerActionVariablesParamsInner { - if o == nil || IsNil(o.Params) { - var ret []GetRuleTypes200ResponseInnerActionVariablesParamsInner +// GetParams returns the Params field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParams() interface{} { + if o == nil { + var ret interface{} return ret } return o.Params @@ -84,31 +84,32 @@ func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParams() []GetRu // GetParamsOk returns a tuple with the Params field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParamsOk() ([]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool) { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetParamsOk() (*interface{}, bool) { if o == nil || IsNil(o.Params) { return nil, false } - return o.Params, true + return &o.Params, true } // HasParams returns a boolean if a field has been set. func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) HasParams() bool { - if o != nil && !IsNil(o.Params) { + if o != nil && IsNil(o.Params) { return true } return false } -// SetParams gets a reference to the given []GetRuleTypes200ResponseInnerActionVariablesParamsInner and assigns it to the Params field. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetParams(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner) { +// SetParams gets a reference to the given interface{} and assigns it to the Params field. +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetParams(v interface{}) { o.Params = v } -// GetState returns the State field value if set, zero value otherwise. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetState() []GetRuleTypes200ResponseInnerActionVariablesParamsInner { - if o == nil || IsNil(o.State) { - var ret []GetRuleTypes200ResponseInnerActionVariablesParamsInner +// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetState() interface{} { + if o == nil { + var ret interface{} return ret } return o.State @@ -116,24 +117,25 @@ func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetState() []GetRul // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetStateOk() ([]GetRuleTypes200ResponseInnerActionVariablesParamsInner, bool) { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) GetStateOk() (*interface{}, bool) { if o == nil || IsNil(o.State) { return nil, false } - return o.State, true + return &o.State, true } // HasState returns a boolean if a field has been set. func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) HasState() bool { - if o != nil && !IsNil(o.State) { + if o != nil && IsNil(o.State) { return true } return false } -// SetState gets a reference to the given []GetRuleTypes200ResponseInnerActionVariablesParamsInner and assigns it to the State field. -func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetState(v []GetRuleTypes200ResponseInnerActionVariablesParamsInner) { +// SetState gets a reference to the given interface{} and assigns it to the State field. +func (o *LegacyGetAlertTypes200ResponseInnerActionVariables) SetState(v interface{}) { o.State = v } @@ -150,10 +152,10 @@ func (o LegacyGetAlertTypes200ResponseInnerActionVariables) ToMap() (map[string] if !IsNil(o.Context) { toSerialize["context"] = o.Context } - if !IsNil(o.Params) { + if o.Params != nil { toSerialize["params"] = o.Params } - if !IsNil(o.State) { + if o.State != nil { toSerialize["state"] = o.State } return toSerialize, nil diff --git a/generated/alerting/model_legacy_get_alert_types_200_response_inner_recovery_action_group.go b/generated/alerting/model_legacy_get_alert_types_200_response_inner_recovery_action_group.go index 7e975bd80..68e1914d7 100644 --- a/generated/alerting/model_legacy_get_alert_types_200_response_inner_recovery_action_group.go +++ b/generated/alerting/model_legacy_get_alert_types_200_response_inner_recovery_action_group.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,8 +19,8 @@ var _ MappedNullable = &LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup{} // LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup An action group to use when an alert instance goes from an active state to an inactive one. If it is not specified, the default recovered action group is used. type LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id NullableString `json:"id,omitempty"` + Name NullableString `json:"name,omitempty"` } // NewLegacyGetAlertTypes200ResponseInnerRecoveryActionGroup instantiates a new LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup object @@ -40,68 +40,90 @@ func NewLegacyGetAlertTypes200ResponseInnerRecoveryActionGroupWithDefaults() *Le return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) GetId() string { - if o == nil || IsNil(o.Id) { + if o == nil || IsNil(o.Id.Get()) { var ret string return ret } - return *o.Id + return *o.Id.Get() } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true + return o.Id.Get(), o.Id.IsSet() } // HasId returns a boolean if a field has been set. func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && o.Id.IsSet() { return true } return false } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId gets a reference to the given NullableString and assigns it to the Id field. func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetId(v string) { - o.Id = &v + o.Id.Set(&v) } -// GetName returns the Name field value if set, zero value otherwise. +// SetIdNil sets the value for Id to be an explicit nil +func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil +func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) UnsetId() { + o.Id.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil || IsNil(o.Name.Get()) { var ret string return ret } - return *o.Name + return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && o.Name.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetName(v string) { - o.Name = &v + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) UnsetName() { + o.Name.Unset() } func (o LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) MarshalJSON() ([]byte, error) { @@ -114,11 +136,11 @@ func (o LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) MarshalJSON() ([ func (o LegacyGetAlertTypes200ResponseInnerRecoveryActionGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() } return toSerialize, nil } diff --git a/generated/alerting/model_legacy_get_alerting_health_200_response.go b/generated/alerting/model_legacy_get_alerting_health_200_response.go index 46a942c95..260329f68 100644 --- a/generated/alerting/model_legacy_get_alerting_health_200_response.go +++ b/generated/alerting/model_legacy_get_alerting_health_200_response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health.go b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health.go index 536ee4749..a7be69086 100644 --- a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health.go +++ b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_decryption_health.go b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_decryption_health.go index ee845db72..08e5f5bc1 100644 --- a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_decryption_health.go +++ b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_decryption_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_execution_health.go b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_execution_health.go index 4037079f0..daf97dfe4 100644 --- a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_execution_health.go +++ b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_execution_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_read_health.go b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_read_health.go index fce0a4f10..52d3237e9 100644 --- a/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_read_health.go +++ b/generated/alerting/model_legacy_get_alerting_health_200_response_alerting_framework_health_read_health.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_update_alert_request_properties.go b/generated/alerting/model_legacy_update_alert_request_properties.go index 52c0cc513..627011b3e 100644 --- a/generated/alerting/model_legacy_update_alert_request_properties.go +++ b/generated/alerting/model_legacy_update_alert_request_properties.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -27,8 +27,7 @@ type LegacyUpdateAlertRequestProperties struct { // The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. Params map[string]interface{} `json:"params"` Schedule LegacyUpdateAlertRequestPropertiesSchedule `json:"schedule"` - // A list of keywords to reference and search. - Tags []string `json:"tags,omitempty"` + Tags []*string `json:"tags,omitempty"` // How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period. Throttle *string `json:"throttle,omitempty"` } @@ -183,9 +182,9 @@ func (o *LegacyUpdateAlertRequestProperties) SetSchedule(v LegacyUpdateAlertRequ } // GetTags returns the Tags field value if set, zero value otherwise. -func (o *LegacyUpdateAlertRequestProperties) GetTags() []string { +func (o *LegacyUpdateAlertRequestProperties) GetTags() []*string { if o == nil || IsNil(o.Tags) { - var ret []string + var ret []*string return ret } return o.Tags @@ -193,7 +192,7 @@ func (o *LegacyUpdateAlertRequestProperties) GetTags() []string { // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LegacyUpdateAlertRequestProperties) GetTagsOk() ([]string, bool) { +func (o *LegacyUpdateAlertRequestProperties) GetTagsOk() ([]*string, bool) { if o == nil || IsNil(o.Tags) { return nil, false } @@ -209,8 +208,8 @@ func (o *LegacyUpdateAlertRequestProperties) HasTags() bool { return false } -// SetTags gets a reference to the given []string and assigns it to the Tags field. -func (o *LegacyUpdateAlertRequestProperties) SetTags(v []string) { +// SetTags gets a reference to the given []*string and assigns it to the Tags field. +func (o *LegacyUpdateAlertRequestProperties) SetTags(v []*string) { o.Tags = v } diff --git a/generated/alerting/model_legacy_update_alert_request_properties_actions_inner.go b/generated/alerting/model_legacy_update_alert_request_properties_actions_inner.go index d7395b789..e3fdd7888 100644 --- a/generated/alerting/model_legacy_update_alert_request_properties_actions_inner.go +++ b/generated/alerting/model_legacy_update_alert_request_properties_actions_inner.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_legacy_update_alert_request_properties_schedule.go b/generated/alerting/model_legacy_update_alert_request_properties_schedule.go index 15d1b6fb6..f41e8f36b 100644 --- a/generated/alerting/model_legacy_update_alert_request_properties_schedule.go +++ b/generated/alerting/model_legacy_update_alert_request_properties_schedule.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_notify_when.go b/generated/alerting/model_notify_when.go index 87d1b5b9f..054b38e45 100644 --- a/generated/alerting/model_notify_when.go +++ b/generated/alerting/model_notify_when.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,7 +15,7 @@ import ( "fmt" ) -// NotifyWhen Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. +// NotifyWhen Deprecated in 8.13.0. Use the `notify_when` property in the action `frequency` object instead. Indicates how often alerts generate actions. NOTE: You cannot specify `notify_when` at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. type NotifyWhen string // List of notify_when diff --git a/generated/alerting/model_rule_response_properties.go b/generated/alerting/model_rule_response_properties.go index 5c5a40603..ec65cf966 100644 --- a/generated/alerting/model_rule_response_properties.go +++ b/generated/alerting/model_rule_response_properties.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,11 @@ var _ MappedNullable = &RuleResponseProperties{} // RuleResponseProperties struct for RuleResponseProperties type RuleResponseProperties struct { - Actions []ActionsInner `json:"actions"` + Actions []ActionsInner `json:"actions"` + AlertDelay *AlertDelay `json:"alert_delay,omitempty"` + // Indicates whether the API key that is associated with the rule was created by the user. + ApiKeyCreatedByUser *bool `json:"api_key_created_by_user,omitempty"` + // The owner of the API key that is associated with the rule and used to run background tasks. ApiKeyOwner NullableString `json:"api_key_owner"` // The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. Consumer string `json:"consumer"` @@ -37,20 +41,23 @@ type RuleResponseProperties struct { MutedAlertIds []string `json:"muted_alert_ids"` MuteAll bool `json:"mute_all"` // The name of the rule. - Name string `json:"name"` - NextRun NullableTime `json:"next_run,omitempty"` - NotifyWhen *NotifyWhen `json:"notify_when,omitempty"` + Name string `json:"name"` + NextRun NullableTime `json:"next_run,omitempty"` + // Indicates how often alerts generate actions. + NotifyWhen NullableString `json:"notify_when,omitempty"` // The parameters for the rule. Params map[string]interface{} `json:"params"` + // The rule revision number. + Revision *int32 `json:"revision,omitempty"` // The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. RuleTypeId string `json:"rule_type_id"` // Indicates whether the rule is running. Running *bool `json:"running,omitempty"` Schedule Schedule `json:"schedule"` ScheduledTaskId *string `json:"scheduled_task_id,omitempty"` - // The tags for the rule. - Tags []string `json:"tags"` - // The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. + Tags []string `json:"tags"` + // Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + // Deprecated Throttle NullableString `json:"throttle"` // The date and time that the rule was updated most recently. UpdatedAt string `json:"updated_at"` @@ -94,7 +101,6 @@ func NewRuleResponsePropertiesWithDefaults() *RuleResponseProperties { } // GetActions returns the Actions field value -// If the value is explicit nil, the zero value for []ActionsInner will be returned func (o *RuleResponseProperties) GetActions() []ActionsInner { if o == nil { var ret []ActionsInner @@ -106,9 +112,8 @@ func (o *RuleResponseProperties) GetActions() []ActionsInner { // GetActionsOk returns a tuple with the Actions field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RuleResponseProperties) GetActionsOk() ([]ActionsInner, bool) { - if o == nil || IsNil(o.Actions) { + if o == nil { return nil, false } return o.Actions, true @@ -119,6 +124,70 @@ func (o *RuleResponseProperties) SetActions(v []ActionsInner) { o.Actions = v } +// GetAlertDelay returns the AlertDelay field value if set, zero value otherwise. +func (o *RuleResponseProperties) GetAlertDelay() AlertDelay { + if o == nil || IsNil(o.AlertDelay) { + var ret AlertDelay + return ret + } + return *o.AlertDelay +} + +// GetAlertDelayOk returns a tuple with the AlertDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleResponseProperties) GetAlertDelayOk() (*AlertDelay, bool) { + if o == nil || IsNil(o.AlertDelay) { + return nil, false + } + return o.AlertDelay, true +} + +// HasAlertDelay returns a boolean if a field has been set. +func (o *RuleResponseProperties) HasAlertDelay() bool { + if o != nil && !IsNil(o.AlertDelay) { + return true + } + + return false +} + +// SetAlertDelay gets a reference to the given AlertDelay and assigns it to the AlertDelay field. +func (o *RuleResponseProperties) SetAlertDelay(v AlertDelay) { + o.AlertDelay = &v +} + +// GetApiKeyCreatedByUser returns the ApiKeyCreatedByUser field value if set, zero value otherwise. +func (o *RuleResponseProperties) GetApiKeyCreatedByUser() bool { + if o == nil || IsNil(o.ApiKeyCreatedByUser) { + var ret bool + return ret + } + return *o.ApiKeyCreatedByUser +} + +// GetApiKeyCreatedByUserOk returns a tuple with the ApiKeyCreatedByUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleResponseProperties) GetApiKeyCreatedByUserOk() (*bool, bool) { + if o == nil || IsNil(o.ApiKeyCreatedByUser) { + return nil, false + } + return o.ApiKeyCreatedByUser, true +} + +// HasApiKeyCreatedByUser returns a boolean if a field has been set. +func (o *RuleResponseProperties) HasApiKeyCreatedByUser() bool { + if o != nil && !IsNil(o.ApiKeyCreatedByUser) { + return true + } + + return false +} + +// SetApiKeyCreatedByUser gets a reference to the given bool and assigns it to the ApiKeyCreatedByUser field. +func (o *RuleResponseProperties) SetApiKeyCreatedByUser(v bool) { + o.ApiKeyCreatedByUser = &v +} + // GetApiKeyOwner returns the ApiKeyOwner field value // If the value is explicit nil, the zero value for string will be returned func (o *RuleResponseProperties) GetApiKeyOwner() string { @@ -324,7 +393,6 @@ func (o *RuleResponseProperties) SetLastRun(v RuleResponsePropertiesLastRun) { } // GetMutedAlertIds returns the MutedAlertIds field value -// If the value is explicit nil, the zero value for []string will be returned func (o *RuleResponseProperties) GetMutedAlertIds() []string { if o == nil { var ret []string @@ -336,9 +404,8 @@ func (o *RuleResponseProperties) GetMutedAlertIds() []string { // GetMutedAlertIdsOk returns a tuple with the MutedAlertIds field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RuleResponseProperties) GetMutedAlertIdsOk() ([]string, bool) { - if o == nil || IsNil(o.MutedAlertIds) { + if o == nil { return nil, false } return o.MutedAlertIds, true @@ -440,36 +507,47 @@ func (o *RuleResponseProperties) UnsetNextRun() { o.NextRun.Unset() } -// GetNotifyWhen returns the NotifyWhen field value if set, zero value otherwise. -func (o *RuleResponseProperties) GetNotifyWhen() NotifyWhen { - if o == nil || IsNil(o.NotifyWhen) { - var ret NotifyWhen +// GetNotifyWhen returns the NotifyWhen field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RuleResponseProperties) GetNotifyWhen() string { + if o == nil || IsNil(o.NotifyWhen.Get()) { + var ret string return ret } - return *o.NotifyWhen + return *o.NotifyWhen.Get() } // GetNotifyWhenOk returns a tuple with the NotifyWhen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RuleResponseProperties) GetNotifyWhenOk() (*NotifyWhen, bool) { - if o == nil || IsNil(o.NotifyWhen) { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RuleResponseProperties) GetNotifyWhenOk() (*string, bool) { + if o == nil { return nil, false } - return o.NotifyWhen, true + return o.NotifyWhen.Get(), o.NotifyWhen.IsSet() } // HasNotifyWhen returns a boolean if a field has been set. func (o *RuleResponseProperties) HasNotifyWhen() bool { - if o != nil && !IsNil(o.NotifyWhen) { + if o != nil && o.NotifyWhen.IsSet() { return true } return false } -// SetNotifyWhen gets a reference to the given NotifyWhen and assigns it to the NotifyWhen field. -func (o *RuleResponseProperties) SetNotifyWhen(v NotifyWhen) { - o.NotifyWhen = &v +// SetNotifyWhen gets a reference to the given NullableString and assigns it to the NotifyWhen field. +func (o *RuleResponseProperties) SetNotifyWhen(v string) { + o.NotifyWhen.Set(&v) +} + +// SetNotifyWhenNil sets the value for NotifyWhen to be an explicit nil +func (o *RuleResponseProperties) SetNotifyWhenNil() { + o.NotifyWhen.Set(nil) +} + +// UnsetNotifyWhen ensures that no value is present for NotifyWhen, not even an explicit nil +func (o *RuleResponseProperties) UnsetNotifyWhen() { + o.NotifyWhen.Unset() } // GetParams returns the Params field value @@ -496,6 +574,38 @@ func (o *RuleResponseProperties) SetParams(v map[string]interface{}) { o.Params = v } +// GetRevision returns the Revision field value if set, zero value otherwise. +func (o *RuleResponseProperties) GetRevision() int32 { + if o == nil || IsNil(o.Revision) { + var ret int32 + return ret + } + return *o.Revision +} + +// GetRevisionOk returns a tuple with the Revision field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleResponseProperties) GetRevisionOk() (*int32, bool) { + if o == nil || IsNil(o.Revision) { + return nil, false + } + return o.Revision, true +} + +// HasRevision returns a boolean if a field has been set. +func (o *RuleResponseProperties) HasRevision() bool { + if o != nil && !IsNil(o.Revision) { + return true + } + + return false +} + +// SetRevision gets a reference to the given int32 and assigns it to the Revision field. +func (o *RuleResponseProperties) SetRevision(v int32) { + o.Revision = &v +} + // GetRuleTypeId returns the RuleTypeId field value func (o *RuleResponseProperties) GetRuleTypeId() string { if o == nil { @@ -634,6 +744,7 @@ func (o *RuleResponseProperties) SetTags(v []string) { // GetThrottle returns the Throttle field value // If the value is explicit nil, the zero value for string will be returned +// Deprecated func (o *RuleResponseProperties) GetThrottle() string { if o == nil || o.Throttle.Get() == nil { var ret string @@ -646,6 +757,7 @@ func (o *RuleResponseProperties) GetThrottle() string { // GetThrottleOk returns a tuple with the Throttle field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *RuleResponseProperties) GetThrottleOk() (*string, bool) { if o == nil { return nil, false @@ -654,6 +766,7 @@ func (o *RuleResponseProperties) GetThrottleOk() (*string, bool) { } // SetThrottle sets field value +// Deprecated func (o *RuleResponseProperties) SetThrottle(v string) { o.Throttle.Set(&v) } @@ -718,8 +831,12 @@ func (o RuleResponseProperties) MarshalJSON() ([]byte, error) { func (o RuleResponseProperties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Actions != nil { - toSerialize["actions"] = o.Actions + toSerialize["actions"] = o.Actions + if !IsNil(o.AlertDelay) { + toSerialize["alert_delay"] = o.AlertDelay + } + if !IsNil(o.ApiKeyCreatedByUser) { + toSerialize["api_key_created_by_user"] = o.ApiKeyCreatedByUser } toSerialize["api_key_owner"] = o.ApiKeyOwner.Get() toSerialize["consumer"] = o.Consumer @@ -731,18 +848,19 @@ func (o RuleResponseProperties) ToMap() (map[string]interface{}, error) { if !IsNil(o.LastRun) { toSerialize["last_run"] = o.LastRun } - if o.MutedAlertIds != nil { - toSerialize["muted_alert_ids"] = o.MutedAlertIds - } + toSerialize["muted_alert_ids"] = o.MutedAlertIds toSerialize["mute_all"] = o.MuteAll toSerialize["name"] = o.Name if o.NextRun.IsSet() { toSerialize["next_run"] = o.NextRun.Get() } - if !IsNil(o.NotifyWhen) { - toSerialize["notify_when"] = o.NotifyWhen + if o.NotifyWhen.IsSet() { + toSerialize["notify_when"] = o.NotifyWhen.Get() } toSerialize["params"] = o.Params + if !IsNil(o.Revision) { + toSerialize["revision"] = o.Revision + } toSerialize["rule_type_id"] = o.RuleTypeId if !IsNil(o.Running) { toSerialize["running"] = o.Running diff --git a/generated/alerting/model_rule_response_properties_execution_status.go b/generated/alerting/model_rule_response_properties_execution_status.go index b8dd26842..16139f3cc 100644 --- a/generated/alerting/model_rule_response_properties_execution_status.go +++ b/generated/alerting/model_rule_response_properties_execution_status.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_rule_response_properties_last_run.go b/generated/alerting/model_rule_response_properties_last_run.go index 019e57e93..d9c404345 100644 --- a/generated/alerting/model_rule_response_properties_last_run.go +++ b/generated/alerting/model_rule_response_properties_last_run.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,10 +19,11 @@ var _ MappedNullable = &RuleResponsePropertiesLastRun{} // RuleResponsePropertiesLastRun struct for RuleResponsePropertiesLastRun type RuleResponsePropertiesLastRun struct { - AlertsCount *RuleResponsePropertiesLastRunAlertsCount `json:"alerts_count,omitempty"` - Outcome *string `json:"outcome,omitempty"` - OutcomeMsg NullableString `json:"outcome_msg,omitempty"` - Warning NullableString `json:"warning,omitempty"` + AlertsCount *RuleResponsePropertiesLastRunAlertsCount `json:"alerts_count,omitempty"` + Outcome *string `json:"outcome,omitempty"` + OutcomeMsg []string `json:"outcome_msg,omitempty"` + OutcomeOrder *int32 `json:"outcome_order,omitempty"` + Warning NullableString `json:"warning,omitempty"` } // NewRuleResponsePropertiesLastRun instantiates a new RuleResponsePropertiesLastRun object @@ -106,47 +107,68 @@ func (o *RuleResponsePropertiesLastRun) SetOutcome(v string) { o.Outcome = &v } -// GetOutcomeMsg returns the OutcomeMsg field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RuleResponsePropertiesLastRun) GetOutcomeMsg() string { - if o == nil || IsNil(o.OutcomeMsg.Get()) { - var ret string +// GetOutcomeMsg returns the OutcomeMsg field value if set, zero value otherwise. +func (o *RuleResponsePropertiesLastRun) GetOutcomeMsg() []string { + if o == nil || IsNil(o.OutcomeMsg) { + var ret []string return ret } - return *o.OutcomeMsg.Get() + return o.OutcomeMsg } // GetOutcomeMsgOk returns a tuple with the OutcomeMsg field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RuleResponsePropertiesLastRun) GetOutcomeMsgOk() (*string, bool) { - if o == nil { +func (o *RuleResponsePropertiesLastRun) GetOutcomeMsgOk() ([]string, bool) { + if o == nil || IsNil(o.OutcomeMsg) { return nil, false } - return o.OutcomeMsg.Get(), o.OutcomeMsg.IsSet() + return o.OutcomeMsg, true } // HasOutcomeMsg returns a boolean if a field has been set. func (o *RuleResponsePropertiesLastRun) HasOutcomeMsg() bool { - if o != nil && o.OutcomeMsg.IsSet() { + if o != nil && !IsNil(o.OutcomeMsg) { return true } return false } -// SetOutcomeMsg gets a reference to the given NullableString and assigns it to the OutcomeMsg field. -func (o *RuleResponsePropertiesLastRun) SetOutcomeMsg(v string) { - o.OutcomeMsg.Set(&v) +// SetOutcomeMsg gets a reference to the given []string and assigns it to the OutcomeMsg field. +func (o *RuleResponsePropertiesLastRun) SetOutcomeMsg(v []string) { + o.OutcomeMsg = v } -// SetOutcomeMsgNil sets the value for OutcomeMsg to be an explicit nil -func (o *RuleResponsePropertiesLastRun) SetOutcomeMsgNil() { - o.OutcomeMsg.Set(nil) +// GetOutcomeOrder returns the OutcomeOrder field value if set, zero value otherwise. +func (o *RuleResponsePropertiesLastRun) GetOutcomeOrder() int32 { + if o == nil || IsNil(o.OutcomeOrder) { + var ret int32 + return ret + } + return *o.OutcomeOrder } -// UnsetOutcomeMsg ensures that no value is present for OutcomeMsg, not even an explicit nil -func (o *RuleResponsePropertiesLastRun) UnsetOutcomeMsg() { - o.OutcomeMsg.Unset() +// GetOutcomeOrderOk returns a tuple with the OutcomeOrder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleResponsePropertiesLastRun) GetOutcomeOrderOk() (*int32, bool) { + if o == nil || IsNil(o.OutcomeOrder) { + return nil, false + } + return o.OutcomeOrder, true +} + +// HasOutcomeOrder returns a boolean if a field has been set. +func (o *RuleResponsePropertiesLastRun) HasOutcomeOrder() bool { + if o != nil && !IsNil(o.OutcomeOrder) { + return true + } + + return false +} + +// SetOutcomeOrder gets a reference to the given int32 and assigns it to the OutcomeOrder field. +func (o *RuleResponsePropertiesLastRun) SetOutcomeOrder(v int32) { + o.OutcomeOrder = &v } // GetWarning returns the Warning field value if set, zero value otherwise (both if not set or set to explicit null). @@ -208,8 +230,11 @@ func (o RuleResponsePropertiesLastRun) ToMap() (map[string]interface{}, error) { if !IsNil(o.Outcome) { toSerialize["outcome"] = o.Outcome } - if o.OutcomeMsg.IsSet() { - toSerialize["outcome_msg"] = o.OutcomeMsg.Get() + if !IsNil(o.OutcomeMsg) { + toSerialize["outcome_msg"] = o.OutcomeMsg + } + if !IsNil(o.OutcomeOrder) { + toSerialize["outcome_order"] = o.OutcomeOrder } if o.Warning.IsSet() { toSerialize["warning"] = o.Warning.Get() diff --git a/generated/alerting/model_rule_response_properties_last_run_alerts_count.go b/generated/alerting/model_rule_response_properties_last_run_alerts_count.go index 168ab0a34..19d8bb664 100644 --- a/generated/alerting/model_rule_response_properties_last_run_alerts_count.go +++ b/generated/alerting/model_rule_response_properties_last_run_alerts_count.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_schedule.go b/generated/alerting/model_schedule.go index 8a2c4b274..6026bf3e3 100644 --- a/generated/alerting/model_schedule.go +++ b/generated/alerting/model_schedule.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/model_update_rule_request.go b/generated/alerting/model_update_rule_request.go index e2239b119..0a195f146 100644 --- a/generated/alerting/model_update_rule_request.go +++ b/generated/alerting/model_update_rule_request.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,16 +19,18 @@ var _ MappedNullable = &UpdateRuleRequest{} // UpdateRuleRequest The update rule API request body varies depending on the type of rule and actions. type UpdateRuleRequest struct { - Actions []ActionsInner `json:"actions,omitempty"` + Actions []ActionsInner `json:"actions,omitempty"` + AlertDelay *AlertDelay `json:"alert_delay,omitempty"` // The name of the rule. - Name string `json:"name"` + Name string `json:"name"` + // Deprecated NotifyWhen *NotifyWhen `json:"notify_when,omitempty"` // The parameters for the rule. Params map[string]interface{} `json:"params"` Schedule Schedule `json:"schedule"` - // The tags for the rule. - Tags []string `json:"tags,omitempty"` - // The throttle interval, which defines how often an alert generates repeated actions. It is applicable only if `notify_when` is set to `onThrottleInterval`. It is specified in seconds, minutes, hours, or days. + Tags []string `json:"tags,omitempty"` + // Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. + // Deprecated Throttle NullableString `json:"throttle,omitempty"` } @@ -52,9 +54,9 @@ func NewUpdateRuleRequestWithDefaults() *UpdateRuleRequest { return &this } -// GetActions returns the Actions field value if set, zero value otherwise (both if not set or set to explicit null). +// GetActions returns the Actions field value if set, zero value otherwise. func (o *UpdateRuleRequest) GetActions() []ActionsInner { - if o == nil { + if o == nil || IsNil(o.Actions) { var ret []ActionsInner return ret } @@ -63,7 +65,6 @@ func (o *UpdateRuleRequest) GetActions() []ActionsInner { // GetActionsOk returns a tuple with the Actions field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *UpdateRuleRequest) GetActionsOk() ([]ActionsInner, bool) { if o == nil || IsNil(o.Actions) { return nil, false @@ -73,7 +74,7 @@ func (o *UpdateRuleRequest) GetActionsOk() ([]ActionsInner, bool) { // HasActions returns a boolean if a field has been set. func (o *UpdateRuleRequest) HasActions() bool { - if o != nil && IsNil(o.Actions) { + if o != nil && !IsNil(o.Actions) { return true } @@ -85,6 +86,38 @@ func (o *UpdateRuleRequest) SetActions(v []ActionsInner) { o.Actions = v } +// GetAlertDelay returns the AlertDelay field value if set, zero value otherwise. +func (o *UpdateRuleRequest) GetAlertDelay() AlertDelay { + if o == nil || IsNil(o.AlertDelay) { + var ret AlertDelay + return ret + } + return *o.AlertDelay +} + +// GetAlertDelayOk returns a tuple with the AlertDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRuleRequest) GetAlertDelayOk() (*AlertDelay, bool) { + if o == nil || IsNil(o.AlertDelay) { + return nil, false + } + return o.AlertDelay, true +} + +// HasAlertDelay returns a boolean if a field has been set. +func (o *UpdateRuleRequest) HasAlertDelay() bool { + if o != nil && !IsNil(o.AlertDelay) { + return true + } + + return false +} + +// SetAlertDelay gets a reference to the given AlertDelay and assigns it to the AlertDelay field. +func (o *UpdateRuleRequest) SetAlertDelay(v AlertDelay) { + o.AlertDelay = &v +} + // GetName returns the Name field value func (o *UpdateRuleRequest) GetName() string { if o == nil { @@ -110,6 +143,7 @@ func (o *UpdateRuleRequest) SetName(v string) { } // GetNotifyWhen returns the NotifyWhen field value if set, zero value otherwise. +// Deprecated func (o *UpdateRuleRequest) GetNotifyWhen() NotifyWhen { if o == nil || IsNil(o.NotifyWhen) { var ret NotifyWhen @@ -120,6 +154,7 @@ func (o *UpdateRuleRequest) GetNotifyWhen() NotifyWhen { // GetNotifyWhenOk returns a tuple with the NotifyWhen field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *UpdateRuleRequest) GetNotifyWhenOk() (*NotifyWhen, bool) { if o == nil || IsNil(o.NotifyWhen) { return nil, false @@ -137,6 +172,7 @@ func (o *UpdateRuleRequest) HasNotifyWhen() bool { } // SetNotifyWhen gets a reference to the given NotifyWhen and assigns it to the NotifyWhen field. +// Deprecated func (o *UpdateRuleRequest) SetNotifyWhen(v NotifyWhen) { o.NotifyWhen = &v } @@ -222,6 +258,7 @@ func (o *UpdateRuleRequest) SetTags(v []string) { } // GetThrottle returns the Throttle field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *UpdateRuleRequest) GetThrottle() string { if o == nil || IsNil(o.Throttle.Get()) { var ret string @@ -233,6 +270,7 @@ func (o *UpdateRuleRequest) GetThrottle() string { // GetThrottleOk returns a tuple with the Throttle field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *UpdateRuleRequest) GetThrottleOk() (*string, bool) { if o == nil { return nil, false @@ -250,6 +288,7 @@ func (o *UpdateRuleRequest) HasThrottle() bool { } // SetThrottle gets a reference to the given NullableString and assigns it to the Throttle field. +// Deprecated func (o *UpdateRuleRequest) SetThrottle(v string) { o.Throttle.Set(&v) } @@ -274,9 +313,12 @@ func (o UpdateRuleRequest) MarshalJSON() ([]byte, error) { func (o UpdateRuleRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Actions != nil { + if !IsNil(o.Actions) { toSerialize["actions"] = o.Actions } + if !IsNil(o.AlertDelay) { + toSerialize["alert_delay"] = o.AlertDelay + } toSerialize["name"] = o.Name if !IsNil(o.NotifyWhen) { toSerialize["notify_when"] = o.NotifyWhen diff --git a/generated/alerting/response.go b/generated/alerting/response.go index 43f4b0ab1..4f28febd1 100644 --- a/generated/alerting/response.go +++ b/generated/alerting/response.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/alerting/utils.go b/generated/alerting/utils.go index 0086541e6..20efec359 100644 --- a/generated/alerting/utils.go +++ b/generated/alerting/utils.go @@ -3,7 +3,7 @@ Alerting OpenAPI schema for alerting endpoints -API version: 0.1 +API version: 0.2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/internal/clients/kibana/alerting.go b/internal/clients/kibana/alerting.go index 657f218e3..2228a9278 100644 --- a/internal/clients/kibana/alerting.go +++ b/internal/clients/kibana/alerting.go @@ -21,18 +21,29 @@ func ruleResponseToModel(spaceID string, res *alerting.RuleResponseProperties) * actions := []models.AlertingRuleAction{} for _, action := range res.Actions { actions = append(actions, models.AlertingRuleAction{ - Group: *action.Group, - ID: *action.Id, + Group: action.Group, + ID: action.Id, Params: action.Params, }) } + var alertDelay *float32 + alertDelayActive := unwrapOptionalField(res.AlertDelay).Active + + if alerting.IsNil(res.AlertDelay) { + alertDelay = nil + } else { + alertDelay = &alertDelayActive + } + return &models.AlertingRule{ - RuleID: res.Id, - SpaceID: spaceID, - Name: res.Name, - Consumer: res.Consumer, - NotifyWhen: string(unwrapOptionalField(res.NotifyWhen)), + RuleID: res.Id, + SpaceID: spaceID, + Name: res.Name, + Consumer: res.Consumer, + + // DEPRECATED + NotifyWhen: res.NotifyWhen.Get(), Params: res.Params, RuleTypeID: res.RuleTypeId, @@ -47,7 +58,8 @@ func ruleResponseToModel(spaceID string, res *alerting.RuleResponseProperties) * LastExecutionDate: res.ExecutionStatus.LastExecutionDate, Status: res.ExecutionStatus.Status, }, - Actions: actions, + Actions: actions, + AlertDelay: alertDelay, } } @@ -57,8 +69,8 @@ func ruleActionsToActionsInner(ruleActions []models.AlertingRuleAction) []alerti for index := range ruleActions { action := ruleActions[index] actions = append(actions, alerting.ActionsInner{ - Group: &action.Group, - Id: &action.ID, + Group: action.Group, + Id: action.ID, Params: action.Params, }) } @@ -78,23 +90,33 @@ func CreateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.Al ctxWithAuth := apiClient.SetAlertingAuthContext(ctx) + var alertDelay *alerting.AlertDelay + + if alerting.IsNil(rule.AlertDelay) { + alertDelay = nil + } else { + alertDelay = &alerting.AlertDelay{ + Active: *rule.AlertDelay, + } + } + reqModel := alerting.CreateRuleRequest{ Consumer: rule.Consumer, Actions: ruleActionsToActionsInner(rule.Actions), Enabled: rule.Enabled, Name: rule.Name, - NotifyWhen: (*alerting.NotifyWhen)(&rule.NotifyWhen), + NotifyWhen: (*alerting.NotifyWhen)(rule.NotifyWhen), Params: rule.Params, RuleTypeId: rule.RuleTypeID, Schedule: alerting.Schedule{ Interval: &rule.Schedule.Interval, }, - Tags: rule.Tags, - Throttle: *alerting.NewNullableString(rule.Throttle), + Tags: rule.Tags, + Throttle: *alerting.NewNullableString(rule.Throttle), + AlertDelay: alertDelay, } - req := client.CreateRule(ctxWithAuth, rule.SpaceID, rule.RuleID).KbnXsrf("true").CreateRuleRequest(reqModel) - + req := client.CreateRuleId(ctxWithAuth, rule.SpaceID, rule.RuleID).KbnXsrf("true").CreateRuleRequest(reqModel) ruleRes, res, err := req.Execute() if err != nil && res == nil { return nil, diag.FromErr(err) @@ -136,7 +158,7 @@ func UpdateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.Al reqModel := alerting.UpdateRuleRequest{ Actions: ruleActionsToActionsInner((rule.Actions)), Name: rule.Name, - NotifyWhen: (*alerting.NotifyWhen)(&rule.NotifyWhen), + NotifyWhen: (*alerting.NotifyWhen)(rule.NotifyWhen), Params: rule.Params, Schedule: alerting.Schedule{ Interval: &rule.Schedule.Interval, diff --git a/internal/clients/kibana/alerting_test.go b/internal/clients/kibana/alerting_test.go index 2a9d0b4d2..90ce90454 100644 --- a/internal/clients/kibana/alerting_test.go +++ b/internal/clients/kibana/alerting_test.go @@ -65,16 +65,16 @@ func Test_ruleResponseToModel(t *testing.T) { RuleTypeId: "rule-type-id", Enabled: true, Tags: []string{"hello"}, - NotifyWhen: makePtr(alerting.NotifyWhen("broken")), + NotifyWhen: *alerting.NewNullableString(makePtr("broken")), Actions: []alerting.ActionsInner{ { - Group: makePtr("group-1"), - Id: makePtr("id"), + Group: "group-1", + Id: "id", Params: map[string]interface{}{}, }, { - Group: makePtr("group-2"), - Id: makePtr("id"), + Group: "group-2", + Id: "id", Params: map[string]interface{}{}, }, }, @@ -87,6 +87,9 @@ func Test_ruleResponseToModel(t *testing.T) { Interval: makePtr("1m"), }, Throttle: *alerting.NewNullableString(makePtr("throttle")), + AlertDelay: &alerting.AlertDelay{ + Active: float32(4), + }, }, expectedModel: &models.AlertingRule{ RuleID: "id", @@ -97,7 +100,7 @@ func Test_ruleResponseToModel(t *testing.T) { RuleTypeID: "rule-type-id", Enabled: makePtr(true), Tags: []string{"hello"}, - NotifyWhen: "broken", + NotifyWhen: makePtr("broken"), Schedule: models.AlertingRuleSchedule{Interval: "1m"}, Throttle: makePtr("throttle"), ScheduledTaskID: makePtr("scheduled-task-id"), @@ -117,6 +120,7 @@ func Test_ruleResponseToModel(t *testing.T) { Params: map[string]interface{}{}, }, }, + AlertDelay: makePtr(float32(4)), }, }, } @@ -154,10 +158,10 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { testFunc: CreateAlertingRule, client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { - return alerting.ApiCreateRuleRequest{ApiService: alertingClient} + alertingClient.EXPECT().CreateRuleId(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleIdRequest { + return alerting.ApiCreateRuleIdRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + alertingClient.EXPECT().CreateRuleIdExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleIdRequest) (*alerting.RuleResponseProperties, *http.Response, error) { return nil, &http.Response{ StatusCode: 401, Body: io.NopCloser(strings.NewReader("some error")), @@ -194,10 +198,10 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { testFunc: CreateAlertingRule, client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { - return alerting.ApiCreateRuleRequest{ApiService: alertingClient} + alertingClient.EXPECT().CreateRuleId(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleIdRequest { + return alerting.ApiCreateRuleIdRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + alertingClient.EXPECT().CreateRuleIdExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleIdRequest) (*alerting.RuleResponseProperties, *http.Response, error) { return nil, &http.Response{ StatusCode: 200, Body: io.NopCloser(strings.NewReader("everything seems fine")), diff --git a/internal/kibana/alerting.go b/internal/kibana/alerting.go index efd9d24c1..a0db6c607 100644 --- a/internal/kibana/alerting.go +++ b/internal/kibana/alerting.go @@ -9,11 +9,14 @@ import ( "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) +var alertDelayMinSupportedVersion = version.Must(version.NewVersion("8.13.0")) + func ResourceAlertingRule() *schema.Resource { apikeySchema := map[string]*schema.Schema{ "rule_id": { @@ -128,6 +131,11 @@ func ResourceAlertingRule() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "alert_delay": { + Description: "A number that indicates how many consecutive runs need to meet the rule conditions for an alert to occur.", + Type: schema.TypeFloat, + Optional: true, + }, } return &schema.Resource{ @@ -146,13 +154,12 @@ func ResourceAlertingRule() *schema.Resource { } } -func getAlertingRuleFromResourceData(d *schema.ResourceData) (models.AlertingRule, diag.Diagnostics) { +func getAlertingRuleFromResourceData(d *schema.ResourceData, serverVersion *version.Version) (models.AlertingRule, diag.Diagnostics) { var diags diag.Diagnostics rule := models.AlertingRule{ SpaceID: d.Get("space_id").(string), Name: d.Get("name").(string), Consumer: d.Get("consumer").(string), - NotifyWhen: d.Get("notify_when").(string), RuleTypeID: d.Get("rule_type_id").(string), Schedule: models.AlertingRuleSchedule{ Interval: d.Get("interval").(string), @@ -181,6 +188,25 @@ func getAlertingRuleFromResourceData(d *schema.ResourceData) (models.AlertingRul rule.Throttle = &t } + if v, ok := d.GetOk("notify_when"); ok { + rule.NotifyWhen = utils.Pointer(v.(string)) + } + + if v, ok := d.GetOk("alert_delay"); ok { + if serverVersion.LessThan(alertDelayMinSupportedVersion) { + return models.AlertingRule{}, diag.Diagnostics{ + diag.Diagnostic{ + Severity: diag.Error, + Summary: "alert_delay is only supported for Elasticsearch v8.13 or higher", + Detail: "alert_delay is only supported for Elasticsearch v8.13 or higher", + }, + } + + } + + rule.AlertDelay = utils.Pointer(float32(v.(float64))) + } + actions, diags := getActionsFromResourceData(d) if diags.HasError() { return models.AlertingRule{}, diags @@ -226,7 +252,12 @@ func resourceRuleCreate(ctx context.Context, d *schema.ResourceData, meta interf return diags } - rule, diags := getAlertingRuleFromResourceData(d) + serverVersion, diags := client.ServerVersion(ctx) + if diags.HasError() { + return diags + } + + rule, diags := getAlertingRuleFromResourceData(d, serverVersion) if diags.HasError() { return diags } @@ -249,7 +280,12 @@ func resourceRuleUpdate(ctx context.Context, d *schema.ResourceData, meta interf return diags } - rule, diags := getAlertingRuleFromResourceData(d) + serverVersion, diags := client.ServerVersion(ctx) + if diags.HasError() { + return diags + } + + rule, diags := getAlertingRuleFromResourceData(d, serverVersion) if diags.HasError() { return diags } diff --git a/internal/kibana/alerting_test.go b/internal/kibana/alerting_test.go index 4137c6cc5..385b273c1 100644 --- a/internal/kibana/alerting_test.go +++ b/internal/kibana/alerting_test.go @@ -17,6 +17,7 @@ import ( func TestAccResourceAlertingRule(t *testing.T) { minSupportedVersion := version.Must(version.NewSemver("7.14.0")) + minSupportedAlertDelayVersion := version.Must(version.NewSemver("8.13.0")) t.Setenv("KIBANA_API_KEY", "") @@ -55,6 +56,36 @@ func TestAccResourceAlertingRule(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "tags.1", "second"), ), }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minSupportedAlertDelayVersion), + Config: testAccResourceAlertingRuleWithAlertDelayCreate(ruleName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "name", ruleName), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "rule_id", "af22bd1c-8fb3-4020-9249-a4ac5471624b"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "consumer", "alerts"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "notify_when", "onActiveAlert"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "rule_type_id", ".index-threshold"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "interval", "1m"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "enabled", "true"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "alert_delay", "4"), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minSupportedAlertDelayVersion), + Config: testAccResourceAlertingRuleWithAlertDelayUpdate(ruleName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "name", fmt.Sprintf("Updated %s", ruleName)), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "rule_id", "af22bd1c-8fb3-4020-9249-a4ac5471624b"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "consumer", "alerts"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "notify_when", "onActiveAlert"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "rule_type_id", ".index-threshold"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "interval", "10m"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "enabled", "false"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "tags.0", "first"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "tags.1", "second"), + resource.TestCheckResourceAttr("elasticstack_kibana_alerting_rule.test_rule", "alert_delay", "4"), + ), + }, }, }) } @@ -124,6 +155,73 @@ resource "elasticstack_kibana_alerting_rule" "test_rule" { `, name) } +func testAccResourceAlertingRuleWithAlertDelayCreate(name string) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_kibana_alerting_rule" "test_rule" { + name = "%s" + rule_id = "af22bd1c-8fb3-4020-9249-a4ac5471624b" + consumer = "alerts" + notify_when = "onActiveAlert" + params = jsonencode({ + aggType = "avg" + groupBy = "top" + termSize = 10 + timeWindowSize = 10 + timeWindowUnit = "s" + threshold = [10] + thresholdComparator = ">" + index = ["test-index"] + timeField = "@timestamp" + aggField = "version" + termField = "name" + }) + rule_type_id = ".index-threshold" + interval = "1m" + enabled = true + alert_delay = 4 +} + `, name) +} + +func testAccResourceAlertingRuleWithAlertDelayUpdate(name string) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_kibana_alerting_rule" "test_rule" { + name = "Updated %s" + rule_id = "af22bd1c-8fb3-4020-9249-a4ac5471624b" + consumer = "alerts" + notify_when = "onActiveAlert" + params = jsonencode({ + aggType = "avg" + groupBy = "top" + termSize = 10 + timeWindowSize = 10 + timeWindowUnit = "s" + threshold = [10] + thresholdComparator = ">" + index = ["test-index"] + timeField = "@timestamp" + aggField = "version" + termField = "name" + }) + rule_type_id = ".index-threshold" + interval = "10m" + enabled = false + tags = ["first", "second"] + alert_delay = 4 +} + `, name) +} + func checkResourceAlertingRuleDestroy(s *terraform.State) error { client, err := clients.NewAcceptanceTestingClient() if err != nil { diff --git a/internal/models/alert_rule.go b/internal/models/alert_rule.go index 9fdca956b..1bbae824a 100644 --- a/internal/models/alert_rule.go +++ b/internal/models/alert_rule.go @@ -7,7 +7,7 @@ type AlertingRule struct { SpaceID string Name string Consumer string - NotifyWhen string + NotifyWhen *string Params map[string]interface{} RuleTypeID string Schedule AlertingRuleSchedule @@ -18,6 +18,7 @@ type AlertingRule struct { ScheduledTaskID *string ExecutionStatus AlertingRuleExecutionStatus + AlertDelay *float32 } type AlertingRuleSchedule struct {