Skip to content

Commit 000919d

Browse files
Merge branch '4.20' into 4.22
2 parents b1f870a + 8db065a commit 000919d

File tree

20 files changed

+166
-22
lines changed

20 files changed

+166
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
4242
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "The ID of the image file")
4343
private Long id;
4444

45-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "The name of the image file")
45+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, length = 251, description = "The name of the image file")
4646
private String templateName;
4747

4848
@Parameter(name = ApiConstants.OS_TYPE_ID,

api/src/main/java/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
7878

7979
@Parameter(name = ApiConstants.DOMAIN_ID,
8080
type = CommandType.STRING,
81+
length = 4096,
8182
description = "The ID of the containing domain(s) as comma separated string, public for public offerings")
8283
private String domainIds;
8384

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd {
7575
@Parameter(name = ApiConstants.ZONE_ID,
7676
type = CommandType.STRING,
7777
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
78+
length = 4096,
7879
since = "4.13")
7980
private String zoneIds;
8081

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
7070
@Parameter(name = ApiConstants.ZONE_ID,
7171
type = CommandType.STRING,
7272
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
73+
length = 4096,
7374
since = "4.13")
7475
private String zoneIds;
7576

api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd {
6565
@Parameter(name = ApiConstants.ZONE_ID,
6666
type = CommandType.STRING,
6767
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
68+
length = 4096,
6869
since = "4.13")
6970
private String zoneIds;
7071

api/src/main/java/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class RegisterIsoCmd extends BaseCmd implements UserCmd {
7070
@Parameter(name = ApiConstants.IS_EXTRACTABLE, type = CommandType.BOOLEAN, description = "True if the ISO or its derivatives are extractable; default is false")
7171
private Boolean extractable;
7272

73-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "The name of the ISO")
73+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, length = 251, description = "The name of the ISO")
7474
private String isoName;
7575

7676
@Parameter(name = ApiConstants.OS_TYPE_ID,
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
package com.cloud.upgrade.dao;
18+
19+
import java.io.InputStream;
20+
import java.sql.Connection;
21+
22+
import com.cloud.utils.exception.CloudRuntimeException;
23+
24+
public class Upgrade42020to42030 extends DbUpgradeAbstractImpl implements DbUpgrade, DbUpgradeSystemVmTemplate {
25+
26+
@Override
27+
public String[] getUpgradableVersionRange() {
28+
return new String[]{"4.20.2.0", "4.20.3.0"};
29+
}
30+
31+
@Override
32+
public String getUpgradedVersion() {
33+
return "4.20.3.0";
34+
}
35+
36+
@Override
37+
public boolean supportsRollingUpgrade() {
38+
return false;
39+
}
40+
41+
@Override
42+
public InputStream[] getPrepareScripts() {
43+
final String scriptFile = "META-INF/db/schema-42020to42030.sql";
44+
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
45+
if (script == null) {
46+
throw new CloudRuntimeException("Unable to find " + scriptFile);
47+
}
48+
49+
return new InputStream[] {script};
50+
}
51+
52+
@Override
53+
public void performDataMigration(Connection conn) {
54+
}
55+
56+
@Override
57+
public InputStream[] getCleanupScripts() {
58+
return null;
59+
}
60+
61+
@Override
62+
public void updateSystemVmTemplates(Connection conn) {
63+
}
64+
}

engine/schema/src/main/java/org/apache/cloudstack/vm/schedule/dao/VMScheduledJobDao.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ public interface VMScheduledJobDao extends GenericDao<VMScheduledJobVO, Long> {
3131
int expungeJobsForSchedules(List<Long> scheduleId, Date dateAfter);
3232

3333
int expungeJobsBefore(Date currentTimestamp);
34+
35+
VMScheduledJobVO findByScheduleAndTimestamp(long scheduleId, Date scheduledTimestamp);
3436
}

engine/schema/src/main/java/org/apache/cloudstack/vm/schedule/dao/VMScheduledJobDaoImpl.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class VMScheduledJobDaoImpl extends GenericDaoBase<VMScheduledJobVO, Long
3939

4040
private final SearchBuilder<VMScheduledJobVO> expungeJobForScheduleSearch;
4141

42+
private final SearchBuilder<VMScheduledJobVO> scheduleAndTimestampSearch;
43+
4244
static final String SCHEDULED_TIMESTAMP = "scheduled_timestamp";
4345

4446
static final String VM_SCHEDULE_ID = "vm_schedule_id";
@@ -58,6 +60,11 @@ public VMScheduledJobDaoImpl() {
5860
expungeJobForScheduleSearch.and(VM_SCHEDULE_ID, expungeJobForScheduleSearch.entity().getVmScheduleId(), SearchCriteria.Op.IN);
5961
expungeJobForScheduleSearch.and(SCHEDULED_TIMESTAMP, expungeJobForScheduleSearch.entity().getScheduledTime(), SearchCriteria.Op.GTEQ);
6062
expungeJobForScheduleSearch.done();
63+
64+
scheduleAndTimestampSearch = createSearchBuilder();
65+
scheduleAndTimestampSearch.and(VM_SCHEDULE_ID, scheduleAndTimestampSearch.entity().getVmScheduleId(), SearchCriteria.Op.EQ);
66+
scheduleAndTimestampSearch.and(SCHEDULED_TIMESTAMP, scheduleAndTimestampSearch.entity().getScheduledTime(), SearchCriteria.Op.EQ);
67+
scheduleAndTimestampSearch.done();
6168
}
6269

6370
/**
@@ -92,4 +99,12 @@ public int expungeJobsBefore(Date date) {
9299
sc.setParameters(SCHEDULED_TIMESTAMP, date);
93100
return expunge(sc);
94101
}
102+
103+
@Override
104+
public VMScheduledJobVO findByScheduleAndTimestamp(long scheduleId, Date scheduledTimestamp) {
105+
SearchCriteria<VMScheduledJobVO> sc = scheduleAndTimestampSearch.create();
106+
sc.setParameters(VM_SCHEDULE_ID, scheduleId);
107+
sc.setParameters(SCHEDULED_TIMESTAMP, scheduledTimestamp);
108+
return findOneBy(sc);
109+
}
95110
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
--;
19+
-- Schema upgrade from 4.20.2.0 to 4.20.3.0
20+
--;
21+
22+
ALTER TABLE `cloud`.`template_store_ref` MODIFY COLUMN `download_url` varchar(2048);

0 commit comments

Comments
 (0)