公有云接口定义,第一版
This commit is contained in:
parent
b6ee6ad658
commit
3a143278c2
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>aclome-cmp-parent</artifactId>
|
||||
<groupId>com.neusoft.aclome</groupId>
|
||||
<version>5.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.neusoft.pub.cloud</groupId>
|
||||
<artifactId>pub-cloud-provider</artifactId>
|
||||
<version>${aclome.cmp.version}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.ProviderCode;
|
||||
|
||||
public interface BaseDriver {
|
||||
|
||||
ProviderCode getProviderCode();
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.BillingMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe : 计费模式
|
||||
* 由于各厂商的计费模式都是写死的,为了简化开发,由此接口提供枚举实现
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
public interface BillingModeDriver extends BaseDriver {
|
||||
List<BillingMode> listBillingMode();
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Disk;
|
||||
import com.neusoft.pub.cloud.provider.request.DiskTypeRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe : 磁盘类型驱动
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
public interface DiskTypeDriver extends BaseDriver {
|
||||
|
||||
List<Disk> listSystemDiskType(DiskTypeRequest req);
|
||||
|
||||
List<Disk> listDataDiskType(DiskTypeRequest req);
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
public interface HelloProgrammerDriver extends BaseDriver {
|
||||
|
||||
String sayHello(String word);
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
public interface HelloworldDriver extends BaseDriver {
|
||||
|
||||
String sayHello(String word);
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Image;
|
||||
import com.neusoft.pub.cloud.provider.entity.ImageOS;
|
||||
import com.neusoft.pub.cloud.provider.entity.Page;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.ImageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 公有云镜像
|
||||
*/
|
||||
public interface ImageDriver extends BaseDriver {
|
||||
|
||||
/**
|
||||
* 通过查询条件返回平台的镜像列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Page<Image> listImage(ImageRequest req);
|
||||
|
||||
/**
|
||||
* 返回操作系统平台列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listPlatform(BaseRequest req);
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.InquiryPriceInstance;
|
||||
import com.neusoft.pub.cloud.provider.request.InquiryPriceRunDriverRequest;
|
||||
|
||||
/**
|
||||
* describe : 询价
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/31
|
||||
*/
|
||||
|
||||
public interface InquiryPriceRunDriver extends BaseDriver {
|
||||
|
||||
/**
|
||||
* 创建实例询价
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
InquiryPriceInstance inquiryPriceInstanceDriver(InquiryPriceRunDriverRequest request);
|
||||
|
||||
/**
|
||||
* 带宽询价(当选择为“按使用流量时,用于计算公网流量费用”)
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
InquiryPriceInstance inquiryPriceBandwidthDriver(InquiryPriceRunDriverRequest request);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.InstanceFamily;
|
||||
import com.neusoft.pub.cloud.provider.entity.InstanceType;
|
||||
import com.neusoft.pub.cloud.provider.entity.Page;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.InstanceTypeRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公有云实例类型(规格)
|
||||
*/
|
||||
public interface InstanceTypeDriver extends BaseDriver {
|
||||
|
||||
Page<InstanceType> listInstanceType(InstanceTypeRequest req);
|
||||
|
||||
List<InstanceFamily> listInstanceFamily(BaseRequest req);
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Region;
|
||||
import com.neusoft.pub.cloud.provider.entity.Zone;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.ZoneRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe : 地域。可用区相关接口
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/21
|
||||
*/
|
||||
public interface RegionsZonesDriver extends BaseDriver {
|
||||
/**
|
||||
* 查询地域列表
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
List<Region> listRegions(BaseRequest request);
|
||||
|
||||
/**
|
||||
* 查询可用区列表
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
List<Zone> listZones(ZoneRequest request);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.AuthInfo;
|
||||
|
||||
public class Secret {
|
||||
|
||||
private final static ThreadLocal<AuthInfo> CONTEXT = new ThreadLocal<>();
|
||||
|
||||
public static void putValue(AuthInfo authInfo) {
|
||||
CONTEXT.set(authInfo);
|
||||
}
|
||||
|
||||
public static AuthInfo getInfo() {
|
||||
return CONTEXT.get();
|
||||
}
|
||||
|
||||
public static void remove() {
|
||||
CONTEXT.remove();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.SecurityGroup;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.CreateSecurityGroupRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.JoinSecurityGroupRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe : 安全组驱动
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public interface SecurityGroupDriver extends BaseDriver {
|
||||
/**
|
||||
* 将实例加入到指定安全组
|
||||
*/
|
||||
boolean joinSecurityGroup(JoinSecurityGroupRequest request);
|
||||
|
||||
/**
|
||||
* 查询安全组列表
|
||||
*/
|
||||
List<SecurityGroup> listSecurityGroup(BaseRequest request);
|
||||
|
||||
/**
|
||||
* 创建安全组
|
||||
*/
|
||||
SecurityGroup createSecurityGroup(CreateSecurityGroupRequest request);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Page;
|
||||
import com.neusoft.pub.cloud.provider.entity.Switch;
|
||||
import com.neusoft.pub.cloud.provider.request.SwitchRequest;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author zfl
|
||||
* @date 2023/8/1
|
||||
*/
|
||||
public interface SwitchDriver extends BaseDriver{
|
||||
|
||||
Page<Switch> getSwitchList(SwitchRequest request);
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Page;
|
||||
import com.neusoft.pub.cloud.provider.entity.VirtualMachine;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
import com.neusoft.pub.cloud.provider.request.ListInstanceRequest;
|
||||
|
||||
// 虚拟机相关
|
||||
public interface VirtualMachineDriver extends BaseDriver {
|
||||
|
||||
void create(VirtualMachine vm);
|
||||
|
||||
Page<VirtualMachine> listInstance(ListInstanceRequest req);
|
||||
|
||||
void delInstance(VirtualMachine vm);
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.neusoft.pub.cloud.provider.driver;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.entity.Page;
|
||||
import com.neusoft.pub.cloud.provider.entity.Vpc;
|
||||
import com.neusoft.pub.cloud.provider.request.BaseRequest;
|
||||
|
||||
public interface VpcDriver extends BaseDriver {
|
||||
|
||||
Page<Vpc> getVpcList(BaseRequest request);
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.ProviderCode;
|
||||
|
||||
public class AuthInfo {
|
||||
|
||||
private Integer dataCenterId;
|
||||
private String secretId;
|
||||
|
||||
private String secretKey;
|
||||
|
||||
private ProviderCode providerCode;
|
||||
|
||||
public Integer getDataCenterId() {
|
||||
return dataCenterId;
|
||||
}
|
||||
|
||||
public void setDataCenterId(Integer dataCenterId) {
|
||||
this.dataCenterId = dataCenterId;
|
||||
}
|
||||
|
||||
public String getSecretId() {
|
||||
return secretId;
|
||||
}
|
||||
|
||||
public void setSecretId(String secretId) {
|
||||
this.secretId = secretId;
|
||||
}
|
||||
|
||||
public String getSecretKey() {
|
||||
return secretKey;
|
||||
}
|
||||
|
||||
public void setSecretKey(String secretKey) {
|
||||
this.secretKey = secretKey;
|
||||
}
|
||||
|
||||
public ProviderCode getProviderCode() {
|
||||
return providerCode;
|
||||
}
|
||||
|
||||
public void setProviderCode(ProviderCode providerCode) {
|
||||
this.providerCode = providerCode;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
/**
|
||||
* describe : 计费模式
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
|
||||
public class BillingMode {
|
||||
private String billingModelKey;
|
||||
private String billingModelName;
|
||||
|
||||
public String getBillingModelKey() {
|
||||
return billingModelKey;
|
||||
}
|
||||
|
||||
public void setBillingModelKey(String billingModelKey) {
|
||||
this.billingModelKey = billingModelKey;
|
||||
}
|
||||
|
||||
public String getBillingModelName() {
|
||||
return billingModelName;
|
||||
}
|
||||
|
||||
public void setBillingModelName(String billingModelName) {
|
||||
this.billingModelName = billingModelName;
|
||||
}
|
||||
|
||||
private BillingMode(String billingModelKey, String billingModelName) {
|
||||
this.billingModelKey = billingModelKey;
|
||||
this.billingModelName = billingModelName;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String billingModelKey;
|
||||
private String billingModelName;
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder setBillingModelKey(String billingModelKey) {
|
||||
this.billingModelKey = billingModelKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBillingModelName(String billingModelName) {
|
||||
this.billingModelName = billingModelName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BillingMode build() {
|
||||
return new BillingMode(billingModelKey, billingModelName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/3
|
||||
*/
|
||||
public class Disk {
|
||||
|
||||
// 磁盘类型
|
||||
private String diskType;
|
||||
|
||||
// 磁盘显示名称
|
||||
private String diskName;
|
||||
|
||||
// 磁盘容量(GB)
|
||||
private Integer diskSize;
|
||||
|
||||
public Integer getDiskSize() {
|
||||
return diskSize;
|
||||
}
|
||||
|
||||
public void setDiskSize(Integer diskSize) {
|
||||
this.diskSize = diskSize;
|
||||
}
|
||||
|
||||
// 支持最小容量
|
||||
private Long min;
|
||||
|
||||
// 支持最大容量
|
||||
private Long max;
|
||||
|
||||
public Disk() {
|
||||
|
||||
}
|
||||
|
||||
public Disk(String diskType, String diskName) {
|
||||
this.diskType = diskType;
|
||||
this.diskName = diskName;
|
||||
}
|
||||
|
||||
public Long getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public void setMin(Long min) {
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
public Long getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public void setMax(Long max) {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public String getDiskType() {
|
||||
return diskType;
|
||||
}
|
||||
|
||||
public void setDiskType(String diskType) {
|
||||
this.diskType = diskType;
|
||||
}
|
||||
|
||||
public String getDiskName() {
|
||||
return diskName;
|
||||
}
|
||||
|
||||
public void setDiskName(String diskName) {
|
||||
this.diskName = diskName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof Disk)) return false;
|
||||
Disk disk = (Disk) o;
|
||||
return Objects.equals(getDiskType(), disk.getDiskType()) && Objects.equals(getDiskName(), disk.getDiskName()) && Objects.equals(getDiskSize(), disk.getDiskSize()) && Objects.equals(getMin(), disk.getMin()) && Objects.equals(getMax(), disk.getMax());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getDiskType(), getDiskName(), getDiskSize(), getMin(), getMax());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.OSArch;
|
||||
|
||||
public class Image {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 操作系统平台
|
||||
*/
|
||||
private String platform;
|
||||
|
||||
private OSArch arch;
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public OSArch getArch() {
|
||||
return arch;
|
||||
}
|
||||
|
||||
public void setArch(OSArch arch) {
|
||||
this.arch = arch;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
public class ImageOS {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
/**
|
||||
* describe : 实例价格
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/2
|
||||
*/
|
||||
public class InquiryPriceInstance {
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private String originalPrice;
|
||||
/**
|
||||
* 折扣
|
||||
*/
|
||||
private String discountPrice;
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String currency;
|
||||
/**
|
||||
* 最终价
|
||||
*/
|
||||
private String tradePrice;
|
||||
|
||||
|
||||
public String getDiscountPrice() {
|
||||
return discountPrice;
|
||||
}
|
||||
|
||||
public void setDiscountPrice(String discountPrice) {
|
||||
this.discountPrice = discountPrice;
|
||||
}
|
||||
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
public String getOriginalPrice() {
|
||||
return originalPrice;
|
||||
}
|
||||
|
||||
public void setOriginalPrice(String originalPrice) {
|
||||
this.originalPrice = originalPrice;
|
||||
}
|
||||
|
||||
public String getTradePrice() {
|
||||
return tradePrice;
|
||||
}
|
||||
|
||||
public void setTradePrice(String tradePrice) {
|
||||
this.tradePrice = tradePrice;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
public class InstanceFamily {
|
||||
|
||||
private String instanceFamily;
|
||||
|
||||
private String instanceFamilyName;
|
||||
|
||||
public String getInstanceFamily() {
|
||||
return instanceFamily;
|
||||
}
|
||||
|
||||
public void setInstanceFamily(String instanceFamily) {
|
||||
this.instanceFamily = instanceFamily;
|
||||
}
|
||||
|
||||
public String getInstanceFamilyName() {
|
||||
return instanceFamilyName;
|
||||
}
|
||||
|
||||
public void setInstanceFamilyName(String instanceFamilyName) {
|
||||
this.instanceFamilyName = instanceFamilyName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
public class InstanceType {
|
||||
|
||||
private String instanceType;
|
||||
|
||||
private String instanceTypeName;
|
||||
|
||||
private String instanceTypeFamily;
|
||||
|
||||
private Integer cpuCoreCount;
|
||||
|
||||
// 内存(GB)
|
||||
private Float memorySize;
|
||||
|
||||
public String getInstanceType() {
|
||||
return instanceType;
|
||||
}
|
||||
|
||||
public void setInstanceType(String instanceType) {
|
||||
this.instanceType = instanceType;
|
||||
}
|
||||
|
||||
public String getInstanceTypeName() {
|
||||
return instanceTypeName;
|
||||
}
|
||||
|
||||
public void setInstanceTypeName(String instanceTypeName) {
|
||||
this.instanceTypeName = instanceTypeName;
|
||||
}
|
||||
|
||||
public String getInstanceTypeFamily() {
|
||||
return instanceTypeFamily;
|
||||
}
|
||||
|
||||
public void setInstanceTypeFamily(String instanceTypeFamily) {
|
||||
this.instanceTypeFamily = instanceTypeFamily;
|
||||
}
|
||||
|
||||
public Integer getCpuCoreCount() {
|
||||
return cpuCoreCount;
|
||||
}
|
||||
|
||||
public void setCpuCoreCount(Integer cpuCoreCount) {
|
||||
this.cpuCoreCount = cpuCoreCount;
|
||||
}
|
||||
|
||||
public Float getMemorySize() {
|
||||
return memorySize;
|
||||
}
|
||||
|
||||
public void setMemorySize(Float memorySize) {
|
||||
this.memorySize = memorySize;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Page<T> {
|
||||
|
||||
private int pageNumber;
|
||||
|
||||
private int pageSize;
|
||||
|
||||
private List<T> pageData;
|
||||
|
||||
private long total;
|
||||
|
||||
public Page() {
|
||||
pageData = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* list转分页
|
||||
* @param pageNumber
|
||||
* @param pageSize
|
||||
* @param list
|
||||
*/
|
||||
public Page(Integer pageNumber, Integer pageSize, List<T> list) {
|
||||
int startIndex = (pageNumber - 1) * pageSize;
|
||||
int endIndex = Math.min(startIndex + pageSize, list.size());
|
||||
List<T> sublist = list.subList(startIndex, endIndex);
|
||||
this.setPageNumber(pageNumber);
|
||||
this.setPageSize(pageSize);
|
||||
this.setPageData(sublist);
|
||||
this.setTotal(list.size());
|
||||
}
|
||||
|
||||
public int getPageNumber() {
|
||||
return pageNumber;
|
||||
}
|
||||
|
||||
public void setPageNumber(int pageNumber) {
|
||||
this.pageNumber = pageNumber;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public List<T> getPageData() {
|
||||
return pageData;
|
||||
}
|
||||
|
||||
public void setPageData(List<T> pageData) {
|
||||
this.pageData = pageData;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.SaleStatus;
|
||||
|
||||
/**
|
||||
* describe : 地域
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public class Region {
|
||||
/**
|
||||
*地域ID
|
||||
*/
|
||||
private String regionId;
|
||||
/**
|
||||
* 地域对应的接入地址(Endpoint)
|
||||
*/
|
||||
private String regionEndpoint;
|
||||
/**
|
||||
* 地域名称
|
||||
*/
|
||||
private String localName;
|
||||
/**
|
||||
* 售卖状态
|
||||
*/
|
||||
private SaleStatus saleStatus;
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public String getRegionEndpoint() {
|
||||
return regionEndpoint;
|
||||
}
|
||||
|
||||
public void setRegionEndpoint(String regionEndpoint) {
|
||||
this.regionEndpoint = regionEndpoint;
|
||||
}
|
||||
|
||||
public String getLocalName() {
|
||||
return localName;
|
||||
}
|
||||
|
||||
public void setLocalName(String localName) {
|
||||
this.localName = localName;
|
||||
}
|
||||
|
||||
public SaleStatus getSaleStatus() {
|
||||
return saleStatus;
|
||||
}
|
||||
|
||||
public void setSaleStatus(SaleStatus saleStatus) {
|
||||
this.saleStatus = saleStatus;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public class SecurityGroup {
|
||||
/**
|
||||
* 安全组ID
|
||||
*/
|
||||
private String securityGroupId;
|
||||
/**
|
||||
* 安全组名称
|
||||
*/
|
||||
private String securityGroupName;
|
||||
|
||||
public String getSecurityGroupId() {
|
||||
return securityGroupId;
|
||||
}
|
||||
|
||||
public void setSecurityGroupId(String securityGroupId) {
|
||||
this.securityGroupId = securityGroupId;
|
||||
}
|
||||
|
||||
public String getSecurityGroupName() {
|
||||
return securityGroupName;
|
||||
}
|
||||
|
||||
public void setSecurityGroupName(String securityGroupName) {
|
||||
this.securityGroupName = securityGroupName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
/**
|
||||
* describe :交换机
|
||||
*
|
||||
* @author zfl
|
||||
* @date 2023/8/1
|
||||
*/
|
||||
public class Switch {
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
private String zoneId;
|
||||
|
||||
/**
|
||||
* 交换机ID
|
||||
*/
|
||||
private String vSwitchId;
|
||||
|
||||
/**
|
||||
* 交换机名称
|
||||
*/
|
||||
private String vSwitchName;
|
||||
|
||||
private String vpcId;
|
||||
|
||||
/**
|
||||
* 网段
|
||||
*/
|
||||
private String cidrBlock;
|
||||
|
||||
/**
|
||||
* 可用IP数量
|
||||
*/
|
||||
private Long availableIpAddressCount;
|
||||
|
||||
public String getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getvSwitchId() {
|
||||
return vSwitchId;
|
||||
}
|
||||
|
||||
public void setvSwitchId(String vSwitchId) {
|
||||
this.vSwitchId = vSwitchId;
|
||||
}
|
||||
|
||||
public String getvSwitchName() {
|
||||
return vSwitchName;
|
||||
}
|
||||
|
||||
public void setvSwitchName(String vSwitchName) {
|
||||
this.vSwitchName = vSwitchName;
|
||||
}
|
||||
|
||||
public String getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
public void setVpcId(String vpcId) {
|
||||
this.vpcId = vpcId;
|
||||
}
|
||||
|
||||
public String getCidrBlock() {
|
||||
return cidrBlock;
|
||||
}
|
||||
|
||||
public void setCidrBlock(String cidrBlock) {
|
||||
this.cidrBlock = cidrBlock;
|
||||
}
|
||||
|
||||
public Long getAvailableIpAddressCount() {
|
||||
return availableIpAddressCount;
|
||||
}
|
||||
|
||||
public void setAvailableIpAddressCount(Long availableIpAddressCount) {
|
||||
this.availableIpAddressCount = availableIpAddressCount;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,385 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.ImportStateEnums;
|
||||
import com.neusoft.pub.cloud.provider.enums.InstanceChargeType;
|
||||
import com.neusoft.pub.cloud.provider.enums.InternetChargeType;
|
||||
import com.neusoft.pub.cloud.provider.enums.PubVirtualMachineStateEnums;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class VirtualMachine {
|
||||
|
||||
@ApiModelProperty(value = "地域id")
|
||||
private String regionId;
|
||||
|
||||
/**
|
||||
* 数据中心id
|
||||
*/
|
||||
private Integer dataCenterId;
|
||||
|
||||
private String cloudPlatformName;
|
||||
|
||||
private String regionName;
|
||||
|
||||
private String zoneId;
|
||||
|
||||
private String zoneName;
|
||||
|
||||
private String instanceId;
|
||||
|
||||
// 实例名称
|
||||
private String instanceName;
|
||||
|
||||
// 主机名
|
||||
private String hostname;
|
||||
|
||||
// 镜像ID
|
||||
private String imageId;
|
||||
|
||||
// 规格ID
|
||||
private String instanceType;
|
||||
|
||||
// VPC网络ID
|
||||
private String vpcId;
|
||||
|
||||
// 子网/子交换机ID
|
||||
private String vSwitchId;
|
||||
/**
|
||||
* ip
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
private Integer cpu;
|
||||
/**
|
||||
* 内存
|
||||
*/
|
||||
private Integer memory;
|
||||
/**
|
||||
* 操作系统id
|
||||
*/
|
||||
private String osId;
|
||||
/**
|
||||
* 操作系统名称
|
||||
*/
|
||||
private String osName;
|
||||
|
||||
private String imageName;
|
||||
/**
|
||||
* 当前使用带宽(峰值)
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
private PubVirtualMachineStateEnums state;
|
||||
|
||||
private String stateName;
|
||||
|
||||
private String description;
|
||||
|
||||
// 安全组ID
|
||||
private List<String> securityGroupIds;
|
||||
|
||||
// 分配公网IP
|
||||
private Boolean publicIP;
|
||||
|
||||
public Boolean getPublicIP() {
|
||||
return publicIP;
|
||||
}
|
||||
|
||||
public void setPublicIP(Boolean publicIP) {
|
||||
this.publicIP = publicIP;
|
||||
}
|
||||
|
||||
// 实例付费类型
|
||||
private InstanceChargeType instanceChargeType;
|
||||
|
||||
// 公网IP付费类型
|
||||
private InternetChargeType internetChargeType;
|
||||
|
||||
// 公网IP付费类型
|
||||
private String internetChargeTypeName;
|
||||
public InternetChargeType getInternetChargeType() {
|
||||
return internetChargeType;
|
||||
}
|
||||
|
||||
public void setInternetChargeType(InternetChargeType internetChargeType) {
|
||||
this.internetChargeType = internetChargeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例付费类型
|
||||
*/
|
||||
private String instanceChargeTypeName;
|
||||
/**
|
||||
* 云平台id
|
||||
*/
|
||||
private String platformResourceId;
|
||||
/**
|
||||
* 导入状态
|
||||
*/
|
||||
private ImportStateEnums importState;
|
||||
|
||||
private String importStateName;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// 系统盘
|
||||
private Disk sysDisk;
|
||||
|
||||
public Disk getSysDisk() {
|
||||
return sysDisk;
|
||||
}
|
||||
|
||||
public void setSysDisk(Disk sysDisk) {
|
||||
this.sysDisk = sysDisk;
|
||||
}
|
||||
|
||||
public List<Disk> getDataDisk() {
|
||||
return dataDisk;
|
||||
}
|
||||
|
||||
public void setDataDisk(List<Disk> dataDisk) {
|
||||
this.dataDisk = dataDisk;
|
||||
}
|
||||
|
||||
// 数据盘
|
||||
private List<Disk> dataDisk;
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getInstanceId() {
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
public void setInstanceId(String instanceId) {
|
||||
this.instanceId = instanceId;
|
||||
}
|
||||
|
||||
public String getInstanceName() {
|
||||
return instanceName;
|
||||
}
|
||||
|
||||
public void setInstanceName(String instanceName) {
|
||||
this.instanceName = instanceName;
|
||||
}
|
||||
|
||||
public String getImageId() {
|
||||
return imageId;
|
||||
}
|
||||
|
||||
public void setImageId(String imageId) {
|
||||
this.imageId = imageId;
|
||||
}
|
||||
|
||||
public String getInstanceType() {
|
||||
return instanceType;
|
||||
}
|
||||
|
||||
public void setInstanceType(String instanceType) {
|
||||
this.instanceType = instanceType;
|
||||
}
|
||||
|
||||
public String getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
public void setVpcId(String vpcId) {
|
||||
this.vpcId = vpcId;
|
||||
}
|
||||
|
||||
public String getvSwitchId() {
|
||||
return vSwitchId;
|
||||
}
|
||||
|
||||
public void setvSwitchId(String vSwitchId) {
|
||||
this.vSwitchId = vSwitchId;
|
||||
}
|
||||
|
||||
public List<String> getSecurityGroupIds() {
|
||||
return securityGroupIds;
|
||||
}
|
||||
|
||||
public void setSecurityGroupIds(List<String> securityGroupIds) {
|
||||
this.securityGroupIds = securityGroupIds;
|
||||
}
|
||||
|
||||
public InstanceChargeType getInstanceChargeType() {
|
||||
return instanceChargeType;
|
||||
}
|
||||
|
||||
public void setInstanceChargeType(InstanceChargeType instanceChargeType) {
|
||||
this.instanceChargeType = instanceChargeType;
|
||||
}
|
||||
|
||||
public Integer getDataCenterId() {
|
||||
return dataCenterId;
|
||||
}
|
||||
|
||||
public void setDataCenterId(Integer dataCenterId) {
|
||||
this.dataCenterId = dataCenterId;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public Integer getCpu() {
|
||||
return cpu;
|
||||
}
|
||||
|
||||
public void setCpu(Integer cpu) {
|
||||
this.cpu = cpu;
|
||||
}
|
||||
|
||||
public Integer getMemory() {
|
||||
return memory;
|
||||
}
|
||||
|
||||
public void setMemory(Integer memory) {
|
||||
this.memory = memory;
|
||||
}
|
||||
|
||||
public String getOsId() {
|
||||
return osId;
|
||||
}
|
||||
|
||||
public void setOsId(String osId) {
|
||||
this.osId = osId;
|
||||
}
|
||||
|
||||
public String getOsName() {
|
||||
return osName;
|
||||
}
|
||||
|
||||
public void setOsName(String osName) {
|
||||
this.osName = osName;
|
||||
}
|
||||
|
||||
public String getImageName() {
|
||||
return imageName;
|
||||
}
|
||||
|
||||
public void setImageName(String imageName) {
|
||||
this.imageName = imageName;
|
||||
}
|
||||
|
||||
public Integer getInternetMaxBandwidthOut() {
|
||||
return internetMaxBandwidthOut;
|
||||
}
|
||||
|
||||
public void setInternetMaxBandwidthOut(Integer internetMaxBandwidthOut) {
|
||||
this.internetMaxBandwidthOut = internetMaxBandwidthOut;
|
||||
}
|
||||
|
||||
public PubVirtualMachineStateEnums getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(PubVirtualMachineStateEnums state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getStateName() {
|
||||
return stateName;
|
||||
}
|
||||
|
||||
public void setStateName(String stateName) {
|
||||
this.stateName = stateName;
|
||||
}
|
||||
|
||||
public String getPlatformResourceId() {
|
||||
return platformResourceId;
|
||||
}
|
||||
|
||||
public void setPlatformResourceId(String platformResourceId) {
|
||||
this.platformResourceId = platformResourceId;
|
||||
}
|
||||
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
public void setHostname(String hostname) {
|
||||
this.hostname = hostname;
|
||||
}
|
||||
|
||||
public String getInstanceChargeTypeName() {
|
||||
return instanceChargeTypeName;
|
||||
}
|
||||
|
||||
public void setInstanceChargeTypeName(String instanceChargeTypeName) {
|
||||
this.instanceChargeTypeName = instanceChargeTypeName;
|
||||
}
|
||||
|
||||
public ImportStateEnums getImportState() {
|
||||
return importState;
|
||||
}
|
||||
|
||||
public void setImportState(ImportStateEnums importState) {
|
||||
this.importState = importState;
|
||||
}
|
||||
|
||||
public String getImportStateName() {
|
||||
return importStateName;
|
||||
}
|
||||
|
||||
public void setImportStateName(String importStateName) {
|
||||
this.importStateName = importStateName;
|
||||
}
|
||||
|
||||
public String getRegionName() {
|
||||
return regionName;
|
||||
}
|
||||
|
||||
public void setRegionName(String regionName) {
|
||||
this.regionName = regionName;
|
||||
}
|
||||
|
||||
public String getZoneName() {
|
||||
return zoneName;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getInternetChargeTypeName() {
|
||||
return internetChargeTypeName;
|
||||
}
|
||||
|
||||
public void setInternetChargeTypeName(String internetChargeTypeName) {
|
||||
this.internetChargeTypeName = internetChargeTypeName;
|
||||
}
|
||||
|
||||
public String getCloudPlatformName() {
|
||||
return cloudPlatformName;
|
||||
}
|
||||
|
||||
public void setCloudPlatformName(String cloudPlatformName) {
|
||||
this.cloudPlatformName = cloudPlatformName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
public class Vpc {
|
||||
|
||||
private String vpcStatus;
|
||||
|
||||
private String vpcId;
|
||||
|
||||
private String regionId;
|
||||
|
||||
private String vpcName;
|
||||
|
||||
public String getVpcStatus() {
|
||||
return vpcStatus;
|
||||
}
|
||||
|
||||
public void setVpcStatus(String vpcStatus) {
|
||||
this.vpcStatus = vpcStatus;
|
||||
}
|
||||
|
||||
public String getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
public void setVpcId(String vpcId) {
|
||||
this.vpcId = vpcId;
|
||||
}
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public String getVpcName() {
|
||||
return vpcName;
|
||||
}
|
||||
|
||||
public void setVpcName(String vpcName) {
|
||||
this.vpcName = vpcName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.neusoft.pub.cloud.provider.entity;
|
||||
|
||||
/**
|
||||
* describe : 可用区
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public class Zone {
|
||||
/**
|
||||
* 可用区ID
|
||||
*/
|
||||
private String zoneId;
|
||||
/**
|
||||
* 可用区标识
|
||||
*/
|
||||
private String zone;
|
||||
/**
|
||||
* 可用区本地语言名
|
||||
*/
|
||||
private String localName;
|
||||
|
||||
public String getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getLocalName() {
|
||||
return localName;
|
||||
}
|
||||
|
||||
public void setLocalName(String localName) {
|
||||
this.localName = localName;
|
||||
}
|
||||
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/15
|
||||
*/
|
||||
public enum ImportStateEnums {
|
||||
UN_IMPORT("未导入"),
|
||||
IMPORTED("已导入");
|
||||
|
||||
String name;
|
||||
|
||||
ImportStateEnums(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
// 实例的付费方式
|
||||
public enum InstanceChargeType {
|
||||
|
||||
// 包年包月
|
||||
PREPAID("包年包月"),
|
||||
|
||||
// 按量付费
|
||||
POSTPAID("按量计费");
|
||||
|
||||
String name;
|
||||
|
||||
InstanceChargeType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
// 公网IP的付费方式
|
||||
public enum InternetChargeType {
|
||||
|
||||
PAYBYBANDWIDTH("按固定带宽"),
|
||||
|
||||
PAYBYTRAFFIC("按使用流量"),
|
||||
|
||||
NULLable("无");
|
||||
|
||||
String name;
|
||||
|
||||
InternetChargeType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
public enum OSArch {
|
||||
I386, X86_64, ARM64, MIPS
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
public enum ProviderCode {
|
||||
|
||||
// 阿里云供应商代码
|
||||
ALIYUN,
|
||||
// 腾讯云供应商代码
|
||||
TENCENT;
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
/**
|
||||
* describe : 云主机运行状态
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/15
|
||||
*/
|
||||
public enum PubVirtualMachineStateEnums {
|
||||
PENDING("创建中"),
|
||||
RUNNING("运行中"),
|
||||
STARTING("启动中"),
|
||||
STOPPING("停止中"),
|
||||
|
||||
STOPPED("已停止"),
|
||||
LAUNCH_FAILED("创建失败"),
|
||||
REBOOTING("重启中"),
|
||||
SHUTDOWN("停止待销毁"),
|
||||
TERMINATING("销毁中"),
|
||||
|
||||
UNKNOWN("未知"),
|
||||
ERROR("错误"),
|
||||
|
||||
;
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
PubVirtualMachineStateEnums(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.neusoft.pub.cloud.provider.enums;
|
||||
|
||||
/**
|
||||
* describe : 售卖状态
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public enum SaleStatus {
|
||||
/**
|
||||
* 未售罄
|
||||
*/
|
||||
AVAILABLE,
|
||||
/**
|
||||
* 已售罄
|
||||
*/
|
||||
SOLD_OUT
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* 通用请求参数
|
||||
*
|
||||
* @author sunxingye
|
||||
*/
|
||||
public class BaseRequest {
|
||||
|
||||
private int pageNumber = 1;
|
||||
|
||||
private int pageSize = 20;
|
||||
|
||||
private String regionId;
|
||||
|
||||
private String zoneId;
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public int getPageNumber() {
|
||||
return pageNumber;
|
||||
}
|
||||
|
||||
public void setPageNumber(int pageNumber) {
|
||||
this.pageNumber = pageNumber;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/8
|
||||
*/
|
||||
public class CloudPlatformRequest {
|
||||
private Integer id;
|
||||
/**
|
||||
* 云平台名称
|
||||
*/
|
||||
private String platformName;
|
||||
/**
|
||||
* 云平台类型
|
||||
*/
|
||||
private String platformType;
|
||||
|
||||
private String secretId;
|
||||
|
||||
private String secretKey;
|
||||
/**
|
||||
* 冗余
|
||||
*/
|
||||
private String note;
|
||||
|
||||
private Integer pageNo;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPlatformName() {
|
||||
return platformName;
|
||||
}
|
||||
|
||||
public void setPlatformName(String platformName) {
|
||||
this.platformName = platformName;
|
||||
}
|
||||
|
||||
public String getPlatformType() {
|
||||
return platformType;
|
||||
}
|
||||
|
||||
public void setPlatformType(String platformType) {
|
||||
this.platformType = platformType;
|
||||
}
|
||||
|
||||
public String getSecretId() {
|
||||
return secretId;
|
||||
}
|
||||
|
||||
public void setSecretId(String secretId) {
|
||||
this.secretId = secretId;
|
||||
}
|
||||
|
||||
public String getSecretKey() {
|
||||
return secretKey;
|
||||
}
|
||||
|
||||
public void setSecretKey(String secretKey) {
|
||||
this.secretKey = secretKey;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/26
|
||||
*/
|
||||
public class CreateSecurityGroupRequest extends BaseRequest {
|
||||
/**
|
||||
* 安全组描述信息
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 安全组名称
|
||||
*/
|
||||
private String securityGroupName;
|
||||
|
||||
private Integer dataCenterId;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getSecurityGroupName() {
|
||||
return securityGroupName;
|
||||
}
|
||||
|
||||
public void setSecurityGroupName(String securityGroupName) {
|
||||
this.securityGroupName = securityGroupName;
|
||||
}
|
||||
|
||||
public Integer getDataCenterId() {
|
||||
return dataCenterId;
|
||||
}
|
||||
|
||||
public void setDataCenterId(Integer dataCenterId) {
|
||||
this.dataCenterId = dataCenterId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* 磁盘类型
|
||||
*/
|
||||
public class DiskTypeRequest extends BaseRequest {
|
||||
|
||||
// 实例规格
|
||||
private String instanceType;
|
||||
|
||||
public String getInstanceType() {
|
||||
return instanceType;
|
||||
}
|
||||
|
||||
public void setInstanceType(String instanceType) {
|
||||
this.instanceType = instanceType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.OSArch;
|
||||
|
||||
public class ImageRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 架构
|
||||
*/
|
||||
private OSArch arch;
|
||||
/**
|
||||
* 操作系统平台
|
||||
*/
|
||||
private String platform;
|
||||
|
||||
private String imageId;
|
||||
|
||||
public String getImageId() {
|
||||
return imageId;
|
||||
}
|
||||
|
||||
public void setImageId(String imageId) {
|
||||
this.imageId = imageId;
|
||||
}
|
||||
|
||||
public OSArch getArch() {
|
||||
return arch;
|
||||
}
|
||||
|
||||
public void setArch(OSArch arch) {
|
||||
this.arch = arch;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,185 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/31
|
||||
*/
|
||||
public class InquiryPriceRunDriverRequest extends BaseRequest {
|
||||
private Integer dataCenterId;
|
||||
/**
|
||||
* 实例规格(InstanceType):用于指定实例的计算能力和配置。
|
||||
*/
|
||||
private String instanceType;
|
||||
/**
|
||||
* 操作系统(ImageId):用于指定实例的操作系统镜像,如Linux、Windows等。
|
||||
*/
|
||||
private String imageId;
|
||||
/**
|
||||
* 系统盘
|
||||
*/
|
||||
private DiskInfo systemDisk;
|
||||
/**
|
||||
* 数据盘
|
||||
*/
|
||||
private List<DiskInfo> dataDisks;
|
||||
|
||||
/**
|
||||
* 网络带宽(InternetMaxBandwidthOut):用于指定实例的出网带宽,即实例可用于外部网络的最大带宽。
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 网络带宽计费方式
|
||||
* PayByBandwidth:按固定带宽计费。
|
||||
* PayByTraffic:按带宽流量计费
|
||||
*/
|
||||
private String internetChargeType;
|
||||
/**
|
||||
* 计费方式
|
||||
* 查询云服务器ECS不同计费周期的价格。取值范围:
|
||||
* <p>
|
||||
* Month:按月计费的价格单位。
|
||||
* Year:按年计费的价格单位。
|
||||
* Hour(默认):按小时计费的价格单位。
|
||||
* Week:按周计费的价格单位。
|
||||
*/
|
||||
private String priceUnit;
|
||||
/**
|
||||
* 云服务器ECS的计费时长。取值范围:
|
||||
* <p>
|
||||
* 当参数PriceUnit取值为Month时:1~9。
|
||||
* 当参数PriceUnit取值为Year时:1~5。
|
||||
* 当参数PriceUnit取值为Hour时:1。
|
||||
* 当参数PriceUnit取值为Week时:1~4。
|
||||
*/
|
||||
private Integer period;
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
public Integer getDataCenterId() {
|
||||
return dataCenterId;
|
||||
}
|
||||
|
||||
public void setDataCenterId(Integer dataCenterId) {
|
||||
this.dataCenterId = dataCenterId;
|
||||
}
|
||||
|
||||
public String getInstanceType() {
|
||||
return instanceType;
|
||||
}
|
||||
|
||||
public void setInstanceType(String instanceType) {
|
||||
this.instanceType = instanceType;
|
||||
}
|
||||
|
||||
public DiskInfo getSystemDisk() {
|
||||
return systemDisk;
|
||||
}
|
||||
|
||||
public void setSystemDisk(DiskInfo systemDisk) {
|
||||
this.systemDisk = systemDisk;
|
||||
}
|
||||
|
||||
public List<DiskInfo> getDataDisks() {
|
||||
return dataDisks;
|
||||
}
|
||||
|
||||
public void setDataDisks(List<DiskInfo> dataDisks) {
|
||||
this.dataDisks = dataDisks;
|
||||
}
|
||||
|
||||
public Integer getInternetMaxBandwidthOut() {
|
||||
return internetMaxBandwidthOut;
|
||||
}
|
||||
|
||||
public void setInternetMaxBandwidthOut(Integer internetMaxBandwidthOut) {
|
||||
this.internetMaxBandwidthOut = internetMaxBandwidthOut;
|
||||
}
|
||||
|
||||
public String getInternetChargeType() {
|
||||
return internetChargeType;
|
||||
}
|
||||
|
||||
public void setInternetChargeType(String internetChargeType) {
|
||||
this.internetChargeType = internetChargeType;
|
||||
}
|
||||
|
||||
public String getPriceUnit() {
|
||||
return priceUnit;
|
||||
}
|
||||
|
||||
public void setPriceUnit(String priceUnit) {
|
||||
this.priceUnit = priceUnit;
|
||||
}
|
||||
|
||||
public Integer getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
public void setPeriod(Integer period) {
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
public Integer getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Integer amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getImageId() {
|
||||
return imageId;
|
||||
}
|
||||
|
||||
public void setImageId(String imageId) {
|
||||
this.imageId = imageId;
|
||||
}
|
||||
|
||||
public static class DiskInfo {
|
||||
/**
|
||||
* 磁盘类型
|
||||
*/
|
||||
private String diskType;
|
||||
/**
|
||||
* 系统盘类型为ESSD云盘时,区分性能等级。仅当SystemDiskCategory=cloud_essd时该参数有效。取值范围:
|
||||
* <p>
|
||||
* PL0。 PL1(默认)。 PL2。 PL3。
|
||||
*/
|
||||
private String performanceLevel;
|
||||
/**
|
||||
* 磁盘大小
|
||||
*/
|
||||
private Integer diskSize;
|
||||
|
||||
public String getDiskType() {
|
||||
return diskType;
|
||||
}
|
||||
|
||||
public void setDiskType(String diskType) {
|
||||
this.diskType = diskType;
|
||||
}
|
||||
|
||||
public String getPerformanceLevel() {
|
||||
return performanceLevel;
|
||||
}
|
||||
|
||||
public void setPerformanceLevel(String performanceLevel) {
|
||||
this.performanceLevel = performanceLevel;
|
||||
}
|
||||
|
||||
public Integer getDiskSize() {
|
||||
return diskSize;
|
||||
}
|
||||
|
||||
public void setDiskSize(Integer diskSize) {
|
||||
this.diskSize = diskSize;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
import com.neusoft.pub.cloud.provider.enums.OSArch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InstanceTypeRequest extends BaseRequest {
|
||||
|
||||
private List<String> instanceTypes;
|
||||
|
||||
private OSArch arch;
|
||||
|
||||
private String instanceTypeFamily;
|
||||
|
||||
private String imageId;
|
||||
|
||||
private Integer cpuCoreCount;
|
||||
|
||||
// 内存(GB)
|
||||
private Float memorySize;
|
||||
|
||||
public String getImageId() {
|
||||
return imageId;
|
||||
}
|
||||
|
||||
public void setImageId(String imageId) {
|
||||
this.imageId = imageId;
|
||||
}
|
||||
|
||||
public String getInstanceTypeFamily() {
|
||||
return instanceTypeFamily;
|
||||
}
|
||||
|
||||
public void setInstanceTypeFamily(String instanceTypeFamily) {
|
||||
this.instanceTypeFamily = instanceTypeFamily;
|
||||
}
|
||||
|
||||
public OSArch getArch() {
|
||||
return arch;
|
||||
}
|
||||
|
||||
public void setArch(OSArch arch) {
|
||||
this.arch = arch;
|
||||
}
|
||||
|
||||
public Integer getCpuCoreCount() {
|
||||
return cpuCoreCount;
|
||||
}
|
||||
|
||||
public void setCpuCoreCount(Integer cpuCoreCount) {
|
||||
this.cpuCoreCount = cpuCoreCount;
|
||||
}
|
||||
|
||||
public Float getMemorySize() {
|
||||
return memorySize;
|
||||
}
|
||||
|
||||
public void setMemorySize(Float memorySize) {
|
||||
this.memorySize = memorySize;
|
||||
}
|
||||
|
||||
public List<String> getInstanceTypes() {
|
||||
return instanceTypes;
|
||||
}
|
||||
|
||||
public void setInstanceTypes(List<String> instanceTypes) {
|
||||
this.instanceTypes = instanceTypes;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
public class JoinSecurityGroupRequest extends BaseRequest {
|
||||
private String securityGroupId;
|
||||
private String instanceId;
|
||||
|
||||
public String getSecurityGroupId() {
|
||||
return securityGroupId;
|
||||
}
|
||||
|
||||
public void setSecurityGroupId(String securityGroupId) {
|
||||
this.securityGroupId = securityGroupId;
|
||||
}
|
||||
|
||||
public String getInstanceId() {
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
public void setInstanceId(String instanceId) {
|
||||
this.instanceId = instanceId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/16
|
||||
*/
|
||||
public class ListInstanceRequest extends BaseRequest {
|
||||
private List<String> instanceIds;
|
||||
|
||||
public List<String> getInstanceIds() {
|
||||
return instanceIds;
|
||||
}
|
||||
|
||||
public void setInstanceIds(List<String> instanceIds) {
|
||||
this.instanceIds = instanceIds;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
@Deprecated
|
||||
public class ListSecurityGroupRequest {
|
||||
/**
|
||||
* 地域id
|
||||
*/
|
||||
private String regionId;
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/8/14
|
||||
*/
|
||||
public class ListVirtualMachineRequest extends BaseRequest {
|
||||
@ApiModelProperty(value = "云平台账号id")
|
||||
private Integer dataCenterId;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "ip")
|
||||
private String ip;
|
||||
|
||||
public Integer getDataCenterId() {
|
||||
return dataCenterId;
|
||||
}
|
||||
|
||||
public void setDataCenterId(Integer dataCenterId) {
|
||||
this.dataCenterId = dataCenterId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public class RegionsRequest {
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
public class SwitchRequest extends BaseRequest {
|
||||
|
||||
private String vpcId;
|
||||
|
||||
public String getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
public void setVpcId(String vpcId) {
|
||||
this.vpcId = vpcId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.neusoft.pub.cloud.provider.request;
|
||||
|
||||
/**
|
||||
* describe :
|
||||
*
|
||||
* @author hao.dd
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
public class ZoneRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 地域对应的接入地址(Endpoint)
|
||||
*/
|
||||
private String regionEndpoint;
|
||||
|
||||
|
||||
public String getRegionEndpoint() {
|
||||
return regionEndpoint;
|
||||
}
|
||||
|
||||
public void setRegionEndpoint(String regionEndpoint) {
|
||||
this.regionEndpoint = regionEndpoint;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue