summaryrefslogtreecommitdiffstats
path: root/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/openstack.yaml
blob: 6941c1a3c9251eb1247323f94cd3b8bcbad507ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

imports:
  - os.yaml
  - aria-1.0

dsl_definitions:

  openstack:
    uuid_constraints: &OPENSTACK_UUID_CONSTRAINTS
      - pattern: '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'

node_types:

  openstack.Instance:
    description: >-
      OpenStack instance.

      You may assign an image_id or attach an openstack.Image artifact (the artifact
      will take precedence).

      You may assign either flavor_id or flavor_name (flavor_id will take precedence).
      If neither are assigned, flavor_name has a default value.
    derived_from: tosca.nodes.Compute
    properties:
      image_id:
        description: >-
          See: https://s3itwiki.uzh.ch/display/clouddoc/Supported+Images
        type: openstack.UUID
        default: 5d62e82c-924e-4fa9-b1e4-c133867596f7
      flavor_id:
        type: openstack.UUID
        required: false
      flavor_name:
        type: string
        default: m1.medium
        required: false
      availability_zone:
        description: >-
          OpenStack availability zone.
        type: string
        required: false
      os_users:
        type: map
        entry_schema: os.UserInfo
    interfaces:
      Standard:
        type: tosca.interfaces.node.lifecycle.Standard
        inputs:
          openstack_credential:
            description: The OpenStack API credential for all operations.
            type: openstack.Credential
        create:
          implementation:
            primary: openstack/create_instance.sh
            dependencies:
              - openstack/utils/api.sh
              - utils/os.sh
    requirements:
      - local_storage: # @override
          capability: tosca.capabilities.Attachment
          node: openstack.Volume
          relationship: tosca.relationships.AttachesTo
#          relationship:
#            type: tosca.relationships.AttachesTo
#            interfaces:
#              Standard:
#                inputs:
#                  xxx:
#                    type: string
#                    default: { concat: [ a, b ] }
          occurrences: [ 0, UNBOUNDED ]

  openstack.Volume:
    description: >-
      OpenStack volume.

      See: http://developer.openstack.org/api-ref-blockstorage-v2.html
    derived_from: tosca.nodes.BlockStorage
    properties:
      tenant_id:
        type: openstack.UUID
        required: false
      availability_zone:
        type: string
        required: false
      source_volid:
        type: openstack.UUID
        required: false
      description:
        type: string
        required: false
      multiattach:
        type: boolean
        default: false
      #snapshot_id: # @override
      #  type: openstack.UUID
      #  required: false
      name:
        type: string
        required: false
      volume_type:
        type: string
        required: false
      metadata:
        type: map
        entry_schema: string
        required: false
      source_replica:
        type: openstack.UUID
        required: false
      consistencygroup_id:
        type: openstack.UUID
        required: false
      scheduler_hints:
        type: map
        entry_schema: string
        required: false
    interfaces:
      Standard:
        type: tosca.interfaces.node.lifecycle.Standard
        inputs:
          openstack_credential:
            description: The OpenStack API credential for all operations.
            type: openstack.Credential
        create:
          implementation:
            primary: openstack/create_volume.sh
            dependencies:
              - openstack/utils/api.sh
              - utils/os.sh

group_types:

  openstack.Secured:
    description: >-
      OpenStack secured group.
    derived_from: tosca.groups.Root
    members:
      - openstack.Instance
    interfaces:
      Standard:
        type: tosca.interfaces.node.lifecycle.Standard
        inputs:
          openstack_credential:
            description: The OpenStack API credential for all operations.
            type: openstack.Credential
        create:
          implementation:
            primary: openstack/create_secured_group.sh
            dependencies:
              - openstack/utils/api.sh
              - utils/os.sh

policy_types:

  openstack.Scaling:
    description: >-
      OpenStack scaling policy.
    derived_from: aria.Scaling
    properties:
      bandwidth_threshold:
        type: scalar-unit.size
        default: 1 GB
    targets:
      - openstack.Instance
      - openstack.Secured

data_types:

  openstack.Credential:
    derived_from: tosca.datatypes.Credential

  openstack.UUID:
    description: >-
      OpenStack UUID (in GUID format).
    derived_from: string
    constraints: *OPENSTACK_UUID_CONSTRAINTS

artifact_types:

  openstack.Image:
    description: >-
      OpenStack image artifact.
    derived_from: tosca.artifacts.Deployment.Image.VM
    file_ext:
      - img
      - iso