Commit graph

302 commits

Author SHA1 Message Date
Shahzad
d25a2b442a
[Synthetics] Refactor bulk delete monitor and params routes !! (#195420)
## Summary

Refactor bulk delete monitor and params routes !! 

We need to remove usage for body from DELETE route.

### Params

Params can be bulk delete now with POST request to
`/params/_bulk_delete` endpoint

### Monitors
Monitors can be bulk delete now with POST request to
`/monitors/_bulk_delete` endpoint
2024-11-07 10:51:56 +01:00
Lisa Cawley
02fab7248d
[OpenAPI][DOCS] Add descriptions, examples, responses for role APIs (#195527)
Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
2024-10-25 10:13:57 -07:00
Shahzad
0ff9a8a9d9
[Synthetics] Fixes partial updates for params and params viewing (#195866)
## Summary

Fixes https://github.com/elastic/kibana/issues/167781

In docs we says that only key/value pairs are required, but in actual
edit, that means rest of the data was being lost on edits

Allow partial updates to params edit API !!

This PR makes sure prev objects is fetched and merged with new data
hence allowing partial updates !!

We are also allowing the ability to view value of the secret once it's
saved via API !!

### Value is hidden
Param value will not be visible unless user is `super_user` or
`kibana_admin`, though user can assign new value.

---------

Co-authored-by: Justin Kambic <jk@elastic.co>
2024-10-25 17:06:52 +02:00
Lisa Cawley
2656e5a4ff
[DOCS][OpenAPI] Add descriptions, examples, tags, responses for space APIs (#195333)
Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
2024-10-18 14:03:06 -05:00
natasha-moore-elastic
f0f1775632
[DOCS ]Direct users to new API reference site (#195909)
## Summary

Contributes to
https://github.com/elastic/security-docs-internal/issues/48.

Add callouts to the asciidoc Osquery API docs to direct users to the new
API reference site, in preparation for retiring the asciidoc API docs.

NOTE: The api-kibana variable is defined in version-specific files. In
[8.15.asciidoc](873ec2c47f/shared/versions/stack/8.15.asciidoc (L74))
and
[8.x.asciidoc](873ec2c47f/shared/versions/stack/8.x.asciidoc (L75)),
the variable points to the [v8
branch](https://www.elastic.co/docs/api/doc/kibana/v8) of the API
reference, which currently doesn't include Security API docs. The v8
branch is derived from the "current" Kibana branch, which is currently
8.15. This likely means that we can only backport the callouts to 8.16
once 8.16 becomes the "current" docs version.

Preview: [Osquery manager
API](https://kibana_bk_195909.docs-preview.app.elstc.co/guide/en/kibana/master/osquery-manager-api.html)
and all its child pages
2024-10-15 16:29:05 +01:00
Christiane (Tina) Heiligers
dd221a7be1
[Docs] Add details to SO APIs landing page (#191693)
Fix https://github.com/elastic/kibana/issues/191534
The deprecation warning in the Kibana Saved Objects API main page was
removed in https://github.com/elastic/kibana/pull/190654.

This PR adds a section about when the APIs will be removed and what to
use instead.

The PR also includes updates to other API main pages that mention the SO
APIs.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials

VIew the [html
diff](https://kibana_bk_191693.docs-preview.app.elstc.co/diff) for these
changes:

![Short URLs API landing
page](https://github.com/user-attachments/assets/3716f33e-0d00-4ff7-b29d-7a5ba0a0f1f2)

![Data views API landing
page](https://github.com/user-attachments/assets/81c8a843-27ca-4510-a181-7ec9b20f86d6)

The updated OpenAPI document looks like this in a Bump.sh preview:


![image](https://github.com/user-attachments/assets/a8b58142-5082-4b75-8b3f-339b8a6b57e4)

---------

Co-authored-by: lcawl <lcawley@elastic.co>
2024-08-29 15:04:00 -05:00
Lisa Cawley
cf43ba2f27
[DOCS] Remove saved object and data view API pages (#190654)
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
2024-08-20 17:29:06 +00:00
Lisa Cawley
cd1d64569a
[DOCS] Remove machine learning, alerting, cases, and connector API pages (#190747) 2024-08-20 14:43:59 +00:00
elena-shostak
1053ec6c7b
[Docs] Fixed endpoint in the example (#190699)
## Summary

Fixed bulk role endpoint in the example.


### Checklist
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials

__Fixes: https://github.com/elastic/kibana/issues/190697__
2024-08-20 14:14:29 +02:00
Lisa Cawley
06f1681cc6
[DOCS] Link to new API pages (#190569) 2024-08-15 16:42:59 -07:00
Shahzad
69f6687af9
[Synthetics] Delete monitor API via id param !! (#190210)
## Summary

Allow deletion of monitor via id param !!

User can now delete monitor via passing id as url param

`DELETE <kibana host>:<port>/api/synthetics/monitors/<config_id>`

Previous bulk delete via list of ids via API body still works as well !!

Docs are updated !!
2024-08-12 21:13:33 +02:00
elena-shostak
c8608461ae
Bulk Role Endpoint (#189173)
## Summary

This PR adds a new `POST security/roles` API that can be used to bulk
create or update roles.

## How to test
1. Create empty roles
```
POST kbn:/api/security/roles
{
  "roles": {
    "bulk_role_1": {},
    "bulk_role_2": {}
  }
}
```
<details>
  <summary>2. Create roles with Kibana and ES privileges</summary>
  
    POST kbn:/api/security/roles
    {
      "roles": {
        "bulk_role_with_privilege_1": {
          "elasticsearch": {
            "cluster": ["manage"],
            "indices": [
              {
                "names": ["logstash-*"],
                "privileges": ["read", "view_index_metadata"]
              }
            ],
            "run_as": ["watcher_user"]
          },
          "kibana": [
            {
              "base": ["read"]
            },
            {
              "feature": {
                "dashboard": ["read"],
                "discover": ["all"],
                "ml": ["all"]
              },
              "spaces": ["marketing", "sales"]
            }
          ]
        },
        "bulk_role_with_privilege_2": {
          "elasticsearch": {
            "cluster": ["manage"],
            "indices": [
              {
                "names": ["logstash-*"],
                "privileges": ["read", "view_index_metadata"]
              }
            ],
            "run_as": ["watcher_user"]
          },
          "kibana": [
            {
              "base": ["read"]
            },
            {
              "feature": {
                "dashboard": ["read"],
                "discover": ["all"],
                "ml": ["all"]
              },
              "spaces": ["marketing", "sales"]
            }
          ]
        }
      }
    }
</details>
<details>
  <summary>3. Create roles failing validation </summary>
  
    POST kbn:/api/security/roles
    {
      "roles": {
        "bulk_role_es_invalid": {
          "elasticsearch": {
            "cluster": ["bla"]
          }
        },
        "bulk_role_kibana_invalid": {
          "kibana": [
            {
              "spaces": ["bar-space"],
              "base": [],
              "feature": {
                "fleetv2": ["all", "read"]
              }
            }
          ]
        },
        "bulk_role_valid": {
          "elasticsearch": {
            "cluster": ["all"]
          }
        }
      }
    }
</details>
<details>
<summary>4. Check validation for license (under basic license should
return security_exception) </summary>
  
  
    POST kbn:/api/security/roles
    {
      "roles": {
        "role_with_privileges_dls_fls": {
          "metadata": {
            "foo": "test-metadata"
          },
          "elasticsearch": {
            "cluster": ["manage"],
            "indices": [
              {
                "field_security": {
                  "grant": ["*"],
                  "except": ["geo.*"]
                },
                "names": ["logstash-*"],
                "privileges": ["read", "view_index_metadata"],
                "query": "{ \"match\": { \"geo.src\": \"CN\" } }"
              }
            ],
            "run_as": ["watcher_user"]
          }
        }
      }
    }

</details>

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

__Fixes: https://github.com/elastic/kibana/issues/187427__

## Release Notes
Added API endpoint `POST security/roles` that can be used to bulk create
or update roles.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-08 14:33:25 +02:00
Lisa Cawley
8dc286067b
[DOCS][OAS] Add data view swap saved object references and preview APIs (#187927) 2024-07-24 17:31:06 -05:00
Lisa Cawley
88be854b89
[Cases][Docs] Add case template overview (#187815) 2024-07-17 18:05:29 +01:00
Julia Rechkunova
cd4a782cac
[Discover] Update data view API docs (#187146)
- Closes https://github.com/elastic/kibana/issues/187075

## Summary

This PR updates data view API docs. `customDescription` was added in
https://github.com/elastic/kibana/pull/168577

---------

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-07-11 19:33:52 +10:00
elena-shostak
3d09eaa6fc
[Spaces] Passing default solution from cloud onboarding process (#185926)
## Summary

Passing default solution from cloud onboarding process.

1. Renaming. Solution changes are not released yet, would be shipped
with `8.15`, so it's fine to do it.
   - `search` -> `es`
   - `observability` -> `oblt`
   - Adjusted telemetry accordingly
2. Added `cloud` as optional dependency to `spaces` plugin to use
`onboarding.defaultSolution` passed through setup contract.

### How to test
1. Set `xpack.cloud.onboarding.default_solution` to `es | oblt |
security`
2. Check that default space was created with provided solution `GET
kbn:/api/spaces/space/default`

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

__Fixes: https://github.com/elastic/kibana/issues/184999__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-18 11:10:52 +02:00
Paul Bianciardi
3f13215f27
Update the docs to clarify the ID of the private location created (#184818)
Update the docs to clarify that the `id` of the Private Location created via the API will be the same `id` as the agent policy
2024-06-05 14:36:03 +01:00
elena-shostak
afb3d37469
[Spaces] Space solution property (#183986)
## Summary

Added solution property for the space.

- Forbidden in serverless.
- To facilitate iterative development made the property as optional in
stateful offering until all of the workstreams are complete.

### How to test API changes
```
# Should create space
POST kbn:/api/spaces/space 
{
  "name": "space without solution",
  "id": "my-space-solution-1",
  "description": "a description",
  "color": "#5c5959",
  "disabledFeatures": []
}

# Should fail with 400
POST kbn:/api/spaces/space 
{
  "name": "space with solution",
  "id": "my-space-solution-2",
  "description": "a description",
  "color": "#5c5959",
  "solution": "some_solution",
  "disabledFeatures": []
}

# Should fail with 400
POST kbn:/api/spaces/space 
{
  "name": "space with solution",
  "id": "my-space-solution-2",
  "description": "a description",
  "color": "#5c5959",
  "solution": null,
  "disabledFeatures": []
}

# Should create space
POST kbn:/api/spaces/space 
{
  "name": "space with solution",
  "id": "my-space-solution-2",
  "description": "a description",
  "color": "#5c5959",
  "solution": "search",
  "disabledFeatures": []
}

# Should get 'my-space-solution-1' space without solution field
GET kbn:/api/spaces/space/my-space-solution-1

# Should get 'my-space-solution-2' space with solution field
GET kbn:/api/spaces/space/my-space-solution-2 

# Should fail to update with 400
PUT kbn:/api/spaces/space/my-space-solution-1
{
  "id": "my-space-solution-1",
  "name": "my-space-solution-1 name",
  "solution": "some_solution"
}

# Should fail to update with 400
PUT kbn:/api/spaces/space/my-space-solution-1
{
  "id": "my-space-solution-1",
  "name": "my-space-solution-1 name",
  "solution": null
}

# Should update 'my-space-solution-1'
PUT kbn:/api/spaces/space/my-space-solution-1
{
  "id": "my-space-solution-1",
  "name": "my-space-solution-1 name",
  "solution": "security"
}

# Should get 'my-space-solution-1' space wit solution field set to 'security'
GET kbn:/api/spaces/space/my-space-solution-1

# Should return list where 
# 1. 'my-space-solution-1' has solution 'security'
# 2. 'my-space-solution-2' has solution 'search'
# 3. Other spaces don't have solution field present
GET kbn:/api/spaces/space
```


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed ([Security and Spaces
config](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6076),
[Spaces only
config](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6075))

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

__Fixes: https://github.com/elastic/kibana/issues/183559__

## Release note
Added optional solution property for Space in a stateful offering.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-27 12:25:44 +02:00
elena-shostak
4fade37313
[Roles] Added optional role description (#183145)
## Summary

1. Added optional role description field for Save/Edit Role page.
2. Added tooltip with description for roles ComboBox that we render on
the User and Role Mappings pages.
<details>
<summary>3. Updated <b>RolesGridPage </b>table responsive
setup.</summary>
  <br>
<table>
  <tr>
    <td>[Before] responsiveBreakpoint={false}</td>
     <td>[After] responsiveBreakpoint={true}</td>
  </tr>
  <tr>
<td><img alt="Before"
src="d8290299-e8c8-4c00-abee-ad1fe909df1d"></td>
<td><img alt="After"
src="917e2c78-6291-43f0-ab7e-7583c51fd69d"></td>
  </tr>
 </table>

</details>



7035c05b-85c6-4da0-97d3-85f6d2dbc313


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed.
[Report](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5960)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

__Fixes: https://github.com/elastic/kibana/issues/173570__

## Release note
Added optional role description field for Save/Edit Role page.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-16 17:14:09 +02:00
elena-shostak
25098d9a72
[Roles] Support for remote_cluster field in ES role definition (#182377)
## Summary

Added support for `remote_cluster` field in ES role definition. The
change is needed for running queries with `ENRICH` keyword that are sent
over CCS.

- Updated GET and PUT APIs, documentation and corresponding data models.
- Added UI section to support the new API features.
- Extracted remote clusters ComboBox to a separate component
[RemoteClusterComboBox](https://github.com/elastic/kibana/pull/182377/files#diff-6b3189b6d802fd2196bcc445dc5c6021af70cf165fe3f8c4d4a5e6a4df651309R22)
to share it between the remote clusters and remote index privilege
views.



d3cf8b9c-e83d-4ace-ba2e-f8e028977f2d




### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([Report](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5855))
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

__Fixes: https://github.com/elastic/kibana/issues/182035__

## Release note
Added support for `remote_cluster` field in ES role definition.
2024-05-08 10:52:35 +02:00
Shahzad
29e8394c3d
[Synthetics] Monitor CRUD's public api's (#169928)
## Summary

Part of https://github.com/elastic/kibana/issues/169547

View docs at [Changed
pages](https://kibana_169928.docs-preview.app.elstc.co/diff)

Add monitor api public api 

### Testing

Make sure you have some monitors populated before testing this PR and
before switching to the branch

- [ ] Try editing already added monitors via API
- [ ] Test adding monitors via API, and then edit those via and
subsqeuently try editing via API the same monitor
- [ ] Test editing monitors via API
- [ ] Test deleting monitors via API
- [ ] Test getting monitors via API
- [ ] Testing private as well public locations

Basic workflow that i am interesting in testing is to make sure, you can
add/edit via both API and UI without any issues


Test each of HTTP/TCP/ICMP browser examples

<img width="1728" alt="image"
src="3575d93a-5f04-4c80-ac62-038643f466f8">

---------

Co-authored-by: Justin Kambic <jk@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2024-04-12 15:10:11 -04:00
Lisa Cawley
1b65592c0e
[OAS] Add details for running Slack connector actions (#169712) 2024-02-13 16:00:15 -07:00
Matthew Kime
b371171d86
[data views] Swap references API docs (#175183)
## Summary

Docs for the swap references api -
https://github.com/elastic/kibana/pull/163225

The docs are on the terse side - I think this makes sense since this is
a tool that should be used infrequently and only by people who use saved
object references.

---------

Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-01-29 15:04:20 -06:00
Lisa Cawley
d3c51c45eb
[OAS] Adds alerts data to get rule types API (#170702) 2024-01-23 11:03:30 -07:00
natasha-moore-elastic
86a31db057
[DOCS] Documents Osquery Timeout setting (#174595)
Contributes to https://github.com/elastic/security-docs/issues/4536 by
documenting the new **Timeout** setting and `timeout` API parameter in
Osquery docs.

---------

Co-authored-by: nastasha.solomon <nastasha.solomon@elastic.co>
Co-authored-by: Benjamin Ironside Goldstein <91905639+benironside@users.noreply.github.com>
2024-01-17 15:29:23 +00:00
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