Skip to content

Commit

Permalink
Merge branch 'zx' into ebs@@3
Browse files Browse the repository at this point in the history
  • Loading branch information
mingjian2049 committed May 17, 2018
2 parents a7f3173 + 63f4b8a commit b0685dd
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 6 deletions.
29 changes: 29 additions & 0 deletions conf/db/upgrade/V2.4.0__schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,32 @@ CREATE TABLE IF NOT EXISTS `AliyunNasMountVolumeRefVO` (
CONSTRAINT `fkAliyunNasMountVolumeRefVOAliyunNasMountTargetVO` FOREIGN KEY (`nasMountUuid`) REFERENCES `zstack`.`AliyunNasMountTargetVO` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `zstack`.`PricePciDeviceOfferingRefVO` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT,
`priceUuid` varchar(32) NOT NULL,
`pciDeviceOfferingUuid` varchar(32) NOT NULL,
`lastOpDate` timestamp ON UPDATE CURRENT_TIMESTAMP,
`createDate` timestamp,
PRIMARY KEY (`id`),
CONSTRAINT `fkPricePciDeviceOfferingRefVOPriceVO` FOREIGN KEY (`priceUuid`) REFERENCES `zstack`.`PriceVO` (`uuid`) ON DELETE CASCADE,
CONSTRAINT `fkPricePciDeviceOfferingRefVOPciDeviceOfferingVO` FOREIGN KEY (`pciDeviceOfferingUuid`) REFERENCES `zstack`.`PciDeviceOfferingVO` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `zstack`.`PciDeviceUsageVO` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT,
`pciDeviceUuid` varchar(32) NOT NULL,
`vendorId` varchar(64) NOT NULL,
`deviceId` varchar(64) NOT NULL,
`subvendorId` varchar(64) DEFAULT NULL,
`subdeviceId` varchar(64) DEFAULT NULL,
`description` varchar(2048) DEFAULT NULL,
`vmUuid` varchar(32) NOT NULL,
`vmName` varchar(255) DEFAULT NULL,
`status` varchar(64) NOT NULL,
`accountUuid` varchar(32) NOT NULL,
`dateInLong` bigint unsigned NOT NULL,
`inventory` text DEFAULT NULL,
`lastOpDate` timestamp ON UPDATE CURRENT_TIMESTAMP,
`createDate` timestamp,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18 changes: 18 additions & 0 deletions conf/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,24 @@
"line": 103,
"fileName": "src/main/java/org/zstack/billing/BillingApiInterceptor.java"
},
{
"raw": "gpu price must be bound to gpu uuid empty",
"en_US": "gpu price must be bound to gpu uuid empty",
"zh_CN": "GPU类型的价格必须绑定一个GPU设备",
"arguments": [],
"line": 117,
"fileName": "src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java"
},
{
"raw": "gpu price must be bound to gpu uuid %s",
"en_US": "gpu price must be bound to gpu uuid {0}",
"zh_CN": "GPU类型的价格必须绑定一个正确的GPU设备{0}",
"arguments": [
"msg.getSystemTags()"
],
"line": 124,
"fileName": "src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java"
},
{
"raw": "VM [uuid: %s] has already been added to affinityGroup [uuid: %s]",
"en_US": "VM [uuid: {0}] has already been added to affinityGroup [uuid: {1}]",
Expand Down
8 changes: 8 additions & 0 deletions conf/i18n/messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ the\ minimal\ resource\ unit\ is\ megabyte,\ cannot\ be\ byte = the minimal reso
# args:
price\ must\ be\ 0\ and\ 9999.99 = price must be 0 and 9999.99

# at: src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java:117
# args:
gpu\ price\ must\ be\ bound\ to\ gpu\ uuid\ empty = gpu price must be bound to gpu uuid empty

# at: src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java:124
# args: msg.getSystemTags()
gpu\ price\ must\ be\ bound\ to\ gpu\ uuid\ %s = gpu price must be bound to gpu uuid {0}

# at: src/main/java/org/zstack/compute/affinityGroup/AffinityGroupBase.java:296
# args: resourceUuid,affinityGroupUuid
VM\ [uuid\:\ %s]\ has\ already\ been\ added\ to\ affinityGroup\ [uuid\:\ %s] = VM [uuid: {0}] has already been added to affinityGroup [uuid: {1}]
Expand Down
8 changes: 8 additions & 0 deletions conf/i18n/messages_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ the\ minimal\ resource\ unit\ is\ megabyte,\ cannot\ be\ byte = 资源的最小
# args:
price\ must\ be\ 0\ and\ 9999.99 = 价格必须在0和9999.99之间

# at: src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java:117
# args:
gpu\ price\ must\ be\ bound\ to\ gpu\ uuid\ empty = GPU类型的价格必须绑定一个GPU设备

# at: src/billing/zstack/./premium/mevoco/src/main/java/org/zstack/billing/BillingApiInterceptor.java:124
# args: msg.getSystemTags()
gpu\ price\ must\ be\ bound\ to\ gpu\ uuid\ %s = GPU类型的价格必须绑定一个正确的GPU设备{0}

# at: src/main/java/org/zstack/compute/affinityGroup/AffinityGroupBase.java:296
# args: resourceUuid,affinityGroupUuid
VM\ [uuid\:\ %s]\ has\ already\ been\ added\ to\ affinityGroup\ [uuid\:\ %s] = VM[uuid:{0}已经被添加到亲和组[uuid:{1}]中。]
Expand Down
6 changes: 6 additions & 0 deletions sdk/src/main/java/SourceClassMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public class SourceClassMap {
put("org.zstack.appliancevm.ApplianceVmInventory", "org.zstack.sdk.ApplianceVmInventory");
put("org.zstack.billing.DataVolumeSpending", "org.zstack.sdk.DataVolumeSpending");
put("org.zstack.billing.DataVolumeSpendingInventory", "org.zstack.sdk.DataVolumeSpendingInventory");
put("org.zstack.billing.PciDeviceSpending", "org.zstack.sdk.PciDeviceSpending");
put("org.zstack.billing.PciDeviceSpendingInventory", "org.zstack.sdk.PciDeviceSpendingInventory");
put("org.zstack.billing.PriceInventory", "org.zstack.sdk.PriceInventory");
put("org.zstack.billing.PricePciDeviceOfferingRefInventory", "org.zstack.sdk.PricePciDeviceOfferingRefInventory");
put("org.zstack.billing.RootVolumeSpending", "org.zstack.sdk.RootVolumeSpending");
put("org.zstack.billing.RootVolumeSpendingInventory", "org.zstack.sdk.RootVolumeSpendingInventory");
put("org.zstack.billing.SnapShotSpendingInventory", "org.zstack.sdk.SnapShotSpendingInventory");
Expand Down Expand Up @@ -392,6 +395,8 @@ public class SourceClassMap {
put("org.zstack.sdk.PciDeviceOfferingInventory", "org.zstack.pciDevice.PciDeviceOfferingInventory");
put("org.zstack.sdk.PciDeviceOfferingType", "org.zstack.pciDevice.PciDeviceOfferingType");
put("org.zstack.sdk.PciDevicePciDeviceOfferingRefInventory", "org.zstack.pciDevice.PciDevicePciDeviceOfferingRefInventory");
put("org.zstack.sdk.PciDeviceSpending", "org.zstack.billing.PciDeviceSpending");
put("org.zstack.sdk.PciDeviceSpendingInventory", "org.zstack.billing.PciDeviceSpendingInventory");
put("org.zstack.sdk.PciDeviceState", "org.zstack.pciDevice.PciDeviceState");
put("org.zstack.sdk.PciDeviceStatus", "org.zstack.pciDevice.PciDeviceStatus");
put("org.zstack.sdk.PciDeviceType", "org.zstack.pciDevice.PciDeviceType");
Expand All @@ -400,6 +405,7 @@ public class SourceClassMap {
put("org.zstack.sdk.PolicyStatementEffect", "org.zstack.header.identity.AccountConstant$StatementEffect");
put("org.zstack.sdk.PortForwardingRuleInventory", "org.zstack.network.service.portforwarding.PortForwardingRuleInventory");
put("org.zstack.sdk.PriceInventory", "org.zstack.billing.PriceInventory");
put("org.zstack.sdk.PricePciDeviceOfferingRefInventory", "org.zstack.billing.PricePciDeviceOfferingRefInventory");
put("org.zstack.sdk.PrimaryStorageHostStatus", "org.zstack.header.storage.primary.PrimaryStorageHostStatus");
put("org.zstack.sdk.PrimaryStorageInventory", "org.zstack.header.storage.primary.PrimaryStorageInventory");
put("org.zstack.sdk.ProgressProperty", "org.zstack.header.aliyun.image.ProgressProperty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ public Result throwExceptionIfError() {
}
}

@Param(required = true, maxLength = 255, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
@Param(required = false, maxLength = 255, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String name;

@Param(required = false, maxLength = 2048, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String description;

@Param(required = false, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String type;

@Param(required = true, maxLength = 4, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vendorId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Result throwExceptionIfError() {
}
}

@Param(required = true, validValues = {"cpu","memory","rootVolume","dataVolume","snapShot"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
@Param(required = true, validValues = {"cpu","memory","rootVolume","dataVolume","snapShot","gpu"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String resourceName;

@Param(required = false, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
Expand Down
15 changes: 15 additions & 0 deletions sdk/src/main/java/org/zstack/sdk/PciDeviceSpending.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.zstack.sdk;



public class PciDeviceSpending extends org.zstack.sdk.SpendingDetails {

public java.util.List sizeInventory;
public void setSizeInventory(java.util.List sizeInventory) {
this.sizeInventory = sizeInventory;
}
public java.util.List getSizeInventory() {
return this.sizeInventory;
}

}
31 changes: 31 additions & 0 deletions sdk/src/main/java/org/zstack/sdk/PciDeviceSpendingInventory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.zstack.sdk;



public class PciDeviceSpendingInventory {

public long startTime;
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getStartTime() {
return this.startTime;
}

public long endTime;
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public long getEndTime() {
return this.endTime;
}

public double spending;
public void setSpending(double spending) {
this.spending = spending;
}
public double getSpending() {
return this.spending;
}

}
8 changes: 8 additions & 0 deletions sdk/src/main/java/org/zstack/sdk/PriceInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ public java.sql.Timestamp getLastOpDate() {
return this.lastOpDate;
}

public java.util.List pciDeviceOfferings;
public void setPciDeviceOfferings(java.util.List pciDeviceOfferings) {
this.pciDeviceOfferings = pciDeviceOfferings;
}
public java.util.List getPciDeviceOfferings() {
return this.pciDeviceOfferings;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.zstack.sdk;



public class PricePciDeviceOfferingRefInventory {

public java.lang.String priceUuid;
public void setPriceUuid(java.lang.String priceUuid) {
this.priceUuid = priceUuid;
}
public java.lang.String getPriceUuid() {
return this.priceUuid;
}

public java.lang.String pciDeviceOfferingUuid;
public void setPciDeviceOfferingUuid(java.lang.String pciDeviceOfferingUuid) {
this.pciDeviceOfferingUuid = pciDeviceOfferingUuid;
}
public java.lang.String getPciDeviceOfferingUuid() {
return this.pciDeviceOfferingUuid;
}

public java.sql.Timestamp createDate;
public void setCreateDate(java.sql.Timestamp createDate) {
this.createDate = createDate;
}
public java.sql.Timestamp getCreateDate() {
return this.createDate;
}

public java.sql.Timestamp lastOpDate;
public void setLastOpDate(java.sql.Timestamp lastOpDate) {
this.lastOpDate = lastOpDate;
}
public java.sql.Timestamp getLastOpDate() {
return this.lastOpDate;
}

}
2 changes: 1 addition & 1 deletion testlib/src/main/java/org/zstack/testlib/EnvSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class EnvSpec implements Node {
"NetworkServiceTypeVO", "VmInstanceSequenceNumberVO",
"GarbageCollectorVO",
"TaskProgressVO", "NotificationVO", "TaskStepVO",
"DataVolumeUsageVO", "RootVolumeUsageVO", "VmUsageVO",
"DataVolumeUsageVO", "RootVolumeUsageVO", "VmUsageVO", "GpuUsageVO",
"ResourceVO","SecurityGroupSequenceNumberVO","SnapShotUsageVO", "MediaVO"]) {
// those tables will continue having entries during running a test suite
return
Expand Down

0 comments on commit b0685dd

Please sign in to comment.