Commit graph

277 commits

Author SHA1 Message Date
Lisa Cawley
9adcfd072f
[DOCS] Fix authentication types for alerting rule enable API (#171807) 2023-11-27 08:24:43 -08:00
Lisa Cawley
fa489d6a93
[OAS] Add examples for running an email connector (#170819) 2023-11-10 18:11:20 -08:00
Shahzad
d2a54d9180
[Synthetics] Private location public API's (#169376)
Co-authored-by: Abdul Wahab Zahid <awahab07@yahoo.com>
Co-authored-by: Justin Kambic <jk@elastic.co>
2023-11-06 12:29:27 -05:00
Lisa Cawley
89dd69656c
[DOCS] Add solution selection to maintenance windows (#169441) 2023-11-03 11:36:55 -07:00
Shahzad
8bbb58f19a
[Synthetics] Global params Public APIs (#169669) 2023-10-27 16:16:40 +02:00
James Rodewig
9caea77ee4
[DOCS] Deprecate rollups (#169670) 2023-10-25 16:51:49 -04:00
Shahzad
882e0bf81a
[Uptime] Settings public API (#163400) 2023-10-23 06:14:37 -07:00
Luke Elmers
6df50ea666
Remove mention of config SO types from SO.create API docs. (#168538) 2023-10-17 09:40:49 -06:00
Lisa Cawley
382e3f6ec2
[DOCS] Remove OAS API previews (#168761) 2023-10-17 07:49:23 -07:00
Lisa Cawley
aab7f6e368
[DOCS] Remove a-data-source shared attribute (#167943) 2023-10-05 12:46:16 -07:00
natasha-moore-elastic
62e087a8a8
[DOCS] Makes shards optional in Create pack API (#166639)
## Summary

* Resolves https://github.com/elastic/security-docs/issues/3822.  

* Updates the `shards` object in Create pack API to optional for 8.10.1
and 8.11.0 onwards, per https://github.com/elastic/kibana/pull/166178

* Related to changes made in
https://github.com/elastic/kibana/pull/166363.
2023-09-25 11:38:41 +01:00
natasha-moore-elastic
0215ed3a0f
[DOCS] Adds shards object to Create pack and Update pack API (#166363)
## Summary

- Resolves https://github.com/elastic/security-docs/issues/3822 

Adds the `shards` object schema definition to Create pack and Update
pack API, and to the Create pack request example.

- Related dev PR: https://github.com/elastic/kibana/pull/166178
2023-09-18 14:55:57 +01:00
Thom Heymann
85595ca8ab
Add docs for remote indices (#156510)
Resolves #155289

~~Todo: Add link to ES remote indices docs once available
(https://github.com/elastic/kibana/pull/154948#discussion_r1169266451)~~

Update: I don't think there's a better page to link to right now so will
leave as is. We can always change it in the future.
2023-08-29 13:03:58 -04:00
Lisa Cawley
16f7189bb1
[OAS] Add deprecated saved object APIs (#164355) 2023-08-25 12:48:55 -07:00
Lisa Cawley
8ce51770a5
[OAS] Add saved objects openAPI folder (#162522) 2023-08-16 16:01:50 -07:00
Lisa Cawley
531127c4b2
[OAS] Add data views openAPI folder and first entrypoints (#163444) 2023-08-10 10:32:28 -05:00
Lisa Cawley
3a0c90d934
[DOCS] Clarify API key authorization for alerting (#161717) 2023-07-17 09:41:23 -07:00
Lisa Cawley
8afb9b086c
[DOCS] Remove deprecated action variables from rule APIs (#161216) 2023-07-06 07:49:49 -07:00
Pierre Gayvallet
b08c322524
Allow exporting all SO types (#159289)
## Summary

Fix https://github.com/elastic/kibana/issues/150079

Add support for the `*` wildcard for by-type export, allowing to more
easily export all the exportable SO types

```
POST /api/saved_objects/_export
{
   types: '*',
}
```

## Release Note

The savedObjects export API now supports exporting all types using the
`*` wildcard. Please refer to the documentation
for more details and examples.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 00:03:54 -07:00
Matthias Wilhelm
40c75ed1a2
[Data Views] Fix data view field update paths in documentation (#158900)
## Summary

This PR fixes the documentation for the "update data view fields" API which used an incorrect route in the provided examples (data-view instead of data_view)
2023-06-02 16:02:54 +02:00
Jeramy Soucy
ab7b2f7f79
Fixes documentation of response codes for copy saved objects (#158416)
## Summary

Moves the response codes documented for the copy saved object API to the
correct document file.

Documentation was incorrectly located in
https://github.com/elastic/kibana/pull/158036
2023-05-24 16:33:29 -04:00
Jeramy Soucy
1589547b6f
Handles non-existing objects in _copy_saved_objects API call (#158036)
Closes #156791

## Summary

This PR implements catching the error thrown by the
saved_objects_exporter when an object is not found, and responding with
a detailed 404 ("Not Found") rather than a generic 500 ("Internal Server
Error") response message.

### Example Response:
```
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Saved objects not found",
  "attributes": {
    "objects": [
      {
        "id": "7adfa750-4c81-11e8-b3d7-01146121b73d",
        "type": "dashboard"
      },
      {
        "id": "571aaf70-4c88-11e8-b3d7-01146121b73d",
        "type": "search"
      },
      {
        "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d",
        "type": "index-pattern"
      }
    ]
  }
}
```

### Testing

1. Install sample flight data, find the id of the flights dashboard SO
2. Create an additional space 'b'
3. Issue a request to copy saved objects to space b
```
POST kbn:/api/spaces/_copy_saved_objects
{
  "spaces": [
    "b"
  ],
  "objects": [
    {
      "type": "dashboard",
      "id": "7adfa750-4c81-11e8-b3d7-01146121b73e"
    },
    {
      "type": "dashboard",
      "id": "7adfa750-4c81-11e8-b3d7-01146121b73f"
    },
    {
      "type": "dashboard",
      "id": "7adfa750-4c81-11e8-b3d7-01146121b73g"
    }
  ]
}
```
4. Verify response
```
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Saved objects not found",
  "attributes": {
    "objects": [
      {
        "type": "dashboard",
        "id": "7adfa750-4c81-11e8-b3d7-01146121b73e"
      },
      {
        "type": "dashboard",
        "id": "7adfa750-4c81-11e8-b3d7-01146121b73f"
      },
      {
        "type": "dashboard",
        "id": "7adfa750-4c81-11e8-b3d7-01146121b73g"
      }
    ]
  }
}
```
5. Issue a request to copy the flights dashboard SO
6. Verify the usual response (200, missing references)
7. Issue a malformed request to copy an SO
8. Verify status 400 response with details
2023-05-24 12:20:46 -04:00
Antonio
2e0ba63e31
[Cases] Limit searchFields in the Find Case API query params (#156495)
Fixes #155978

## Summary

- Remove the `fields` parameter from the find cases API 
- Limit the `searchFields` parameter in the find cases API

One of the FTR tests was actually successfully calling the find_cases
API while passing the fields parameter but only certain combinations of
fields would actually work.

Passing single fields would not work.

I just removed the test as we won't support the `fields` param anymore.

---------

Co-authored-by: lcawl <lcawley@elastic.co>
2023-05-11 11:04:10 -04:00
Mike Côté
cb2e28d1e4
Fix task manager polling flow controls (#153491)
Fixes https://github.com/elastic/kibana/issues/151938

In this PR, I'm re-writing the Task Manager poller so it doesn't run
concurrently when timeouts occur while also fixing the issue where
polling requests would pile up when polling takes time. To support this,
I've also made the following changes:
- Removed the observable monitor and the
`xpack.task_manager.max_poll_inactivity_cycles` setting
- Make the task store `search` and `updateByQuery` functions have no
retries. This prevents the request from retrying 5x whenever a timeout
occurs, causing each call taking up to 2 1/2 minutes before Kibana sees
the error (now down to 30s each). We have polling to manage retries in
these situations.
- Switch the task poller tests to use `sinon` for faking timers
- Removing the `assertStillInSetup` checks on plugin setup. Felt like a
maintenance burden that wasn't necessary to fix with my code changes.

The main code changes are within these files (to review thoroughly so
the polling cycle doesn't suddenly stop):
- x-pack/plugins/task_manager/server/polling/task_poller.ts
- x-pack/plugins/task_manager/server/polling_lifecycle.ts (easier to
review if you disregard whitespace `?w=1`)

## To verify
1. Tasks run normally (create a rule or something that goes through task
manager regularly).
2. When the update by query takes a while, the request is cancelled
after 30s or the time manually configured.
4. When the search for claimed tasks query takes a while, the request is
cancelled after 30s or the time manually configured.

**Tips:**
<details><summary>how to slowdown search for claimed task
queries</summary>

```
diff --git a/x-pack/plugins/task_manager/server/queries/task_claiming.ts b/x-pack/plugins/task_manager/server/queries/task_claiming.ts
index 07042650a37..2caefd63672 100644
--- a/x-pack/plugins/task_manager/server/queries/task_claiming.ts
+++ b/x-pack/plugins/task_manager/server/queries/task_claiming.ts
@@ -247,7 +247,7 @@ export class TaskClaiming {
         taskTypes,
       });

-    const docs = tasksUpdated > 0 ? await this.sweepForClaimedTasks(taskTypes, size) : [];
+    const docs = await this.sweepForClaimedTasks(taskTypes, size);

     this.emitEvents(docs.map((doc) => asTaskClaimEvent(doc.id, asOk(doc))));

@@ -346,6 +346,13 @@ export class TaskClaiming {
       size,
       sort: SortByRunAtAndRetryAt,
       seq_no_primary_term: true,
+      aggs: {
+        delay: {
+          shard_delay: {
+            value: '40s',
+          },
+        },
+      },
     });

     return docs;
```
</details>

<details><summary>how to slow down update by queries</summary>
Not the cleanest way but you'll see occasional request timeouts from the
updateByQuery calls. I had more luck creating rules running every 1s.

```
diff --git a/x-pack/plugins/task_manager/server/task_store.ts b/x-pack/plugins/task_manager/server/task_store.ts
index a06ee7b918a..07aa81e5388 100644
--- a/x-pack/plugins/task_manager/server/task_store.ts
+++ b/x-pack/plugins/task_manager/server/task_store.ts
@@ -126,6 +126,7 @@ export class TaskStore {
       // Timeouts are retried and make requests timeout after (requestTimeout * (1 + maxRetries))
       // The poller doesn't need retry logic because it will try again at the next polling cycle
       maxRetries: 0,
+      requestTimeout: 900,
     });
   }

@@ -458,6 +459,7 @@ export class TaskStore {
           ignore_unavailable: true,
           refresh: true,
           conflicts: 'proceed',
+          requests_per_second: 1,
           body: {
             ...opts,
             max_docs,
```
</details>

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-03 09:33:10 -04:00
Aleh Zasypkin
7112c286ab
Document compatibilityMode query string parameter in Resolve import errors API. (#155696) 2023-04-25 17:36:31 +02:00
Mike Côté
5a4dd3fccd
Remove alerting_framework_heath from the alerting framework health API response (#154276)
Resolves https://github.com/elastic/kibana/issues/135035.

In this PR, I'm removing the deprecated attribute
`alerting_framework_heath` from the alerting framework health API.

## To verify

1. Start Kibana.
2. Call `/api/alerting/_health`.
3. Notice `alerting_framework_heath` is no longer part of the HTTP API
response.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2023-04-20 07:16:27 -04:00
Nick Peihl
95d4820592
[Docs] Fix curl examples in update data view api docs (#153292)
## Summary

Fixes typos in the curl examples in the Update data views API docs.

[Reported by a community
user](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/5).
2023-04-03 16:02:26 -04:00
Aleh Zasypkin
a1fccfd880
Support generating legacy URL aliases for objects that change IDs during import. (#149021) 2023-04-03 10:54:23 +02:00
Tomonori Soejima
4506391efd
[DOCS] Update create_rule.asciidoc (#153734) 2023-03-27 09:20:46 -07:00
Lisa Cawley
1607f812eb
[DOCS] Add stub for find case activity API (#152041) 2023-02-28 18:16:33 +01:00
Konrad Szwarc
ee26923aab
[Defend Workflows] Fix saved queries 500 (#150426)
**Bug** 
Calling `/api/osquery/saved_queries` with `sortOrder` but without `sort`
field (`/api/osquery/saved_queries?sortOrder=desc`) was causing 500
server error. Same with calls without any parameters
(`/api/osquery/saved_queries`)

**Cause**
We had defaults failover set for `sortOrder` but not for `sort`. Sorting
logic required both fields to be defined. All schema params were set to
optional and we were validating them ourselves.

**Fix** 
I've tightened the schema by making all the params required and provided
default values if not provided.
`page: schema.number({ defaultValue: 1 }),
sort: schema.string({ defaultValue: 'id' }),
sortOrder: schema.oneOf([schema.literal('asc'), schema.literal('desc')],
{defaultValue: 'desc',}),`

**Additionally** 
Outdated osQuery API docs - `perPage` became `pageSize` and `sortField`
became `sort`. Also, minor spelling fixes.

---------

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-02-14 16:11:14 +01:00
Christiane (Tina) Heiligers
b14af4b243
API docs: Add deprecation warning to all deprecated Saved Object APIs (#150267) 2023-02-07 09:28:13 -07:00
Jeramy Soucy
01a18df436
[Docs] Documents constraints of space id in create space API (#150379)
closes #150311

Adds wording to clarify that the space ID must be lowercase
alphanumeric, but can include underscores and hyphens. Previously this
restriction was not documented, but if these requirements are not met
the API will respond with a 400.
2023-02-06 16:31:35 -05:00
Christiane (Tina) Heiligers
3f4f1cb8c7
Adds deprecation notice to saved objects API docs (#150124)
Fix https://github.com/elastic/kibana/issues/149988
2023-02-02 11:13:45 -07:00
Kaarina Tungseth
be498a5c58
[DOCS] Fixes formatting in the Osquery manager APIs (#149871)
## Summary

Fixes the formatting of the rogue `Query parameters` sections.
2023-01-30 12:41:10 -06:00
Lisa Cawley
7421a9737d
[DOCS] Create open API specification for create rule (#149565) 2023-01-26 18:07:23 -08:00
Lisa Cawley
f78236a2e4
[DOCS] Create open API specification for run connector (#149274) 2023-01-26 08:53:47 -08:00
Jorge Sanz
fc17f49f27
Update DELETE request (#127537)
Update the `DELETE` request to use `<space_name>`.

Thanks @Erni for the nudge!

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 11:45:49 +01:00
Lisa Cawley
9ebb3994c8
[DOCS] Fix deduplication spelling (#149066) 2023-01-18 11:00:29 -08:00
Lisa Cawley
fa68cb432b
[DOCS] Create OAS for get rule types and get alerting framework health (#148774) 2023-01-17 10:53:48 -07:00
Lisa Cawley
4f6d0dff28
[DOCS] Create open API specification for create/update connector (#148691) 2023-01-17 10:31:48 -07:00
Lisa Cawley
b254abaf08
[DOCS] Create open API specification for disable/enable rule and mute/unmute all alerts #148360 (#148494) 2023-01-10 17:01:16 -07:00
Lisa Cawley
a077a1d468
[DOCS] Create open API specification for delete/get connectors (#148360) 2023-01-10 10:58:58 -08:00
Lisa Cawley
d35296ea3b
[DOCS] Create open API specification for update rule (#147407) 2023-01-10 10:27:58 -07:00
Lisa Cawley
d862f46c2a
[DOCS] Create open API specification for find rules (#147061) 2022-12-12 11:36:44 -08:00
Lisa Cawley
e1227a3fe9
[DOCS] Add assignees query parameter to find cases API (#146087) 2022-11-29 08:46:49 -08:00
Lisa Cawley
94b67781e8
Add open API specification for list connector types (#145951) 2022-11-24 11:30:51 -07:00
Lisa Cawley
876f1b9ac8
[DOCS] Alert limit for cases (#145950) 2022-11-24 17:56:45 +01:00
Lisa Cawley
8086e99478
[DOCS] Fix Rules and Connectors app labels (#145660) 2022-11-22 09:14:31 -08:00
Lisa Cawley
74198264e1
[DOCS] Clarify alertId and index in add comment API (#145189) 2022-11-18 17:56:37 +01:00