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

Updated opensearch-php to reflect the latest OpenSearch API spec #241

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Fixed PHP 8.4 deprecations
### Updated APIs
- Updated opensearch-php APIs to reflect [opensearch-api-specification@c400057](https://github.com/opensearch-project/opensearch-api-specification/commit/c400057d94d5e034c9457b32d175d1e3e6439c26)
- Updated opensearch-php APIs to reflect [opensearch-api-specification@398481e](https://github.com/opensearch-project/opensearch-api-specification/commit/398481e5bd1cc590d947c35379c47096f2114f00)
- Updated opensearch-php APIs to reflect [opensearch-api-specification@6bb1fed](https://github.com/opensearch-project/opensearch-api-specification/commit/6bb1fed0a2c7cf094a5ecfdb01f0306a4b9f8eba)
- Updated opensearch-php APIs to reflect [opensearch-api-specification@07e329e](https://github.com/opensearch-project/opensearch-api-specification/commit/07e329e8d01fd0576de6a0a3c35412fd5a9163db)
Expand Down
112 changes: 63 additions & 49 deletions src/OpenSearch/Client.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/OpenSearch/Endpoints/Cat/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
/**
* @deprecated To promote inclusive language, please use '/_cat/cluster_manager' instead.
* @deprecated To promote inclusive language, use '/_cat/cluster_manager' instead.
*/
class Master extends AbstractEndpoint
{
Expand Down
2 changes: 0 additions & 2 deletions src/OpenSearch/Endpoints/Indices/SimulateIndexTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
'cause',
'cluster_manager_timeout',
'create',
'master_timeout',
'pretty',
'human',
Expand Down
1 change: 1 addition & 0 deletions src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function getURI(): string
public function getParamWhitelist(): array
{
return [
's',
'pretty',
'human',
'error_trace',
Expand Down
45 changes: 45 additions & 0 deletions src/OpenSearch/Endpoints/Replication/AutofollowStats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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\Replication;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class AutofollowStats extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_replication/autofollow_stats";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
55 changes: 55 additions & 0 deletions src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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\Replication;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class CreateReplicationRule extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_replication/_autofollow";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

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

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

return $this;
}
}
55 changes: 55 additions & 0 deletions src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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\Replication;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class DeleteReplicationRule extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_replication/_autofollow";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

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

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

return $this;
}
}
45 changes: 45 additions & 0 deletions src/OpenSearch/Endpoints/Replication/FollowerStats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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\Replication;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class FollowerStats extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_replication/follower_stats";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
45 changes: 45 additions & 0 deletions src/OpenSearch/Endpoints/Replication/LeaderStats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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\Replication;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class LeaderStats extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_replication/leader_stats";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
60 changes: 60 additions & 0 deletions src/OpenSearch/Endpoints/Replication/Pause.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?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\Replication;

use OpenSearch\Common\Exceptions\RuntimeException;
use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Pause extends AbstractEndpoint
{
public function getURI(): string
{
$index = $this->index ?? null;
if (isset($index)) {
return "/_plugins/_replication/$index/_pause";
}
throw new RuntimeException('Missing parameter for the endpoint replication.pause');
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

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

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

return $this;
}
}
Loading