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` | `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`

    - #### 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.