blueprints

The cfy blueprints command is used to manage blueprints on a Cloudify Manager instance.

You can use the command to upload, delete, download, validate and list blueprints and to retrieve information for a specific blueprint.

Optional flags

These commands support the common CLI flags.

Commands

upload

Usage

cfy blueprints upload [options] BLUEPRINT_PATH

Upload a blueprint to a Cloudify Manager.

BLUEPRINT_PATH can be either a local blueprint yaml file or blueprint archive; a url to a blueprint archive or an organization/blueprint_repo[:tag/branch] (to be retrieved from GitHub) Supported archive types are: zip, tar, tar.gz and tar.bz2

Optional flags

 

Example

$ cfy blueprint upload simple-blueprint.yaml 
...

Uploading blueprint simple-blueprint.yaml...
 simple-blueprint.... |################################################| 100.0%
Blueprint uploaded. The blueprint's id is cloudify-nodecellar-example

...

$ cfy blueprints upload simple-python-webserver-blueprint/blueprint.yaml --validate
...

Validating blueprint: simple-python-webserver-blueprint/blueprint.yaml
Blueprint validated successfully

...

delete

Usage

cfy blueprints delete [OPTIONS] BLUEPRINT_ID

Delete a blueprint. It’s important to note that deleting a blueprint does not delete the deployments created from that blueprint and resources of those deployments.

Optional Flags

 

Example

$ cfy blueprints delete simple-python-webserver-blueprint
...

Deleting blueprint simple-python-webserver-blueprint...
Blueprint deleted

...

package

Usage

cfy blueprints package [OPTIONS] BLUEPRINT_PATH

Create a blueprint archive

BLUEPRINT_PATH - The path to the blueprint yaml or to the directory in which the blueprint yaml files resides.

Optional flags

 

Example

$ cfy blueprints package simple-python-webserver-blueprint/blueprint.yaml
...

Creating blueprint archive simple-python-webserver-blueprint...
Packaging complete!

...

download

Usage

cfy blueprints download [OPTIONS] BLUEPRINT_ID

Download a blueprint from Cloudify Manager.

BLUEPRINT_ID - The ID of the blueprint to download.

Optional flags

 

Example

$ cfy blueprints download simple-python-webserver-blueprint
...

Downloading blueprint simple-python-webserver-blueprint...
 simple-python-web... |################################################| 100.0%
Blueprint downloaded as simple-python-webserver-blueprint.tar.gz

...

validate

Usage

cfy blueprints validate [OPTIONS] BLUEPRINT_PATH

Validate a blueprint. Checks that the blueprint’s syntax is valid and that all imports are accessible.

BLUEPRINT_PATH - The path of the blueprint to validate.

 

Example

$ cfy blueprints validate simple-python-webserver-blueprint/blueprint.yaml
...

Validating blueprint: simple-python-webserver-blueprint/blueprint.yaml
Blueprint validated successfully

...

create-requirements

Usage

cfy blueprints create-requirements [OPTIONS] BLUEPRINT_PATH

Generate a pip-compliant requirements file for a specific blueprint.

BLUEPRINT_PATH - The path to the blueprint for which the file will be generated.

Optional flags

 

Example

$ cfy blueprints create-requirements nodecellar-blueprint/aws-ec2-blueprint.yaml
...

https://github.com/cloudify-cosmo/cloudify-aws-plugin/archive/1.4.1.zip
https://github.com/cloudify-cosmo/cloudify-diamond-plugin/archive/1.3.3.zip

...

install-plugins

Usage

cfy blueprints install-plugins [OPTIONS] BLUEPRINT_PATH

Install the necessary plugins for a specific blueprint in the local environment.

Only supports passing the YAML of the blueprint directly.

BLUEPRINT_PATH - The path to the blueprint to install plugins for.

 

Example

$ cfy blueprints install-plugins nodecellar-blueprint/aws-ec2-blueprint.yaml
...

Installing plugins...
Collecting https://github...
.
.
.
Installing collected packages: boto, cloudify-aws-plugin
  Running setup.py install for cloudify-aws-plugin ... done
Successfully installed boto-2.38.0 cloudify-aws-plugin-1.4.3

...

list

Usage

cfy blueprints list [OPTIONS]

List all existing blueprints.

Optional flags

 

Example

$ cfy blueprints list
...

Listing all blueprints...

Blueprints:
+------------------------------+----------------------+---------------------------+--------------------------+--------------------------+------------+----------------+------------+
|              id              |     description      |       main_file_name      |        created_at        |        updated_at        | visibility |  tenant_name   | created_by |
+------------------------------+----------------------+---------------------------+--------------------------+--------------------------+------------+----------------+------------+
| cloudify-nodecellar-example  | This Blueprint ins.. |   simple-blueprint.yaml   | 2017-04-04 05:52:32.634  | 2017-04-04 05:52:32.634  |   private  | default_tenant |   admin    |
| cloudify-hello-world-example | This blueprint ins.. | singlehost-blueprint.yaml | 2017-04-04 06:48:53.255  | 2017-04-04 06:48:53.255  |   tenant   | default_tenant |   admin    |
+------------------------------+----------------------+---------------------------+--------------------------+--------------------------+------------+----------------+------------+

...

summary

Usage

cfy blueprints summary <field> [optional sub-field] [OPTIONS]

Summarizes blueprints, giving a count of elements with each distinct value for the selected field. If a sub-field is selected then a count will be given for each distinct field and sub-field combination, as well as totals for each field.

For valid field/sub-field names, invoke cfy blueprints summary

 

Example

$ cfy blueprints summary --all-tenants tenant_name
Retrieving summary of blueprints on field tenant_name

Blueprint summary by tenant_name
+----------------+------------+
|  tenant_name   | blueprints |
+----------------+------------+
|     test1      |     3      |
|     test2      |     3      |
| default_tenant |     3      |
+----------------+------------+

...

$ cfy blueprints summary --all-tenants tenant_name visibility
Retrieving summary of blueprints on field tenant_name

Blueprint summary by tenant_name
+----------------+------------+------------+
|  tenant_name   | visibility | blueprints |
+----------------+------------+------------+
|     test1      |   tenant   |     3      |
|     test1      |   TOTAL    |     3      |
|     test2      |   tenant   |     3      |
|     test2      |   TOTAL    |     3      |
| default_tenant |   tenant   |     3      |
| default_tenant |   TOTAL    |     3      |
+----------------+------------+------------+

...

get

Usage

cfy blueprints get [OPTIONS] BLUEPRINT_ID

Retrieve information for a specific blueprint.

BLUEPRINT_ID - The ID of the blueprint for which to retrieve information.

Optional flags

 

Example

$ cfy blueprints get cloudify-nodecellar-example
...

Blueprint:
+-----------------------------+----------------------------------------------------+-----------------------+--------------------------+--------------------------+------------+----------------+------------+--------------+
|              id             |                    description                     |     main_file_name    |        created_at        |        updated_at        | visibility |  tenant_name   | created_by | #deployments |
+-----------------------------+----------------------------------------------------+-----------------------+--------------------------+--------------------------+------------+----------------+------------+--------------+
| cloudify-nodecellar-example | This Blueprint installs the nodecellar application | simple-blueprint.yaml | 2017-04-04 05:52:32.634  | 2017-04-04 05:52:32.634  |   tenant   | default_tenant |   admin    |      1       |
|                             |                on an existing host.                |                       |                          |                          |            |                |            |              |
|                             |                                                    |                       |                          |                          |            |                |            |              |
+-----------------------------+----------------------------------------------------+-----------------------+--------------------------+--------------------------+------------+----------------+------------+--------------+

Description:
This Blueprint installs the nodecellar application on an existing host.


Existing deployments:
["cloudify-nodecellar-example"]
...

inputs

Usage

cfy blueprints inputs [OPTIONS] BLUEPRINT_ID

Retrieve inputs for a specific blueprint

BLUEPRINT_ID - The path of the blueprint for which to retrieve inputs.

Optional flags

 

Example

$ cfy blueprints inputs cloudify-hello-world-example
...

Retrieving inputs for blueprint cloudify-hello-world-example...

Inputs:
+------------------------+------+-------------+-------------+
|          name          | type |   default   | description |
+------------------------+------+-------------+-------------+
|     webserver_port     |  -   |     8080    |      -      |
|       agent_user       |  -   |    centos   |      -      |
|       server_ip        |  -   | 172.16.0.49 |      -      |
| agent_private_key_path |  -   |   /key.pem  |      -      |
+------------------------+------+-------------+-------------+

...

set-visibility

Usage

cfy blueprints set-visibility [OPTIONS] BLUEPRINT_ID

Set the blueprint’s visibility

BLUEPRINT_ID - The id of the blueprint to update.

Mandatory flags

 

Example

$ cfy blueprints set-visibility cloudify-nodecellar-example -l global
...

Blueprint `cloudify-nodecellar-example` was set to global

...