Skip to content

Commit 09cdd31

Browse files
committed
Merge branch 'main' of https://github.com/apache/cloudstack into clone-edit-existing-offerings
2 parents 7b2be10 + a5b6bc3 commit 09cdd31

File tree

351 files changed

+8476
-2664
lines changed

Some content is hidden

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

351 files changed

+8476
-2664
lines changed

.github/workflows/stale.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ jobs:
4141
days-before-pr-close: 240
4242
exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan'
4343
exempt-pr-labels: 'status:ready-for-merge,status:needs-testing,status:on-hold'
44+
- uses: actions/stale@v10
45+
with:
46+
stale-issue-label: 'archive'
47+
days-before-stale: 240
48+
exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan'
49+
days-before-close: -1

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ repos:
5252
args: ['644']
5353
files: \.md$
5454
stages: [manual]
55+
- id: insert-license
56+
name: add license for all cfg files
57+
description: automatically adds a licence header to all cfg files that don't have a license header
58+
files: \.cfg$
59+
args:
60+
- --comment-style
61+
- '|#|'
62+
- --license-filepath
63+
- .github/workflows/license-templates/LICENSE.txt
64+
- --fuzzy-match-generates-todo
5565
- id: insert-license
5666
name: add license for all Markdown files
5767
files: \.md$

agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, fi
331331
final Object resource = this;
332332
logger.info("Building class loader for com.cloud.consoleproxy.ConsoleProxy");
333333
if (consoleProxyMain == null) {
334-
logger.info("Running com.cloud.consoleproxy.ConsoleProxy with encryptor password={}", encryptorPassword);
334+
logger.info("Running com.cloud.consoleproxy.ConsoleProxy");
335335
consoleProxyMain = new Thread(new ManagedContextRunnable() {
336336
@Override
337337
protected void runInContext() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ public class EventTypes {
584584

585585
// Network ACL
586586
public static final String EVENT_NETWORK_ACL_CREATE = "NETWORK.ACL.CREATE";
587+
public static final String EVENT_NETWORK_ACL_IMPORT = "NETWORK.ACL.IMPORT";
587588
public static final String EVENT_NETWORK_ACL_DELETE = "NETWORK.ACL.DELETE";
588589
public static final String EVENT_NETWORK_ACL_REPLACE = "NETWORK.ACL.REPLACE";
589590
public static final String EVENT_NETWORK_ACL_UPDATE = "NETWORK.ACL.UPDATE";

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ Network createGuestNetwork(long networkOfferingId, String name, String displayTe
108108
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType) throws
109109
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
110110

111+
Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
112+
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs) throws
113+
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
114+
111115
Pair<List<? extends Network>, Integer> searchForNetworks(ListNetworksCmd cmd);
112116

113117
boolean deleteNetwork(long networkId, boolean forced);

api/src/main/java/com/cloud/network/vpc/NetworkACLService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020

2121
import org.apache.cloudstack.api.command.user.network.CreateNetworkACLCmd;
22+
import org.apache.cloudstack.api.command.user.network.ImportNetworkACLCmd;
2223
import org.apache.cloudstack.api.command.user.network.ListNetworkACLListsCmd;
2324
import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd;
2425
import org.apache.cloudstack.api.command.user.network.MoveNetworkAclItemCmd;
@@ -98,4 +99,6 @@ public interface NetworkACLService {
9899
NetworkACLItem moveNetworkAclRuleToNewPosition(MoveNetworkAclItemCmd moveNetworkAclItemCmd);
99100

100101
NetworkACLItem moveRuleToTheTopInACLList(NetworkACLItem ruleBeingMoved);
102+
103+
List<NetworkACLItem> importNetworkACLRules(ImportNetworkACLCmd cmd) throws ResourceUnavailableException;
101104
}

api/src/main/java/com/cloud/server/ResourceTag.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
// under the License.
1717
package com.cloud.server;
1818

19-
import org.apache.cloudstack.acl.ControlledEntity;
20-
import org.apache.cloudstack.api.Identity;
21-
import org.apache.cloudstack.api.InternalIdentity;
22-
2319
import java.util.HashMap;
2420
import java.util.Locale;
2521
import java.util.Map;
2622

23+
import org.apache.cloudstack.acl.ControlledEntity;
24+
import org.apache.cloudstack.api.Identity;
25+
import org.apache.cloudstack.api.InternalIdentity;
26+
2727
public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
2828

2929
// FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
@@ -70,7 +70,7 @@ public enum ResourceObjectType {
7070
GuestOs(false, true),
7171
NetworkOffering(false, true),
7272
VpcOffering(true, false),
73-
Domain(false, false, true),
73+
Domain(true, false, true),
7474
ObjectStore(false, false, true);
7575

7676

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public interface VolumeApiService {
5656
Boolean.class,
5757
"use.https.to.upload",
5858
"true",
59-
"Determines the protocol (HTTPS or HTTP) ACS will use to generate links to upload ISOs, volumes, and templates. When set as 'true', ACS will use protocol HTTPS, otherwise, it will use protocol HTTP. Default value is 'true'.",
59+
"Controls whether upload links for ISOs, volumes, and templates use HTTPS (true, default) or HTTP (false). After changing this setting, the Secondary Storage VM (SSVM) must be recreated",
6060
true,
61-
ConfigKey.Scope.StoragePool);
61+
ConfigKey.Scope.Zone);
6262

6363
/**
6464
* Creates the database object for a volume based on the given criteria

api/src/main/java/com/cloud/user/AccountService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ User createUser(String userName, String password, String firstName, String lastN
124124

125125
void validateAccountHasAccessToResource(Account account, AccessType accessType, Object resource);
126126

127-
Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly);
127+
Long finalizeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly);
128128

129129
/**
130130
* returns the user account object for a given user id

api/src/main/java/org/apache/cloudstack/alert/AlertService.java

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@
2424

2525
public interface AlertService {
2626
public static class AlertType {
27-
private static Set<AlertType> defaultAlertTypes = new HashSet<AlertType>();
27+
private static final Set<AlertType> defaultAlertTypes = new HashSet<>();
2828
private final String name;
2929
private final short type;
30+
private final boolean repetitionAllowed;
3031

31-
private AlertType(short type, String name, boolean isDefault) {
32+
private AlertType(short type, String name, boolean isDefault, boolean repetitionAllowed) {
3233
this.name = name;
3334
this.type = type;
35+
this.repetitionAllowed = repetitionAllowed;
3436
if (isDefault) {
3537
defaultAlertTypes.add(this);
3638
}
3739
}
3840

41+
private AlertType(short type, String name, boolean isDefault) {
42+
this(type, name, isDefault, false);
43+
}
44+
3945
public static final AlertType ALERT_TYPE_MEMORY = new AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
4046
public static final AlertType ALERT_TYPE_CPU = new AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
4147
public static final AlertType ALERT_TYPE_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
@@ -45,36 +51,36 @@ private AlertType(short type, String name, boolean isDefault) {
4551
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, "ALERT.NETWORK.IPV6SUBNET", true);
4652
public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
4753
public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", true);
48-
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true);
49-
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true);
50-
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
51-
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true);
54+
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true, true);
55+
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true, true);
56+
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true, true);
57+
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true, true);
5258
public static final AlertType ALERT_TYPE_ROUTING = new AlertType((short)11, "ALERT.NETWORK.ROUTING", true);
53-
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true);
59+
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true, true);
5460
public static final AlertType ALERT_TYPE_USAGE_SERVER = new AlertType((short)13, "ALERT.USAGE", true);
55-
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true);
61+
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true, true);
5662
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true);
5763
public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true);
5864
public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new AlertType((short)17, "ALERT.USERVM.MIGRATE", true);
5965
public static final AlertType ALERT_TYPE_VLAN = new AlertType((short)18, "ALERT.NETWORK.VLAN", true);
60-
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true);
66+
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true, true);
6167
public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new AlertType((short)20, "ALERT.USAGE.RESULT", true);
6268
public static final AlertType ALERT_TYPE_STORAGE_DELETE = new AlertType((short)21, "ALERT.STORAGE.DELETE", true);
6369
public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new AlertType((short)22, "ALERT.RESOURCE.COUNT", true);
6470
public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new AlertType((short)23, "ALERT.USAGE.SANITY", true);
6571
public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true);
6672
public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new AlertType((short)25, "ALERT.STORAGE.LOCAL", true);
67-
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true);
73+
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true, true);
6874
public static final AlertType ALERT_TYPE_SYNC = new AlertType((short)27, "ALERT.TYPE.SYNC", true);
69-
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true);
70-
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
71-
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true);
72-
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true);
75+
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true, true);
76+
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true, true);
77+
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true, true);
78+
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true, true);
7379
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
74-
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
75-
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
76-
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
77-
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true);
80+
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)33, "ALERT.VR.PUBLIC.IFACE.MTU", true);
81+
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)34, "ALERT.VR.PRIVATE.IFACE.MTU", true);
82+
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true, true);
83+
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true, true);
7884
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_BACKUP_STORAGE, "ALERT.STORAGE.BACKUP", true);
7985
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_OBJECT_STORAGE, "ALERT.STORAGE.OBJECT", true);
8086

@@ -86,6 +92,10 @@ public String getName() {
8692
return name;
8793
}
8894

95+
public boolean isRepetitionAllowed() {
96+
return repetitionAllowed;
97+
}
98+
8999
private static AlertType getAlertType(short type) {
90100
for (AlertType alertType : defaultAlertTypes) {
91101
if (alertType.getType() == type) {
@@ -109,7 +119,7 @@ public static AlertType generateAlert(short type, String name) {
109119
if (defaultAlert != null && !defaultAlert.getName().equalsIgnoreCase(name)) {
110120
throw new InvalidParameterValueException("There is a default alert having type " + type + " and name " + defaultAlert.getName());
111121
} else {
112-
return new AlertType(type, name, false);
122+
return new AlertType(type, name, false, false);
113123
}
114124
}
115125
}

0 commit comments

Comments
 (0)