{
   "swagger":"2.0",
   "info":{
      "description":"API used to communicate with the DIVA Core database. Only license, user and role end-points are exposed.",
      "version":"1.0.0",
      "title":"DIVA Core Data Service API",
      "license":{
         "name":"Apache 2.0",
         "url":"http://www.apache.org/licenses/LICENSE-2.0.html"
      }
   },
   "host":"172.16.10.18:13443",
   "basePath":"/",
   "tags":[
      {
         "name":"user-api-controller-impl",
         "description":"User Api Controller Impl"
      },
      {
         "name":"license-api-controller",
         "description":"License Api Controller"
      }
   ],
   "paths":{
      "/license":{
         "get":{
            "tags":[
               "license"
            ],
            "summary":"Gets active license information.",
            "description":"Returns current active license information.",
            "operationId":"getLicense",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/License"
                  }
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/licenseHistories":{
         "get":{
            "tags":[
               "license"
            ],
            "summary":"Gets the list of all licenses.",
            "description":"Returns information for all licenses in the database.",
            "operationId":"getAllLicenses",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"id",
                  "in":"query",
                  "description":"license ID",
                  "required":false,
                  "type":"integer",
                  "format":"int32"
               },
               {
                  "name":"page",
                  "in":"query",
                  "description":"page",
                  "required":false,
                  "type":"integer",
                  "default":1,
                  "format":"int32"
               },
               {
                  "name":"size",
                  "in":"query",
                  "description":"size",
                  "required":false,
                  "type":"integer",
                  "default":5,
                  "format":"int32"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/LicenseHistories"
                  }
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         },
         "post":{
            "tags":[
               "license"
            ],
            "summary":"Imports a license.",
            "description":"Returns status for import of a license.",
            "operationId":"postLicense",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "in":"body",
                  "name":"license",
                  "description":"License to import",
                  "required":true,
                  "schema":{
                     "$ref":"#/definitions/LicenseInput"
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid license supplied"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/roles":{
         "get":{
            "tags":[
               "role"
            ],
            "summary":"Gets the list of all DIVA Core roles.",
            "description":"Returns all DIVA Core roles.",
            "operationId":"getAllRoles",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"page",
                  "in":"query",
                  "description":"page",
                  "required":false,
                  "type":"integer",
                  "default":1,
                  "format":"int32"
               },
               {
                  "name":"size",
                  "in":"query",
                  "description":"size",
                  "required":false,
                  "type":"integer",
                  "default":5,
                  "format":"int32"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/RoleOutputs"
                  }
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/users":{
         "get":{
            "tags":[
               "user"
            ],
            "summary":"Gets the list of all users or get a single user by name.",
            "description":"Returns user information for all users.",
            "operationId":"getAllUsers",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"userName",
                  "in":"query",
                  "description":"name of user",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"page",
                  "in":"query",
                  "description":"page",
                  "required":false,
                  "type":"integer",
                  "default":1,
                  "format":"int32"
               },
               {
                  "name":"size",
                  "in":"query",
                  "description":"size",
                  "required":false,
                  "type":"integer",
                  "default":5,
                  "format":"int32"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/UserOutputs"
                  }
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         },
         "post":{
            "tags":[
               "user"
            ],
            "summary":"Creates a DIVA Core user.",
            "description":"Returns status for the creation of a user.",
            "operationId":"createUser",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "in":"body",
                  "name":"userReg",
                  "description":"userReg",
                  "required":true,
                  "schema":{
                     "$ref":"#/definitions/UserRegistration"
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid user supplied"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         },
         "delete":{
            "tags":[
               "user"
            ],
            "summary":"Deletes a DIVA Core user.",
            "description":"Returns status for the deletion of a user.",
            "operationId":"deleteUser",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"userName",
                  "in":"query",
                  "description":"name of user",
                  "required":true,
                  "type":"string"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid user supplied"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/users/login":{
         "post":{
            "tags":[
               "user"
            ],
            "summary":"Login a user",
            "description":"Returns the created token.",
            "operationId":"login",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "in":"body",
                  "name":"userLogin",
                  "description":"userLogin",
                  "required":true,
                  "schema":{
                     "$ref":"#/definitions/UserLogin"
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Token"
                  }
               },
               "400":{
                  "description":"Invalid user supplied"
               },
               "404":{
                  "description":"User not found"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/users/logout":{
         "post":{
            "tags":[
               "user"
            ],
            "summary":"Logout a user",
            "description":"Returns the status.",
            "operationId":"logout",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid user supplied"
               },
               "404":{
                  "description":"User not found"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/users/password":{
         "put":{
            "tags":[
               "user"
            ],
            "summary":"Updates the password of a user.",
            "description":"Update the password of a user.",
            "operationId":"updatePassword",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"userName",
                  "in":"query",
                  "description":"name of user",
                  "required":true,
                  "type":"string"
               },
               {
                  "in":"body",
                  "name":"userUpdatePassword",
                  "description":"userUpdatePassword",
                  "required":true,
                  "schema":{
                     "$ref":"#/definitions/UserPasswordUpdate"
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid user supplied"
               },
               "404":{
                  "description":"User not found"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      },
      "/users/role":{
         "put":{
            "tags":[
               "user"
            ],
            "summary":"Updates the role of a user.",
            "description":"Returns status for update of a user's role.",
            "operationId":"updateRole",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "name":"Authorization",
                  "in":"header",
                  "required":false,
                  "type":"string"
               },
               {
                  "name":"userName",
                  "in":"query",
                  "description":"name of user",
                  "required":true,
                  "type":"string"
               },
               {
                  "in":"body",
                  "name":"userUpdateRole",
                  "description":"userUpdateRole",
                  "required":true,
                  "schema":{
                     "$ref":"#/definitions/UserRoleUpdate"
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful operation",
                  "schema":{
                     "$ref":"#/definitions/Status"
                  }
               },
               "400":{
                  "description":"Invalid role supplied"
               },
               "404":{
                  "description":"User not found"
               }
            },
            "security":[
               {
                  "bearerAuth":[
                     
                  ]
               }
            ]
         }
      }
   },
   "definitions":{
      "License":{
         "type":"object",
         "properties":{
            "comments":{
               "type":"string"
            },
            "customerName":{
               "type":"string"
            },
            "divaVersion":{
               "type":"string"
            },
            "featureAnalytics":{
               "type":"boolean"
            },
            "featureExternalization":{
               "type":"boolean"
            },
            "featureNumberOfAvidDet1Det2":{
               "type":"integer",
               "format":"int32"
            },
            "featureNumberOfAvidDhm":{
               "type":"integer",
               "format":"int32"
            },
            "featureNumberOfCloudAccounts":{
               "type":"integer",
               "format":"int32"
            },
            "featureNumberOfDcSites":{
               "type":"integer",
               "format":"int32"
            },
            "featureNumberOfExternalDiskSystems":{
               "type":"integer",
               "format":"int32"
            },
            "featureSpmUnlimited":{
               "type":"boolean"
            },
            "highWaterMark":{
               "type":"integer",
               "format":"int32"
            },
            "managerHostUuidList":{
               "type":"array",
               "items":{
                  "type":"string"
               }
            },
            "nearlineTB":{
               "type":"number",
               "format":"float"
            },
            "numberOfActors":{
               "type":"integer",
               "format":"int32"
            },
            "numberOfRobots":{
               "type":"integer",
               "format":"int32"
            },
            "prAvi":{
               "type":"boolean"
            },
            "prDif":{
               "type":"boolean"
            },
            "prGxf":{
               "type":"boolean"
            },
            "prLxf":{
               "type":"boolean"
            },
            "prMxf":{
               "type":"boolean"
            },
            "prQuicktime":{
               "type":"boolean"
            },
            "systemId":{
               "type":"string"
            },
            "tapeSlots":{
               "type":"integer",
               "format":"int32"
            },
            "validityDate":{
               "type":"string"
            }
         }
      },
      "LicenseHistories":{
         "type":"object",
         "properties":{
            "count":{
               "type":"integer",
               "format":"int32"
            },
            "licenses":{
               "type":"array",
               "items":{
                  "$ref":"#/definitions/LicenseHistory"
               }
            }
         }
      },
      "LicenseHistory":{
         "type":"object",
         "properties":{
            "expirationDate":{
               "type":"string",
               "format":"date-time"
            },
            "faclityId":{
               "type":"string"
            },
            "failureReason":{
               "type":"string"
            },
            "id":{
               "type":"integer",
               "format":"int32"
            },
            "importDate":{
               "type":"string",
               "format":"date-time"
            },
            "importReason":{
               "type":"string"
            },
            "importStatus":{
               "type":"string"
            },
            "importer":{
               "type":"string"
            },
            "settings":{
               "type":"string"
            }
         }
      },
      "LicenseInput":{
         "type":"object",
         "properties":{
            "importReason":{
               "type":"string"
            },
            "importer":{
               "type":"string"
            },
            "licenseFileContent":{
               "type":"string",
               "description":"licenseFileContent"
            },
            "managerAddress":{
               "type":"string",
               "example":"127.0.0.1",
               "description":"managerAddress"
            },
            "managerPort":{
               "type":"integer",
               "format":"int32",
               "example":8000,
               "description":"managerPort"
            },
            "notifyManagerAfterImport":{
               "type":"boolean",
               "example":false,
               "description":"notifyManagerAfterImport"
            }
         }
      },
      "RoleOutput":{
         "type":"object",
         "properties":{
            "name":{
               "type":"string",
               "example":"user",
               "description":"name"
            }
         }
      },
      "RoleOutputs":{
         "type":"object",
         "properties":{
            "count":{
               "type":"integer",
               "format":"int32"
            },
            "roles":{
               "type":"array",
               "items":{
                  "$ref":"#/definitions/RoleOutput"
               }
            }
         }
      },
      "Status":{
         "type":"object",
         "properties":{
            "statusCode":{
               "type":"integer",
               "format":"int32"
            },
            "statusDescription":{
               "type":"string"
            },
            "statusName":{
               "type":"string"
            }
         }
      },
      "Token":{
         "type":"object",
         "properties":{
            "token":{
               "type":"string"
            }
         }
      },
      "UserLogin":{
         "type":"object",
         "properties":{
            "password":{
               "type":"string"
            },
            "username":{
               "type":"string"
            }
         }
      },
      "UserOutput":{
         "type":"object",
         "properties":{
            "role":{
               "type":"string"
            },
            "username":{
               "type":"string"
            }
         }
      },
      "UserOutputs":{
         "type":"object",
         "properties":{
            "count":{
               "type":"integer",
               "format":"int32"
            },
            "users":{
               "type":"array",
               "items":{
                  "$ref":"#/definitions/UserOutput"
               }
            }
         }
      },
      "UserPasswordUpdate":{
         "type":"object",
         "properties":{
            "newPassword":{
               "type":"string"
            },
            "oldPassword":{
               "type":"string"
            }
         }
      },
      "UserRegistration":{
         "type":"object",
         "properties":{
            "password":{
               "type":"string"
            },
            "role":{
               "type":"string"
            },
            "username":{
               "type":"string"
            }
         }
      },
      "UserRoleUpdate":{
         "type":"object",
         "properties":{
            "newRole":{
               "type":"string"
            }
         }
      }
   }
}