1<?php 2/** 3 * Elasticsearch PHP client 4 * 5 * @link https://github.com/elastic/elasticsearch-php/ 6 * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co) 7 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 8 * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1 9 * 10 * Licensed to Elasticsearch B.V under one or more agreements. 11 * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or 12 * the GNU Lesser General Public License, Version 2.1, at your option. 13 * See the LICENSE file in the project root for more information. 14 */ 15declare(strict_types = 1); 16 17namespace Elasticsearch\Namespaces; 18 19use Elasticsearch\Namespaces\AbstractNamespace; 20 21/** 22 * Class LicenseNamespace 23 * 24 * NOTE: this file is autogenerated using util/GenerateEndpoints.php 25 * and Elasticsearch 7.16.0-SNAPSHOT (dfc9a8e7563ed5f24b5210ed21ed92ae182cd0ee) 26 */ 27class LicenseNamespace extends AbstractNamespace 28{ 29 30 /** 31 * Deletes licensing information for the cluster 32 * 33 * 34 * @param array $params Associative array of parameters 35 * @return array 36 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html 37 */ 38 public function delete(array $params = []) 39 { 40 41 $endpointBuilder = $this->endpoints; 42 $endpoint = $endpointBuilder('License\Delete'); 43 $endpoint->setParams($params); 44 45 return $this->performRequest($endpoint); 46 } 47 /** 48 * Retrieves licensing information for the cluster 49 * 50 * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) 51 * $params['accept_enterprise'] = (boolean) If the active license is an enterprise license, return type as 'enterprise' (default: false) 52 * 53 * @param array $params Associative array of parameters 54 * @return array 55 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html 56 */ 57 public function get(array $params = []) 58 { 59 60 $endpointBuilder = $this->endpoints; 61 $endpoint = $endpointBuilder('License\Get'); 62 $endpoint->setParams($params); 63 64 return $this->performRequest($endpoint); 65 } 66 /** 67 * Retrieves information about the status of the basic license. 68 * 69 * 70 * @param array $params Associative array of parameters 71 * @return array 72 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html 73 */ 74 public function getBasicStatus(array $params = []) 75 { 76 77 $endpointBuilder = $this->endpoints; 78 $endpoint = $endpointBuilder('License\GetBasicStatus'); 79 $endpoint->setParams($params); 80 81 return $this->performRequest($endpoint); 82 } 83 /** 84 * Retrieves information about the status of the trial license. 85 * 86 * 87 * @param array $params Associative array of parameters 88 * @return array 89 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html 90 */ 91 public function getTrialStatus(array $params = []) 92 { 93 94 $endpointBuilder = $this->endpoints; 95 $endpoint = $endpointBuilder('License\GetTrialStatus'); 96 $endpoint->setParams($params); 97 98 return $this->performRequest($endpoint); 99 } 100 /** 101 * Updates the license for the cluster. 102 * 103 * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) 104 * $params['body'] = (array) licenses to be installed 105 * 106 * @param array $params Associative array of parameters 107 * @return array 108 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html 109 */ 110 public function post(array $params = []) 111 { 112 $body = $this->extractArgument($params, 'body'); 113 114 $endpointBuilder = $this->endpoints; 115 $endpoint = $endpointBuilder('License\Post'); 116 $endpoint->setParams($params); 117 $endpoint->setBody($body); 118 119 return $this->performRequest($endpoint); 120 } 121 /** 122 * Starts an indefinite basic license. 123 * 124 * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) 125 * 126 * @param array $params Associative array of parameters 127 * @return array 128 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html 129 */ 130 public function postStartBasic(array $params = []) 131 { 132 133 $endpointBuilder = $this->endpoints; 134 $endpoint = $endpointBuilder('License\PostStartBasic'); 135 $endpoint->setParams($params); 136 137 return $this->performRequest($endpoint); 138 } 139 /** 140 * starts a limited time trial license. 141 * 142 * $params['type'] = (string) The type of trial license to generate (default: "trial") 143 * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) 144 * 145 * @param array $params Associative array of parameters 146 * @return array 147 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html 148 */ 149 public function postStartTrial(array $params = []) 150 { 151 152 $endpointBuilder = $this->endpoints; 153 $endpoint = $endpointBuilder('License\PostStartTrial'); 154 $endpoint->setParams($params); 155 156 return $this->performRequest($endpoint); 157 } 158} 159