Skip to content

Commit 2cfc768

Browse files
committed
improvement(offering): make network mode mandatory when creating vpc and network offerings (#13607)
1 parent 0e43c6a commit 2cfc768

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,8 @@ public abstract class NetworkOfferingBaseCmd extends BaseCmd {
153153
since = "4.20.0")
154154
private Boolean nsxSupportsInternalLbService;
155155

156-
@Parameter(name = ApiConstants.NETWORK_MODE,
157-
type = CommandType.STRING,
158-
description = "Indicates the mode with which the network will operate. Valid option: NATTED or ROUTED",
159-
since = "4.20.0")
160-
private String networkMode;
156+
@Parameter(name = ApiConstants.NETWORK_MODE, type = CommandType.STRING, required = true, description = "the network mode for the network offering")
157+
private String networkMode;
161158

162159
@Parameter(name = ApiConstants.FOR_TUNGSTEN,
163160
type = CommandType.BOOLEAN,

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
144144
since = "4.16")
145145
private Boolean enable;
146146

147-
@Parameter(name = ApiConstants.NETWORK_MODE,
148-
type = CommandType.STRING,
149-
description = "Indicates the mode with which the network will operate. Valid option: NATTED or ROUTED",
150-
since = "4.20.0")
147+
@Parameter(name = ApiConstants.NETWORK_MODE, type = CommandType.STRING, required = true, description = "the network mode for the VPC offering")
151148
private String networkMode;
152149

153150
@Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = CommandType.BOOLEAN, since = "4.20.0",

ui/src/views/offering/AddNetworkOffering.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ export default {
711711
})
712712
this.rules = reactive({
713713
name: [{ required: true, message: this.$t('message.error.name') }],
714+
// ADD THIS LINE:
715+
networkmode: [{ required: true, message: this.$t('message.error.select') }],
714716
networkrate: [{ type: 'number', validator: this.validateNumber }],
715717
serviceofferingid: [{ required: true, message: this.$t('message.error.select') }],
716718
domainid: [{ type: 'array', required: true, message: this.$t('message.error.select') }],

ui/src/views/offering/AddVpcOffering.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ export default {
366366
})
367367
this.rules = reactive({
368368
name: [{ required: true, message: this.$t('message.error.name') }],
369+
// ADD THIS LINE:
370+
networkmode: [{ required: true, message: this.$t('message.error.select') }],
369371
domainid: [{ type: 'array', required: true, message: this.$t('message.error.select') }],
370372
zoneid: [{
371373
type: 'array',

0 commit comments

Comments
 (0)