Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
Added powerflex support to create storage pool foem
Browse files Browse the repository at this point in the history
  • Loading branch information
Pearl Dsilva committed Dec 15, 2020
1 parent 6d43c20 commit 9e70b74
Showing 1 changed file with 46 additions and 10 deletions.
56 changes: 46 additions & 10 deletions src/views/infra/AddPrimaryStorage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,41 @@
</a-form-item>
</div>
<div v-if="this.providerSelected === 'PowerFlex'">
<a-form-item :label="$t('label.powerflex.gateway')">
<a-input v-decorator="['powerflexGateway']" />
<a-form-item :label="$t('label.powerflex.gateway.username')">
<a-input v-decorator="['powerflexGatewayUsername']" />
<a-form-item>
<span slot="label">
{{ $t('label.powerflex.gateway') }}
<a-tooltip :title="$t('label.powerflex.gateway')">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input v-decorator="['powerflexGateway', { rules: [{ required: true, message: `${$t('label.required')}` }] }]"/>
</a-form-item>
<a-form-item :label="$t('label.powerflex.gateway.password')">
<a-input v-decorator="['powerflexGatewayPassword']" />
<a-form-item>
<span slot="label">
{{ $t('label.powerflex.gateway.username') }}
<a-tooltip :title="$t('label.powerflex.gateway.username')">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input v-decorator="['powerflexGatewayUsername', { rules: [{ required: true, message: `${$t('label.required')}` }] }]"/>
</a-form-item>
<a-form-item>
<span slot="label">
{{ $t('label.powerflex.gateway.password') }}
<a-tooltip :title="$t('label.powerflex.gateway.password')">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input-password v-decorator="['powerflexGatewayPassword', { rules: [{ required: true, message: `${$t('label.required')}` }] }]"/>
</a-form-item>
</a-form-item><a-form-item :label="$t('label.powerflex.storage.pool')">
<a-input v-decorator="['powerflexStoragePool']" />
<a-form-item>
<span slot="label">
{{ $t('label.powerflex.storage.pool') }}
<a-tooltip :title="$t('label.powerflex.storage.pool')">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input v-decorator="['powerflexStoragePool', { rules: [{ required: true, message: `${$t('label.required')}` }] }]"/>
</a-form-item>
</div>
<div v-if="this.protocolSelected === 'RBD'">
Expand Down Expand Up @@ -570,6 +595,11 @@ export default {
}
return url
},
powerflexURL (gateway, username, password, pool) {
var url = 'powerflex://' + encodeURIComponent(username) + ':' + encodeURIComponent(password) + '@' +
gateway + '/' + encodeURIComponent(pool)
return url
},
closeModal () {
this.$parent.$parent.close()
},
Expand Down Expand Up @@ -662,7 +692,7 @@ export default {
url = this.iscsiURL(server, iqn, lun)
}
params.url = url
if (values.provider !== 'DefaultPrimary') {
if (values.provider !== 'DefaultPrimary' && values.provider !== 'PowerFlex') {
if (values.managed) {
params.managed = true
} else {
Expand All @@ -678,11 +708,17 @@ export default {
params.url = values.url
}
}
if (values.provider === 'PowerFlex') {
params.url = this.powerflexURL(values.powerflexGateway, values.powerflexGatewayUsername,
values.powerflexGatewayPassword, values.powerflexStoragePool)
}
if (this.selectedTags.length > 0) {
params.tags = this.selectedTags.join()
}
this.loading = true
api('createStoragePool', params).then(json => {
api('createStoragePool', {}, 'POST', params).then(json => {
this.$notification.success({
message: this.$t('label.add.primary.storage'),
description: this.$t('label.add.primary.storage')
Expand Down

0 comments on commit 9e70b74

Please sign in to comment.