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

Merged
merged 1 commit into from
Dec 16, 2024
Merged
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@ebe0f8a](https://github.com/opensearch-project/opensearch-api-specification/commit/ebe0f8a885f7db7e882d160c101055a5aa70a707)
- 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 @@
'help',
'ignore_unavailable',
'master_timeout',
'repository',

Check warning on line 51 in src/OpenSearch/Endpoints/Cat/Snapshots.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Cat/Snapshots.php#L51

Added line #L51 was not covered by tests
'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 @@
{
return 'POST';
}

public function setBody($body): static

Check warning on line 61 in src/OpenSearch/Endpoints/Indices/Upgrade.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Indices/Upgrade.php#L61

Added line #L61 was not covered by tests
{
if (isset($body) !== true) {
return $this;

Check warning on line 64 in src/OpenSearch/Endpoints/Indices/Upgrade.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Indices/Upgrade.php#L63-L64

Added lines #L63 - L64 were not covered by tests
}
$this->body = $body;

Check warning on line 66 in src/OpenSearch/Endpoints/Indices/Upgrade.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Indices/Upgrade.php#L66

Added line #L66 was not covered by tests

return $this;

Check warning on line 68 in src/OpenSearch/Endpoints/Indices/Upgrade.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Indices/Upgrade.php#L68

Added line #L68 was not covered by tests
}
}
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 getParamWhitelist(): array
{
return [
's',

Check warning on line 39 in src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php#L39

Added line #L39 was not covered by tests
'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

Check warning on line 25 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L25

Added line #L25 was not covered by tests
{
return "/_plugins/_replication/autofollow_stats";

Check warning on line 27 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L27

Added line #L27 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L30

Added line #L30 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 38 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L32-L38

Added lines #L32 - L38 were not covered by tests
}

public function getMethod(): string

Check warning on line 41 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L41

Added line #L41 was not covered by tests
{
return 'GET';

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/AutofollowStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/AutofollowStats.php#L43

Added line #L43 was not covered by tests
}
}
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

Check warning on line 25 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L25

Added line #L25 was not covered by tests
{
return "/_plugins/_replication/_autofollow";

Check warning on line 27 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L27

Added line #L27 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L30

Added line #L30 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 38 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L32-L38

Added lines #L32 - L38 were not covered by tests
}

public function getMethod(): string

Check warning on line 41 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L41

Added line #L41 was not covered by tests
{
return 'POST';

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L43

Added line #L43 was not covered by tests
}

public function setBody($body): static

Check warning on line 46 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L46

Added line #L46 was not covered by tests
{
if (isset($body) !== true) {
return $this;

Check warning on line 49 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L48-L49

Added lines #L48 - L49 were not covered by tests
}
$this->body = $body;

Check warning on line 51 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L51

Added line #L51 was not covered by tests

return $this;

Check warning on line 53 in src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/CreateReplicationRule.php#L53

Added line #L53 was not covered by tests
}
}
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

Check warning on line 25 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L25

Added line #L25 was not covered by tests
{
return "/_plugins/_replication/_autofollow";

Check warning on line 27 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L27

Added line #L27 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L30

Added line #L30 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 38 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L32-L38

Added lines #L32 - L38 were not covered by tests
}

public function getMethod(): string

Check warning on line 41 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L41

Added line #L41 was not covered by tests
{
return 'DELETE';

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L43

Added line #L43 was not covered by tests
}

public function setBody($body): static

Check warning on line 46 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L46

Added line #L46 was not covered by tests
{
if (isset($body) !== true) {
return $this;

Check warning on line 49 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L48-L49

Added lines #L48 - L49 were not covered by tests
}
$this->body = $body;

Check warning on line 51 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L51

Added line #L51 was not covered by tests

return $this;

Check warning on line 53 in src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/DeleteReplicationRule.php#L53

Added line #L53 was not covered by tests
}
}
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

Check warning on line 25 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L25

Added line #L25 was not covered by tests
{
return "/_plugins/_replication/follower_stats";

Check warning on line 27 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L27

Added line #L27 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L30

Added line #L30 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 38 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L32-L38

Added lines #L32 - L38 were not covered by tests
}

public function getMethod(): string

Check warning on line 41 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L41

Added line #L41 was not covered by tests
{
return 'GET';

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/FollowerStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/FollowerStats.php#L43

Added line #L43 was not covered by tests
}
}
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

Check warning on line 25 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L25

Added line #L25 was not covered by tests
{
return "/_plugins/_replication/leader_stats";

Check warning on line 27 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L27

Added line #L27 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L30

Added line #L30 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 38 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L32-L38

Added lines #L32 - L38 were not covered by tests
}

public function getMethod(): string

Check warning on line 41 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L41

Added line #L41 was not covered by tests
{
return 'GET';

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/LeaderStats.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/LeaderStats.php#L43

Added line #L43 was not covered by tests
}
}
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

Check warning on line 26 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L26

Added line #L26 was not covered by tests
{
$index = $this->index ?? null;
if (isset($index)) {
return "/_plugins/_replication/$index/_pause";

Check warning on line 30 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L28-L30

Added lines #L28 - L30 were not covered by tests
}
throw new RuntimeException('Missing parameter for the endpoint replication.pause');

Check warning on line 32 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L32

Added line #L32 was not covered by tests
}

public function getParamWhitelist(): array

Check warning on line 35 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L35

Added line #L35 was not covered by tests
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];

Check warning on line 43 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L37-L43

Added lines #L37 - L43 were not covered by tests
}

public function getMethod(): string

Check warning on line 46 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L46

Added line #L46 was not covered by tests
{
return 'POST';

Check warning on line 48 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L48

Added line #L48 was not covered by tests
}

public function setBody($body): static

Check warning on line 51 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L51

Added line #L51 was not covered by tests
{
if (isset($body) !== true) {
return $this;

Check warning on line 54 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L53-L54

Added lines #L53 - L54 were not covered by tests
}
$this->body = $body;

Check warning on line 56 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L56

Added line #L56 was not covered by tests

return $this;

Check warning on line 58 in src/OpenSearch/Endpoints/Replication/Pause.php

View check run for this annotation

Codecov / codecov/patch

src/OpenSearch/Endpoints/Replication/Pause.php#L58

Added line #L58 was not covered by tests
}
}
Loading
Loading