Skip to content

Commit

Permalink
Updated opensearch-php to reflect the latest OpenSearch API spec (202…
Browse files Browse the repository at this point in the history
…4-12-13)

Signed-off-by: GitHub <[email protected]>
  • Loading branch information
dblock authored Dec 13, 2024
1 parent f110a17 commit 21ffdb1
Show file tree
Hide file tree
Showing 47 changed files with 1,943 additions and 275 deletions.
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@dd7fd9a](https://github.com/opensearch-project/opensearch-api-specification/commit/dd7fd9a0e4e1c3abb76cf53fb6c6d75fde144e46)
- 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
139 changes: 85 additions & 54 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
1 change: 1 addition & 0 deletions src/OpenSearch/Endpoints/Cat/Snapshots.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function getParamWhitelist(): array
'help',
'ignore_unavailable',
'master_timeout',
'repository',
's',
'time',
'v',
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
10 changes: 10 additions & 0 deletions src/OpenSearch/Endpoints/Indices/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,14 @@ public function getMethod(): string
{
return 'POST';
}

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

return $this;
}
}
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

0 comments on commit 21ffdb1

Please sign in to comment.