Skip to content

Commit 2cdf59a

Browse files
author
Landry JUGE
committed
Fixing categoryId being inconsistent following refactoring of names, breaking functionnality
1 parent 77f821f commit 2cdf59a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ public class ApiConstants {
529529
public static final String SENT_BYTES = "sentbytes";
530530
public static final String SERIAL = "serial";
531531
public static final String SERVICE_IP = "serviceip";
532-
public static final String SERVICE_OFFERING_CATEGORY_ID = "serviceofferingcategoryid";
533-
public static final String SERVICE_OFFERING_CATEGORY_NAME = "serviceofferingcategoryname";
532+
public static final String SERVICE_OFFERING_CATEGORY_ID = "categoryid";
533+
public static final String SERVICE_OFFERING_CATEGORY_NAME = "categoryname";
534534
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
535535
public static final String SERVICE_OFFERING_NAME = "serviceofferingname";
536536
public static final String SESSIONKEY = "sessionkey";

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
296296
required = false,
297297
description = "the ID of the service offering category to associate with this offering",
298298
since = "4.23")
299-
private Long serviceOfferingCategoryId;
299+
private Long categoryId;
300300

301301
/////////////////////////////////////////////////////
302302
/////////////////// Accessors ///////////////////////
@@ -570,8 +570,8 @@ public Boolean getGpuDisplay() {
570570
return Boolean.TRUE.equals(gpuDisplay);
571571
}
572572

573-
public Long getServiceOfferingCategoryId() {
574-
return serviceOfferingCategoryId;
573+
public Long getCategoryId() {
574+
return categoryId;
575575
}
576576

577577
/////////////////////////////////////////////////////

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3470,7 +3470,7 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
34703470
}
34713471

34723472
// validate optional category id
3473-
final Long serviceOfferingCategoryId = cmd.getServiceOfferingCategoryId();
3473+
final Long serviceOfferingCategoryId = cmd.getCategoryId();
34743474
if (serviceOfferingCategoryId != null && _serviceOfferingCategoryDao.findById(serviceOfferingCategoryId) == null) {
34753475
throw new InvalidParameterValueException("Please specify a valid service offering category id");
34763476
}

ui/src/config/section/offering.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default {
4141
filters: ['active', 'inactive'],
4242
columns: ['name', 'displaytext', 'state', 'cpunumber', 'cpuspeed', 'memory', 'gpu', 'category', 'domain', 'zone', 'order'],
4343
details: () => {
44-
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails', 'categoryid', 'category']
44+
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails', 'category']
4545
if (store.getters.apis.createServiceOffering &&
4646
store.getters.apis.createServiceOffering.params.filter(x => x.name === 'storagepolicy').length > 0) {
4747
fields.splice(6, 0, 'vspherestoragepolicy')

ui/src/views/compute/DeployVM.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,9 +2308,9 @@ export default {
23082308
pageSize: 10
23092309
}
23102310
if (categoryId && categoryId !== '-1') {
2311-
params.serviceofferingcategoryid = categoryId
2311+
params.categoryid = categoryId
23122312
} else {
2313-
params.serviceofferingcategoryid = null
2313+
params.categoryid = null
23142314
}
23152315
this.handleSearchFilter('serviceOfferings', params)
23162316
},

0 commit comments

Comments
 (0)