syntax = "proto3";

option go_package = "v1";
option java_package = "io.stackrox.proto.api.v1";

import "google/api/annotations.proto";
import "api/v1/common.proto";
import "api/v1/empty.proto";
import "storage/cluster.proto";

package v1;

enum DeploymentFormat {
    KUBECTL = 0;
    HELM    = 1;
}

enum LoadBalancerType {
    NONE          = 0;
    LOAD_BALANCER = 1;
    NODE_PORT     = 2;
    ROUTE         = 3;
}

message ClusterResponse {
    storage.Cluster cluster            = 1;
}

message ClustersList {
    repeated storage.Cluster clusters = 1;
}

service ClustersService {

    rpc GetClusters (Empty) returns (ClustersList) {
        option (google.api.http) = {
            get: "/v1/clusters"
        };
    }

    rpc GetCluster (ResourceByID) returns (ClusterResponse) {
        option (google.api.http) = {
            get: "/v1/clusters/{id}"
        };
    }

    rpc PostCluster (storage.Cluster) returns (ClusterResponse) {
        option (google.api.http) = {
            post: "/v1/clusters"
            body: "*"
        };
    }

    rpc PutCluster (storage.Cluster) returns (ClusterResponse) {
        option (google.api.http) = {
            put: "/v1/clusters/{id}"
            body: "*"
        };
    }

    rpc DeleteCluster (ResourceByID) returns (Empty) {
        option (google.api.http) = {
            delete: "/v1/clusters/{id}"
        };
    }
}
