pcm-coordinator/adaptor/pcm_pod/idl/pod.proto

282 lines
6.3 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package pod;
option go_package = "/podpb";
// 云提供商
enum CloudProvider {
// 0 - 阿里云
ali = 0;
// 1 - 腾讯云
tencent = 1;
// 2 - 华为云
huawei = 2;
// 3 - K8S
k8s = 3;
// 3 - Harvester
harvester = 4;
}
message Region {
//id
int32 id = 1;
//name
string name = 2;
}
message PodInstance {
// 云类型
CloudProvider provider = 1;
// 账号名称
string account_name = 2;
//pcm id
string pcm_id = 3;
// 实例id
string pod_id = 4;
// 实例名称
string pod_name = 5;
// 地域ID
int32 region_id = 6;
// 地域Name
string region_name = 7;
// 镜像
string container_image = 8;
// 容器名称
string container_name = 9;
// vcpu数
string cpu_pod = 10;
// 内存MB
string memory_pod = 11;
//安全组ID 对应腾讯 SecurityGroupIds(腾讯必需)
string security_group_id = 12;
//子网ID 对应腾讯 SubnetId(腾讯必需)
string subnet_id = 13;
//VPC ID 对应腾讯 VpcId(腾讯必需)
string vpc_id = 14;
//名空间
string namespace = 15;
// 实例状态
string status = 16;
}
message CreatePodsReq {
// 创建请求集合
repeated CreatePodReq createPodReq = 1;
}
message CreatePodsResp {
// 查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询
bool finished = 2;
// 请求id出现问题后提供给云厂商排查问题
repeated string request_id = 3;
}
message CreatePodReq {
// 云类型
CloudProvider provider = 1;
// 账号名称
string account_name = 2;
// 实例id
string pod_id = 3;
// 实例名称
string pod_name = 4;
// 地域,数据中心
int32 region_id = 5;
// 镜像
string container_image = 6;
// 容器名称
string container_name = 7;
// v cpu数
string cpu_pod = 8;
// 内存MB
string memory_pod = 9;
//安全组ID 对应腾讯 SecurityGroupIds(腾讯必需)
string security_group_id = 10;
//子网ID 对应腾讯 SubnetId(腾讯必需)
string subnet_id = 11;
//VPC ID 对应腾讯 VpcId(腾讯必需)
string vpc_id = 12;
//名空间
string namespace = 13;
//请求源,如果是从pcm sdk 过来的则单独生成tenanters实体
string requestSource = 14;
}
message CreatePodResp {
// 查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询
bool finished = 1;
// 请求id出现问题后提供给云厂商排查问题
string request_id = 2;
// podId
string pod_id = 3;
// podName
string pod_name = 4;
}
message DeletePodReq {
// 云类型
CloudProvider provider = 1;
// 账号名称
string account_name = 2;
// pcm id
string pcm_id = 3;
// podId
string pod_id = 4;
// podName
string pod_name = 5;
//namespace
string namespace = 6;
// 地域,数据中心
int32 region_id = 7;
//请求源,如果是从pcm sdk 过来的则单独生成tenanters实体
string requestSource = 8;
}
message DeletePodResp {
// 删除是否完成
bool finished = 1;
// 请求id出现问题后提供给云厂商排查问题
string request_id = 2;
// podId
string pod_id = 3;
// podName
string pod_name = 4;
}
message UpdatePodReq {
// 云类型
CloudProvider provider = 1;
// 账号名称
string account_name = 2;
// pcm ID
string pcm_id = 3;
// podId
string pod_id = 4;
// podName
string pod_name = 5;
//namespace
string namespace = 6;
// 地域,数据中心
int32 region_id = 7;
// 镜像
string container_image = 8;
// 容器名称
string container_name = 9;
// v cpu数
string cpu_pod = 10;
// 内存MB
string memory_pod = 11;
// 重启策略
string restart_policy = 12;
// labels
string labels = 13;
//请求源,如果是从pcm sdk 过来的则单独生成tenanters实体
string requestSource = 14;
}
message UpdatePodResp {
// 更新是否完成
bool finished = 1;
// 请求id出现问题后提供给云厂商排查问题
string request_id = 2;
// podId
string pod_id = 3;
// podName
string pod_name = 4;
}
message ListPodDetailReq {
// 云名称
CloudProvider provider = 1;
// 账户名称根据config.yaml中的配置默认为第一个配置的账户
string account_name = 2;
// 区域Id参考 tenant.proto 中的各个云的区域
int32 region_id = 3;
// 区域名称各云厂商自定义的region name
int32 region_name = 4;
// podID
int32 pod_id = 5;
// 分页相关参数,页码
int32 page_number = 6;
// 分页相关参数,每页数量
int32 page_size = 7;
// 分页相关参数下一页的token
string next_token = 8;
// namespace
string namespace = 9;
}
message ListPodDetailResp {
// Pod集合
repeated PodInstance pods = 1;
// 查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询
bool finished = 2;
// 分页相关参数,页码
int32 page_number = 3;
// 分页相关参数,每页数量
int32 page_size = 4;
// 分页相关参数下一页的token
string next_token = 5;
// 请求id出现问题后提供给云厂商排查问题
string request_id = 6;
}
message ListPodReq {
// cloud name
CloudProvider provider = 1;
//命名空间
string namespace =2;
//请求源,如果是从pcm sdk 过来的则单独生成tenanters实体
string requestSource =3;
}
message ListPodResp {
// pod list
repeated PodInstance pods = 1;
}
message GetPodRegionReq {
// cloud name
CloudProvider provider = 1;
}
message GetPodRegionResp {
// region list
repeated Region regions = 1;
}
message ListPodAllReq{}
// Pod类产品接口
// 阿里云 - ECI
// 腾讯云 - TKS
// 华为云 - CCI
service PodService {
// 创建Pods
rpc CreatePods(CreatePodsReq) returns (CreatePodsResp);
// 创建Pod
rpc CreatePod(CreatePodReq) returns (CreatePodResp);
// 删除Pod
rpc DeletePod(DeletePodReq) returns (DeletePodResp);
// 更新Pod
rpc UpdatePod(UpdatePodReq) returns (UpdatePodResp);
// 查询Pod明细
rpc ListPodDetail(ListPodDetailReq) returns (ListPodDetailResp);
// 查询Pod全量 - 根据云类型
rpc ListPod(ListPodReq) returns (ListPodResp);
// 查询所有云的Pod
rpc ListPodAll(ListPodAllReq) returns (ListPodResp);
}