Skip to content

Commit

Permalink
[DOCS] Add examples for index, server log, and Jira connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Jan 24, 2023
1 parent 818c8b4 commit 45eddb5
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 18 deletions.
97 changes: 94 additions & 3 deletions x-pack/plugins/actions/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,20 @@
"description": "The identifier for the connector."
},
"data": {
"type": "object",
"description": "Information returned from the action.",
"additionalProperties": true
"oneOf": [
{
"type": "object",
"description": "Information returned from the action.",
"additionalProperties": true
},
{
"type": "array",
"description": "An array of information returned from the action.",
"items": {
"type": "object"
}
}
]
},
"status": {
"type": "string",
Expand All @@ -720,6 +731,17 @@
]
}
}
},
"examples": {
"runIndexConnectorResponse": {
"$ref": "#/components/examples/run_index_connector_response"
},
"runJiraConnectorResponse": {
"$ref": "#/components/examples/run_jira_connector_response"
},
"runServerLogConnectorResponse": {
"$ref": "#/components/examples/run_server_log_connector_response"
}
}
}
}
Expand Down Expand Up @@ -3667,6 +3689,75 @@
"message": "Test warning message."
}
}
},
"run_index_connector_response": {
"summary": "Response from running an index connector.",
"value": {
"connector_id": "fd38c600-96a5-11ed-bb79-353b74189cba",
"data": {
"errors": false,
"items": [
{
"create": {
"_id": "4JtvwYUBrcyxt2NnfW3y",
"_index": "my-index",
"_primary_term": 1,
"_seq_no": 0,
"_shards": {
"failed": 0,
"successful": 1,
"total": 2
},
"_version": 1,
"result": "created",
"status": 201
}
}
],
"took": 135
},
"status": "ok"
}
},
"run_jira_connector_response": {
"summary": "Response from retrieving the list of issue types for a Jira connector.",
"value": {
"connector_id": "b3aad810-edbe-11ec-82d1-11348ecbf4a6",
"data": [
{
"id": 10024,
"name": "Improvement"
},
{
"id": 10006,
"name": "Task"
},
{
"id": 10007,
"name": "Sub-task"
},
{
"id": 10025,
"name": "New Feature"
},
{
"id": 10023,
"name": "Bug"
},
{
"id": 10000,
"name": "Epic"
}
],
"status": "ok"
}
},
"run_server_log_connector_response": {
"summary": "Response from running a server log connector.",
"value": {
"connector_id": "7fc7b9a0-ecc9-11ec-8736-e7d63118c907",
"status": "ok"
}
}
}
},
Expand Down
62 changes: 59 additions & 3 deletions x-pack/plugins/actions/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,27 @@ paths:
type: string
description: The identifier for the connector.
data:
type: object
description: Information returned from the action.
additionalProperties: true
oneOf:
- type: object
description: Information returned from the action.
additionalProperties: true
- type: array
description: An array of information returned from the action.
items:
type: object
status:
type: string
description: The status of the action.
enum:
- error
- ok
examples:
runIndexConnectorResponse:
$ref: '#/components/examples/run_index_connector_response'
runJiraConnectorResponse:
$ref: '#/components/examples/run_jira_connector_response'
runServerLogConnectorResponse:
$ref: '#/components/examples/run_server_log_connector_response'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -2598,6 +2610,50 @@ components:
params:
level: warn
message: Test warning message.
run_index_connector_response:
summary: Response from running an index connector.
value:
connector_id: fd38c600-96a5-11ed-bb79-353b74189cba
data:
errors: false
items:
- create:
_id: 4JtvwYUBrcyxt2NnfW3y
_index: my-index
_primary_term: 1
_seq_no: 0
_shards:
failed: 0
successful: 1
total: 2
_version: 1
result: created
status: 201
took: 135
status: ok
run_jira_connector_response:
summary: Response from retrieving the list of issue types for a Jira connector.
value:
connector_id: b3aad810-edbe-11ec-82d1-11348ecbf4a6
data:
- id: 10024
name: Improvement
- id: 10006
name: Task
- id: 10007
name: Sub-task
- id: 10025
name: New Feature
- id: 10023
name: Bug
- id: 10000
name: Epic
status: ok
run_server_log_connector_response:
summary: Response from running a server log connector.
value:
connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907
status: ok
security:
- basicAuth: []
- apiKeyAuth: []
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Response from running an index connector.
summary: Response from running an index connector.
value:
connector_id: fd38c600-96a5-11ed-bb79-353b74189cba
data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Response from retrieving the list of issue types for a Jira connector.
summary: Response from retrieving the list of issue types for a Jira connector.
value:
connector_id: b3aad810-edbe-11ec-82d1-11348ecbf4a6
data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
title: Response from running a server log connector.
summary: Response from running a server log connector.
value:
{}
connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907
status: ok
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,27 @@ post:
type: string
description: The identifier for the connector.
data:
type: object
description: Information returned from the action.
additionalProperties: true
oneOf:
- type: object
description: Information returned from the action.
additionalProperties: true
- type: array
description: An array of information returned from the action.
items:
type: object
status:
type: string
description: The status of the action.
enum:
- error
- ok
# examples:
# runIndexConnectorResponse:
# $ref: '../components/examples/run_index_connector_response.yaml'
# runServerLogConnectorResponse:
# $ref: '../components/examples/run_server_log_connector_response.yaml'
examples:
runIndexConnectorResponse:
$ref: '../components/examples/run_index_connector_response.yaml'
runJiraConnectorResponse:
$ref: '../components/examples/run_jira_connector_response.yaml'
runServerLogConnectorResponse:
$ref: '../components/examples/run_server_log_connector_response.yaml'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down

0 comments on commit 45eddb5

Please sign in to comment.