mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
126 lines
3.3 KiB
Protocol Buffer
126 lines
3.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
|
|
option go_package = "github.com/psviderski/uncloud/internal/machine/api/pb";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "internal/machine/api/pb/common.proto";
|
|
|
|
service Docker {
|
|
rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse);
|
|
rpc InspectContainer(InspectContainerRequest) returns (InspectContainerResponse);
|
|
rpc StartContainer(StartContainerRequest) returns (google.protobuf.Empty);
|
|
rpc StopContainer(StopContainerRequest) returns (google.protobuf.Empty);
|
|
rpc ListContainers(ListContainersRequest) returns (ListContainersResponse);
|
|
rpc RemoveContainer(RemoveContainerRequest) returns (google.protobuf.Empty);
|
|
rpc PullImage(PullImageRequest) returns (stream JSONMessage);
|
|
rpc InspectImage(InspectImageRequest) returns (InspectImageResponse);
|
|
// InspectRemoteImage returns the image metadata for an image in a remote registry using the machine's
|
|
// Docker auth credentials if necessary.
|
|
rpc InspectRemoteImage(InspectRemoteImageRequest) returns (InspectRemoteImageResponse);
|
|
}
|
|
|
|
message CreateContainerRequest {
|
|
// JSON serialized container.Config.
|
|
bytes config = 1;
|
|
// JSON serialized container.HostConfig.
|
|
bytes host_config = 2;
|
|
// JSON serialized network.NetworkingConfig.
|
|
bytes network_config = 3;
|
|
// JSON serialized ocispec.Platform.
|
|
bytes platform = 4;
|
|
string name = 5;
|
|
}
|
|
|
|
message CreateContainerResponse {
|
|
// JSON serialized container.CreateResponse.
|
|
bytes response = 1;
|
|
}
|
|
|
|
message InspectContainerRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message InspectContainerResponse {
|
|
// JSON serialized container.InspectResponse.
|
|
bytes response = 1;
|
|
}
|
|
|
|
message StartContainerRequest {
|
|
string id = 1;
|
|
// JSON serialized container.StartOptions.
|
|
bytes options = 2;
|
|
}
|
|
|
|
message StopContainerRequest {
|
|
string id = 1;
|
|
// JSON serialized container.StopOptions.
|
|
bytes options = 2;
|
|
}
|
|
|
|
message ListContainersRequest {
|
|
// JSON serialized container.ListOptions.
|
|
bytes options = 1;
|
|
}
|
|
|
|
message ListContainersResponse {
|
|
// Must contain only one repeated messages field to allow broadcasting ListContainers requests to multiple machines.
|
|
repeated MachineContainers messages = 1;
|
|
}
|
|
|
|
message MachineContainers {
|
|
Metadata metadata = 1;
|
|
// JSON serialized []container.ContainerJSON.
|
|
bytes containers = 2;
|
|
}
|
|
|
|
message RemoveContainerRequest {
|
|
string id = 1;
|
|
// JSON serialized container.RemoveOptions.
|
|
bytes options = 2;
|
|
}
|
|
|
|
message PullImageRequest {
|
|
string image = 1;
|
|
// JSON serialized image.PullOptions.
|
|
bytes options = 2;
|
|
}
|
|
|
|
message JSONMessage {
|
|
// JSON serialized jsonmessage.JSONMessage.
|
|
bytes message = 1;
|
|
}
|
|
|
|
message InspectImageRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message InspectImageResponse {
|
|
// Must contain only one repeated messages field to allow broadcasting InspectImage requests to multiple machines.
|
|
repeated Image messages = 1;
|
|
}
|
|
|
|
message Image {
|
|
Metadata metadata = 1;
|
|
// JSON serialized types.ImageInspect.
|
|
bytes image = 2;
|
|
}
|
|
|
|
message InspectRemoteImageRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message InspectRemoteImageResponse {
|
|
// Must contain only one repeated messages field to allow broadcasting InspectRemoteImage requests to multiple machines.
|
|
repeated RemoteImage messages = 1;
|
|
}
|
|
|
|
message RemoteImage {
|
|
Metadata metadata = 1;
|
|
// Image reference in the canonical form with the digest.
|
|
string reference = 2;
|
|
// Raw JSON manifest from the registry.
|
|
bytes manifest = 3;
|
|
}
|