New tenant configuration template?

95 views
Skip to first unread message

Duy Anh Pham

unread,
Nov 9, 2016, 4:50:42 AM11/9/16
to SiteWhere
Hi Derek,

How to add new tenant configuration template (configuration type) that can be used when create new tenant? 

Thanks,
Duy Anh

Derek Adams

unread,
Nov 9, 2016, 8:35:59 AM11/9/16
to SiteWhere
Are you using the 1.8.0 code base or the code in the 1.9.0 branch? If using 1.8.0, there is no way to add a new template since the system always uses the contents of the tenant-template folder to initialize a new tenant. We have addressed the ability to create tenant templates in the upcoming 1.9.0 release. 

In 1.9.0, there is now a 'tenants' folder under 'conf' which contains a separate folder for each tenant template. There is a 'template.json' file which defines the basic template information including data initializers for bootstrapping sample data in a newly created tenant based on the template. Each template folder contains a complete tenant configuration including any scripts or other resources that are to be populated into the tenant. Note that this new configuration allows you to create empty tenants, or tenants that illustrate examples such as the existing construction and air traffic examples. We have not officially released SiteWhere 1.9.0, so there may be a few more changes before we are done. It should be officially released in the next couple of weeks.

Duy Anh Pham

unread,
Nov 10, 2016, 3:13:40 AM11/10/16
to SiteWhere
Thank you. I use the 1.8.0 version.
Looking forward to the update.

Thanks,
Duy Anh

Derek Adams

unread,
Dec 11, 2016, 9:19:36 AM12/11/16
to SiteWhere
Hi Duy Anh,

We released SiteWhere 1.9.0, which includes the new multi-template support for tenants.

Thanks,
Derek

fausti...@isen-lille.fr

unread,
Apr 16, 2018, 11:04:35 AM4/16/18
to SiteWhere
Hi Derek,

I am using a template in my SiteWhere instance (/opt/sitewhere/conf/templates/mytemplate/sitewhere-tenant.xml) so that new tenants created used this template
It works, but then when my template is modified, existing tenants are not updated 

If I am correct, staging a JSON file for a specific tenant uses the file located in  /opt/sitewhere/conf/tenants/mytenant/sitewhere-tenant.xml, is there a way to update already existing tenants with the global template file and not the one of the tenant ?

My version of sitewhere is : 1.9.0

Thank you

fausti...@isen-lille.fr

unread,
Apr 16, 2018, 11:41:32 AM4/16/18
to SiteWhere
I would like to bring more precisions about how the procedure works for me : 
  • If a modify the JSON file on /opt/sitewhere/conf/tenants/mytenant/sitewhere-tenant.xml, then stage / stop / start my tenant, there is no modification JSON file and tenant configuration is still the same
  • If I configure the tenant on the web interface and then apply "Stage Updates", JSON file is modified for the tenant and configured as required after restart
Since I have a lot of tenants to update with the same modification, I would like to modify tenants with updates I did on JSON file (first bullet point)
Reply all
Reply to author
Forward
0 new messages