Skip to content

Commit a0c2a9f

Browse files
committed
Resolve conflicts
2 parents 976f2e1 + 5a8a1e2 commit a0c2a9f

File tree

59 files changed

+1942
-300
lines changed

Some content is hidden

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

59 files changed

+1942
-300
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public class ApiConstants {
8080
public static final String BYTES_WRITE_RATE_MAX = "byteswriteratemax";
8181
public static final String BYTES_WRITE_RATE_MAX_LENGTH = "byteswriteratemaxlength";
8282
public static final String BYPASS_VLAN_OVERLAP_CHECK = "bypassvlanoverlapcheck";
83+
public static final String CALLER = "caller";
8384
public static final String CAPACITY = "capacity";
8485
public static final String CATEGORY = "category";
8586
public static final String CAN_REVERT = "canrevert";

api/src/main/java/org/apache/cloudstack/api/command/user/consoleproxy/CreateConsoleEndpointCmd.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.apache.cloudstack.context.CallContext;
3636
import org.apache.cloudstack.utils.consoleproxy.ConsoleAccessUtils;
3737
import org.apache.commons.collections.MapUtils;
38+
import org.apache.commons.lang3.ObjectUtils;
3839

3940
import javax.inject.Inject;
4041
import java.util.Map;
@@ -86,6 +87,10 @@ private CreateConsoleEndpointResponse createResponse(ConsoleEndpoint endpoint) {
8687
}
8788

8889
private ConsoleEndpointWebsocketResponse createWebsocketResponse(ConsoleEndpoint endpoint) {
90+
if (ObjectUtils.allNull(endpoint.getWebsocketHost(), endpoint.getWebsocketPort(), endpoint.getWebsocketPath(),
91+
endpoint.getWebsocketToken(), endpoint.getWebsocketExtra())) {
92+
return null;
93+
}
8994
ConsoleEndpointWebsocketResponse wsResponse = new ConsoleEndpointWebsocketResponse();
9095
wsResponse.setHost(endpoint.getWebsocketHost());
9196
wsResponse.setPort(endpoint.getWebsocketPort());

api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ public void setNetworkAvailable(String networkAvailable) {
569569

570570
@Override
571571
public void setVpcLimit(String vpcLimit) {
572-
this.vpcLimit = networkLimit;
572+
this.vpcLimit = vpcLimit;
573573
}
574574

575575
@Override
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
// with 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 com.cloud.agent.api;
19+
20+
public class GetExternalConsoleAnswer extends Answer {
21+
22+
private String url;
23+
private String host;
24+
private Integer port;
25+
@LogLevel(LogLevel.Log4jLevel.Off)
26+
private String password;
27+
private String protocol;
28+
private boolean passwordOneTimeUseOnly;
29+
30+
public GetExternalConsoleAnswer(Command command, String details) {
31+
super(command, false, details);
32+
}
33+
34+
public GetExternalConsoleAnswer(Command command, String url, String host, Integer port, String password,
35+
boolean passwordOneTimeUseOnly, String protocol) {
36+
super(command, true, "");
37+
this.url = url;
38+
this.host = host;
39+
this.port = port;
40+
this.password = password;
41+
this.passwordOneTimeUseOnly = passwordOneTimeUseOnly;
42+
this.protocol = protocol;
43+
}
44+
45+
public String getUrl() {
46+
return url;
47+
}
48+
49+
public String getHost() {
50+
return host;
51+
}
52+
53+
public Integer getPort() {
54+
return port;
55+
}
56+
57+
public String getPassword() {
58+
return password;
59+
}
60+
61+
public String getProtocol() {
62+
return protocol;
63+
}
64+
65+
public boolean isPasswordOneTimeUseOnly() {
66+
return passwordOneTimeUseOnly;
67+
}
68+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
// with 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 com.cloud.agent.api;
19+
20+
import com.cloud.agent.api.to.VirtualMachineTO;
21+
22+
public class GetExternalConsoleCommand extends Command {
23+
String vmName;
24+
VirtualMachineTO vm;
25+
protected boolean executeInSequence;
26+
27+
public GetExternalConsoleCommand(String vmName, VirtualMachineTO vm) {
28+
this.vmName = vmName;
29+
this.vm = vm;
30+
this.executeInSequence = false;
31+
}
32+
33+
public String getVmName() {
34+
return this.vmName;
35+
}
36+
37+
public void setVirtualMachine(VirtualMachineTO vm) {
38+
this.vm = vm;
39+
}
40+
41+
public VirtualMachineTO getVirtualMachine() {
42+
return vm;
43+
}
44+
45+
@Override
46+
public boolean executeInSequence() {
47+
return executeInSequence;
48+
}
49+
50+
public void setExecuteInSequence(boolean executeInSequence) {
51+
this.executeInSequence = executeInSequence;
52+
}
53+
}

core/src/main/java/com/cloud/agent/api/RunCustomActionCommand.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
import java.util.Map;
2323

24+
import com.cloud.agent.api.to.VirtualMachineTO;
25+
2426
public class RunCustomActionCommand extends Command {
2527

2628
String actionName;
27-
Long vmId;
29+
VirtualMachineTO vmTO;
2830
Map<String, Object> parameters;
2931

3032
public RunCustomActionCommand(String actionName) {
@@ -36,12 +38,12 @@ public String getActionName() {
3638
return actionName;
3739
}
3840

39-
public Long getVmId() {
40-
return vmId;
41+
public VirtualMachineTO getVmTO() {
42+
return vmTO;
4143
}
4244

43-
public void setVmId(Long vmId) {
44-
this.vmId = vmId;
45+
public void setVmTO(VirtualMachineTO vmTO) {
46+
this.vmTO = vmTO;
4547
}
4648

4749
public Map<String, Object> getParameters() {

engine/components-api/src/main/java/com/cloud/hypervisor/ExternalProvisioner.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import java.util.Map;
2020

21+
import com.cloud.agent.api.GetExternalConsoleAnswer;
22+
import com.cloud.agent.api.GetExternalConsoleCommand;
2123
import com.cloud.agent.api.HostVmStateReportEntry;
2224
import com.cloud.agent.api.PrepareExternalProvisioningAnswer;
2325
import com.cloud.agent.api.PrepareExternalProvisioningCommand;
@@ -57,5 +59,7 @@ public interface ExternalProvisioner extends Manager {
5759

5860
Map<String, HostVmStateReportEntry> getHostVmStateReport(long hostId, String extensionName, String extensionRelativePath);
5961

62+
GetExternalConsoleAnswer getInstanceConsole(String hostGuid, String extensionName, String extensionRelativePath, GetExternalConsoleCommand cmd);
63+
6064
RunCustomActionAnswer runCustomAction(String hostGuid, String extensionName, String extensionRelativePath, RunCustomActionCommand cmd);
6165
}

engine/schema/src/main/java/com/cloud/usage/dao/UsageBackupDaoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void removeUsage(Long accountId, Long vmId, Long backupOfferingId, Date e
6868
pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), eventDate));
6969
pstmt.setLong(2, accountId);
7070
pstmt.setLong(3, vmId);
71-
pstmt.setLong(3, backupOfferingId);
71+
pstmt.setLong(4, backupOfferingId);
7272
pstmt.executeUpdate();
7373
}
7474
} catch (SQLException e) {

engine/schema/src/main/resources/META-INF/db/schema-42100to42200.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,11 @@ CALL `cloud`.`IDEMPOTENT_CHANGE_COLUMN`('cloud.domain_router', 'scripts_version'
2929
-- Increase the cache_mode column size from cloud.disk_offering table
3030
CALL `cloud`.`IDEMPOTENT_CHANGE_COLUMN`('cloud.disk_offering', 'cache_mode', 'cache_mode', 'varchar(18) DEFAULT "none" COMMENT "The disk cache mode to use for disks created with this offering"');
3131

32+
-- Add uuid column to ldap_configuration table
33+
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.ldap_configuration', 'uuid', 'VARCHAR(40) NOT NULL');
34+
35+
-- Populate uuid for existing rows where uuid is NULL or empty
36+
UPDATE `cloud`.`ldap_configuration` SET uuid = UUID() WHERE uuid IS NULL OR uuid = '';
37+
3238
-- Add the column cross_zone_instance_creation to cloud.backup_repository. if enabled it means that new Instance can be created on all Zones from Backups on this Repository.
3339
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_repository', 'cross_zone_instance_creation', 'TINYINT(1) DEFAULT NULL COMMENT ''Backup Repository can be used for disaster recovery on another zone''');

extensions/HyperV/hyperv.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def fail(message):
28-
print(json.dumps({"error": message}))
28+
print(json.dumps({"status": "error", "error": message}))
2929
sys.exit(1)
3030

3131

@@ -220,6 +220,9 @@ def delete(self):
220220
fail(str(e))
221221
succeed({"status": "success", "message": "Instance deleted"})
222222

223+
def get_console(self):
224+
fail("Operation not supported")
225+
223226
def suspend(self):
224227
self.run_ps(f'Suspend-VM -Name "{self.data["vmname"]}"')
225228
succeed({"status": "success", "message": "Instance suspended"})
@@ -283,6 +286,7 @@ def main():
283286
"reboot": manager.reboot,
284287
"delete": manager.delete,
285288
"status": manager.status,
289+
"getconsole": manager.get_console,
286290
"suspend": manager.suspend,
287291
"resume": manager.resume,
288292
"listsnapshots": manager.list_snapshots,

0 commit comments

Comments
 (0)