Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Adds connector endpoints #89

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/elasticsearch-serverless/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def perform_request(method, path, params = {}, body = nil, headers = nil)
:async_search,
:cat,
:cluster,
:connector,
:enrich,
:eql,
:esql,
Expand Down
57 changes: 57 additions & 0 deletions lib/elasticsearch-serverless/api/connector/check_in.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Updates the last_seen field in the connector, and sets it to current timestamp
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [String] :connector_id The unique identifier of the connector to be checked in (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/check-in-connector-api.html
#
def check_in(arguments = {})
raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_connector_id = arguments.delete(:connector_id)

method = ElasticsearchServerless::API::HTTP_PUT
path = "_connector/#{Utils.listify(_connector_id)}/_check_in"
params = {}

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
58 changes: 58 additions & 0 deletions lib/elasticsearch-serverless/api/connector/delete.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Deletes a connector.
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [String] :connector_id The unique identifier of the connector to be deleted (*Required*)
# @option arguments [Boolean] :delete_sync_jobs Determines whether associated sync jobs are also deleted. (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-api.html
#
def delete(arguments = {})
raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_connector_id = arguments.delete(:connector_id)

method = ElasticsearchServerless::API::HTTP_DELETE
path = "_connector/#{Utils.listify(_connector_id)}"
params = Utils.process_params(arguments)

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
57 changes: 57 additions & 0 deletions lib/elasticsearch-serverless/api/connector/get.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Retrieves a connector.
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [String] :connector_id The unique identifier of the connector (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-api.html
#
def get(arguments = {})
raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_connector_id = arguments.delete(:connector_id)

method = ElasticsearchServerless::API::HTTP_GET
path = "_connector/#{Utils.listify(_connector_id)}"
params = {}

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
59 changes: 59 additions & 0 deletions lib/elasticsearch-serverless/api/connector/last_sync.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Updates last sync stats in the connector document
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-last-sync-api.html
#
def last_sync(arguments = {})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

_connector_id = arguments.delete(:connector_id)

method = ElasticsearchServerless::API::HTTP_PUT
path = "_connector/#{Utils.listify(_connector_id)}/_last_sync"
params = {}

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
58 changes: 58 additions & 0 deletions lib/elasticsearch-serverless/api/connector/list.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Returns existing connectors.
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [Integer] :from Starting offset (default: 0)
# @option arguments [Integer] :size Specifies a max number of results to get
# @option arguments [String, Array] :index_name A comma-separated list of connector index names to fetch connector documents for
# @option arguments [String, Array<String>] :connector_name A comma-separated list of connector names to fetch connector documents for
# @option arguments [String, Array<String>] :service_type A comma-separated list of connector service types to fetch connector documents for
# @option arguments [String] :query A wildcard query string that filters connectors with matching name, description or index name
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-connector-api.html
#
def list(arguments = {})
arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

method = ElasticsearchServerless::API::HTTP_GET
path = "_connector"
params = Utils.process_params(arguments)

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
53 changes: 53 additions & 0 deletions lib/elasticsearch-serverless/api/connector/post.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module ElasticsearchServerless
module API
module Connector
module Actions
# Creates a connector.
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-api.html
#
def post(arguments = {})
arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

method = ElasticsearchServerless::API::HTTP_POST
path = "_connector"
params = {}

ElasticsearchServerless::API::Response.new(
perform_request(method, path, params, body, headers)
)
end
end
end
end
end
Loading
Loading