@@ -125,6 +125,7 @@ export default {
125125 launching: ' message.please.wait.while.zone.is.being.created'
126126 },
127127 nsx: false ,
128+ netris: false ,
128129 isLaunchZone: false ,
129130 processStatus: null ,
130131 messageError: ' ' ,
@@ -218,6 +219,7 @@ export default {
218219 const index = this .steps .findIndex (step => step .index === this .currentStep )
219220 this .steps [index].status = status
220221 this .nsx = false
222+ this .netris = false
221223 },
222224 handleBack (e ) {
223225 this .$emit (' backPressed' )
@@ -487,7 +489,10 @@ export default {
487489 if (physicalNetwork .isolationMethod === ' NSX' &&
488490 physicalNetwork .traffics .findIndex (traffic => traffic .type === ' public' || traffic .type === ' guest' ) > - 1 ) {
489491 this .stepData .isNsxZone = true
490- this .stepData .tungstenPhysicalNetworkId = physicalNetworkReturned .id
492+ }
493+ if (physicalNetwork .isolationMethod === ' NETRIS' &&
494+ physicalNetwork .traffics .findIndex (traffic => traffic .type === ' public' || traffic .type === ' guest' ) > - 1 ) {
495+ this .stepData .isNetrisZone = true
491496 }
492497 } else {
493498 this .stepData .physicalNetworkReturned = this .stepData .physicalNetworkItem [' createPhysicalNetwork' + index]
@@ -909,6 +914,8 @@ export default {
909914 this .addStep (message, trafficType)
910915 if (trafficType === ' nsxPublicTraffic' ) {
911916 this .nsx = false
917+ } else if (trafficType === ' netrisPublicTraffic' ) {
918+ this .netris = false
912919 }
913920
914921 let stopNow = false
@@ -937,7 +944,7 @@ export default {
937944 params .zoneId = this .stepData .zoneReturned .id
938945 if (publicVlanIpRange .vlan && publicVlanIpRange .vlan .length > 0 ) {
939946 params .vlan = publicVlanIpRange .vlan
940- } else if (publicVlanIpRange .fornsx ) {
947+ } else if (publicVlanIpRange .fornsx ) { // TODO: should this be the same for Netris?
941948 params .vlan = null
942949 } else {
943950 params .vlan = ' untagged'
@@ -987,6 +994,8 @@ export default {
987994 await this .stepCreateTungstenFabricPublicNetwork ()
988995 } else if (this .stepData .isNsxZone ) {
989996 await this .stepAddNsxController ()
997+ } else if (this .stepData .isNetrisZone ) {
998+ await this .stepAddNetrisController ()
990999 } else {
9911000 await this .stepConfigureStorageTraffic ()
9921001 }
@@ -1090,6 +1099,35 @@ export default {
10901099 this .setStepStatus (STATUS_FAILED )
10911100 }
10921101 },
1102+ async stepAddNetrisController () {
1103+ this .setStepStatus (STATUS_FINISH )
1104+ this .currentStep ++
1105+ this .addStep (' message.add.netris.controller' , ' netris' )
1106+ if (this .stepData .stepMove .includes (' netris' )) {
1107+ await this .stepConfigureStorageTraffic ()
1108+ return
1109+ }
1110+ try {
1111+ if (! this .stepData .stepMove .includes (' addNetrisProvider' )) {
1112+ const providerParams = {}
1113+ providerParams .name = this .prefillContent ? .netrisName || ' '
1114+ providerParams .netrisproviderhostname = this .prefillContent ? .netrisHostname || ' '
1115+ providerParams .netrisproviderport = this .prefillContent ? .netrisPort || ' '
1116+ providerParams .username = this .prefillContent ? .username || ' '
1117+ providerParams .password = this .prefillContent ? .password || ' '
1118+ providerParams .zoneid = this .stepData .zoneReturned .id
1119+
1120+ await this .addNetrisProvider (providerParams)
1121+ this .stepData .stepMove .push (' addNetrisController' )
1122+ }
1123+ this .stepData .stepMove .push (' netris' )
1124+ await this .stepConfigureStorageTraffic ()
1125+ } catch (e) {
1126+ this .messageError = e
1127+ this .processStatus = STATUS_FAILED
1128+ this .setStepStatus (STATUS_FAILED )
1129+ }
1130+ },
10931131 async stepConfigureStorageTraffic () {
10941132 let targetNetwork = false
10951133 this .prefillContent .physicalNetworks .forEach (physicalNetwork => {
@@ -2247,6 +2285,16 @@ export default {
22472285 })
22482286 })
22492287 },
2288+ addNetrisPovider (args ) {
2289+ return new Promise ((resolve , reject ) => {
2290+ api (' addNetrisProvider' , {}, ' POST' , args).then (json => {
2291+ resolve ()
2292+ }).catch (error => {
2293+ const message = error .response .headers [' x-description' ]
2294+ reject (message)
2295+ })
2296+ })
2297+ },
22502298 configTungstenFabricService (args ) {
22512299 return new Promise ((resolve , reject ) => {
22522300 api (' configTungstenFabricService' , {}, ' POST' , args).then (json => {
0 commit comments