Tony Hansen | a795b59 | 2017-09-29 01:15:29 +0000 | [diff] [blame] | 1 | # -*- indent-tabs-mode: nil -*- # vi: set expandtab: |
Tony Hansen | 749bc2d | 2017-10-03 02:51:42 +0000 | [diff] [blame] | 2 | # |
| 3 | # ============LICENSE_START==================================================== |
| 4 | # org.onap.dcae |
| 5 | # ============================================================================= |
| 6 | # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. |
| 7 | # ============================================================================= |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # ============LICENSE_END====================================================== |
Tony Hansen | a795b59 | 2017-09-29 01:15:29 +0000 | [diff] [blame] | 20 | |
| 21 | tosca_definitions_version: cloudify_dsl_1_3 |
| 22 | |
Tony Hansen | 6b903fe | 2017-09-29 17:29:52 +0000 | [diff] [blame] | 23 | description: |- |
Tony Hansen | a795b59 | 2017-09-29 01:15:29 +0000 | [diff] [blame] | 24 | This blueprint is an example of how an application can access the needed information about |
| 25 | a persistent database created as part of a PGaaS cluster. |
| 26 | |
| 27 | For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", |
| 28 | there are three roles created: |
| 29 | admin role: has complete administrative control over that database |
| 30 | user role: has complete read and write access on that database |
| 31 | viewer role: only has read access on that database |
| 32 | The various attributes will return the appropriate information |
| 33 | that can be used with that role: host fqdn, role name and password. |
| 34 | |
| 35 | imports: |
| 36 | - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml |
| 37 | |
Hansen, Tony (th1395) | b936fb4 | 2018-03-29 14:28:59 +0000 | [diff] [blame] | 38 | - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" |
Tony Hansen | a795b59 | 2017-09-29 01:15:29 +0000 | [diff] [blame] | 39 | |
| 40 | inputs: |
| 41 | location_domain: |
| 42 | type: string |
| 43 | location_prefix: |
| 44 | type: string |
| 45 | pgaas_cluster_name: |
| 46 | type: string |
| 47 | default: pgcl |
| 48 | database_name: |
| 49 | type: string |
| 50 | default: sample |
| 51 | |
| 52 | node_templates: |
| 53 | pgclustername_dbname: |
| 54 | type: dcae.nodes.pgaas.database |
| 55 | properties: |
| 56 | writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } |
| 57 | name: { get_input: database_name } |
| 58 | use_existing: true |
| 59 | |
| 60 | outputs: |
| 61 | # admin role has control over table/index/view creation/dropping |
| 62 | pgclustername_dbname_admin_host: |
| 63 | description: Hostname for PGCLUSTERNAME dbname database |
| 64 | value: { get_attribute: [ pgclustername_dbname, admin, host ] } |
| 65 | pgclustername_dbname_admin_user: |
| 66 | description: Admin Username for PGCLUSTERNAME dbname database |
| 67 | value: { get_attribute: [ pgclustername_dbname, admin, user ] } |
| 68 | pgclustername_dbname_admin_password: |
| 69 | description: Admin Password for PGCLUSTERNAME dbname database |
| 70 | value: { get_attribute: [ pgclustername_dbname, admin, password ] } |
| 71 | |
| 72 | # user role can read and write the tables |
| 73 | pgclustername_dbname_user_host: |
| 74 | description: Hostname for PGCLUSTERNAME dbname database |
| 75 | value: { get_attribute: [ pgclustername_dbname, user, host ] } |
| 76 | pgclustername_dbname_user_user: |
| 77 | description: User Username for PGCLUSTERNAME dbname database |
| 78 | value: { get_attribute: [ pgclustername_dbname, user, user ] } |
| 79 | pgclustername_dbname_user_password: |
| 80 | description: User Password for PGCLUSTERNAME dbname database |
| 81 | value: { get_attribute: [ pgclustername_dbname, user, password ] } |
| 82 | |
| 83 | # viewer role can only read from the tables |
| 84 | pgclustername_dbname_viewer_host: |
| 85 | description: Hostname for PGCLUSTERNAME dbname database |
| 86 | value: { get_attribute: [ pgclustername_dbname, viewer, host ] } |
| 87 | pgclustername_dbname_viewer_user: |
| 88 | description: Viewer Username for PGCLUSTERNAME dbname database |
| 89 | value: { get_attribute: [ pgclustername_dbname, viewer, user ] } |
| 90 | pgclustername_dbname_viewer_password: |
| 91 | description: Viewer Password for PGCLUSTERNAME dbname database |
| 92 | value: { get_attribute: [ pgclustername_dbname, viewer, password ] } |