Skip to content

Commit da3ba17

Browse files
authored
Fix build and ui build errors in main (#11332)
* fix build error in registeruserdatacmd * remove unused imports * fix ui build errors
1 parent 2bffabb commit da3ba17

File tree

4 files changed

+93
-139
lines changed

4 files changed

+93
-139
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.Parameter;
2323
import org.apache.cloudstack.api.ServerApiException;
24-
import org.apache.cloudstack.api.response.DomainResponse;
25-
import org.apache.cloudstack.api.response.ProjectResponse;
2624
import org.apache.cloudstack.api.response.SuccessResponse;
2725
import org.apache.cloudstack.api.response.UserDataResponse;
2826
import org.apache.cloudstack.context.CallContext;
@@ -48,52 +46,8 @@ public class RegisterUserDataCmd extends BaseRegisterUserDataCmd {
4846
//////////////// API parameters /////////////////////
4947
/////////////////////////////////////////////////////
5048

51-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the User Data")
52-
private String name;
53-
54-
//Owner information
55-
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account for the User Data. Must be used with domainId.")
56-
private String accountName;
57-
58-
@Parameter(name = ApiConstants.DOMAIN_ID,
59-
type = CommandType.UUID,
60-
entityType = DomainResponse.class,
61-
description = "an optional domainId for the User Data. If the account parameter is used, domainId must also be used.")
62-
private Long domainId;
63-
64-
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the User Data")
65-
private Long projectId;
66-
67-
@Parameter(name = ApiConstants.USER_DATA,
68-
type = CommandType.STRING,
69-
required = true,
70-
description = "Base64 encoded User Data content. " +
71-
"Using HTTP GET (via querystring), you can send up to 4KB of data after base64 encoding. " +
72-
"Using HTTP POST (via POST body), you can send up to 32KB of data after base64 encoding, " +
73-
"which can be increased upto 1MB using the vm.userdata.max.length setting",
74-
length = 1048576)
75-
private String userData;
76-
77-
78-
/////////////////////////////////////////////////////
79-
/////////////////// Accessors ///////////////////////
80-
/////////////////////////////////////////////////////
81-
82-
public String getName() {
83-
return name;
84-
}
85-
86-
public String getAccountName() {
87-
return accountName;
88-
}
89-
90-
public Long getDomainId() {
91-
return domainId;
92-
}
93-
94-
public Long getProjectId() {
95-
return projectId;
96-
}
49+
@Parameter(name = ApiConstants.USER_DATA, type = CommandType.STRING, required = true, description = "User data content", length = 1048576)
50+
protected String userData;
9751

9852
public String getUserData() {
9953
return userData;

ui/src/views/compute/DeployVM.vue

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,64 +2528,64 @@ export default {
25282528
if (exclude && exclude.length > 0 && exclude.includes(name)) {
25292529
return resolve(null)
25302530
}
2531-
}
2532-
this.loading[name] = true
2533-
param.loading = true
2534-
param.opts = []
2535-
const options = param.options || {}
2536-
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
2537-
options.listall = true
2538-
}
2539-
postApi(param.list, options).then((response) => {
2540-
param.loading = false
2541-
_.map(response, (responseItem, responseKey) => {
2542-
if (Object.keys(responseItem).length === 0) {
2543-
this.rowCount[name] = 0
2544-
this.options[name] = []
2545-
return
2546-
}
2547-
if (!responseKey.includes('response')) {
2548-
return
2549-
}
2550-
_.map(responseItem, (response, key) => {
2551-
if (key === 'count') {
2552-
this.rowCount[name] = response
2531+
this.loading[name] = true
2532+
param.loading = true
2533+
param.opts = []
2534+
const options = param.options || {}
2535+
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
2536+
options.listall = true
2537+
}
2538+
postAPI(param.list, options).then((response) => {
2539+
param.loading = false
2540+
_.map(response, (responseItem, responseKey) => {
2541+
if (Object.keys(responseItem).length === 0) {
2542+
this.rowCount[name] = 0
2543+
this.options[name] = []
25532544
return
25542545
}
25552546
if (!responseKey.includes('response')) {
2556-
return resolve(null)
2547+
return
25572548
}
25582549
_.map(responseItem, (response, key) => {
25592550
if (key === 'count') {
25602551
this.rowCount[name] = response
25612552
return
25622553
}
2563-
param.opts = response
2564-
this.options[name] = response
2565-
2566-
if (name === 'hypervisors') {
2567-
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
2568-
this.dataPreFill.hypervisor = hypervisorFromResponse
2569-
this.form.hypervisor = hypervisorFromResponse
2554+
if (!responseKey.includes('response')) {
2555+
return resolve(null)
25702556
}
2557+
_.map(responseItem, (response, key) => {
2558+
if (key === 'count') {
2559+
this.rowCount[name] = response
2560+
return
2561+
}
2562+
param.opts = response
2563+
this.options[name] = response
25712564
2572-
if (param.field) {
2573-
this.fillValue(param.field)
2574-
}
2575-
})
2565+
if (name === 'hypervisors') {
2566+
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
2567+
this.dataPreFill.hypervisor = hypervisorFromResponse
2568+
this.form.hypervisor = hypervisorFromResponse
2569+
}
25762570
2577-
if (name === 'zones') {
2578-
let zoneid = ''
2579-
if (this.$route.query.zoneid) {
2580-
zoneid = this.$route.query.zoneid
2581-
} else if (this.options.zones.length === 1) {
2582-
zoneid = this.options.zones[0].id
2583-
}
2584-
if (zoneid) {
2585-
this.form.zoneid = zoneid
2586-
this.onSelectZoneId(zoneid)
2571+
if (param.field) {
2572+
this.fillValue(param.field)
2573+
}
2574+
})
2575+
2576+
if (name === 'zones') {
2577+
let zoneid = ''
2578+
if (this.$route.query.zoneid) {
2579+
zoneid = this.$route.query.zoneid
2580+
} else if (this.options.zones.length === 1) {
2581+
zoneid = this.options.zones[0].id
2582+
}
2583+
if (zoneid) {
2584+
this.form.zoneid = zoneid
2585+
this.onSelectZoneId(zoneid)
2586+
}
25872587
}
2588-
}
2588+
})
25892589
})
25902590
resolve(response)
25912591
}).catch(function (error) {

ui/src/views/compute/DeployVnfAppliance.vue

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,64 +2472,64 @@ export default {
24722472
if (exclude && exclude.length > 0 && exclude.includes(name)) {
24732473
return resolve(null)
24742474
}
2475-
}
2476-
this.loading[name] = true
2477-
param.loading = true
2478-
param.opts = []
2479-
const options = param.options || {}
2480-
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
2481-
options.listall = true
2482-
}
2483-
postApi(param.list, options).then((response) => {
2484-
param.loading = false
2485-
_.map(response, (responseItem, responseKey) => {
2486-
if (Object.keys(responseItem).length === 0) {
2487-
this.rowCount[name] = 0
2488-
this.options[name] = []
2489-
return
2490-
}
2491-
if (!responseKey.includes('response')) {
2492-
return
2493-
}
2494-
_.map(responseItem, (response, key) => {
2495-
if (key === 'count') {
2496-
this.rowCount[name] = response
2475+
this.loading[name] = true
2476+
param.loading = true
2477+
param.opts = []
2478+
const options = param.options || {}
2479+
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
2480+
options.listall = true
2481+
}
2482+
postAPI(param.list, options).then((response) => {
2483+
param.loading = false
2484+
_.map(response, (responseItem, responseKey) => {
2485+
if (Object.keys(responseItem).length === 0) {
2486+
this.rowCount[name] = 0
2487+
this.options[name] = []
24972488
return
24982489
}
24992490
if (!responseKey.includes('response')) {
2500-
return resolve(null)
2491+
return
25012492
}
25022493
_.map(responseItem, (response, key) => {
25032494
if (key === 'count') {
25042495
this.rowCount[name] = response
25052496
return
25062497
}
2507-
param.opts = response
2508-
this.options[name] = response
2509-
2510-
if (name === 'hypervisors') {
2511-
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
2512-
this.dataPreFill.hypervisor = hypervisorFromResponse
2513-
this.form.hypervisor = hypervisorFromResponse
2498+
if (!responseKey.includes('response')) {
2499+
return resolve(null)
25142500
}
2501+
_.map(responseItem, (response, key) => {
2502+
if (key === 'count') {
2503+
this.rowCount[name] = response
2504+
return
2505+
}
2506+
param.opts = response
2507+
this.options[name] = response
25152508
2516-
if (param.field) {
2517-
this.fillValue(param.field)
2518-
}
2519-
})
2509+
if (name === 'hypervisors') {
2510+
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
2511+
this.dataPreFill.hypervisor = hypervisorFromResponse
2512+
this.form.hypervisor = hypervisorFromResponse
2513+
}
25202514
2521-
if (name === 'zones') {
2522-
let zoneid = ''
2523-
if (this.$route.query.zoneid) {
2524-
zoneid = this.$route.query.zoneid
2525-
} else if (this.options.zones.length === 1) {
2526-
zoneid = this.options.zones[0].id
2527-
}
2528-
if (zoneid) {
2529-
this.form.zoneid = zoneid
2530-
this.onSelectZoneId(zoneid)
2515+
if (param.field) {
2516+
this.fillValue(param.field)
2517+
}
2518+
})
2519+
2520+
if (name === 'zones') {
2521+
let zoneid = ''
2522+
if (this.$route.query.zoneid) {
2523+
zoneid = this.$route.query.zoneid
2524+
} else if (this.options.zones.length === 1) {
2525+
zoneid = this.options.zones[0].id
2526+
}
2527+
if (zoneid) {
2528+
this.form.zoneid = zoneid
2529+
this.onSelectZoneId(zoneid)
2530+
}
25312531
}
2532-
}
2532+
})
25332533
})
25342534
resolve(response)
25352535
}).catch(function (error) {

ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export default {
470470
})
471471
},
472472
fetchDomainAccounts (domainid) {
473-
api('listAccounts', {
473+
getAPI('listAccounts', {
474474
domainid: domainid
475475
}).then(response => {
476476
// Clean up the selected account from a previous domain

0 commit comments

Comments
 (0)