syntax = "proto3";

package docker_controler;


// DockerControlerService represents the querying service provided by docker controler.
service DockerControlerService {
    // Get all container names.
    rpc GetAllContainerNames(GetAllContainerNamesRequest) returns (GetAllContainerNamesResponse) {};

    // Start a container.
    rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {};

    // Stop a container.
    rpc StopContainer(StopContainerRequest) returns (StopContainerResponse) {};

    // Restart a container.
    rpc RestartContainer(RestartContainerRequest) returns (RestartContainerResponse) {};
}


// Request and Response of DockerControlerService.GetAllContainerNames.
message GetAllContainerNamesRequest {
}

message GetAllContainerNamesResponse {
    // List of names of containers existing on server.
    repeated string container_names = 1;
}

// Request and Response of DockerControlerService.StartContainer.
message StartContainerRequest {
    // Container name.
    string name = 1;
}

message StartContainerResponse {
    // Container status after request
    string container_status = 1;
}

// Request and Response of DockerControlerService.StopContainer.
message StopContainerRequest {
    // Container name.
    string name = 1;
}

message StopContainerResponse {
    // Container status after request
    string container_status = 1;
}

// Request and Response of DockerControlerService.RestartContainer.
message RestartContainerRequest {
    // Container name.
    string name = 1;
}

message RestartContainerResponse {
    // Container status after request
    string container_status = 1;
}

