Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserDataResponse;
import org.apache.cloudstack.context.CallContext;
Expand All @@ -48,52 +46,8 @@ public class RegisterUserDataCmd extends BaseRegisterUserDataCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////

@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the User Data")
private String name;

//Owner information
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account for the User Data. Must be used with domainId.")
private String accountName;

@Parameter(name = ApiConstants.DOMAIN_ID,
type = CommandType.UUID,
entityType = DomainResponse.class,
description = "an optional domainId for the User Data. If the account parameter is used, domainId must also be used.")
private Long domainId;

@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the User Data")
private Long projectId;

@Parameter(name = ApiConstants.USER_DATA,
type = CommandType.STRING,
required = true,
description = "Base64 encoded User Data content. " +
"Using HTTP GET (via querystring), you can send up to 4KB of data after base64 encoding. " +
"Using HTTP POST (via POST body), you can send up to 32KB of data after base64 encoding, " +
"which can be increased upto 1MB using the vm.userdata.max.length setting",
length = 1048576)
private String userData;


/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////

public String getName() {
return name;
}

public String getAccountName() {
return accountName;
}

public Long getDomainId() {
return domainId;
}

public Long getProjectId() {
return projectId;
}
@Parameter(name = ApiConstants.USER_DATA, type = CommandType.STRING, required = true, description = "User data content", length = 1048576)
protected String userData;

public String getUserData() {
return userData;
Expand Down
90 changes: 45 additions & 45 deletions ui/src/views/compute/DeployVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2528,64 +2528,64 @@ export default {
if (exclude && exclude.length > 0 && exclude.includes(name)) {
return resolve(null)
}
}
this.loading[name] = true
param.loading = true
param.opts = []
const options = param.options || {}
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
options.listall = true
}
postApi(param.list, options).then((response) => {
param.loading = false
_.map(response, (responseItem, responseKey) => {
if (Object.keys(responseItem).length === 0) {
this.rowCount[name] = 0
this.options[name] = []
return
}
if (!responseKey.includes('response')) {
return
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
this.loading[name] = true
param.loading = true
param.opts = []
const options = param.options || {}
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
options.listall = true
}
postAPI(param.list, options).then((response) => {
param.loading = false
_.map(response, (responseItem, responseKey) => {
if (Object.keys(responseItem).length === 0) {
this.rowCount[name] = 0
this.options[name] = []
return
}
if (!responseKey.includes('response')) {
return resolve(null)
return
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
return
}
param.opts = response
this.options[name] = response

if (name === 'hypervisors') {
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
this.dataPreFill.hypervisor = hypervisorFromResponse
this.form.hypervisor = hypervisorFromResponse
if (!responseKey.includes('response')) {
return resolve(null)
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
return
}
param.opts = response
this.options[name] = response

if (param.field) {
this.fillValue(param.field)
}
})
if (name === 'hypervisors') {
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
this.dataPreFill.hypervisor = hypervisorFromResponse
this.form.hypervisor = hypervisorFromResponse
}

if (name === 'zones') {
let zoneid = ''
if (this.$route.query.zoneid) {
zoneid = this.$route.query.zoneid
} else if (this.options.zones.length === 1) {
zoneid = this.options.zones[0].id
}
if (zoneid) {
this.form.zoneid = zoneid
this.onSelectZoneId(zoneid)
if (param.field) {
this.fillValue(param.field)
}
})

if (name === 'zones') {
let zoneid = ''
if (this.$route.query.zoneid) {
zoneid = this.$route.query.zoneid
} else if (this.options.zones.length === 1) {
zoneid = this.options.zones[0].id
}
if (zoneid) {
this.form.zoneid = zoneid
this.onSelectZoneId(zoneid)
}
}
}
})
})
resolve(response)
}).catch(function (error) {
Expand Down
90 changes: 45 additions & 45 deletions ui/src/views/compute/DeployVnfAppliance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2472,64 +2472,64 @@ export default {
if (exclude && exclude.length > 0 && exclude.includes(name)) {
return resolve(null)
}
}
this.loading[name] = true
param.loading = true
param.opts = []
const options = param.options || {}
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
options.listall = true
}
postApi(param.list, options).then((response) => {
param.loading = false
_.map(response, (responseItem, responseKey) => {
if (Object.keys(responseItem).length === 0) {
this.rowCount[name] = 0
this.options[name] = []
return
}
if (!responseKey.includes('response')) {
return
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
this.loading[name] = true
param.loading = true
param.opts = []
const options = param.options || {}
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
options.listall = true
}
postAPI(param.list, options).then((response) => {
param.loading = false
_.map(response, (responseItem, responseKey) => {
if (Object.keys(responseItem).length === 0) {
this.rowCount[name] = 0
this.options[name] = []
return
}
if (!responseKey.includes('response')) {
return resolve(null)
return
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
return
}
param.opts = response
this.options[name] = response

if (name === 'hypervisors') {
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
this.dataPreFill.hypervisor = hypervisorFromResponse
this.form.hypervisor = hypervisorFromResponse
if (!responseKey.includes('response')) {
return resolve(null)
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
this.rowCount[name] = response
return
}
param.opts = response
this.options[name] = response

if (param.field) {
this.fillValue(param.field)
}
})
if (name === 'hypervisors') {
const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null
this.dataPreFill.hypervisor = hypervisorFromResponse
this.form.hypervisor = hypervisorFromResponse
}

if (name === 'zones') {
let zoneid = ''
if (this.$route.query.zoneid) {
zoneid = this.$route.query.zoneid
} else if (this.options.zones.length === 1) {
zoneid = this.options.zones[0].id
}
if (zoneid) {
this.form.zoneid = zoneid
this.onSelectZoneId(zoneid)
if (param.field) {
this.fillValue(param.field)
}
})

if (name === 'zones') {
let zoneid = ''
if (this.$route.query.zoneid) {
zoneid = this.$route.query.zoneid
} else if (this.options.zones.length === 1) {
zoneid = this.options.zones[0].id
}
if (zoneid) {
this.form.zoneid = zoneid
this.onSelectZoneId(zoneid)
}
}
}
})
})
resolve(response)
}).catch(function (error) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ export default {
})
},
fetchDomainAccounts (domainid) {
api('listAccounts', {
getAPI('listAccounts', {
domainid: domainid
}).then(response => {
// Clean up the selected account from a previous domain
Expand Down
Loading