Methods |
public
static
|
create(): ClientBuilder
Create an instance of ClientBuilder
Create an instance of ClientBuilder
|
#
|
public
|
getTransport(): Transport
Can supply first param to Client::__construct() when invoking manually or with dependency injection
Can supply first param to Client::__construct() when invoking manually or with dependency injection
|
#
|
public
|
getEndpoint(): callable
Can supply second param to Client::__construct() when invoking manually or with dependency injection
Can supply second param to Client::__construct() when invoking manually or with dependency injection
Deprecated
in 2.3.2 and will be removed in 3.0.0. Use \OpenSearch\ClientBuilder::getEndpointFactory() instead.
|
#
|
public
|
getRegisteredNamespacesBuilders(): NamespaceBuilderInterface[]
Can supply third param to Client::__construct() when invoking manually or with dependency injection
Can supply third param to Client::__construct() when invoking manually or with dependency injection
|
#
|
public
static
|
fromConfig(array $config, bool $quiet = false): Client
Build a new client from the provided config. Hash keys
should correspond to the method name e.g. ['connectionPool']…
Build a new client from the provided config. Hash keys
should correspond to the method name e.g. ['connectionPool']
corresponds to setConnectionPool().
Missing keys will use the default for that setting if applicable
Unknown keys will throw an exception by default, but this can be silenced
by setting quiet to true
Parameters
$quiet |
False if unknown settings throw exception, true to silently
ignore unknown settings
|
Throws
|
#
|
public
static
|
defaultHandler(array $multiParams = [], array $singleParams = []): callable
Get the default handler
|
#
|
public
static
|
multiHandler(array $params = []): CurlMultiHandler
Get the multi handler for async (CurlMultiHandler)
Get the multi handler for async (CurlMultiHandler)
Throws
|
#
|
public
static
|
singleHandler(): CurlHandler
Get the handler instance (CurlHandler)
Get the handler instance (CurlHandler)
Throws
|
#
|
public
|
setConnectionFactory(ConnectionFactoryInterface $connectionFactory): ClientBuilder
Set connection Factory
|
#
|
public
|
setConnectionPool(AbstractConnectionPool|string $connectionPool, array $args = []): ClientBuilder
Set the connection pool (default is StaticNoPingConnectionPool)
Set the connection pool (default is StaticNoPingConnectionPool)
Throws
|
#
|
public
|
setEndpoint(callable $endpoint): ClientBuilder
Set the endpoint
Deprecated
in 2.3.2 and will be removed in 3.0.0. Use \OpenSearch\ClientBuilder::setEndpointFactory() instead.
|
#
|
public
|
setEndpointFactory(EndpointFactoryInterface $endpointFactory): ClientBuilder
|
#
|
public
|
registerNamespace(NamespaceBuilderInterface $namespaceBuilder): ClientBuilder
Register namespace
|
#
|
public
|
setTransport(Transport $transport): ClientBuilder
Set the transport
|
#
|
public
|
setHandler(mixed $handler): ClientBuilder
Set the HTTP handler (cURL is default)
Set the HTTP handler (cURL is default)
|
#
|
public
|
setLogger(LoggerInterface $logger): ClientBuilder
Set the PSR-3 Logger
|
#
|
public
|
setTracer(LoggerInterface $tracer): ClientBuilder
Set the PSR-3 tracer
|
#
|
public
|
setSerializer(SerializerInterface|string $serializer): ClientBuilder
Set the serializer
|
#
|
public
|
setHosts(array $hosts): ClientBuilder
Set the hosts (nodes)
|
#
|
public
|
setBasicAuthentication(string $username, string $password): ClientBuilder
Set Basic access authentication
Set Basic access authentication
Throws
|
#
|
public
|
setConnectionParams(array $params): ClientBuilder
Set connection parameters
Set connection parameters
|
#
|
public
|
setRetries(int $retries): ClientBuilder
Set number or retries (default is equal to number of nodes)
Set number or retries (default is equal to number of nodes)
|
#
|
public
|
setSelector(SelectorInterface|string $selector): ClientBuilder
Set the selector algorithm
Set the selector algorithm
|
#
|
public
|
setSigV4CredentialProvider(callable|bool|array|CredentialsInterface|null $credentialProvider): ClientBuilder
Set the credential provider for SigV4 request signing. The value provider should be a
callable object that will return
Set the credential provider for SigV4 request signing. The value provider should be a
callable object that will return
|
#
|
public
|
setSigV4Region(string|null $region): ClientBuilder
Set the region for SigV4 signing.
Set the region for SigV4 signing.
|
#
|
public
|
setSigV4Service(string|null $service): ClientBuilder
Set the service for SigV4 signing.
Set the service for SigV4 signing.
|
#
|
public
|
setSniffOnStart(bool $sniffOnStart): ClientBuilder
Set sniff on start
Parameters
$sniffOnStart |
enable or disable sniff on start
|
|
#
|
public
|
setSSLCert(string $cert, string $password = null): ClientBuilder
Set SSL certificate
Parameters
$cert |
The name of a file containing a PEM formatted certificate.
|
$password |
if the certificate requires a password
|
|
#
|
public
|
setSSLKey(string $key, string $password = null): ClientBuilder
Set SSL key
Parameters
$key |
The name of a file containing a private SSL key
|
$password |
if the private key requires a password
|
|
#
|
public
|
setSSLVerification(bool|string $value = true): ClientBuilder
Set SSL verification
|
#
|
public
|
includePortInHostHeader(bool $enable): ClientBuilder
Include the port in Host header
Include the port in Host header
|
#
|
public
|
build(): Client
Build and returns the Client object
Build and returns the Client object
|
#
|
protected
|
instantiate(Transport $transport, EndpointFactoryInterface $endpointFactory, array $registeredNamespaces): Client
|
#
|