Capabilities

capabilities enable you to expose some aspects of a deployment. When deployed, a blueprint can expose specific capabilities of that deployment - for example, an endpoint of a server or any other runtime or static information of a specific resource.

Declaration

capabilities:
  capability1:
    ...
  capability2:
    ...

Schema

Keyname Required Type Description
description no description An optional description for the capability.
value yes <any> The capability value. May be anything from a simple value (e.g. port) to a complex value (e.g. hash with values). Capability values can contain hard-coded values, inputs, properties, attributes and even other capabilities.


Example

tosca_definitions_version: cloudify_dsl_1_3

imports:
  - http://www.getcloudify.org/spec/cloudify/5.0.0/types.yaml

node_templates:
  webserver_vm:
    type: cloudify.nodes.Compute
  webserver:
    type: cloudify.nodes.WebServer
    properties:
        port: 8080

capabilities:
    webapp_endpoint:
        description: ip and port of the web application
        value:
            ip: { get_attribute: [webserver_vm, ip] }
            port: { get_property: [webserver, port] }

Reading Capabilities

You can view the capabilities either by using the CLI

cfy deployments capabilities DEPLOYMENT_ID
or using it in a blueprint with get_capability intrinsic function or by making a REST call
curl -X GET --header "Tenant: <manager-tenant>" -u <manager-username>:<manager-password> "http://<manager-ip>/api/v3.1/deployments/<deployment-id>/capabilities"