Skip to content

Commit

Permalink
Generated Endpoints Using OpenSearch API Specifications: Phase II (#206)
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <saimedhi@amazon.com>
  • Loading branch information
saimedhi authored Jul 9, 2024
1 parent 96580eb commit fc749ea
Show file tree
Hide file tree
Showing 205 changed files with 7,444 additions and 2,189 deletions.
1,348 changes: 899 additions & 449 deletions src/OpenSearch/Client.php

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions src/OpenSearch/Endpoints/Bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
use OpenSearch\Serializers\SerializerInterface;
use Traversable;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Bulk extends AbstractEndpoint
{
public function __construct(SerializerInterface $serializer)
Expand All @@ -36,7 +39,6 @@ public function __construct(SerializerInterface $serializer)
public function getURI(): string
{
$index = $this->index ?? null;

if (isset($index)) {
return "/$index/_bulk";
}
Expand All @@ -46,15 +48,20 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'wait_for_active_shards',
'refresh',
'routing',
'timeout',
'_source',
'_source_excludes',
'_source_includes',
'pipeline',
'require_alias'
'refresh',
'require_alias',
'routing',
'timeout',
'wait_for_active_shards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/OpenSearch/Endpoints/Cat/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'expand_wildcards',
'format',
'local',
'h',
'help',
'local',
's',
'v',
'expand_wildcards',
'pretty',
'human',
'error_trace',
Expand Down
51 changes: 51 additions & 0 deletions src/OpenSearch/Endpoints/Cat/AllPitSegments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class AllPitSegments extends AbstractEndpoint
{
public function getURI(): string
{
return "/_cat/pit_segments/_all";
}

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

public function getMethod(): string
{
return 'GET';
}
}
6 changes: 3 additions & 3 deletions src/OpenSearch/Endpoints/Cat/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'bytes',
'local',
'master_timeout',
'cluster_manager_timeout',
'format',
'h',
'help',
'local',
'master_timeout',
's',
'v',
'pretty',
Expand Down
20 changes: 17 additions & 3 deletions src/OpenSearch/Endpoints/Cat/ClusterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class ClusterManager extends AbstractEndpoint
{
public function getURI(): string
Expand All @@ -33,18 +36,29 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'local',
'cluster_manager_timeout',
'format',
'h',
'help',
'local',
'master_timeout',
'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'];
}
}
4 changes: 2 additions & 2 deletions src/OpenSearch/Endpoints/Cat/Fielddata.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'bytes',
'fields',
'format',
'h',
'help',
's',
'v',
'fields',
'pretty',
'human',
'error_trace',
Expand Down
2 changes: 0 additions & 2 deletions src/OpenSearch/Endpoints/Cat/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'help',
's',
'pretty',
'human',
'error_trace',
Expand Down
10 changes: 5 additions & 5 deletions src/OpenSearch/Endpoints/Cat/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'bytes',
'local',
'master_timeout',
'cluster_manager_timeout',
'expand_wildcards',
'format',
'h',
'health',
'help',
'include_unloaded_segments',
'local',
'master_timeout',
'pri',
's',
'time',
'v',
'include_unloaded_segments',
'expand_wildcards',
'pretty',
'human',
'error_trace',
Expand Down
17 changes: 13 additions & 4 deletions src/OpenSearch/Endpoints/Cat/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
use OpenSearch\Endpoints\AbstractEndpoint;

/**
* @deprecated use \OpenSearch\Endpoints\Cat\ClusterManager instead
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
/**
* @deprecated To promote inclusive language, please use '/_cat/cluster_manager' instead.
*/
class Master extends AbstractEndpoint
{
Expand All @@ -36,21 +39,27 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'cluster_manager_timeout',
'format',
'local',
'master_timeout',
'h',
'help',
'local',
'master_timeout',
'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
6 changes: 3 additions & 3 deletions src/OpenSearch/Endpoints/Cat/NodeAttrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'format',
'h',
'help',
'local',
'master_timeout',
's',
'v',
'pretty',
Expand Down
6 changes: 3 additions & 3 deletions src/OpenSearch/Endpoints/Cat/Nodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function getParamWhitelist(): array
{
return [
'bytes',
'cluster_manager_timeout',
'format',
'full_id',
'local',
'master_timeout',
'cluster_manager_timeout',
'h',
'help',
'local',
'master_timeout',
's',
'time',
'v',
Expand Down
6 changes: 3 additions & 3 deletions src/OpenSearch/Endpoints/Cat/PendingTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'format',
'h',
'help',
'local',
'master_timeout',
's',
'time',
'v',
Expand Down
61 changes: 61 additions & 0 deletions src/OpenSearch/Endpoints/Cat/PitSegments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class PitSegments extends AbstractEndpoint
{
public function getURI(): string
{
return "/_cat/pit_segments";
}

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

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

public function setBody($body): PitSegments
{
if (isset($body) !== true) {
return $this;
}
$this->body = $body;

return $this;
}
}
6 changes: 3 additions & 3 deletions src/OpenSearch/Endpoints/Cat/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'local',
'master_timeout',
'cluster_manager_timeout',
'format',
'h',
'help',
'local',
'master_timeout',
's',
'v',
'pretty',
Expand Down
Loading

0 comments on commit fc749ea

Please sign in to comment.