bb2d0e5a84
Now all OpenStack resource classes inherit CloudResource that provides getRegion method and regionName property. This allows to assign resources to different regions. getRegion() returns CloudRegion instance that resource or it parent belong to. CloudRegion has the similar interface to Environment class and is the correct way to get HeatStack instance associated with the regoin, default network configuration, security group manager and agent listener instances. Environment acts as the default region so backward compatibility is not broken. However new applications should not use environment to set security group rules but rather a region(s) of their instance(s) in order to work correctly when their instances were configured to use region other then the default. Change-Id: I4dbf40c65042e9a354f3bfadfcd63a63e6e3e418
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
# 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:
|
|
=: io.murano.resources
|
|
std: io.murano
|
|
|
|
|
|
Name: Volume
|
|
Extends: std:CloudResource
|
|
|
|
|
|
Properties:
|
|
openstackId:
|
|
Contract: $.string()
|
|
Usage: Out
|
|
|
|
|
|
Methods:
|
|
deploy:
|
|
|
|
getRef:
|
|
|
|
releaseResources:
|
|
|
|
.destroy:
|
|
Body:
|
|
- $.releaseResources()
|
|
|
|
attachTo:
|
|
Arguments:
|
|
- instance:
|
|
Contract: $.class(Instance).notNull()
|
|
- path:
|
|
Contract: $.string().notNull()
|
|
Body:
|
|
- $.deploy()
|
|
- $resourceName: format('vol-attachment-{0}-{1}', id($), $instance.name)
|
|
- Return:
|
|
template:
|
|
resources:
|
|
$resourceName:
|
|
type: 'OS::Cinder::VolumeAttachment'
|
|
properties:
|
|
instance_uuid: $instance.getRef()
|
|
mountpoint: $path
|
|
volume_id: $.getRef()
|
|
instanceResources: [$resourceName]
|
|
instanceOutputs: []
|