diff --git a/adaptor/pcm_pod/gen/idl/pod.pb.go b/adaptor/pcm_pod/gen/idl/pod.pb.go index e5ab3c98..0d0bf839 100644 --- a/adaptor/pcm_pod/gen/idl/pod.pb.go +++ b/adaptor/pcm_pod/gen/idl/pod.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: idl/pod.proto @@ -86,9 +86,9 @@ type Region struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id + //id Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name + //name Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } @@ -147,7 +147,7 @@ type PodInstance struct { Provider CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pod.CloudProvider" json:"provider,omitempty"` // 账号名称 AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` - // pcm id + //pcm id PcmId string `protobuf:"bytes,3,opt,name=pcm_id,json=pcmId,proto3" json:"pcm_id,omitempty"` // 实例id PodId string `protobuf:"bytes,4,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"` @@ -165,13 +165,13 @@ type PodInstance struct { CpuPod string `protobuf:"bytes,10,opt,name=cpu_pod,json=cpuPod,proto3" json:"cpu_pod,omitempty"` // 内存MB MemoryPod string `protobuf:"bytes,11,opt,name=memory_pod,json=memoryPod,proto3" json:"memory_pod,omitempty"` - // 安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) + //安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) SecurityGroupId string `protobuf:"bytes,12,opt,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` - // 子网ID 对应腾讯 SubnetId(腾讯必需) + //子网ID 对应腾讯 SubnetId(腾讯必需) SubnetId string `protobuf:"bytes,13,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // VPC ID 对应腾讯 VpcId(腾讯必需) + //VPC ID 对应腾讯 VpcId(腾讯必需) VpcId string `protobuf:"bytes,14,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // 名空间 + //名空间 Namespace string `protobuf:"bytes,15,opt,name=namespace,proto3" json:"namespace,omitempty"` // 实例状态 Status string `protobuf:"bytes,16,opt,name=status,proto3" json:"status,omitempty"` @@ -449,15 +449,15 @@ type CreatePodReq struct { CpuPod string `protobuf:"bytes,8,opt,name=cpu_pod,json=cpuPod,proto3" json:"cpu_pod,omitempty"` // 内存MB MemoryPod string `protobuf:"bytes,9,opt,name=memory_pod,json=memoryPod,proto3" json:"memory_pod,omitempty"` - // 安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) + //安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) SecurityGroupId string `protobuf:"bytes,10,opt,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` - // 子网ID 对应腾讯 SubnetId(腾讯必需) + //子网ID 对应腾讯 SubnetId(腾讯必需) SubnetId string `protobuf:"bytes,11,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // VPC ID 对应腾讯 VpcId(腾讯必需) + //VPC ID 对应腾讯 VpcId(腾讯必需) VpcId string `protobuf:"bytes,12,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // 名空间 + //名空间 Namespace string `protobuf:"bytes,13,opt,name=namespace,proto3" json:"namespace,omitempty"` - // 请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 + //请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 RequestSource string `protobuf:"bytes,14,opt,name=requestSource,proto3" json:"requestSource,omitempty"` } @@ -681,11 +681,11 @@ type DeletePodReq struct { PodId string `protobuf:"bytes,4,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"` // podName PodName string `protobuf:"bytes,5,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` - // namespace + //namespace Namespace string `protobuf:"bytes,6,opt,name=namespace,proto3" json:"namespace,omitempty"` // 地域,数据中心 RegionId int32 `protobuf:"varint,7,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - // 请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 + //请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 RequestSource string `protobuf:"bytes,8,opt,name=requestSource,proto3" json:"requestSource,omitempty"` } @@ -867,7 +867,7 @@ type UpdatePodReq struct { PodId string `protobuf:"bytes,4,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"` // podName PodName string `protobuf:"bytes,5,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` - // namespace + //namespace Namespace string `protobuf:"bytes,6,opt,name=namespace,proto3" json:"namespace,omitempty"` // 地域,数据中心 RegionId int32 `protobuf:"varint,7,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` @@ -883,7 +883,7 @@ type UpdatePodReq struct { RestartPolicy string `protobuf:"bytes,12,opt,name=restart_policy,json=restartPolicy,proto3" json:"restart_policy,omitempty"` // labels Labels string `protobuf:"bytes,13,opt,name=labels,proto3" json:"labels,omitempty"` - // 请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 + //请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 RequestSource string `protobuf:"bytes,14,opt,name=requestSource,proto3" json:"requestSource,omitempty"` } @@ -1312,9 +1312,9 @@ type ListPodReq struct { // cloud name Provider CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pod.CloudProvider" json:"provider,omitempty"` - // 命名空间 + //命名空间 Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - // 请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 + //请求源,如果是从pcm sdk 过来的,则单独生成tenanters实体 RequestSource string `protobuf:"bytes,3,opt,name=requestSource,proto3" json:"requestSource,omitempty"` } diff --git a/adaptor/pcm_pod/gen/openapiv2/idl/pod.swagger.json b/adaptor/pcm_pod/gen/openapiv2/idl/pod.swagger.json index 32cfc90d..8c71500b 100644 --- a/adaptor/pcm_pod/gen/openapiv2/idl/pod.swagger.json +++ b/adaptor/pcm_pod/gen/openapiv2/idl/pod.swagger.json @@ -34,7 +34,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/podCloudProvider" + "$ref": "#/definitions/podCloudProvider", + "title": "云类型" }, "accountName": { "type": "string", @@ -199,7 +200,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/podCloudProvider" + "$ref": "#/definitions/podCloudProvider", + "title": "云类型" }, "accountName": { "type": "string", @@ -288,11 +290,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/adaptor/pcm_slurm/gen/idl/slurm.pb.go b/adaptor/pcm_slurm/gen/idl/slurm.pb.go index 63b8f458..512486e0 100644 --- a/adaptor/pcm_slurm/gen/idl/slurm.pb.go +++ b/adaptor/pcm_slurm/gen/idl/slurm.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: idl/slurm.proto diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json index ebe0873c..7136d584 100644 --- a/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json @@ -20,11 +20,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/adaptor/pcm_vm/gen/idl/ecs.pb.go b/adaptor/pcm_vm/gen/idl/ecs.pb.go index 26c99766..002fb955 100644 --- a/adaptor/pcm_vm/gen/idl/ecs.pb.go +++ b/adaptor/pcm_vm/gen/idl/ecs.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: idl/ecs.proto @@ -85,9 +85,9 @@ func (CloudProvider) EnumDescriptor() ([]byte, []int) { type InternetChargeType int32 const ( - // 按固定带宽计费。 + //按固定带宽计费。 InternetChargeType_PayByBandwidth InternetChargeType = 0 - // (默认):按使用流量计费 + //(默认):按使用流量计费 InternetChargeType_PayByTraffic InternetChargeType = 1 ) @@ -134,11 +134,11 @@ func (InternetChargeType) EnumDescriptor() ([]byte, []int) { type ActionType int32 const ( - // 启动 + //启动 ActionType_start ActionType = 0 - // 停止 + //停止 ActionType_stop ActionType = 1 - // 重启 + //重启 ActionType_restart ActionType = 2 ) @@ -224,9 +224,9 @@ type EcsInstance struct { // 收费类型 InstanceChargeType string `protobuf:"bytes,17,opt,name=instance_charge_type,json=instanceChargeType,proto3" json:"instance_charge_type,omitempty"` // -----------harvester--------- - // 虚拟机所在的节点 + //虚拟机所在的节点 Node string `protobuf:"bytes,18,opt,name=node,proto3" json:"node,omitempty"` - // namespace + //namespace Namespace string `protobuf:"bytes,20,opt,name=namespace,proto3" json:"namespace,omitempty"` } @@ -513,76 +513,76 @@ type CreateEcsReq struct { AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 地域,数据中心 RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - // 镜像id + //镜像id ImageId string `protobuf:"bytes,4,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` // 实例的付费方式 InstanceChargeType string `protobuf:"bytes,5,opt,name=instance_charge_type,json=instanceChargeType,proto3" json:"instance_charge_type,omitempty"` - // 实例的资源规格 + //实例的资源规格 InstanceType string `protobuf:"bytes,6,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"` // 安全组id SecurityGroupId string `protobuf:"bytes,7,opt,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` - // 交换机id + //交换机id VSwitchId string `protobuf:"bytes,8,opt,name=v_switch_id,json=vSwitchId,proto3" json:"v_switch_id,omitempty"` - // 实例名称 + //实例名称 InstanceName string `protobuf:"bytes,9,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - // 实例描述 + //实例描述 Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"` - // 可用区id + //可用区id ZoneId string `protobuf:"bytes,11,opt,name=zone_id,json=zoneId,proto3" json:"zone_id,omitempty"` - // 系统磁盘 + //系统磁盘 SystemDisk *SystemDisk `protobuf:"bytes,12,opt,name=system_disk,json=systemDisk,proto3" json:"system_disk,omitempty"` - // 创建ECS的数量 + //创建ECS的数量 Amount int32 `protobuf:"varint,13,opt,name=amount,proto3" json:"amount,omitempty"` - // 预检此次请求,为true时请求通过,则返回 Request validation has been passed with DryRun flag set + //预检此次请求,为true时请求通过,则返回 Request validation has been passed with DryRun flag set DryRun string `protobuf:"bytes,14,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` - // 数据盘N的云盘种类。取值范围:cloud_efficiency:高效云盘;cloud_ssd:SSD云盘;cloud_essd:ESSD云盘;cloud:普通云盘。 + //数据盘N的云盘种类。取值范围:cloud_efficiency:高效云盘;cloud_ssd:SSD云盘;cloud_essd:ESSD云盘;cloud:普通云盘。 Category string `protobuf:"bytes,15,opt,name=category,proto3" json:"category,omitempty"` - // 网络计费类型。取值范围:PayByBandwidth:按固定带宽计费。PayByTraffic(默认):按使用流量计费 + //网络计费类型。取值范围:PayByBandwidth:按固定带宽计费。PayByTraffic(默认):按使用流量计费 InternetChargeType InternetChargeType `protobuf:"varint,16,opt,name=internet_charge_type,json=internetChargeType,proto3,enum=ecs.InternetChargeType" json:"internet_charge_type,omitempty"` - // 公网入带宽最大值,单位为Mbit/s。创建的实例如果参数InternetMaxBandwidthOut的值大于0,则自动为实例分配公网IP。 + //公网入带宽最大值,单位为Mbit/s。创建的实例如果参数InternetMaxBandwidthOut的值大于0,则自动为实例分配公网IP。 InternetMaxBandwidthOut int32 `protobuf:"varint,17,opt,name=internet_max_bandwidth_out,json=internetMaxBandwidthOut,proto3" json:"internet_max_bandwidth_out,omitempty"` // vpc id 华为云必需 VpcId string `protobuf:"bytes,18,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // 待创建云服务器所在的子网信息。需要指定vpcid对应VPC下已创建的子网(subnet)的网络ID,UUID格式。华为云必需 + //待创建云服务器所在的子网信息。需要指定vpcid对应VPC下已创建的子网(subnet)的网络ID,UUID格式。华为云必需 SubnetId string `protobuf:"bytes,19,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // -------------harvester--------------- - // 命名空间 + //-------------harvester--------------- + //命名空间 Namespace string `protobuf:"bytes,20,opt,name=namespace,proto3" json:"namespace,omitempty"` - // vCpu + //vCpu Cpu int32 `protobuf:"varint,21,opt,name=cpu,proto3" json:"cpu,omitempty"` - // memory + //memory Memory string `protobuf:"bytes,22,opt,name=memory,proto3" json:"memory,omitempty"` - // ssh_key + //ssh_key SshKey string `protobuf:"bytes,23,opt,name=ssh_key,json=sshKey,proto3" json:"ssh_key,omitempty"` - // diskName + //diskName DiskName string `protobuf:"bytes,24,opt,name=disk_name,json=diskName,proto3" json:"disk_name,omitempty"` - // disk类型 disk,cd-rom + //disk类型 disk,cd-rom DiskType string `protobuf:"bytes,25,opt,name=disk_type,json=diskType,proto3" json:"disk_type,omitempty"` - // 卷大小 + //卷大小 DiskSize string `protobuf:"bytes,26,opt,name=disk_size,json=diskSize,proto3" json:"disk_size,omitempty"` - // bus 总线指示要模拟的磁盘设备的类型,支持virtio, sata, scsi. + //bus 总线指示要模拟的磁盘设备的类型,支持virtio, sata, scsi. Bus string `protobuf:"bytes,27,opt,name=bus,proto3" json:"bus,omitempty"` - // 网络名称 + //网络名称 NetworkName string `protobuf:"bytes,28,opt,name=network_name,json=networkName,proto3" json:"network_name,omitempty"` - // network_model 网络模式,支持e1000, e1000e, ne2k_pci, pcnet, rtl8139, virtio. + //network_model 网络模式,支持e1000, e1000e, ne2k_pci, pcnet, rtl8139, virtio. NetworkModel string `protobuf:"bytes,29,opt,name=network_model,json=networkModel,proto3" json:"network_model,omitempty"` - // 网络 + //网络 Network string `protobuf:"bytes,30,opt,name=network,proto3" json:"network,omitempty"` - // 网络连接方法,默认bridge + //网络连接方法,默认bridge NetworkType string `protobuf:"bytes,31,opt,name=network_type,json=networkType,proto3" json:"network_type,omitempty"` - // osType //系统类型 + //osType //系统类型 OsType string `protobuf:"bytes,32,opt,name=os_type,json=osType,proto3" json:"os_type,omitempty"` - // machineType //机器类型 none、q35、pc + //machineType //机器类型 none、q35、pc MachineType string `protobuf:"bytes,33,opt,name=machine_type,json=machineType,proto3" json:"machine_type,omitempty"` - // machineName //主机名称,默认为虚拟机名称 + //machineName //主机名称,默认为虚拟机名称 MachineName string `protobuf:"bytes,34,opt,name=machine_name,json=machineName,proto3" json:"machine_name,omitempty"` - // userDataTemplate //用户数据模板 + //userDataTemplate //用户数据模板 UserDataTemplate string `protobuf:"bytes,35,opt,name=user_data_template,json=userDataTemplate,proto3" json:"user_data_template,omitempty"` - // networkDataTemplate //网络数据模板 + //networkDataTemplate //网络数据模板 NetworkDataTemplate string `protobuf:"bytes,36,opt,name=network_data_template,json=networkDataTemplate,proto3" json:"network_data_template,omitempty"` - // vmTemplateName //模板名称 + //vmTemplateName //模板名称 VmTemplateName string `protobuf:"bytes,37,opt,name=vm_template_name,json=vmTemplateName,proto3" json:"vm_template_name,omitempty"` - // vmTemplateVersion //版本号 + //vmTemplateVersion //版本号 VmTemplateVersion string `protobuf:"bytes,38,opt,name=vm_template_version,json=vmTemplateVersion,proto3" json:"vm_template_version,omitempty"` } @@ -890,17 +890,17 @@ type SystemDisk struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // 系统盘大小,单位为GiB。取值范围:20~500。该参数的取值必须大于或者等于max{20, ImageSize}。默认值:max{40, 参数ImageId对应的镜像大小} + //系统盘大小,单位为GiB。取值范围:20~500。该参数的取值必须大于或者等于max{20, ImageSize}。默认值:max{40, 参数ImageId对应的镜像大小} Size string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` - // 系统盘类型。系统盘的云盘种类。取值范围:cloud_efficiency:高效云盘。cloud_ssd:SSD云盘。cloud_essd:ESSD云盘。cloud:普通云盘。 + //系统盘类型。系统盘的云盘种类。取值范围:cloud_efficiency:高效云盘。cloud_ssd:SSD云盘。cloud_essd:ESSD云盘。cloud:普通云盘。 Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` - // 系统盘名称 + //系统盘名称 DiskName string `protobuf:"bytes,3,opt,name=disk_name,json=diskName,proto3" json:"disk_name,omitempty"` - // 系统盘描述 + //系统盘描述 Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // 创建ESSD云盘作为系统盘使用时,设置云盘的性能等级。取值范围:PL0:单盘最高随机读写IOPS 1万。PL1(默认):单盘最高随机读写IOPS 5万。PL2:单盘最高随机读写IOPS 10万。PL3:单盘最高随机读写IOPS 100万。 + //创建ESSD云盘作为系统盘使用时,设置云盘的性能等级。取值范围:PL0:单盘最高随机读写IOPS 1万。PL1(默认):单盘最高随机读写IOPS 5万。PL2:单盘最高随机读写IOPS 10万。PL3:单盘最高随机读写IOPS 100万。 PerformanceLevel string `protobuf:"bytes,5,opt,name=performance_level,json=performanceLevel,proto3" json:"performance_level,omitempty"` - // 系统盘采用的自动快照策略ID。 + //系统盘采用的自动快照策略ID。 AutoSnapshotPolicyId string `protobuf:"bytes,6,opt,name=auto_snapshot_policy_id,json=autoSnapshotPolicyId,proto3" json:"auto_snapshot_policy_id,omitempty"` } @@ -996,7 +996,7 @@ type CreateEcsResp struct { OrderId string `protobuf:"bytes,5,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` // 订单成交价 TradePrice float32 `protobuf:"fixed32,6,opt,name=trade_price,json=tradePrice,proto3" json:"trade_price,omitempty"` - // 实例ID(InstanceIdSet)列表 + //实例ID(InstanceIdSet)列表 InstanceIdSets []string `protobuf:"bytes,7,rep,name=instance_id_sets,json=instanceIdSets,proto3" json:"instance_id_sets,omitempty"` // 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询 Finished bool `protobuf:"varint,8,opt,name=finished,proto3" json:"finished,omitempty"` @@ -1102,28 +1102,28 @@ type DeleteEcsReq struct { AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 地域,数据中心 RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - // 是否只预检此次请求是否只预检此次请求。true:发送检查请求,不会查询资源状况。检查项包括AccessKey是否有效、RAM用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DRYRUN.SUCCESS。 - // false(默认值):发送正常请求,通过检查后返回2XX HTTP状态码并直接查询资源状况。 + //是否只预检此次请求是否只预检此次请求。true:发送检查请求,不会查询资源状况。检查项包括AccessKey是否有效、RAM用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DRYRUN.SUCCESS。 + //false(默认值):发送正常请求,通过检查后返回2XX HTTP状态码并直接查询资源状况。 DryRun string `protobuf:"bytes,4,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` - // Force是否强制释放**运行中**;true:强制释放运行中(Running)的实例。强制释放相当于断电,实例内存以及存储中的临时数据都会被擦除,无法恢复。 - // false(默认值):正常释放实例,此时实例必须处于已停止(Stopped)状态 + //Force是否强制释放**运行中**;true:强制释放运行中(Running)的实例。强制释放相当于断电,实例内存以及存储中的临时数据都会被擦除,无法恢复。 + //false(默认值):正常释放实例,此时实例必须处于已停止(Stopped)状态 Force string `protobuf:"bytes,5,opt,name=force,proto3" json:"force,omitempty"` - // 是否释放已到期的包年包月实例 true,false + //是否释放已到期的包年包月实例 true,false TerminateSubscription string `protobuf:"bytes,6,opt,name=terminate_subscription,json=terminateSubscription,proto3" json:"terminate_subscription,omitempty"` - // 实例ID数组以”,“分割。列:i-8vb2nlubkow0fxbq2218,i-8vb2nlubkow0fxbq2216 + //实例ID数组以”,“分割。列:i-8vb2nlubkow0fxbq2218,i-8vb2nlubkow0fxbq2216 InstanceIds string `protobuf:"bytes,7,opt,name=instance_ids,json=instanceIds,proto3" json:"instance_ids,omitempty"` - // 配置删除云服务器是否删除云服务器绑定的弹性IP。如果选择不删除,则系统仅做解绑定操作,保留弹性IP资源。 - // 取值为true或false。默认false;华为云 + //配置删除云服务器是否删除云服务器绑定的弹性IP。如果选择不删除,则系统仅做解绑定操作,保留弹性IP资源。 + //取值为true或false。默认false;华为云 DeletePublicip string `protobuf:"bytes,8,opt,name=delete_publicip,json=deletePublicip,proto3" json:"delete_publicip,omitempty"` - // 配置删除云服务器是否删除云服务器对应的数据盘,如果选择不删除,则系统仅做卸载操作,保留云硬盘资源。默认为false。 - // 取值为true或false。默认false;华为云 + //配置删除云服务器是否删除云服务器对应的数据盘,如果选择不删除,则系统仅做卸载操作,保留云硬盘资源。默认为false。 + //取值为true或false。默认false;华为云 DeleteVolume string `protobuf:"bytes,9,opt,name=delete_volume,json=deleteVolume,proto3" json:"delete_volume,omitempty"` - // ----------------harvester---------------- - // 虚拟机名称 + //----------------harvester---------------- + //虚拟机名称 InstanceName string `protobuf:"bytes,10,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - // namespace + //namespace Namespace string `protobuf:"bytes,11,opt,name=namespace,proto3" json:"namespace,omitempty"` - // diskName,以“,” 分割 + //diskName,以“,” 分割 DiskName string `protobuf:"bytes,12,opt,name=disk_name,json=diskName,proto3" json:"disk_name,omitempty"` } @@ -1331,26 +1331,26 @@ type UpdateEcsReq struct { AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 地域,数据中心 RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - // 实例id + //实例id InstanceIds string `protobuf:"bytes,4,opt,name=instance_ids,json=instanceIds,proto3" json:"instance_ids,omitempty"` // 实例状态不能为启动中(Starting)。重启实例后,重置生效,且必须是在ECS控制台重启或者调用API RebootInstance重启,新密码才能生效。在操作系统内部重启不能生效。 Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - // 操作系统的主机名 + //操作系统的主机名 HostName string `protobuf:"bytes,6,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"` - // 实例名称 + //实例名称 InstanceName string `protobuf:"bytes,7,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - // 实例描述 + //实例描述 Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` - // 实例重新加入的安全组列表,安全组ID不能重复。以”,“分割 + //实例重新加入的安全组列表,安全组ID不能重复。以”,“分割 SecurityGroupIds string `protobuf:"bytes,9,opt,name=security_group_ids,json=securityGroupIds,proto3" json:"security_group_ids,omitempty"` - // ---------------harvester----------------- - // namespace + //---------------harvester----------------- + //namespace Namespace string `protobuf:"bytes,10,opt,name=namespace,proto3" json:"namespace,omitempty"` - // cpu + //cpu Cpu string `protobuf:"bytes,11,opt,name=cpu,proto3" json:"cpu,omitempty"` - // memory + //memory Memory string `protobuf:"bytes,12,opt,name=memory,proto3" json:"memory,omitempty"` - // 修改配置后是否重启 + //修改配置后是否重启 IsRestart bool `protobuf:"varint,13,opt,name=is_restart,json=isRestart,proto3" json:"is_restart,omitempty"` } @@ -1571,8 +1571,8 @@ type ListDetailReq struct { PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 分页相关参数,下一页的token NextToken string `protobuf:"bytes,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` - // --------harvester--------- - // namespace + //--------harvester--------- + //namespace Namespace string `protobuf:"bytes,7,opt,name=namespace,proto3" json:"namespace,omitempty"` } @@ -1762,11 +1762,11 @@ type ActionReq struct { AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 区域Id,参考 tenant.proto 中的各个云的区域 RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - // 命名空间 + //命名空间 Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` - // 虚拟机名称 + //虚拟机名称 VmName string `protobuf:"bytes,5,opt,name=vm_name,json=vmName,proto3" json:"vm_name,omitempty"` - // 虚拟机操作状态 + //虚拟机操作状态 ActionType ActionType `protobuf:"varint,6,opt,name=action_type,json=actionType,proto3,enum=ecs.ActionType" json:"action_type,omitempty"` } @@ -1857,7 +1857,7 @@ type ActionResp struct { Ecses []*EcsInstance `protobuf:"bytes,3,rep,name=ecses,proto3" json:"ecses,omitempty"` // 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询 Finished bool `protobuf:"varint,4,opt,name=finished,proto3" json:"finished,omitempty"` - // vm状态 + //vm状态 Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` } @@ -2062,6 +2062,249 @@ func (*ListAllReq) Descriptor() ([]byte, []int) { return file_idl_ecs_proto_rawDescGZIP(), []int{16} } +type ListImagesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=ecs.CloudProvider" json:"provider,omitempty"` + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // 区域Id,参考 tenant.proto 中的各个云的区域 + RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + //命名空间 + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + // 分页相关参数,页码 + PageNumber int32 `protobuf:"varint,5,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // 分页相关参数,每页数量 + PageSize int32 `protobuf:"varint,6,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListImagesReq) Reset() { + *x = ListImagesReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_ecs_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListImagesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListImagesReq) ProtoMessage() {} + +func (x *ListImagesReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_ecs_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListImagesReq.ProtoReflect.Descriptor instead. +func (*ListImagesReq) Descriptor() ([]byte, []int) { + return file_idl_ecs_proto_rawDescGZIP(), []int{17} +} + +func (x *ListImagesReq) GetProvider() CloudProvider { + if x != nil { + return x.Provider + } + return CloudProvider_ali +} + +func (x *ListImagesReq) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *ListImagesReq) GetRegionId() int32 { + if x != nil { + return x.RegionId + } + return 0 +} + +func (x *ListImagesReq) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListImagesReq) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListImagesReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type Image struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=ecs.CloudProvider" json:"provider,omitempty"` + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + //镜像状态 + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + //镜像名称 + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + //命名空间 + Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` + //镜像id + Id string `protobuf:"bytes,6,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *Image) Reset() { + *x = Image{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_ecs_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Image) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Image) ProtoMessage() {} + +func (x *Image) ProtoReflect() protoreflect.Message { + mi := &file_idl_ecs_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Image.ProtoReflect.Descriptor instead. +func (*Image) Descriptor() ([]byte, []int) { + return file_idl_ecs_proto_rawDescGZIP(), []int{18} +} + +func (x *Image) GetProvider() CloudProvider { + if x != nil { + return x.Provider + } + return CloudProvider_ali +} + +func (x *Image) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *Image) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Image) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Image) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Image) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ListImagesResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=ecs.CloudProvider" json:"provider,omitempty"` + // 镜像集合 + Images []*Image `protobuf:"bytes,2,rep,name=images,proto3" json:"images,omitempty"` +} + +func (x *ListImagesResp) Reset() { + *x = ListImagesResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_ecs_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListImagesResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListImagesResp) ProtoMessage() {} + +func (x *ListImagesResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_ecs_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListImagesResp.ProtoReflect.Descriptor instead. +func (*ListImagesResp) Descriptor() ([]byte, []int) { + return file_idl_ecs_proto_rawDescGZIP(), []int{19} +} + +func (x *ListImagesResp) GetProvider() CloudProvider { + if x != nil { + return x.Provider + } + return CloudProvider_ali +} + +func (x *ListImagesResp) GetImages() []*Image { + if x != nil { + return x.Images + } + return nil +} + var File_idl_ecs_proto protoreflect.FileDescriptor var file_idl_ecs_proto_rawDesc = []byte{ @@ -2371,47 +2614,83 @@ var file_idl_ecs_proto_rawDesc = []byte{ 0x05, 0x65, 0x63, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x45, 0x63, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x65, 0x63, 0x73, 0x65, 0x73, 0x22, 0x0c, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, - 0x52, 0x65, 0x71, 0x2a, 0x49, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x61, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x75, - 0x61, 0x77, 0x65, 0x69, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x6b, 0x38, 0x73, 0x10, 0x03, 0x12, - 0x0d, 0x0a, 0x09, 0x68, 0x61, 0x72, 0x76, 0x65, 0x73, 0x74, 0x65, 0x72, 0x10, 0x04, 0x2a, 0x3a, - 0x0a, 0x12, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x42, 0x79, 0x42, 0x61, 0x6e, - 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x61, 0x79, 0x42, - 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x10, 0x01, 0x2a, 0x2e, 0x0a, 0x0a, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x10, 0x01, 0x12, 0x0b, 0x0a, - 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x10, 0x02, 0x32, 0xb2, 0x03, 0x0a, 0x0a, 0x45, - 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x63, 0x73, 0x12, 0x19, - 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x65, 0x63, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, - 0x63, 0x73, 0x12, 0x11, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, - 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x45, 0x63, 0x73, 0x12, 0x11, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, - 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x12, 0x11, 0x2e, 0x65, 0x63, 0x73, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, - 0x65, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x38, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, 0x44, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x12, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x07, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, 0x12, 0x0c, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, 0x41, 0x6c, - 0x6c, 0x12, 0x0f, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x2c, 0x0a, 0x09, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x63, 0x73, 0x12, 0x0e, - 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0f, - 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, - 0x08, 0x5a, 0x06, 0x2f, 0x65, 0x63, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x52, 0x65, 0x71, 0x22, 0xdb, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x2e, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, + 0x65, 0x22, 0xc3, 0x01, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, + 0x65, 0x63, 0x73, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x64, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x63, + 0x73, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x06, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x65, 0x63, 0x73, 0x2e, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2a, 0x49, 0x0a, + 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x07, + 0x0a, 0x03, 0x61, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x63, 0x65, + 0x6e, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x10, 0x02, + 0x12, 0x07, 0x0a, 0x03, 0x6b, 0x38, 0x73, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x68, 0x61, 0x72, + 0x76, 0x65, 0x73, 0x74, 0x65, 0x72, 0x10, 0x04, 0x2a, 0x3a, 0x0a, 0x12, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x42, 0x79, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x61, 0x79, 0x42, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x63, 0x10, 0x01, 0x2a, 0x2e, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x73, 0x74, 0x6f, 0x70, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x10, 0x02, 0x32, 0xec, 0x03, 0x0a, 0x0a, 0x45, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x63, 0x73, 0x12, 0x19, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x45, 0x63, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x32, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x12, 0x11, 0x2e, 0x65, + 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x63, 0x73, + 0x12, 0x11, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x45, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x45, 0x63, 0x73, 0x12, 0x11, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x45, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x0d, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x2e, 0x65, + 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, + 0x1a, 0x13, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, + 0x12, 0x0c, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, + 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, + 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x63, 0x73, 0x41, 0x6c, 0x6c, 0x12, 0x0f, 0x2e, 0x65, 0x63, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x65, + 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x09, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x63, 0x73, 0x12, 0x0e, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x0d, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x63, 0x73, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, 0x2e, 0x65, 0x63, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x13, + 0x2e, 0x65, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x65, 0x63, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2427,7 +2706,7 @@ func file_idl_ecs_proto_rawDescGZIP() []byte { } var file_idl_ecs_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_idl_ecs_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_idl_ecs_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_idl_ecs_proto_goTypes = []interface{}{ (CloudProvider)(0), // 0: ecs.CloudProvider (InternetChargeType)(0), // 1: ecs.InternetChargeType @@ -2449,6 +2728,9 @@ var file_idl_ecs_proto_goTypes = []interface{}{ (*ListReq)(nil), // 17: ecs.ListReq (*ListResp)(nil), // 18: ecs.ListResp (*ListAllReq)(nil), // 19: ecs.ListAllReq + (*ListImagesReq)(nil), // 20: ecs.ListImagesReq + (*Image)(nil), // 21: ecs.Image + (*ListImagesResp)(nil), // 22: ecs.ListImagesResp } var file_idl_ecs_proto_depIdxs = []int32{ 0, // 0: ecs.EcsInstance.provider:type_name -> ecs.CloudProvider @@ -2469,27 +2751,33 @@ var file_idl_ecs_proto_depIdxs = []int32{ 3, // 15: ecs.ActionResp.ecses:type_name -> ecs.EcsInstance 0, // 16: ecs.ListReq.provider:type_name -> ecs.CloudProvider 3, // 17: ecs.ListResp.ecses:type_name -> ecs.EcsInstance - 4, // 18: ecs.EcsService.CreateMultipleEcs:input_type -> ecs.CreateEcsMultipleReq - 6, // 19: ecs.EcsService.CreateEcs:input_type -> ecs.CreateEcsReq - 9, // 20: ecs.EcsService.DeleteEcs:input_type -> ecs.DeleteEcsReq - 11, // 21: ecs.EcsService.UpdateEcs:input_type -> ecs.UpdateEcsReq - 13, // 22: ecs.EcsService.ListEcsDetail:input_type -> ecs.ListDetailReq - 17, // 23: ecs.EcsService.ListEcs:input_type -> ecs.ListReq - 19, // 24: ecs.EcsService.ListEcsAll:input_type -> ecs.ListAllReq - 15, // 25: ecs.EcsService.ActionEcs:input_type -> ecs.ActionReq - 5, // 26: ecs.EcsService.CreateMultipleEcs:output_type -> ecs.CreateEcsMultipleResp - 8, // 27: ecs.EcsService.CreateEcs:output_type -> ecs.CreateEcsResp - 10, // 28: ecs.EcsService.DeleteEcs:output_type -> ecs.DeleteEcsResp - 12, // 29: ecs.EcsService.UpdateEcs:output_type -> ecs.UpdateEcsResp - 14, // 30: ecs.EcsService.ListEcsDetail:output_type -> ecs.ListDetailResp - 18, // 31: ecs.EcsService.ListEcs:output_type -> ecs.ListResp - 18, // 32: ecs.EcsService.ListEcsAll:output_type -> ecs.ListResp - 16, // 33: ecs.EcsService.ActionEcs:output_type -> ecs.ActionResp - 26, // [26:34] is the sub-list for method output_type - 18, // [18:26] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 0, // 18: ecs.ListImagesReq.provider:type_name -> ecs.CloudProvider + 0, // 19: ecs.Image.provider:type_name -> ecs.CloudProvider + 0, // 20: ecs.ListImagesResp.provider:type_name -> ecs.CloudProvider + 21, // 21: ecs.ListImagesResp.images:type_name -> ecs.Image + 4, // 22: ecs.EcsService.CreateMultipleEcs:input_type -> ecs.CreateEcsMultipleReq + 6, // 23: ecs.EcsService.CreateEcs:input_type -> ecs.CreateEcsReq + 9, // 24: ecs.EcsService.DeleteEcs:input_type -> ecs.DeleteEcsReq + 11, // 25: ecs.EcsService.UpdateEcs:input_type -> ecs.UpdateEcsReq + 13, // 26: ecs.EcsService.ListEcsDetail:input_type -> ecs.ListDetailReq + 17, // 27: ecs.EcsService.ListEcs:input_type -> ecs.ListReq + 19, // 28: ecs.EcsService.ListEcsAll:input_type -> ecs.ListAllReq + 15, // 29: ecs.EcsService.ActionEcs:input_type -> ecs.ActionReq + 20, // 30: ecs.EcsService.ListEcsImages:input_type -> ecs.ListImagesReq + 5, // 31: ecs.EcsService.CreateMultipleEcs:output_type -> ecs.CreateEcsMultipleResp + 8, // 32: ecs.EcsService.CreateEcs:output_type -> ecs.CreateEcsResp + 10, // 33: ecs.EcsService.DeleteEcs:output_type -> ecs.DeleteEcsResp + 12, // 34: ecs.EcsService.UpdateEcs:output_type -> ecs.UpdateEcsResp + 14, // 35: ecs.EcsService.ListEcsDetail:output_type -> ecs.ListDetailResp + 18, // 36: ecs.EcsService.ListEcs:output_type -> ecs.ListResp + 18, // 37: ecs.EcsService.ListEcsAll:output_type -> ecs.ListResp + 16, // 38: ecs.EcsService.ActionEcs:output_type -> ecs.ActionResp + 22, // 39: ecs.EcsService.ListEcsImages:output_type -> ecs.ListImagesResp + 31, // [31:40] is the sub-list for method output_type + 22, // [22:31] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_idl_ecs_proto_init() } @@ -2702,6 +2990,42 @@ func file_idl_ecs_proto_init() { return nil } } + file_idl_ecs_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListImagesReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_ecs_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Image); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_ecs_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListImagesResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2709,7 +3033,7 @@ func file_idl_ecs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_idl_ecs_proto_rawDesc, NumEnums: 3, - NumMessages: 17, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/adaptor/pcm_vm/gen/idl/ecs.pb.gw.go b/adaptor/pcm_vm/gen/idl/ecs.pb.gw.go index 960a9c28..d430673a 100644 --- a/adaptor/pcm_vm/gen/idl/ecs.pb.gw.go +++ b/adaptor/pcm_vm/gen/idl/ecs.pb.gw.go @@ -291,6 +291,42 @@ func local_request_EcsService_ActionEcs_0(ctx context.Context, marshaler runtime } +var ( + filter_EcsService_ListEcsImages_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_EcsService_ListEcsImages_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListImagesReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcsImages_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListEcsImages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_EcsService_ListEcsImages_0(ctx context.Context, marshaler runtime.Marshaler, server EcsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListImagesReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcsImages_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListEcsImages(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterEcsServiceHandlerServer registers the http handlers for service EcsService to "mux". // UnaryRPC :call EcsServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -497,6 +533,31 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, }) + mux.Handle("GET", pattern_EcsService_ListEcsImages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ecs.EcsService/ListEcsImages", runtime.WithHTTPPathPattern("/apis/ecs/listImages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_EcsService_ListEcsImages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_EcsService_ListEcsImages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -714,6 +775,28 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, }) + mux.Handle("GET", pattern_EcsService_ListEcsImages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ecs.EcsService/ListEcsImages", runtime.WithHTTPPathPattern("/apis/ecs/listImages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EcsService_ListEcsImages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_EcsService_ListEcsImages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -733,6 +816,8 @@ var ( pattern_EcsService_ListEcsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "all"}, "")) pattern_EcsService_ActionEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "action"}, "")) + + pattern_EcsService_ListEcsImages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "listImages"}, "")) ) var ( @@ -751,4 +836,6 @@ var ( forward_EcsService_ListEcsAll_0 = runtime.ForwardResponseMessage forward_EcsService_ActionEcs_0 = runtime.ForwardResponseMessage + + forward_EcsService_ListEcsImages_0 = runtime.ForwardResponseMessage ) diff --git a/adaptor/pcm_vm/gen/idl/ecs_grpc.pb.go b/adaptor/pcm_vm/gen/idl/ecs_grpc.pb.go index 345d92da..a4fe2f23 100644 --- a/adaptor/pcm_vm/gen/idl/ecs_grpc.pb.go +++ b/adaptor/pcm_vm/gen/idl/ecs_grpc.pb.go @@ -36,8 +36,10 @@ type EcsServiceClient interface { ListEcs(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error) // 查询所有云的ECS ListEcsAll(ctx context.Context, in *ListAllReq, opts ...grpc.CallOption) (*ListResp, error) - // 操作ecs(start-stop-restart) + //操作ecs(start-stop-restart) ActionEcs(ctx context.Context, in *ActionReq, opts ...grpc.CallOption) (*ActionResp, error) + //查询ecs镜像 + ListEcsImages(ctx context.Context, in *ListImagesReq, opts ...grpc.CallOption) (*ListImagesResp, error) } type ecsServiceClient struct { @@ -120,6 +122,15 @@ func (c *ecsServiceClient) ActionEcs(ctx context.Context, in *ActionReq, opts .. return out, nil } +func (c *ecsServiceClient) ListEcsImages(ctx context.Context, in *ListImagesReq, opts ...grpc.CallOption) (*ListImagesResp, error) { + out := new(ListImagesResp) + err := c.cc.Invoke(ctx, "/ecs.EcsService/ListEcsImages", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // EcsServiceServer is the server API for EcsService service. // All implementations must embed UnimplementedEcsServiceServer // for forward compatibility @@ -138,8 +149,10 @@ type EcsServiceServer interface { ListEcs(context.Context, *ListReq) (*ListResp, error) // 查询所有云的ECS ListEcsAll(context.Context, *ListAllReq) (*ListResp, error) - // 操作ecs(start-stop-restart) + //操作ecs(start-stop-restart) ActionEcs(context.Context, *ActionReq) (*ActionResp, error) + //查询ecs镜像 + ListEcsImages(context.Context, *ListImagesReq) (*ListImagesResp, error) mustEmbedUnimplementedEcsServiceServer() } @@ -171,6 +184,9 @@ func (UnimplementedEcsServiceServer) ListEcsAll(context.Context, *ListAllReq) (* func (UnimplementedEcsServiceServer) ActionEcs(context.Context, *ActionReq) (*ActionResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ActionEcs not implemented") } +func (UnimplementedEcsServiceServer) ListEcsImages(context.Context, *ListImagesReq) (*ListImagesResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEcsImages not implemented") +} func (UnimplementedEcsServiceServer) mustEmbedUnimplementedEcsServiceServer() {} // UnsafeEcsServiceServer may be embedded to opt out of forward compatibility for this service. @@ -328,6 +344,24 @@ func _EcsService_ActionEcs_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _EcsService_ListEcsImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListImagesReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EcsServiceServer).ListEcsImages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ecs.EcsService/ListEcsImages", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EcsServiceServer).ListEcsImages(ctx, req.(*ListImagesReq)) + } + return interceptor(ctx, in, info, handler) +} + // EcsService_ServiceDesc is the grpc.ServiceDesc for EcsService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -367,6 +401,10 @@ var EcsService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ActionEcs", Handler: _EcsService_ActionEcs_Handler, }, + { + MethodName: "ListEcsImages", + Handler: _EcsService_ListEcsImages_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "idl/ecs.proto", diff --git a/adaptor/pcm_vm/gen/openapiv2/idl/ecs.swagger.json b/adaptor/pcm_vm/gen/openapiv2/idl/ecs.swagger.json index e1607e59..03ddf140 100644 --- a/adaptor/pcm_vm/gen/openapiv2/idl/ecs.swagger.json +++ b/adaptor/pcm_vm/gen/openapiv2/idl/ecs.swagger.json @@ -21,7 +21,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" }, "accountName": { "type": "string", @@ -89,7 +90,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云类型" }, "accountName": { "type": "string", @@ -133,7 +135,8 @@ "title": "可用区id" }, "systemDisk": { - "$ref": "#/definitions/ecsSystemDisk" + "$ref": "#/definitions/ecsSystemDisk", + "title": "系统磁盘" }, "amount": { "type": "integer", @@ -149,7 +152,8 @@ "title": "数据盘N的云盘种类。取值范围:cloud_efficiency:高效云盘;cloud_ssd:SSD云盘;cloud_essd:ESSD云盘;cloud:普通云盘。" }, "internetChargeType": { - "$ref": "#/definitions/ecsInternetChargeType" + "$ref": "#/definitions/ecsInternetChargeType", + "title": "网络计费类型。取值范围:PayByBandwidth:按固定带宽计费。PayByTraffic(默认):按使用流量计费" }, "internetMaxBandwidthOut": { "type": "integer", @@ -248,7 +252,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" }, "accountName": { "type": "string", @@ -290,7 +295,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" }, "accountName": { "type": "string", @@ -312,7 +318,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云类型" }, "accountName": { "type": "string", @@ -395,6 +402,35 @@ }, "title": "ECS 实例" }, + "ecsImage": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" + }, + "accountName": { + "type": "string", + "title": "账户名称,根据config.yaml中的配置,默认为第一个配置的账户" + }, + "status": { + "type": "string", + "title": "镜像状态" + }, + "displayName": { + "type": "string", + "title": "镜像名称" + }, + "namespace": { + "type": "string", + "title": "命名空间" + }, + "id": { + "type": "string", + "title": "镜像id" + } + } + }, "ecsInternetChargeType": { "type": "string", "enum": [ @@ -440,6 +476,22 @@ }, "title": "查询ECS返回值" }, + "ecsListImagesResp": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/ecsImage" + }, + "title": "镜像集合" + } + } + }, "ecsListResp": { "type": "object", "properties": { @@ -486,7 +538,8 @@ "type": "object", "properties": { "provider": { - "$ref": "#/definitions/ecsCloudProvider" + "$ref": "#/definitions/ecsCloudProvider", + "title": "云名称" }, "accountName": { "type": "string", @@ -507,11 +560,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/adaptor/pcm_vm/idl/ecs.proto b/adaptor/pcm_vm/idl/ecs.proto index 1493638c..6875adc7 100644 --- a/adaptor/pcm_vm/idl/ecs.proto +++ b/adaptor/pcm_vm/idl/ecs.proto @@ -371,6 +371,43 @@ message ListResp { message ListAllReq{} +message ListImagesReq { + // 云名称 + CloudProvider provider = 1; + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + string account_name = 2; + // 区域Id,参考 tenant.proto 中的各个云的区域 + int32 region_id = 3; + //命名空间 + string namespace= 4; + // 分页相关参数,页码 + int32 page_number = 5; + // 分页相关参数,每页数量 + int32 page_size = 6; +} + +message Image { + // 云名称 + CloudProvider provider = 1; + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + string account_name = 2; + //镜像状态 + string status = 3 ; + //镜像名称 + string display_name= 4; + //命名空间 + string namespace= 5; + //镜像id + string id= 6; +} + +message ListImagesResp { + // 云名称 + CloudProvider provider = 1; + // 镜像集合 + repeated Image images = 2; +} + // ECS类产品接口 // 阿里云 - ECS @@ -402,4 +439,7 @@ service EcsService { //操作ecs(start-stop-restart) rpc ActionEcs(ActionReq) returns (ActionResp); + + //查询ecs镜像 + rpc ListEcsImages(ListImagesReq) returns (ListImagesResp); } \ No newline at end of file diff --git a/adaptor/pcm_vm/idl/ecs.yaml b/adaptor/pcm_vm/idl/ecs.yaml index 97ee03c9..87fc5e02 100644 --- a/adaptor/pcm_vm/idl/ecs.yaml +++ b/adaptor/pcm_vm/idl/ecs.yaml @@ -23,4 +23,6 @@ http: get: "/apis/ecs/all" - selector: ecs.EcsService.ActionEcs post: "/apis/ecs/action" - body: "*" \ No newline at end of file + body: "*" + - selector: ecs.EcsService.ListEcsImages + get: "/apis/ecs/listImages" \ No newline at end of file diff --git a/adaptor/pcm_vm/server/ecs.go b/adaptor/pcm_vm/server/ecs.go index 050654be..b7f7c8b9 100644 --- a/adaptor/pcm_vm/server/ecs.go +++ b/adaptor/pcm_vm/server/ecs.go @@ -91,3 +91,13 @@ func (s *Server) ActionEcs(ctx context.Context, req *ecspb.ActionReq) (*ecspb.Ac } return resp, nil } + +// ListEcsImages return ecs image list +func (s *Server) ListEcsImages(ctx context.Context, req *ecspb.ListImagesReq) (*ecspb.ListImagesResp, error) { + resp, err := ListImages(ctx, req) + if err != nil { + glog.Errorf("ListImages error %+v", err) + return nil, status.Errorf(codes.Internal, err.Error()) + } + return resp, nil +} diff --git a/adaptor/pcm_vm/server/ecsImpl.go b/adaptor/pcm_vm/server/ecsImpl.go index 6a6514f8..507b8a5c 100644 --- a/adaptor/pcm_vm/server/ecsImpl.go +++ b/adaptor/pcm_vm/server/ecsImpl.go @@ -242,3 +242,23 @@ func ActionEcs(ctx context.Context, req *pbecs.ActionReq) (*pbecs.ActionResp, er } return ecs.ActionEcs(ctx, req) } + +func ListImages(ctx context.Context, req *pbecs.ListImagesReq) (*pbecs.ListImagesResp, error) { + var ( + ecs ecser.Ecser + ) + tenanters, err := tenanter.GetTenanters(pbtenant.CloudProvider(req.Provider)) + region, err := tenanter.NewRegion(pbtenant.CloudProvider(req.Provider), req.RegionId) + if err != nil { + return nil, errors.Wrap(err, "get tenanters failed") + } + for _, tenanter := range tenanters { + if req.AccountName == "" || tenanter.AccountName() == req.AccountName { + if ecs, err = ecser.NewEcsClient(req.Provider, region, tenanter); err != nil { + return nil, errors.WithMessage(err, "NewEcsClient error") + } + break + } + } + return ecs.ListEcsImages(ctx, req) +} diff --git a/adaptor/pcm_vm/service/ali.go b/adaptor/pcm_vm/service/ali.go index 262b2991..222ae4ff 100644 --- a/adaptor/pcm_vm/service/ali.go +++ b/adaptor/pcm_vm/service/ali.go @@ -237,3 +237,7 @@ func (ecs *AliEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*p func (ecs *AliEcs) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error) { return nil, nil } + +func (ecs *AliEcs) ListEcsImages(ctx context.Context, req *pbecs.ListImagesReq) (resp *pbecs.ListImagesResp, err error) { + return nil, nil +} diff --git a/adaptor/pcm_vm/service/ecser.go b/adaptor/pcm_vm/service/ecser.go index 056c0ff1..adaa3d20 100644 --- a/adaptor/pcm_vm/service/ecser.go +++ b/adaptor/pcm_vm/service/ecser.go @@ -15,11 +15,12 @@ var ( ) type Ecser interface { - CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (resp *pbecs.CreateEcsResp, err error) //创建ecs - DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (resp *pbecs.DeleteEcsResp, err error) //批量删除ecs - UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (resp *pbecs.UpdateEcsResp, err error) //修改ecs - ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error) //查询ecs详情 - ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error) //操作ecs + CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (resp *pbecs.CreateEcsResp, err error) //创建ecs + DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (resp *pbecs.DeleteEcsResp, err error) //批量删除ecs + UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (resp *pbecs.UpdateEcsResp, err error) //修改ecs + ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error) //查询ecs详情 + ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error) //操作ecs + ListEcsImages(ctx context.Context, req *pbecs.ListImagesReq) (resp *pbecs.ListImagesResp, err error) //查询镜像列表 } func NewEcsClient(provider pbecs.CloudProvider, region tenanter.Region, tenant tenanter.Tenanter) (ecser Ecser, err error) { diff --git a/adaptor/pcm_vm/service/harvester.go b/adaptor/pcm_vm/service/harvester.go index e7942310..c666fe1f 100644 --- a/adaptor/pcm_vm/service/harvester.go +++ b/adaptor/pcm_vm/service/harvester.go @@ -3,6 +3,7 @@ package service import ( pbecs "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_vm/gen/idl" "code.gitlink.org.cn/JCCE/PCM.git/common/tenanter" + pbtenant "code.gitlink.org.cn/JCCE/PCM.git/tenant/gen/idl" "context" "fmt" "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" @@ -568,3 +569,27 @@ func restartVmByName(c *harvClient.Clientset, namespace, vmName string) error { return startVmByName(c, namespace, vm.Name) } } + +func (h *HarVMer) ListEcsImages(ctx context.Context, req *pbecs.ListImagesReq) (resp *pbecs.ListImagesResp, err error) { + //harvester查询默认命名空间 + namespace := "default" + images, err := h.harvCli.HarvesterhciV1beta1().VirtualMachineImages(namespace).List(ctx, k8smetav1.ListOptions{}) + if err != nil { + return nil, err + } + imageList := make([]*pbecs.Image, 0) + for _, im := range images.Items { + image := pbecs.Image{ + Provider: pbecs.CloudProvider(pbtenant.CloudProvider_harvester), + Id: im.Name, + DisplayName: im.Spec.DisplayName, + Namespace: im.Namespace, + } + imageList = append(imageList, &image) + } + + return &pbecs.ListImagesResp{ + Provider: pbecs.CloudProvider(pbtenant.CloudProvider_harvester), + Images: imageList, + }, nil +} diff --git a/adaptor/pcm_vm/service/huawei.go b/adaptor/pcm_vm/service/huawei.go index 6dfe5636..65fdb30f 100644 --- a/adaptor/pcm_vm/service/huawei.go +++ b/adaptor/pcm_vm/service/huawei.go @@ -264,3 +264,7 @@ func (ecs *HuaweiEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) func (ecs *HuaweiEcs) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error) { return nil, nil } + +func (ecs *HuaweiEcs) ListEcsImages(ctx context.Context, req *pbecs.ListImagesReq) (resp *pbecs.ListImagesResp, err error) { + return nil, nil +} diff --git a/adaptor/pcm_vm/service/tencent.go b/adaptor/pcm_vm/service/tencent.go index d12b0d69..498316d3 100644 --- a/adaptor/pcm_vm/service/tencent.go +++ b/adaptor/pcm_vm/service/tencent.go @@ -188,3 +188,7 @@ func (ecs *TencentCvm) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) func (ecs *TencentCvm) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error) { return nil, nil } + +func (ecs *TencentCvm) ListEcsImages(ctx context.Context, req *pbecs.ListImagesReq) (resp *pbecs.ListImagesResp, err error) { + return nil, nil +} diff --git a/go.mod b/go.mod index 25e4f0e5..ee375359 100644 --- a/go.mod +++ b/go.mod @@ -119,6 +119,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.22.3 // indirect k8s.io/component-base v0.21.4 // indirect k8s.io/klog/v2 v2.10.0 // indirect diff --git a/tenant/gen/idl/tenant.pb.go b/tenant/gen/idl/tenant.pb.go index d54fd84a..e745b1e5 100644 --- a/tenant/gen/idl/tenant.pb.go +++ b/tenant/gen/idl/tenant.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: idl/tenant.proto @@ -740,9 +740,9 @@ type Region struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id + //id Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name + //name Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } diff --git a/tenant/gen/openapiv2/idl/tenant.swagger.json b/tenant/gen/openapiv2/idl/tenant.swagger.json index 727eb16e..99e1518b 100644 --- a/tenant/gen/openapiv2/idl/tenant.swagger.json +++ b/tenant/gen/openapiv2/idl/tenant.swagger.json @@ -15,11 +15,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object",