@@ -33,440 +33,440 @@ |
||
| 33 | 33 | |
| 34 | 34 | class ClientBuilder |
| 35 | 35 | { |
| 36 | - const DEFAULT_HOST = 'localhost:9200'; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * PSR-18 client |
|
| 40 | - */ |
|
| 41 | - private ClientInterface $httpClient; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * The HTTP async client |
|
| 45 | - */ |
|
| 46 | - private HttpAsyncClient $asyncHttpClient; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * PSR-3 Logger |
|
| 50 | - */ |
|
| 51 | - private LoggerInterface $logger; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * The NodelPool |
|
| 55 | - */ |
|
| 56 | - private NodePoolInterface $nodePool; |
|
| 57 | - |
|
| 58 | - /** |
|
| 59 | - * Hosts (elasticsearch nodes) |
|
| 60 | - */ |
|
| 61 | - private array $hosts; |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Elasticsearch API key |
|
| 65 | - */ |
|
| 66 | - private string $apiKey; |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * Basic authentication username |
|
| 70 | - */ |
|
| 71 | - private string $username; |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * Basic authentication password |
|
| 75 | - */ |
|
| 76 | - private string $password; |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * Elastic cloud Id |
|
| 80 | - */ |
|
| 81 | - private string $cloudId; |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Retries |
|
| 85 | - * |
|
| 86 | - * The default value is calculated during the client build |
|
| 87 | - * and it is equal to the number of hosts |
|
| 88 | - */ |
|
| 89 | - private int $retries; |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * SSL certificate |
|
| 93 | - * @var array [$cert, $password] $cert is the name of a file containing a PEM formatted certificate, |
|
| 94 | - * $password if the certificate requires a password |
|
| 95 | - */ |
|
| 96 | - private array $sslCert; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * SSL key |
|
| 100 | - * @var array [$key, $password] $key is the name of a file containing a private SSL key, |
|
| 101 | - * $password if the private key requires a password |
|
| 102 | - */ |
|
| 103 | - private array $sslKey; |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * SSL verification |
|
| 107 | - * |
|
| 108 | - * Enable or disable the SSL verfiication (default is true) |
|
| 109 | - */ |
|
| 110 | - private bool $sslVerification = true; |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * SSL CA bundle |
|
| 114 | - */ |
|
| 115 | - private string $sslCA; |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Elastic meta header |
|
| 119 | - * |
|
| 120 | - * Enable or disable the x-elastic-client-meta header (default is true) |
|
| 121 | - */ |
|
| 122 | - private bool $elasticMetaHeader = true; |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * HTTP client options |
|
| 126 | - */ |
|
| 127 | - private array $httpClientOptions = []; |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * Make the constructor final so cannot be overwritten |
|
| 131 | - */ |
|
| 132 | - final public function __construct() |
|
| 133 | - { |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * Create an instance of ClientBuilder |
|
| 138 | - */ |
|
| 139 | - public static function create(): ClientBuilder |
|
| 140 | - { |
|
| 141 | - return new static(); |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Build a new client from the provided config. Hash keys |
|
| 146 | - * should correspond to the method name e.g. ['nodePool'] |
|
| 147 | - * corresponds to setNodePool(). |
|
| 148 | - * |
|
| 149 | - * Missing keys will use the default for that setting if applicable |
|
| 150 | - * |
|
| 151 | - * Unknown keys will throw an exception by default, but this can be silenced |
|
| 152 | - * by setting `quiet` to true |
|
| 153 | - * |
|
| 154 | - * @param array $config |
|
| 155 | - * @param bool $quiet False if unknown settings throw exception, true to silently |
|
| 156 | - * ignore unknown settings |
|
| 157 | - * @throws ConfigException |
|
| 158 | - */ |
|
| 159 | - public static function fromConfig(array $config, bool $quiet = false): Client |
|
| 160 | - { |
|
| 161 | - $builder = new static; |
|
| 162 | - foreach ($config as $key => $value) { |
|
| 163 | - $method = "set$key"; |
|
| 164 | - $reflection = new ReflectionClass($builder); |
|
| 165 | - if ($reflection->hasMethod($method)) { |
|
| 166 | - $func = $reflection->getMethod($method); |
|
| 167 | - if ($func->getNumberOfParameters() > 1) { |
|
| 168 | - $builder->$method(...$value); |
|
| 169 | - } else { |
|
| 170 | - $builder->$method($value); |
|
| 171 | - } |
|
| 172 | - unset($config[$key]); |
|
| 173 | - } |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - if ($quiet === false && count($config) > 0) { |
|
| 177 | - $unknown = implode(array_keys($config)); |
|
| 178 | - throw new ConfigException("Unknown parameters provided: $unknown"); |
|
| 179 | - } |
|
| 180 | - return $builder->build(); |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - public function setHttpClient(ClientInterface $httpClient): ClientBuilder |
|
| 184 | - { |
|
| 185 | - $this->httpClient = $httpClient; |
|
| 186 | - return $this; |
|
| 187 | - } |
|
| 188 | - |
|
| 189 | - public function setAsyncHttpClient(HttpAsyncClient $asyncHttpClient): ClientBuilder |
|
| 190 | - { |
|
| 191 | - $this->asyncHttpClient = $asyncHttpClient; |
|
| 192 | - return $this; |
|
| 193 | - } |
|
| 194 | - |
|
| 195 | - /** |
|
| 196 | - * Set the PSR-3 Logger |
|
| 197 | - */ |
|
| 198 | - public function setLogger(LoggerInterface $logger): ClientBuilder |
|
| 199 | - { |
|
| 200 | - $this->logger = $logger; |
|
| 201 | - return $this; |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - /** |
|
| 205 | - * Set the NodePool |
|
| 206 | - */ |
|
| 207 | - public function setNodePool(NodePoolInterface $nodePool): ClientBuilder |
|
| 208 | - { |
|
| 209 | - $this->nodePool = $nodePool; |
|
| 210 | - return $this; |
|
| 211 | - } |
|
| 212 | - |
|
| 213 | - /** |
|
| 214 | - * Set the hosts (nodes) |
|
| 215 | - */ |
|
| 216 | - public function setHosts(array $hosts): ClientBuilder |
|
| 217 | - { |
|
| 218 | - $this->hosts = $hosts; |
|
| 219 | - return $this; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * Set the ApiKey |
|
| 224 | - * If the id is not specified we store the ApiKey otherwise |
|
| 225 | - * we store as Base64(id:ApiKey) |
|
| 226 | - * |
|
| 227 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
| 228 | - */ |
|
| 229 | - public function setApiKey(string $apiKey, string $id = null): ClientBuilder |
|
| 230 | - { |
|
| 231 | - if (empty($id)) { |
|
| 232 | - $this->apiKey = $apiKey; |
|
| 233 | - } else { |
|
| 234 | - $this->apiKey = base64_encode($id . ':' . $apiKey); |
|
| 235 | - } |
|
| 236 | - return $this; |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - /** |
|
| 240 | - * Set the Basic Authentication |
|
| 241 | - */ |
|
| 242 | - public function setBasicAuthentication(string $username, string $password): ClientBuilder |
|
| 243 | - { |
|
| 244 | - $this->username = $username; |
|
| 245 | - $this->password = $password; |
|
| 246 | - return $this; |
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - public function setElasticCloudId(string $cloudId) |
|
| 250 | - { |
|
| 251 | - $this->cloudId = $cloudId; |
|
| 252 | - return $this; |
|
| 253 | - } |
|
| 254 | - |
|
| 255 | - /** |
|
| 256 | - * Set number or retries |
|
| 257 | - * |
|
| 258 | - * @param int $retries |
|
| 259 | - */ |
|
| 260 | - public function setRetries(int $retries): ClientBuilder |
|
| 261 | - { |
|
| 262 | - if ($retries < 0) { |
|
| 263 | - throw new InvalidArgumentException('The retries number must be >= 0'); |
|
| 264 | - } |
|
| 265 | - $this->retries = $retries; |
|
| 266 | - return $this; |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - /** |
|
| 270 | - * Set SSL certificate |
|
| 271 | - * |
|
| 272 | - * @param string $cert The name of a file containing a PEM formatted certificate |
|
| 273 | - * @param string $password if the certificate requires a password |
|
| 274 | - */ |
|
| 275 | - public function setSSLCert(string $cert, string $password = null): ClientBuilder |
|
| 276 | - { |
|
| 277 | - $this->sslCert = [$cert, $password]; |
|
| 278 | - return $this; |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - /** |
|
| 282 | - * Set the Certificate Authority (CA) bundle |
|
| 283 | - * |
|
| 284 | - * @param string $cert The name of a file containing a PEM formatted certificate |
|
| 285 | - */ |
|
| 286 | - public function setCABundle(string $cert): ClientBuilder |
|
| 287 | - { |
|
| 288 | - $this->sslCA = $cert; |
|
| 289 | - return $this; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * Set SSL key |
|
| 294 | - * |
|
| 295 | - * @param string $key The name of a file containing a private SSL key |
|
| 296 | - * @param string $password if the private key requires a password |
|
| 297 | - */ |
|
| 298 | - public function setSSLKey(string $key, string $password = null): ClientBuilder |
|
| 299 | - { |
|
| 300 | - $this->sslKey = [$key, $password]; |
|
| 301 | - return $this; |
|
| 302 | - } |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * Enable or disable the SSL verification |
|
| 306 | - */ |
|
| 307 | - public function setSSLVerification(bool $value = true): ClientBuilder |
|
| 308 | - { |
|
| 309 | - $this->sslVerification = $value; |
|
| 310 | - return $this; |
|
| 311 | - } |
|
| 312 | - |
|
| 313 | - /** |
|
| 314 | - * Enable or disable the x-elastic-client-meta header |
|
| 315 | - */ |
|
| 316 | - public function setElasticMetaHeader(bool $value = true): ClientBuilder |
|
| 317 | - { |
|
| 318 | - $this->elasticMetaHeader = $value; |
|
| 319 | - return $this; |
|
| 320 | - } |
|
| 321 | - |
|
| 322 | - public function setHttpClientOptions(array $options): ClientBuilder |
|
| 323 | - { |
|
| 324 | - $this->httpClientOptions = $options; |
|
| 325 | - return $this; |
|
| 326 | - } |
|
| 327 | - |
|
| 328 | - /** |
|
| 329 | - * Build and returns the Client object |
|
| 330 | - */ |
|
| 331 | - public function build(): Client |
|
| 332 | - { |
|
| 333 | - // Transport builder |
|
| 334 | - $builder = TransportBuilder::create(); |
|
| 335 | - |
|
| 336 | - // Set the default hosts if empty |
|
| 337 | - if (empty($this->hosts)) { |
|
| 338 | - $this->hosts = [self::DEFAULT_HOST]; |
|
| 339 | - } |
|
| 340 | - $builder->setHosts($this->hosts); |
|
| 341 | - |
|
| 342 | - // Logger |
|
| 343 | - if (!empty($this->logger)) { |
|
| 344 | - $builder->setLogger($this->logger); |
|
| 345 | - } |
|
| 346 | - |
|
| 347 | - // Http client |
|
| 348 | - if (!empty($this->httpClient)) { |
|
| 349 | - $builder->setClient($this->httpClient); |
|
| 350 | - } |
|
| 351 | - // Set HTTP client options |
|
| 352 | - $builder->setClient( |
|
| 353 | - $this->setOptions($builder->getClient(), $this->getConfig(), $this->httpClientOptions) |
|
| 354 | - ); |
|
| 355 | - |
|
| 356 | - // Cloud id |
|
| 357 | - if (!empty($this->cloudId)) { |
|
| 358 | - $builder->setCloudId($this->cloudId); |
|
| 359 | - } |
|
| 360 | - |
|
| 361 | - // Node Pool |
|
| 362 | - if (!empty($this->nodePool)) { |
|
| 363 | - $builder->setNodePool($this->nodePool); |
|
| 364 | - } |
|
| 365 | - |
|
| 366 | - $transport = $builder->build(); |
|
| 36 | + const DEFAULT_HOST = 'localhost:9200'; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * PSR-18 client |
|
| 40 | + */ |
|
| 41 | + private ClientInterface $httpClient; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * The HTTP async client |
|
| 45 | + */ |
|
| 46 | + private HttpAsyncClient $asyncHttpClient; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * PSR-3 Logger |
|
| 50 | + */ |
|
| 51 | + private LoggerInterface $logger; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * The NodelPool |
|
| 55 | + */ |
|
| 56 | + private NodePoolInterface $nodePool; |
|
| 57 | + |
|
| 58 | + /** |
|
| 59 | + * Hosts (elasticsearch nodes) |
|
| 60 | + */ |
|
| 61 | + private array $hosts; |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Elasticsearch API key |
|
| 65 | + */ |
|
| 66 | + private string $apiKey; |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * Basic authentication username |
|
| 70 | + */ |
|
| 71 | + private string $username; |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * Basic authentication password |
|
| 75 | + */ |
|
| 76 | + private string $password; |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * Elastic cloud Id |
|
| 80 | + */ |
|
| 81 | + private string $cloudId; |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Retries |
|
| 85 | + * |
|
| 86 | + * The default value is calculated during the client build |
|
| 87 | + * and it is equal to the number of hosts |
|
| 88 | + */ |
|
| 89 | + private int $retries; |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * SSL certificate |
|
| 93 | + * @var array [$cert, $password] $cert is the name of a file containing a PEM formatted certificate, |
|
| 94 | + * $password if the certificate requires a password |
|
| 95 | + */ |
|
| 96 | + private array $sslCert; |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * SSL key |
|
| 100 | + * @var array [$key, $password] $key is the name of a file containing a private SSL key, |
|
| 101 | + * $password if the private key requires a password |
|
| 102 | + */ |
|
| 103 | + private array $sslKey; |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * SSL verification |
|
| 107 | + * |
|
| 108 | + * Enable or disable the SSL verfiication (default is true) |
|
| 109 | + */ |
|
| 110 | + private bool $sslVerification = true; |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * SSL CA bundle |
|
| 114 | + */ |
|
| 115 | + private string $sslCA; |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Elastic meta header |
|
| 119 | + * |
|
| 120 | + * Enable or disable the x-elastic-client-meta header (default is true) |
|
| 121 | + */ |
|
| 122 | + private bool $elasticMetaHeader = true; |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * HTTP client options |
|
| 126 | + */ |
|
| 127 | + private array $httpClientOptions = []; |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * Make the constructor final so cannot be overwritten |
|
| 131 | + */ |
|
| 132 | + final public function __construct() |
|
| 133 | + { |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * Create an instance of ClientBuilder |
|
| 138 | + */ |
|
| 139 | + public static function create(): ClientBuilder |
|
| 140 | + { |
|
| 141 | + return new static(); |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Build a new client from the provided config. Hash keys |
|
| 146 | + * should correspond to the method name e.g. ['nodePool'] |
|
| 147 | + * corresponds to setNodePool(). |
|
| 148 | + * |
|
| 149 | + * Missing keys will use the default for that setting if applicable |
|
| 150 | + * |
|
| 151 | + * Unknown keys will throw an exception by default, but this can be silenced |
|
| 152 | + * by setting `quiet` to true |
|
| 153 | + * |
|
| 154 | + * @param array $config |
|
| 155 | + * @param bool $quiet False if unknown settings throw exception, true to silently |
|
| 156 | + * ignore unknown settings |
|
| 157 | + * @throws ConfigException |
|
| 158 | + */ |
|
| 159 | + public static function fromConfig(array $config, bool $quiet = false): Client |
|
| 160 | + { |
|
| 161 | + $builder = new static; |
|
| 162 | + foreach ($config as $key => $value) { |
|
| 163 | + $method = "set$key"; |
|
| 164 | + $reflection = new ReflectionClass($builder); |
|
| 165 | + if ($reflection->hasMethod($method)) { |
|
| 166 | + $func = $reflection->getMethod($method); |
|
| 167 | + if ($func->getNumberOfParameters() > 1) { |
|
| 168 | + $builder->$method(...$value); |
|
| 169 | + } else { |
|
| 170 | + $builder->$method($value); |
|
| 171 | + } |
|
| 172 | + unset($config[$key]); |
|
| 173 | + } |
|
| 174 | + } |
|
| 175 | + |
|
| 176 | + if ($quiet === false && count($config) > 0) { |
|
| 177 | + $unknown = implode(array_keys($config)); |
|
| 178 | + throw new ConfigException("Unknown parameters provided: $unknown"); |
|
| 179 | + } |
|
| 180 | + return $builder->build(); |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + public function setHttpClient(ClientInterface $httpClient): ClientBuilder |
|
| 184 | + { |
|
| 185 | + $this->httpClient = $httpClient; |
|
| 186 | + return $this; |
|
| 187 | + } |
|
| 188 | + |
|
| 189 | + public function setAsyncHttpClient(HttpAsyncClient $asyncHttpClient): ClientBuilder |
|
| 190 | + { |
|
| 191 | + $this->asyncHttpClient = $asyncHttpClient; |
|
| 192 | + return $this; |
|
| 193 | + } |
|
| 194 | + |
|
| 195 | + /** |
|
| 196 | + * Set the PSR-3 Logger |
|
| 197 | + */ |
|
| 198 | + public function setLogger(LoggerInterface $logger): ClientBuilder |
|
| 199 | + { |
|
| 200 | + $this->logger = $logger; |
|
| 201 | + return $this; |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + /** |
|
| 205 | + * Set the NodePool |
|
| 206 | + */ |
|
| 207 | + public function setNodePool(NodePoolInterface $nodePool): ClientBuilder |
|
| 208 | + { |
|
| 209 | + $this->nodePool = $nodePool; |
|
| 210 | + return $this; |
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + /** |
|
| 214 | + * Set the hosts (nodes) |
|
| 215 | + */ |
|
| 216 | + public function setHosts(array $hosts): ClientBuilder |
|
| 217 | + { |
|
| 218 | + $this->hosts = $hosts; |
|
| 219 | + return $this; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * Set the ApiKey |
|
| 224 | + * If the id is not specified we store the ApiKey otherwise |
|
| 225 | + * we store as Base64(id:ApiKey) |
|
| 226 | + * |
|
| 227 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
| 228 | + */ |
|
| 229 | + public function setApiKey(string $apiKey, string $id = null): ClientBuilder |
|
| 230 | + { |
|
| 231 | + if (empty($id)) { |
|
| 232 | + $this->apiKey = $apiKey; |
|
| 233 | + } else { |
|
| 234 | + $this->apiKey = base64_encode($id . ':' . $apiKey); |
|
| 235 | + } |
|
| 236 | + return $this; |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + /** |
|
| 240 | + * Set the Basic Authentication |
|
| 241 | + */ |
|
| 242 | + public function setBasicAuthentication(string $username, string $password): ClientBuilder |
|
| 243 | + { |
|
| 244 | + $this->username = $username; |
|
| 245 | + $this->password = $password; |
|
| 246 | + return $this; |
|
| 247 | + } |
|
| 248 | + |
|
| 249 | + public function setElasticCloudId(string $cloudId) |
|
| 250 | + { |
|
| 251 | + $this->cloudId = $cloudId; |
|
| 252 | + return $this; |
|
| 253 | + } |
|
| 254 | + |
|
| 255 | + /** |
|
| 256 | + * Set number or retries |
|
| 257 | + * |
|
| 258 | + * @param int $retries |
|
| 259 | + */ |
|
| 260 | + public function setRetries(int $retries): ClientBuilder |
|
| 261 | + { |
|
| 262 | + if ($retries < 0) { |
|
| 263 | + throw new InvalidArgumentException('The retries number must be >= 0'); |
|
| 264 | + } |
|
| 265 | + $this->retries = $retries; |
|
| 266 | + return $this; |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + /** |
|
| 270 | + * Set SSL certificate |
|
| 271 | + * |
|
| 272 | + * @param string $cert The name of a file containing a PEM formatted certificate |
|
| 273 | + * @param string $password if the certificate requires a password |
|
| 274 | + */ |
|
| 275 | + public function setSSLCert(string $cert, string $password = null): ClientBuilder |
|
| 276 | + { |
|
| 277 | + $this->sslCert = [$cert, $password]; |
|
| 278 | + return $this; |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + /** |
|
| 282 | + * Set the Certificate Authority (CA) bundle |
|
| 283 | + * |
|
| 284 | + * @param string $cert The name of a file containing a PEM formatted certificate |
|
| 285 | + */ |
|
| 286 | + public function setCABundle(string $cert): ClientBuilder |
|
| 287 | + { |
|
| 288 | + $this->sslCA = $cert; |
|
| 289 | + return $this; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * Set SSL key |
|
| 294 | + * |
|
| 295 | + * @param string $key The name of a file containing a private SSL key |
|
| 296 | + * @param string $password if the private key requires a password |
|
| 297 | + */ |
|
| 298 | + public function setSSLKey(string $key, string $password = null): ClientBuilder |
|
| 299 | + { |
|
| 300 | + $this->sslKey = [$key, $password]; |
|
| 301 | + return $this; |
|
| 302 | + } |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * Enable or disable the SSL verification |
|
| 306 | + */ |
|
| 307 | + public function setSSLVerification(bool $value = true): ClientBuilder |
|
| 308 | + { |
|
| 309 | + $this->sslVerification = $value; |
|
| 310 | + return $this; |
|
| 311 | + } |
|
| 312 | + |
|
| 313 | + /** |
|
| 314 | + * Enable or disable the x-elastic-client-meta header |
|
| 315 | + */ |
|
| 316 | + public function setElasticMetaHeader(bool $value = true): ClientBuilder |
|
| 317 | + { |
|
| 318 | + $this->elasticMetaHeader = $value; |
|
| 319 | + return $this; |
|
| 320 | + } |
|
| 321 | + |
|
| 322 | + public function setHttpClientOptions(array $options): ClientBuilder |
|
| 323 | + { |
|
| 324 | + $this->httpClientOptions = $options; |
|
| 325 | + return $this; |
|
| 326 | + } |
|
| 327 | + |
|
| 328 | + /** |
|
| 329 | + * Build and returns the Client object |
|
| 330 | + */ |
|
| 331 | + public function build(): Client |
|
| 332 | + { |
|
| 333 | + // Transport builder |
|
| 334 | + $builder = TransportBuilder::create(); |
|
| 335 | + |
|
| 336 | + // Set the default hosts if empty |
|
| 337 | + if (empty($this->hosts)) { |
|
| 338 | + $this->hosts = [self::DEFAULT_HOST]; |
|
| 339 | + } |
|
| 340 | + $builder->setHosts($this->hosts); |
|
| 341 | + |
|
| 342 | + // Logger |
|
| 343 | + if (!empty($this->logger)) { |
|
| 344 | + $builder->setLogger($this->logger); |
|
| 345 | + } |
|
| 346 | + |
|
| 347 | + // Http client |
|
| 348 | + if (!empty($this->httpClient)) { |
|
| 349 | + $builder->setClient($this->httpClient); |
|
| 350 | + } |
|
| 351 | + // Set HTTP client options |
|
| 352 | + $builder->setClient( |
|
| 353 | + $this->setOptions($builder->getClient(), $this->getConfig(), $this->httpClientOptions) |
|
| 354 | + ); |
|
| 355 | + |
|
| 356 | + // Cloud id |
|
| 357 | + if (!empty($this->cloudId)) { |
|
| 358 | + $builder->setCloudId($this->cloudId); |
|
| 359 | + } |
|
| 360 | + |
|
| 361 | + // Node Pool |
|
| 362 | + if (!empty($this->nodePool)) { |
|
| 363 | + $builder->setNodePool($this->nodePool); |
|
| 364 | + } |
|
| 365 | + |
|
| 366 | + $transport = $builder->build(); |
|
| 367 | 367 | |
| 368 | - // The default retries is equal to the number of hosts |
|
| 369 | - if (empty($this->retries)) { |
|
| 370 | - $this->retries = count($this->hosts); |
|
| 371 | - } |
|
| 372 | - $transport->setRetries($this->retries); |
|
| 373 | - |
|
| 374 | - // Async client |
|
| 375 | - if (!empty($this->asyncHttpClient)) { |
|
| 376 | - $transport->setAsyncClient($this->asyncHttpClient); |
|
| 377 | - } |
|
| 368 | + // The default retries is equal to the number of hosts |
|
| 369 | + if (empty($this->retries)) { |
|
| 370 | + $this->retries = count($this->hosts); |
|
| 371 | + } |
|
| 372 | + $transport->setRetries($this->retries); |
|
| 373 | + |
|
| 374 | + // Async client |
|
| 375 | + if (!empty($this->asyncHttpClient)) { |
|
| 376 | + $transport->setAsyncClient($this->asyncHttpClient); |
|
| 377 | + } |
|
| 378 | 378 | |
| 379 | - // Basic authentication |
|
| 380 | - if (!empty($this->username) && !empty($this->password)) { |
|
| 381 | - $transport->setUserInfo($this->username, $this->password); |
|
| 382 | - } |
|
| 383 | - |
|
| 384 | - // API key |
|
| 385 | - if (!empty($this->apiKey)) { |
|
| 386 | - if (!empty($this->username)) { |
|
| 387 | - throw new AuthenticationException('You cannot use APIKey and Basic Authenication together'); |
|
| 388 | - } |
|
| 389 | - $transport->setHeader('Authorization', sprintf("ApiKey %s", $this->apiKey)); |
|
| 390 | - } |
|
| 391 | - |
|
| 392 | - /** |
|
| 393 | - * Elastic cloud optimized with gzip |
|
| 394 | - * @see https://github.com/elastic/elasticsearch-php/issues/1241 omit for Symfony HTTP Client |
|
| 395 | - */ |
|
| 396 | - if (!empty($this->cloudId) && !$this->isSymfonyHttpClient($transport)) { |
|
| 397 | - $transport->setHeader('Accept-Encoding', 'gzip'); |
|
| 398 | - } |
|
| 399 | - |
|
| 400 | - $client = new Client($transport, $transport->getLogger()); |
|
| 401 | - // Enable or disable the x-elastic-client-meta header |
|
| 402 | - $client->setElasticMetaHeader($this->elasticMetaHeader); |
|
| 403 | - |
|
| 404 | - return $client; |
|
| 405 | - } |
|
| 406 | - |
|
| 407 | - /** |
|
| 408 | - * Returns true if the transport HTTP client is Symfony |
|
| 409 | - */ |
|
| 410 | - protected function isSymfonyHttpClient(Transport $transport): bool |
|
| 411 | - { |
|
| 412 | - if (false !== strpos(get_class($transport->getClient()), 'Symfony\Component\HttpClient')) { |
|
| 413 | - return true; |
|
| 414 | - } |
|
| 415 | - try { |
|
| 416 | - if (false !== strpos(get_class($transport->getAsyncClient()), 'Symfony\Component\HttpClient')) { |
|
| 417 | - return true; |
|
| 418 | - } |
|
| 419 | - } catch (NoAsyncClientException $e) { |
|
| 420 | - return false; |
|
| 421 | - } |
|
| 422 | - return false; |
|
| 423 | - } |
|
| 424 | - |
|
| 425 | - /** |
|
| 426 | - * Returns the configuration to be used in the HTTP client |
|
| 427 | - */ |
|
| 428 | - protected function getConfig(): array |
|
| 429 | - { |
|
| 430 | - $config = []; |
|
| 431 | - if (!empty($this->sslCert)) { |
|
| 432 | - $config[RequestOptions::SSL_CERT] = $this->sslCert; |
|
| 433 | - } |
|
| 434 | - if (!empty($this->sslKey)) { |
|
| 435 | - $config[RequestOptions::SSL_KEY] = $this->sslKey; |
|
| 436 | - } |
|
| 437 | - if (!$this->sslVerification) { |
|
| 438 | - $config[RequestOptions::SSL_VERIFY] = false; |
|
| 439 | - } |
|
| 440 | - if (!empty($this->sslCA)) { |
|
| 441 | - $config[RequestOptions::SSL_CA] = $this->sslCA; |
|
| 442 | - } |
|
| 443 | - return $config; |
|
| 444 | - } |
|
| 445 | - |
|
| 446 | - /** |
|
| 447 | - * Set the configuration for the specific HTTP client using an adapter |
|
| 448 | - */ |
|
| 449 | - protected function setOptions(ClientInterface $client, array $config, array $clientOptions = []): ClientInterface |
|
| 450 | - { |
|
| 451 | - if (empty($config) && empty($clientOptions)) { |
|
| 452 | - return $client; |
|
| 453 | - } |
|
| 454 | - $class = get_class($client); |
|
| 455 | - if (!isset(AdapterOptions::HTTP_ADAPTERS[$class])) { |
|
| 456 | - throw new HttpClientException(sprintf( |
|
| 457 | - "The HTTP client %s is not supported for custom options", |
|
| 458 | - $class |
|
| 459 | - )); |
|
| 460 | - } |
|
| 461 | - $adapterClass = AdapterOptions::HTTP_ADAPTERS[$class]; |
|
| 462 | - if (!class_exists($adapterClass) || !in_array(AdapterInterface::class, class_implements($adapterClass))) { |
|
| 463 | - throw new HttpClientException(sprintf( |
|
| 464 | - "The class %s does not exists or does not implement %s", |
|
| 465 | - $adapterClass, |
|
| 466 | - AdapterInterface::class |
|
| 467 | - )); |
|
| 468 | - } |
|
| 469 | - $adapter = new $adapterClass; |
|
| 470 | - return $adapter->setConfig($client, $config, $clientOptions); |
|
| 471 | - } |
|
| 379 | + // Basic authentication |
|
| 380 | + if (!empty($this->username) && !empty($this->password)) { |
|
| 381 | + $transport->setUserInfo($this->username, $this->password); |
|
| 382 | + } |
|
| 383 | + |
|
| 384 | + // API key |
|
| 385 | + if (!empty($this->apiKey)) { |
|
| 386 | + if (!empty($this->username)) { |
|
| 387 | + throw new AuthenticationException('You cannot use APIKey and Basic Authenication together'); |
|
| 388 | + } |
|
| 389 | + $transport->setHeader('Authorization', sprintf("ApiKey %s", $this->apiKey)); |
|
| 390 | + } |
|
| 391 | + |
|
| 392 | + /** |
|
| 393 | + * Elastic cloud optimized with gzip |
|
| 394 | + * @see https://github.com/elastic/elasticsearch-php/issues/1241 omit for Symfony HTTP Client |
|
| 395 | + */ |
|
| 396 | + if (!empty($this->cloudId) && !$this->isSymfonyHttpClient($transport)) { |
|
| 397 | + $transport->setHeader('Accept-Encoding', 'gzip'); |
|
| 398 | + } |
|
| 399 | + |
|
| 400 | + $client = new Client($transport, $transport->getLogger()); |
|
| 401 | + // Enable or disable the x-elastic-client-meta header |
|
| 402 | + $client->setElasticMetaHeader($this->elasticMetaHeader); |
|
| 403 | + |
|
| 404 | + return $client; |
|
| 405 | + } |
|
| 406 | + |
|
| 407 | + /** |
|
| 408 | + * Returns true if the transport HTTP client is Symfony |
|
| 409 | + */ |
|
| 410 | + protected function isSymfonyHttpClient(Transport $transport): bool |
|
| 411 | + { |
|
| 412 | + if (false !== strpos(get_class($transport->getClient()), 'Symfony\Component\HttpClient')) { |
|
| 413 | + return true; |
|
| 414 | + } |
|
| 415 | + try { |
|
| 416 | + if (false !== strpos(get_class($transport->getAsyncClient()), 'Symfony\Component\HttpClient')) { |
|
| 417 | + return true; |
|
| 418 | + } |
|
| 419 | + } catch (NoAsyncClientException $e) { |
|
| 420 | + return false; |
|
| 421 | + } |
|
| 422 | + return false; |
|
| 423 | + } |
|
| 424 | + |
|
| 425 | + /** |
|
| 426 | + * Returns the configuration to be used in the HTTP client |
|
| 427 | + */ |
|
| 428 | + protected function getConfig(): array |
|
| 429 | + { |
|
| 430 | + $config = []; |
|
| 431 | + if (!empty($this->sslCert)) { |
|
| 432 | + $config[RequestOptions::SSL_CERT] = $this->sslCert; |
|
| 433 | + } |
|
| 434 | + if (!empty($this->sslKey)) { |
|
| 435 | + $config[RequestOptions::SSL_KEY] = $this->sslKey; |
|
| 436 | + } |
|
| 437 | + if (!$this->sslVerification) { |
|
| 438 | + $config[RequestOptions::SSL_VERIFY] = false; |
|
| 439 | + } |
|
| 440 | + if (!empty($this->sslCA)) { |
|
| 441 | + $config[RequestOptions::SSL_CA] = $this->sslCA; |
|
| 442 | + } |
|
| 443 | + return $config; |
|
| 444 | + } |
|
| 445 | + |
|
| 446 | + /** |
|
| 447 | + * Set the configuration for the specific HTTP client using an adapter |
|
| 448 | + */ |
|
| 449 | + protected function setOptions(ClientInterface $client, array $config, array $clientOptions = []): ClientInterface |
|
| 450 | + { |
|
| 451 | + if (empty($config) && empty($clientOptions)) { |
|
| 452 | + return $client; |
|
| 453 | + } |
|
| 454 | + $class = get_class($client); |
|
| 455 | + if (!isset(AdapterOptions::HTTP_ADAPTERS[$class])) { |
|
| 456 | + throw new HttpClientException(sprintf( |
|
| 457 | + "The HTTP client %s is not supported for custom options", |
|
| 458 | + $class |
|
| 459 | + )); |
|
| 460 | + } |
|
| 461 | + $adapterClass = AdapterOptions::HTTP_ADAPTERS[$class]; |
|
| 462 | + if (!class_exists($adapterClass) || !in_array(AdapterInterface::class, class_implements($adapterClass))) { |
|
| 463 | + throw new HttpClientException(sprintf( |
|
| 464 | + "The class %s does not exists or does not implement %s", |
|
| 465 | + $adapterClass, |
|
| 466 | + AdapterInterface::class |
|
| 467 | + )); |
|
| 468 | + } |
|
| 469 | + $adapter = new $adapterClass; |
|
| 470 | + return $adapter->setConfig($client, $config, $clientOptions); |
|
| 471 | + } |
|
| 472 | 472 | } |
| 473 | 473 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 11 | 11 | * See the LICENSE file in the project root for more information. |
| 12 | 12 | */ |
| 13 | -declare(strict_types = 1); |
|
| 13 | +declare(strict_types=1); |
|
| 14 | 14 | |
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch; |
| 16 | 16 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | if (empty($id)) { |
| 232 | 232 | $this->apiKey = $apiKey; |
| 233 | 233 | } else { |
| 234 | - $this->apiKey = base64_encode($id . ':' . $apiKey); |
|
| 234 | + $this->apiKey = base64_encode($id.':'.$apiKey); |
|
| 235 | 235 | } |
| 236 | 236 | return $this; |
| 237 | 237 | } |
@@ -31,8 +31,7 @@ |
||
| 31 | 31 | use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Log\LoggerInterface; |
| 32 | 32 | use ReflectionClass; |
| 33 | 33 | |
| 34 | -class ClientBuilder |
|
| 35 | -{ |
|
| 34 | +class ClientBuilder { |
|
| 36 | 35 | const DEFAULT_HOST = 'localhost:9200'; |
| 37 | 36 | |
| 38 | 37 | /** |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | public function delete(array $params = []) |
| 53 | 53 | { |
| 54 | 54 | $this->checkRequiredParameters(['id'], $params); |
| 55 | - $url = '/_async_search/' . $this->encode($params['id']); |
|
| 55 | + $url = '/_async_search/'.$this->encode($params['id']); |
|
| 56 | 56 | $method = 'DELETE'; |
| 57 | 57 | |
| 58 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 59 | 59 | $headers = [ |
| 60 | 60 | 'Accept' => 'application/json', |
| 61 | 61 | ]; |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | public function get(array $params = []) |
| 91 | 91 | { |
| 92 | 92 | $this->checkRequiredParameters(['id'], $params); |
| 93 | - $url = '/_async_search/' . $this->encode($params['id']); |
|
| 93 | + $url = '/_async_search/'.$this->encode($params['id']); |
|
| 94 | 94 | $method = 'GET'; |
| 95 | 95 | |
| 96 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_alive','typed_keys','pretty','human','error_trace','source','filter_path']); |
|
| 96 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 97 | 97 | $headers = [ |
| 98 | 98 | 'Accept' => 'application/json', |
| 99 | 99 | ]; |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | public function status(array $params = []) |
| 127 | 127 | { |
| 128 | 128 | $this->checkRequiredParameters(['id'], $params); |
| 129 | - $url = '/_async_search/status/' . $this->encode($params['id']); |
|
| 129 | + $url = '/_async_search/status/'.$this->encode($params['id']); |
|
| 130 | 130 | $method = 'GET'; |
| 131 | 131 | |
| 132 | - $url = $this->addQueryString($url, $params, ['keep_alive','pretty','human','error_trace','source','filter_path']); |
|
| 132 | + $url = $this->addQueryString($url, $params, ['keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 133 | 133 | $headers = [ |
| 134 | 134 | 'Accept' => 'application/json', |
| 135 | 135 | ]; |
@@ -202,13 +202,13 @@ discard block |
||
| 202 | 202 | public function submit(array $params = []) |
| 203 | 203 | { |
| 204 | 204 | if (isset($params['index'])) { |
| 205 | - $url = '/' . $this->encode($params['index']) . '/_async_search'; |
|
| 205 | + $url = '/'.$this->encode($params['index']).'/_async_search'; |
|
| 206 | 206 | $method = 'POST'; |
| 207 | 207 | } else { |
| 208 | 208 | $url = '/_async_search'; |
| 209 | 209 | $method = 'POST'; |
| 210 | 210 | } |
| 211 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','batched_reduce_size','request_cache','analyzer','analyze_wildcard','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','max_concurrent_shard_requests','pretty','human','error_trace','source','filter_path']); |
|
| 211 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 212 | 212 | $headers = [ |
| 213 | 213 | 'Accept' => 'application/json', |
| 214 | 214 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class AsyncSearch extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class AsyncSearch extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
| 33 | 32 | * |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $url = '/_ssl/certificates'; |
| 53 | 53 | $method = 'GET'; |
| 54 | 54 | |
| 55 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 55 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 56 | 56 | $headers = [ |
| 57 | 57 | 'Accept' => 'application/json', |
| 58 | 58 | ]; |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Ssl extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Ssl extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
| 33 | 32 | * |
@@ -56,13 +56,13 @@ discard block |
||
| 56 | 56 | public function cancel(array $params = []) |
| 57 | 57 | { |
| 58 | 58 | if (isset($params['task_id'])) { |
| 59 | - $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel'; |
|
| 59 | + $url = '/_tasks/'.$this->encode($params['task_id']).'/_cancel'; |
|
| 60 | 60 | $method = 'POST'; |
| 61 | 61 | } else { |
| 62 | 62 | $url = '/_tasks/_cancel'; |
| 63 | 63 | $method = 'POST'; |
| 64 | 64 | } |
| 65 | - $url = $this->addQueryString($url, $params, ['nodes','actions','parent_task_id','wait_for_completion','pretty','human','error_trace','source','filter_path']); |
|
| 65 | + $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'parent_task_id', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 66 | 66 | $headers = [ |
| 67 | 67 | 'Accept' => 'application/json', |
| 68 | 68 | ]; |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | public function get(array $params = []) |
| 98 | 98 | { |
| 99 | 99 | $this->checkRequiredParameters(['task_id'], $params); |
| 100 | - $url = '/_tasks/' . $this->encode($params['task_id']); |
|
| 100 | + $url = '/_tasks/'.$this->encode($params['task_id']); |
|
| 101 | 101 | $method = 'GET'; |
| 102 | 102 | |
| 103 | - $url = $this->addQueryString($url, $params, ['wait_for_completion','timeout','pretty','human','error_trace','source','filter_path']); |
|
| 103 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 104 | 104 | $headers = [ |
| 105 | 105 | 'Accept' => 'application/json', |
| 106 | 106 | ]; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $url = '/_tasks'; |
| 141 | 141 | $method = 'GET'; |
| 142 | 142 | |
| 143 | - $url = $this->addQueryString($url, $params, ['nodes','actions','detailed','parent_task_id','wait_for_completion','group_by','timeout','pretty','human','error_trace','source','filter_path']); |
|
| 143 | + $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'detailed', 'parent_task_id', 'wait_for_completion', 'group_by', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 144 | 144 | $headers = [ |
| 145 | 145 | 'Accept' => 'application/json', |
| 146 | 146 | ]; |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Tasks extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Tasks extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Cancels a task, if it can be cancelled through an API. |
| 33 | 32 | * |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $url = '/_security/profile/_activate'; |
| 55 | 55 | $method = 'POST'; |
| 56 | 56 | |
| 57 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 57 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | 58 | $headers = [ |
| 59 | 59 | 'Accept' => 'application/json', |
| 60 | 60 | 'Content-Type' => 'application/json', |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $url = '/_security/_authenticate'; |
| 88 | 88 | $method = 'GET'; |
| 89 | 89 | |
| 90 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 90 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | 91 | $headers = [ |
| 92 | 92 | 'Accept' => 'application/json', |
| 93 | 93 | ]; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $url = '/_security/api_key/_bulk_update'; |
| 122 | 122 | $method = 'POST'; |
| 123 | 123 | |
| 124 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 124 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 125 | 125 | $headers = [ |
| 126 | 126 | 'Accept' => 'application/json', |
| 127 | 127 | 'Content-Type' => 'application/json', |
@@ -156,13 +156,13 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | $this->checkRequiredParameters(['body'], $params); |
| 158 | 158 | if (isset($params['username'])) { |
| 159 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
| 159 | + $url = '/_security/user/'.$this->encode($params['username']).'/_password'; |
|
| 160 | 160 | $method = 'PUT'; |
| 161 | 161 | } else { |
| 162 | 162 | $url = '/_security/user/_password'; |
| 163 | 163 | $method = 'PUT'; |
| 164 | 164 | } |
| 165 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 165 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 166 | 166 | $headers = [ |
| 167 | 167 | 'Accept' => 'application/json', |
| 168 | 168 | 'Content-Type' => 'application/json', |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | public function clearApiKeyCache(array $params = []) |
| 196 | 196 | { |
| 197 | 197 | $this->checkRequiredParameters(['ids'], $params); |
| 198 | - $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
| 198 | + $url = '/_security/api_key/'.$this->encode($params['ids']).'/_clear_cache'; |
|
| 199 | 199 | $method = 'POST'; |
| 200 | 200 | |
| 201 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 201 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 202 | 202 | $headers = [ |
| 203 | 203 | 'Accept' => 'application/json', |
| 204 | 204 | ]; |
@@ -230,10 +230,10 @@ discard block |
||
| 230 | 230 | public function clearCachedPrivileges(array $params = []) |
| 231 | 231 | { |
| 232 | 232 | $this->checkRequiredParameters(['application'], $params); |
| 233 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
| 233 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/_clear_cache'; |
|
| 234 | 234 | $method = 'POST'; |
| 235 | 235 | |
| 236 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 236 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 237 | 237 | $headers = [ |
| 238 | 238 | 'Accept' => 'application/json', |
| 239 | 239 | ]; |
@@ -266,10 +266,10 @@ discard block |
||
| 266 | 266 | public function clearCachedRealms(array $params = []) |
| 267 | 267 | { |
| 268 | 268 | $this->checkRequiredParameters(['realms'], $params); |
| 269 | - $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
| 269 | + $url = '/_security/realm/'.$this->encode($params['realms']).'/_clear_cache'; |
|
| 270 | 270 | $method = 'POST'; |
| 271 | 271 | |
| 272 | - $url = $this->addQueryString($url, $params, ['usernames','pretty','human','error_trace','source','filter_path']); |
|
| 272 | + $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 273 | 273 | $headers = [ |
| 274 | 274 | 'Accept' => 'application/json', |
| 275 | 275 | ]; |
@@ -301,10 +301,10 @@ discard block |
||
| 301 | 301 | public function clearCachedRoles(array $params = []) |
| 302 | 302 | { |
| 303 | 303 | $this->checkRequiredParameters(['name'], $params); |
| 304 | - $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 304 | + $url = '/_security/role/'.$this->encode($params['name']).'/_clear_cache'; |
|
| 305 | 305 | $method = 'POST'; |
| 306 | 306 | |
| 307 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 307 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 308 | 308 | $headers = [ |
| 309 | 309 | 'Accept' => 'application/json', |
| 310 | 310 | ]; |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | public function clearCachedServiceTokens(array $params = []) |
| 339 | 339 | { |
| 340 | - $this->checkRequiredParameters(['namespace','service','name'], $params); |
|
| 341 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 340 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 341 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']).'/_clear_cache'; |
|
| 342 | 342 | $method = 'POST'; |
| 343 | 343 | |
| 344 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 344 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 345 | 345 | $headers = [ |
| 346 | 346 | 'Accept' => 'application/json', |
| 347 | 347 | ]; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $url = '/_security/api_key'; |
| 377 | 377 | $method = 'PUT'; |
| 378 | 378 | |
| 379 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 379 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 380 | 380 | $headers = [ |
| 381 | 381 | 'Accept' => 'application/json', |
| 382 | 382 | 'Content-Type' => 'application/json', |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $url = '/_security/cross_cluster/api_key'; |
| 412 | 412 | $method = 'POST'; |
| 413 | 413 | |
| 414 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 414 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 415 | 415 | $headers = [ |
| 416 | 416 | 'Accept' => 'application/json', |
| 417 | 417 | 'Content-Type' => 'application/json', |
@@ -446,15 +446,15 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public function createServiceToken(array $params = []) |
| 448 | 448 | { |
| 449 | - $this->checkRequiredParameters(['namespace','service'], $params); |
|
| 449 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 450 | 450 | if (isset($params['name'])) { |
| 451 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 451 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']); |
|
| 452 | 452 | $method = 'PUT'; |
| 453 | 453 | } else { |
| 454 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
| 454 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token'; |
|
| 455 | 455 | $method = 'POST'; |
| 456 | 456 | } |
| 457 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 457 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 458 | 458 | $headers = [ |
| 459 | 459 | 'Accept' => 'application/json', |
| 460 | 460 | ]; |
@@ -487,11 +487,11 @@ discard block |
||
| 487 | 487 | */ |
| 488 | 488 | public function deletePrivileges(array $params = []) |
| 489 | 489 | { |
| 490 | - $this->checkRequiredParameters(['application','name'], $params); |
|
| 491 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 490 | + $this->checkRequiredParameters(['application', 'name'], $params); |
|
| 491 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']); |
|
| 492 | 492 | $method = 'DELETE'; |
| 493 | 493 | |
| 494 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 494 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 495 | 495 | $headers = [ |
| 496 | 496 | 'Accept' => 'application/json', |
| 497 | 497 | ]; |
@@ -524,10 +524,10 @@ discard block |
||
| 524 | 524 | public function deleteRole(array $params = []) |
| 525 | 525 | { |
| 526 | 526 | $this->checkRequiredParameters(['name'], $params); |
| 527 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 527 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 528 | 528 | $method = 'DELETE'; |
| 529 | 529 | |
| 530 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 530 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 531 | 531 | $headers = [ |
| 532 | 532 | 'Accept' => 'application/json', |
| 533 | 533 | ]; |
@@ -560,10 +560,10 @@ discard block |
||
| 560 | 560 | public function deleteRoleMapping(array $params = []) |
| 561 | 561 | { |
| 562 | 562 | $this->checkRequiredParameters(['name'], $params); |
| 563 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 563 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 564 | 564 | $method = 'DELETE'; |
| 565 | 565 | |
| 566 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 566 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 567 | 567 | $headers = [ |
| 568 | 568 | 'Accept' => 'application/json', |
| 569 | 569 | ]; |
@@ -597,11 +597,11 @@ discard block |
||
| 597 | 597 | */ |
| 598 | 598 | public function deleteServiceToken(array $params = []) |
| 599 | 599 | { |
| 600 | - $this->checkRequiredParameters(['namespace','service','name'], $params); |
|
| 601 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 600 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 601 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']); |
|
| 602 | 602 | $method = 'DELETE'; |
| 603 | 603 | |
| 604 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 604 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 605 | 605 | $headers = [ |
| 606 | 606 | 'Accept' => 'application/json', |
| 607 | 607 | ]; |
@@ -634,10 +634,10 @@ discard block |
||
| 634 | 634 | public function deleteUser(array $params = []) |
| 635 | 635 | { |
| 636 | 636 | $this->checkRequiredParameters(['username'], $params); |
| 637 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 637 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 638 | 638 | $method = 'DELETE'; |
| 639 | 639 | |
| 640 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 640 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 641 | 641 | $headers = [ |
| 642 | 642 | 'Accept' => 'application/json', |
| 643 | 643 | ]; |
@@ -670,10 +670,10 @@ discard block |
||
| 670 | 670 | public function disableUser(array $params = []) |
| 671 | 671 | { |
| 672 | 672 | $this->checkRequiredParameters(['username'], $params); |
| 673 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
| 673 | + $url = '/_security/user/'.$this->encode($params['username']).'/_disable'; |
|
| 674 | 674 | $method = 'PUT'; |
| 675 | 675 | |
| 676 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 676 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 677 | 677 | $headers = [ |
| 678 | 678 | 'Accept' => 'application/json', |
| 679 | 679 | ]; |
@@ -706,10 +706,10 @@ discard block |
||
| 706 | 706 | public function disableUserProfile(array $params = []) |
| 707 | 707 | { |
| 708 | 708 | $this->checkRequiredParameters(['uid'], $params); |
| 709 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
| 709 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_disable'; |
|
| 710 | 710 | $method = 'PUT'; |
| 711 | 711 | |
| 712 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 712 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 713 | 713 | $headers = [ |
| 714 | 714 | 'Accept' => 'application/json', |
| 715 | 715 | ]; |
@@ -742,10 +742,10 @@ discard block |
||
| 742 | 742 | public function enableUser(array $params = []) |
| 743 | 743 | { |
| 744 | 744 | $this->checkRequiredParameters(['username'], $params); |
| 745 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
| 745 | + $url = '/_security/user/'.$this->encode($params['username']).'/_enable'; |
|
| 746 | 746 | $method = 'PUT'; |
| 747 | 747 | |
| 748 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 748 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 749 | 749 | $headers = [ |
| 750 | 750 | 'Accept' => 'application/json', |
| 751 | 751 | ]; |
@@ -778,10 +778,10 @@ discard block |
||
| 778 | 778 | public function enableUserProfile(array $params = []) |
| 779 | 779 | { |
| 780 | 780 | $this->checkRequiredParameters(['uid'], $params); |
| 781 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
| 781 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_enable'; |
|
| 782 | 782 | $method = 'PUT'; |
| 783 | 783 | |
| 784 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 784 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 785 | 785 | $headers = [ |
| 786 | 786 | 'Accept' => 'application/json', |
| 787 | 787 | ]; |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | $url = '/_security/enroll/kibana'; |
| 814 | 814 | $method = 'GET'; |
| 815 | 815 | |
| 816 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 816 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 817 | 817 | $headers = [ |
| 818 | 818 | 'Accept' => 'application/json', |
| 819 | 819 | 'Content-Type' => 'application/json', |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $url = '/_security/enroll/node'; |
| 847 | 847 | $method = 'GET'; |
| 848 | 848 | |
| 849 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 849 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 850 | 850 | $headers = [ |
| 851 | 851 | 'Accept' => 'application/json', |
| 852 | 852 | 'Content-Type' => 'application/json', |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | $url = '/_security/api_key'; |
| 887 | 887 | $method = 'GET'; |
| 888 | 888 | |
| 889 | - $url = $this->addQueryString($url, $params, ['id','name','username','realm_name','owner','with_limited_by','active_only','pretty','human','error_trace','source','filter_path']); |
|
| 889 | + $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 890 | 890 | $headers = [ |
| 891 | 891 | 'Accept' => 'application/json', |
| 892 | 892 | ]; |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | $url = '/_security/privilege/_builtin'; |
| 919 | 919 | $method = 'GET'; |
| 920 | 920 | |
| 921 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 921 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 922 | 922 | $headers = [ |
| 923 | 923 | 'Accept' => 'application/json', |
| 924 | 924 | ]; |
@@ -950,16 +950,16 @@ discard block |
||
| 950 | 950 | public function getPrivileges(array $params = []) |
| 951 | 951 | { |
| 952 | 952 | if (isset($params['application']) && isset($params['name'])) { |
| 953 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 953 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']); |
|
| 954 | 954 | $method = 'GET'; |
| 955 | 955 | } elseif (isset($params['application'])) { |
| 956 | - $url = '/_security/privilege/' . $this->encode($params['application']); |
|
| 956 | + $url = '/_security/privilege/'.$this->encode($params['application']); |
|
| 957 | 957 | $method = 'GET'; |
| 958 | 958 | } else { |
| 959 | 959 | $url = '/_security/privilege'; |
| 960 | 960 | $method = 'GET'; |
| 961 | 961 | } |
| 962 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 962 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 963 | 963 | $headers = [ |
| 964 | 964 | 'Accept' => 'application/json', |
| 965 | 965 | ]; |
@@ -990,13 +990,13 @@ discard block |
||
| 990 | 990 | public function getRole(array $params = []) |
| 991 | 991 | { |
| 992 | 992 | if (isset($params['name'])) { |
| 993 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 993 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 994 | 994 | $method = 'GET'; |
| 995 | 995 | } else { |
| 996 | 996 | $url = '/_security/role'; |
| 997 | 997 | $method = 'GET'; |
| 998 | 998 | } |
| 999 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 999 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1000 | 1000 | $headers = [ |
| 1001 | 1001 | 'Accept' => 'application/json', |
| 1002 | 1002 | ]; |
@@ -1027,13 +1027,13 @@ discard block |
||
| 1027 | 1027 | public function getRoleMapping(array $params = []) |
| 1028 | 1028 | { |
| 1029 | 1029 | if (isset($params['name'])) { |
| 1030 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 1030 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 1031 | 1031 | $method = 'GET'; |
| 1032 | 1032 | } else { |
| 1033 | 1033 | $url = '/_security/role_mapping'; |
| 1034 | 1034 | $method = 'GET'; |
| 1035 | 1035 | } |
| 1036 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1036 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1037 | 1037 | $headers = [ |
| 1038 | 1038 | 'Accept' => 'application/json', |
| 1039 | 1039 | ]; |
@@ -1065,16 +1065,16 @@ discard block |
||
| 1065 | 1065 | public function getServiceAccounts(array $params = []) |
| 1066 | 1066 | { |
| 1067 | 1067 | if (isset($params['namespace']) && isset($params['service'])) { |
| 1068 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
| 1068 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']); |
|
| 1069 | 1069 | $method = 'GET'; |
| 1070 | 1070 | } elseif (isset($params['namespace'])) { |
| 1071 | - $url = '/_security/service/' . $this->encode($params['namespace']); |
|
| 1071 | + $url = '/_security/service/'.$this->encode($params['namespace']); |
|
| 1072 | 1072 | $method = 'GET'; |
| 1073 | 1073 | } else { |
| 1074 | 1074 | $url = '/_security/service'; |
| 1075 | 1075 | $method = 'GET'; |
| 1076 | 1076 | } |
| 1077 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1077 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1078 | 1078 | $headers = [ |
| 1079 | 1079 | 'Accept' => 'application/json', |
| 1080 | 1080 | ]; |
@@ -1106,11 +1106,11 @@ discard block |
||
| 1106 | 1106 | */ |
| 1107 | 1107 | public function getServiceCredentials(array $params = []) |
| 1108 | 1108 | { |
| 1109 | - $this->checkRequiredParameters(['namespace','service'], $params); |
|
| 1110 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
| 1109 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 1110 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential'; |
|
| 1111 | 1111 | $method = 'GET'; |
| 1112 | 1112 | |
| 1113 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1113 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1114 | 1114 | $headers = [ |
| 1115 | 1115 | 'Accept' => 'application/json', |
| 1116 | 1116 | ]; |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | $url = '/_security/settings'; |
| 1143 | 1143 | $method = 'GET'; |
| 1144 | 1144 | |
| 1145 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1145 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1146 | 1146 | $headers = [ |
| 1147 | 1147 | 'Accept' => 'application/json', |
| 1148 | 1148 | 'Content-Type' => 'application/json', |
@@ -1177,7 +1177,7 @@ discard block |
||
| 1177 | 1177 | $url = '/_security/oauth2/token'; |
| 1178 | 1178 | $method = 'POST'; |
| 1179 | 1179 | |
| 1180 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1180 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1181 | 1181 | $headers = [ |
| 1182 | 1182 | 'Accept' => 'application/json', |
| 1183 | 1183 | 'Content-Type' => 'application/json', |
@@ -1210,13 +1210,13 @@ discard block |
||
| 1210 | 1210 | public function getUser(array $params = []) |
| 1211 | 1211 | { |
| 1212 | 1212 | if (isset($params['username'])) { |
| 1213 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1213 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 1214 | 1214 | $method = 'GET'; |
| 1215 | 1215 | } else { |
| 1216 | 1216 | $url = '/_security/user'; |
| 1217 | 1217 | $method = 'GET'; |
| 1218 | 1218 | } |
| 1219 | - $url = $this->addQueryString($url, $params, ['with_profile_uid','pretty','human','error_trace','source','filter_path']); |
|
| 1219 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1220 | 1220 | $headers = [ |
| 1221 | 1221 | 'Accept' => 'application/json', |
| 1222 | 1222 | ]; |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $url = '/_security/user/_privileges'; |
| 1249 | 1249 | $method = 'GET'; |
| 1250 | 1250 | |
| 1251 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1251 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1252 | 1252 | $headers = [ |
| 1253 | 1253 | 'Accept' => 'application/json', |
| 1254 | 1254 | ]; |
@@ -1281,10 +1281,10 @@ discard block |
||
| 1281 | 1281 | public function getUserProfile(array $params = []) |
| 1282 | 1282 | { |
| 1283 | 1283 | $this->checkRequiredParameters(['uid'], $params); |
| 1284 | - $url = '/_security/profile/' . $this->encode($params['uid']); |
|
| 1284 | + $url = '/_security/profile/'.$this->encode($params['uid']); |
|
| 1285 | 1285 | $method = 'GET'; |
| 1286 | 1286 | |
| 1287 | - $url = $this->addQueryString($url, $params, ['data','pretty','human','error_trace','source','filter_path']); |
|
| 1287 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1288 | 1288 | $headers = [ |
| 1289 | 1289 | 'Accept' => 'application/json', |
| 1290 | 1290 | ]; |
@@ -1319,7 +1319,7 @@ discard block |
||
| 1319 | 1319 | $url = '/_security/api_key/grant'; |
| 1320 | 1320 | $method = 'POST'; |
| 1321 | 1321 | |
| 1322 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 1322 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1323 | 1323 | $headers = [ |
| 1324 | 1324 | 'Accept' => 'application/json', |
| 1325 | 1325 | 'Content-Type' => 'application/json', |
@@ -1353,13 +1353,13 @@ discard block |
||
| 1353 | 1353 | { |
| 1354 | 1354 | $this->checkRequiredParameters(['body'], $params); |
| 1355 | 1355 | if (isset($params['user'])) { |
| 1356 | - $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
| 1356 | + $url = '/_security/user/'.$this->encode($params['user']).'/_has_privileges'; |
|
| 1357 | 1357 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1358 | 1358 | } else { |
| 1359 | 1359 | $url = '/_security/user/_has_privileges'; |
| 1360 | 1360 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1361 | 1361 | } |
| 1362 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1362 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1363 | 1363 | $headers = [ |
| 1364 | 1364 | 'Accept' => 'application/json', |
| 1365 | 1365 | 'Content-Type' => 'application/json', |
@@ -1394,7 +1394,7 @@ discard block |
||
| 1394 | 1394 | $url = '/_security/profile/_has_privileges'; |
| 1395 | 1395 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1396 | 1396 | |
| 1397 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1397 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1398 | 1398 | $headers = [ |
| 1399 | 1399 | 'Accept' => 'application/json', |
| 1400 | 1400 | 'Content-Type' => 'application/json', |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | $url = '/_security/api_key'; |
| 1430 | 1430 | $method = 'DELETE'; |
| 1431 | 1431 | |
| 1432 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1432 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1433 | 1433 | $headers = [ |
| 1434 | 1434 | 'Accept' => 'application/json', |
| 1435 | 1435 | 'Content-Type' => 'application/json', |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | $url = '/_security/oauth2/token'; |
| 1465 | 1465 | $method = 'DELETE'; |
| 1466 | 1466 | |
| 1467 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1467 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1468 | 1468 | $headers = [ |
| 1469 | 1469 | 'Accept' => 'application/json', |
| 1470 | 1470 | 'Content-Type' => 'application/json', |
@@ -1499,7 +1499,7 @@ discard block |
||
| 1499 | 1499 | $url = '/_security/oidc/authenticate'; |
| 1500 | 1500 | $method = 'POST'; |
| 1501 | 1501 | |
| 1502 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1502 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1503 | 1503 | $headers = [ |
| 1504 | 1504 | 'Accept' => 'application/json', |
| 1505 | 1505 | 'Content-Type' => 'application/json', |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | $url = '/_security/oidc/logout'; |
| 1535 | 1535 | $method = 'POST'; |
| 1536 | 1536 | |
| 1537 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1537 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1538 | 1538 | $headers = [ |
| 1539 | 1539 | 'Accept' => 'application/json', |
| 1540 | 1540 | 'Content-Type' => 'application/json', |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | $url = '/_security/oidc/prepare'; |
| 1570 | 1570 | $method = 'POST'; |
| 1571 | 1571 | |
| 1572 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1572 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1573 | 1573 | $headers = [ |
| 1574 | 1574 | 'Accept' => 'application/json', |
| 1575 | 1575 | 'Content-Type' => 'application/json', |
@@ -1605,7 +1605,7 @@ discard block |
||
| 1605 | 1605 | $url = '/_security/privilege/'; |
| 1606 | 1606 | $method = 'PUT'; |
| 1607 | 1607 | |
| 1608 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 1608 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1609 | 1609 | $headers = [ |
| 1610 | 1610 | 'Accept' => 'application/json', |
| 1611 | 1611 | 'Content-Type' => 'application/json', |
@@ -1639,11 +1639,11 @@ discard block |
||
| 1639 | 1639 | */ |
| 1640 | 1640 | public function putRole(array $params = []) |
| 1641 | 1641 | { |
| 1642 | - $this->checkRequiredParameters(['name','body'], $params); |
|
| 1643 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 1642 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1643 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 1644 | 1644 | $method = 'PUT'; |
| 1645 | 1645 | |
| 1646 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 1646 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1647 | 1647 | $headers = [ |
| 1648 | 1648 | 'Accept' => 'application/json', |
| 1649 | 1649 | 'Content-Type' => 'application/json', |
@@ -1677,11 +1677,11 @@ discard block |
||
| 1677 | 1677 | */ |
| 1678 | 1678 | public function putRoleMapping(array $params = []) |
| 1679 | 1679 | { |
| 1680 | - $this->checkRequiredParameters(['name','body'], $params); |
|
| 1681 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 1680 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1681 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 1682 | 1682 | $method = 'PUT'; |
| 1683 | 1683 | |
| 1684 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 1684 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1685 | 1685 | $headers = [ |
| 1686 | 1686 | 'Accept' => 'application/json', |
| 1687 | 1687 | 'Content-Type' => 'application/json', |
@@ -1715,11 +1715,11 @@ discard block |
||
| 1715 | 1715 | */ |
| 1716 | 1716 | public function putUser(array $params = []) |
| 1717 | 1717 | { |
| 1718 | - $this->checkRequiredParameters(['username','body'], $params); |
|
| 1719 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1718 | + $this->checkRequiredParameters(['username', 'body'], $params); |
|
| 1719 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 1720 | 1720 | $method = 'PUT'; |
| 1721 | 1721 | |
| 1722 | - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); |
|
| 1722 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1723 | 1723 | $headers = [ |
| 1724 | 1724 | 'Accept' => 'application/json', |
| 1725 | 1725 | 'Content-Type' => 'application/json', |
@@ -1754,7 +1754,7 @@ discard block |
||
| 1754 | 1754 | $url = '/_security/_query/api_key'; |
| 1755 | 1755 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1756 | 1756 | |
| 1757 | - $url = $this->addQueryString($url, $params, ['with_limited_by','pretty','human','error_trace','source','filter_path']); |
|
| 1757 | + $url = $this->addQueryString($url, $params, ['with_limited_by', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1758 | 1758 | $headers = [ |
| 1759 | 1759 | 'Accept' => 'application/json', |
| 1760 | 1760 | 'Content-Type' => 'application/json', |
@@ -1789,7 +1789,7 @@ discard block |
||
| 1789 | 1789 | $url = '/_security/_query/user'; |
| 1790 | 1790 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1791 | 1791 | |
| 1792 | - $url = $this->addQueryString($url, $params, ['with_profile_uid','pretty','human','error_trace','source','filter_path']); |
|
| 1792 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1793 | 1793 | $headers = [ |
| 1794 | 1794 | 'Accept' => 'application/json', |
| 1795 | 1795 | 'Content-Type' => 'application/json', |
@@ -1824,7 +1824,7 @@ discard block |
||
| 1824 | 1824 | $url = '/_security/saml/authenticate'; |
| 1825 | 1825 | $method = 'POST'; |
| 1826 | 1826 | |
| 1827 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1827 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1828 | 1828 | $headers = [ |
| 1829 | 1829 | 'Accept' => 'application/json', |
| 1830 | 1830 | 'Content-Type' => 'application/json', |
@@ -1859,7 +1859,7 @@ discard block |
||
| 1859 | 1859 | $url = '/_security/saml/complete_logout'; |
| 1860 | 1860 | $method = 'POST'; |
| 1861 | 1861 | |
| 1862 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1862 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1863 | 1863 | $headers = [ |
| 1864 | 1864 | 'Accept' => 'application/json', |
| 1865 | 1865 | 'Content-Type' => 'application/json', |
@@ -1894,7 +1894,7 @@ discard block |
||
| 1894 | 1894 | $url = '/_security/saml/invalidate'; |
| 1895 | 1895 | $method = 'POST'; |
| 1896 | 1896 | |
| 1897 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1897 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1898 | 1898 | $headers = [ |
| 1899 | 1899 | 'Accept' => 'application/json', |
| 1900 | 1900 | 'Content-Type' => 'application/json', |
@@ -1929,7 +1929,7 @@ discard block |
||
| 1929 | 1929 | $url = '/_security/saml/logout'; |
| 1930 | 1930 | $method = 'POST'; |
| 1931 | 1931 | |
| 1932 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1932 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1933 | 1933 | $headers = [ |
| 1934 | 1934 | 'Accept' => 'application/json', |
| 1935 | 1935 | 'Content-Type' => 'application/json', |
@@ -1964,7 +1964,7 @@ discard block |
||
| 1964 | 1964 | $url = '/_security/saml/prepare'; |
| 1965 | 1965 | $method = 'POST'; |
| 1966 | 1966 | |
| 1967 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1967 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1968 | 1968 | $headers = [ |
| 1969 | 1969 | 'Accept' => 'application/json', |
| 1970 | 1970 | 'Content-Type' => 'application/json', |
@@ -1997,10 +1997,10 @@ discard block |
||
| 1997 | 1997 | public function samlServiceProviderMetadata(array $params = []) |
| 1998 | 1998 | { |
| 1999 | 1999 | $this->checkRequiredParameters(['realm_name'], $params); |
| 2000 | - $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
| 2000 | + $url = '/_security/saml/metadata/'.$this->encode($params['realm_name']); |
|
| 2001 | 2001 | $method = 'GET'; |
| 2002 | 2002 | |
| 2003 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 2003 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2004 | 2004 | $headers = [ |
| 2005 | 2005 | 'Accept' => 'application/json', |
| 2006 | 2006 | 'Content-Type' => 'application/json', |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | $url = '/_security/profile/_suggest'; |
| 2036 | 2036 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 2037 | 2037 | |
| 2038 | - $url = $this->addQueryString($url, $params, ['data','pretty','human','error_trace','source','filter_path']); |
|
| 2038 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2039 | 2039 | $headers = [ |
| 2040 | 2040 | 'Accept' => 'application/json', |
| 2041 | 2041 | 'Content-Type' => 'application/json', |
@@ -2069,10 +2069,10 @@ discard block |
||
| 2069 | 2069 | public function updateApiKey(array $params = []) |
| 2070 | 2070 | { |
| 2071 | 2071 | $this->checkRequiredParameters(['id'], $params); |
| 2072 | - $url = '/_security/api_key/' . $this->encode($params['id']); |
|
| 2072 | + $url = '/_security/api_key/'.$this->encode($params['id']); |
|
| 2073 | 2073 | $method = 'PUT'; |
| 2074 | 2074 | |
| 2075 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 2075 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2076 | 2076 | $headers = [ |
| 2077 | 2077 | 'Accept' => 'application/json', |
| 2078 | 2078 | 'Content-Type' => 'application/json', |
@@ -2105,11 +2105,11 @@ discard block |
||
| 2105 | 2105 | */ |
| 2106 | 2106 | public function updateCrossClusterApiKey(array $params = []) |
| 2107 | 2107 | { |
| 2108 | - $this->checkRequiredParameters(['id','body'], $params); |
|
| 2109 | - $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
| 2108 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 2109 | + $url = '/_security/cross_cluster/api_key/'.$this->encode($params['id']); |
|
| 2110 | 2110 | $method = 'PUT'; |
| 2111 | 2111 | |
| 2112 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 2112 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2113 | 2113 | $headers = [ |
| 2114 | 2114 | 'Accept' => 'application/json', |
| 2115 | 2115 | 'Content-Type' => 'application/json', |
@@ -2144,7 +2144,7 @@ discard block |
||
| 2144 | 2144 | $url = '/_security/settings'; |
| 2145 | 2145 | $method = 'PUT'; |
| 2146 | 2146 | |
| 2147 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 2147 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2148 | 2148 | $headers = [ |
| 2149 | 2149 | 'Accept' => 'application/json', |
| 2150 | 2150 | 'Content-Type' => 'application/json', |
@@ -2180,11 +2180,11 @@ discard block |
||
| 2180 | 2180 | */ |
| 2181 | 2181 | public function updateUserProfileData(array $params = []) |
| 2182 | 2182 | { |
| 2183 | - $this->checkRequiredParameters(['uid','body'], $params); |
|
| 2184 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
| 2183 | + $this->checkRequiredParameters(['uid', 'body'], $params); |
|
| 2184 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_data'; |
|
| 2185 | 2185 | $method = 'PUT'; |
| 2186 | 2186 | |
| 2187 | - $url = $this->addQueryString($url, $params, ['if_seq_no','if_primary_term','refresh','pretty','human','error_trace','source','filter_path']); |
|
| 2187 | + $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2188 | 2188 | $headers = [ |
| 2189 | 2189 | 'Accept' => 'application/json', |
| 2190 | 2190 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Security extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Security extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Creates or updates the user profile on behalf of another user. |
| 33 | 32 | * |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | public function deletePipeline(array $params = []) |
| 53 | 53 | { |
| 54 | 54 | $this->checkRequiredParameters(['id'], $params); |
| 55 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
| 55 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
| 56 | 56 | $method = 'DELETE'; |
| 57 | 57 | |
| 58 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 59 | 59 | $headers = [ |
| 60 | 60 | 'Accept' => 'application/json', |
| 61 | 61 | ]; |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | public function getPipeline(array $params = []) |
| 87 | 87 | { |
| 88 | 88 | if (isset($params['id'])) { |
| 89 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
| 89 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
| 90 | 90 | $method = 'GET'; |
| 91 | 91 | } else { |
| 92 | 92 | $url = '/_logstash/pipeline'; |
| 93 | 93 | $method = 'GET'; |
| 94 | 94 | } |
| 95 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 95 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 96 | 96 | $headers = [ |
| 97 | 97 | 'Accept' => 'application/json', |
| 98 | 98 | ]; |
@@ -124,11 +124,11 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function putPipeline(array $params = []) |
| 126 | 126 | { |
| 127 | - $this->checkRequiredParameters(['id','body'], $params); |
|
| 128 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
| 127 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 128 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
| 129 | 129 | $method = 'PUT'; |
| 130 | 130 | |
| 131 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 131 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 132 | 132 | $headers = [ |
| 133 | 133 | 'Accept' => 'application/json', |
| 134 | 134 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Logstash extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Logstash extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Deletes Logstash Pipelines used by Central Management |
| 33 | 32 | * |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | public function deleteNode(array $params = []) |
| 53 | 53 | { |
| 54 | 54 | $this->checkRequiredParameters(['node_id'], $params); |
| 55 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
| 55 | + $url = '/_nodes/'.$this->encode($params['node_id']).'/shutdown'; |
|
| 56 | 56 | $method = 'DELETE'; |
| 57 | 57 | |
| 58 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 59 | 59 | $headers = [ |
| 60 | 60 | 'Accept' => 'application/json', |
| 61 | 61 | 'Content-Type' => 'application/json', |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | public function getNode(array $params = []) |
| 88 | 88 | { |
| 89 | 89 | if (isset($params['node_id'])) { |
| 90 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
| 90 | + $url = '/_nodes/'.$this->encode($params['node_id']).'/shutdown'; |
|
| 91 | 91 | $method = 'GET'; |
| 92 | 92 | } else { |
| 93 | 93 | $url = '/_nodes/shutdown'; |
| 94 | 94 | $method = 'GET'; |
| 95 | 95 | } |
| 96 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 96 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 97 | 97 | $headers = [ |
| 98 | 98 | 'Accept' => 'application/json', |
| 99 | 99 | 'Content-Type' => 'application/json', |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function putNode(array $params = []) |
| 128 | 128 | { |
| 129 | - $this->checkRequiredParameters(['node_id','body'], $params); |
|
| 130 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
| 129 | + $this->checkRequiredParameters(['node_id', 'body'], $params); |
|
| 130 | + $url = '/_nodes/'.$this->encode($params['node_id']).'/shutdown'; |
|
| 131 | 131 | $method = 'PUT'; |
| 132 | 132 | |
| 133 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 133 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 134 | 134 | $headers = [ |
| 135 | 135 | 'Accept' => 'application/json', |
| 136 | 136 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Shutdown extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Shutdown extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
| 33 | 32 | * |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function addBlock(array $params = []) |
| 59 | 59 | { |
| 60 | - $this->checkRequiredParameters(['index','block'], $params); |
|
| 61 | - $url = '/' . $this->encode($params['index']) . '/_block/' . $this->encode($params['block']); |
|
| 60 | + $this->checkRequiredParameters(['index', 'block'], $params); |
|
| 61 | + $url = '/'.$this->encode($params['index']).'/_block/'.$this->encode($params['block']); |
|
| 62 | 62 | $method = 'PUT'; |
| 63 | 63 | |
| 64 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 64 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 65 | 65 | $headers = [ |
| 66 | 66 | 'Accept' => 'application/json', |
| 67 | 67 | ]; |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | public function analyze(array $params = []) |
| 94 | 94 | { |
| 95 | 95 | if (isset($params['index'])) { |
| 96 | - $url = '/' . $this->encode($params['index']) . '/_analyze'; |
|
| 96 | + $url = '/'.$this->encode($params['index']).'/_analyze'; |
|
| 97 | 97 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 98 | 98 | } else { |
| 99 | 99 | $url = '/_analyze'; |
| 100 | 100 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 101 | 101 | } |
| 102 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 102 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 103 | 103 | $headers = [ |
| 104 | 104 | 'Accept' => 'application/json', |
| 105 | 105 | 'Content-Type' => 'application/json', |
@@ -138,13 +138,13 @@ discard block |
||
| 138 | 138 | public function clearCache(array $params = []) |
| 139 | 139 | { |
| 140 | 140 | if (isset($params['index'])) { |
| 141 | - $url = '/' . $this->encode($params['index']) . '/_cache/clear'; |
|
| 141 | + $url = '/'.$this->encode($params['index']).'/_cache/clear'; |
|
| 142 | 142 | $method = 'POST'; |
| 143 | 143 | } else { |
| 144 | 144 | $url = '/_cache/clear'; |
| 145 | 145 | $method = 'POST'; |
| 146 | 146 | } |
| 147 | - $url = $this->addQueryString($url, $params, ['fielddata','fields','query','ignore_unavailable','allow_no_indices','expand_wildcards','request','pretty','human','error_trace','source','filter_path']); |
|
| 147 | + $url = $this->addQueryString($url, $params, ['fielddata', 'fields', 'query', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'request', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 148 | 148 | $headers = [ |
| 149 | 149 | 'Accept' => 'application/json', |
| 150 | 150 | ]; |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function clone(array $params = []) |
| 182 | 182 | { |
| 183 | - $this->checkRequiredParameters(['index','target'], $params); |
|
| 184 | - $url = '/' . $this->encode($params['index']) . '/_clone/' . $this->encode($params['target']); |
|
| 183 | + $this->checkRequiredParameters(['index', 'target'], $params); |
|
| 184 | + $url = '/'.$this->encode($params['index']).'/_clone/'.$this->encode($params['target']); |
|
| 185 | 185 | $method = 'PUT'; |
| 186 | 186 | |
| 187 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 187 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 188 | 188 | $headers = [ |
| 189 | 189 | 'Accept' => 'application/json', |
| 190 | 190 | 'Content-Type' => 'application/json', |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | public function close(array $params = []) |
| 224 | 224 | { |
| 225 | 225 | $this->checkRequiredParameters(['index'], $params); |
| 226 | - $url = '/' . $this->encode($params['index']) . '/_close'; |
|
| 226 | + $url = '/'.$this->encode($params['index']).'/_close'; |
|
| 227 | 227 | $method = 'POST'; |
| 228 | 228 | |
| 229 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 229 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 230 | 230 | $headers = [ |
| 231 | 231 | 'Accept' => 'application/json', |
| 232 | 232 | ]; |
@@ -262,10 +262,10 @@ discard block |
||
| 262 | 262 | public function create(array $params = []) |
| 263 | 263 | { |
| 264 | 264 | $this->checkRequiredParameters(['index'], $params); |
| 265 | - $url = '/' . $this->encode($params['index']); |
|
| 265 | + $url = '/'.$this->encode($params['index']); |
|
| 266 | 266 | $method = 'PUT'; |
| 267 | 267 | |
| 268 | - $url = $this->addQueryString($url, $params, ['wait_for_active_shards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 268 | + $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 269 | 269 | $headers = [ |
| 270 | 270 | 'Accept' => 'application/json', |
| 271 | 271 | 'Content-Type' => 'application/json', |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | public function createDataStream(array $params = []) |
| 299 | 299 | { |
| 300 | 300 | $this->checkRequiredParameters(['name'], $params); |
| 301 | - $url = '/_data_stream/' . $this->encode($params['name']); |
|
| 301 | + $url = '/_data_stream/'.$this->encode($params['name']); |
|
| 302 | 302 | $method = 'PUT'; |
| 303 | 303 | |
| 304 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 304 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 305 | 305 | $headers = [ |
| 306 | 306 | 'Accept' => 'application/json', |
| 307 | 307 | ]; |
@@ -332,13 +332,13 @@ discard block |
||
| 332 | 332 | public function dataStreamsStats(array $params = []) |
| 333 | 333 | { |
| 334 | 334 | if (isset($params['name'])) { |
| 335 | - $url = '/_data_stream/' . $this->encode($params['name']) . '/_stats'; |
|
| 335 | + $url = '/_data_stream/'.$this->encode($params['name']).'/_stats'; |
|
| 336 | 336 | $method = 'GET'; |
| 337 | 337 | } else { |
| 338 | 338 | $url = '/_data_stream/_stats'; |
| 339 | 339 | $method = 'GET'; |
| 340 | 340 | } |
| 341 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 341 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 342 | 342 | $headers = [ |
| 343 | 343 | 'Accept' => 'application/json', |
| 344 | 344 | ]; |
@@ -375,10 +375,10 @@ discard block |
||
| 375 | 375 | public function delete(array $params = []) |
| 376 | 376 | { |
| 377 | 377 | $this->checkRequiredParameters(['index'], $params); |
| 378 | - $url = '/' . $this->encode($params['index']); |
|
| 378 | + $url = '/'.$this->encode($params['index']); |
|
| 379 | 379 | $method = 'DELETE'; |
| 380 | 380 | |
| 381 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 381 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 382 | 382 | $headers = [ |
| 383 | 383 | 'Accept' => 'application/json', |
| 384 | 384 | ]; |
@@ -412,11 +412,11 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | public function deleteAlias(array $params = []) |
| 414 | 414 | { |
| 415 | - $this->checkRequiredParameters(['index','name'], $params); |
|
| 416 | - $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']); |
|
| 415 | + $this->checkRequiredParameters(['index', 'name'], $params); |
|
| 416 | + $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']); |
|
| 417 | 417 | $method = 'DELETE'; |
| 418 | 418 | |
| 419 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 419 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 420 | 420 | $headers = [ |
| 421 | 421 | 'Accept' => 'application/json', |
| 422 | 422 | ]; |
@@ -452,10 +452,10 @@ discard block |
||
| 452 | 452 | public function deleteDataLifecycle(array $params = []) |
| 453 | 453 | { |
| 454 | 454 | $this->checkRequiredParameters(['name'], $params); |
| 455 | - $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle'; |
|
| 455 | + $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle'; |
|
| 456 | 456 | $method = 'DELETE'; |
| 457 | 457 | |
| 458 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 458 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 459 | 459 | $headers = [ |
| 460 | 460 | 'Accept' => 'application/json', |
| 461 | 461 | ]; |
@@ -488,10 +488,10 @@ discard block |
||
| 488 | 488 | public function deleteDataStream(array $params = []) |
| 489 | 489 | { |
| 490 | 490 | $this->checkRequiredParameters(['name'], $params); |
| 491 | - $url = '/_data_stream/' . $this->encode($params['name']); |
|
| 491 | + $url = '/_data_stream/'.$this->encode($params['name']); |
|
| 492 | 492 | $method = 'DELETE'; |
| 493 | 493 | |
| 494 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 494 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 495 | 495 | $headers = [ |
| 496 | 496 | 'Accept' => 'application/json', |
| 497 | 497 | ]; |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | public function deleteIndexTemplate(array $params = []) |
| 526 | 526 | { |
| 527 | 527 | $this->checkRequiredParameters(['name'], $params); |
| 528 | - $url = '/_index_template/' . $this->encode($params['name']); |
|
| 528 | + $url = '/_index_template/'.$this->encode($params['name']); |
|
| 529 | 529 | $method = 'DELETE'; |
| 530 | 530 | |
| 531 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 531 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 532 | 532 | $headers = [ |
| 533 | 533 | 'Accept' => 'application/json', |
| 534 | 534 | ]; |
@@ -562,10 +562,10 @@ discard block |
||
| 562 | 562 | public function deleteTemplate(array $params = []) |
| 563 | 563 | { |
| 564 | 564 | $this->checkRequiredParameters(['name'], $params); |
| 565 | - $url = '/_template/' . $this->encode($params['name']); |
|
| 565 | + $url = '/_template/'.$this->encode($params['name']); |
|
| 566 | 566 | $method = 'DELETE'; |
| 567 | 567 | |
| 568 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 568 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 569 | 569 | $headers = [ |
| 570 | 570 | 'Accept' => 'application/json', |
| 571 | 571 | ]; |
@@ -603,10 +603,10 @@ discard block |
||
| 603 | 603 | public function diskUsage(array $params = []) |
| 604 | 604 | { |
| 605 | 605 | $this->checkRequiredParameters(['index'], $params); |
| 606 | - $url = '/' . $this->encode($params['index']) . '/_disk_usage'; |
|
| 606 | + $url = '/'.$this->encode($params['index']).'/_disk_usage'; |
|
| 607 | 607 | $method = 'POST'; |
| 608 | 608 | |
| 609 | - $url = $this->addQueryString($url, $params, ['run_expensive_tasks','flush','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 609 | + $url = $this->addQueryString($url, $params, ['run_expensive_tasks', 'flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 610 | 610 | $headers = [ |
| 611 | 611 | 'Accept' => 'application/json', |
| 612 | 612 | ]; |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | */ |
| 641 | 641 | public function downsample(array $params = []) |
| 642 | 642 | { |
| 643 | - $this->checkRequiredParameters(['index','target_index','body'], $params); |
|
| 644 | - $url = '/' . $this->encode($params['index']) . '/_downsample/' . $this->encode($params['target_index']); |
|
| 643 | + $this->checkRequiredParameters(['index', 'target_index', 'body'], $params); |
|
| 644 | + $url = '/'.$this->encode($params['index']).'/_downsample/'.$this->encode($params['target_index']); |
|
| 645 | 645 | $method = 'POST'; |
| 646 | 646 | |
| 647 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 647 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 648 | 648 | $headers = [ |
| 649 | 649 | 'Accept' => 'application/json', |
| 650 | 650 | 'Content-Type' => 'application/json', |
@@ -683,10 +683,10 @@ discard block |
||
| 683 | 683 | public function exists(array $params = []) |
| 684 | 684 | { |
| 685 | 685 | $this->checkRequiredParameters(['index'], $params); |
| 686 | - $url = '/' . $this->encode($params['index']); |
|
| 686 | + $url = '/'.$this->encode($params['index']); |
|
| 687 | 687 | $method = 'HEAD'; |
| 688 | 688 | |
| 689 | - $url = $this->addQueryString($url, $params, ['local','ignore_unavailable','allow_no_indices','expand_wildcards','flat_settings','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 689 | + $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 690 | 690 | $headers = [ |
| 691 | 691 | 'Accept' => 'application/json', |
| 692 | 692 | ]; |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | { |
| 725 | 725 | $this->checkRequiredParameters(['name'], $params); |
| 726 | 726 | if (isset($params['index'])) { |
| 727 | - $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']); |
|
| 727 | + $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']); |
|
| 728 | 728 | $method = 'HEAD'; |
| 729 | 729 | } else { |
| 730 | - $url = '/_alias/' . $this->encode($params['name']); |
|
| 730 | + $url = '/_alias/'.$this->encode($params['name']); |
|
| 731 | 731 | $method = 'HEAD'; |
| 732 | 732 | } |
| 733 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','local','pretty','human','error_trace','source','filter_path']); |
|
| 733 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 734 | 734 | $headers = [ |
| 735 | 735 | 'Accept' => 'application/json', |
| 736 | 736 | ]; |
@@ -765,10 +765,10 @@ discard block |
||
| 765 | 765 | public function existsIndexTemplate(array $params = []) |
| 766 | 766 | { |
| 767 | 767 | $this->checkRequiredParameters(['name'], $params); |
| 768 | - $url = '/_index_template/' . $this->encode($params['name']); |
|
| 768 | + $url = '/_index_template/'.$this->encode($params['name']); |
|
| 769 | 769 | $method = 'HEAD'; |
| 770 | 770 | |
| 771 | - $url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','pretty','human','error_trace','source','filter_path']); |
|
| 771 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 772 | 772 | $headers = [ |
| 773 | 773 | 'Accept' => 'application/json', |
| 774 | 774 | ]; |
@@ -803,10 +803,10 @@ discard block |
||
| 803 | 803 | public function existsTemplate(array $params = []) |
| 804 | 804 | { |
| 805 | 805 | $this->checkRequiredParameters(['name'], $params); |
| 806 | - $url = '/_template/' . $this->encode($params['name']); |
|
| 806 | + $url = '/_template/'.$this->encode($params['name']); |
|
| 807 | 807 | $method = 'HEAD'; |
| 808 | 808 | |
| 809 | - $url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','pretty','human','error_trace','source','filter_path']); |
|
| 809 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 810 | 810 | $headers = [ |
| 811 | 811 | 'Accept' => 'application/json', |
| 812 | 812 | ]; |
@@ -841,10 +841,10 @@ discard block |
||
| 841 | 841 | public function explainDataLifecycle(array $params = []) |
| 842 | 842 | { |
| 843 | 843 | $this->checkRequiredParameters(['index'], $params); |
| 844 | - $url = '/' . $this->encode($params['index']) . '/_lifecycle/explain'; |
|
| 844 | + $url = '/'.$this->encode($params['index']).'/_lifecycle/explain'; |
|
| 845 | 845 | $method = 'GET'; |
| 846 | 846 | |
| 847 | - $url = $this->addQueryString($url, $params, ['include_defaults','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 847 | + $url = $this->addQueryString($url, $params, ['include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 848 | 848 | $headers = [ |
| 849 | 849 | 'Accept' => 'application/json', |
| 850 | 850 | ]; |
@@ -881,10 +881,10 @@ discard block |
||
| 881 | 881 | public function fieldUsageStats(array $params = []) |
| 882 | 882 | { |
| 883 | 883 | $this->checkRequiredParameters(['index'], $params); |
| 884 | - $url = '/' . $this->encode($params['index']) . '/_field_usage_stats'; |
|
| 884 | + $url = '/'.$this->encode($params['index']).'/_field_usage_stats'; |
|
| 885 | 885 | $method = 'GET'; |
| 886 | 886 | |
| 887 | - $url = $this->addQueryString($url, $params, ['fields','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 887 | + $url = $this->addQueryString($url, $params, ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 888 | 888 | $headers = [ |
| 889 | 889 | 'Accept' => 'application/json', |
| 890 | 890 | ]; |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | public function flush(array $params = []) |
| 921 | 921 | { |
| 922 | 922 | if (isset($params['index'])) { |
| 923 | - $url = '/' . $this->encode($params['index']) . '/_flush'; |
|
| 923 | + $url = '/'.$this->encode($params['index']).'/_flush'; |
|
| 924 | 924 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 925 | 925 | } else { |
| 926 | 926 | $url = '/_flush'; |
| 927 | 927 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 928 | 928 | } |
| 929 | - $url = $this->addQueryString($url, $params, ['force','wait_if_ongoing','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 929 | + $url = $this->addQueryString($url, $params, ['force', 'wait_if_ongoing', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 930 | 930 | $headers = [ |
| 931 | 931 | 'Accept' => 'application/json', |
| 932 | 932 | ]; |
@@ -964,13 +964,13 @@ discard block |
||
| 964 | 964 | public function forcemerge(array $params = []) |
| 965 | 965 | { |
| 966 | 966 | if (isset($params['index'])) { |
| 967 | - $url = '/' . $this->encode($params['index']) . '/_forcemerge'; |
|
| 967 | + $url = '/'.$this->encode($params['index']).'/_forcemerge'; |
|
| 968 | 968 | $method = 'POST'; |
| 969 | 969 | } else { |
| 970 | 970 | $url = '/_forcemerge'; |
| 971 | 971 | $method = 'POST'; |
| 972 | 972 | } |
| 973 | - $url = $this->addQueryString($url, $params, ['flush','ignore_unavailable','allow_no_indices','expand_wildcards','max_num_segments','only_expunge_deletes','wait_for_completion','pretty','human','error_trace','source','filter_path']); |
|
| 973 | + $url = $this->addQueryString($url, $params, ['flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'max_num_segments', 'only_expunge_deletes', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 974 | 974 | $headers = [ |
| 975 | 975 | 'Accept' => 'application/json', |
| 976 | 976 | ]; |
@@ -1010,10 +1010,10 @@ discard block |
||
| 1010 | 1010 | public function get(array $params = []) |
| 1011 | 1011 | { |
| 1012 | 1012 | $this->checkRequiredParameters(['index'], $params); |
| 1013 | - $url = '/' . $this->encode($params['index']); |
|
| 1013 | + $url = '/'.$this->encode($params['index']); |
|
| 1014 | 1014 | $method = 'GET'; |
| 1015 | 1015 | |
| 1016 | - $url = $this->addQueryString($url, $params, ['local','ignore_unavailable','allow_no_indices','expand_wildcards','features','flat_settings','include_defaults','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 1016 | + $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'features', 'flat_settings', 'include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1017 | 1017 | $headers = [ |
| 1018 | 1018 | 'Accept' => 'application/json', |
| 1019 | 1019 | ]; |
@@ -1049,19 +1049,19 @@ discard block |
||
| 1049 | 1049 | public function getAlias(array $params = []) |
| 1050 | 1050 | { |
| 1051 | 1051 | if (isset($params['index']) && isset($params['name'])) { |
| 1052 | - $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']); |
|
| 1052 | + $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']); |
|
| 1053 | 1053 | $method = 'GET'; |
| 1054 | 1054 | } elseif (isset($params['name'])) { |
| 1055 | - $url = '/_alias/' . $this->encode($params['name']); |
|
| 1055 | + $url = '/_alias/'.$this->encode($params['name']); |
|
| 1056 | 1056 | $method = 'GET'; |
| 1057 | 1057 | } elseif (isset($params['index'])) { |
| 1058 | - $url = '/' . $this->encode($params['index']) . '/_alias'; |
|
| 1058 | + $url = '/'.$this->encode($params['index']).'/_alias'; |
|
| 1059 | 1059 | $method = 'GET'; |
| 1060 | 1060 | } else { |
| 1061 | 1061 | $url = '/_alias'; |
| 1062 | 1062 | $method = 'GET'; |
| 1063 | 1063 | } |
| 1064 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','local','pretty','human','error_trace','source','filter_path']); |
|
| 1064 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1065 | 1065 | $headers = [ |
| 1066 | 1066 | 'Accept' => 'application/json', |
| 1067 | 1067 | ]; |
@@ -1096,10 +1096,10 @@ discard block |
||
| 1096 | 1096 | public function getDataLifecycle(array $params = []) |
| 1097 | 1097 | { |
| 1098 | 1098 | $this->checkRequiredParameters(['name'], $params); |
| 1099 | - $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle'; |
|
| 1099 | + $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle'; |
|
| 1100 | 1100 | $method = 'GET'; |
| 1101 | 1101 | |
| 1102 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 1102 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1103 | 1103 | $headers = [ |
| 1104 | 1104 | 'Accept' => 'application/json', |
| 1105 | 1105 | ]; |
@@ -1132,13 +1132,13 @@ discard block |
||
| 1132 | 1132 | public function getDataStream(array $params = []) |
| 1133 | 1133 | { |
| 1134 | 1134 | if (isset($params['name'])) { |
| 1135 | - $url = '/_data_stream/' . $this->encode($params['name']); |
|
| 1135 | + $url = '/_data_stream/'.$this->encode($params['name']); |
|
| 1136 | 1136 | $method = 'GET'; |
| 1137 | 1137 | } else { |
| 1138 | 1138 | $url = '/_data_stream'; |
| 1139 | 1139 | $method = 'GET'; |
| 1140 | 1140 | } |
| 1141 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 1141 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1142 | 1142 | $headers = [ |
| 1143 | 1143 | 'Accept' => 'application/json', |
| 1144 | 1144 | ]; |
@@ -1177,13 +1177,13 @@ discard block |
||
| 1177 | 1177 | { |
| 1178 | 1178 | $this->checkRequiredParameters(['fields'], $params); |
| 1179 | 1179 | if (isset($params['index'])) { |
| 1180 | - $url = '/' . $this->encode($params['index']) . '/_mapping/field/' . $this->encode($params['fields']); |
|
| 1180 | + $url = '/'.$this->encode($params['index']).'/_mapping/field/'.$this->encode($params['fields']); |
|
| 1181 | 1181 | $method = 'GET'; |
| 1182 | 1182 | } else { |
| 1183 | - $url = '/_mapping/field/' . $this->encode($params['fields']); |
|
| 1183 | + $url = '/_mapping/field/'.$this->encode($params['fields']); |
|
| 1184 | 1184 | $method = 'GET'; |
| 1185 | 1185 | } |
| 1186 | - $url = $this->addQueryString($url, $params, ['include_defaults','ignore_unavailable','allow_no_indices','expand_wildcards','local','pretty','human','error_trace','source','filter_path']); |
|
| 1186 | + $url = $this->addQueryString($url, $params, ['include_defaults', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1187 | 1187 | $headers = [ |
| 1188 | 1188 | 'Accept' => 'application/json', |
| 1189 | 1189 | ]; |
@@ -1218,13 +1218,13 @@ discard block |
||
| 1218 | 1218 | public function getIndexTemplate(array $params = []) |
| 1219 | 1219 | { |
| 1220 | 1220 | if (isset($params['name'])) { |
| 1221 | - $url = '/_index_template/' . $this->encode($params['name']); |
|
| 1221 | + $url = '/_index_template/'.$this->encode($params['name']); |
|
| 1222 | 1222 | $method = 'GET'; |
| 1223 | 1223 | } else { |
| 1224 | 1224 | $url = '/_index_template'; |
| 1225 | 1225 | $method = 'GET'; |
| 1226 | 1226 | } |
| 1227 | - $url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 1227 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1228 | 1228 | $headers = [ |
| 1229 | 1229 | 'Accept' => 'application/json', |
| 1230 | 1230 | ]; |
@@ -1260,13 +1260,13 @@ discard block |
||
| 1260 | 1260 | public function getMapping(array $params = []) |
| 1261 | 1261 | { |
| 1262 | 1262 | if (isset($params['index'])) { |
| 1263 | - $url = '/' . $this->encode($params['index']) . '/_mapping'; |
|
| 1263 | + $url = '/'.$this->encode($params['index']).'/_mapping'; |
|
| 1264 | 1264 | $method = 'GET'; |
| 1265 | 1265 | } else { |
| 1266 | 1266 | $url = '/_mapping'; |
| 1267 | 1267 | $method = 'GET'; |
| 1268 | 1268 | } |
| 1269 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','master_timeout','local','pretty','human','error_trace','source','filter_path']); |
|
| 1269 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1270 | 1270 | $headers = [ |
| 1271 | 1271 | 'Accept' => 'application/json', |
| 1272 | 1272 | ]; |
@@ -1305,19 +1305,19 @@ discard block |
||
| 1305 | 1305 | public function getSettings(array $params = []) |
| 1306 | 1306 | { |
| 1307 | 1307 | if (isset($params['index']) && isset($params['name'])) { |
| 1308 | - $url = '/' . $this->encode($params['index']) . '/_settings/' . $this->encode($params['name']); |
|
| 1308 | + $url = '/'.$this->encode($params['index']).'/_settings/'.$this->encode($params['name']); |
|
| 1309 | 1309 | $method = 'GET'; |
| 1310 | 1310 | } elseif (isset($params['index'])) { |
| 1311 | - $url = '/' . $this->encode($params['index']) . '/_settings'; |
|
| 1311 | + $url = '/'.$this->encode($params['index']).'/_settings'; |
|
| 1312 | 1312 | $method = 'GET'; |
| 1313 | 1313 | } elseif (isset($params['name'])) { |
| 1314 | - $url = '/_settings/' . $this->encode($params['name']); |
|
| 1314 | + $url = '/_settings/'.$this->encode($params['name']); |
|
| 1315 | 1315 | $method = 'GET'; |
| 1316 | 1316 | } else { |
| 1317 | 1317 | $url = '/_settings'; |
| 1318 | 1318 | $method = 'GET'; |
| 1319 | 1319 | } |
| 1320 | - $url = $this->addQueryString($url, $params, ['master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','flat_settings','local','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 1320 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1321 | 1321 | $headers = [ |
| 1322 | 1322 | 'Accept' => 'application/json', |
| 1323 | 1323 | ]; |
@@ -1351,13 +1351,13 @@ discard block |
||
| 1351 | 1351 | public function getTemplate(array $params = []) |
| 1352 | 1352 | { |
| 1353 | 1353 | if (isset($params['name'])) { |
| 1354 | - $url = '/_template/' . $this->encode($params['name']); |
|
| 1354 | + $url = '/_template/'.$this->encode($params['name']); |
|
| 1355 | 1355 | $method = 'GET'; |
| 1356 | 1356 | } else { |
| 1357 | 1357 | $url = '/_template'; |
| 1358 | 1358 | $method = 'GET'; |
| 1359 | 1359 | } |
| 1360 | - $url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','pretty','human','error_trace','source','filter_path']); |
|
| 1360 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1361 | 1361 | $headers = [ |
| 1362 | 1362 | 'Accept' => 'application/json', |
| 1363 | 1363 | ]; |
@@ -1389,10 +1389,10 @@ discard block |
||
| 1389 | 1389 | public function migrateToDataStream(array $params = []) |
| 1390 | 1390 | { |
| 1391 | 1391 | $this->checkRequiredParameters(['name'], $params); |
| 1392 | - $url = '/_data_stream/_migrate/' . $this->encode($params['name']); |
|
| 1392 | + $url = '/_data_stream/_migrate/'.$this->encode($params['name']); |
|
| 1393 | 1393 | $method = 'POST'; |
| 1394 | 1394 | |
| 1395 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1395 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1396 | 1396 | $headers = [ |
| 1397 | 1397 | 'Accept' => 'application/json', |
| 1398 | 1398 | ]; |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | $url = '/_data_stream/_modify'; |
| 1427 | 1427 | $method = 'POST'; |
| 1428 | 1428 | |
| 1429 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1429 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1430 | 1430 | $headers = [ |
| 1431 | 1431 | 'Accept' => 'application/json', |
| 1432 | 1432 | 'Content-Type' => 'application/json', |
@@ -1465,10 +1465,10 @@ discard block |
||
| 1465 | 1465 | public function open(array $params = []) |
| 1466 | 1466 | { |
| 1467 | 1467 | $this->checkRequiredParameters(['index'], $params); |
| 1468 | - $url = '/' . $this->encode($params['index']) . '/_open'; |
|
| 1468 | + $url = '/'.$this->encode($params['index']).'/_open'; |
|
| 1469 | 1469 | $method = 'POST'; |
| 1470 | 1470 | |
| 1471 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 1471 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1472 | 1472 | $headers = [ |
| 1473 | 1473 | 'Accept' => 'application/json', |
| 1474 | 1474 | ]; |
@@ -1500,10 +1500,10 @@ discard block |
||
| 1500 | 1500 | public function promoteDataStream(array $params = []) |
| 1501 | 1501 | { |
| 1502 | 1502 | $this->checkRequiredParameters(['name'], $params); |
| 1503 | - $url = '/_data_stream/_promote/' . $this->encode($params['name']); |
|
| 1503 | + $url = '/_data_stream/_promote/'.$this->encode($params['name']); |
|
| 1504 | 1504 | $method = 'POST'; |
| 1505 | 1505 | |
| 1506 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 1506 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1507 | 1507 | $headers = [ |
| 1508 | 1508 | 'Accept' => 'application/json', |
| 1509 | 1509 | ]; |
@@ -1538,11 +1538,11 @@ discard block |
||
| 1538 | 1538 | */ |
| 1539 | 1539 | public function putAlias(array $params = []) |
| 1540 | 1540 | { |
| 1541 | - $this->checkRequiredParameters(['index','name'], $params); |
|
| 1542 | - $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']); |
|
| 1541 | + $this->checkRequiredParameters(['index', 'name'], $params); |
|
| 1542 | + $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']); |
|
| 1543 | 1543 | $method = 'PUT'; |
| 1544 | 1544 | |
| 1545 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 1545 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1546 | 1546 | $headers = [ |
| 1547 | 1547 | 'Accept' => 'application/json', |
| 1548 | 1548 | 'Content-Type' => 'application/json', |
@@ -1580,10 +1580,10 @@ discard block |
||
| 1580 | 1580 | public function putDataLifecycle(array $params = []) |
| 1581 | 1581 | { |
| 1582 | 1582 | $this->checkRequiredParameters(['name'], $params); |
| 1583 | - $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle'; |
|
| 1583 | + $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle'; |
|
| 1584 | 1584 | $method = 'PUT'; |
| 1585 | 1585 | |
| 1586 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 1586 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1587 | 1587 | $headers = [ |
| 1588 | 1588 | 'Accept' => 'application/json', |
| 1589 | 1589 | ]; |
@@ -1618,11 +1618,11 @@ discard block |
||
| 1618 | 1618 | */ |
| 1619 | 1619 | public function putIndexTemplate(array $params = []) |
| 1620 | 1620 | { |
| 1621 | - $this->checkRequiredParameters(['name','body'], $params); |
|
| 1622 | - $url = '/_index_template/' . $this->encode($params['name']); |
|
| 1621 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1622 | + $url = '/_index_template/'.$this->encode($params['name']); |
|
| 1623 | 1623 | $method = 'PUT'; |
| 1624 | 1624 | |
| 1625 | - $url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 1625 | + $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1626 | 1626 | $headers = [ |
| 1627 | 1627 | 'Accept' => 'application/json', |
| 1628 | 1628 | 'Content-Type' => 'application/json', |
@@ -1661,11 +1661,11 @@ discard block |
||
| 1661 | 1661 | */ |
| 1662 | 1662 | public function putMapping(array $params = []) |
| 1663 | 1663 | { |
| 1664 | - $this->checkRequiredParameters(['index','body'], $params); |
|
| 1665 | - $url = '/' . $this->encode($params['index']) . '/_mapping'; |
|
| 1664 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
| 1665 | + $url = '/'.$this->encode($params['index']).'/_mapping'; |
|
| 1666 | 1666 | $method = 'PUT'; |
| 1667 | 1667 | |
| 1668 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','write_index_only','pretty','human','error_trace','source','filter_path']); |
|
| 1668 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'write_index_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1669 | 1669 | $headers = [ |
| 1670 | 1670 | 'Accept' => 'application/json', |
| 1671 | 1671 | 'Content-Type' => 'application/json', |
@@ -1707,13 +1707,13 @@ discard block |
||
| 1707 | 1707 | { |
| 1708 | 1708 | $this->checkRequiredParameters(['body'], $params); |
| 1709 | 1709 | if (isset($params['index'])) { |
| 1710 | - $url = '/' . $this->encode($params['index']) . '/_settings'; |
|
| 1710 | + $url = '/'.$this->encode($params['index']).'/_settings'; |
|
| 1711 | 1711 | $method = 'PUT'; |
| 1712 | 1712 | } else { |
| 1713 | 1713 | $url = '/_settings'; |
| 1714 | 1714 | $method = 'PUT'; |
| 1715 | 1715 | } |
| 1716 | - $url = $this->addQueryString($url, $params, ['master_timeout','timeout','preserve_existing','reopen','ignore_unavailable','allow_no_indices','expand_wildcards','flat_settings','pretty','human','error_trace','source','filter_path']); |
|
| 1716 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'preserve_existing', 'reopen', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1717 | 1717 | $headers = [ |
| 1718 | 1718 | 'Accept' => 'application/json', |
| 1719 | 1719 | 'Content-Type' => 'application/json', |
@@ -1749,11 +1749,11 @@ discard block |
||
| 1749 | 1749 | */ |
| 1750 | 1750 | public function putTemplate(array $params = []) |
| 1751 | 1751 | { |
| 1752 | - $this->checkRequiredParameters(['name','body'], $params); |
|
| 1753 | - $url = '/_template/' . $this->encode($params['name']); |
|
| 1752 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1753 | + $url = '/_template/'.$this->encode($params['name']); |
|
| 1754 | 1754 | $method = 'PUT'; |
| 1755 | 1755 | |
| 1756 | - $url = $this->addQueryString($url, $params, ['order','create','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 1756 | + $url = $this->addQueryString($url, $params, ['order', 'create', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1757 | 1757 | $headers = [ |
| 1758 | 1758 | 'Accept' => 'application/json', |
| 1759 | 1759 | 'Content-Type' => 'application/json', |
@@ -1787,13 +1787,13 @@ discard block |
||
| 1787 | 1787 | public function recovery(array $params = []) |
| 1788 | 1788 | { |
| 1789 | 1789 | if (isset($params['index'])) { |
| 1790 | - $url = '/' . $this->encode($params['index']) . '/_recovery'; |
|
| 1790 | + $url = '/'.$this->encode($params['index']).'/_recovery'; |
|
| 1791 | 1791 | $method = 'GET'; |
| 1792 | 1792 | } else { |
| 1793 | 1793 | $url = '/_recovery'; |
| 1794 | 1794 | $method = 'GET'; |
| 1795 | 1795 | } |
| 1796 | - $url = $this->addQueryString($url, $params, ['detailed','active_only','pretty','human','error_trace','source','filter_path']); |
|
| 1796 | + $url = $this->addQueryString($url, $params, ['detailed', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1797 | 1797 | $headers = [ |
| 1798 | 1798 | 'Accept' => 'application/json', |
| 1799 | 1799 | ]; |
@@ -1827,13 +1827,13 @@ discard block |
||
| 1827 | 1827 | public function refresh(array $params = []) |
| 1828 | 1828 | { |
| 1829 | 1829 | if (isset($params['index'])) { |
| 1830 | - $url = '/' . $this->encode($params['index']) . '/_refresh'; |
|
| 1830 | + $url = '/'.$this->encode($params['index']).'/_refresh'; |
|
| 1831 | 1831 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1832 | 1832 | } else { |
| 1833 | 1833 | $url = '/_refresh'; |
| 1834 | 1834 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1835 | 1835 | } |
| 1836 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 1836 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1837 | 1837 | $headers = [ |
| 1838 | 1838 | 'Accept' => 'application/json', |
| 1839 | 1839 | ]; |
@@ -1869,10 +1869,10 @@ discard block |
||
| 1869 | 1869 | public function reloadSearchAnalyzers(array $params = []) |
| 1870 | 1870 | { |
| 1871 | 1871 | $this->checkRequiredParameters(['index'], $params); |
| 1872 | - $url = '/' . $this->encode($params['index']) . '/_reload_search_analyzers'; |
|
| 1872 | + $url = '/'.$this->encode($params['index']).'/_reload_search_analyzers'; |
|
| 1873 | 1873 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1874 | 1874 | |
| 1875 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','resource','pretty','human','error_trace','source','filter_path']); |
|
| 1875 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'resource', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1876 | 1876 | $headers = [ |
| 1877 | 1877 | 'Accept' => 'application/json', |
| 1878 | 1878 | ]; |
@@ -1908,10 +1908,10 @@ discard block |
||
| 1908 | 1908 | public function resolveCluster(array $params = []) |
| 1909 | 1909 | { |
| 1910 | 1910 | $this->checkRequiredParameters(['name'], $params); |
| 1911 | - $url = '/_resolve/cluster/' . $this->encode($params['name']); |
|
| 1911 | + $url = '/_resolve/cluster/'.$this->encode($params['name']); |
|
| 1912 | 1912 | $method = 'GET'; |
| 1913 | 1913 | |
| 1914 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 1914 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1915 | 1915 | $headers = [ |
| 1916 | 1916 | 'Accept' => 'application/json', |
| 1917 | 1917 | ]; |
@@ -1944,10 +1944,10 @@ discard block |
||
| 1944 | 1944 | public function resolveIndex(array $params = []) |
| 1945 | 1945 | { |
| 1946 | 1946 | $this->checkRequiredParameters(['name'], $params); |
| 1947 | - $url = '/_resolve/index/' . $this->encode($params['name']); |
|
| 1947 | + $url = '/_resolve/index/'.$this->encode($params['name']); |
|
| 1948 | 1948 | $method = 'GET'; |
| 1949 | 1949 | |
| 1950 | - $url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 1950 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1951 | 1951 | $headers = [ |
| 1952 | 1952 | 'Accept' => 'application/json', |
| 1953 | 1953 | ]; |
@@ -1988,13 +1988,13 @@ discard block |
||
| 1988 | 1988 | { |
| 1989 | 1989 | $this->checkRequiredParameters(['alias'], $params); |
| 1990 | 1990 | if (isset($params['new_index'])) { |
| 1991 | - $url = '/' . $this->encode($params['alias']) . '/_rollover/' . $this->encode($params['new_index']); |
|
| 1991 | + $url = '/'.$this->encode($params['alias']).'/_rollover/'.$this->encode($params['new_index']); |
|
| 1992 | 1992 | $method = 'POST'; |
| 1993 | 1993 | } else { |
| 1994 | - $url = '/' . $this->encode($params['alias']) . '/_rollover'; |
|
| 1994 | + $url = '/'.$this->encode($params['alias']).'/_rollover'; |
|
| 1995 | 1995 | $method = 'POST'; |
| 1996 | 1996 | } |
| 1997 | - $url = $this->addQueryString($url, $params, ['timeout','dry_run','master_timeout','wait_for_active_shards','lazy','pretty','human','error_trace','source','filter_path']); |
|
| 1997 | + $url = $this->addQueryString($url, $params, ['timeout', 'dry_run', 'master_timeout', 'wait_for_active_shards', 'lazy', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1998 | 1998 | $headers = [ |
| 1999 | 1999 | 'Accept' => 'application/json', |
| 2000 | 2000 | 'Content-Type' => 'application/json', |
@@ -2030,13 +2030,13 @@ discard block |
||
| 2030 | 2030 | public function segments(array $params = []) |
| 2031 | 2031 | { |
| 2032 | 2032 | if (isset($params['index'])) { |
| 2033 | - $url = '/' . $this->encode($params['index']) . '/_segments'; |
|
| 2033 | + $url = '/'.$this->encode($params['index']).'/_segments'; |
|
| 2034 | 2034 | $method = 'GET'; |
| 2035 | 2035 | } else { |
| 2036 | 2036 | $url = '/_segments'; |
| 2037 | 2037 | $method = 'GET'; |
| 2038 | 2038 | } |
| 2039 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable','allow_no_indices','expand_wildcards','verbose','pretty','human','error_trace','source','filter_path']); |
|
| 2039 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2040 | 2040 | $headers = [ |
| 2041 | 2041 | 'Accept' => 'application/json', |
| 2042 | 2042 | ]; |
@@ -2071,13 +2071,13 @@ discard block |
||
| 2071 | 2071 | public function shardStores(array $params = []) |
| 2072 | 2072 | { |
| 2073 | 2073 | if (isset($params['index'])) { |
| 2074 | - $url = '/' . $this->encode($params['index']) . '/_shard_stores'; |
|
| 2074 | + $url = '/'.$this->encode($params['index']).'/_shard_stores'; |
|
| 2075 | 2075 | $method = 'GET'; |
| 2076 | 2076 | } else { |
| 2077 | 2077 | $url = '/_shard_stores'; |
| 2078 | 2078 | $method = 'GET'; |
| 2079 | 2079 | } |
| 2080 | - $url = $this->addQueryString($url, $params, ['status','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); |
|
| 2080 | + $url = $this->addQueryString($url, $params, ['status', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2081 | 2081 | $headers = [ |
| 2082 | 2082 | 'Accept' => 'application/json', |
| 2083 | 2083 | ]; |
@@ -2113,11 +2113,11 @@ discard block |
||
| 2113 | 2113 | */ |
| 2114 | 2114 | public function shrink(array $params = []) |
| 2115 | 2115 | { |
| 2116 | - $this->checkRequiredParameters(['index','target'], $params); |
|
| 2117 | - $url = '/' . $this->encode($params['index']) . '/_shrink/' . $this->encode($params['target']); |
|
| 2116 | + $this->checkRequiredParameters(['index', 'target'], $params); |
|
| 2117 | + $url = '/'.$this->encode($params['index']).'/_shrink/'.$this->encode($params['target']); |
|
| 2118 | 2118 | $method = 'PUT'; |
| 2119 | 2119 | |
| 2120 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 2120 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2121 | 2121 | $headers = [ |
| 2122 | 2122 | 'Accept' => 'application/json', |
| 2123 | 2123 | 'Content-Type' => 'application/json', |
@@ -2155,10 +2155,10 @@ discard block |
||
| 2155 | 2155 | public function simulateIndexTemplate(array $params = []) |
| 2156 | 2156 | { |
| 2157 | 2157 | $this->checkRequiredParameters(['name'], $params); |
| 2158 | - $url = '/_index_template/_simulate_index/' . $this->encode($params['name']); |
|
| 2158 | + $url = '/_index_template/_simulate_index/'.$this->encode($params['name']); |
|
| 2159 | 2159 | $method = 'POST'; |
| 2160 | 2160 | |
| 2161 | - $url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 2161 | + $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2162 | 2162 | $headers = [ |
| 2163 | 2163 | 'Accept' => 'application/json', |
| 2164 | 2164 | 'Content-Type' => 'application/json', |
@@ -2195,13 +2195,13 @@ discard block |
||
| 2195 | 2195 | public function simulateTemplate(array $params = []) |
| 2196 | 2196 | { |
| 2197 | 2197 | if (isset($params['name'])) { |
| 2198 | - $url = '/_index_template/_simulate/' . $this->encode($params['name']); |
|
| 2198 | + $url = '/_index_template/_simulate/'.$this->encode($params['name']); |
|
| 2199 | 2199 | $method = 'POST'; |
| 2200 | 2200 | } else { |
| 2201 | 2201 | $url = '/_index_template/_simulate'; |
| 2202 | 2202 | $method = 'POST'; |
| 2203 | 2203 | } |
| 2204 | - $url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']); |
|
| 2204 | + $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2205 | 2205 | $headers = [ |
| 2206 | 2206 | 'Accept' => 'application/json', |
| 2207 | 2207 | 'Content-Type' => 'application/json', |
@@ -2238,11 +2238,11 @@ discard block |
||
| 2238 | 2238 | */ |
| 2239 | 2239 | public function split(array $params = []) |
| 2240 | 2240 | { |
| 2241 | - $this->checkRequiredParameters(['index','target'], $params); |
|
| 2242 | - $url = '/' . $this->encode($params['index']) . '/_split/' . $this->encode($params['target']); |
|
| 2241 | + $this->checkRequiredParameters(['index', 'target'], $params); |
|
| 2242 | + $url = '/'.$this->encode($params['index']).'/_split/'.$this->encode($params['target']); |
|
| 2243 | 2243 | $method = 'PUT'; |
| 2244 | 2244 | |
| 2245 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 2245 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2246 | 2246 | $headers = [ |
| 2247 | 2247 | 'Accept' => 'application/json', |
| 2248 | 2248 | 'Content-Type' => 'application/json', |
@@ -2284,19 +2284,19 @@ discard block |
||
| 2284 | 2284 | public function stats(array $params = []) |
| 2285 | 2285 | { |
| 2286 | 2286 | if (isset($params['index']) && isset($params['metric'])) { |
| 2287 | - $url = '/' . $this->encode($params['index']) . '/_stats/' . $this->encode($params['metric']); |
|
| 2287 | + $url = '/'.$this->encode($params['index']).'/_stats/'.$this->encode($params['metric']); |
|
| 2288 | 2288 | $method = 'GET'; |
| 2289 | 2289 | } elseif (isset($params['metric'])) { |
| 2290 | - $url = '/_stats/' . $this->encode($params['metric']); |
|
| 2290 | + $url = '/_stats/'.$this->encode($params['metric']); |
|
| 2291 | 2291 | $method = 'GET'; |
| 2292 | 2292 | } elseif (isset($params['index'])) { |
| 2293 | - $url = '/' . $this->encode($params['index']) . '/_stats'; |
|
| 2293 | + $url = '/'.$this->encode($params['index']).'/_stats'; |
|
| 2294 | 2294 | $method = 'GET'; |
| 2295 | 2295 | } else { |
| 2296 | 2296 | $url = '/_stats'; |
| 2297 | 2297 | $method = 'GET'; |
| 2298 | 2298 | } |
| 2299 | - $url = $this->addQueryString($url, $params, ['completion_fields','fielddata_fields','fields','groups','level','include_segment_file_sizes','include_unloaded_segments','expand_wildcards','forbid_closed_indices','pretty','human','error_trace','source','filter_path']); |
|
| 2299 | + $url = $this->addQueryString($url, $params, ['completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'include_segment_file_sizes', 'include_unloaded_segments', 'expand_wildcards', 'forbid_closed_indices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2300 | 2300 | $headers = [ |
| 2301 | 2301 | 'Accept' => 'application/json', |
| 2302 | 2302 | ]; |
@@ -2334,10 +2334,10 @@ discard block |
||
| 2334 | 2334 | public function unfreeze(array $params = []) |
| 2335 | 2335 | { |
| 2336 | 2336 | $this->checkRequiredParameters(['index'], $params); |
| 2337 | - $url = '/' . $this->encode($params['index']) . '/_unfreeze'; |
|
| 2337 | + $url = '/'.$this->encode($params['index']).'/_unfreeze'; |
|
| 2338 | 2338 | $method = 'POST'; |
| 2339 | 2339 | |
| 2340 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','ignore_unavailable','allow_no_indices','expand_wildcards','wait_for_active_shards','pretty','human','error_trace','source','filter_path']); |
|
| 2340 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2341 | 2341 | $headers = [ |
| 2342 | 2342 | 'Accept' => 'application/json', |
| 2343 | 2343 | ]; |
@@ -2373,7 +2373,7 @@ discard block |
||
| 2373 | 2373 | $url = '/_aliases'; |
| 2374 | 2374 | $method = 'POST'; |
| 2375 | 2375 | |
| 2376 | - $url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']); |
|
| 2376 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2377 | 2377 | $headers = [ |
| 2378 | 2378 | 'Accept' => 'application/json', |
| 2379 | 2379 | 'Content-Type' => 'application/json', |
@@ -2418,13 +2418,13 @@ discard block |
||
| 2418 | 2418 | public function validateQuery(array $params = []) |
| 2419 | 2419 | { |
| 2420 | 2420 | if (isset($params['index'])) { |
| 2421 | - $url = '/' . $this->encode($params['index']) . '/_validate/query'; |
|
| 2421 | + $url = '/'.$this->encode($params['index']).'/_validate/query'; |
|
| 2422 | 2422 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 2423 | 2423 | } else { |
| 2424 | 2424 | $url = '/_validate/query'; |
| 2425 | 2425 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 2426 | 2426 | } |
| 2427 | - $url = $this->addQueryString($url, $params, ['explain','ignore_unavailable','allow_no_indices','expand_wildcards','q','analyzer','analyze_wildcard','default_operator','df','lenient','rewrite','all_shards','pretty','human','error_trace','source','filter_path']); |
|
| 2427 | + $url = $this->addQueryString($url, $params, ['explain', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2428 | 2428 | $headers = [ |
| 2429 | 2429 | 'Accept' => 'application/json', |
| 2430 | 2430 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Indices extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Indices extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Adds a block to an index. |
| 33 | 32 | * |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $this->checkRequiredParameters(['inference_id'], $params); |
| 57 | 57 | if (isset($params['task_type'])) { |
| 58 | - $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); |
|
| 58 | + $url = '/_inference/'.$this->encode($params['task_type']).'/'.$this->encode($params['inference_id']); |
|
| 59 | 59 | $method = 'DELETE'; |
| 60 | 60 | } else { |
| 61 | - $url = '/_inference/' . $this->encode($params['inference_id']); |
|
| 61 | + $url = '/_inference/'.$this->encode($params['inference_id']); |
|
| 62 | 62 | $method = 'DELETE'; |
| 63 | 63 | } |
| 64 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 64 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 65 | 65 | $headers = [ |
| 66 | 66 | 'Accept' => 'application/json', |
| 67 | 67 | ]; |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $this->checkRequiredParameters(['inference_id'], $params); |
| 98 | 98 | if (isset($params['task_type'])) { |
| 99 | - $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); |
|
| 99 | + $url = '/_inference/'.$this->encode($params['task_type']).'/'.$this->encode($params['inference_id']); |
|
| 100 | 100 | $method = 'GET'; |
| 101 | 101 | } else { |
| 102 | - $url = '/_inference/' . $this->encode($params['inference_id']); |
|
| 102 | + $url = '/_inference/'.$this->encode($params['inference_id']); |
|
| 103 | 103 | $method = 'GET'; |
| 104 | 104 | } |
| 105 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 105 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 106 | 106 | $headers = [ |
| 107 | 107 | 'Accept' => 'application/json', |
| 108 | 108 | ]; |
@@ -138,13 +138,13 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $this->checkRequiredParameters(['inference_id'], $params); |
| 140 | 140 | if (isset($params['task_type'])) { |
| 141 | - $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); |
|
| 141 | + $url = '/_inference/'.$this->encode($params['task_type']).'/'.$this->encode($params['inference_id']); |
|
| 142 | 142 | $method = 'POST'; |
| 143 | 143 | } else { |
| 144 | - $url = '/_inference/' . $this->encode($params['inference_id']); |
|
| 144 | + $url = '/_inference/'.$this->encode($params['inference_id']); |
|
| 145 | 145 | $method = 'POST'; |
| 146 | 146 | } |
| 147 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 147 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 148 | 148 | $headers = [ |
| 149 | 149 | 'Accept' => 'application/json', |
| 150 | 150 | 'Content-Type' => 'application/json', |
@@ -181,13 +181,13 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | $this->checkRequiredParameters(['inference_id'], $params); |
| 183 | 183 | if (isset($params['task_type'])) { |
| 184 | - $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); |
|
| 184 | + $url = '/_inference/'.$this->encode($params['task_type']).'/'.$this->encode($params['inference_id']); |
|
| 185 | 185 | $method = 'PUT'; |
| 186 | 186 | } else { |
| 187 | - $url = '/_inference/' . $this->encode($params['inference_id']); |
|
| 187 | + $url = '/_inference/'.$this->encode($params['inference_id']); |
|
| 188 | 188 | $method = 'PUT'; |
| 189 | 189 | } |
| 190 | - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); |
|
| 190 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 191 | 191 | $headers = [ |
| 192 | 192 | 'Accept' => 'application/json', |
| 193 | 193 | 'Content-Type' => 'application/json', |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @generated This file is generated, please do not edit |
| 28 | 28 | */ |
| 29 | -class Inference extends AbstractEndpoint |
|
| 30 | -{ |
|
| 29 | +class Inference extends AbstractEndpoint { |
|
| 31 | 30 | /** |
| 32 | 31 | * Delete model in the Inference API |
| 33 | 32 | * |