@@ -424,6 +424,45 @@ public function deleteAlias(array $params = [])
424424 }
425425
426426
427+ /**
428+ * Deletes the data lifecycle of the selected data streams.
429+ *
430+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-delete-lifecycle.html
431+ * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
432+ *
433+ * @param array{
434+ * name: list, // (REQUIRED) A comma-separated list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams
435+ * expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
436+ * timeout: time, // Explicit timestamp for the document
437+ * master_timeout: time, // Specify timeout for connection to master
438+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
439+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
440+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
441+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
442+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
443+ * } $params
444+ *
445+ * @throws MissingParameterException if a required parameter is missing
446+ * @throws NoNodeAvailableException if all the hosts are offline
447+ * @throws ClientResponseException if the status code of response is 4xx
448+ * @throws ServerResponseException if the status code of response is 5xx
449+ *
450+ * @return Elasticsearch|Promise
451+ */
452+ public function deleteDataLifecycle (array $ params = [])
453+ {
454+ $ this ->checkRequiredParameters (['name ' ], $ params );
455+ $ url = '/_data_stream/ ' . $ this ->encode ($ params ['name ' ]) . '/_lifecycle ' ;
456+ $ method = 'DELETE ' ;
457+
458+ $ url = $ this ->addQueryString ($ url , $ params , ['expand_wildcards ' ,'timeout ' ,'master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
459+ $ headers = [
460+ 'Accept ' => 'application/json ' ,
461+ ];
462+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
463+ }
464+
465+
427466 /**
428467 * Deletes a data stream.
429468 *
@@ -775,6 +814,44 @@ public function existsTemplate(array $params = [])
775814 }
776815
777816
817+ /**
818+ * Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc.
819+ *
820+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/dlm-explain-lifecycle.html
821+ * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
822+ *
823+ * @param array{
824+ * index: string, // (REQUIRED) The name of the index to explain
825+ * include_defaults: boolean, // indicates if the API should return the default values the system uses for the index's lifecycle
826+ * master_timeout: time, // Specify timeout for connection to master
827+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
828+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
829+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
830+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
831+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
832+ * } $params
833+ *
834+ * @throws MissingParameterException if a required parameter is missing
835+ * @throws NoNodeAvailableException if all the hosts are offline
836+ * @throws ClientResponseException if the status code of response is 4xx
837+ * @throws ServerResponseException if the status code of response is 5xx
838+ *
839+ * @return Elasticsearch|Promise
840+ */
841+ public function explainDataLifecycle (array $ params = [])
842+ {
843+ $ this ->checkRequiredParameters (['index ' ], $ params );
844+ $ url = '/ ' . $ this ->encode ($ params ['index ' ]) . '/_lifecycle/explain ' ;
845+ $ method = 'GET ' ;
846+
847+ $ url = $ this ->addQueryString ($ url , $ params , ['include_defaults ' ,'master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
848+ $ headers = [
849+ 'Accept ' => 'application/json ' ,
850+ ];
851+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
852+ }
853+
854+
778855 /**
779856 * Returns the field usage stats for each field of an index
780857 *
@@ -992,6 +1069,44 @@ public function getAlias(array $params = [])
9921069 }
9931070
9941071
1072+ /**
1073+ * Returns the data lifecycle of the selected data streams.
1074+ *
1075+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-get-lifecycle.html
1076+ * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1077+ *
1078+ * @param array{
1079+ * name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
1080+ * expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1081+ * include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
1082+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1083+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1084+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1085+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1086+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
1087+ * } $params
1088+ *
1089+ * @throws MissingParameterException if a required parameter is missing
1090+ * @throws NoNodeAvailableException if all the hosts are offline
1091+ * @throws ClientResponseException if the status code of response is 4xx
1092+ * @throws ServerResponseException if the status code of response is 5xx
1093+ *
1094+ * @return Elasticsearch|Promise
1095+ */
1096+ public function getDataLifecycle (array $ params = [])
1097+ {
1098+ $ this ->checkRequiredParameters (['name ' ], $ params );
1099+ $ url = '/_data_stream/ ' . $ this ->encode ($ params ['name ' ]) . '/_lifecycle ' ;
1100+ $ method = 'GET ' ;
1101+
1102+ $ url = $ this ->addQueryString ($ url , $ params , ['expand_wildcards ' ,'include_defaults ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1103+ $ headers = [
1104+ 'Accept ' => 'application/json ' ,
1105+ ];
1106+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
1107+ }
1108+
1109+
9951110 /**
9961111 * Returns data streams.
9971112 *
@@ -1000,6 +1115,7 @@ public function getAlias(array $params = [])
10001115 * @param array{
10011116 * name: list, // A comma-separated list of data streams to get; use `*` to get all data streams
10021117 * expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1118+ * include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
10031119 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10041120 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10051121 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1022,7 +1138,7 @@ public function getDataStream(array $params = [])
10221138 $ url = '/_data_stream ' ;
10231139 $ method = 'GET ' ;
10241140 }
1025- $ url = $ this ->addQueryString ($ url , $ params , ['expand_wildcards ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1141+ $ url = $ this ->addQueryString ($ url , $ params , ['expand_wildcards ' ,'include_defaults ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
10261142 $ headers = [
10271143 'Accept ' => 'application/json ' ,
10281144 ];
@@ -1085,6 +1201,7 @@ public function getFieldMapping(array $params = [])
10851201 * flat_settings: boolean, // Return settings in flat format (default: false)
10861202 * master_timeout: time, // Explicit operation timeout for connection to master node
10871203 * local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1204+ * include_defaults: boolean, // Return all relevant default configurations for the index template (default: false)
10881205 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10891206 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10901207 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1107,7 +1224,7 @@ public function getIndexTemplate(array $params = [])
11071224 $ url = '/_index_template ' ;
11081225 $ method = 'GET ' ;
11091226 }
1110- $ url = $ this ->addQueryString ($ url , $ params , ['flat_settings ' ,'master_timeout ' ,'local ' ,'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 ' ]);
11111228 $ headers = [
11121229 'Accept ' => 'application/json ' ,
11131230 ];
@@ -1434,6 +1551,46 @@ public function putAlias(array $params = [])
14341551 }
14351552
14361553
1554+ /**
1555+ * Updates the data lifecycle of the selected data streams.
1556+ *
1557+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-put-lifecycle.html
1558+ * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1559+ *
1560+ * @param array{
1561+ * name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
1562+ * expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1563+ * timeout: time, // Explicit timestamp for the document
1564+ * master_timeout: time, // Specify timeout for connection to master
1565+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1566+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1567+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1568+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1569+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
1570+ * body: array, // The data lifecycle configuration that consist of the data retention
1571+ * } $params
1572+ *
1573+ * @throws MissingParameterException if a required parameter is missing
1574+ * @throws NoNodeAvailableException if all the hosts are offline
1575+ * @throws ClientResponseException if the status code of response is 4xx
1576+ * @throws ServerResponseException if the status code of response is 5xx
1577+ *
1578+ * @return Elasticsearch|Promise
1579+ */
1580+ public function putDataLifecycle (array $ params = [])
1581+ {
1582+ $ this ->checkRequiredParameters (['name ' ], $ params );
1583+ $ url = '/_data_stream/ ' . $ this ->encode ($ params ['name ' ]) . '/_lifecycle ' ;
1584+ $ method = 'PUT ' ;
1585+
1586+ $ url = $ this ->addQueryString ($ url , $ params , ['expand_wildcards ' ,'timeout ' ,'master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1587+ $ headers = [
1588+ 'Accept ' => 'application/json ' ,
1589+ ];
1590+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
1591+ }
1592+
1593+
14371594 /**
14381595 * Creates or updates an index template.
14391596 *
@@ -1937,6 +2094,7 @@ public function shrink(array $params = [])
19372094 * create: boolean, // Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
19382095 * cause: string, // User defined reason for dry-run creating the new template for simulation purposes
19392096 * master_timeout: time, // Specify timeout for connection to master
2097+ * include_defaults: boolean, // Return all relevant default configurations for this index template simulation (default: false)
19402098 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
19412099 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
19422100 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1958,7 +2116,7 @@ public function simulateIndexTemplate(array $params = [])
19582116 $ url = '/_index_template/_simulate_index/ ' . $ this ->encode ($ params ['name ' ]);
19592117 $ method = 'POST ' ;
19602118
1961- $ url = $ this ->addQueryString ($ url , $ params , ['create ' ,'cause ' ,'master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
2119+ $ url = $ this ->addQueryString ($ url , $ params , ['create ' ,'cause ' ,'master_timeout ' ,'include_defaults ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
19622120 $ headers = [
19632121 'Accept ' => 'application/json ' ,
19642122 'Content-Type ' => 'application/json ' ,
@@ -1977,6 +2135,7 @@ public function simulateIndexTemplate(array $params = [])
19772135 * create: boolean, // Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
19782136 * cause: string, // User defined reason for dry-run creating the new template for simulation purposes
19792137 * master_timeout: time, // Specify timeout for connection to master
2138+ * include_defaults: boolean, // Return all relevant default configurations for this template simulation (default: false)
19802139 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
19812140 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
19822141 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -2000,7 +2159,7 @@ public function simulateTemplate(array $params = [])
20002159 $ url = '/_index_template/_simulate ' ;
20012160 $ method = 'POST ' ;
20022161 }
2003- $ url = $ this ->addQueryString ($ url , $ params , ['create ' ,'cause ' ,'master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
2162+ $ url = $ this ->addQueryString ($ url , $ params , ['create ' ,'cause ' ,'master_timeout ' ,'include_defaults ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
20042163 $ headers = [
20052164 'Accept ' => 'application/json ' ,
20062165 'Content-Type ' => 'application/json ' ,
0 commit comments