com.trendmicro.ds.platform.rest.api

## Interface ITenantAPI

-     public interface ITenantAPI

  Interface for the Tenant API.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `CreateTenantResponse` | `addTenant(CreateTenantRequest createTenantRequest)` Add a new tenant.
    `DeleteTenantResponse` | `deleteTenant(java.lang.String tenantName, java.lang.String sID)` Delete a tenant by name.
    `DeleteTenantResponse` | `deleteTenantById(java.lang.Integer tenantID, java.lang.String sID)` Delete tenant by tenant's ID.
    `TenantElement` | `getTenant(java.lang.String tenantName, java.lang.String sID)` Retrieve a tenant by name.
    `TenantElement` | `getTenantById(java.lang.Integer tenantID, java.lang.String sID)` Retrieve a tenant by tenant's ID.
    `TenantListing` | `listAllTenants(java.lang.String sID)` Retrieve information about all tenants.
    `UpdateTenantResponse` | `updateTenant(java.lang.String tenantName, UpdateTenantRequest updateTenantRequest)` Update a tenant's information.

- - ### Method Detail

    - #### listAllTenants

          TenantListing listAllTenants(java.lang.String sID)
                                throws java.lang.Exception

      Retrieve information about all tenants.
      Parameters:
        `sID` - session ID.
      Returns:
        The collection of tenants.
      Throws:
        `java.lang.Exception`

    - #### addTenant

          CreateTenantResponse addTenant(CreateTenantRequest createTenantRequest)
                                  throws java.lang.Exception

      Add a new tenant.
      Parameters:
        `createTenantRequest` - contains options to be used for the creation of the new tenant.
      Returns:
        A response with status `200 OK` and a body containing tenant details when adding the tenant succeeds. If parameter validation fails, it will return a response with status `400 Bad Request` and a body containing an `ErrorMessage`. If parameter validation succeeds but creation of the tenant fails, the tenant will be left in a partially created state, and will need to be deleted.
      Throws:
        `java.lang.Exception`

    - #### updateTenant

          UpdateTenantResponse updateTenant(java.lang.String tenantName,
                                            UpdateTenantRequest updateTenantRequest)
                                     throws java.lang.Exception

      Update a tenant's information.
      Parameters:
        `tenantName` - The name of the tenant to update.
        `updateTenantRequest` -
      Returns:
        A response with status `200 OK` and a body containing response information when updating the tenant succeeds. If tenant name is null or empty, or an attempt is made to modify the name, it will return a response with status `400 Bad Request` and a body containing an `ErrorMessage`. If the tenant does not exist, it will return a response with status `404 Not Found`.
      Throws:
        `java.lang.Exception`

    - #### getTenant

          TenantElement getTenant(java.lang.String tenantName,
                                  java.lang.String sID)
                           throws java.lang.Exception

      Retrieve a tenant by name.
      Parameters:
        `tenantName` - The tenant's name
        `sID` - session ID.
      Returns:
        The tenant's information.
      Throws:
        `java.lang.Exception`

    - #### getTenantById

          TenantElement getTenantById(java.lang.Integer tenantID,
                                      java.lang.String sID)
                               throws java.lang.Exception

      Retrieve a tenant by tenant's ID.
      Parameters:
        `tenantID` - The ID of the tenant to retrieve.
        `sID` - session ID.
      Returns:
        The tenant's information.
      Throws:
        `java.lang.Exception`

    - #### deleteTenant

          DeleteTenantResponse deleteTenant(java.lang.String tenantName,
                                            java.lang.String sID)
                                     throws java.lang.Exception

      Delete a tenant by name.
      Parameters:
        `tenantName` - The name of the tenant to delete.
        `sID` - session ID.
      Returns:
        A response with status `200 OK` and a body containing response information when deletion succeeds. If the tenant does not exist, it will return a response with status `404 Not Found` and a body containing an `ErrorMessage`.
      Throws:
        `java.lang.Exception`

    - #### deleteTenantById

          DeleteTenantResponse deleteTenantById(java.lang.Integer tenantID,
                                                java.lang.String sID)
                                         throws java.lang.Exception

      Delete tenant by tenant's ID.
      Parameters:
        `tenantID` - The ID of the tenant to delete.
        `sID` - session ID.
      Returns:
        A response with status `200 OK` and a body containing response information when deletion succeeds. If the tenant does not exist, it will return a response with status `404 Not Found` and a body containing an `ErrorMessage`.
      Throws:
        `java.lang.Exception`

Copyright © 2015 Trend Micro Inc. All Rights Reserved.