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 code using OpenSearch API spec #205

Closed
wants to merge 1 commit 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
  •  
  •  
  •  
1,376 changes: 922 additions & 454 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
13 changes: 10 additions & 3 deletions src/OpenSearch/Endpoints/Cat/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Aliases extends AbstractEndpoint
{
protected $name;

public function getURI(): string
{
$name = $this->name ?? null;

if (isset($name)) {
return "/_cat/aliases/$name";
}
Expand All @@ -40,13 +42,18 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'expand_wildcards',
'format',
'local',
'h',
'help',
'local',
's',
'v',
'expand_wildcards'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

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';
}
}
17 changes: 12 additions & 5 deletions src/OpenSearch/Endpoints/Cat/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Allocation extends AbstractEndpoint
{
protected $node_id;

public function getURI(): string
{
$node_id = $this->node_id ?? null;

if (isset($node_id)) {
return "/_cat/allocation/$node_id";
}
Expand All @@ -40,15 +42,20 @@ 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',
'cluster_manager_timeout'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

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'];
}
}
11 changes: 9 additions & 2 deletions src/OpenSearch/Endpoints/Cat/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Count extends AbstractEndpoint
{
public function getURI(): string
{
$index = $this->index ?? null;

if (isset($index)) {
return "/_cat/count/$index";
}
Expand All @@ -42,7 +44,12 @@ public function getParamWhitelist(): array
'h',
'help',
's',
'v'
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
13 changes: 10 additions & 3 deletions src/OpenSearch/Endpoints/Cat/Fielddata.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Fielddata extends AbstractEndpoint
{
protected $fields;

public function getURI(): string
{
$fields = $this->fields ?? null;

if (isset($fields)) {
return "/_cat/fielddata/$fields";
}
Expand All @@ -40,13 +42,18 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'format',
'bytes',
'fields',
'format',
'h',
'help',
's',
'v',
'fields'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
10 changes: 9 additions & 1 deletion src/OpenSearch/Endpoints/Cat/Health.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 Health extends AbstractEndpoint
{
public function getURI(): string
Expand All @@ -39,7 +42,12 @@ public function getParamWhitelist(): array
's',
'time',
'ts',
'v'
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
10 changes: 8 additions & 2 deletions src/OpenSearch/Endpoints/Cat/Help.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 Help extends AbstractEndpoint
{
public function getURI(): string
Expand All @@ -33,8 +36,11 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'help',
's'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

Expand Down
22 changes: 15 additions & 7 deletions src/OpenSearch/Endpoints/Cat/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Indices extends AbstractEndpoint
{
public function getURI(): string
{
$index = $this->index ?? null;

if (isset($index)) {
return "/_cat/indices/$index";
}
Expand All @@ -38,27 +40,33 @@ 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',
'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