Skip to content

Commit 8fc019e

Browse files
committed
Merge branch '4.18' of github.com:apache/cloudstack into fix-and-improve-quota-balance-calculation
2 parents 56a3a68 + 9d748f0 commit 8fc019e

File tree

66 files changed

+487
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+487
-311
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v3
3131

3232
- name: Set up JDK 11
33-
uses: actions/setup-java@v3
33+
uses: actions/setup-java@v4
3434
with:
3535
java-version: '11'
3636
distribution: 'adopt'

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
- uses: actions/checkout@v3
195195

196196
- name: Set up JDK
197-
uses: actions/setup-java@v3
197+
uses: actions/setup-java@v4
198198
with:
199199
java-version: '11'
200200
distribution: 'adopt'

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/checkout@v3
3636

3737
- name: Set up JDK11
38-
uses: actions/setup-java@v3
38+
uses: actions/setup-java@v4
3939
with:
4040
distribution: 'temurin'
4141
java-version: '11'

.github/workflows/main-sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fetch-depth: 0
3434

3535
- name: Set up JDK11
36-
uses: actions/setup-java@v3
36+
uses: actions/setup-java@v4
3737
with:
3838
distribution: 'temurin'
3939
java-version: '11'

.github/workflows/rat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v3
3131
- name: Set up JDK 11
32-
uses: actions/setup-java@v3
32+
uses: actions/setup-java@v4
3333
with:
3434
java-version: '11'
3535
distribution: 'adopt'

.github/workflows/sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fetch-depth: 0
3939

4040
- name: Set up JDK11
41-
uses: actions/setup-java@v3
41+
uses: actions/setup-java@v4
4242
with:
4343
distribution: 'temurin'
4444
java-version: '11'

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.cloudstack.api.response.ZoneResponse;
3030
import org.apache.cloudstack.config.Configuration;
3131
import org.apache.cloudstack.ha.HAConfig;
32+
import org.apache.cloudstack.quota.QuotaTariff;
3233
import org.apache.cloudstack.usage.Usage;
3334

3435
import com.cloud.dc.DataCenter;
@@ -693,6 +694,11 @@ public class EventTypes {
693694
// SystemVM
694695
public static final String EVENT_LIVE_PATCH_SYSTEMVM = "LIVE.PATCH.SYSTEM.VM";
695696

697+
// Quota
698+
public static final String EVENT_QUOTA_TARIFF_CREATE = "QUOTA.TARIFF.CREATE";
699+
public static final String EVENT_QUOTA_TARIFF_DELETE = "QUOTA.TARIFF.DELETE";
700+
public static final String EVENT_QUOTA_TARIFF_UPDATE = "QUOTA.TARIFF.UPDATE";
701+
696702
static {
697703

698704
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
@@ -1118,6 +1124,11 @@ public class EventTypes {
11181124

11191125
entityEventDetails.put(EVENT_IMAGE_STORE_DATA_MIGRATE, ImageStore.class);
11201126
entityEventDetails.put(EVENT_LIVE_PATCH_SYSTEMVM, "SystemVMs");
1127+
1128+
// Quota
1129+
entityEventDetails.put(EVENT_QUOTA_TARIFF_CREATE, QuotaTariff.class);
1130+
entityEventDetails.put(EVENT_QUOTA_TARIFF_DELETE, QuotaTariff.class);
1131+
entityEventDetails.put(EVENT_QUOTA_TARIFF_UPDATE, QuotaTariff.class);
11211132
}
11221133

11231134
public static String getEntityForEvent(String eventName) {

api/src/main/java/com/cloud/storage/Storage.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static enum StoragePoolType {
138138
LVM(false, false, false), // XenServer local LVM SR
139139
CLVM(true, false, false),
140140
RBD(true, true, false), // http://libvirt.org/storage.html#StorageBackendRBD
141-
SharedMountPoint(true, false, true),
141+
SharedMountPoint(true, true, true),
142142
VMFS(true, true, false), // VMware VMFS storage
143143
PreSetup(true, true, false), // for XenServer, Storage Pool is set up by customers.
144144
EXT(false, true, false), // XenServer local EXT SR
@@ -152,12 +152,12 @@ public static enum StoragePoolType {
152152
StorPool(true, true, true);
153153

154154
private final boolean shared;
155-
private final boolean overprovisioning;
155+
private final boolean overProvisioning;
156156
private final boolean encryption;
157157

158-
StoragePoolType(boolean shared, boolean overprovisioning, boolean encryption) {
158+
StoragePoolType(boolean shared, boolean overProvisioning, boolean encryption) {
159159
this.shared = shared;
160-
this.overprovisioning = overprovisioning;
160+
this.overProvisioning = overProvisioning;
161161
this.encryption = encryption;
162162
}
163163

@@ -166,14 +166,16 @@ public boolean isShared() {
166166
}
167167

168168
public boolean supportsOverProvisioning() {
169-
return overprovisioning;
169+
return overProvisioning;
170170
}
171171

172-
public boolean supportsEncryption() { return encryption; }
172+
public boolean supportsEncryption() {
173+
return encryption;
174+
}
173175
}
174176

175177
public static List<StoragePoolType> getNonSharedStoragePoolTypes() {
176-
List<StoragePoolType> nonSharedStoragePoolTypes = new ArrayList<StoragePoolType>();
178+
List<StoragePoolType> nonSharedStoragePoolTypes = new ArrayList<>();
177179
for (StoragePoolType storagePoolType : StoragePoolType.values()) {
178180
if (!storagePoolType.isShared()) {
179181
nonSharedStoragePoolTypes.add(storagePoolType);

api/src/main/java/org/apache/cloudstack/api/ApiCommandResourceType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ public enum ApiCommandResourceType {
7777
Pod(com.cloud.dc.Pod.class),
7878
VmSnapshot(com.cloud.vm.snapshot.VMSnapshot.class),
7979
Role(org.apache.cloudstack.acl.Role.class),
80-
VpnCustomerGateway(com.cloud.network.Site2SiteCustomerGateway.class);
80+
VpnCustomerGateway(com.cloud.network.Site2SiteCustomerGateway.class),
81+
QuotaTariff(org.apache.cloudstack.quota.QuotaTariff.class);
8182

8283
private final Class<?> clazz;
8384

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.apache.cloudstack.quota;
19+
20+
import org.apache.cloudstack.api.Identity;
21+
import org.apache.cloudstack.api.InternalIdentity;
22+
23+
public interface QuotaTariff extends InternalIdentity, Identity {
24+
25+
}

0 commit comments

Comments
 (0)