Skip to content

Extensions Framework & Orchestrate Anything #9752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 177 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
3d9a92a
Introducing External Framework and Orchestrate Anything
harikrishna-patnala Sep 23, 2024
790ae86
Added since parameter
harikrishna-patnala Oct 1, 2024
2f9d04c
fix logger
harikrishna-patnala Oct 1, 2024
266f101
Fix tests
harikrishna-patnala Oct 1, 2024
6576152
License check
harikrishna-patnala Oct 1, 2024
51ea49a
Rename Folder
harikrishna-patnala Nov 10, 2024
4681493
recent commit for proxmax, I'll have edit this commit afterwards
harikrishna-patnala Nov 21, 2024
9c42b55
Merge this into FR04
harikrishna-patnala Mar 5, 2025
fc25c0f
working env
harikrishna-patnala Mar 16, 2025
7d140c1
Extension framework
harikrishna-patnala Mar 18, 2025
f0f6779
Listing API
harikrishna-patnala Mar 27, 2025
38bb8ba
Renames and adding path
harikrishna-patnala Mar 27, 2025
7e58612
New changes
harikrishna-patnala Mar 27, 2025
32fc7f8
Fix Map and String
harikrishna-patnala Mar 27, 2025
73ad1bf
License
harikrishna-patnala Mar 27, 2025
f6ab456
Unit test fix
harikrishna-patnala Mar 27, 2025
8b1ed02
Lint error
harikrishna-patnala Mar 27, 2025
50de0ef
gen doc issue
harikrishna-patnala Mar 27, 2025
659e816
Fix sql
harikrishna-patnala Mar 27, 2025
6aedf94
import issue
harikrishna-patnala Mar 27, 2025
f517c68
Script Fixes
harikrishna-patnala Mar 28, 2025
ed9dff1
Lint error
harikrishna-patnala Mar 28, 2025
a9cb4ad
response added
harikrishna-patnala Mar 30, 2025
c25e85c
Fix restart MS issue and method mappings in provisioner.sh
abh1sar Apr 1, 2025
e23bcb5
Introducing extensions and refactoring framework around it
harikrishna-patnala Apr 30, 2025
5ba592e
gen_toc changes
harikrishna-patnala May 12, 2025
cff3c58
license
harikrishna-patnala May 12, 2025
1422536
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 13, 2025
831e125
address review comments
shwstppr May 13, 2025
b4350d9
Fix a bug in finalizeReservation due to which External hypervisor was…
abh1sar May 15, 2025
bf4cc9e
refactor, configurable extension path
shwstppr May 16, 2025
5dcb7aa
fix
shwstppr May 16, 2025
0a16872
unnecessary
shwstppr May 16, 2025
83f5cb8
changes
shwstppr May 19, 2025
f77a2e0
refactor check extensions dir
shwstppr May 19, 2025
54c7073
use java code to prepare scripts
shwstppr May 19, 2025
d2132cb
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 19, 2025
3c0086c
backend custom actions changes
shwstppr May 20, 2025
568a61e
Update plugins/hypervisors/external/src/main/java/org/apache/cloudsta…
shwstppr May 22, 2025
069f8f2
UI fix for external details not sent correctly
abh1sar May 26, 2025
0174a13
Fix some NPEs in External Hypervisor framework
abh1sar May 26, 2025
65c3a41
base changes for checkhealthcommand handling
shwstppr May 26, 2025
3553e23
Minor bug fixes in Custom Actions
abh1sar May 29, 2025
26d6641
changes
shwstppr May 29, 2025
f5c4b06
fixes
shwstppr May 29, 2025
06b9eb2
changes, extension ui, events, misc
shwstppr May 30, 2025
0dbab7f
remove unimplemented comments tab for now
shwstppr May 30, 2025
d9d7de2
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 30, 2025
086f57e
changes - fix CRUD for ext abd custom actions; ui
shwstppr Jun 2, 2025
b8ff2da
changes
shwstppr Jun 3, 2025
204bc28
fix
shwstppr Jun 3, 2025
0a61f80
ui: fix add cluster
shwstppr Jun 5, 2025
4c64106
ui: add refs in extension forms
shwstppr Jun 5, 2025
adc2a00
ui: fix cluster extension selection
shwstppr Jun 5, 2025
321ff1e
ui: use detailinput in addhost form
shwstppr Jun 5, 2025
44e8024
fix cluster extension register
shwstppr Jun 5, 2025
09da11b
refactor
shwstppr Jun 5, 2025
0e9291c
remove unused config validation
shwstppr Jun 5, 2025
af14f06
ui: fix details and parameters input
shwstppr Jun 5, 2025
ebe3e3e
ui: fix select labels in extension forms
shwstppr Jun 5, 2025
7f80ffb
api: allow list custom actions for resource, run api change
shwstppr Jun 5, 2025
82f88d9
ui: initial work for erun custom action
shwstppr Jun 5, 2025
f52bae2
changes
shwstppr Jun 9, 2025
42c846c
additional commands
shwstppr Jun 9, 2025
070051c
remove unused css
shwstppr Jun 9, 2025
41703c2
pass json file instead
shwstppr Jun 9, 2025
17eb17c
wip changes for extension sync
shwstppr Jun 10, 2025
fd917ab
fix stop vm
shwstppr Jun 10, 2025
238bc19
entrypoint sync ui
shwstppr Jun 10, 2025
08c6f0e
allow actual execution, fix script
shwstppr Jun 10, 2025
eafe9f1
fix addcusotmaction form
shwstppr Jun 10, 2025
6bb936e
fix add host form css
shwstppr Jun 10, 2025
51bd0b1
ui fixes
shwstppr Jun 10, 2025
22fec2a
external planner to adhere arch, enabled clusters
shwstppr Jun 10, 2025
f0c5ecf
prepare entry-point on all MS
shwstppr Jun 10, 2025
cafb5a9
fixes, changes
shwstppr Jun 10, 2025
0a35310
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 11, 2025
0beeeea
wip
shwstppr Jun 11, 2025
34040e8
fix enable-disable
shwstppr Jun 11, 2025
5210121
fix runaction wait
shwstppr Jun 11, 2025
8296d48
ui: fix custom action add/update
shwstppr Jun 11, 2025
abc3943
wip: changes for feedback from demo
shwstppr Jun 13, 2025
2605b51
ui fix
shwstppr Jun 13, 2025
84f25c0
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 13, 2025
dd5568c
Merge branch 'ExternalDeploymentIntegration' into feature-extensions-…
shwstppr Jun 13, 2025
d7c982f
ui: label fixes
shwstppr Jun 13, 2025
945109b
wip: changes for writing files in a known dir
shwstppr Jun 13, 2025
005bd8d
changes for host update, command handling, ui actions control
shwstppr Jun 16, 2025
49318a8
changes for extension data directory
shwstppr Jun 16, 2025
b651d1c
refactor external details in JSON
shwstppr Jun 16, 2025
ef6960c
use default timeout
shwstppr Jun 16, 2025
7e35bdb
ui: fix instance vol snapshot action
shwstppr Jun 16, 2025
8d75f15
remove postprovisioning
shwstppr Jun 16, 2025
28b1b34
change logging
shwstppr Jun 16, 2025
94151b4
keep extensions dir in replace.properties and server.properties.in
abh1sar Jun 13, 2025
e04fba9
builtin extensions initial scripts
abh1sar Jun 13, 2025
685674f
Update proxmox and hyperv scripts
abh1sar Jun 13, 2025
e623d1f
upgrade path to add builtin extensions
abh1sar Jun 13, 2025
849a0e1
remove extensionsDirectory config
abh1sar Jun 13, 2025
4868760
move sample extensions to scripts/vm/hypervisor/external
abh1sar Jun 16, 2025
d5e7670
Package sample extensions for el8
abh1sar Jun 17, 2025
500d649
fix precommit failure in hyperv.py
abh1sar Jun 17, 2025
f1d63c0
revert copy to /etc/cloudstack
abh1sar Jun 17, 2025
b2f04ca
fix minor error in cloud.spec
abh1sar Jun 17, 2025
6f4f4ec
refactor
shwstppr Jun 16, 2025
abae8af
ui fix
shwstppr Jun 16, 2025
21bbae2
Merge branch 'feature-extensions-framework' into ExternalDeploymentIn…
shwstppr Jun 17, 2025
c83d184
refactor reading server.properties for extensions.file.path
shwstppr Jun 17, 2025
751fed6
update column name in insert
shwstppr Jun 17, 2025
6b1fbb5
typo
shwstppr Jun 17, 2025
21bbc63
move extensions data dir under target
shwstppr Jun 17, 2025
e1de17a
do not prepare inbuilt extension
shwstppr Jun 17, 2025
54d0acd
notification title
shwstppr Jun 17, 2025
8c765e3
fixes
shwstppr Jun 17, 2025
c5a48cd
more fix
shwstppr Jun 17, 2025
53c0f46
extensions directory label
shwstppr Jun 17, 2025
3270afd
default location for extensions for dev env
abh1sar Jun 17, 2025
fe79499
rename class member for JSON
shwstppr Jun 17, 2025
2bf6690
only return details that are meant for display
shwstppr Jun 18, 2025
23b7d93
update extension fix
shwstppr Jun 18, 2025
f112ba9
wip: prepare updates VM in a generic way
shwstppr Jun 16, 2025
eee516c
changes
shwstppr Jun 17, 2025
e076a35
ui: show inbuilt tag in infocard
shwstppr Jun 18, 2025
c6dab62
ui: minor refactor
shwstppr Jun 18, 2025
d8bd9de
ui: fix console error
shwstppr Jun 18, 2025
2c59171
ui: enable/disable as separate actions
shwstppr Jun 18, 2025
378d64e
changes for orchestrator prepare using virtualmachineto
shwstppr Jun 18, 2025
049f52c
changes for extension path, refactor
shwstppr Jun 18, 2025
f33a70a
missing license
shwstppr Jun 18, 2025
3644cf4
Move extensions dir to top level. add property extensions.deployment.…
abh1sar Jun 19, 2025
518503d
prepare only on first start
shwstppr Jun 19, 2025
d5f1d72
api,server,ui: changes for host, cluster extensionid
shwstppr Jun 19, 2025
440aba0
minor refactor
shwstppr Jun 19, 2025
34691b2
fixes
shwstppr Jun 19, 2025
76b08a8
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 19, 2025
9b1ca52
refactor
shwstppr Jun 19, 2025
a46873d
fix merge issue
shwstppr Jun 19, 2025
a18682e
build fix
shwstppr Jun 19, 2025
7ab2dc9
error handling and other improvements in proxmox.sh
abh1sar Jun 20, 2025
d205b84
enable destroy for external vms. get deployvm from vmto.
abh1sar Jun 20, 2025
97c8d6f
insert parameters as HashMap into accessDetails in RunCustomAction
abh1sar Jun 20, 2025
2590316
refactor, remove todo
shwstppr Jun 20, 2025
840c1c1
refactor
shwstppr Jun 20, 2025
5836a2d
handle upload todo, move common methods from HypervisorTemplateAdapter
shwstppr Jun 20, 2025
a11cdfb
Add Proxmox custom actions
abh1sar Jun 20, 2025
cb38175
fix pre-commit failure
abh1sar Jun 20, 2025
85101ac
Error handling and custom actions for hyperv
abh1sar Jun 21, 2025
a89a493
Add ExternalEntryPointPayloadProvisionerTest
abh1sar Jun 22, 2025
9e4376d
ExternalEntryPointPayloadProvisionerTest
abh1sar Jun 23, 2025
8cbd28e
changes for vm state, external details
shwstppr Jun 20, 2025
8b0bb7b
assorted changes
shwstppr Jun 23, 2025
7af9868
test: add integration tests
shwstppr Jun 23, 2025
77856d9
ui: fix extensions path
shwstppr Jun 23, 2025
2e77980
fix build
shwstppr Jun 23, 2025
534a56d
fix naming
shwstppr Jun 23, 2025
5280666
add more tests
shwstppr Jun 23, 2025
c248627
more tests
shwstppr Jun 23, 2025
1b92d4a
tests and minor refactor
shwstppr Jun 23, 2025
e56a591
build fix
shwstppr Jun 23, 2025
69ede10
lint eof
shwstppr Jun 23, 2025
6297a42
integration test fix
shwstppr Jun 23, 2025
157e4a5
fix test fail with sudo permissions
shwstppr Jun 23, 2025
eb21fc8
fix
shwstppr Jun 23, 2025
f3b93e6
Remove prepare from proxmox and hyperv. Builtin exts disabled by defa…
abh1sar Jun 23, 2025
54e844c
Added ExtensionCustomActionTest
abh1sar Jun 24, 2025
f7d0fe8
refactor to add more tests
shwstppr Jun 24, 2025
af19e3c
use InvalidParameterValueException, fix integration test failure
shwstppr Jun 24, 2025
35f779b
list all for sync check
shwstppr Jun 24, 2025
2951a67
minor fixes
shwstppr Jun 24, 2025
be99173
ui fixes
shwstppr Jun 24, 2025
cace6cd
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 24, 2025
67377c4
show run action result
shwstppr Jun 25, 2025
10a90e8
extensions directory to be owned by cloud:cloud. Also added debian ru…
abh1sar Jun 25, 2025
2abe27a
prepare changes
shwstppr Jun 26, 2025
39c8b16
action name check
shwstppr Jun 26, 2025
ecd517c
get vmid in prepare for proxmox. nic related changes
abh1sar Jun 29, 2025
b54804c
multiple network support in hyperv
abh1sar Jun 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ jobs:
smoke/test_nested_virtualization
smoke/test_set_sourcenat
smoke/test_webhook_lifecycle
smoke/test_purge_expunged_vms",
smoke/test_purge_expunged_vms
smoke/test_extension_lifecycle
smoke/test_extension_custom_action_lifecycle
smoke/test_extension_custom",
"smoke/test_network
smoke/test_network_acl
smoke/test_network_ipv6
Expand Down
14 changes: 14 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.stream.Collectors;

import com.cloud.agent.api.LogLevel;
import com.cloud.network.element.NetworkElement;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachine.Type;
import com.cloud.vm.VmDetailConstants;

public class VirtualMachineTO {
private long id;
Expand Down Expand Up @@ -496,4 +498,16 @@
public String toString() {
return String.format("VM {id: \"%s\", name: \"%s\", uuid: \"%s\", type: \"%s\"}", id, name, uuid, type);
}

public Map<String, String> getExternalDetails() {

Check warning on line 502 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L502

Added line #L502 was not covered by tests
if (details == null) {
return new HashMap<>();

Check warning on line 504 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L504

Added line #L504 was not covered by tests
}
return details.entrySet().stream()
.filter(entry -> entry.getKey().startsWith(VmDetailConstants.EXTERNAL_DETAIL_PREFIX))
.collect(Collectors.toMap(
entry -> entry.getKey().substring(VmDetailConstants.EXTERNAL_DETAIL_PREFIX.length()),

Check warning on line 509 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L506-L509

Added lines #L506 - L509 were not covered by tests
Map.Entry::getValue
));
}

Check warning on line 512 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L512

Added line #L512 was not covered by tests
}
28 changes: 27 additions & 1 deletion api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.config.Configuration;
import org.apache.cloudstack.datacenter.DataCenterIpv4GuestSubnet;
import org.apache.cloudstack.extension.Extension;
import org.apache.cloudstack.extension.ExtensionCustomAction;
import org.apache.cloudstack.ha.HAConfig;
import org.apache.cloudstack.network.BgpPeer;
import org.apache.cloudstack.network.Ipv4GuestSubnetNetworkMap;
import org.apache.cloudstack.quota.QuotaTariff;
import org.apache.cloudstack.storage.sharedfs.SharedFS;
import org.apache.cloudstack.storage.object.Bucket;
import org.apache.cloudstack.storage.object.ObjectStore;
import org.apache.cloudstack.storage.sharedfs.SharedFS;
import org.apache.cloudstack.usage.Usage;
import org.apache.cloudstack.vm.schedule.VMSchedule;

Expand Down Expand Up @@ -801,11 +803,25 @@ public class EventTypes {
// Resource Limit
public static final String EVENT_RESOURCE_LIMIT_UPDATE = "RESOURCE.LIMIT.UPDATE";

// VM Lease
public static final String VM_LEASE_EXPIRED = "VM.LEASE.EXPIRED";
public static final String VM_LEASE_DISABLED = "VM.LEASE.DISABLED";
public static final String VM_LEASE_CANCELLED = "VM.LEASE.CANCELLED";
public static final String VM_LEASE_EXPIRING = "VM.LEASE.EXPIRING";

// Extension
public static final String EVENT_EXTENSION_CREATE = "EXTENSION.CREATE";
public static final String EVENT_EXTENSION_UPDATE = "EXTENSION.UPDATE";
public static final String EVENT_EXTENSION_DELETE = "EXTENSION.DELETE";
public static final String EVENT_EXTENSION_RESOURCE_REGISTER = "EXTENSION.RESOURCE.REGISTER";
public static final String EVENT_EXTENSION_RESOURCE_UNREGISTER = "EXTENSION.RESOURCE.UNREGISTER";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_ADD = "EXTENSION.CUSTOM.ACTION.ADD";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_UPDATE = "EXTENSION.CUSTOM.ACTION.UPDATE";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_DELETE = "EXTENSION.CUSTOM.ACTION.DELETE";

// Custom Action
public static final String EVENT_CUSTOM_ACTION = "CUSTOM.ACTION";

static {

// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
Expand Down Expand Up @@ -1306,6 +1322,16 @@ public class EventTypes {
entityEventDetails.put(VM_LEASE_EXPIRING, VirtualMachine.class);
entityEventDetails.put(VM_LEASE_DISABLED, VirtualMachine.class);
entityEventDetails.put(VM_LEASE_CANCELLED, VirtualMachine.class);

// Extension
entityEventDetails.put(EVENT_EXTENSION_CREATE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_UPDATE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_DELETE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_RESOURCE_REGISTER, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_RESOURCE_UNREGISTER, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_ADD, ExtensionCustomAction.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_UPDATE, ExtensionCustomAction.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_DELETE, ExtensionCustomAction.class);
}

public static boolean isNetworkEvent(String eventType) {
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/hypervisor/Hypervisor.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public enum Functionality {
public static final HypervisorType Ovm3 = new HypervisorType("Ovm3", ImageFormat.RAW);
public static final HypervisorType LXC = new HypervisorType("LXC");
public static final HypervisorType Custom = new HypervisorType("Custom", null, EnumSet.of(RootDiskSizeOverride));
public static final HypervisorType External = new HypervisorType("External", null, EnumSet.of(RootDiskSizeOverride));
public static final HypervisorType Any = new HypervisorType("Any"); /*If you don't care about the hypervisor type*/
private final String name;
private final ImageFormat imageFormat;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ public interface NetworkModel {

NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri);

NicProfile getNicProfile(VirtualMachine vm, Nic nic, DataCenter dataCenter);

Set<Long> getAvailableIps(Network network, String requestedIp);

String getDomainNetworkDomain(long domainId, long zoneId);
Expand Down
8 changes: 5 additions & 3 deletions api/src/main/java/com/cloud/network/NetworkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.List;
import java.util.Map;

import com.cloud.dc.DataCenter;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.command.admin.address.ReleasePodIpCmdByAdmin;
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
Expand All @@ -39,13 +38,15 @@
import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
import org.apache.cloudstack.api.response.AcquirePodIpCmdResponse;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;

import com.cloud.dc.DataCenter;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network.IpAddresses;
import com.cloud.network.Network.Service;
import com.cloud.network.Networks.TrafficType;
Expand All @@ -57,7 +58,6 @@
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.Nic;
import com.cloud.vm.NicSecondaryIp;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;

/**
* The NetworkService interface is the "public" api to entities that make requests to the orchestration engine
Expand Down Expand Up @@ -270,4 +270,6 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();

boolean handleCksIsoOnNetworkVirtualRouter(Long virtualRouterId, boolean mount) throws ResourceUnavailableException;

String getNsxSegmentId(long domainId, long accountId, long zoneId, Long vpcId, long networkId);
}
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static enum ImageFormat {
OVA(true, true, true, "ova"),
VHDX(true, true, true, "vhdx"),
BAREMETAL(false, false, false, "BAREMETAL"),
EXTERNAL(false, false, false, "EXTERNAL"),
VMDK(true, true, false, "vmdk"),
VDI(true, true, false, "vdi"),
TAR(false, false, false, "tar"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,6 @@ public enum TemplateFilter {

CPU.CPUArch getArch();

Long getExtensionId();

}
8 changes: 8 additions & 0 deletions api/src/main/java/com/cloud/vm/VmDetailConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ public interface VmDetailConstants {
String GUEST_CPU_MODE = "guest.cpu.mode";
String GUEST_CPU_MODEL = "guest.cpu.model";

// Lease related
String INSTANCE_LEASE_EXPIRY_DATE = "leaseexpirydate";
String INSTANCE_LEASE_EXPIRY_ACTION = "leaseexpiryaction";
String INSTANCE_LEASE_EXECUTION = "leaseactionexecution";

// External orchestrator related
String MAC_ADDRESS = "mac_address";
String EXPUNGE_EXTERNAL_SERVER = "expunge.external.server";
String EXTERNAL_DETAIL_PREFIX = "External:";
String CLOUDSTACK_VM_DETAILS = "cloudstack.vm.details";
String CLOUDSTACK_VLAN = "cloudstack.vlan";
}
27 changes: 27 additions & 0 deletions api/src/main/java/org/apache/cloudstack/acl/RoleType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

// Enum for default roles in CloudStack
public enum RoleType {
Expand Down Expand Up @@ -100,6 +103,30 @@
return roleId;
}

public static int toCombinedMask(Collection<RoleType> roles) {
int combinedMask = 0;

Check warning on line 107 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L106-L107

Added lines #L106 - L107 were not covered by tests
if (roles != null) {
for (RoleType role : roles) {
combinedMask |= role.getMask();
}
}
return combinedMask;
}

Check warning on line 114 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L110-L114

Added lines #L110 - L114 were not covered by tests

public static Set<RoleType> fromCombinedMask(int combinedMask) {
Set<RoleType> roles = EnumSet.noneOf(RoleType.class);

Check warning on line 117 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L116-L117

Added lines #L116 - L117 were not covered by tests
for (RoleType roleType : RoleType.values()) {
if ((combinedMask & roleType.getMask()) != 0) {
roles.add(roleType);

Check warning on line 120 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L120

Added line #L120 was not covered by tests
}
}
if (roles.isEmpty()) {
roles.add(Unknown);

Check warning on line 124 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L124

Added line #L124 was not covered by tests
}
return roles;
}

Check warning on line 127 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L126-L127

Added lines #L126 - L127 were not covered by tests


/**
* This method returns the role account type if the role isn't null, else it returns the default account type.
* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private AlertType(short type, String name, boolean isDefault) {
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_EXTENSION_ENTRY_POINT_OUT_OF_SYNC = new AlertType((short)33, "ALERT.TYPE.EXTENSION.ENTRY.POINT.OUT.OF.SYNC", true);

public short getType() {
return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public enum ApiCommandResourceType {
QuotaTariff(org.apache.cloudstack.quota.QuotaTariff.class),
KubernetesCluster(com.cloud.kubernetes.cluster.KubernetesCluster.class),
KubernetesSupportedVersion(null),
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class);
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class),
Extension(org.apache.cloudstack.extension.Extension.class),
ExtensionCustomAction(org.apache.cloudstack.extension.ExtensionCustomAction.class);

private final Class<?> clazz;

Expand Down
26 changes: 26 additions & 0 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public static final String ALLOCATED_DATE = "allocateddate";
public static final String ALLOCATED_ONLY = "allocatedonly";
public static final String ALLOCATED_TIME = "allocated";
public static final String ALLOWED_ROLE_TYPES = "allowedroletypes";
public static final String ALLOW_USER_FORCE_STOP_VM = "allowuserforcestopvm";
public static final String ANNOTATION = "annotation";
public static final String API_KEY = "apikey";
Expand Down Expand Up @@ -137,6 +138,7 @@
public static final String CUSTOMIZED = "customized";
public static final String CUSTOMIZED_IOPS = "customizediops";
public static final String CUSTOM_ID = "customid";
public static final String CUSTOM_ACTION_ID = "customactionid";
public static final String CUSTOM_JOB_ID = "customjobid";
public static final String CURRENT_START_IP = "currentstartip";
public static final String CURRENT_END_IP = "currentendip";
Expand All @@ -161,6 +163,7 @@
public static final String DISK = "disk";
public static final String DISK_OFFERING_ID = "diskofferingid";
public static final String NEW_DISK_OFFERING_ID = "newdiskofferingid";
public static final String ORCHESTRATOR_REQUIRES_PREPARE_VM = "orchestratorrequirespreparevm";
public static final String OVERRIDE_DISK_OFFERING_ID = "overridediskofferingid";
public static final String DISK_KBS_READ = "diskkbsread";
public static final String DISK_KBS_WRITE = "diskkbswrite";
Expand Down Expand Up @@ -201,7 +204,10 @@
public static final String END_IP = "endip";
public static final String END_IPV6 = "endipv6";
public static final String END_PORT = "endport";
public static final String ENTRY_POINT = "entrypoint";
public static final String ENTRY_POINT_READY = "entrypointready";
public static final String ENTRY_TIME = "entrytime";
public static final String ERROR_MESSAGE = "errormessage";
public static final String EVENT_ID = "eventid";
public static final String EVENT_TYPE = "eventtype";
public static final String EXPIRES = "expires";
Expand All @@ -212,6 +218,12 @@
public static final String EXTRA_DHCP_OPTION_VALUE = "extradhcpvalue";
public static final String EXTERNAL = "external";
public static final String EXTERNAL_UUID = "externaluuid";
public static final String EXTERNAL_DETAILS = "externaldetails";
public static final String PARAMETERS = "parameters";
public static final String EXTENSION = "extension";
public static final String EXTENSION_ID = "extensionid";
public static final String EXTENSION_NAME = "extensionname";
public static final String EXTENSIONS_PATH = "extensionspath";
public static final String FENCE = "fence";
public static final String FETCH_LATEST = "fetchlatest";
public static final String FILESYSTEM = "filesystem";
Expand Down Expand Up @@ -344,6 +356,7 @@
public static final String MAX_BACKUPS = "maxbackups";
public static final String MAX_CPU_NUMBER = "maxcpunumber";
public static final String MAX_MEMORY = "maxmemory";
public static final String MESSAGE = "message";
public static final String MIN_CPU_NUMBER = "mincpunumber";
public static final String MIN_MEMORY = "minmemory";
public static final String MIGRATION_TYPE = "migrationtype";
Expand Down Expand Up @@ -425,6 +438,7 @@
public static final String POST_URL = "postURL";
public static final String POWER_STATE = "powerstate";
public static final String PRECEDENCE = "precedence";
public static final String PREPARE_VM = "preparevm";
public static final String PRIVATE_INTERFACE = "privateinterface";
public static final String PRIVATE_IP = "privateip";
public static final String PRIVATE_PORT = "privateport";
Expand All @@ -446,6 +460,7 @@
public static final String RECOVER = "recover";
public static final String REPAIR = "repair";
public static final String REQUIRES_HVM = "requireshvm";
public static final String RESOURCES = "resources";
public static final String RESOURCE_COUNT = "resourcecount";
public static final String RESOURCE_NAME = "resourcename";
public static final String RESOURCE_TYPE = "resourcetype";
Expand Down Expand Up @@ -517,6 +532,7 @@
public static final String POD_STORAGE_ACCESS_GROUPS = "podstorageaccessgroups";
public static final String ZONE_STORAGE_ACCESS_GROUPS = "zonestorageaccessgroups";
public static final String SUCCESS = "success";
public static final String SUCCESS_MESSAGE = "successmessage";
public static final String SUITABLE_FOR_VM = "suitableforvirtualmachine";
public static final String SUPPORTS_STORAGE_SNAPSHOT = "supportsstoragesnapshot";
public static final String TARGET_IQN = "targetiqn";
Expand Down Expand Up @@ -557,7 +573,10 @@
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
public static final String VALIDATION_FORMAT = "validationformat";
public static final String VALUE = "value";
public static final String VALUE_OPTIONS = "valueoptions";
public static final String VIRTUAL_MACHINE = "virtualmachine";
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
public static final String VIRTUAL_MACHINE_NAME = "virtualmachinename";
Expand Down Expand Up @@ -657,6 +676,7 @@
public static final String ZONE_TOKEN = "zonetoken";
public static final String DHCP_PROVIDER = "dhcpprovider";
public static final String RESULT = "success";
public static final String RESULT1 = "result";
public static final String RESUME = "resume";
public static final String LUN_ID = "lunId";
public static final String IQN = "iqn";
Expand Down Expand Up @@ -1048,6 +1068,7 @@

public static final String RESOURCE_DETAILS = "resourcedetails";
public static final String RESOURCE_ICON = "icon";
public static final String RESOURCE_MAP = "resourcemap";
public static final String EXPUNGE = "expunge";
public static final String FOR_DISPLAY = "fordisplay";
public static final String PASSIVE = "passive";
Expand Down Expand Up @@ -1083,6 +1104,7 @@
public static final String OVM3_CLUSTER = "ovm3cluster";
public static final String OVM3_VIP = "ovm3vip";
public static final String CLEAN_UP_DETAILS = "cleanupdetails";
public static final String CLEAN_UP_PARAMETERS = "cleanupparameters";
public static final String VIRTUAL_SIZE = "virtualsize";
public static final String NETSCALER_CONTROLCENTER_ID = "netscalercontrolcenterid";
public static final String NETSCALER_SERVICEPACKAGE_ID = "netscalerservicepackageid";
Expand Down Expand Up @@ -1307,6 +1329,10 @@
all, resource, min;
}

public enum ExtensionDetails {
all, resource, external, min;

Check warning on line 1333 in api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java#L1332-L1333

Added lines #L1332 - L1333 were not covered by tests
}

public enum ApiKeyAccess {
DISABLED(false),
ENABLED(true),
Expand Down
Loading
Loading