Skip to content

Commit

Permalink
[OAS][DOCS] Add example for import saved objects API (elastic#192291)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Sep 9, 2024
1 parent 910fa36 commit 9833f0f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 2 deletions.
8 changes: 8 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7269,6 +7269,14 @@ paths:
summary: Import saved objects
tags:
- saved objects
x-codeSamples:
- label: Import with createNewCopies
lang: cURL
source: |
curl \
-X POST api/saved_objects/_import?createNewCopies=true
-H "kbn-xsrf: true"
--form file=@file.ndjson
/api/status:
get:
operationId: '%2Fapi%2Fstatus#0'
Expand Down
8 changes: 8 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10201,6 +10201,14 @@ paths:
summary: Import saved objects
tags:
- saved objects
x-codeSamples:
- label: Import with createNewCopies
lang: cURL
source: |
curl \
-X POST api/saved_objects/_import?createNewCopies=true
-H "kbn-xsrf: true"
--form file=@file.ndjson
/api/saved_objects/_resolve_import_errors:
post:
description: >
Expand Down
9 changes: 8 additions & 1 deletion packages/core/saved-objects/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,14 @@
}
}
}
}
},
"x-codeSamples": [
{
"lang": "cURL",
"label": "Import with createNewCopies",
"source": "curl \\\n -X POST api/saved_objects/_import?createNewCopies=true\n -H \"kbn-xsrf: true\"\n --form file=@file.ndjson\n"
}
]
}
},
"/api/saved_objects/_resolve_import_errors": {
Expand Down
8 changes: 8 additions & 0 deletions packages/core/saved-objects/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,14 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/400_response'
x-codeSamples:
- lang: cURL
label: Import with createNewCopies
source: |
curl \
-X POST api/saved_objects/_import?createNewCopies=true
-H "kbn-xsrf: true"
--form file=@file.ndjson
/api/saved_objects/_resolve_import_errors:
post:
summary: Resolve import errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@
}
}
}
}
},
"x-codeSamples": [
{
"lang": "cURL",
"label": "Import with createNewCopies",
"source": "curl \\\n -X POST api/saved_objects/_import?createNewCopies=true\n -H \"kbn-xsrf: true\"\n --form file=@file.ndjson\n"
}
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/400_response'
x-codeSamples:
- lang: cURL
label: Import with createNewCopies
source: |
curl \
-X POST api/saved_objects/_import?createNewCopies=true
-H "kbn-xsrf: true"
--form file=@file.ndjson
components:
parameters:
kbn_xsrf:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,11 @@ post:
application/json:
schema:
$ref: '../components/schemas/400_response.yaml'
x-codeSamples:
- lang: cURL
label: Import with createNewCopies
source: |
curl \
-X POST api/saved_objects/_import?createNewCopies=true
-H "kbn-xsrf: true"
--form file=@file.ndjson

0 comments on commit 9833f0f

Please sign in to comment.