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

Generated Endpoints Using OpenSearch API Specifications #195

Closed
wants to merge 2 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"ext-json": ">=1.3.7",
"ext-curl": "*",
"ezimuel/ringphp": "^1.1.2",
"psr/log": "^1|^2|^3"
"psr/log": "^1|^2|^3",
"symfony/yaml": "*"
},
"require-dev": {
"ext-zip": "*",
Expand Down
1,323 changes: 823 additions & 500 deletions src/OpenSearch/Client.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/OpenSearch/Endpoints/AbstractEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

use OpenSearch\Common\Exceptions\UnexpectedValueException;
use OpenSearch\Serializers\SerializerInterface;

use function array_filter;

abstract class AbstractEndpoint
Expand Down
48 changes: 0 additions & 48 deletions src/OpenSearch/Endpoints/AsyncSearch/Delete.php

This file was deleted.

52 changes: 0 additions & 52 deletions src/OpenSearch/Endpoints/AsyncSearch/Get.php

This file was deleted.

7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public function getParamWhitelist(): array
'_source_excludes',
'_source_includes',
'pipeline',
'require_alias'
'require_alias',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ public function getParamWhitelist(): array
'help',
's',
'v',
'expand_wildcards'
'expand_wildcards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
48 changes: 48 additions & 0 deletions src/OpenSearch/Endpoints/Cat/AllPitSegments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

declare(strict_types=1);

/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

namespace OpenSearch\Endpoints\Cat;

use OpenSearch\Endpoints\AbstractEndpoint;

class AllPitSegments extends AbstractEndpoint
{
public function getURI(): string
{
return "/_cat/pit_segments/_all";
}

public function getParamWhitelist(): array
{
return [
'format',
'h',
'help',
's',
'v',
'bytes',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ public function getParamWhitelist(): array
'bytes',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'help',
's',
'v',
'cluster_manager_timeout'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
13 changes: 12 additions & 1 deletion src/OpenSearch/Endpoints/Cat/ClusterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,27 @@ public function getParamWhitelist(): array
return [
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'help',
's',
'v'
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}

protected function getParamDeprecation(): array
{
return ['master_timeout' => 'cluster_manager_timeout'];
}
}
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function getParamWhitelist(): array
'h',
'help',
's',
'v'
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Fielddata.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ public function getParamWhitelist(): array
'help',
's',
'v',
'fields'
'fields',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ public function getParamWhitelist(): array
's',
'time',
'ts',
'v'
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
7 changes: 6 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public function getParamWhitelist(): array
{
return [
'help',
's'
's',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
8 changes: 7 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function getParamWhitelist(): array
'bytes',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'health',
'help',
Expand All @@ -51,14 +52,19 @@ public function getParamWhitelist(): array
'v',
'include_unloaded_segments',
'expand_wildcards',
'cluster_manager_timeout'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}

protected function getParamDeprecation(): array
{
return ['master_timeout' => 'cluster_manager_timeout'];
Expand Down
11 changes: 7 additions & 4 deletions src/OpenSearch/Endpoints/Cat/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* @deprecated use \OpenSearch\Endpoints\Cat\ClusterManager instead
*/
class Master extends AbstractEndpoint
{
public function getURI(): string
Expand All @@ -39,18 +36,24 @@ public function getParamWhitelist(): array
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'help',
's',
'v',
'cluster_manager_timeout'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}

protected function getParamDeprecation(): array
{
return ['master_timeout' => 'cluster_manager_timeout'];
Expand Down
8 changes: 7 additions & 1 deletion src/OpenSearch/Endpoints/Cat/NodeAttrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,24 @@ public function getParamWhitelist(): array
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'help',
's',
'v',
'cluster_manager_timeout'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}

protected function getParamDeprecation(): array
{
return ['master_timeout' => 'cluster_manager_timeout'];
Expand Down
Loading
Loading