Przeglądaj źródła

[Connector API] Document get, list and delete endpoints (#103306)

Jedr Blaszyk 1 rok temu
rodzic
commit
36eb1b7c81

+ 6 - 0
docs/reference/connector/apis/connector-apis.asciidoc

@@ -23,6 +23,9 @@ You can use these APIs to create, get, delete and update connectors.
 Use the following APIs to manage connectors:
 
 * <<create-connector-api>>
+* <<delete-connector-api>>
+* <<get-connector-api>>
+* <<list-connector-api>>
 
 
 [discrete]
@@ -35,3 +38,6 @@ Use the following APIs to manage sync jobs:
 
 
 include::create-connector-api.asciidoc[]
+include::delete-connector-api.asciidoc[]
+include::get-connector-api.asciidoc[]
+include::list-connectors-api.asciidoc[]

+ 66 - 0
docs/reference/connector/apis/delete-connector-api.asciidoc

@@ -0,0 +1,66 @@
+[[delete-connector-api]]
+=== Delete connector API
+
+preview::[]
+
+++++
+<titleabbrev>Delete connector</titleabbrev>
+++++
+
+Removes a connector and its associated data.
+This is a destructive action that is not recoverable.
+
+[[delete-connector-api-request]]
+==== {api-request-title}
+
+`DELETE _connector/<connector_id>`
+
+[[delete-connector-api-prereq]]
+==== {api-prereq-title}
+
+* To sync data using connectors, it's essential to have the Elastic connectors service running.
+
+[[delete-connector-api-path-params]]
+==== {api-path-parms-title}
+
+`<connector_id>`::
+(Required, string)
+
+[[delete-connector-api-response-codes]]
+==== {api-response-codes-title}
+
+`400`::
+The `connector_id` was not provided.
+
+`404` (Missing resources)::
+No connector matching `connector_id` could be found.
+
+[[delete-connector-api-example]]
+==== {api-examples-title}
+
+The following example deletes the connector with ID `my-connector`:
+
+////
+[source, console]
+--------------------------------------------------
+PUT _connector/my-connector
+{
+  "index_name": "search-google-drive",
+  "name": "My Connector",
+  "service_type": "google_drive"
+}
+--------------------------------------------------
+// TESTSETUP
+////
+
+[source,console]
+----
+DELETE _connector/my-connector
+----
+
+[source,console-result]
+----
+{
+    "acknowledged": true
+}
+----

+ 63 - 0
docs/reference/connector/apis/get-connector-api.asciidoc

@@ -0,0 +1,63 @@
+[[get-connector-api]]
+=== Get connector API
+preview::[]
+++++
+<titleabbrev>Get connector</titleabbrev>
+++++
+
+Retrieves the details about a connector.
+
+[[get-connector-api-request]]
+==== {api-request-title}
+
+`GET _connector/<connector_id>`
+
+[[get-connector-api-prereq]]
+==== {api-prereq-title}
+
+* To sync data using connectors, it's essential to have the Elastic connectors service running.
+
+[[get-connector-api-path-params]]
+==== {api-path-parms-title}
+
+`<connector_id>`::
+(Required, string)
+
+[[get-connector-api-response-codes]]
+==== {api-response-codes-title}
+
+`400`::
+The `connector_id` was not provided.
+
+`404` (Missing resources)::
+No connector matching `connector_id` could be found.
+
+[[get-connector-api-example]]
+==== {api-examples-title}
+
+The following example gets the connector `my-connector`:
+
+////
+[source,console]
+--------------------------------------------------
+PUT _connector/my-connector
+{
+  "index_name": "search-google-drive",
+  "name": "Google Drive Connector",
+  "service_type": "google_drive"
+}
+
+--------------------------------------------------
+// TESTSETUP
+
+[source,console]
+--------------------------------------------------
+DELETE _connector/my-connector
+--------------------------------------------------
+// TEARDOWN
+////
+
+[source,console]
+----
+GET _connector/my-connector
+----

+ 77 - 0
docs/reference/connector/apis/list-connectors-api.asciidoc

@@ -0,0 +1,77 @@
+[role="xpack"]
+[[list-connector-api]]
+=== List connectors API
+
+preview::[]
+
+++++
+<titleabbrev>List connectors</titleabbrev>
+++++
+
+Returns information about all stored connectors.
+
+
+[[list-connector-api-request]]
+==== {api-request-title}
+
+`GET _connector`
+
+[[list-connector-api-prereq]]
+==== {api-prereq-title}
+
+* To sync data using connectors, it's essential to have the Elastic connectors service running.
+
+[[list-connector-api-path-params]]
+==== {api-path-parms-title}
+
+`size`::
+(Optional, integer) Maximum number of results to retrieve.
+
+`from`::
+(Optional, integer) The offset from the first result to fetch.
+
+[[list-connector-api-example]]
+==== {api-examples-title}
+
+The following example lists all connectors:
+
+////
+[source,console]
+--------------------------------------------------
+PUT _connector/connector-1
+{
+  "index_name": "search-google-drive",
+  "name": "Google Drive Connector",
+  "service_type": "google_drive"
+}
+
+PUT _connector/connector-2
+{
+  "index_name": "search-sharepoint-online",
+  "name": "Sharepoint Online Connector",
+  "service_type": "sharepoint_online"
+}
+
+--------------------------------------------------
+// TESTSETUP
+
+[source,console]
+--------------------------------------------------
+DELETE _connector/connector-1
+
+DELETE _connector/connector-2
+--------------------------------------------------
+// TEARDOWN
+////
+
+[source,console]
+----
+GET _connector
+----
+
+The following example lists the first two connectors:
+
+[source,console]
+----
+GET _connector/?from=0&size=2
+----