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

Auto-generated code for 8.x #2492

Merged
merged 2 commits into from
Oct 14, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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 build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
#
module Elasticsearch
module API
module Ingest
module Actions
# Deletes an ip location database configuration
#
# @option arguments [List] :id A comma-separated list of ip location database configurations to delete
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-ip-location-database-api.html
#
def delete_ip_location_database(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'ingest.delete_ip_location_database' }

defined_params = [:id].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

body = nil

_id = arguments.delete(:id)

method = Elasticsearch::API::HTTP_DELETE
path = "_ingest/ip_location/database/#{Utils.__listify(_id)}"
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
#
module Elasticsearch
module API
module Ingest
module Actions
# Returns the specified ip location database configuration
#
# @option arguments [List] :id A comma-separated list of ip location database configurations to get; use `*` to get all ip location database configurations
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.16/get-ip-location-database-api.html
#
def get_ip_location_database(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'ingest.get_ip_location_database' }

defined_params = [:id].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

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

body = nil

_id = arguments.delete(:id)

method = Elasticsearch::API::HTTP_GET
path = if _id
"_ingest/ip_location/database/#{Utils.__listify(_id)}"
else
'_ingest/ip_location/database'
end
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
#
module Elasticsearch
module API
module Ingest
module Actions
# Puts the configuration for a ip location database to be downloaded
#
# @option arguments [String] :id The id of the database configuration
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body The database configuration definition (*Required*)
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.16/put-ip-location-database-api.html
#
def put_ip_location_database(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'ingest.put_ip_location_database' }

defined_params = [:id].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

body = arguments.delete(:body)

_id = arguments.delete(:id)

method = Elasticsearch::API::HTTP_PUT
path = "_ingest/ip_location/database/#{Utils.__listify(_id)}"
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.

require 'spec_helper'

describe 'client.ingest#delete_ip_location_database' do
let(:expected_args) do
[
'DELETE',
'_ingest/ip_location/database/foo',
{},
nil,
{},
{ defined_params: { id: 'foo' }, endpoint: 'ingest.delete_ip_location_database' }
]
end

let(:client) do
Class.new { include Elasticsearch::API }.new
end

it 'performs the request' do
expect(client_double.ingest.delete_ip_location_database(id: 'foo', body: {})).to be_a Elasticsearch::API::Response
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.

require 'spec_helper'

describe 'client.ingest#get_ip_location_database' do
let(:expected_args) do
[
'GET',
'_ingest/ip_location/database/foo',
{},
nil,
{},
{ defined_params: { id: 'foo' }, endpoint: 'ingest.get_ip_location_database' }
]
end

let(:client) do
Class.new { include Elasticsearch::API }.new
end

it 'performs the request' do
expect(client_double.ingest.get_ip_location_database(id: 'foo', body: {})).to be_a Elasticsearch::API::Response
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.

require 'spec_helper'

describe 'client.ingest#put_ip_location_database' do
let(:expected_args) do
[
'PUT',
'_ingest/ip_location/database/foo',
{},
{},
{},
{ defined_params: { id: 'foo' }, endpoint: 'ingest.put_ip_location_database' }
]
end

let(:client) do
Class.new { include Elasticsearch::API }.new
end

it 'requires the :id argument' do
expect {
client.ingest.put_ip_location_database
}.to raise_exception(ArgumentError)
end

it 'performs the request' do
expect(client_double.ingest.put_ip_location_database(id: 'foo', body: {})).to be_a Elasticsearch::API::Response
end
end
6 changes: 6 additions & 0 deletions elasticsearch-api/spec/rest_api/skipped_tests_free.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,9 @@
-
:file: 'ingest_geoip/40_geoip_databases.yml'
:description: 'Test adding, getting, and removing geoip databases'
-
:file: 'ingest_geoip/50_ip_lookup_processor.yml'
:description: '*'
-
:file: 'ingest_geoip/60_ip_location_databases.yml'
:description: '*'