|
| 1 | +# Licensed to Elasticsearch B.V. under one or more contributor |
| 2 | +# license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright |
| 4 | +# ownership. Elasticsearch B.V. licenses this file to you under |
| 5 | +# the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +class C: |
| 19 | + |
| 20 | + @_rewrite_parameters() |
| 21 | + @_stability_warning(Stability.EXPERIMENTAL) |
| 22 | + async def logs_disable( |
| 23 | + self, |
| 24 | + *, |
| 25 | + error_trace: t.Optional[bool] = None, |
| 26 | + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, |
| 27 | + human: t.Optional[bool] = None, |
| 28 | + master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, |
| 29 | + pretty: t.Optional[bool] = None, |
| 30 | + timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, |
| 31 | + ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: |
| 32 | + """ |
| 33 | + .. raw:: html |
| 34 | +
|
| 35 | + <p>Disable logs stream.</p> |
| 36 | + <p>Turn off the logs stream feature for this cluster.</p> |
| 37 | +
|
| 38 | +
|
| 39 | + `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_ |
| 40 | +
|
| 41 | + :param master_timeout: The period to wait for a connection to the master node. |
| 42 | + If no response is received before the timeout expires, the request fails |
| 43 | + and returns an error. |
| 44 | + :param timeout: The period to wait for a response. If no response is received |
| 45 | + before the timeout expires, the request fails and returns an error. |
| 46 | + """ |
| 47 | + __path_parts: t.Dict[str, str] = {} |
| 48 | + __path = "/_streams/logs/_disable" |
| 49 | + __query: t.Dict[str, t.Any] = {} |
| 50 | + if error_trace is not None: |
| 51 | + __query["error_trace"] = error_trace |
| 52 | + if filter_path is not None: |
| 53 | + __query["filter_path"] = filter_path |
| 54 | + if human is not None: |
| 55 | + __query["human"] = human |
| 56 | + if master_timeout is not None: |
| 57 | + __query["master_timeout"] = master_timeout |
| 58 | + if pretty is not None: |
| 59 | + __query["pretty"] = pretty |
| 60 | + if timeout is not None: |
| 61 | + __query["timeout"] = timeout |
| 62 | + __headers = {"accept": "application/json,text/plain"} |
| 63 | + return await self.perform_request( # type: ignore[return-value] |
| 64 | + "POST", |
| 65 | + __path, |
| 66 | + params=__query, |
| 67 | + headers=__headers, |
| 68 | + endpoint_id="streams.logs_disable", |
| 69 | + path_parts=__path_parts, |
| 70 | + ) |
| 71 | + |
| 72 | + @_rewrite_parameters() |
| 73 | + @_stability_warning(Stability.EXPERIMENTAL) |
| 74 | + async def logs_enable( |
| 75 | + self, |
| 76 | + *, |
| 77 | + error_trace: t.Optional[bool] = None, |
| 78 | + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, |
| 79 | + human: t.Optional[bool] = None, |
| 80 | + master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, |
| 81 | + pretty: t.Optional[bool] = None, |
| 82 | + timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, |
| 83 | + ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: |
| 84 | + """ |
| 85 | + .. raw:: html |
| 86 | +
|
| 87 | + <p>Enable logs stream.</p> |
| 88 | + <p>Turn on the logs stream feature for this cluster.</p> |
| 89 | + <p>NOTE: To protect existing data, this feature can be turned on only if the |
| 90 | + cluster does not have existing indices or data streams that match the pattern <code>logs|logs.*</code>. |
| 91 | + If those indices or data streams exist, a <code>409 - Conflict</code> response and error is returned.</p> |
| 92 | +
|
| 93 | +
|
| 94 | + `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_ |
| 95 | +
|
| 96 | + :param master_timeout: The period to wait for a connection to the master node. |
| 97 | + If no response is received before the timeout expires, the request fails |
| 98 | + and returns an error. |
| 99 | + :param timeout: The period to wait for a response. If no response is received |
| 100 | + before the timeout expires, the request fails and returns an error. |
| 101 | + """ |
| 102 | + __path_parts: t.Dict[str, str] = {} |
| 103 | + __path = "/_streams/logs/_enable" |
| 104 | + __query: t.Dict[str, t.Any] = {} |
| 105 | + if error_trace is not None: |
| 106 | + __query["error_trace"] = error_trace |
| 107 | + if filter_path is not None: |
| 108 | + __query["filter_path"] = filter_path |
| 109 | + if human is not None: |
| 110 | + __query["human"] = human |
| 111 | + if master_timeout is not None: |
| 112 | + __query["master_timeout"] = master_timeout |
| 113 | + if pretty is not None: |
| 114 | + __query["pretty"] = pretty |
| 115 | + if timeout is not None: |
| 116 | + __query["timeout"] = timeout |
| 117 | + __headers = {"accept": "application/json,text/plain"} |
| 118 | + return await self.perform_request( # type: ignore[return-value] |
| 119 | + "POST", |
| 120 | + __path, |
| 121 | + params=__query, |
| 122 | + headers=__headers, |
| 123 | + endpoint_id="streams.logs_enable", |
| 124 | + path_parts=__path_parts, |
| 125 | + ) |
| 126 | + |
| 127 | + @_rewrite_parameters() |
| 128 | + @_stability_warning(Stability.EXPERIMENTAL) |
| 129 | + async def status( |
| 130 | + self, |
| 131 | + *, |
| 132 | + error_trace: t.Optional[bool] = None, |
| 133 | + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, |
| 134 | + human: t.Optional[bool] = None, |
| 135 | + master_timeout: t.Optional[ |
| 136 | + t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]] |
| 137 | + ] = None, |
| 138 | + pretty: t.Optional[bool] = None, |
| 139 | + ) -> ObjectApiResponse[t.Any]: |
| 140 | + """ |
| 141 | + .. raw:: html |
| 142 | +
|
| 143 | + <p>Get the status of streams.</p> |
| 144 | + <p>Get the current status for all types of streams.</p> |
| 145 | +
|
| 146 | +
|
| 147 | + `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_ |
| 148 | +
|
| 149 | + :param master_timeout: Period to wait for a connection to the master node. If |
| 150 | + no response is received before the timeout expires, the request fails and |
| 151 | + returns an error. |
| 152 | + """ |
| 153 | + __path_parts: t.Dict[str, str] = {} |
| 154 | + __path = "/_streams/status" |
| 155 | + __query: t.Dict[str, t.Any] = {} |
| 156 | + if error_trace is not None: |
| 157 | + __query["error_trace"] = error_trace |
| 158 | + if filter_path is not None: |
| 159 | + __query["filter_path"] = filter_path |
| 160 | + if human is not None: |
| 161 | + __query["human"] = human |
| 162 | + if master_timeout is not None: |
| 163 | + __query["master_timeout"] = master_timeout |
| 164 | + if pretty is not None: |
| 165 | + __query["pretty"] = pretty |
| 166 | + __headers = {"accept": "application/json"} |
| 167 | + return await self.perform_request( # type: ignore[return-value] |
| 168 | + "GET", |
| 169 | + __path, |
| 170 | + params=__query, |
| 171 | + headers=__headers, |
| 172 | + endpoint_id="streams.status", |
| 173 | + path_parts=__path_parts, |
| 174 | + ) |
0 commit comments