Is there anyway to add tenant by rest api?

I want to use search guard multi-tenancy, i can add tenant by modify sg_config.xml.
Is there anyway I can add tenant and assign tenant by rest api?

It’s possible with the roles endpoint, but indeed this part is missing in the documentation. Thanks for letting us know, we will add it accordingly.

You can add the tenants to a role like that:

{

“cluster” : [ “”, “”, … ],

“indices” : {

“” : {

“” : [ “<index/type permission>”, “<index/type permission>”, … ],

dls”: “”

fls”: [“field”, “field”]

},

“” : {

“” : [ “<index/type permission>”, “<index/type permission>”, … ],

}
“tenants”: {
: <RW | RO>,
: <RW | RO>,

}

}

}

``

.

···

On Tuesday, January 30, 2018 at 9:58:21 AM UTC+1, Johnson C wrote:

I want to use search guard multi-tenancy, i can add tenant by modify sg_config.xml.
Is there anyway I can add tenant and assign tenant by rest api?