@@ -935,6 +935,7 @@ async def enroll_node(
935
935
async def get_api_key (
936
936
self ,
937
937
* ,
938
+ active_only : t .Optional [bool ] = None ,
938
939
error_trace : t .Optional [bool ] = None ,
939
940
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
940
941
human : t .Optional [bool ] = None ,
@@ -951,6 +952,11 @@ async def get_api_key(
951
952
952
953
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html>`_
953
954
955
+ :param active_only: A boolean flag that can be used to query API keys that are
956
+ currently active. An API key is considered active if it is neither invalidated,
957
+ nor expired at query time. You can specify this together with other parameters
958
+ such as `owner` or `name`. If `active_only` is false, the response will include
959
+ both active and inactive (expired or invalidated) keys.
954
960
:param id: An API key id. This parameter cannot be used with any of `name`, `realm_name`
955
961
or `username`.
956
962
:param name: An API key name. This parameter cannot be used with any of `id`,
@@ -969,6 +975,8 @@ async def get_api_key(
969
975
"""
970
976
__path = "/_security/api_key"
971
977
__query : t .Dict [str , t .Any ] = {}
978
+ if active_only is not None :
979
+ __query ["active_only" ] = active_only
972
980
if error_trace is not None :
973
981
__query ["error_trace" ] = error_trace
974
982
if filter_path is not None :
@@ -1875,7 +1883,14 @@ async def put_role(
1875
1883
)
1876
1884
1877
1885
@_rewrite_parameters (
1878
- body_fields = ("enabled" , "metadata" , "roles" , "rules" , "run_as" ),
1886
+ body_fields = (
1887
+ "enabled" ,
1888
+ "metadata" ,
1889
+ "role_templates" ,
1890
+ "roles" ,
1891
+ "rules" ,
1892
+ "run_as" ,
1893
+ ),
1879
1894
)
1880
1895
async def put_role_mapping (
1881
1896
self ,
@@ -1890,6 +1905,7 @@ async def put_role_mapping(
1890
1905
refresh : t .Optional [
1891
1906
t .Union ["t.Literal['false', 'true', 'wait_for']" , bool , str ]
1892
1907
] = None ,
1908
+ role_templates : t .Optional [t .Sequence [t .Mapping [str , t .Any ]]] = None ,
1893
1909
roles : t .Optional [t .Sequence [str ]] = None ,
1894
1910
rules : t .Optional [t .Mapping [str , t .Any ]] = None ,
1895
1911
run_as : t .Optional [t .Sequence [str ]] = None ,
@@ -1906,6 +1922,7 @@ async def put_role_mapping(
1906
1922
:param refresh: If `true` (the default) then refresh the affected shards to make
1907
1923
this operation visible to search, if `wait_for` then wait for a refresh to
1908
1924
make this operation visible to search, if `false` then do nothing with refreshes.
1925
+ :param role_templates:
1909
1926
:param roles:
1910
1927
:param rules:
1911
1928
:param run_as:
@@ -1930,6 +1947,8 @@ async def put_role_mapping(
1930
1947
__body ["enabled" ] = enabled
1931
1948
if metadata is not None :
1932
1949
__body ["metadata" ] = metadata
1950
+ if role_templates is not None :
1951
+ __body ["role_templates" ] = role_templates
1933
1952
if roles is not None :
1934
1953
__body ["roles" ] = roles
1935
1954
if rules is not None :
0 commit comments