Skip to content

Commit

Permalink
Generate API
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Pepper <[email protected]>
  • Loading branch information
kimpepper committed Nov 14, 2024
1 parent bbdd851 commit d69d2ac
Show file tree
Hide file tree
Showing 28 changed files with 891 additions and 897 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@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)
- Updated opensearch-php APIs to reflect [opensearch-api-specification@1db1840](https://github.com/opensearch-project/opensearch-api-specification/commit/1db184063a463c5180a2cc824b1efc1aeebfd5eb)
Expand Down
336 changes: 181 additions & 155 deletions src/OpenSearch/Client.php

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/OpenSearch/Namespaces/AsynchronousSearchNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function delete(array $params = [])
{
$id = $this->extractArgument($params, 'id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('AsynchronousSearch\Delete');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Delete::class);
$endpoint->setParams($params);
$endpoint->setId($id);

return $this->performRequest($endpoint);
}

/**
* Get partial responses from asynchronous search.
*
Expand All @@ -65,13 +65,13 @@ public function get(array $params = [])
{
$id = $this->extractArgument($params, 'id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('AsynchronousSearch\Get');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Get::class);
$endpoint->setParams($params);
$endpoint->setId($id);

return $this->performRequest($endpoint);
}

/**
* Perform an asynchronous search.
*
Expand All @@ -92,13 +92,13 @@ public function search(array $params = [])
{
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('AsynchronousSearch\Search');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Search::class);
$endpoint->setParams($params);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
* Monitoring of asynchronous searches that are running, completed, and/or persisted.
*
Expand All @@ -113,10 +113,10 @@ public function search(array $params = [])
*/
public function stats(array $params = [])
{
$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('AsynchronousSearch\Stats');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Stats::class);
$endpoint->setParams($params);

return $this->performRequest($endpoint);
}

}
124 changes: 62 additions & 62 deletions src/OpenSearch/Namespaces/CatNamespace.php

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions src/OpenSearch/Namespaces/ClusterNamespace.php

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/OpenSearch/Namespaces/DanglingIndicesNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function deleteDanglingIndex(array $params = [])
{
$index_uuid = $this->extractArgument($params, 'index_uuid');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('DanglingIndices\DeleteDanglingIndex');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\DeleteDanglingIndex::class);
$endpoint->setParams($params);
$endpoint->setIndexUuid($index_uuid);

return $this->performRequest($endpoint);
}

/**
* Imports the specified dangling index.
*
Expand All @@ -79,15 +79,15 @@ public function importDanglingIndex(array $params = [])
{
$index_uuid = $this->extractArgument($params, 'index_uuid');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('DanglingIndices\ImportDanglingIndex');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\ImportDanglingIndex::class);
$endpoint->setParams($params);
$endpoint->setIndexUuid($index_uuid);

return $this->performRequest($endpoint);
}

/**
* Returns all dangling indices.
* Returns all dangling indexes.
*
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
* $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
Expand All @@ -100,10 +100,10 @@ public function importDanglingIndex(array $params = [])
*/
public function listDanglingIndices(array $params = [])
{
$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('DanglingIndices\ListDanglingIndices');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\ListDanglingIndices::class);
$endpoint->setParams($params);

return $this->performRequest($endpoint);
}

}
40 changes: 20 additions & 20 deletions src/OpenSearch/Namespaces/FlowFrameworkNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function create(array $params = [])
{
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Create');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Create::class);
$endpoint->setParams($params);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
* Delete a workflow.
*
Expand All @@ -70,13 +70,13 @@ public function delete(array $params = [])
{
$workflow_id = $this->extractArgument($params, 'workflow_id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Delete');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Delete::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);

return $this->performRequest($endpoint);
}

/**
* Deprovision workflow's resources when you no longer need it.
*
Expand All @@ -95,13 +95,13 @@ public function deprovision(array $params = [])
{
$workflow_id = $this->extractArgument($params, 'workflow_id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Deprovision');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Deprovision::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);

return $this->performRequest($endpoint);
}

/**
* Get a workflow.
*
Expand All @@ -119,13 +119,13 @@ public function get(array $params = [])
{
$workflow_id = $this->extractArgument($params, 'workflow_id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Get');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Get::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);

return $this->performRequest($endpoint);
}

/**
* Get the provisioning deployment status until it is complete.
*
Expand All @@ -144,13 +144,13 @@ public function getStatus(array $params = [])
{
$workflow_id = $this->extractArgument($params, 'workflow_id');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\GetStatus');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\GetStatus::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);

return $this->performRequest($endpoint);
}

/**
* Get a list of workflow steps.
*
Expand All @@ -166,12 +166,12 @@ public function getStatus(array $params = [])
*/
public function getSteps(array $params = [])
{
$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\GetSteps');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\GetSteps::class);
$endpoint->setParams($params);

return $this->performRequest($endpoint);
}

/**
* Provisioning a workflow. This API is also executed when the Create or Update Workflow API is called with the provision parameter set to true.
*
Expand All @@ -190,14 +190,14 @@ public function provision(array $params = [])
$workflow_id = $this->extractArgument($params, 'workflow_id');
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Provision');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Provision::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
* Search for workflows by using a query matching a field.
*
Expand All @@ -214,13 +214,13 @@ public function search(array $params = [])
{
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Search');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Search::class);
$endpoint->setParams($params);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
* Search for workflows by using a query matching a field.
*
Expand All @@ -237,13 +237,13 @@ public function searchState(array $params = [])
{
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\SearchState');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\SearchState::class);
$endpoint->setParams($params);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
* Update a workflow. You can only update a complete workflow if it has not yet been provisioned.
*
Expand All @@ -267,12 +267,12 @@ public function update(array $params = [])
$workflow_id = $this->extractArgument($params, 'workflow_id');
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('FlowFramework\Update');
$endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\FlowFramework\Update::class);
$endpoint->setParams($params);
$endpoint->setWorkflowId($workflow_id);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

}
Loading

0 comments on commit d69d2ac

Please sign in to comment.