Skip to content

Commit 78d70d3

Browse files
committed
Merge branch 'master' into api_refactoring
- Applies Isaac Chian'gs fix (CLOUDSTACK-648) to allow user change their password - TODO: Fix response, only partially applied Conflicts: api/src/org/apache/cloudstack/api/response/UserResponse.java client/tomcatconf/commands.properties.in server/src/com/cloud/api/ApiResponseHelper.java Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2 parents a3c2bb7 + 5aefd77 commit 78d70d3

20 files changed

Lines changed: 330 additions & 572 deletions

File tree

api/src/org/apache/cloudstack/api/response/UserResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public class UserResponse extends BaseResponse {
7272
@SerializedName("accountid") @Param(description="the account ID of the user")
7373
private String accountId;
7474

75+
@SerializedName("iscallerchilddomain") @Param(description="the boolean value representing if the updating target is in caller's child domain")
76+
private boolean isCallerChildDomain;
7577

7678
@Override
7779
public String getObjectId() {
@@ -196,4 +198,12 @@ public String getAccountId() {
196198
public void setAccountId(String accountId) {
197199
this.accountId = accountId;
198200
}
201+
202+
public boolean getIsCallerSubdomain() {
203+
return this.isCallerChildDomain;
204+
}
205+
206+
public void setIsCallerChildDomain(boolean isCallerChildDomain) {
207+
this.isCallerChildDomain = isCallerChildDomain;
208+
}
199209
}

client/pom.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<groupId>org.apache.cloudstack</groupId>
4545
<artifactId>cloud-plugin-user-authenticator-sha256salted</artifactId>
4646
<version>${project.version}</version>
47-
</dependency>
47+
</dependency>
4848
<dependency>
4949
<groupId>org.apache.cloudstack</groupId>
5050
<artifactId>cloud-plugin-network-nvp</artifactId>
@@ -66,9 +66,9 @@
6666
<version>${project.version}</version>
6767
</dependency>
6868
<dependency>
69-
<groupId>org.apache.cloudstack</groupId>
70-
<artifactId>cloud-plugin-hypervisor-ovm</artifactId>
71-
<version>${project.version}</version>
69+
<groupId>org.apache.cloudstack</groupId>
70+
<artifactId>cloud-plugin-hypervisor-ovm</artifactId>
71+
<version>${project.version}</version>
7272
</dependency>
7373
<dependency>
7474
<groupId>org.apache.cloudstack</groupId>
@@ -290,7 +290,7 @@
290290
</plugins>
291291
<pluginManagement>
292292
<plugins>
293-
<!--This plugin's configuration is used to store Eclipse m2e settings
293+
<!--This plugin's configuration is used to store Eclipse m2e settings
294294
only. It has no influence on the Maven build itself. -->
295295
<plugin>
296296
<groupId>org.eclipse.m2e</groupId>
@@ -324,6 +324,21 @@
324324
</pluginManagement>
325325
</build>
326326
<profiles>
327+
<profile>
328+
<id>simulator</id>
329+
<activation>
330+
<property>
331+
<name>simulator</name>
332+
</property>
333+
</activation>
334+
<dependencies>
335+
<dependency>
336+
<groupId>org.apache.cloudstack</groupId>
337+
<artifactId>cloud-plugin-hypervisor-simulator</artifactId>
338+
<version>${project.version}</version>
339+
</dependency>
340+
</dependencies>
341+
</profile>
327342
<profile>
328343
<id>netapp</id>
329344
<activation>

client/tomcatconf/commands.properties.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ markDefaultZoneForAccount=org.apache.cloudstack.api.command.admin.zone.MarkDefau
3131
#### User commands
3232
createUser=org.apache.cloudstack.api.command.admin.user.CreateUserCmd;3
3333
deleteUser=org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;3
34-
updateUser=org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;3
34+
updateUser=org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;15
3535
listUsers=org.apache.cloudstack.api.command.admin.user.ListUsersCmd;7
3636
lockUser=org.apache.cloudstack.api.command.admin.user.LockUserCmd;7
3737
disableUser=org.apache.cloudstack.api.command.admin.user.DisableUserCmd;7

client/tomcatconf/simulator.properties.in renamed to client/tomcatconf/simulator_commands.properties.in

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
host=127.0.0.1
19-
port=8250
20-
workers=3
21-
zone=1
22-
pod=1
23-
run=13
24-
sequence=r
25-
agent.save.path=/tmp/agents
26-
latency=2
27-
latency.start.range=2
28-
latency.end.range=2
29-
delay.distribution={(5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (10,120)}
30-
property.scan.enabled=1
31-
property.scan.interval=300
18+
19+
configureSimulator=com.cloud.api.commands.ConfigureSimulator;1

developer/developer-prefill.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
-- under the License.
1717

1818
-- Add a default ROOT domain
19+
use cloud;
20+
1921
INSERT INTO `cloud`.`domain` (id, name, parent, path, owner) VALUES
2022
(1, 'ROOT', NULL, '/', 2);
2123

developer/pom.xml

Lines changed: 129 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
22
license agreements. See the NOTICE file distributed with this work for additional
33
information regarding copyright ownership. The ASF licenses this file to
44
you under the Apache License, Version 2.0 (the "License"); you may not use
@@ -9,6 +9,7 @@
99
OF ANY KIND, either express or implied. See the License for the specific
1010
language governing permissions and limitations under the License. -->
1111
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
1213
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1314
<modelVersion>4.0.0</modelVersion>
1415
<artifactId>cloud-developer</artifactId>
@@ -101,6 +102,7 @@
101102
</dependency>
102103
</dependencies>
103104
<configuration>
105+
104106
<driver>org.gjt.mm.mysql.Driver</driver>
105107
<url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url>
106108
<username>${db.cloud.username}</username>
@@ -109,7 +111,6 @@
109111
<skip>${maven.test.skip}</skip>
110112
<forceMojoExecution>true</forceMojoExecution>
111113
</configuration>
112-
113114
<executions>
114115
<execution>
115116
<id>drop-database</id>
@@ -310,15 +311,138 @@
310311
</goals>
311312
<configuration>
312313
<autocommit>true</autocommit>
313-
<srcFiles>
314-
<srcFile>${basedir}/developer-prefill.sql</srcFile>
315-
</srcFiles>
314+
<srcFiles>
315+
<srcFile>${basedir}/developer-prefill.sql</srcFile>
316+
</srcFiles>
316317
</configuration>
317318
</execution>
318319
</executions>
319320
</plugin>
320321
</plugins>
321322
</build>
322323
</profile>
324+
325+
<!-- Simulator profile -->
326+
<profile>
327+
<id>simulator</id>
328+
<activation>
329+
<property><name>deploydb-simulator</name></property>
330+
</activation>
331+
<build>
332+
<plugins>
333+
<plugin>
334+
<groupId>org.codehaus.mojo</groupId>
335+
<artifactId>properties-maven-plugin</artifactId>
336+
<version>1.0-alpha-2</version>
337+
<executions>
338+
<execution>
339+
<phase>initialize</phase>
340+
<goals>
341+
<goal>read-project-properties</goal>
342+
</goals>
343+
<configuration>
344+
<files>
345+
<file>${project.parent.basedir}/utils/conf/db.properties</file>
346+
<file>${project.parent.basedir}/utils/conf/db.properties.override</file>
347+
</files>
348+
<quiet>true</quiet>
349+
</configuration>
350+
</execution>
351+
</executions>
352+
</plugin>
353+
<plugin>
354+
<groupId>org.codehaus.mojo</groupId>
355+
<artifactId>sql-maven-plugin</artifactId>
356+
<version>1.5</version>
357+
<dependencies>
358+
<dependency>
359+
<groupId>mysql</groupId>
360+
<artifactId>mysql-connector-java</artifactId>
361+
<version>${cs.mysql.version}</version>
362+
</dependency>
363+
</dependencies>
364+
<configuration>
365+
<driver>org.gjt.mm.mysql.Driver</driver>
366+
<url>jdbc:mysql://${db.simulator.host}:3306/simulator</url>
367+
<username>${db.simulator.username}</username>
368+
<password>${db.simulator.password}</password>
369+
<skip>${maven.test.skip}</skip>
370+
<forceMojoExecution>true</forceMojoExecution>
371+
</configuration>
372+
<executions>
373+
<execution>
374+
<id>drop-database</id>
375+
<phase>process-test-resources</phase>
376+
<goals>
377+
<goal>execute</goal>
378+
</goals>
379+
<configuration>
380+
<username>root</username>
381+
<password>${db.root.password}</password>
382+
<url>jdbc:mysql://${db.simulator.host}:3306</url>
383+
<sqlCommand>drop database if exists `simulator`</sqlCommand>
384+
</configuration>
385+
</execution>
386+
<execution>
387+
<id>create-database</id>
388+
<phase>process-test-resources</phase>
389+
<goals>
390+
<goal>execute</goal>
391+
</goals>
392+
<configuration>
393+
<username>root</username>
394+
<password>${db.root.password}</password>
395+
<url>jdbc:mysql://${db.simulator.host}:3306</url>
396+
<sqlCommand>create database `simulator`</sqlCommand>
397+
</configuration>
398+
</execution>
399+
<execution>
400+
<id>grant-user-cloud</id>
401+
<phase>process-test-resources</phase>
402+
<goals>
403+
<goal>execute</goal>
404+
</goals>
405+
<configuration>
406+
<username>root</username>
407+
<password>${db.root.password}</password>
408+
<url>jdbc:mysql://${db.simulator.host}:3306</url>
409+
<sqlCommand>GRANT ALL ON simulator.* to
410+
${db.simulator.username}@`localhost` identified by
411+
'${db.simulator.password}';</sqlCommand>
412+
</configuration>
413+
</execution>
414+
<execution>
415+
<id>grant-user-cloud-all</id>
416+
<phase>process-test-resources</phase>
417+
<goals>
418+
<goal>execute</goal>
419+
</goals>
420+
<configuration>
421+
<username>root</username>
422+
<password>${db.root.password}</password>
423+
<url>jdbc:mysql://${db.simulator.host}:3306</url>
424+
<sqlCommand>GRANT ALL ON simulator.* to
425+
${db.simulator.username}@`%` identified by
426+
'${db.simulator.password}';</sqlCommand>
427+
</configuration>
428+
</execution>
429+
<execution>
430+
<id>create-schema</id>
431+
<phase>process-test-resources</phase>
432+
<goals>
433+
<goal>execute</goal>
434+
</goals>
435+
<configuration>
436+
<srcFiles>
437+
<srcFile>${basedir}/target/db/create-schema-simulator.sql</srcFile>
438+
<srcFile>${basedir}/target/db/templates.simulator.sql</srcFile>
439+
</srcFiles>
440+
</configuration>
441+
</execution>
442+
</executions>
443+
</plugin>
444+
</plugins>
445+
</build>
446+
</profile>
323447
</profiles>
324448
</project>

plugins/hypervisors/simulator/resources/components-simulator.xml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ specific language governing permissions and limitations
1818
under the License.
1919
-->
2020
<components-simulator.xml>
21-
<system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
21+
<system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
2222
<checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
2323
<checker name="EncryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker"/>
2424
<checker name="DatabaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"/>
@@ -30,44 +30,12 @@ under the License.
3030
<dao name="Configuration configuration server" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
3131
<param name="premium">true</param>
3232
</dao>
33-
<adapters key="com.cloud.agent.manager.allocator.HostAllocator">
34-
<adapter name="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator"/>
35-
</adapters>
36-
<adapters key="com.cloud.storage.allocator.StoragePoolAllocator">
37-
<adapter name="LocalStorage" class="com.cloud.storage.allocator.LocalStoragePoolAllocator"/>
38-
<adapter name="Storage" class="com.cloud.storage.allocator.FirstFitStoragePoolAllocator"/>
39-
</adapters>
40-
<adapters key="com.cloud.agent.manager.allocator.PodAllocator">
41-
<adapter name="User First" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator"/>
42-
</adapters>
43-
<adapters key="com.cloud.consoleproxy.ConsoleProxyAllocator">
44-
<adapter name="Balance" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator"/>
45-
</adapters>
46-
<adapters key="com.cloud.ha.Investigator">
47-
<adapter name="SimpleInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator"/>
48-
<adapter name="PingInvestigator" class="com.cloud.ha.UserVmDomRInvestigator"/>
49-
<adapter name="ManagementIPSysVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator"/>
50-
</adapters>
5133
<adapters key="com.cloud.resource.Discoverer">
5234
<adapter name="Simulator Agent" class="com.cloud.resource.SimulatorDiscoverer"/>
53-
<adapter name="SecondaryStorage" class="com.cloud.resource.SimulatorSecondaryDiscoverer"/>
54-
<adapter name="XCP Agent" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer"/>
55-
<adapter name="SecondaryStorage" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer"/>
56-
<adapter name="KVM Agent" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer"/>
35+
<adapter name="SimulatorSecondaryStorage" class="com.cloud.resource.SimulatorSecondaryDiscoverer"/>
5736
</adapters>
5837
<adapters key="com.cloud.hypervisor.HypervisorGuru">
5938
<adapter name="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru"/>
60-
<adapter name="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru"/>
61-
<adapter name="KVMGuru" class="com.cloud.hypervisor.KVMGuru"/>
62-
</adapters>
63-
<adapters key="com.cloud.deploy.DeploymentPlanner">
64-
<adapter name="First Fit" class="com.cloud.deploy.FirstFitPlanner"/>
65-
<adapter name="UserDispersing" class="com.cloud.deploy.UserDispersingPlanner"/>
66-
<adapter name="UserConcentratedPod" class="com.cloud.deploy.UserConcentratedPodPlanner"/>
67-
<adapter name="BareMetal Fit" class="com.cloud.deploy.BareMetalPlanner"/>
68-
</adapters>
69-
<adapters key="com.cloud.agent.StartupCommandProcessor">
70-
<adapter name="BasicAgentAuthorizer" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager"/>
7139
</adapters>
7240
</management-server>
7341
<configuration-server class="com.cloud.server.ConfigurationServerImpl" extends="components.xml:configuration-server">
@@ -95,4 +63,4 @@ under the License.
9563
<dao name="Site2SiteVpnGatewayDao" class="com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl" singleton="false"/>
9664
<dao name="Site2SiteVpnConnectionDao" class="com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl" singleton="false"/>
9765
</configuration-server>
98-
</components-simulator.xml>
66+
</components-simulator.xml>

plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManager.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,7 @@
3535
import com.cloud.agent.api.SecStorageSetupCommand;
3636
import com.cloud.agent.api.SecStorageVMSetupCommand;
3737
import com.cloud.agent.api.StoragePoolInfo;
38-
import com.cloud.agent.api.storage.CopyVolumeAnswer;
39-
import com.cloud.agent.api.storage.CopyVolumeCommand;
40-
import com.cloud.agent.api.storage.CreateAnswer;
41-
import com.cloud.agent.api.storage.CreateCommand;
42-
import com.cloud.agent.api.storage.DeleteTemplateCommand;
43-
import com.cloud.agent.api.storage.DestroyCommand;
44-
import com.cloud.agent.api.storage.DownloadCommand;
45-
import com.cloud.agent.api.storage.DownloadProgressCommand;
46-
import com.cloud.agent.api.storage.ListTemplateCommand;
47-
import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer;
48-
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
38+
import com.cloud.agent.api.storage.*;
4939
import com.cloud.utils.component.Manager;
5040

5141
public interface MockStorageManager extends Manager {
@@ -64,6 +54,7 @@ public interface MockStorageManager extends Manager {
6454

6555
public Answer SecStorageSetup(SecStorageSetupCommand cmd);
6656
public Answer ListTemplates(ListTemplateCommand cmd);
57+
public Answer ListVolumes(ListVolumeCommand cmd);
6758
public Answer Destroy(DestroyCommand cmd);
6859
public Answer Download(DownloadCommand cmd);
6960
public Answer DownloadProcess(DownloadProgressCommand cmd);

0 commit comments

Comments
 (0)