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-11-19)

Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
dblock authored Nov 19, 2024
1 parent f110a17 commit 60add85
Show file tree
Hide file tree
Showing 25 changed files with 1,084 additions and 187 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@ccce065](https://github.com/opensearch-project/opensearch-api-specification/commit/ccce0656eecca26f18d4ba06ece9155d96b15d7a)
- 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
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;
}
}
60 changes: 60 additions & 0 deletions src/OpenSearch/Endpoints/Replication/Resume.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 Resume extends AbstractEndpoint
{
public function getURI(): string
{
$index = $this->index ?? null;
if (isset($index)) {
return "/_plugins/_replication/$index/_resume";
}
throw new RuntimeException('Missing parameter for the endpoint replication.resume');
}

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 60add85

Please sign in to comment.