Kibotos
API 参考kibotos.ctrl.v1

ProcessService

本页列出 kibotos.ctrl.v1 中 ProcessService 的方法及每个方法用到的消息与枚举,由 ctrl.proto 及其注释生成,注释保持英文。多个服务共用的消息与枚举见 kibotos.ctrl.v1 类型。

node 数据面在数据面会话的 endpoint 上调用,凭证放在 Authorization: Bearer。调用方式

ProcessService owns reconnectable pipe and PTY processes. Every call requires a data-plane bearer credential with PROCESS scope.

A caller whose stream broke can resume it: Attach with resume_from replays the output each channel produced since the given offset, as far as the guest's replay buffer reaches, and SendInput with input_offset can be sent again without writing any byte twice. The server announces both as workspace.process.resume.

Start

POST/kibotos.ctrl.v1.ProcessService/Start服务端流
请求StartRequest
  • argvrepeatedstring= 1
  • working_directory is the directory the process starts in. Empty starts it in the home directory of the identity user selects, and a relative one is resolved against that home.

  • environmentmap<string, string>= 3
  • mode 中的一个
  • userstring= 8

    user selects the identity the process runs as: empty for the Template default, the declared account name, or root.

响应流式StartResponse

ProcessPipeMode

ProcessPtyMode

Attach

POST/kibotos.ctrl.v1.ProcessService/Attach服务端流
请求AttachRequest
  • pidint32= 1
  • incarnationoptionaluint64= 2
  • resume_from replays, before live output, what each listed channel produced from offset on, as far as the replay buffer reaches. A channel not listed starts at its current offset. An offset beyond what the channel produced fails with INVALID_ARGUMENT and leaves the current subscription in place. A guest without replay starts every channel at its current offset.

响应流式AttachResponse

SendInput

POST/kibotos.ctrl.v1.ProcessService/SendInput一元调用
请求SendInputRequest
  • pidint32= 1
  • incarnationoptionaluint64= 2
  • databytes= 3
  • input_offsetoptionaluint64= 4

    input_offset is where data starts in the process's input. Bytes the process already accepted are skipped, so the request can be sent again; an offset beyond what it accepted fails with FAILED_PRECONDITION and writes nothing. A guest that cannot take input offsets fails the request with UNIMPLEMENTED.

响应SendInputResponse
  • input_offsetoptionaluint64= 2

    input_offset is the number of input bytes the process has accepted after this request. It is absent when the guest cannot take input offsets.

CloseStdin

POST/kibotos.ctrl.v1.ProcessService/CloseStdin一元调用
请求CloseStdinRequest
响应CloseStdinResponse

无字段。

SendSignal

POST/kibotos.ctrl.v1.ProcessService/SendSignal一元调用
请求SendSignalRequest
响应SendSignalResponse

无字段。

ProcessSignal

  • PROCESS_SIGNAL_UNSPECIFIED= 0
  • PROCESS_SIGNAL_SIGTERM= 1
  • PROCESS_SIGNAL_SIGKILL= 2

Resize

POST/kibotos.ctrl.v1.ProcessService/Resize一元调用
请求ResizeRequest
响应ResizeResponse

无字段。

消息与枚举

ProcessService 的多个方法用到以下消息与枚举。

ProcessChannelOffset

  • offsetuint64= 2

    offset is the number of bytes the process produced on this channel.

  • startoptionaluint64= 3

    start is where this subscription's output on the channel begins. It equals offset unless the attach resumed; then it is the requested offset or the replay buffer's first byte, whichever is later, so a start above the requested offset is a gap of that many bytes. Only set in attached.

ProcessAttachedEvent

ProcessOutputEvent

ProcessChannelResult

ProcessExitedEvent

ProcessHeartbeatEvent

此消息没有字段。

OutputStream

  • OUTPUT_STREAM_UNSPECIFIED= 0
  • OUTPUT_STREAM_STDOUT= 1
  • OUTPUT_STREAM_STDERR= 2
  • OUTPUT_STREAM_PTY= 3

ProcessMode

  • PROCESS_MODE_UNSPECIFIED= 0
  • PROCESS_MODE_PIPE= 1
  • PROCESS_MODE_PTY= 2

ProcessTerminationReason

  • PROCESS_TERMINATION_REASON_UNSPECIFIED= 0
  • PROCESS_TERMINATION_REASON_EXITED= 1
  • PROCESS_TERMINATION_REASON_SIGNALED= 2
  • PROCESS_TERMINATION_REASON_TIMED_OUT= 3

本页内容