diff --git a/components/supervisor-api/typescript-rest/control.swagger.json b/components/supervisor-api/typescript-rest/control.swagger.json new file mode 100644 index 00000000000000..faabf4ecc8efde --- /dev/null +++ b/components/supervisor-api/typescript-rest/control.swagger.json @@ -0,0 +1,54 @@ +{ + "swagger": "2.0", + "info": { + "title": "control.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ControlService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorExposePortResponse": { + "type": "object" + } + } +} diff --git a/components/supervisor-api/typescript-rest/info.swagger.json b/components/supervisor-api/typescript-rest/info.swagger.json new file mode 100644 index 00000000000000..72b68098daf04e --- /dev/null +++ b/components/supervisor-api/typescript-rest/info.swagger.json @@ -0,0 +1,145 @@ +{ + "swagger": "2.0", + "info": { + "title": "info.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "InfoService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/info/workspace": { + "get": { + "operationId": "InfoService_WorkspaceInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorWorkspaceInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "InfoService" + ] + } + } + }, + "definitions": { + "WorkspaceInfoResponseGitpodAPI": { + "type": "object", + "properties": { + "endpoint": { + "type": "string", + "title": "endpoint is the websocket URL on which the token-accessible Gitpod API is served on" + }, + "host": { + "type": "string", + "description": "host is the host of the endpoint. Use this host to ask supervisor a token." + } + } + }, + "WorkspaceInfoResponseRepository": { + "type": "object", + "properties": { + "owner": { + "type": "string", + "title": "owner is the repository owner" + }, + "name": { + "type": "string", + "title": "name is the repository name" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorWorkspaceInfoResponse": { + "type": "object", + "properties": { + "workspaceId": { + "type": "string", + "description": "workspace_id is the workspace ID of this workspace." + }, + "instanceId": { + "type": "string", + "description": "instance_id is the instance ID of this workspace." + }, + "checkoutLocation": { + "type": "string", + "title": "checkout_location is the path where we initialized the workspace content" + }, + "workspaceLocationFile": { + "type": "string", + "description": "file means the workspace root is a file describing the workspace layout." + }, + "workspaceLocationFolder": { + "type": "string", + "description": "folder means the workspace root is a simple folder." + }, + "userHome": { + "type": "string", + "description": "user_home is the path to the user's home." + }, + "gitpodApi": { + "$ref": "#/definitions/WorkspaceInfoResponseGitpodAPI", + "description": "GitpodAPI provides information to reach the Gitpod server API." + }, + "gitpodHost": { + "type": "string", + "description": "gitpod_host provides Gitpod host URL." + }, + "workspaceContextUrl": { + "type": "string", + "description": "workspace_context_url is an URL for which the workspace was created." + }, + "repository": { + "$ref": "#/definitions/WorkspaceInfoResponseRepository", + "title": "repository is a repository from which this workspace was created" + } + } + } + } +} diff --git a/components/supervisor-api/typescript-rest/notification.swagger.json b/components/supervisor-api/typescript-rest/notification.swagger.json new file mode 100644 index 00000000000000..cda6960205d071 --- /dev/null +++ b/components/supervisor-api/typescript-rest/notification.swagger.json @@ -0,0 +1,181 @@ +{ + "swagger": "2.0", + "info": { + "title": "notification.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "NotificationService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/notification/notify": { + "post": { + "summary": "Prompts the user and asks for a decision. Typically called by some external process.\nIf the list of actions is empty this service returns immediately,\notherwise it blocks until the user has made their choice.", + "operationId": "NotificationService_Notify", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorNotifyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "NotificationService" + ] + } + }, + "/v1/notification/respond": { + "post": { + "summary": "Report a user's choice as a response to a notification. Typically called by the IDE.", + "operationId": "NotificationService_Respond", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorRespondResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "NotificationService" + ] + } + }, + "/v1/notification/subscribe": { + "get": { + "summary": "Subscribe to notifications. Typically called by the IDE.", + "operationId": "NotificationService_Subscribe", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorSubscribeResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorSubscribeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "NotificationService" + ] + } + } + }, + "definitions": { + "NotifyRequestLevel": { + "type": "string", + "enum": [ + "ERROR", + "WARNING", + "INFO" + ], + "default": "ERROR" + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorNotifyRequest": { + "type": "object", + "properties": { + "level": { + "$ref": "#/definitions/NotifyRequestLevel" + }, + "message": { + "type": "string" + }, + "actions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "if actions are empty, Notify will return immediately" + } + } + }, + "supervisorNotifyResponse": { + "type": "object", + "properties": { + "action": { + "type": "string", + "title": "action chosen by the user or empty string if cancelled" + } + } + }, + "supervisorRespondResponse": { + "type": "object" + }, + "supervisorSubscribeResponse": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "format": "uint64" + }, + "request": { + "$ref": "#/definitions/supervisorNotifyRequest" + } + } + } + } +} diff --git a/components/supervisor-api/typescript-rest/port.swagger.json b/components/supervisor-api/typescript-rest/port.swagger.json new file mode 100644 index 00000000000000..03c4de5fdc8195 --- /dev/null +++ b/components/supervisor-api/typescript-rest/port.swagger.json @@ -0,0 +1,211 @@ +{ + "swagger": "2.0", + "info": { + "title": "port.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "PortService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/port/tunnel/auto/{enabled}": { + "post": { + "summary": "AutoTunnel controls enablement of auto tunneling", + "operationId": "PortService_AutoTunnel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorAutoTunnelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "enabled", + "in": "path", + "required": true, + "type": "boolean" + } + ], + "tags": [ + "PortService" + ] + } + }, + "/v1/port/tunnel/{port}": { + "delete": { + "summary": "CloseTunnel notifies clients to remove listeners on remote machines.", + "operationId": "PortService_CloseTunnel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorCloseTunnelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "port", + "in": "path", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "PortService" + ] + }, + "post": { + "summary": "Tunnel notifies clients to install listeners on remote machines.\nAfter that such clients should call EstablishTunnel to forward incoming connections.", + "operationId": "PortService_Tunnel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorTunnelPortResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "port", + "in": "path", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "targetPort": { + "type": "integer", + "format": "int64" + }, + "visibility": { + "$ref": "#/definitions/supervisorTunnelVisiblity" + }, + "clientId": { + "type": "string" + } + } + } + } + ], + "tags": [ + "PortService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorAutoTunnelResponse": { + "type": "object" + }, + "supervisorCloseTunnelResponse": { + "type": "object" + }, + "supervisorEstablishTunnelResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + } + } + }, + "supervisorTunnelPortRequest": { + "type": "object", + "properties": { + "port": { + "type": "integer", + "format": "int64" + }, + "targetPort": { + "type": "integer", + "format": "int64" + }, + "visibility": { + "$ref": "#/definitions/supervisorTunnelVisiblity" + }, + "clientId": { + "type": "string" + } + } + }, + "supervisorTunnelPortResponse": { + "type": "object" + }, + "supervisorTunnelVisiblity": { + "type": "string", + "enum": [ + "none", + "host", + "network" + ], + "default": "none" + } + } +} diff --git a/components/supervisor-api/typescript-rest/status.swagger.json b/components/supervisor-api/typescript-rest/status.swagger.json new file mode 100644 index 00000000000000..cd5ac233ad81ac --- /dev/null +++ b/components/supervisor-api/typescript-rest/status.swagger.json @@ -0,0 +1,591 @@ +{ + "swagger": "2.0", + "info": { + "title": "status.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "StatusService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/status/backup": { + "get": { + "summary": "BackupStatus offers feedback on the workspace backup status. This status information can\nbe relayed to the user to provide transparency as to how \"safe\" their files/content\ndata are w.r.t. to being lost.", + "operationId": "StatusService_BackupStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorBackupStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/content": { + "get": { + "summary": "ContentStatus returns the status of the workspace content. When used with `wait`, the call\nreturns when the content has become available.", + "operationId": "StatusService_ContentStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorContentStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "wait", + "description": "if true this request will return either when it times out or when the workspace content\nhas become available.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/content/wait/{wait}": { + "get": { + "summary": "ContentStatus returns the status of the workspace content. When used with `wait`, the call\nreturns when the content has become available.", + "operationId": "StatusService_ContentStatus2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorContentStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "wait", + "description": "if true this request will return either when it times out or when the workspace content\nhas become available.", + "in": "path", + "required": true, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/ide": { + "get": { + "summary": "IDEStatus returns OK if the IDE can serve requests.", + "operationId": "StatusService_IDEStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorIDEStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "wait", + "description": "if true this request will return either when it times out or when the workspace IDE\nhas become available.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/ide/wait/{wait}": { + "get": { + "summary": "IDEStatus returns OK if the IDE can serve requests.", + "operationId": "StatusService_IDEStatus2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorIDEStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "wait", + "description": "if true this request will return either when it times out or when the workspace IDE\nhas become available.", + "in": "path", + "required": true, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/ports": { + "get": { + "summary": "PortsStatus provides feedback about the network ports currently in use.", + "operationId": "StatusService_PortsStatus", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorPortsStatusResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorPortsStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "observe", + "description": "if observe is true, we'll return a stream of changes rather than just the\ncurrent state of affairs.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/ports/observe/{observe}": { + "get": { + "summary": "PortsStatus provides feedback about the network ports currently in use.", + "operationId": "StatusService_PortsStatus2", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorPortsStatusResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorPortsStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "observe", + "description": "if observe is true, we'll return a stream of changes rather than just the\ncurrent state of affairs.", + "in": "path", + "required": true, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/supervisor": { + "get": { + "summary": "SupervisorStatus returns once supervisor is running.", + "operationId": "StatusService_SupervisorStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorSupervisorStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/tasks": { + "get": { + "summary": "TasksStatus provides tasks status information.", + "operationId": "StatusService_TasksStatus", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorTasksStatusResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorTasksStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "observe", + "description": "if observe is true, we'll return a stream of changes rather than just the\ncurrent state of affairs.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + }, + "/v1/status/tasks/observe/{observe}": { + "get": { + "summary": "TasksStatus provides tasks status information.", + "operationId": "StatusService_TasksStatus2", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorTasksStatusResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorTasksStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "observe", + "description": "if observe is true, we'll return a stream of changes rather than just the\ncurrent state of affairs.", + "in": "path", + "required": true, + "type": "boolean" + } + ], + "tags": [ + "StatusService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorBackupStatusResponse": { + "type": "object", + "properties": { + "canaryAvailable": { + "type": "boolean" + } + } + }, + "supervisorContentSource": { + "type": "string", + "enum": [ + "from_other", + "from_backup", + "from_prebuild" + ], + "default": "from_other" + }, + "supervisorContentStatusResponse": { + "type": "object", + "properties": { + "available": { + "type": "boolean", + "title": "true if the workspace content is available" + }, + "source": { + "$ref": "#/definitions/supervisorContentSource", + "title": "source indicates where the workspace content came from" + } + } + }, + "supervisorExposedPortInfo": { + "type": "object", + "properties": { + "visibility": { + "$ref": "#/definitions/supervisorPortVisibility", + "title": "public determines if the port is available without authentication or not" + }, + "url": { + "type": "string", + "title": "url is the URL at which the port is available" + }, + "onExposed": { + "$ref": "#/definitions/supervisorOnPortExposedAction", + "title": "action hint on expose" + } + } + }, + "supervisorIDEStatusResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, + "supervisorOnPortExposedAction": { + "type": "string", + "enum": [ + "ignore", + "open_browser", + "open_preview", + "notify", + "notify_private" + ], + "default": "ignore" + }, + "supervisorPortVisibility": { + "type": "string", + "enum": [ + "private", + "public" + ], + "default": "private" + }, + "supervisorPortsStatus": { + "type": "object", + "properties": { + "localPort": { + "type": "integer", + "format": "int64", + "description": "local_port is the port a service actually bound to. Some services bind\nto localhost:\u003cport\u003e, in which case they cannot be made accessible from\noutside the container. To help with this, supervisor then starts a proxy\nthat forwards traffic to this local port. In those cases, global_port\ncontains the port where the proxy is listening on." + }, + "globalPort": { + "type": "integer", + "format": "int64" + }, + "served": { + "type": "boolean", + "description": "served is true if there is a process in the workspace that serves this port." + }, + "exposed": { + "$ref": "#/definitions/supervisorExposedPortInfo", + "description": "Exposed provides information when a port is exposed. If this field isn't set,\nthe port is not available from outside the workspace (i.e. the internet)." + }, + "tunneled": { + "$ref": "#/definitions/supervisorTunneledPortInfo", + "description": "Tunneled provides information when a port is tunneled. If not present then\nthe port is not tunneled." + } + } + }, + "supervisorPortsStatusResponse": { + "type": "object", + "properties": { + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/supervisorPortsStatus" + } + } + } + }, + "supervisorSupervisorStatusResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, + "supervisorTaskPresentation": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "openIn": { + "type": "string" + }, + "openMode": { + "type": "string" + } + } + }, + "supervisorTaskState": { + "type": "string", + "enum": [ + "opening", + "running", + "closed" + ], + "default": "opening" + }, + "supervisorTaskStatus": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "state": { + "$ref": "#/definitions/supervisorTaskState" + }, + "terminal": { + "type": "string" + }, + "presentation": { + "$ref": "#/definitions/supervisorTaskPresentation" + } + } + }, + "supervisorTasksStatusResponse": { + "type": "object", + "properties": { + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/supervisorTaskStatus" + } + } + } + }, + "supervisorTunnelVisiblity": { + "type": "string", + "enum": [ + "none", + "host", + "network" + ], + "default": "none" + }, + "supervisorTunneledPortInfo": { + "type": "object", + "properties": { + "targetPort": { + "type": "integer", + "format": "int64", + "title": "target port is the desired port on the remote machine" + }, + "visibility": { + "$ref": "#/definitions/supervisorTunnelVisiblity", + "title": "visibility determines if the listener on remote machine should accept connections from localhost or network\nvisibility none means that the port should not be tunneled" + }, + "clients": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + }, + "title": "map of remote clients indicates on which remote port each client is listening to" + } + } + } + } +} diff --git a/components/supervisor-api/typescript-rest/terminal.swagger.json b/components/supervisor-api/typescript-rest/terminal.swagger.json new file mode 100644 index 00000000000000..c6437eaa2a3de2 --- /dev/null +++ b/components/supervisor-api/typescript-rest/terminal.swagger.json @@ -0,0 +1,316 @@ +{ + "swagger": "2.0", + "info": { + "title": "terminal.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "TerminalService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/terminal/get/{alias}": { + "get": { + "summary": "Get returns an opened terminal info", + "operationId": "TerminalService_Get", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorTerminal" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "TerminalService" + ] + } + }, + "/v1/terminal/list": { + "get": { + "summary": "List lists all open terminals", + "operationId": "TerminalService_List", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorListTerminalsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "TerminalService" + ] + } + }, + "/v1/terminal/listen/{alias}": { + "get": { + "summary": "Listen listens to a terminal", + "operationId": "TerminalService_Listen", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/supervisorListenTerminalResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of supervisorListenTerminalResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "TerminalService" + ] + } + }, + "/v1/terminal/shutdown/{alias}": { + "get": { + "summary": "Shutdown closes a terminal for the given alias, SIGKILL'ing all child processes\nbefore closing the pseudo-terminal.", + "operationId": "TerminalService_Shutdown", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorShutdownTerminalResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "TerminalService" + ] + } + }, + "/v1/terminal/write/{alias}": { + "post": { + "summary": "Write writes to a terminal", + "operationId": "TerminalService_Write", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorWriteTerminalResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "TerminalService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorListTerminalsResponse": { + "type": "object", + "properties": { + "terminals": { + "type": "array", + "items": { + "$ref": "#/definitions/supervisorTerminal" + } + } + } + }, + "supervisorListenTerminalResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + }, + "exitCode": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string" + } + } + }, + "supervisorOpenTerminalResponse": { + "type": "object", + "properties": { + "terminal": { + "$ref": "#/definitions/supervisorTerminal" + }, + "starterToken": { + "type": "string", + "description": "starter_token can be used to change the terminal size if there are\nmultiple listerns, without having to force your way in." + } + } + }, + "supervisorSetTerminalSizeResponse": { + "type": "object" + }, + "supervisorShutdownTerminalResponse": { + "type": "object" + }, + "supervisorTerminal": { + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "pid": { + "type": "string", + "format": "int64" + }, + "initialWorkdir": { + "type": "string" + }, + "currentWorkdir": { + "type": "string" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "supervisorTerminalSize": { + "type": "object", + "properties": { + "rows": { + "type": "integer", + "format": "int64" + }, + "cols": { + "type": "integer", + "format": "int64" + }, + "widthPx": { + "type": "integer", + "format": "int64" + }, + "heightPx": { + "type": "integer", + "format": "int64" + } + } + }, + "supervisorWriteTerminalResponse": { + "type": "object", + "properties": { + "bytesWritten": { + "type": "integer", + "format": "int64" + } + } + } + } +} diff --git a/components/supervisor-api/typescript-rest/token.swagger.json b/components/supervisor-api/typescript-rest/token.swagger.json new file mode 100644 index 00000000000000..c810d3893efe05 --- /dev/null +++ b/components/supervisor-api/typescript-rest/token.swagger.json @@ -0,0 +1,348 @@ +{ + "swagger": "2.0", + "info": { + "title": "token.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "TokenService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/token/{kind}/clear/all/{all}": { + "delete": { + "operationId": "TokenService_ClearToken2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorClearTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "kind", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "all", + "in": "path", + "required": true, + "type": "boolean" + }, + { + "name": "value", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "TokenService" + ] + } + }, + "/v1/token/{kind}/{host}": { + "post": { + "operationId": "TokenService_SetToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorSetTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "kind", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "host", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scope": { + "type": "array", + "items": { + "type": "string" + } + }, + "token": { + "type": "string" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "reuse": { + "$ref": "#/definitions/supervisorTokenReuse" + } + } + } + } + ], + "tags": [ + "TokenService" + ] + } + }, + "/v1/token/{kind}/{host}/{scope}": { + "get": { + "operationId": "TokenService_GetToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorGetTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "kind", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "host", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "scope", + "in": "path", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "minItems": 1 + }, + { + "name": "description", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "TokenService" + ] + } + }, + "/v1/token/{kind}/{value}": { + "delete": { + "operationId": "TokenService_ClearToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supervisorClearTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "kind", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "value", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "all", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "TokenService" + ] + } + } + }, + "definitions": { + "ProvideTokenRequestRegisterProvider": { + "type": "object", + "properties": { + "kind": { + "type": "string" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "supervisorClearTokenResponse": { + "type": "object" + }, + "supervisorGetTokenRequest": { + "type": "object", + "properties": { + "host": { + "type": "string" + }, + "scope": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "kind": { + "type": "string" + } + } + }, + "supervisorGetTokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "user": { + "type": "string", + "description": "* The username of the account associated with the token." + }, + "scope": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "supervisorProvideTokenResponse": { + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/supervisorGetTokenRequest" + } + } + }, + "supervisorSetTokenRequest": { + "type": "object", + "properties": { + "host": { + "type": "string" + }, + "scope": { + "type": "array", + "items": { + "type": "string" + } + }, + "token": { + "type": "string" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "reuse": { + "$ref": "#/definitions/supervisorTokenReuse" + }, + "kind": { + "type": "string" + } + } + }, + "supervisorSetTokenResponse": { + "type": "object" + }, + "supervisorTokenReuse": { + "type": "string", + "enum": [ + "REUSE_NEVER", + "REUSE_EXACTLY", + "REUSE_WHEN_POSSIBLE" + ], + "default": "REUSE_NEVER", + "description": " - REUSE_NEVER: REUSE_NEVER means the token can never be re-used.\nThis mode only makes sense when providing a token in response to a request.\n - REUSE_EXACTLY: REUSE_EXACTLY means the token can only be reused when the requested scopes\nexactly match those of the token.\n - REUSE_WHEN_POSSIBLE: REUSE_WHEN_POSSIBLE means the token can be reused when the requested scopes\nare a subset of the token's scopes." + } + } +}