squiz / elasticio-php-client
Client library for Elastic.io v2
dev-master
2019-05-27 00:31 UTC
Requires
- php: >=7.1
- wp-cli/php-cli-tools: ^0.11
This package is not auto-updated.
Last update: 2024-05-07 02:29:22 UTC
README
PSR-4 compliant PHP client for ElasticIO's admin API Version 2
How to install
- Requires minimum PHP version > 7.1
composer install
Example Usage
// Username and API Key needs to be defined.
define('USERNAME', '');
define('APIKEY', '');
// Retrieving an exsting flow.
$flowid = 'FLOWID_TO_RETRIEVE';
$json = Factory::get('flow')->retrieveByID($flowid)->getResponse();
// Creating a new workspace.
$json = Factory::get('workspace')->create(
[
'type' => 'workspace',
'attributes' => ['name' => 'New Workspace Name'],
'relationships' => [
'contract' => [
'data' => [
'id' => $contractid,
'type' => 'contract',
]
]
]
]
)->getResponse();