swagger: "2.0" info: {} basePath: /api paths: /add-asset: post: tags: - Asset API description: add a asset operationId: ApiController.AddAsset parameters: - in: body name: body description: The details of the asset required: true schema: $ref: '#/definitions/object.Asset' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /add-asset-tunnel: get: tags: - Session API description: add session operationId: ApiController.AddAssetTunnel parameters: - in: query name: assetId description: The id of asset required: true type: string responses: "200": description: "" schema: $ref: '#/definitions/Response' /add-command-rule: post: tags: - Command Rule API description: add a command rule operationId: ApiController.AddCommandRule parameters: - in: body name: body description: The details of the command rule required: true schema: $ref: '#/definitions/object.CommandRule' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /add-permission: post: tags: - Permission API description: add a permission operationId: ApiController.AddPermission parameters: - in: body name: body description: The details of the permission required: true schema: $ref: '#/definitions/object.Permission' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /add-record: post: tags: - Record API description: add a record operationId: ApiController.AddRecord parameters: - in: body name: body description: The details of the record required: true schema: $ref: '#/definitions/object.Record' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /add-session: post: tags: - Session API description: add session operationId: ApiController.AddSession parameters: - in: body name: body description: The session object required: true schema: $ref: '#/definitions/object.Session' responses: "200": description: "" schema: $ref: '#/definitions/Response' /add-ssh-key: post: tags: - SSH Key API description: add an SSH public key for the signed-in user to sign in to the SSH gateway with operationId: ApiController.AddSshKey parameters: - in: body name: body description: The SSH key object required: true schema: $ref: '#/definitions/object.SshKey' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /create-session-dir: post: tags: - Session File API description: create a directory on the asset of an SSH session operationId: ApiController.CreateSessionDir parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the new directory required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-asset: post: tags: - Asset API description: delete a asset operationId: ApiController.DeleteAsset parameters: - in: body name: body description: The details of the asset required: true schema: $ref: '#/definitions/object.Asset' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-command-rule: post: tags: - Command Rule API description: delete a command rule operationId: ApiController.DeleteCommandRule parameters: - in: body name: body description: The details of the command rule required: true schema: $ref: '#/definitions/object.CommandRule' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-permission: post: tags: - Permission API description: delete a permission operationId: ApiController.DeletePermission parameters: - in: body name: body description: The details of the permission required: true schema: $ref: '#/definitions/object.Permission' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-record: post: tags: - Record API description: delete a record operationId: ApiController.DeleteRecord parameters: - in: body name: body description: The details of the record required: true schema: $ref: '#/definitions/object.Record' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-session: post: tags: - Session API description: delete session operationId: ApiController.DeleteSession parameters: - in: query name: id description: The id of session required: true type: string responses: "200": description: "" schema: $ref: '#/definitions/Response' /delete-session-file: post: tags: - Session File API description: delete a file, or a directory with everything in it, on the asset of an SSH session operationId: ApiController.DeleteSessionFile parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the file or directory required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /delete-ssh-key: post: tags: - SSH Key API description: delete an SSH public key of the signed-in user operationId: ApiController.DeleteSshKey parameters: - in: body name: body description: The SSH key object required: true schema: $ref: '#/definitions/object.SshKey' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /download-session-file: get: tags: - Session File API description: download a file from the asset of an SSH session operationId: ApiController.DownloadSessionFile parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the file required: true type: string responses: "200": description: '{file} file The file' /get-asset: get: tags: - Asset API description: get asset operationId: ApiController.GetAsset parameters: - in: query name: id description: The id ( owner/name ) of the asset required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Asset' /get-assets: get: tags: - Asset API description: get all assets operationId: ApiController.GetAssets parameters: - in: query name: pageSize description: The size of each page required: true type: string - in: query name: p description: The number of the page required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Asset' /get-command-rule: get: tags: - Command Rule API description: get command rule operationId: ApiController.GetCommandRule parameters: - in: query name: id description: The id ( owner/name ) of the command rule required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.CommandRule' /get-command-rules: get: tags: - Command Rule API description: get all command rules operationId: ApiController.GetCommandRules parameters: - in: query name: owner description: The owner of command rules required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.CommandRule' /get-commands: get: tags: - Command API description: get the commands run in SSH sessions, by page operationId: ApiController.GetCommands parameters: - in: query name: owner description: The owner of the commands required: true type: string - in: query name: pageSize description: The size of each page required: true type: string - in: query name: p description: The number of the page required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Command' /get-groups: get: tags: - Permission API description: get the groups of the Casdoor organization, for choosing permission subjects operationId: ApiController.GetGroups responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Principal' /get-patch-job: get: tags: - Patch API description: get a job with its output, live while it runs operationId: ApiController.GetPatchJob parameters: - in: query name: id description: The id ( owner/name ) of the job required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.PatchJob' /get-patch-jobs: get: tags: - Patch API description: get the scan, install and restart jobs, by page operationId: ApiController.GetPatchJobs parameters: - in: query name: owner description: The owner of the jobs required: true type: string - in: query name: pageSize description: The size of each page required: true type: string - in: query name: p description: The number of the page required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.PatchJob' /get-patch-status: get: tags: - Patch API description: get the pending updates of an SSH asset, from the last scan operationId: ApiController.GetPatchStatus parameters: - in: query name: id description: The id ( owner/name ) of the asset required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.PatchStatus' /get-patch-statuses: get: tags: - Patch API description: get the pending updates of every SSH asset, from the last scan operationId: ApiController.GetPatchStatuses parameters: - in: query name: owner description: The owner of the assets required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.PatchStatus' /get-permission: get: tags: - Permission API description: get permission operationId: ApiController.GetPermission parameters: - in: query name: id description: The id ( owner/name ) of the permission required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Permission' /get-permissions: get: tags: - Permission API description: get all permissions operationId: ApiController.GetPermissions parameters: - in: query name: owner description: The owner of permissions required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Permission' /get-record: get: tags: - Record API description: get record operationId: ApiController.GetRecord parameters: - in: query name: id description: The id ( owner/name ) of the record required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Record' /get-records: get: tags: - Record API description: get all records operationId: ApiController.GetRecords parameters: - in: query name: pageSize description: The size of each page required: true type: string - in: query name: p description: The number of the page required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Record' /get-session: get: tags: - Session API description: get session operationId: ApiController.GetConnSession parameters: - in: query name: id description: The id of session required: true type: string responses: "200": description: "" schema: $ref: '#/definitions/object.Session' /get-session-files: get: tags: - Session File API description: list a directory on the asset of an SSH session, the home directory when path is empty operationId: ApiController.GetSessionFiles parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the directory type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.SessionFiles' /get-session-monitor: get: tags: - Session API description: watch a connected SSH session live over a websocket, read only operationId: ApiController.GetSessionMonitor parameters: - in: query name: id description: The id of the session required: true type: string /get-sessions: get: tags: - Session API description: get all sessions operationId: ApiController.GetSessions parameters: - in: query name: pageSize description: The size of each page required: true type: string - in: query name: p description: The number of the page required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Session' /get-ssh-gateway: get: tags: - SSH Key API description: get the address and host key fingerprint of the SSH gateway operationId: ApiController.GetSshGateway responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.SshGateway' /get-ssh-keys: get: tags: - SSH Key API description: get the SSH public keys of the signed-in user operationId: ApiController.GetSshKeys responses: "200": description: The Response object schema: $ref: '#/definitions/object.SshKey' /get-users: get: tags: - Permission API description: get the users of the Casdoor organization, for choosing permission subjects operationId: ApiController.GetUsers responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Principal' /rename-session-file: post: tags: - Session File API description: rename or move a file or directory on the asset of an SSH session operationId: ApiController.RenameSessionFile parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the file required: true type: string - in: query name: newPath description: The new absolute path required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /start-patch-job: post: tags: - Patch API description: scan for updates, install updates or restart, on one or more SSH assets operationId: ApiController.StartPatchJob parameters: - in: body name: body description: The owner, the asset names, the type (Scan, Install or Reboot) and, to install some of the updates of one asset, their ids required: true schema: $ref: '#/definitions/controllers.patchJobRequest' responses: "200": description: The Response object schema: $ref: '#/definitions/object.PatchJob' /update-asset: post: tags: - Asset API description: update asset operationId: ApiController.UpdateAsset parameters: - in: query name: id description: The id ( owner/name ) of the asset required: true type: string - in: body name: body description: The details of the asset required: true schema: $ref: '#/definitions/object.Asset' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /update-command-rule: post: tags: - Command Rule API description: update command rule operationId: ApiController.UpdateCommandRule parameters: - in: query name: id description: The id ( owner/name ) of the command rule required: true type: string - in: body name: body description: The details of the command rule required: true schema: $ref: '#/definitions/object.CommandRule' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /update-permission: post: tags: - Permission API description: update permission operationId: ApiController.UpdatePermission parameters: - in: query name: id description: The id ( owner/name ) of the permission required: true type: string - in: body name: body description: The details of the permission required: true schema: $ref: '#/definitions/object.Permission' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /update-record: post: tags: - Record API description: update record operationId: ApiController.UpdateRecord parameters: - in: query name: id description: The id ( owner/name ) of the record required: true type: string - in: body name: body description: The details of the record required: true schema: $ref: '#/definitions/object.Record' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /update-session: post: tags: - Session API description: update session operationId: ApiController.UpdateSession parameters: - in: query name: id description: The id of session required: true type: string - in: body name: body description: The session object required: true schema: $ref: '#/definitions/object.Session' responses: "200": description: "" schema: $ref: '#/definitions/Response' /upload-session-file: post: tags: - Session File API description: upload files (form field "files") into a directory on the asset of an SSH session operationId: ApiController.UploadSessionFile parameters: - in: query name: id description: The id of the session required: true type: string - in: query name: path description: The absolute path of the directory required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' definitions: Response: title: Response type: object controllers.Principal: title: Principal type: object properties: displayName: type: string name: type: string controllers.Response: title: Response type: object properties: data: additionalProperties: description: support string, struct or []struct type: string data2: additionalProperties: description: support string, struct or []struct type: string msg: type: string status: type: string controllers.SessionFile: title: SessionFile type: object properties: isDir: type: boolean isLink: type: boolean mode: type: string modifiedTime: type: string name: type: string size: type: integer format: int64 controllers.SessionFiles: title: SessionFiles type: object properties: files: type: array items: $ref: '#/definitions/controllers.SessionFile' path: type: string controllers.SshGateway: title: SshGateway type: object properties: enabled: type: boolean fingerprint: type: string host: type: string port: type: string controllers.patchJobRequest: title: patchJobRequest type: object properties: assets: type: array items: type: string owner: type: string type: type: string updates: type: array items: type: string object: title: object type: object object.Asset: title: Asset type: object properties: createdTime: type: string description: type: string displayName: type: string enableRemoteApp: type: boolean fingerprint: type: string host: type: string name: type: string os: type: string owner: type: string password: type: string port: type: integer format: int64 privateKey: type: string protocol: type: string remoteApps: type: array items: $ref: '#/definitions/object.RemoteApp' tag: type: string updatedTime: type: string username: type: string object.Command: title: Command type: object properties: action: type: string asset: type: string clientIp: type: string createdTime: type: string name: type: string owner: type: string rule: type: string session: type: string text: type: string user: type: string object.CommandRule: title: CommandRule type: object properties: action: type: string assetTags: type: array items: type: string assets: type: array items: type: string createdTime: type: string description: type: string displayName: type: string groups: type: array items: type: string isEnabled: type: boolean name: type: string owner: type: string pattern: type: string updatedTime: type: string users: type: array items: type: string object.PatchJob: title: PatchJob type: object properties: asset: type: string createdTime: type: string endTime: type: string message: type: string name: type: string output: type: string owner: type: string status: type: string type: type: string updates: type: array items: type: string user: type: string object.PatchStatus: title: PatchStatus type: object properties: displayName: type: string host: type: string job: type: string jobType: type: string manager: type: string message: type: string name: type: string os: type: string owner: type: string platform: type: string rebootRequired: type: boolean scannedTime: type: string securityCount: type: integer format: int64 tag: type: string updateCount: type: integer format: int64 updatedTime: type: string updates: type: array items: $ref: '#/definitions/object.PatchUpdate' object.PatchUpdate: title: PatchUpdate type: object properties: category: type: string currentVersion: type: string id: type: string isSecurity: type: boolean kb: type: string newVersion: type: string rebootRequired: type: boolean severity: type: string title: type: string object.Permission: title: Permission type: object properties: actions: type: array items: type: string assetTags: type: array items: type: string assets: type: array items: type: string clientIps: type: array items: type: string createdTime: type: string description: type: string displayName: type: string endTime: type: string groups: type: array items: type: string isEnabled: type: boolean name: type: string owner: type: string startTime: type: string updatedTime: type: string users: type: array items: type: string object.Record: title: Record type: object properties: action: type: string clientIp: type: string createdTime: type: string id: type: integer format: int64 language: type: string method: type: string name: type: string object: type: string organization: type: string owner: type: string requestUri: type: string response: type: string user: type: string userAgent: type: string object.RemoteApp: title: RemoteApp type: object properties: "no": type: integer format: int64 remoteAppArgs: type: string remoteAppDir: type: string remoteAppName: type: string object.Session: title: Session type: object properties: asset: type: string clientIp: type: string clientIpDesc: type: string code: type: integer format: int64 commandCount: type: integer format: int64 connectionId: type: string createdTime: type: string creator: type: string endTime: type: string height: type: integer format: int64 message: type: string mode: type: string name: type: string operations: type: array items: type: string owner: type: string protocol: type: string recording: type: string reviewed: type: boolean startTime: type: string status: type: string userAgent: type: string userAgentDesc: type: string width: type: integer format: int64 object.SshKey: title: SshKey type: object properties: createdTime: type: string displayName: type: string fingerprint: type: string lastUsedTime: type: string name: type: string owner: type: string publicKey: type: string user: type: string