From 7a807cc2b0d45bbae83cba4a48cde97c947c324e Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Mon, 16 Oct 2023 15:14:38 -0700 Subject: [PATCH] [OAS] Amazon Bedrock connector (#168662) --- .../connectors/action-types/bedrock.asciidoc | 1 - .../plugins/actions/docs/openapi/bundled.json | 82 ++++++++++++++++++- .../plugins/actions/docs/openapi/bundled.yaml | 61 +++++++++++++- .../schemas/config_properties_bedrock.yaml | 15 ++++ ...connector_response_properties_bedrock.yaml | 31 +++++++ .../components/schemas/connector_types.yaml | 1 + .../create_connector_request_bedrock.yaml | 23 ++++++ .../schemas/secrets_properties_bedrock.yaml | 13 +++ .../update_connector_request_bedrock.yaml | 13 +++ .../s@{spaceid}@api@actions@connector.yaml | 1 + ...}@api@actions@connector@{connectorid}.yaml | 2 + 11 files changed, 239 insertions(+), 4 deletions(-) create mode 100644 x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_bedrock.yaml create mode 100644 x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_bedrock.yaml create mode 100644 x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml create mode 100644 x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_bedrock.yaml create mode 100644 x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_bedrock.yaml diff --git a/docs/management/connectors/action-types/bedrock.asciidoc b/docs/management/connectors/action-types/bedrock.asciidoc index a01a750ae77aa..80a8ba5b183f2 100644 --- a/docs/management/connectors/action-types/bedrock.asciidoc +++ b/docs/management/connectors/action-types/bedrock.asciidoc @@ -30,7 +30,6 @@ image::management/connectors/images/bedrock-connector.png[{bedrock} connector] Name:: The name of the connector. API URL:: The {bedrock} request URL. Default model:: The GAI model for {bedrock} to use. Current support is for the Anthropic Claude models, defaulting to Claude 2. The model can be set on a per request basis by including a "model" parameter alongside the request body. -Region:: The {bedrock} request URL. Access Key:: The AWS access key for authentication. Secret:: The secret for authentication. diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json index 801dd78a76936..1db5f55b1c744 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.json +++ b/x-pack/plugins/actions/docs/openapi/bundled.json @@ -57,6 +57,9 @@ "title": "Create connector request body properties", "description": "The properties vary depending on the connector type.", "oneOf": [ + { + "$ref": "#/components/schemas/create_connector_request_bedrock" + }, { "$ref": "#/components/schemas/create_connector_request_cases_webhook" }, @@ -338,6 +341,9 @@ "title": "Create connector request body properties", "description": "The properties vary depending on the connector type.", "oneOf": [ + { + "$ref": "#/components/schemas/create_connector_request_bedrock" + }, { "$ref": "#/components/schemas/create_connector_request_cases_webhook" }, @@ -466,6 +472,9 @@ "title": "Update connector request body properties", "description": "The properties vary depending on the connector type.", "oneOf": [ + { + "$ref": "#/components/schemas/create_connector_request_bedrock" + }, { "$ref": "#/components/schemas/update_connector_request_cases_webhook" }, @@ -1423,6 +1432,76 @@ } }, "schemas": { + "config_properties_bedrock": { + "title": "Connector request properties for an Amazon Bedrock connector", + "description": "Defines properties for connectors when type is `.bedrock`.", + "type": "object", + "required": [ + "apiUrl" + ], + "properties": { + "apiUrl": { + "type": "string", + "description": "The Amazon Bedrock request URL." + }, + "defaultModel": { + "type": "string", + "description": "The generative artificial intelligence model for Amazon Bedrock to use. Current support is for the Anthropic Claude models.\n", + "default": "anthropic.claude-v2" + } + } + }, + "secrets_properties_bedrock": { + "title": "Connector secrets properties for an Amazon Bedrock connector", + "description": "Defines secrets for connectors when type is `.bedrock`.", + "type": "object", + "required": [ + "accessKey", + "secret" + ], + "properties": { + "accessKey": { + "type": "string", + "description": "The AWS access key for authentication." + }, + "secret": { + "type": "string", + "description": "The AWS secret for authentication." + } + } + }, + "create_connector_request_bedrock": { + "title": "Create Amazon Bedrock connector request", + "description": "The Amazon Bedrock connector uses axios to send a POST request to Amazon Bedrock.", + "type": "object", + "required": [ + "config", + "connector_type_id", + "name", + "secrets" + ], + "properties": { + "config": { + "$ref": "#/components/schemas/config_properties_bedrock" + }, + "connector_type_id": { + "type": "string", + "description": "The type of connector.", + "enum": [ + ".bedrock" + ], + "example": ".bedrock" + }, + "name": { + "type": "string", + "description": "The display name for the connector.", + "example": "my-connector" + }, + "secrets": { + "$ref": "#/components/schemas/secrets_properties_bedrock" + } + } + }, "config_properties_cases_webhook": { "title": "Connector request properties for Webhook - Case Management connector", "required": [ @@ -4450,6 +4529,7 @@ "type": "string", "description": "The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`.", "enum": [ + ".bedrock", ".cases-webhook", ".d3security", ".email", @@ -5722,4 +5802,4 @@ } } } -} +} \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml index 63156405da018..9fb7caccd1f17 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml @@ -37,6 +37,7 @@ paths: title: Create connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '#/components/schemas/create_connector_request_bedrock' - $ref: '#/components/schemas/create_connector_request_cases_webhook' - $ref: '#/components/schemas/create_connector_request_d3security' - $ref: '#/components/schemas/create_connector_request_email' @@ -191,6 +192,7 @@ paths: title: Create connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '#/components/schemas/create_connector_request_bedrock' - $ref: '#/components/schemas/create_connector_request_cases_webhook' - $ref: '#/components/schemas/create_connector_request_d3security' - $ref: '#/components/schemas/create_connector_request_email' @@ -250,6 +252,7 @@ paths: title: Update connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '#/components/schemas/create_connector_request_bedrock' - $ref: '#/components/schemas/update_connector_request_cases_webhook' - $ref: '#/components/schemas/update_connector_request_d3security' - $ref: '#/components/schemas/update_connector_request_email' @@ -818,6 +821,59 @@ components: type: string example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad schemas: + config_properties_bedrock: + title: Connector request properties for an Amazon Bedrock connector + description: Defines properties for connectors when type is `.bedrock`. + type: object + required: + - apiUrl + properties: + apiUrl: + type: string + description: The Amazon Bedrock request URL. + defaultModel: + type: string + description: | + The generative artificial intelligence model for Amazon Bedrock to use. Current support is for the Anthropic Claude models. + default: anthropic.claude-v2 + secrets_properties_bedrock: + title: Connector secrets properties for an Amazon Bedrock connector + description: Defines secrets for connectors when type is `.bedrock`. + type: object + required: + - accessKey + - secret + properties: + accessKey: + type: string + description: The AWS access key for authentication. + secret: + type: string + description: The AWS secret for authentication. + create_connector_request_bedrock: + title: Create Amazon Bedrock connector request + description: The Amazon Bedrock connector uses axios to send a POST request to Amazon Bedrock. + type: object + required: + - config + - connector_type_id + - name + - secrets + properties: + config: + $ref: '#/components/schemas/config_properties_bedrock' + connector_type_id: + type: string + description: The type of connector. + enum: + - .bedrock + example: .bedrock + name: + type: string + description: The display name for the connector. + example: my-connector + secrets: + $ref: '#/components/schemas/secrets_properties_bedrock' config_properties_cases_webhook: title: Connector request properties for Webhook - Case Management connector required: @@ -1031,14 +1087,14 @@ components: type: boolean host: description: | - The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: string oauthTokenUrl: type: string nullable: true port: description: | - The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: integer secure: description: | @@ -3084,6 +3140,7 @@ components: type: string description: The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. enum: + - .bedrock - .cases-webhook - .d3security - .email diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_bedrock.yaml new file mode 100644 index 0000000000000..25b279c423739 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_bedrock.yaml @@ -0,0 +1,15 @@ +title: Connector request properties for an Amazon Bedrock connector +description: Defines properties for connectors when type is `.bedrock`. +type: object +required: + - apiUrl +properties: + apiUrl: + type: string + description: The Amazon Bedrock request URL. + defaultModel: + type: string + description: > + The generative artificial intelligence model for Amazon Bedrock to use. + Current support is for the Anthropic Claude models. + default: anthropic.claude-v2 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_bedrock.yaml new file mode 100644 index 0000000000000..0d3f308744aa3 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_bedrock.yaml @@ -0,0 +1,31 @@ +title: Connector response properties for an Amazon Bedrock connector +type: object +required: + - config + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name +properties: + config: + $ref: 'config_properties_bedrock.yaml' + connector_type_id: + type: string + description: The type of connector. + enum: + - .bedrock + id: + type: string + description: The identifier for the connector. + is_deprecated: + $ref: 'is_deprecated.yaml' + is_missing_secrets: + $ref: 'is_missing_secrets.yaml' + is_preconfigured: + $ref: 'is_preconfigured.yaml' + is_system_action: + $ref: 'is_system_action.yaml' + name: + type: string + description: The display name for the connector. diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml index 687648acd7141..5d0bc42ab8317 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml @@ -2,6 +2,7 @@ title: Connector types type: string description: The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. enum: + - .bedrock - .cases-webhook - .d3security - .email diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml new file mode 100644 index 0000000000000..2acc21bfbfac7 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml @@ -0,0 +1,23 @@ +title: Create Amazon Bedrock connector request +description: The Amazon Bedrock connector uses axios to send a POST request to Amazon Bedrock. +type: object +required: + - config + - connector_type_id + - name + - secrets +properties: + config: + $ref: 'config_properties_bedrock.yaml' + connector_type_id: + type: string + description: The type of connector. + enum: + - .bedrock + example: .bedrock + name: + type: string + description: The display name for the connector. + example: my-connector + secrets: + $ref: 'secrets_properties_bedrock.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_bedrock.yaml new file mode 100644 index 0000000000000..5f31baade28df --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_bedrock.yaml @@ -0,0 +1,13 @@ +title: Connector secrets properties for an Amazon Bedrock connector +description: Defines secrets for connectors when type is `.bedrock`. +type: object +required: + - accessKey + - secret +properties: + accessKey: + type: string + description: The AWS access key for authentication. + secret: + type: string + description: The AWS secret for authentication. diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_bedrock.yaml new file mode 100644 index 0000000000000..dfa479870aab5 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_bedrock.yaml @@ -0,0 +1,13 @@ +title: Update Amazon Bedrock connector request +type: object +required: + - config + - name +properties: + config: + $ref: 'config_properties_bedrock.yaml' + name: + type: string + description: The display name for the connector. + secrets: + $ref: 'secrets_properties_bedrock.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml index 62f2e1821eb8f..64712858fa8a0 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml @@ -16,6 +16,7 @@ post: title: Create connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '../components/schemas/create_connector_request_bedrock.yaml' - $ref: '../components/schemas/create_connector_request_cases_webhook.yaml' - $ref: '../components/schemas/create_connector_request_d3security.yaml' - $ref: '../components/schemas/create_connector_request_email.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml index d85e38cff5f75..7c1d402efaca4 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml @@ -100,6 +100,7 @@ post: title: Create connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '../components/schemas/create_connector_request_bedrock.yaml' - $ref: '../components/schemas/create_connector_request_cases_webhook.yaml' - $ref: '../components/schemas/create_connector_request_d3security.yaml' - $ref: '../components/schemas/create_connector_request_email.yaml' @@ -160,6 +161,7 @@ put: title: Update connector request body properties description: The properties vary depending on the connector type. oneOf: + - $ref: '../components/schemas/create_connector_request_bedrock.yaml' - $ref: '../components/schemas/update_connector_request_cases_webhook.yaml' - $ref: '../components/schemas/update_connector_request_d3security.yaml' - $ref: '../components/schemas/update_connector_request_email.yaml'