{
  "openapi": "3.0.3",
  "info": {
    "title": "Backup & DR API",
    "version": "1.0.0",
    "description": "Device backup and disaster recovery \u2014 backups, qkview jobs, and NetScaler backup jobs."
  },
  "servers": [
    {
      "url": "https://versus-demo.com"
    }
  ],
  "paths": {
    "/api/backups/": {
      "get": {
        "operationId": "backups_list",
        "parameters": [
          {
            "in": "query",
            "name": "backup_type",
            "schema": {
              "type": "string",
              "enum": [
                "full",
                "qkview",
                "startup",
                "ucs"
              ]
            },
            "description": "* `ucs` - UCS\n* `qkview` - QKView\n* `startup` - Startup Config\n* `full` - Full Backup"
          },
          {
            "in": "query",
            "name": "device",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "A page number within the paginated result set.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBackupList"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List backups"
      },
      "post": {
        "operationId": "backups_create",
        "tags": [
          "backups"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Create backup"
      }
    },
    "/api/backups/{id}/": {
      "get": {
        "operationId": "backups_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Retrieve backup"
      },
      "put": {
        "operationId": "backups_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update backup"
      },
      "patch": {
        "operationId": "backups_partial_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedBackupRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PatchedBackupRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PatchedBackupRequest"
              }
            }
          }
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update backup"
      },
      "delete": {
        "operationId": "backups_destroy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        },
        "summary": "Delete backup"
      }
    },
    "/api/backups/{id}/download/": {
      "get": {
        "operationId": "backups_download_retrieve",
        "description": "Serve the backup file as an attachment (streamed from local disk or\nthe object store, same-origin).",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Download: backup"
      }
    },
    "/api/backups/{id}/file/": {
      "get": {
        "operationId": "backups_file_retrieve",
        "description": "Return the text content of a single file inside the backup.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "File: backup"
      }
    },
    "/api/backups/{id}/inspect/": {
      "get": {
        "operationId": "backups_inspect_retrieve",
        "description": "Return the list of files contained in the backup.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this backup.",
            "required": true
          }
        ],
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Inspect: backup"
      }
    },
    "/api/backups/diff/": {
      "get": {
        "operationId": "backups_diff_retrieve",
        "description": "Return a unified diff of one file between two backups.",
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List diffs"
      }
    },
    "/api/backups/latest/": {
      "get": {
        "operationId": "backups_latest_retrieve",
        "description": "Return the most recent backup for a device identified by name or ID.\n\nQuery params (one required):\n  device_name  \u00e2\u20ac\u201d exact device name (case-insensitive)\n  device       \u00e2\u20ac\u201d numeric device ID\n\nAppend ?download=1 to stream the file directly instead of returning metadata.",
        "tags": [
          "backups"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List latests"
      }
    },
    "/api/netscaler-backup-jobs/": {
      "get": {
        "operationId": "netscaler_backup_jobs_list",
        "parameters": [
          {
            "in": "query",
            "name": "device",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "A page number within the paginated result set.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "failed",
                "pending",
                "ready",
                "running"
              ]
            },
            "description": "* `pending` - Pending\n* `running` - Running\n* `ready` - Ready\n* `failed` - Failed"
          }
        ],
        "tags": [
          "netscaler-backup-jobs"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedNetscalerBackupJobList"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List netscaler backup jobs"
      }
    },
    "/api/netscaler-backup-jobs/{id}/": {
      "get": {
        "operationId": "netscaler_backup_jobs_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this netscaler backup job.",
            "required": true
          }
        ],
        "tags": [
          "netscaler-backup-jobs"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetscalerBackupJob"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Retrieve netscaler backup job"
      }
    },
    "/api/netscaler-backup-jobs/{id}/cancel/": {
      "post": {
        "operationId": "netscaler_backup_jobs_cancel_create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this netscaler backup job.",
            "required": true
          }
        ],
        "tags": [
          "netscaler-backup-jobs"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetscalerBackupJob"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Cancel: netscaler backup job"
      }
    },
    "/api/qkview-jobs/": {
      "get": {
        "operationId": "qkview_jobs_list",
        "parameters": [
          {
            "in": "query",
            "name": "device",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "A page number within the paginated result set.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "downloading",
                "failed",
                "generating",
                "processing",
                "ready",
                "uploading"
              ]
            },
            "description": "* `generating` - Generating on device\n* `downloading` - Downloading QKView\n* `uploading` - Uploading to iHealth\n* `processing` - Processing on iHealth\n* `ready` - Ready\n* `failed` - Failed"
          }
        ],
        "tags": [
          "qkview-jobs"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedQKViewJobList"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List qkview jobs"
      }
    },
    "/api/qkview-jobs/{id}/": {
      "get": {
        "operationId": "qkview_jobs_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this qk view job.",
            "required": true
          }
        ],
        "tags": [
          "qkview-jobs"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QKViewJob"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Retrieve qkview job"
      }
    }
  },
  "components": {
    "schemas": {
      "PaginatedQKViewJobList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QKViewJob"
            }
          }
        }
      },
      "PaginatedBackupList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Backup"
            }
          }
        }
      },
      "Backup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "device_name": {
            "type": "string",
            "readOnly": true
          },
          "backup_type": {
            "$ref": "#/components/schemas/BackupTypeEnum"
          },
          "filename": {
            "type": "string",
            "maxLength": 300
          },
          "storage": {
            "$ref": "#/components/schemas/StorageEnum"
          },
          "file_path": {
            "type": "string",
            "maxLength": 500
          },
          "object_key": {
            "type": "string",
            "maxLength": 600
          },
          "file_size": {
            "type": "integer",
            "maximum": 9223372036854775807,
            "minimum": -9223372036854775808,
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "created_by": {
            "type": "string",
            "maxLength": 100
          },
          "notes": {
            "type": "string"
          },
          "device": {
            "type": "integer"
          }
        },
        "required": [
          "created_at",
          "device",
          "device_name",
          "filename",
          "id"
        ]
      },
      "QKViewJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "device": {
            "type": "integer",
            "readOnly": true
          },
          "device_name": {
            "type": "string",
            "readOnly": true
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QKViewJobStatusEnum"
              }
            ],
            "readOnly": true
          },
          "ihealth_qkview_id": {
            "type": "string",
            "readOnly": true
          },
          "ihealth_username": {
            "type": "string",
            "readOnly": true
          },
          "diagnostics": {
            "readOnly": true
          },
          "diagnostic_count": {
            "type": "string",
            "readOnly": true
          },
          "log": {
            "type": "string",
            "readOnly": true
          },
          "error": {
            "type": "string",
            "readOnly": true
          },
          "file_size": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "finished_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          }
        },
        "required": [
          "created_at",
          "device",
          "device_name",
          "diagnostic_count",
          "diagnostics",
          "error",
          "file_size",
          "finished_at",
          "id",
          "ihealth_qkview_id",
          "ihealth_username",
          "log",
          "status"
        ]
      },
      "PaginatedNetscalerBackupJobList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetscalerBackupJob"
            }
          }
        }
      },
      "BackupRequest": {
        "type": "object",
        "properties": {
          "backup_type": {
            "$ref": "#/components/schemas/BackupTypeEnum"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "storage": {
            "$ref": "#/components/schemas/StorageEnum"
          },
          "file_path": {
            "type": "string",
            "maxLength": 500
          },
          "object_key": {
            "type": "string",
            "maxLength": 600
          },
          "file_size": {
            "type": "integer",
            "maximum": 9223372036854775807,
            "minimum": -9223372036854775808,
            "format": "int64"
          },
          "created_by": {
            "type": "string",
            "maxLength": 100
          },
          "notes": {
            "type": "string"
          },
          "device": {
            "type": "integer"
          }
        },
        "required": [
          "device",
          "filename"
        ]
      },
      "BackupTypeEnum": {
        "enum": [
          "ucs",
          "qkview",
          "startup",
          "full"
        ],
        "type": "string",
        "description": "* `ucs` - UCS\n* `qkview` - QKView\n* `startup` - Startup Config\n* `full` - Full Backup"
      },
      "NetscalerBackupJobStatusEnum": {
        "enum": [
          "pending",
          "running",
          "ready",
          "failed"
        ],
        "type": "string",
        "description": "* `pending` - Pending\n* `running` - Running\n* `ready` - Ready\n* `failed` - Failed"
      },
      "StorageEnum": {
        "enum": [
          "local",
          "s3"
        ],
        "type": "string",
        "description": "* `local` - Local disk\n* `s3` - Object store"
      },
      "PatchedBackupRequest": {
        "type": "object",
        "properties": {
          "backup_type": {
            "$ref": "#/components/schemas/BackupTypeEnum"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "storage": {
            "$ref": "#/components/schemas/StorageEnum"
          },
          "file_path": {
            "type": "string",
            "maxLength": 500
          },
          "object_key": {
            "type": "string",
            "maxLength": 600
          },
          "file_size": {
            "type": "integer",
            "maximum": 9223372036854775807,
            "minimum": -9223372036854775808,
            "format": "int64"
          },
          "created_by": {
            "type": "string",
            "maxLength": 100
          },
          "notes": {
            "type": "string"
          },
          "device": {
            "type": "integer"
          }
        }
      },
      "NetscalerBackupJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "device": {
            "type": "integer",
            "readOnly": true
          },
          "device_name": {
            "type": "string",
            "readOnly": true
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NetscalerBackupJobStatusEnum"
              }
            ],
            "readOnly": true
          },
          "current_step": {
            "type": "string",
            "readOnly": true
          },
          "progress": {
            "type": "integer",
            "readOnly": true
          },
          "log": {
            "type": "string",
            "readOnly": true
          },
          "error": {
            "type": "string",
            "readOnly": true
          },
          "backup": {
            "type": "integer",
            "readOnly": true,
            "nullable": true
          },
          "created_by": {
            "type": "string",
            "readOnly": true
          },
          "notes": {
            "type": "string",
            "readOnly": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          },
          "finished_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "backup",
          "created_at",
          "created_by",
          "current_step",
          "device",
          "device_name",
          "error",
          "finished_at",
          "id",
          "log",
          "notes",
          "progress",
          "started_at",
          "status"
        ]
      },
      "QKViewJobStatusEnum": {
        "enum": [
          "generating",
          "downloading",
          "uploading",
          "processing",
          "ready",
          "failed"
        ],
        "type": "string",
        "description": "* `generating` - Generating on device\n* `downloading` - Downloading QKView\n* `uploading` - Uploading to iHealth\n* `processing` - Processing on iHealth\n* `ready` - Ready\n* `failed` - Failed"
      }
    }
  }
}