@Controller @RequestMapping(value="/tenants") public class TenantsController extends RestController
| Constructor and Description |
|---|
TenantsController() |
| Modifier and Type | Method and Description |
|---|---|
com.sitewhere.spi.user.ITenant |
createTenant(com.sitewhere.rest.model.user.request.TenantCreateRequest request)
Create a new tenant.
|
com.sitewhere.spi.user.ITenant |
deleteTenantById(String tenantId,
boolean force)
Delete tenant by unique tenant id.
|
com.sitewhere.spi.user.ITenant |
getTenantByAuthToken(String authToken)
Get a tenant by unique authentication token.
|
com.sitewhere.spi.user.ITenant |
getTenantById(String tenantId,
boolean includeRuntimeInfo)
Get a tenant by unique id.
|
String |
getTenantEngineConfiguration(String tenantId)
Get the current configuration for a tenant engine.
|
ElementContent |
getTenantEngineConfigurationAsJson(String tenantId)
Get the current configuration for a tenant engine formatted as JSON.
|
com.sitewhere.spi.command.ICommandResponse |
issueTenantEngineCommand(String tenantId,
String command) |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.user.ITenant> |
listTenants(String authUserId,
boolean includeRuntimeInfo,
int page,
int pageSize)
List tenants that match the given criteria.
|
List<com.sitewhere.spi.user.ITenant> |
listTenantsForDevice(String hardwareId,
javax.servlet.http.HttpServletRequest servletRequest)
Lists all tenants that contain a device with the given hardware id.
|
String |
stageTenantEngineConfiguration(String tenantId,
javax.servlet.http.HttpServletRequest svtRequest,
javax.servlet.http.HttpServletResponse svtResponse)
Stages a new tenant configuration based on a JSON representation of the
configuration.
|
com.sitewhere.spi.user.ITenant |
updateTenant(String tenantId,
com.sitewhere.rest.model.user.request.TenantCreateRequest request)
Update an existing tenant.
|
getTenant, getTenantAuthToken, handleAccessDenied, handleMissingContent, handleRuntimeException, handleSuccessfulAdd, handleSystemException@RequestMapping(method=POST) @ResponseBody @PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')") public com.sitewhere.spi.user.ITenant createTenant(@RequestBody com.sitewhere.rest.model.user.request.TenantCreateRequest request) throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}",
method=PUT)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public com.sitewhere.spi.user.ITenant updateTenant(@PathVariable
String tenantId,
@RequestBody
com.sitewhere.rest.model.user.request.TenantCreateRequest request)
throws com.sitewhere.spi.SiteWhereException
tenantId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}",
method=GET)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public com.sitewhere.spi.user.ITenant getTenantById(@PathVariable
String tenantId,
@RequestParam(required=false,defaultValue="false")
boolean includeRuntimeInfo)
throws com.sitewhere.spi.SiteWhereException
tenantId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}/engine/{command}",
method=POST)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public com.sitewhere.spi.command.ICommandResponse issueTenantEngineCommand(@PathVariable
String tenantId,
@PathVariable
String command)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/{tenantId}/engine/configuration",
method=GET)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public String getTenantEngineConfiguration(@PathVariable
String tenantId)
throws com.sitewhere.spi.SiteWhereException
tenantId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}/engine/configuration/json",
method=GET)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public ElementContent getTenantEngineConfigurationAsJson(@PathVariable
String tenantId)
throws com.sitewhere.spi.SiteWhereException
tenantId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}/engine/configuration/json",
method=POST)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public String stageTenantEngineConfiguration(@PathVariable
String tenantId,
javax.servlet.http.HttpServletRequest svtRequest,
javax.servlet.http.HttpServletResponse svtResponse)
throws com.sitewhere.spi.SiteWhereException
tenantId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/authtoken/{authToken}",
method=GET)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public com.sitewhere.spi.user.ITenant getTenantByAuthToken(@PathVariable
String authToken)
throws com.sitewhere.spi.SiteWhereException
authToken - com.sitewhere.spi.SiteWhereException@RequestMapping(method=GET) @ResponseBody @PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')") public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.user.ITenant> listTenants(@RequestParam(required=false) String authUserId, @RequestParam(required=false,defaultValue="false") boolean includeRuntimeInfo, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="100") int pageSize) throws com.sitewhere.spi.SiteWhereException
criteria - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{tenantId}",
method=DELETE)
@ResponseBody
@PreAuthorize(value="hasRole(\'ROLE_REST\') and hasRole(\'ROLE_ADMINISTER_TENANTS\')")
public com.sitewhere.spi.user.ITenant deleteTenantById(@PathVariable
String tenantId,
@RequestParam(defaultValue="false")
boolean force)
throws com.sitewhere.spi.SiteWhereException
tenantId - force - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/device/{hardwareId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public List<com.sitewhere.spi.user.ITenant> listTenantsForDevice(@PathVariable
String hardwareId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - servletRequest - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.