diff --git a/util/ClientEndpoint.php b/util/ClientEndpoint.php index 1acec505..2e3a9f54 100644 --- a/util/ClientEndpoint.php +++ b/util/ClientEndpoint.php @@ -50,7 +50,7 @@ public function renderClass(): string $useNamespace = ''; // The following namespaces do not have OpenSearch API specifications - $patchnamespaces = ['async_search', 'searchable_snapshots', 'ssl', 'sql', 'data_frame_transform_deprecated', 'monitoring']; + $patchnamespaces = ['async_search', 'searchable_snapshots', 'ssl', 'data_frame_transform_deprecated', 'monitoring']; $this->namespace = array_unique(array_merge($this->namespace, $patchnamespaces)); sort($this->namespace); diff --git a/util/EndpointProxies/sql/closeCursorProxy.php b/util/EndpointProxies/sql/closeCursorProxy.php new file mode 100644 index 00000000..f8f4502f --- /dev/null +++ b/util/EndpointProxies/sql/closeCursorProxy.php @@ -0,0 +1,24 @@ +endpoints; + + $endpoint = $endpointBuilder('Sql\Close'); + $endpoint->setBody(array_filter([ + 'cursor' => $this->extractArgument($params, 'cursor'), + ])); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +EOD; diff --git a/util/EndpointProxies/sql/explainProxy.php b/util/EndpointProxies/sql/explainProxy.php new file mode 100644 index 00000000..ac0a89ce --- /dev/null +++ b/util/EndpointProxies/sql/explainProxy.php @@ -0,0 +1,27 @@ +endpoints; + + $body = $this->extractArgument($params, 'body') ?? []; + $query = $this->extractArgument($params, 'query'); + + $endpoint = $endpointBuilder('Sql\Explain'); + $endpoint->setBody(array_merge($body, [ + 'query' => $query, + ])); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +EOD; diff --git a/util/EndpointProxies/sql/queryProxy.php b/util/EndpointProxies/sql/queryProxy.php new file mode 100644 index 00000000..b4d2e439 --- /dev/null +++ b/util/EndpointProxies/sql/queryProxy.php @@ -0,0 +1,31 @@ +endpoints; + + $endpoint = $endpointBuilder('Sql\Query'); + $body = $this->extractArgument($params, 'body') ?? []; + $endpoint->setBody(array_merge($body, array_filter([ + 'query' => $this->extractArgument($params, 'query'), + 'cursor' => $this->extractArgument($params, 'cursor'), + 'fetch_size' => $this->extractArgument($params, 'fetch_size'), + ]))); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +EOD;