Skip to content

Commit

Permalink
Updated endpoints to 8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Nov 7, 2022
1 parent fe79250 commit 0cb27bf
Show file tree
Hide file tree
Showing 13 changed files with 295 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 8.5.0 (2022-11-07)

Release compatible with Enterprise Search, App Search and Workplace Search 8.5.

## 8.4.0 (2022-08-24)

Release compatible with Enterprise Search, App Search and Workplace Search 8.3.
Release compatible with Enterprise Search, App Search and Workplace Search 8.4.

This release includes the following fixes:

Expand Down
6 changes: 4 additions & 2 deletions src/AppSearch/Request/SearchEsSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ class SearchEsSearch extends Request
{
/**
* @param string $engineName Name of the engine
* @param string $authorization The Elasticsearch token API
* @param EsSearchParams $es_search_params
*/
public function __construct(string $engineName, EsSearchParams $es_search_params = null)
public function __construct(string $engineName, string $authorization, EsSearchParams $es_search_params = null)
{
$this->method = 'POST';
$engine_name = urlencode($engineName);
$this->path = "/api/as/v0/engines/$engine_name/elasticsearch/_search";
$this->headers['Authorization'] = $authorization;
$this->path = "/api/as/v1/engines/$engine_name/elasticsearch/_search";
$this->headers['Content-Type'] = 'application/json';
$this->body = $es_search_params;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AppSearch/Request/SearchExplain.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(string $engineName, SearchRequestParams $search_requ
{
$this->method = 'POST';
$engine_name = urlencode($engineName);
$this->path = "/api/as/v0/engines/$engine_name/search_explain";
$this->path = "/api/as/v1/engines/$engine_name/search_explain";
$this->headers['Content-Type'] = 'application/json';
$this->body = $search_request_params;
}
Expand Down
1 change: 1 addition & 0 deletions src/AppSearch/Schema/SearchSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class SearchSettings
public SearchFields $search_fields;
public SimpleObject $result_fields;
public int $precision;
public bool $precision_enabled;
}
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class Client
{
const VERSION = '8.4.0';
const VERSION = '8.5.0';

private array $config = [];

Expand Down
33 changes: 33 additions & 0 deletions src/EnterpriseSearch/Endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,39 @@ public function getStats(Request\GetStats $request): Response
}


/**
* Get information on the application indices and the space used
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#get-storage-api
*/
public function getStorage(Request\GetStorage $request): Response
{
return new Response($this->transport->sendRequest($request->getRequest()));
}


/**
* Get information on the outdated application indices
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#get-stale-storage-api
*/
public function getStaleStorage(Request\GetStaleStorage $request): Response
{
return new Response($this->transport->sendRequest($request->getRequest()));
}


/**
* Cleanup outdated application indices
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#delete-stale-storage-api
*/
public function deleteStaleStorage(Request\DeleteStaleStorage $request): Response
{
return new Response($this->transport->sendRequest($request->getRequest()));
}


/**
* Get version information for this server
*
Expand Down
44 changes: 44 additions & 0 deletions src/EnterpriseSearch/Request/DeleteStaleStorage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Request;

use Elastic\EnterpriseSearch\Request\Request;

/**
* Cleanup outdated application indices
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#delete-stale-storage-api
* @generated This file is generated, please do not edit
*/
class DeleteStaleStorage extends Request
{
public function __construct()
{
$this->method = 'DELETE';
$this->path = "/api/ent/v1/internal/storage/stale";
}


/**
* @param bool $force The value for the "force" flag
*/
public function setForce(bool $force): self
{
$this->queryParams['force'] = $force;
return $this;
}
}
34 changes: 34 additions & 0 deletions src/EnterpriseSearch/Request/GetStaleStorage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Request;

use Elastic\EnterpriseSearch\Request\Request;

/**
* Get information on the outdated application indices
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#get-stale-storage-api
* @generated This file is generated, please do not edit
*/
class GetStaleStorage extends Request
{
public function __construct()
{
$this->method = 'GET';
$this->path = "/api/ent/v1/internal/storage/stale";
}
}
34 changes: 34 additions & 0 deletions src/EnterpriseSearch/Request/GetStorage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Request;

use Elastic\EnterpriseSearch\Request\Request;

/**
* Get information on the application indices and the space used
*
* @see https://www.elastic.co/guide/en/enterprise-search/current/storage-api.html#get-storage-api
* @generated This file is generated, please do not edit
*/
class GetStorage extends Request
{
public function __construct()
{
$this->method = 'GET';
$this->path = "/api/ent/v1/internal/storage";
}
}
33 changes: 33 additions & 0 deletions src/EnterpriseSearch/Schema/IndexInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Schema;

/**
* @generated This file is generated, please do not edit
*/
class IndexInfo
{
public string $name;
public int $size_in_bytes;


public function __construct(string $name, int $size_in_bytes)
{
$this->name = $name;
$this->size_in_bytes = $size_in_bytes;
}
}
36 changes: 36 additions & 0 deletions src/EnterpriseSearch/Schema/StorageCleanupResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Schema;

/**
* @generated This file is generated, please do not edit
*/
class StorageCleanupResponse
{
public array $indices;
public int $index_count;


/**
* @param string[] $indices
*/
public function __construct(array $indices, int $index_count)
{
$this->indices = $indices;
$this->index_count = $index_count;
}
}
36 changes: 36 additions & 0 deletions src/EnterpriseSearch/Schema/StorageResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Schema;

/**
* @generated This file is generated, please do not edit
*/
class StorageResponse
{
public array $indices;
public StorageSummary $summary;


/**
* @param IndexInfo[] $indices
*/
public function __construct(array $indices, StorageSummary $summary)
{
$this->indices = $indices;
$this->summary = $summary;
}
}
33 changes: 33 additions & 0 deletions src/EnterpriseSearch/Schema/StorageSummary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* Elastic Enterprise Search
*
* @link https://github.com/elastic/enterprise-search-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\EnterpriseSearch\EnterpriseSearch\Schema;

/**
* @generated This file is generated, please do not edit
*/
class StorageSummary
{
public int $index_count;
public int $size_in_bytes;


public function __construct(int $index_count, int $size_in_bytes)
{
$this->index_count = $index_count;
$this->size_in_bytes = $size_in_bytes;
}
}

0 comments on commit 0cb27bf

Please sign in to comment.