'use strict'; angular.module('yardStickGui2App') .controller('MainCtrl', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', 'ngDialog', '$localStorage', '$loading', '$interval', function($scope, $state, $stateParams, mainFactory, Upload, toaster, ngDialog, $localStorage, $loading, $interval) { init(); $scope.project = 0; $scope.showloading = false; $scope.showEnvrionment = false; $scope.loadingOPENrc = false; $scope.uuidEnv = null; $scope.showPod = null; $scope.showImage = null; $scope.showContainer = null; $scope.showNextOpenRc = null; $scope.showNextPod = null; $scope.displayContainerInfo = []; $scope.containerList = [{ value: 'create_influxdb', name: "InfluxDB" }, { value: 'create_grafana', name: "Grafana" }] $scope.$on('$destroy', function() { $interval.cancel($scope.intervalImgae) }); $scope.showImageStatus = 0; function init() { $scope.gotoProject = gotoProject; $scope.gotoEnvironment = gotoEnvironment; $scope.gotoTask = gotoTask; $scope.gotoExcute = gotoExcute; $scope.gotoReport = gotoReport; $scope.deleteEnvItem = deleteEnvItem; $scope.addInfo = addInfo; $scope.submitOpenRcFile = submitOpenRcFile; $scope.uploadFilesPod = uploadFilesPod; $scope.uploadFiles = uploadFiles; $scope.showEnvriomentStatus = showEnvriomentStatus; $scope.openEnvironmentDialog = openEnvironmentDialog; $scope.getEnvironmentList = getEnvironmentList; $scope.gotoDetail = gotoDetail; $scope.addEnvironment = addEnvironment; $scope.createContainer = createContainer; $scope.chooseResult = chooseResult; getEnvironmentList(); // getImageList(); } function gotoProject() { $scope.project = 1; } function gotoEnvironment() { $scope.project = 0; } function gotoTask() { $scope.project = 2; } function gotoExcute() { $scope.project = 3; } function gotoReport() { $scope.project = 4; } $scope.skipPod = function skipPod() { $scope.showContainer = 1; } $scope.skipContainer = function skipContainer() { getEnvironmentList(); ngDialog.close(); } $scope.goToImage = function goToImage() { getImageListSimple(); $scope.showImage = 1; } $scope.goToPod = function goToPod() { $scope.showPod = 1; } $scope.goToPodPrev = function goToPodPrev() { $scope.showImage = null; } $scope.skipPodPrev = function skipPodPrev() { $scope.showImage = 1; $scope.showPod = null; } $scope.skipContainerPrev = function skipContainerPrev() { $scope.showPod = 1; $scope.showContainer = null; } $scope.envInfo = [ { name: 'OS_USERNAME', value: '' }, { name: 'OS_PASSWORD', value: '' }, { name: 'OS_TENANT_NAME', value: '' }, { name: 'EXTERNAL_NETWORK', value: '' } ]; function deleteEnvItem(index) { $scope.envInfo.splice(index, 1); } function addInfo() { var tempKey = null; var tempValue = null; var temp = { name: tempKey, value: tempValue } $scope.envInfo.push(temp); } function submitOpenRcFile() { $scope.showloading = true; var postData = {}; postData['action'] = 'update_openrc'; rebuildEnvInfo(); postData['args'] = {}; postData.args["openrc"] = $scope.postEnvInfo; postData.args['environment_id'] = $scope.uuidEnv; mainFactory.postEnvironmentVariable().post(postData).$promise.then(function(response) { $scope.showloading = false; if (response.status == 1) { $scope.openrcInfo = response.result; toaster.pop({ type: 'success', title: 'create success', body: 'you can go next step', timeout: 3000 }); $scope.showEnvrionment = true; // $scope.showImage = response.status; $scope.showNextOpenRc = 1; } else { toaster.pop({ type: 'error', title: 'fail', body: response.error_msg, timeout: 3000 }); } }, function(error) { toaster.pop({ type: 'error', title: 'fail', body: 'unknow error', timeout: 3000 }); }) } function uploadFiles($file, $invalidFiles) { $scope.openrcInfo = {}; $scope.loadingO
heat_template_version: 2016-04-08

description: >
  OpenDaylight OVS Configuration.

parameters:
  OpenDaylightPort:
    default: 8081
    description: Set opendaylight service port
    type: number
  OpenDaylightConnectionProtocol:
    description: L7 protocol used for REST access
    type: string
    default: 'http'
  OpenDaylightCheckURL:
    description: URL postfix to verify ODL has finished starting up
    type: string
    default: 'restconf/operational/network-topology:network-topology/topology/netvirt:1'
  OpenDaylightApiVirtualIP:
    type: string
    default: ''
  OpenDaylightProviderMappings:
    description: Mappings between logical networks and physical interfaces.
                 Required for VLAN deployments.  For example physnet1 -> eth1.
    type: comma_delimited_list
    default: "datacentre:br-ex"
  EndpointMap:
    default: {}
    description: Mapping of service endpoint -> protocol. Typically set
                 via parameter_defaults in the resource registry.
    type: json
  ServiceNetMap:
    default: {}
    description: Mapping of service_name -> network name. Typically set
                 via parameter_defaults in the resource registry.  This
                 mapping overrides those in ServiceNetMapDefaults.
    type: json
  DefaultPasswords:
    default: {}
    type: json

outputs:
  role_data:
    description: Role data for the OpenDaylight service.
    value:
      service_name: opendaylight_ovs
      config_settings:
        opendaylight::odl_rest_port: {get_param: OpenDaylightPort}
        opendaylight_check_url: {get_param: OpenDaylightCheckURL}
        opendaylight::nb_connection_protocol: {get_param: OpenDaylightConnectionProtocol}
        neutron::agents::ml2::ovs::local_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]}
        neutron::plugins::ovs::opendaylight::provider_mappings:
          str_replace:
            template: MAPPINGS
            params:
              MAPPINGS: {get_param: OpenDaylightProviderMappings}
        tripleo.opendaylight_ovs.firewall_rules:
          '118 neutron vxlan networks':
             proto: 'udp'
             dport: 4789
          '136 neutron gre networks':
             proto: 'gre'
      step_config: |
        include tripleo::profile::base::neutron::plugins::ovs::opendaylight
body: 'unknow error', timeout: 3000 }); }) } //getopenRcid function getOpenrcDetailForOpenrc(openrcId) { mainFactory.getEnvironmentDetail().get({ 'openrc_id': openrcId }).$promise.then(function(response) { $scope.openrcInfo = response.result; buildToEnvInfoOpenrc($scope.openrcInfo.openrc) }, function(response) { toaster.pop({ type: 'error', title: 'error', body: 'unknow error', timeout: 3000 }); }) } //buildtoEnvInfo function buildToEnvInfoOpenrc(object) { var tempKeyArray = Object.keys(object); $scope.envInfo = []; for (var i = 0; i < tempKeyArray.length; i++) { var tempkey = tempKeyArray[i]; var tempValue = object[tempKeyArray[i]]; var temp = { name: tempkey, value: tempValue }; $scope.envInfo.push(temp); } } } ]);