# Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi openapi: 3.0.3 info: title: Execute version: 0.0.4 security: - bearerHttpAuthentication: [] paths: /v1/execute: post: summary: "Execute code" description: "Run a script in a secure, isolated sandbox. Scripts can read from stdin and write to stdout or stderr. They can access environment variables and command line arguments." tags: - Sandbox operationId: Sandbox_Execute requestBody: content: application/json: schema: $ref: "#/components/schemas/ExecuteRequest" examples: Python: value: language: PYTHON code: 'print("Hello world!")' required: true responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ExecuteResponse" example: exit_code: 0 stdout: "Hello world!" stderr: "" "401": description: Default error response content: application/json: schema: $ref: "#/components/schemas/Status" example: code: 16 message: "unauthenticated" components: securitySchemes: bearerHttpAuthentication: type: http scheme: bearer schemas: ExecuteRequest: type: object properties: language: description: "The interpreter to use when executing code." enum: - PYTHON - JAVASCRIPT - TYPESCRIPT - RUBY - PHP type: string runtime: description: "The runtime to use when executing code." type: string code: description: "The code to execute in the sandbox." type: string stdin: description: "Input to pass to the script via `stdin`." type: string args: description: "List of command line arguments to pass to the script." type: array items: type: string env: description: "Set of key-value pairs to add to the script's execution environment." type: object additionalProperties: type: string allow_http_hosts: description: "List of allowed hosts for HTTP requests" type: array items: type: string required: [code] ExecuteResponse: type: object properties: exit_code: description: "The exit code returned by the script. Will be `0` on success and non-zero on failure." type: integer format: int32 stdout: description: "The contents of `stdout` after executing the script." type: string stderr: description: "The contents of `stderr` after executing the script." type: string Status: type: object properties: code: type: integer description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. format: int32 message: type: string description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. description: "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)." tags: - name: Sandbox