All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ooklyn.brooklyn-software-base.0.11.0.source-code.catalog.bom Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
# 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.

brooklyn.catalog:
    version: "0.11.0" # BROOKLYN_VERSION
    itemType: entity
    items:
    - id: org.apache.brooklyn.entity.machine.MachineEntity
      item:
        type: org.apache.brooklyn.entity.machine.MachineEntity
        name: Machine Entity
        description: Represents a machine, providing metrics about it (e.g. obtained from ssh)
    - id: org.apache.brooklyn.entity.software.base.SameServerEntity
      item:
        type: org.apache.brooklyn.entity.software.base.SameServerEntity
    - id: org.apache.brooklyn.entity.chef.ChefEntity
      item:
        type: org.apache.brooklyn.entity.chef.ChefEntity
    - id: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirror
      item:
        type: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirror
        name: Brooklyn Entity Mirror
        description: Provides an entity which can sit in one brooklyn 
    - id: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
      item:
        type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
    - id: org.apache.brooklyn.entity.software.base.EmptyWindowsProcess
      item:
        type: org.apache.brooklyn.entity.software.base.EmptyWindowsProcess
    - id: org.apache.brooklyn.entity.software.base.VanillaWindowsProcess
      item:
        type: org.apache.brooklyn.entity.software.base.VanillaWindowsProcess
        name: Vanilla Windows Process
        description: A basic Windows entity configured with scripts, e.g. for launch, check-running and stop
    - id: org.apache.brooklyn.entity.java.VanillaJavaApp
      item:
        type: org.apache.brooklyn.entity.java.VanillaJavaApp
    - id: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
      item:
        type: org.apache.brooklyn.entity.brooklynnode.BrooklynNode
        name: Brooklyn Node
        description: Deploys a Brooklyn management server
    - id: org.apache.brooklyn.entity.brooklynnode.BrooklynCluster
      item:
        type: org.apache.brooklyn.entity.brooklynnode.BrooklynCluster
    - id: org.apache.brooklyn.entity.brooklynnode.LocalBrooklynNode
      item:
        type: org.apache.brooklyn.entity.brooklynnode.LocalBrooklynNode
    - id: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
      item:
        type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
        name: Vanilla Software Process
        description: A software process configured with scripts, e.g. for launch, check-running and stop
    - id: org.apache.brooklyn.entity.machine.pool.ServerPool
      item:
        type: org.apache.brooklyn.entity.machine.pool.ServerPool
        name: Server Pool
        description: Creates a pre-allocated server pool, which other applications can deploy to

    - id: bash-web-server-template
      itemType: template
      name: "Template: Bash Web Server"
      description: |
        Sample YAML building on Template "Server",
        adding bash commands to launch a Python-based web server
        on port 8020
      item:
        name: Python Web Server (Brooklyn Example)

        # this example builds on the previous one,
        # adding some scripts to initialize the VM

        services:
        - type:           org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
          name:           My Bash Web Server VM
          brooklyn.config:
            install.command: |
              # install python if not present
              which python || \
                { apt-get update && apt-get install python ; } || \
                { yum update && yum install python ; } || \
                { echo WARNING: cannot install python && exit 1 ; }

            customize.command: |
              # create the web page to serve
              cat > index.html << EOF

              Hello world.
              

I am ${ENTITY_INFO}, ${MESSAGE:-a Brooklyn sample}.

Created at: `date`

I am running at ${HOSTNAME}, with on-box IP configuration:

              `ifconfig | grep inet`
              
EOF launch.command: | # launch in background (ensuring no streams open), and record PID to file nohup python -m SimpleHTTPServer ${PORT:-8020} < /dev/null > output.txt 2>&1 & echo $! > ${PID_FILE:-pid.txt} sleep 5 ps -p `cat ${PID_FILE:-pid.txt}` if [ $? -ne 0 ] ; then cat output.txt echo WARNING: python web server not running exit 1 fi shell.env: HOSTNAME: $brooklyn:attributeWhenReady("host.name") PORT: $brooklyn:config("my.app.port") ENTITY_INFO: $brooklyn:component("this", "") MESSAGE: $brooklyn:config("my.message") # custom my.app.port: 8020 my.message: "good to meet you" brooklyn.enrichers: # publish the URL as a sensor; the GUI will pick this up (main.uri) - type: org.apache.brooklyn.enricher.stock.Transformer brooklyn.config: uniqueTag: url-generator enricher.sourceSensor: host.subnet.hostname # use the definition from Attributes class, as it has a RendererHint so GUI makes it a link enricher.targetSensor: $brooklyn:sensor("org.apache.brooklyn.core.entity.Attributes", "main.uri") enricher.targetValue: $brooklyn:formatString: - "http://%s:%s/" - $brooklyn:attributeWhenReady("host.subnet.hostname") - $brooklyn:config("my.app.port") location: jclouds:aws-ec2: region: eu-central-1 # edit these (or delete if credentials specified in brooklyn.properties) identity: credential:




© 2015 - 2024 Weber Informatics LLC | Privacy Policy