You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Thomas Bouron <th...@cloudsoftcorp.com> on 2015/06/12 12:02:53 UTC
PostgreSQLNode & DSL commands
Hi there.
I have a YAML blueprint that uses the PostgresqlNode entity and the
*datastore.creation.script.contents* config key to setup my user and db.
The user / password and db name are defined as configuration in my YAML,
therefore I use the following:
*CREATE USER $brooklyn:config("db.user") WITH PASSWORD
'$brooklyn:config("db.password")' CREATEDB;*
*CREATE DATABASE $brooklyn:config("db.name <http://db.name>") OWNER
$brooklyn:config("db.user");*
Turns out that it does get replaced. I checked the creation-script.sql file
created on the server and it is exactly as it is.
Is that an expected behaviour?
Thanks.
Best.
--
Thomas
--
Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message
from your computer. Internet e-mails are not necessarily secure. Cloudsoft
Corporation Limited does not accept responsibility for changes made to this
message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward transmission, opening or use of this message and any attachments
will not adversely affect its systems or data. No responsibility is
accepted by Cloudsoft Corporation Limited in this regard and the recipient
should carry out such virus and other checks as it considers appropriate.
Re: PostgreSQLNode & DSL commands
Posted by Thomas Bouron <th...@cloudsoftcorp.com>.
Hi Martin.
I forgot about this feature. I just tested it and it works great, thank you.
Cheers.
On Mon, 15 Jun 2015 at 13:12 Martin Harris <ma...@cloudsoftcorp.com>
wrote:
> Hi Thomas,
>
> I found a similar issue with MySQL a while ago. You can find the changes I
> made here[1]
>
> [1]: https://github.com/apache/incubator-brooklyn/pull/530/files
>
> Cheers
>
> M
>
> On 12 Jun 2015 11:04, "Thomas Bouron" <th...@cloudsoftcorp.com>
> wrote:
>
> > Hi there.
> >
> > I have a YAML blueprint that uses the PostgresqlNode entity and the
> > *datastore.creation.script.contents* config key to setup my user and db.
> >
> > The user / password and db name are defined as configuration in my YAML,
> > therefore I use the following:
> >
> > *CREATE USER $brooklyn:config("db.user") WITH PASSWORD
> > '$brooklyn:config("db.password")' CREATEDB;*
> > *CREATE DATABASE $brooklyn:config("db.name <http://db.name>") OWNER
> > $brooklyn:config("db.user");*
> >
> > Turns out that it does get replaced. I checked the creation-script.sql
> file
> > created on the server and it is exactly as it is.
> >
> > Is that an expected behaviour?
> >
> > Thanks.
> >
> > Best.
> > --
> > Thomas
> >
> > --
> > Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
> > Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
> >
> > This e-mail message is confidential and for use by the addressee only. If
> > the message is received by anyone other than the addressee, please return
> > the message to the sender by replying to it and then delete the message
> > from your computer. Internet e-mails are not necessarily secure.
> Cloudsoft
> > Corporation Limited does not accept responsibility for changes made to
> this
> > message after it was sent.
> >
> > Whilst all reasonable care has been taken to avoid the transmission of
> > viruses, it is the responsibility of the recipient to ensure that the
> > onward transmission, opening or use of this message and any attachments
> > will not adversely affect its systems or data. No responsibility is
> > accepted by Cloudsoft Corporation Limited in this regard and the
> recipient
> > should carry out such virus and other checks as it considers appropriate.
> >
>
> --
> Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
> Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
>
> This e-mail message is confidential and for use by the addressee only. If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from your computer. Internet e-mails are not necessarily secure. Cloudsoft
> Corporation Limited does not accept responsibility for changes made to this
> message after it was sent.
>
> Whilst all reasonable care has been taken to avoid the transmission of
> viruses, it is the responsibility of the recipient to ensure that the
> onward transmission, opening or use of this message and any attachments
> will not adversely affect its systems or data. No responsibility is
> accepted by Cloudsoft Corporation Limited in this regard and the recipient
> should carry out such virus and other checks as it considers appropriate.
>
--
Thomas
--
Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message
from your computer. Internet e-mails are not necessarily secure. Cloudsoft
Corporation Limited does not accept responsibility for changes made to this
message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward transmission, opening or use of this message and any attachments
will not adversely affect its systems or data. No responsibility is
accepted by Cloudsoft Corporation Limited in this regard and the recipient
should carry out such virus and other checks as it considers appropriate.
Re: PostgreSQLNode & DSL commands
Posted by Martin Harris <ma...@cloudsoftcorp.com>.
Hi Thomas,
I found a similar issue with MySQL a while ago. You can find the changes I
made here[1]
[1]: https://github.com/apache/incubator-brooklyn/pull/530/files
Cheers
M
On 12 Jun 2015 11:04, "Thomas Bouron" <th...@cloudsoftcorp.com>
wrote:
> Hi there.
>
> I have a YAML blueprint that uses the PostgresqlNode entity and the
> *datastore.creation.script.contents* config key to setup my user and db.
>
> The user / password and db name are defined as configuration in my YAML,
> therefore I use the following:
>
> *CREATE USER $brooklyn:config("db.user") WITH PASSWORD
> '$brooklyn:config("db.password")' CREATEDB;*
> *CREATE DATABASE $brooklyn:config("db.name <http://db.name>") OWNER
> $brooklyn:config("db.user");*
>
> Turns out that it does get replaced. I checked the creation-script.sql file
> created on the server and it is exactly as it is.
>
> Is that an expected behaviour?
>
> Thanks.
>
> Best.
> --
> Thomas
>
> --
> Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
> Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
>
> This e-mail message is confidential and for use by the addressee only. If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from your computer. Internet e-mails are not necessarily secure. Cloudsoft
> Corporation Limited does not accept responsibility for changes made to this
> message after it was sent.
>
> Whilst all reasonable care has been taken to avoid the transmission of
> viruses, it is the responsibility of the recipient to ensure that the
> onward transmission, opening or use of this message and any attachments
> will not adversely affect its systems or data. No responsibility is
> accepted by Cloudsoft Corporation Limited in this regard and the recipient
> should carry out such virus and other checks as it considers appropriate.
>
--
Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message
from your computer. Internet e-mails are not necessarily secure. Cloudsoft
Corporation Limited does not accept responsibility for changes made to this
message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward transmission, opening or use of this message and any attachments
will not adversely affect its systems or data. No responsibility is
accepted by Cloudsoft Corporation Limited in this regard and the recipient
should carry out such virus and other checks as it considers appropriate.
Re: PostgreSQLNode & DSL commands
Posted by Svetoslav Neykov <sv...@cloudsoftcorp.com>.
Hi Thomas,
The $brooklyn prefix doesn't work when inside a string. You can use $brooklyn:formatString instead. See https://github.com/apache/incubator-brooklyn/blob/2bffd089de8c9824d472c2796d1650dd013c3879/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml#L29 <https://github.com/apache/incubator-brooklyn/blob/2bffd089de8c9824d472c2796d1650dd013c3879/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml#L29> for example usage.
Svet.
> On 12.06.2015 г., at 13:02, Thomas Bouron <th...@cloudsoftcorp.com> wrote:
>
> Hi there.
>
> I have a YAML blueprint that uses the PostgresqlNode entity and the
> *datastore.creation.script.contents* config key to setup my user and db.
>
> The user / password and db name are defined as configuration in my YAML,
> therefore I use the following:
>
> *CREATE USER $brooklyn:config("db.user") WITH PASSWORD
> '$brooklyn:config("db.password")' CREATEDB;*
> *CREATE DATABASE $brooklyn:config("db.name <http://db.name>") OWNER
> $brooklyn:config("db.user");*
>
> Turns out that it does get replaced. I checked the creation-script.sql file
> created on the server and it is exactly as it is.
>
> Is that an expected behaviour?
>
> Thanks.
>
> Best.
> --
> Thomas
>
> --
> Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
> Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
>
> This e-mail message is confidential and for use by the addressee only. If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from your computer. Internet e-mails are not necessarily secure. Cloudsoft
> Corporation Limited does not accept responsibility for changes made to this
> message after it was sent.
>
> Whilst all reasonable care has been taken to avoid the transmission of
> viruses, it is the responsibility of the recipient to ensure that the
> onward transmission, opening or use of this message and any attachments
> will not adversely affect its systems or data. No responsibility is
> accepted by Cloudsoft Corporation Limited in this regard and the recipient
> should carry out such virus and other checks as it considers appropriate.
--
Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.
Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP
This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message
from your computer. Internet e-mails are not necessarily secure. Cloudsoft
Corporation Limited does not accept responsibility for changes made to this
message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward transmission, opening or use of this message and any attachments
will not adversely affect its systems or data. No responsibility is
accepted by Cloudsoft Corporation Limited in this regard and the recipient
should carry out such virus and other checks as it considers appropriate.