Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
4f779c2
remove the unnecessary check for tags when migrating volumes
Aug 10, 2020
d339b54
Merge pull request #3 from atrocitytheme/main
atrocitytheme Jul 15, 2021
0415cbc
error handling complates
cron-ns Jul 16, 2021
cbe380a
Externalize secondary storage capacity threshold (#4790)
GutoVeronezi Jul 16, 2021
ff07fee
api: Fix deprecation of CIDR_LIST parameter (#5211)
srgoni Jul 16, 2021
15d3d39
UI: bulk action support for various resources (#5034)
Pearl1594 Jul 16, 2021
4542f6b
Merge pull request #5 from atrocitytheme/test
atrocitytheme Jul 16, 2021
96c9c5a
Added disk provisioning type support for VMWare (#4640)
Spaceman1984 Jul 17, 2021
f7fdc8a
Do remove volume only on expunge (#5213)
sureshanaparti Jul 17, 2021
05a978c
Externalize kvm agent storage timeout configuration (#4585)
GutoVeronezi Jul 19, 2021
535761b
UI: Refactor async job polling codebase-wide (#4782)
Jul 19, 2021
03e380f
modify usage manager
cron-ns Jul 19, 2021
4d6d6cf
change the usage server
cron-ns Jul 19, 2021
678d9d8
debug logger enabled
cron-ns Jul 19, 2021
8ea6949
fix the usage event snapshot event recording
cron-ns Jul 20, 2021
794ca8f
Merge pull request #6 from atrocitytheme/test
atrocitytheme Jul 20, 2021
27d674d
Merge branch '4.15' into main
davidjumani Jul 20, 2021
908bf98
ui: Fix title error
davidjumani Jul 20, 2021
6f93e5c
Revert "Externalize kvm agent storage timeout configuration (#4585)" …
DaanHoogland Jul 20, 2021
1f743e9
api: Add 'created' field to API response (#5210)
Pearl1594 Jul 20, 2021
61de489
ui: Replace bulk delete icons (#5222)
davidjumani Jul 21, 2021
84e52c9
ui: Fix async poll job (#5221)
davidjumani Jul 21, 2021
c4388d7
ui: Refresh only on current / parent page (#5214)
davidjumani Jul 21, 2021
1f8b34f
add entity-type to message when no UUID is found for a DB ID (#5163)
DaanHoogland Jul 21, 2021
eb3acc3
Externalize tls version and security protocols configuration on mail …
GutoVeronezi Jul 21, 2021
eff2da2
Refactor and improvements for method com.cloud.hypervisor.kvm.resourc…
SadiJr Jul 21, 2021
c23cbdf
Remove condition that are prevent resizing for root volumes (vmware) …
DK101010 Jul 22, 2021
d9eac6e
add front end for clone virtuial machine
cron-ns Jul 25, 2021
14fa30c
fix lint
cron-ns Jul 25, 2021
0d893f0
modify show condition
cron-ns Jul 25, 2021
c72654c
change ui icon
cron-ns Jul 25, 2021
b065e79
ui: Fix refresh issue (#5232)
davidjumani Jul 26, 2021
29090fe
Only display information, if they are relevant (#5206)
mib1185 Jul 26, 2021
7678bc1
ui bug fix: scalevm is disabled when vm is Stopped (#5233)
weizhouapache Jul 26, 2021
8efc3ea
UI: Submit the form when press CTRL + ENTER (#4766)
Jul 26, 2021
446337b
Fix of shrinking volumes with QCOW2 format (#5225)
slavkap Jul 26, 2021
3c1219a
Add logs to api removeVpnUser (#4616)
GutoVeronezi Jul 27, 2021
37f3fc3
Merge remote-tracking branch 'apache/4.15' into main
davidjumani Jul 27, 2021
87ee866
ui: vmware vm import-unmanage (#5075)
shwstppr Jul 27, 2021
6cd5b36
[UI] Add Shift key for noVNC consoles (#5237)
GabrielBrascher Jul 27, 2021
2643854
ui: Fix current for vmsnapshots (#5247)
davidjumani Jul 27, 2021
a436869
ui: Fix comparator for boolean (#5246)
davidjumani Jul 27, 2021
0c6b8fe
ui: Update header notice if job failed (#5245)
davidjumani Jul 27, 2021
826e479
api: Fix pagination for list PublicIPAddresses (#5231)
Pearl1594 Jul 27, 2021
8ed5a4f
ui: fix create shared network with multi-zone (#5205)
shwstppr Jul 27, 2021
6540d99
ui: submit form with false boolean params (#5224)
shwstppr Jul 27, 2021
c6cb30d
Merge remote-tracking branch 'origin/4.15' into main
yadvr Jul 27, 2021
1f5ee5b
Improve logs on ConsoleProxyManagerImpl and refactor a few process (#…
GutoVeronezi Jul 27, 2021
b0ab18b
ping first test case
cron-ns Jul 28, 2021
a423887
fix checkstyle
cron-ns Jul 28, 2021
4a3fc6d
fix null mackito
cron-ns Jul 28, 2021
7b752c3
Externalize KVM Agent storage's timeout configuration (#5239)
GutoVeronezi Jul 28, 2021
490658c
display nics deviceid and order nics by deviceid on Nics tab of insta…
soreana Jul 28, 2021
83a25c8
Merge pull request #7 from atrocitytheme/test
atrocitytheme Jul 28, 2021
98d4275
Merge pull request #4257 from RodrigoDLopez/Remove_tags_check_when_mi…
harikrishna-patnala Jul 29, 2021
5033426
ui: fix import instance form root disk label (#5252)
shwstppr Jul 29, 2021
c24aee9
ui: fix error using value of ip6dns1 for ip6dns2 (#5253)
Jul 30, 2021
61fd402
vmware: VR health check in vmware basic zone (#5236)
weizhouapache Jul 30, 2021
1ccd61c
[TEST] - Test unit - Fix failing UI unit test 4.15 branch (#5219)
Jul 30, 2021
db31e67
Merge remote-tracking branch 'origin/4.15' into main
yadvr Jul 30, 2021
66e7bde
ui: Fix failing UI (#5263)
davidjumani Jul 30, 2021
0d8b4de
Cleaning up code and enhancing a few IP management logs (#4714)
GabrielBrascher Jul 30, 2021
82df04e
Improve HA logs (#5241)
GutoVeronezi Jul 30, 2021
d6a77a7
Allow updating the storage/host tags of service offerings (#5043)
slavkap Aug 2, 2021
5b20e6f
ui: fix import instance form for recent changes (#5257)
shwstppr Aug 2, 2021
450de92
ui: Fix failing UI unit test main branch (#5262)
Aug 3, 2021
75a2c0b
Add YouTube channel link in the README (#5272)
GabrielBrascher Aug 5, 2021
d8c407d
ui: Add 'on / off' to status icon and make it case insensitive (#5278)
davidjumani Aug 5, 2021
b6350be
Merge branch '4.15' into main
nvazquez Aug 6, 2021
f9fbd86
ui: Fix failure in deletion of templates (#5283)
Pearl1594 Aug 6, 2021
d925bed
add integration test for clone
cron-ns Aug 6, 2021
f421a96
ui: fix handle action response (#5285)
shwstppr Aug 6, 2021
766fc80
ui: fix capitalise filter (#5269)
shwstppr Aug 6, 2021
cdbbd60
add clone tag to test
cron-ns Aug 6, 2021
6af4d28
fix the virtualmachine id attribute
cron-ns Aug 6, 2021
a743d20
fix the integration target
cron-ns Aug 7, 2021
1194b63
debug msg and vm id logged
cron-ns Aug 8, 2021
0521448
fix the size integration test
cron-ns Aug 8, 2021
de15e9d
fix the resource limit check
cron-ns Aug 8, 2021
76f9869
fix min root size
cron-ns Aug 8, 2021
dee4406
fix size error when the template is not healthy
cron-ns Aug 8, 2021
b1ad52c
fix the permission issue
cron-ns Aug 8, 2021
9401571
finish the assertion of clone vm integration test
cron-ns Aug 8, 2021
0cafec9
migrate clone vm to seperate class cycle test
cron-ns Aug 8, 2021
43d00b3
fix typo
cron-ns Aug 8, 2021
43c8da2
API-call to declare host as Degraded (#4111)
GabrielBrascher Aug 8, 2021
ee5b01f
ui: Show host as unsecure in listview (#5292)
davidjumani Aug 9, 2021
05d1d56
vr: restart conntrackd instead of '/usr/sbin/conntrackd -d' (#5275)
weizhouapache Aug 9, 2021
1389862
engine/storage: Fix regression on create volume from snapshot (#5282)
GutoVeronezi Aug 9, 2021
d9503f4
UI - Zone Wizard - Fixes the IP range form fields are too narrow (#5287)
Aug 9, 2021
95de827
server: Fix migration issue in UserVmManagerImpl.migrateVirtualMachin…
GabrielBrascher Aug 9, 2021
1ccb420
server: skip zone check for PERHOST iso during attachIso (#5270)
shwstppr Aug 9, 2021
2f8d557
api: Change GET/POST request max length of VM user data to 4K/1M (#4737)
ravening Aug 9, 2021
949cf71
api: Display last updated time for VM (#4685)
ravening Aug 9, 2021
ea7d3b3
Cleanup volume information from db when deleted (#4551)
Pearl1594 Aug 9, 2021
3c8c704
kubernetes: Deploy kubernetes-provider when creating a cluster (#5254)
davidjumani Aug 9, 2021
cb1078a
Merge remote-tracking branch 'apache/4.15' into main
davidjumani Aug 9, 2021
d5015d7
ui: Prettify ManageInstances.vue (#5295)
davidjumani Aug 9, 2021
fa552ce
Test (#8)
atrocitytheme Aug 9, 2021
846efdb
server: Optional destination host when migrate a vm (#4378)
ustcweizhou Aug 10, 2021
3395a65
ui: Prevent sending default false for isdynamicallyscalable, haenable…
davidjumani Aug 10, 2021
55174d5
add ref=submit missing in button (#5298)
Aug 11, 2021
1182051
UI: Add multiple management server support (#4885)
Aug 11, 2021
75b335e
Merge branch '4.15' into main
nvazquez Aug 11, 2021
6581a1b
test/vmware: add live migratevmwithvolume test and fix (#5289)
shwstppr Aug 11, 2021
fb0dedc
ui: fix display host hypervisorversion (#5301)
shwstppr Aug 11, 2021
8680f7d
UI: Dark mode toggle button on Management Server (#5052)
Aug 11, 2021
0011d45
Merge branch '4.15' into main
nvazquez Aug 11, 2021
2a4c2c2
Global setting to select preferred storage pool (#5249)
ravening Aug 12, 2021
2786582
Add new registers in guest_os (#4699)
GutoVeronezi Aug 12, 2021
28e70c0
Add missing labels (#5305)
davidjumani Aug 12, 2021
13bb0a5
refactor the clone to service layer
cron-ns Aug 13, 2021
8b55262
fix checkstyle
cron-ns Aug 13, 2021
56f4d1c
server style fix:
cron-ns Aug 13, 2021
4efd6b6
fix custom id option
cron-ns Aug 13, 2021
d65ab7b
Merge pull request #9 from atrocitytheme/test
atrocitytheme Aug 13, 2021
aa02972
fix virtualmachine id variable naming
cron-ns Aug 13, 2021
a669bf0
Merge pull request #10 from atrocitytheme/test
atrocitytheme Aug 13, 2021
1bfb2f9
disable hot add memory and cpu via vm settings (#4630)
DK101010 Aug 13, 2021
1d17d7c
Add internal cs name to vm during the ingest (#5242)
DK101010 Aug 13, 2021
87ddc76
db: make *_details.value non-nullable (#5274)
shwstppr Aug 14, 2021
0a2a524
vmware: get recommended disk controller only when root or data disk c…
weizhouapache Aug 15, 2021
2215cd7
Merge branch '4.15' into main
nvazquez Aug 16, 2021
349120f
Externalize config to enable manually setting CPU topology on KVM VM …
GutoVeronezi Aug 16, 2021
9f58ebd
resolve conflit
cron-ns Aug 16, 2021
53cbda0
resolve main branch conflict
cron-ns Aug 16, 2021
feb0325
Merge branch 'test' of github.com:atrocitytheme/cloudstack into test
cron-ns Aug 16, 2021
5fa517e
fix remaining bugs and refactor
cron-ns Aug 17, 2021
8abf141
remove getter and setter of cloneVmCmd
cron-ns Aug 18, 2021
50d250e
fix checkstyle:trailingspace
cron-ns Aug 18, 2021
ee6ce66
change execute sequence and apply new tests
cron-ns Aug 18, 2021
9ffd335
fix null name
cron-ns Aug 18, 2021
862f901
fix ui
cron-ns Aug 18, 2021
28e417c
typo check
cron-ns Aug 18, 2021
4e7f40f
fix null pointer
cron-ns Aug 18, 2021
a44bba9
add new test
cron-ns Aug 18, 2021
826ea4d
finish the test
cron-ns Aug 18, 2021
2ab2472
update the smoke test to ignore specific vm
cron-ns Aug 19, 2021
c3e836a
fix restore vm
cron-ns Aug 19, 2021
2fd4ca0
fix typo and delete trivial comments
cron-ns Aug 22, 2021
6ff0ce4
optimize test implementation
cron-ns Aug 22, 2021
520e951
add clean up resources
cron-ns Aug 22, 2021
5072889
fix the orchestrator
cron-ns Aug 24, 2021
a1e22b7
add None checker if kvm enabled var doesn't exist
cron-ns Aug 24, 2021
ae25c4a
add cleanup code
cron-ns Aug 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions 1 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ via Github pull requests.
* Design [documents](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Design)
* API [documentation](https://cloudstack.apache.org/api.html)
* How to [contribute](CONTRIBUTING.md)
* Check the [YouTube channel](https://www.youtube.com/ApacheCloudStack) for presentations, interviews, and more

## Getting Involved and Contributing

Expand Down
7 changes: 7 additions & 0 deletions 7 agent/conf/agent.properties
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,10 @@ iscsi.session.cleanup.enabled=false
# Automatically clean up iscsi sessions not attached to any VM.
# Should be enabled for users using managed storage for example solidfire.
# Should be disabled for users with unmanaged iscsi connections on their hosts

# This parameter specifies the heartbeat update timeout in ms; The default value is 60000ms (1 min).
# Depending on the use case, this timeout might need increasing/decreasing.
# heartbeat.update.timeout=60000

# Enable manually setting CPU's topology on KVM's VM.
# enable.manually.setting.cpu.topology.on.kvm.vm=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cloud.agent.properties;

/**
* Class of constant agent's properties available to configure on
* "agent.properties".
*<br><br>
* Not all available agent properties are defined here, but we should work to
* migrate them on demand to this class.
*
* @param <T> type of the default value.
*/
public class AgentProperties{

/**
* Heartbeat update timeout. <br>
* Data type: int. <br>
* Default value: 60000 (ms).
*/
public static final Property<Integer> HEARTBEAT_UPDATE_TIMEOUT = new Property<Integer>("heartbeat.update.timeout", 60000);

/**
* Enable manually setting CPU's topology on KVM's VM. <br>
* Data type: boolean.<br>
* Default value: true.
*/
public static final Property<Boolean> ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM = new Property<Boolean>("enable.manually.setting.cpu.topology.on.kvm.vm", true);

public static class Property <T>{
private final String name;
private final T defaultValue;

private Property(String name, T value) {
this.name = name;
this.defaultValue = value;
}

public String getName() {
return name;
}

public T getDefaultValue() {
return defaultValue;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cloud.agent.properties;

import com.cloud.utils.PropertiesUtil;
import java.io.File;
import java.io.IOException;
import org.apache.cloudstack.utils.security.KeyStoreUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.IntegerConverter;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;

/**
* This class provides a facility to read the agent's properties file and get
* its properties, according to the {@link AgentProperties} properties constants.
*
*/
public class AgentPropertiesFileHandler {

private static final Logger logger = Logger.getLogger(AgentPropertiesFileHandler.class);

/**
* This method reads the property in the agent.properties file.
*
* @param property the property to retrieve.
* @return The value of the property. If the property is not available, the
* default defined value will be used.
*/
public static <T> T getPropertyValue(AgentProperties.Property<T> property) {
T defaultValue = property.getDefaultValue();
String name = property.getName();

File agentPropertiesFile = PropertiesUtil.findConfigFile(KeyStoreUtils.AGENT_PROPSFILE);

if (agentPropertiesFile != null) {
try {
String configValue = PropertiesUtil.loadFromFile(agentPropertiesFile).getProperty(name);
if (StringUtils.isNotBlank(configValue)) {
if (defaultValue instanceof Integer) {
ConvertUtils.register(new IntegerConverter(defaultValue), Integer.class);
}

return (T)ConvertUtils.convert(configValue, defaultValue.getClass());
} else {
logger.debug(String.format("Property [%s] has empty or null value. Using default value [%s].", name, defaultValue));
}
} catch (IOException ex) {
logger.debug(String.format("Failed to get property [%s]. Using default value [%s].", name, defaultValue), ex);
}
} else {
logger.debug(String.format("File [%s] was not found, we will use default defined values. Property [%s]: [%s].", KeyStoreUtils.AGENT_PROPSFILE, name, defaultValue));
}

return defaultValue;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.cloud.agent.properties;

import com.cloud.utils.PropertiesUtil;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import junit.framework.TestCase;
import org.apache.commons.beanutils.ConvertUtils;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

@RunWith(PowerMockRunner.class)
@PrepareForTest({PropertiesUtil.class, ConvertUtils.class})
public class AgentPropertiesFileHandlerTest extends TestCase {

@Mock
AgentProperties.Property<String> agentPropertiesStringMock;

@Mock
AgentProperties.Property<Integer> agentPropertiesIntegerMock;

@Mock
File fileMock;

@Mock
Properties propertiesMock;

@Test
public void validateGetPropertyValueFileNotFoundReturnDefaultValue() throws Exception{
String expectedResult = "default value";
Mockito.doReturn(expectedResult).when(agentPropertiesStringMock).getDefaultValue();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(null).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());

String result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesStringMock);

Assert.assertEquals(expectedResult, result);
}

@Test
public void validateGetPropertyValueLoadFromFileThrowsIOExceptionReturnDefaultValue() throws Exception{
String expectedResult = "default value";
Mockito.doReturn(expectedResult).when(agentPropertiesStringMock).getDefaultValue();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(fileMock).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());
PowerMockito.doThrow(new IOException()).when(PropertiesUtil.class, "loadFromFile", Mockito.any());

String result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesStringMock);

Assert.assertEquals(expectedResult, result);
}

@Test
public void validateGetPropertyValuePropertyIsEmptyReturnDefaultValue() throws Exception{
String expectedResult = "default value";
Mockito.doReturn(expectedResult).when(agentPropertiesStringMock).getDefaultValue();
Mockito.doReturn("name").when(agentPropertiesStringMock).getName();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(fileMock).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());
PowerMockito.doReturn(propertiesMock).when(PropertiesUtil.class, "loadFromFile", Mockito.any());
PowerMockito.doReturn("").when(propertiesMock).getProperty(Mockito.anyString());

String result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesStringMock);

Assert.assertEquals(expectedResult, result);
}

@Test
public void validateGetPropertyValuePropertyIsNullReturnDefaultValue() throws Exception{
String expectedResult = "default value";
Mockito.doReturn(expectedResult).when(agentPropertiesStringMock).getDefaultValue();
Mockito.doReturn("name").when(agentPropertiesStringMock).getName();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(fileMock).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());
PowerMockito.doReturn(propertiesMock).when(PropertiesUtil.class, "loadFromFile", Mockito.any());
PowerMockito.doReturn(null).when(propertiesMock).getProperty(Mockito.anyString());

String result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesStringMock);

Assert.assertEquals(expectedResult, result);
}

@Test
public void validateGetPropertyValueValidPropertyReturnPropertyValue() throws Exception{
String expectedResult = "test";
Mockito.doReturn("default value").when(agentPropertiesStringMock).getDefaultValue();
Mockito.doReturn("name").when(agentPropertiesStringMock).getName();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(fileMock).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());
PowerMockito.doReturn(propertiesMock).when(PropertiesUtil.class, "loadFromFile", Mockito.any());
Mockito.doReturn(expectedResult).when(propertiesMock).getProperty(Mockito.anyString());

String result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesStringMock);

Assert.assertEquals(expectedResult, result);
}

@Test
public void validateGetPropertyValueValidIntegerPropertyReturnPropertyValue() throws Exception{
Integer expectedResult = 2;
Mockito.doReturn(1).when(agentPropertiesIntegerMock).getDefaultValue();
Mockito.doReturn("name").when(agentPropertiesIntegerMock).getName();

PowerMockito.mockStatic(PropertiesUtil.class);
PowerMockito.doReturn(fileMock).when(PropertiesUtil.class, "findConfigFile", Mockito.anyString());
PowerMockito.doReturn(propertiesMock).when(PropertiesUtil.class, "loadFromFile", Mockito.any());
Mockito.doReturn(String.valueOf(expectedResult)).when(propertiesMock).getProperty(Mockito.anyString());

Integer result = AgentPropertiesFileHandler.getPropertyValue(agentPropertiesIntegerMock);

Assert.assertEquals(expectedResult, result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -413,4 +413,9 @@ public DeployAsIsInfoTO getDeployAsIsInfo() {
public void setDeployAsIsInfo(DeployAsIsInfoTO deployAsIsInfo) {
this.deployAsIsInfo = deployAsIsInfo;
}

@Override
public String toString() {
return String.format("VM {id: \"%s\", name: \"%s\", uuid: \"%s\", type: \"%s\"}", id, name, uuid, type);
}
}
4 changes: 4 additions & 0 deletions 4 api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ public class EventTypes {
// Host
public static final String EVENT_HOST_RECONNECT = "HOST.RECONNECT";

// Host on Degraded ResourceState
public static final String EVENT_DECLARE_HOST_DEGRADED = "HOST.DECLARE.DEGRADED";
public static final String EVENT_CANCEL_HOST_DEGRADED = "HOST.CANCEL.DEGRADED";

// Host Out-of-band management
public static final String EVENT_HOST_OUTOFBAND_MANAGEMENT_ENABLE = "HOST.OOBM.ENABLE";
public static final String EVENT_HOST_OUTOFBAND_MANAGEMENT_DISABLE = "HOST.OOBM.DISABLE";
Expand Down
3 changes: 3 additions & 0 deletions 3 api/src/main/java/com/cloud/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.cloud.exception.InvalidParameterValueException;
Expand Down Expand Up @@ -456,4 +457,6 @@ public void setIp6Address(String ip6Address) {
String getRouterIp();

String getRouterIpv6();

Date getCreated();
}
6 changes: 6 additions & 0 deletions 6 api/src/main/java/com/cloud/network/NetworkProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.cloud.network;

import java.net.URI;
import java.util.Date;

import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
Expand Down Expand Up @@ -329,4 +330,9 @@ public String getRouterIpv6() {
return null;
}

@Override
public Date getCreated() {
return null;
}

}
4 changes: 4 additions & 0 deletions 4 api/src/main/java/com/cloud/network/vpc/Vpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

import java.util.Date;

public interface Vpc extends ControlledEntity, Identity, InternalIdentity {

public enum State {
Expand Down Expand Up @@ -91,4 +93,6 @@ public enum State {
boolean isRollingRestart();

void setRollingRestart(boolean rollingRestart);

Date getCreated();
}
4 changes: 4 additions & 0 deletions 4 api/src/main/java/com/cloud/offering/NetworkOffering.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import com.cloud.network.Network.GuestType;
import com.cloud.network.Networks.TrafficType;

import java.util.Date;

/**
* Describes network offering
*
Expand Down Expand Up @@ -141,4 +143,6 @@ public enum Detail {
boolean isSupportingPublicAccess();

String getServicePackage();

Date getCreated();
}
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.