brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [1/2] brooklyn-library git commit: tidies to illustrative examples
Date Fri, 03 Jun 2016 08:16:42 GMT
Repository: brooklyn-library
Updated Branches:
  refs/heads/master 7d8dec210 -> c9206b988


tidies to illustrative examples


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/1a936e02
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/1a936e02
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/1a936e02

Branch: refs/heads/master
Commit: 1a936e02dc35a04a81f6c5f78d3f760ede84cc2a
Parents: 8e72520
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Jun 3 09:15:58 2016 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Jun 3 09:15:58 2016 +0100

----------------------------------------------------------------------
 .../java-web-app-and-db-with-function.yaml      | 24 ++++-----
 .../java-web-app-and-db-with-policy.bom         | 54 ++++++++++++++++++++
 .../java-web-app-and-db-with-policy.yaml        | 25 +++++----
 3 files changed, 77 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/1a936e02/qa/src/test/resources/java-web-app-and-db-with-function.yaml
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-function.yaml b/qa/src/test/resources/java-web-app-and-db-with-function.yaml
index 0f15729..1d07f9b 100644
--- a/qa/src/test/resources/java-web-app-and-db-with-function.yaml
+++ b/qa/src/test/resources/java-web-app-and-db-with-function.yaml
@@ -17,20 +17,18 @@
 # under the License.
 #
 name: java-cluster-db-example
+location: localhost
 services:
-- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
   name: My Web
-  location: localhost
-  brooklyn.config:
-    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.7.0-M1/brooklyn-example-hello-world-sql-webapp-0.7.0-M1.war
-    http.port: 9280+
-    proxy.http.port: 9210+
-    java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
-- serviceType: org.apache.brooklyn.entity.database.mysql.MySqlNode
+  wars.root: http://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.9.0/brooklyn-example-hello-world-sql-webapp-0.9.0.war
+  http.port: 9280+
+  proxy.http.port: 9210+
+  java.sysprops: 
+    brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+       component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+
+- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: My DB
-  location: localhost
-  brooklyn.config:
-    datastore.creation.script.url: classpath://visitors-creation-script.sql
+  creationScriptUrl: classpath://visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/1a936e02/qa/src/test/resources/java-web-app-and-db-with-policy.bom
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-policy.bom b/qa/src/test/resources/java-web-app-and-db-with-policy.bom
new file mode 100644
index 0000000..0bc5de9
--- /dev/null
+++ b/qa/src/test/resources/java-web-app-and-db-with-policy.bom
@@ -0,0 +1,54 @@
+#
+# 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.
+#
+
+# standalone catalog file
+
+brooklyn.catalog:
+  version: 0.10.0-SNAPSHOT   # BROOKLYN_VERSION
+  items:
+  - id: java-cluster-db-policy-example
+    name: Elastic Web + DB
+    description: Sample elastic Java cluster fronted by nginx with a MySQL backend, including
a scaling policy
+    iconUrl: http://www.apache.org/foundation/press/kit/poweredBy/Apache_PoweredBy.png
+    itemType: template
+    item:
+      name: Elastic Web + DB
+      services:
+      - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+        name: My Web with Policy
+        war: 
+          http://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.9.0/brooklyn-example-hello-world-sql-webapp-0.9.0.war
+        java.sysprops: 
+          brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+             component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
"br00k11n")
+      
+        brooklyn.policies:
+        - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+          brooklyn.config:
+            metric: $brooklyn:sensor("org.apache.brooklyn.entity.webapp.DynamicWebAppCluster",
"webapp.reqs.perSec.windowed.perNode")
+            metricLowerBound: 10
+            metricUpperBound: 100
+            minPoolSize: 1
+            maxPoolSize: 5
+            
+      - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+        id: db
+        name: My DB
+        creationScriptUrl:
+          https://raw.githubusercontent.com/apache/brooklyn-library/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/1a936e02/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-policy.yaml b/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
index 10ea4e5..58d6121 100644
--- a/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
+++ b/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
@@ -17,19 +17,19 @@
 # under the License.
 #
 name: java-cluster-db-policy-example
+location: localhost
 services:
 - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
   name: My Web with Policy
-  location: localhost
-  brooklyn.config:
-    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0-M2/brooklyn-example-hello-world-sql-webapp-0.6.0-M2.war
-    http.port: 9280+
-    proxy.http.port: 9210+
-    java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+  wars.root: http://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.9.0/brooklyn-example-hello-world-sql-webapp-0.9.0.war
+  http.port: 9280+
+  proxy.http.port: 9210+
+  java.sysprops: 
+    brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+       component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+
   brooklyn.policies:
-  - policyType: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+  - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
     brooklyn.config:
       metric: $brooklyn:sensor("org.apache.brooklyn.entity.webapp.DynamicWebAppCluster",
"webapp.reqs.perSec.windowed.perNode")
       metricLowerBound: 10
@@ -40,7 +40,6 @@ services:
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: My DB
-  location: localhost
-  brooklyn.config:
-    # this also uses the flag rather than the config key
-    creationScriptUrl: classpath://visitors-creation-script.sql
+  creationScriptUrl: classpath://visitors-creation-script.sql
+  # or https://raw.githubusercontent.com/apache/brooklyn-library/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+    
\ No newline at end of file


Mime
View raw message