com.trendmicro.ds.platform.rest.api

## Interface ITenantAPI

-     @Path(value="/tenants")
      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 sessionId)` Delete a tenant by name.
    `DeleteTenantResponse` | `deleteTenantById(java.lang.Integer tenantID, java.lang.String sessionId)` Delete tenant by tenant's ID.
    `TenantElement` | `getTenant(java.lang.String tenantName, java.lang.String sessionId)` Retrieve a tenant by name.
    `TenantElement` | `getTenantById(java.lang.Integer tenantID, java.lang.String sessionId)` Retrieve a tenant by tenant's ID.
    `TenantListing` | `getTenantsByState(java.lang.String sessionId, TenantState tenantState, java.lang.Integer tenantID, java.lang.String tenantIDOp, java.lang.Integer maxItems)` Get tenants by tenant state
    `TenantListing` | `listAllTenants(java.lang.String sessionId)` Retrieve information about all tenants.
    `UpdateTenantResponse` | `updateTenant(java.lang.String tenantName, UpdateTenantRequest updateTenantRequest)` Update a tenant's information.

- - ### Method Detail

    - #### listAllTenants

          @GET
           @Produces(value={"application/xml","application/json"})
          TenantListing listAllTenants(@QueryParam(value="sID")
                                                                                                     java.lang.String sessionId)
                                                                                              throws java.lang.Exception

      Retrieve information about all tenants.
      Parameters:
        `sessionId` - a session ID returned by the Authentication API.
      Returns:
        The collection of tenants.
      Throws:
        `java.lang.Exception`

    - #### addTenant

          @POST
           @Consumes(value={"application/xml","application/json"})
           @Produces(value={"application/xml","application/json"})
          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

          @PUT
           @Path(value="/name/{tName}")
           @Consumes(value={"application/xml","application/json"})
           @Produces(value={"application/xml","application/json"})
          UpdateTenantResponse updateTenant(@PathParam(value="tName")
                                                                                                                                                                                                 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

          @GET
           @Path(value="/name/{tName}")
           @Produces(value={"application/xml","application/json"})
          TenantElement getTenant(@PathParam(value="tName")
                                                                                                                              java.lang.String tenantName,
                                                                                                                              @QueryParam(value="sID")
                                                                                                                              java.lang.String sessionId)
                                                                                                                       throws java.lang.Exception

      Retrieve a tenant by name.
      Parameters:
        `tenantName` - The tenant's name
        `sessionId` - a session ID returned by the Authentication API.
      Returns:
        The tenant's information.
      Throws:
        `java.lang.Exception`

    - #### getTenantById

          @GET
           @Path(value="/id/{tID}")
           @Produces(value={"application/xml","application/json"})
          TenantElement getTenantById(@PathParam(value="tID")
                                                                                                                              java.lang.Integer tenantID,
                                                                                                                              @QueryParam(value="sID")
                                                                                                                              java.lang.String sessionId)
                                                                                                                       throws java.lang.Exception

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

    - #### getTenantsByState

          @GET
           @Path(value="/state/{state}")
           @Produces(value={"application/xml","application/json"})
          TenantListing getTenantsByState(@QueryParam(value="sID")
                                                                                                                                       java.lang.String sessionId,
                                                                                                                                       @PathParam(value="state")
                                                                                                                                       TenantState tenantState,
                                                                                                                                       @QueryParam(value="tenantID")
                                                                                                                                       java.lang.Integer tenantID,
                                                                                                                                       @QueryParam(value="tenantIDOp")
                                                                                                                                       java.lang.String tenantIDOp,
                                                                                                                                       @QueryParam(value="maxItems")
                                                                                                                                       java.lang.Integer maxItems)
                                                                                                                                throws java.lang.Exception

      Get tenants by tenant state
      Parameters:
        `sessionID` - a session ID returned by the Authentication API.
        `tenantState` - Tenant state. Currently supported states are:
        - undefined (Default state)
        - created (Tenant is created)
        - active (Tenant is active)
        - suspended (Tenant is suspended)
        - pending-deletion (Tenant is pending to be deleted)
        - db-upgrade-failure (Tenant database upgrade failure)
        - confirmation-required (Tenant confirmation is required)
        - cache-requires-initialization (Cached tenant is pending to be initialized)
        - cache-initializing (Cached tenant is initializing)
        - cache-ready-for-use (Cached tenant is ready for use)
        - cache-activating (Cached tenant is activating)
        `tenantID` - (optional) used to define the starting point for the query. Combine with `tenantIDOp` to page through results.
        `tenantIDOp` - (optional, required if `tenantID` is specified) Currently-supported operations are:
        - gt (greater than)
        - ge (greater than or equal to)
        - eq (equal to)
        - lt (less than)
        - le (less than or equal to)
        `maxItems` - (optional) the number of items to retrieve. The maximum value for this parameter is controlled by the "Maximum number of items to retrieve from database" setting on the administrator account, which defaults to 5000.
      Returns:
        a `TenantListing` with the tenant details.
      Throws:
        `java.lang.Exception`

    - #### deleteTenant

          @DELETE
           @Path(value="/name/{tName}")
           @Produces(value={"application/xml","application/json"})
          DeleteTenantResponse deleteTenant(@PathParam(value="tName")
                                                                                                                                           java.lang.String tenantName,
                                                                                                                                           @QueryParam(value="sID")
                                                                                                                                           java.lang.String sessionId)
                                                                                                                                    throws java.lang.Exception

      Delete a tenant by name.
      Parameters:
        `tenantName` - The name of the tenant to delete.
        `sessionId` - a session ID returned by the Authentication API.
      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

          @DELETE
           @Path(value="/id/{tID}")
           @Produces(value={"application/xml","application/json"})
          DeleteTenantResponse deleteTenantById(@PathParam(value="tID")
                                                                                                                                           java.lang.Integer tenantID,
                                                                                                                                           @QueryParam(value="sID")
                                                                                                                                           java.lang.String sessionId)
                                                                                                                                    throws java.lang.Exception

      Delete tenant by tenant's ID.
      Parameters:
        `tenantID` - The ID of the tenant to delete.
        `sessionId` - a session ID returned by the Authentication API.
      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 © 2017 Trend Micro Inc. All Rights Reserved.