initRegionsAndDataCenters() {
    this.loaders.step2 = true;
    this.submitted.step2 = false;
    this.resetStep3();

    return this.$q.all({
      regions: this.OvhApiCloudProjectRegion.v6().query({ serviceName: this.serviceName }).$promise
        .then((regions) => {
          this.regions = _.map(regions, region => this.CucRegionService.getRegion(region));
          return this.VirtualMachineAddService.getRegionsByImageType(this.regions, this.images, _.get(this.model, 'imageType'));
        }),
      availableRegions: this.fetchAvailableRegions(),
      quota: this.promiseQuota
        .then((quota) => { this.quota = quota; })
        .catch(this.CucServiceHelper.errorHandler('cpcivm_add_step2_quota_ERROR')),
    })
      .then(({ regions, availableRegions }) => {
        const allRegions = regions.concat(availableRegions);
        _.forEach(allRegions, (region) => {
          // Add quota info
          this.CloudRegionService.constructor.addOverQuotaInfos(region, this.quota);
          // Check SSH Key opportunity
          if (_.get(this.model, 'sshKey.regions', false)) {
            this.CloudRegionService.constructor.checkSshKey(region, this.model.sshKey.regions);
          }
          // check region active/inactive
          const isRegionActive = this.CloudRegionService.constructor.isActive(region);
          if (!isRegionActive) {
            this.CloudRegionService.constructor.setRegionInactiveMessage(region);
          }
        });
        this.displayedRegions = this.VirtualMachineAddService.constructor
          .groupRegionsByDatacenter(allRegions);
        this.groupedRegions = _.groupBy(this.displayedRegions, 'continent');
      })
      .catch(this.CucServiceHelper.errorHandler('cpcivm_add_step2_regions_ERROR'))
      .finally(() => {
        this.loaders.step2 = false;
      });
  }
/*-----------------------------------------
     |  Step 2 : Region and DataCenter choice  |
     -----------------------------------------*/
|  Step 2 : Region and DataCenter choice  |
| Step 2 : Region and DataCenter choice |
initRegionsAndDataCenters() {
    this.loaders.step2 = true;
    this.submitted.step2 = false;
    this.resetStep3();
    return this.$q.all({
      regions: this.OvhApiCloudProjectRegion.v6().query({ serviceName: this.serviceName }).$promise
        .then((regions) => {
          this.regions = _.map(regions, region => this.CucRegionService.getRegion(region));
          return this.VirtualMachineAddService.getRegionsByImageType(this.regions, this.images, _.get(this.model, 'imageType'));
        }),
      availableRegions: this.fetchAvailableRegions(),
      quota: this.promiseQuota
        .then((quota) => { this.quota = quota; })
        .catch(this.CucServiceHelper.errorHandler('cpcivm_add_step2_quota_ERROR')),
    })
      .then(({ regions, availableRegions }) => {
        const allRegions = regions.concat(availableRegions);
        _.forEach(allRegions, (region) => {
          this.CloudRegionService.constructor.addOverQuotaInfos(region, this.quota);
          if (_.get(this.model, 'sshKey.regions', false)) {
            this.CloudRegionService.constructor.checkSshKey(region, this.model.sshKey.regions);
          }
          const isRegionActive = this.CloudRegionService.constructor.isActive(region);
          if (!isRegionActive) {
            this.CloudRegionService.constructor.setRegionInactiveMessage(region);
          }
        });
        this.displayedRegions = this.VirtualMachineAddService.constructor
          .groupRegionsByDatacenter(allRegions);
        this.groupedRegions = _.groupBy(this.displayedRegions, 'continent');
      })
      .catch(this.CucServiceHelper.errorHandler('cpcivm_add_step2_regions_ERROR'))
      .finally(() => {
        this.loaders.step2 = false;
      });
  }
initRegionsAndDataCenters ( ) { this . loaders . step2 = true ; this . submitted . step2 = false ; this . resetStep3 ( ) ; return this . $q . all ( { regions : this . OvhApiCloudProjectRegion . v6 ( ) . query ( { serviceName : this . serviceName } ) . $promise . then ( ( regions ) => { this . regions = _ . map ( regions , region => this . CucRegionService . getRegion ( region ) ) ; return this . VirtualMachineAddService . getRegionsByImageType ( this . regions , this . images , _ . get ( this . model , 'imageType' ) ) ; } ) , availableRegions : this . fetchAvailableRegions ( ) , quota : this . promiseQuota . then ( ( quota ) => { this . quota = quota ; } ) . catch ( this . CucServiceHelper . errorHandler ( 'cpcivm_add_step2_quota_ERROR' ) ) , } ) . then ( ( { regions , availableRegions } ) => { const allRegions = regions . concat ( availableRegions ) ; _ . forEach ( allRegions , ( region ) => { this . CloudRegionService . constructor . addOverQuotaInfos ( region , this . quota ) ; if ( _ . get ( this . model , 'sshKey.regions' , false ) ) { this . CloudRegionService . constructor . checkSshKey ( region , this . model . sshKey . regions ) ; } const isRegionActive = this . CloudRegionService . constructor . isActive ( region ) ; if ( ! isRegionActive ) { this . CloudRegionService . constructor . setRegionInactiveMessage ( region ) ; } } ) ; this . displayedRegions = this . VirtualMachineAddService . constructor . groupRegionsByDatacenter ( allRegions ) ; this . groupedRegions = _ . groupBy ( this . displayedRegions , 'continent' ) ; } ) . catch ( this . CucServiceHelper . errorHandler ( 'cpcivm_add_step2_regions_ERROR' ) ) . finally ( ( ) => { this . loaders . step2 = false ; } ) ; }
|  Step 2 : Region and DataCenter choice  |
| Step 2 : Region and DataCenter choice |
// Add quota info // Check SSH Key opportunity // check region active/inactive