Improve header hiearchy on platform plugins
[ccsdk/distribution.git] / docs / platform / plugins / pgaas.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4
5 PGaaS Plugin
6 ============
7
8 Cloudify PGaaS plugin description and configuraiton # Description The
9 PGaaS plugin allows users to deploy PostgreSQL application databases,
10 and retrieve access credentials for such databases, as part of a
11 Cloudify blueprint. # Plugin Requirements \* Python versions \* 2.7.x \*
12 System dependencies \* psycopg2
13
14 Note: These requirements apply to the VM where Cloudify Manager itself
15 runs.
16
17 Note: The psycopg2 requirement is met by running "yum install
18 python-psycopg2" on the Cloudify Manager VM.
19
20 Note: Cloudify Manager, itself, requires Python 2.7.x (and Centos 7).
21
22 Types
23 +++++
24
25 dcae.nodes.pgaas.cluster
26 ------------------------
27
28 **Derived From:** cloudify.nodes.Root
29
30 **Properties:**
31
32 -  ``writerfqdn`` (required string) The FQDN used for read-write access
33    to the cluster containing the postgres database instance. This is
34    used to identify and access a particular database instance and to
35    record information about that instance on Cloudify Manager.
36 -  ``use_existing`` (optional boolean default=false) This is used to
37    reference a database instance, in one blueprint, that was deployed in
38    a different one. If it is ``true``, then the ``readerfqdn`` property
39    must not be set and this node must not have any
40    ``dcae.relationships.pgaas_cluster_uses_sshkeypair`` relationships.
41    If it is ``false``, then this node must have exactly one
42    ``dcae.relationships.pgaas_cluster_uses_sshkeypair`` relationship.
43 -  ``readerfqdn`` (optional string default=value of ``writerfqdn``) The
44    FQDN used for read-only access to the cluster containing the postgres
45    database instance, if different than the FQDN used for read-write
46    access. This will be used by viewer roles.
47
48 **Mapped Operations:**
49
50 -  ``cloudify.interfaces.lifecycle.create`` validates and records
51    information about the cluster on the Cloudify Manager server in
52    /opt/manager/resources/pgaas/``writerfqdn``.
53 -  ``cloudify.interfaces.lifecycle.delete`` deletes previously recorded
54    information from the Cloudify Manager server.
55
56 Note: When ``use_existing`` is ``true``, the create operation validates
57 but does not record, and delete does nothing. Delete also does nothing
58 when validation has failed.
59
60 **Attributes:** This type has no runtime attributes
61
62 dcae.nodes.pgaas.database
63 -------------------------
64
65 **Derived From:** cloudify.nodes.Root
66
67 **Properties:** \* ``name`` (required string) The name of the
68 application database, in postgres. This name is also used to create the
69 names of the roles used to access the database, and the schema made
70 available to users of the database. \* ``use_existing`` (optional
71 boolean default=false) This is used to reference an application
72 database, in one blueprint, that was deployed in a different one. If
73 true, and this node has a
74 dcae.relationships.database\_runson\_pgaas\_cluster relationship, the
75 dcae.nodes.pgaas.cluster node that is the target of that relationship
76 must also have it's ``use_existing`` property set to true. \*
77 ``writerfqdn`` (optional string) This can be used as an alternative to
78 specifying the cluster, for the application database, with a
79 dcae.relationships.database\_runson\_pgaas\_cluster relationship to a
80 dcae.nodes.pgaas.cluster node. Exactly one of the two options must be
81 used. The relationship method must be used if this blueprint is
82 deploying both the cluster and the application database on the cluster.
83
84 **Mapped Operations:**
85
86 -  ``cloudify.interfaces.lifecycle.create`` creates the application
87    database, and various roles for admin/user/viewer access to it.
88 -  ``cloudify.interfaces.lifecycle.delete`` deletes the application
89    database and roles
90
91 Note: When ``use_existing`` is true, create and delete do not create or
92 delete the application database or associated roles. Create still sets
93 runtime attributes (see below).
94
95 **Attributes:**
96
97 -  ``admin`` a dict containing access information for adminstrative
98    access to the application database.
99 -  ``user`` a dict containing access information for user access to the
100    application database.
101 -  ``viewer`` a dict containing access information for read-only access
102    to the application database.
103
104 The keys in the access information dicts are as follows:
105
106 -  ``database`` the name of the application database.
107 -  ``host`` the appropriate FQDN for accessing the application database,
108    (writerfqdn or readerfqdn, based on the type of access).
109 -  ``user`` the user role for accessing the database.
110 -  ``password`` the password corresponding to the user role.
111
112 Relationships
113 +++++++++++++
114
115 dcae.relationships.pgaas\_cluster\_uses\_sshkeypair
116 ---------------------------------------------------
117
118 **Description:** A relationship for binding a dcae.nodes.pgaas.cluster
119 node to the dcae.nodes.ssh.keypair used by the cluster to initialize the
120 database access password for the postgres role. The password for the
121 postgres role is expected to be the hex representation of the MD5 hash
122 of 'postgres' and the contents of the id\_rsa (private key) file for the
123 ssh keypair. A dcae.nodes.pgaas.cluster node must have such a
124 relationship if and only if it's use\_existing property is false. ##
125 dcae.relationships.dcae.relationships.database\_runson\_pgaas\_cluster
126 **Description:** A relationship for binding a dcae.nodes.pgaas.database
127 node to the dcae.nodes.pgaas.cluster node that contains the application
128 database. A dcae.nodes.pgaas.database node must have either such a
129 relationship or a writerfqdn property. The writerfqdn property cannot be
130 used if the cluster is created in the same blueprint as the application
131 database. ## dcae.relationships.application\_uses\_pgaas\_database
132 **Description:** A relationship for binding a node that needs
133 application database access information to the dcae.nodes.pgaas.database
134 node for that application database.