{
  "swagger" : "2.0",
  "info" : {
    "description" : "Tenants service. Manages tenants in a containerized environment.",
    "version" : "1.0",
    "title" : "Tenants Swagger Definition",
    "contact" : {
      "name" : "WSO2 Inc.",
      "url" : "http://wso2.com",
      "email" : "dev@wso2.org"
    },
    "license" : {
      "name" : "Apache 2.0",
      "url" : "http://www.apache.org/licenses/LICENSE-2.0"
    }
  },
  "basePath" : "/tenants",
  "tags" : [ {
    "name" : "service"
  } ],
  "paths" : {
    "/tenants" : {
      "get" : {
        "tags" : [ "service" ],
        "summary" : "Get all tenants",
        "description" : "Returns all the available tenants",
        "operationId" : "getAllTenants",
        "produces" : [ "application/json" ],
        "parameters" : [ ],
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "schema" : {
              "type" : "array",
              "items" : {
                "$ref" : "#/definitions/Tenant"
              }
            }
          }
        }
      },
      "post" : {
        "tags" : [ "service" ],
        "summary" : "Add a new tenant",
        "description" : "",
        "operationId" : "addTenant",
        "consumes" : [ "application/json" ],
        "parameters" : [ {
          "in" : "body",
          "name" : "body",
          "description" : "Tenant object",
          "required" : true,
          "schema" : {
            "$ref" : "#/definitions/Tenant"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Tenant added"
          },
          "500" : {
            "description" : "Unable to add the tenant"
          }
        }
      }
    },
    "/tenants/{name}" : {
      "get" : {
        "tags" : [ "service" ],
        "summary" : "Get a tenant",
        "description" : "Find and return a tenant by name",
        "operationId" : "getTenant",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "name" : "name",
          "in" : "path",
          "description" : "Tenant name",
          "required" : true,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "Tenant found"
          },
          "404" : {
            "description" : "Tenant not found"
          }
        }
      },
      "delete" : {
        "tags" : [ "service" ],
        "summary" : "Delete a tenant",
        "description" : "Delete a tenant identified by name",
        "operationId" : "delete",
        "parameters" : [ {
          "name" : "name",
          "in" : "path",
          "description" : "Tenant name",
          "required" : true,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "Tenant deleted"
          },
          "404" : {
            "description" : "Tenant not found"
          }
        }
      }
    }
  },
  "definitions" : {
    "Tenant" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        }
      }
    }
  }
}