Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class:
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
- # not use this file except in compliance with the License. You may obtain
- # a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- # License for the specific language governing permissions and limitations
- # under the License.
- Namespaces:
- =: gov.pnnl.apps.visr
- pnnl: gov.pnnl.apps
- std: io.murano
- res: io.murano.resources
- sys: io.murano.system
- Name: ViSRWindowsWorkstation
- Extends: std:Application
- Properties:
- instance:
- Contract: $.class(res:WindowsInstance).notNull()
- Methods:
- initialize:
- Body:
- - $._environment: $.find(std:Environment).require()
- deploy:
- Body:
- - $.super($.deploy())
- - If: not $.getAttr(hostDeployed, false)
- Then:
- - $._environment.reporter.report($this, 'Creating VM for ViSR Windows Workstation')
- - $.instance.deploy()
- - $._environment.reporter.report($this, 'Instance is created.')
- - If: $.instance.assignFloatingIp
- Then:
- - $host: $.instance.floatingIpAddress
- Else:
- - $host: $.instance.ipAddresses[0]
- - $._environment.reporter.report($this, format('Workstation is available at {0}', $host))
- - $.setAttr(deployed, true)
- - Return:
- - $.setAttr(hostDeployed, true)
- UI:
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
- # not use this file except in compliance with the License. You may obtain
- # a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- # License for the specific language governing permissions and limitations
- # under the License.
- Version: 2.2
- Templates:
- customJoinNet:
- - ?:
- type: io.murano.resources.ExistingNeutronNetwork
- internalNetworkName: $.instanceConfiguration.network[0]
- internalSubnetworkName: $.instanceConfiguration.network[1]
- Application:
- ?:
- type: gov.pnnl.apps.visr.ViSRWindowsWorkstation
- instance:
- ?:
- type: io.murano.resources.WindowsInstance
- name: generateHostname($.instanceConfiguration.unitNamingPattern,1)
- flavor: $.instanceConfiguration.flavor
- image: $.instanceConfiguration.osImage
- keyname: $.instanceConfiguration.keyPair
- availabilityZone: $.instanceConfiguration.availabilityZone
- assignFloatingIp: $.appConfiguration.assignFloatingIP
- networks:
- useEnvironmentNetwork: $.instanceConfiguration.network[0]=null
- useFlatNetwork: false
- customNetworks: switch($.instanceConfiguration.network[0], $=null=>list(), $!=null=>$customJoinNet)
- Forms:
- - appConfiguration:
- fields:
- - name: license
- type: string
- description: Apache License, Version 2.0
- hidden: true
- required: false
- - name: assignFloatingIP
- type: boolean
- label: Assign Floating IP
- description: >-
- Select to true to assign floating IP automatically
- initial: false
- required: false
- - instanceConfiguration:
- fields:
- - name: title
- type: string
- required: false
- hidden: true
- description: Specify instance parameters for the worker workstations.
- - name: flavor
- type: flavor
- label: Instance flavor
- description: >-
- Select registered in Openstack flavor. Consider that application performance
- depends on this parameter.
- required: false
- - name: osImage
- type: image
- imageType: windows
- label: Instance image
- description: >-
- Select valid image for the application. Image should already be prepared and
- registered in glance.
- - name: keyPair
- type: keypair
- label: Key Pair
- description: >-
- Select the Key Pair to control access to instances. You can login to
- instances using this KeyPair after the deployment of application.
- required: false
- - name: availabilityZone
- type: azone
- label: Availability zone
- description: Select availability zone where application would be installed.
- required: false
- - name: network
- type: network
- label: Network
- description: Select a network to join. 'Auto' corresponds to a default environment's network.
- required: false
- murano_networks: translate
- - name: unitNamingPattern
- type: string
- label: Instance Naming Pattern
- required: false
- maxLength: 64
- regexpValidator: '^[a-zA-z][-_\w]*$'
- errorMessages:
- invalid: Just letters, numbers, underscores and hyphens are allowed.
- helpText: Just letters, numbers, underscores and hyphens are allowed.
- description: >-
- Specify a string, that will be used in instance hostname.
- Just A-Z, a-z, 0-9, dash and underline are allowed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement