File tree Expand file tree Collapse file tree 6 files changed +378
-0
lines changed Expand file tree Collapse file tree 6 files changed +378
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Elasticsearch \Namespaces \CatNamespace ;
9
9
use Elasticsearch \Namespaces \ClusterNamespace ;
10
10
use Elasticsearch \Namespaces \IndicesNamespace ;
11
+ use Elasticsearch \Namespaces \IngestNamespace ;
11
12
use Elasticsearch \Namespaces \NodesNamespace ;
12
13
use Elasticsearch \Namespaces \SnapshotNamespace ;
13
14
use Elasticsearch \Namespaces \BooleanRequestWrapper ;
@@ -58,6 +59,11 @@ class Client
58
59
*/
59
60
protected $ cat ;
60
61
62
+ /**
63
+ * @var IngestNamespace
64
+ */
65
+ protected $ ingest ;
66
+
61
67
/** @var callback */
62
68
protected $ endpoints ;
63
69
@@ -76,6 +82,7 @@ public function __construct(Transport $transport, callable $endpoint)
76
82
$ this ->nodes = new NodesNamespace ($ transport , $ endpoint );
77
83
$ this ->snapshot = new SnapshotNamespace ($ transport , $ endpoint );
78
84
$ this ->cat = new CatNamespace ($ transport , $ endpoint );
85
+ $ this ->ingest = new IngestNamespace ($ transport , $ endpoint );
79
86
}
80
87
81
88
/**
@@ -1413,6 +1420,16 @@ public function cat()
1413
1420
return $ this ->cat ;
1414
1421
}
1415
1422
1423
+ /**
1424
+ * Operate on the Ingest namespace of commands
1425
+ *
1426
+ * @return IngestNamespace
1427
+ */
1428
+ public function ingest ()
1429
+ {
1430
+ return $ this ->ingest ;
1431
+ }
1432
+
1416
1433
/**
1417
1434
* @param array $params
1418
1435
* @param string $arg
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Elasticsearch \Endpoints \Ingest \Pipeline ;
4
+
5
+ use Elasticsearch \Common \Exceptions ;
6
+ use Elasticsearch \Endpoints \AbstractEndpoint ;
7
+
8
+ /**
9
+ * Class Delete
10
+ *
11
+ * @category Elasticsearch
12
+ * @package Elasticsearch\Endpoints\Ingest
13
+ * @author Zachary Tong <zachary.tong@elasticsearch.com>
14
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
15
+ * @link http://elasticsearch.org
16
+ */
17
+ class Delete extends AbstractEndpoint
18
+ {
19
+ /**
20
+ * @throws \Elasticsearch\Common\Exceptions\RuntimeException
21
+ * @return string
22
+ */
23
+ protected function getURI ()
24
+ {
25
+ if (isset ($ this ->id ) !== true ) {
26
+ throw new Exceptions \RuntimeException (
27
+ 'id is required for DeletePipeline '
28
+ );
29
+ }
30
+ $ id = $ this ->id ;
31
+ $ uri = "/_ingest/pipeline/ $ id " ;
32
+
33
+ return $ uri ;
34
+ }
35
+
36
+ /**
37
+ * @return string[]
38
+ */
39
+ protected function getParamWhitelist ()
40
+ {
41
+ return array (
42
+ 'master_timeout ' ,
43
+ 'timeout '
44
+ );
45
+ }
46
+
47
+ /**
48
+ * @return string
49
+ */
50
+ protected function getMethod ()
51
+ {
52
+ return 'DELETE ' ;
53
+ }
54
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Elasticsearch \Endpoints \Ingest \Pipeline ;
4
+
5
+ use Elasticsearch \Common \Exceptions ;
6
+ use Elasticsearch \Endpoints \AbstractEndpoint ;
7
+
8
+ /**
9
+ * Class Get
10
+ *
11
+ * @category Elasticsearch
12
+ * @package Elasticsearch\Endpoints\Ingest
13
+ * @author Zachary Tong <zachary.tong@elasticsearch.com>
14
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
15
+ * @link http://elasticsearch.org
16
+ */
17
+ class Get extends AbstractEndpoint
18
+ {
19
+ /**
20
+ * @throws \Elasticsearch\Common\Exceptions\RuntimeException
21
+ * @return string
22
+ */
23
+ protected function getURI ()
24
+ {
25
+ if (isset ($ this ->id ) !== true ) {
26
+ throw new Exceptions \RuntimeException (
27
+ 'id is required for GetPipeline '
28
+ );
29
+ }
30
+ $ id = $ this ->id ;
31
+ $ uri = "/_ingest/pipeline/ $ id " ;
32
+
33
+ return $ uri ;
34
+ }
35
+
36
+ /**
37
+ * @return string[]
38
+ */
39
+ protected function getParamWhitelist ()
40
+ {
41
+ return array (
42
+ 'master_timeout '
43
+ );
44
+ }
45
+
46
+ /**
47
+ * @return string
48
+ */
49
+ protected function getMethod ()
50
+ {
51
+ return 'GET ' ;
52
+ }
53
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Elasticsearch \Endpoints \Ingest \Pipeline ;
4
+
5
+ use Elasticsearch \Common \Exceptions ;
6
+ use Elasticsearch \Endpoints \AbstractEndpoint ;
7
+
8
+ /**
9
+ * Class Put
10
+ *
11
+ * @category Elasticsearch
12
+ * @package Elasticsearch\Endpoints\Ingest
13
+ * @author Zachary Tong <zachary.tong@elasticsearch.com>
14
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
15
+ * @link http://elasticsearch.org
16
+ */
17
+ class Put extends AbstractEndpoint
18
+ {
19
+ /**
20
+ * @param array $body
21
+ *
22
+ * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException
23
+ * @return $this
24
+ */
25
+ public function setBody ($ body )
26
+ {
27
+ if (isset ($ body ) !== true ) {
28
+ return $ this ;
29
+ }
30
+
31
+ $ this ->body = $ body ;
32
+
33
+ return $ this ;
34
+ }
35
+
36
+ /**
37
+ * @throws \Elasticsearch\Common\Exceptions\RuntimeException
38
+ * @return string
39
+ */
40
+ protected function getURI ()
41
+ {
42
+ if (isset ($ this ->id ) !== true ) {
43
+ throw new Exceptions \RuntimeException (
44
+ 'id is required for PutPipeline '
45
+ );
46
+ }
47
+ $ id = $ this ->id ;
48
+ $ uri = "/_ingest/pipeline/ $ id " ;
49
+
50
+ return $ uri ;
51
+ }
52
+
53
+ /**
54
+ * @return string[]
55
+ */
56
+ protected function getParamWhitelist ()
57
+ {
58
+ return array (
59
+ 'master_timeout ' ,
60
+ 'timeout '
61
+ );
62
+ }
63
+
64
+ /**
65
+ * @return string
66
+ */
67
+ protected function getMethod ()
68
+ {
69
+ return 'PUT ' ;
70
+ }
71
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Elasticsearch \Endpoints \Ingest ;
4
+
5
+ use Elasticsearch \Common \Exceptions ;
6
+ use Elasticsearch \Endpoints \AbstractEndpoint ;
7
+
8
+ /**
9
+ * Class Simulate
10
+ *
11
+ * @category Elasticsearch
12
+ * @package Elasticsearch\Endpoints\Ingest
13
+ * @author Zachary Tong <zachary.tong@elasticsearch.com>
14
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
15
+ * @link http://elasticsearch.org
16
+ */
17
+ class Simulate extends AbstractEndpoint
18
+ {
19
+ /**
20
+ * @param array $body
21
+ *
22
+ * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException
23
+ * @return $this
24
+ */
25
+ public function setBody ($ body )
26
+ {
27
+ if (isset ($ body ) !== true ) {
28
+ return $ this ;
29
+ }
30
+
31
+ $ this ->body = $ body ;
32
+
33
+ return $ this ;
34
+ }
35
+
36
+ /**
37
+ * @throws \Elasticsearch\Common\Exceptions\RuntimeException
38
+ * @return string
39
+ */
40
+ protected function getURI ()
41
+ {
42
+ if (isset ($ this ->id ) === true ) {
43
+ return "/_ingest/pipeline/ {$ this ->id }/_simulate " ;
44
+ }
45
+ return "/_ingest/pipeline/_simulate " ;
46
+ }
47
+
48
+ /**
49
+ * @return string[]
50
+ */
51
+ protected function getParamWhitelist ()
52
+ {
53
+ return array (
54
+ 'verbose ' ,
55
+ );
56
+ }
57
+
58
+ /**
59
+ * @return string
60
+ */
61
+ protected function getMethod ()
62
+ {
63
+ return 'GET ' ;
64
+ }
65
+ }
You can’t perform that action at this time.
0 commit comments