How to set database web admin tool and hostname URL.
Overview
Database service can have a separate zone for web admin tool with appropriate record or can have one zone for database hostname and web admin tool with separate records. Web admin tool and hostname URL can be generated based on data from provisioned service or resource description depending on set configuration.
Configuring web admin tool URL
Open the Atomia.Web.Plugin.Databases.dll.config configuration file. It contains a list of plugin settings for different databases.
MySQL database
<pluginSetting name="MysqlPHPMyAdminEnabled" value="true"/> <pluginSetting name="MysqlPHPMyAdminAddress" value=""/> <pluginSetting name="MySQLWebAdminFromResource" value="false"/> <pluginSetting name="ResourcePropertyForMySQLWebAdminURL" value="DatabaseManagementURL"/>
To enable display of web admin tool URL for MySQL database “MysqlPHPMyAdminEnabled” plugin setting should be set to true. If “MySQLWebAdminFromResource” is set to false, the web admin tool URL is generated based on database service data. If it is set to true, URL is fetched from resource description for the resource used for service provisioning and “ResourcePropertyForMySQLWebAdminURL” should contain property name that holds the URL. If needed information for URL generation is not found, the web admin tool URL is constructed based on the value from plugin setting “MysqlPHPMyAdminAddress”.
MSSQL database
<pluginSetting name="MssqlMyLittleAdminEnabled" value="true"/> <pluginSetting name="MssqlMyLittleAdminAddress" value=""/> <pluginSetting name="MSSQLWebAdminFromResource" value="false"/> <pluginSetting name="ResourcePropertyForMSSQLWebAdmin" value="DatabaseManagementURL"/>
To enable display of web admin tool URL for MSSQL database “MssqlMyLittleAdminEnabled” plugin setting should be set to true. If “MSSQLHostnameFromResource” is set to false, the web admin tool URL is generated based on database service data. If it is set to true, URL is fetched from resource description for the resource used for service provisioning and “ResourcePropertyForMSSQLWebAdmin” should contain property name that holds the URL. If needed information for URL generation is not found, the web admin tool URL is constructed based on the value from plugin setting “MssqlMyLittleAdminAddress”.
PostgreSQL database
<pluginSetting name="PostgreWebAdminEnabled" value="true"/> <pluginSetting name="PostgreWebAdmin" value=""/> <pluginSetting name="PostgreWebAdminFromResource" value="false"/> <pluginSetting name="ResourcePropertyForPostgreWebAdminURL" value="DatabaseManagementURL"/>
To enable display of web admin tool URL for PostgreSQL database “PostgreWebAdminEnabled” plugin setting should be set to true. If “PostgreWebAdminFromResource” is set to false, the web admin tool URL is generated based on database service data. If it is set to true, URL is fetched from resource description for the resource used for service provisioning and “ResourcePropertyForPostgreWebAdminURL” should contain property name that holds the URL. If needed information for URL generation is not found, the web admin tool URL is constructed based on the value from plugin setting “PostgreWebAdmin”.
Configuring database hostname URLs
MySQL database
<pluginSetting name="MysqlHostname" value=""/> <pluginSetting name="MySQLHostnameFromResource" value="false"/> <pluginSetting name="ResourcePropertyForMySQLHostname" value="PublicHostname"/>
If “MySQLHostnameFromResource” is set to false, the database hostname URL is generated based on database service data. If set to true, URL is fetched from the resource description for the resource used for service provisioning and “ResourcePropertyForMySQLHostname” should contain property name that holds the URL. If needed information for URL generation is not found, hostname URL is constructed based on the value from plugin setting “MysqlHostname”.
MSSQL database
<pluginSetting name="MssqlHostname" value=""/> <pluginSetting name="MSSQLHostnameFromResource" value="false"/> <pluginSetting name="ResourcePropertyForMSSQLHostname" value="PublicHostname"/>
If “MSSQLHostnameFromResource” is set to false, the database hostname URL is generated based on database service data. If set to true, URL is fetched from resource description for the resource used for service provisioning and “ResourcePropertyForMSSQLHostname” should contain property name that holds the URL. If needed information for URL generation is not found, hostname URL is constructed based on the value from plugin setting “MssqlHostname”.
PostgreSQL database
<pluginSetting name="PostgreHostname" value=""/> <pluginSetting name="PostgreHostnameFromResource" value="false"/> <pluginSetting name="ResourcePropertyForPostgreHostname" value="PublicHostname"/>
If “PostgreHostnameFromResource” is set to false, the database hostname URL is generated based on database service data. If set to true, URL is fetched from resource description for the resource used for service provisioning and “ResourcePropertyForPostgreHostname” should contain property name that holds the URL. If needed information for URL generation is not found, hostname URL is constructed based on the value from plugin setting “PostgreHostname”.
Example configuration for provisioning description
A configuration for database service with two zones:
<complexService name = "CsMSSQLDatabase"> <complexServicePropertyList> <complexServiceProperty name="DatabaseName" description="Database Name" key="true" /> <complexServiceProperty name="Collation" description="Collation" /> </complexServicePropertyList> <partList> <partService name="MSSQLDatabase" min="1" max="1"> <propertyTransformation> <simpleTransformer> <serviceProperty name="DatabaseName"> <expression>#Account()+\-+$CsMSSQLDatabase::DatabaseName</expression> </serviceProperty> <serviceProperty name="Collation"> <expression>$CsMSSQLDatabase::Collation</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </partService> <partService name="DnsZone"> </partService> <partService name="DnsZone"> </partService> </partList> <init> <add partName="MSSQLDatabase" instanceName="MSSQLInstance"> </add> <add partName="DnsZone"> <initPropertyList> <initProperty name="Zonename" value="mssql.dev.atomia.com" /> <initProperty name="Shared" value="true" /> </initPropertyList> <add partName="DnsZoneRecord"> <initPropertyList> <initProperty name="Id" value="" /> <initProperty name = "DnsType" value="A" /> <propertyTransformation> <simpleTransformer> <serviceProperty name = "Label"> <expression>$CsMSSQLDatabase::DatabaseName+\-+#Account()</expression> </serviceProperty> <serviceProperty name = "Data"> <expression>#Instance(MSSQLInstance).Resource.PublicIpAddress</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </initPropertyList> </add> </add> <add partName="DnsZone"> <initPropertyList> <initProperty name="Zonename" value="mylittleadmin.mssql.dev.atomia.com" /> <initProperty name="Shared" value="true" /> </initPropertyList> <add partName="DnsZoneRecord"> <initPropertyList> <initProperty name="Id" value="" /> <initProperty name = "DnsType" value="A" /> <propertyTransformation> <simpleTransformer> <serviceProperty name="Label"> <expression>$CsMSSQLDatabase::DatabaseName+\-+#Account()</expression> </serviceProperty> <serviceProperty name="Data"> <expression>#Instance(MSSQLInstance).Resource.AdminIpAddress</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </initPropertyList> </add> </add> </init> <actionHooks> <onBeforeAddService type="Atomia.Provisioning.ActionHooks.BeforeAddService.UniquenessCheck, Atomia.Provisioning.ActionHooks.BeforeAddService" argument="" /> </actionHooks> </complexService>
Database service defined this way contains zone for database host and a second zone for the web admin tool. Since this example configuration is for MSSQL database, if “MSSQLHostnameFromResource” and “MSSQLWebAdminFromResource” are set to false, URLs are generated from the zone and record data. Web admin tool URL is generated using web admin tool zone (the one with zone name “mylittleadmin.mssql.dev.atomia.com”) by concatenating record label with zone name. In the same manner, URL for database host is formed, only this time using zone defined for database host and using the record from that zone.
Example configuration for database service with one zone containing two records:
<complexService name="CsMySqlDatabase" description="MySQL Databasee Complex Service"> <complexServicePropertyList> <complexServiceProperty name="DatabaseName" description="Database Name" key="true" /> <complexServiceProperty name="CharacterSet" description="Character Set" /> <complexServiceProperty name="Collation" description="Collation" /> </complexServicePropertyList> <partList> <partService name="MySQLDatabase" min="1" max="1"> <propertyTransformation> <simpleTransformer> <serviceProperty name="DatabaseName"> <expression>#Account()+\-+$CsMySqlDatabase::DatabaseName</expression> </serviceProperty> <serviceProperty name="CharacterSet"> <expression>$CsMySqlDatabase::CharacterSet</expression> </serviceProperty> <serviceProperty name="Collation"> <expression>$CsMySqlDatabase::Collation</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </partService> <partService name="DnsZone"> </partService> </partList> <init> <add partName="MySQLDatabase" instanceName="MysqlDatabaseInstance"> </add> <add partName="DnsZone"> <initPropertyList> <initProperty name="Zonename" value="mysql.dev.atomia.com" /> <initProperty name="Shared" value="true" /> </initPropertyList> <add partName="DnsZoneRecord"> <initPropertyList> <initProperty name="Id" value="" /> <initProperty name="DnsType" value="A" /> <propertyTransformation> <simpleTransformer> <serviceProperty name="Label"> <expression>$CsMySqlDatabase::DatabaseName+\-+#Account()</expression> </serviceProperty> <serviceProperty name="Data"> <expression>#Instance(MysqlDatabaseInstance).Resource.PublicIpAddress</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </initPropertyList> </add> <add partName="DnsZoneRecord"> <initPropertyList> <initProperty name="Id" value="" /> <initProperty name="DnsType" value="A" /> <propertyTransformation> <simpleTransformer> <serviceProperty name="Label"> <expression>$CsMySqlDatabase::DatabaseName+\-+#Account()+\.phpmyadmin</expression> </serviceProperty> <serviceProperty name="Data"> <expression>#Instance(MysqlDatabaseInstance).Resource.PublicIpAddress</expression> </serviceProperty> </simpleTransformer> </propertyTransformation> </initPropertyList> </add> </add> </init> <actionHooks> <onBeforeAddService type="Atomia.Provisioning.ActionHooks.BeforeAddService.UniquenessCheck, Atomia.Provisioning.ActionHooks.BeforeAddService" argument="" /> </actionHooks> </complexService>
Database service defined this way contains one zone for database host and web admin tool. Since this example configuration is for MySQL database, if “MySQLWebAdminFromResource” and “MySQLHostnameFromResource” are set to false, URLs are generated from the zone and record data. Web admin tool URL is generated by concatenating label from web admin tool record (the one whose label contains phpmyadmin) with zone name (“mysql.dev.atomia.com”). Database host URL is formed in the same way, only using the database host record.