Welcome to cloudify-cli’s documentation!¶
The documention here includes reference for the various cfy subcommands. For general usage, please refer to the documentation located at getcloudify.org.
Contents:
Commands¶
- There are two flags that can be used for all operations:
--verbose prints the traceback and prints the events in verbose mode (a full event json)
--debug sets all loggers declared in the config file to debug mode.
In particular, sets the rest client logger to debug mode, this means that the output will include http communication with the rest server (response, requests and headers).
cfy¶
Manages Cloudify in different Cloud Environments
usage: cfy [-h] [--version] {status,use,executions,ssh,workflows,blueprints,teardown,bootstrap,dev,deployments,init,local,events} ...
- Options:
--version show version information and exit - Sub-commands:
- status
Show a management server’s status
The command prints out the currently active manager’s IP address and a status of the active manager’s running services.
usage: cfy status [-h] [-v] [--debug]
- Options:
-v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- use
Use/switch to the specified management server
usage: cfy use [-h] [--provider] [--port REST_PORT] -t MANAGEMENT_IP [-v] [--debug]
- Options:
--provider=False Use deprecated provider api --port=80 Specify the rest server port -t, --management-ip The cloudify management server ip address -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- executions
Manages Cloudify’s Executions
usage: cfy executions [-h] {cancel,start,list,get} ...
- ssh
SSH to management server
usage: cfy ssh [-h] [-c COMMAND] [-p] [-v] [--debug]
- Options:
-c, --command Execute command over SSH -p=False, --plain=False Leave authentication to user -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- workflows
Manages Deployment Workflows
usage: cfy workflows [-h] {list,get} ...
- blueprints
Manages Cloudify’s Blueprints
usage: cfy blueprints [-h] {download,validate,list,upload,delete} ...
- teardown
Teardown Cloudify
usage: cfy teardown [-h] [-c CONFIG_FILE] [-f] [--ignore-validation] [--ignore-deployments] [-v] [--debug]
- Options:
-c, --config-file Path to a provider configuration file (DEPRECATED: provider api) -f=False, --force=False A flag indicating confirmation for the teardown request --ignore-validation=False A flag indicating confirmation for teardown even if there are validation conflicts --ignore-deployments=False A flag indicating confirmation for teardown even if there exist active deployments -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- bootstrap
Bootstrap Cloudify on the currently active provider
The command takes care of creating the topology and installing the Cloudify Manager to function.
Note
The command also allows you to run validations without actually bootstrapping to verify that the resources required are available for the bootstrap process.
usage: cfy bootstrap [-h] [-c CONFIG_FILE] [--task-thread-pool-size TASK_THREAD_POOL_SIZE] [--install-plugins] [--keep-up-on-failure] [--validate-only] [--skip-validations] [-p BLUEPRINT_PATH] [-i INPUTS] [--task-retries TASK_RETRIES] [--task-retry-interval TASK_RETRY_INTERVAL] [-v] [--debug]
- Options:
-c, --config-file Path to a provider configuration file (DEPRECATED: provider api) --task-thread-pool-size=1 The size of the thread pool size to execute tasks in --install-plugins=False Install necessary plugins of the given blueprint. --keep-up-on-failure=False A flag indicating that even if bootstrap fails, the instance will remain running --validate-only=False A flag indicating that validations will run without, actually performing the bootstrap process. --skip-validations=False A flag indicating that bootstrap will be run without, validating resources prior to bootstrapping the manager -p, --blueprint-path Path to a manager blueprint -i, --inputs Inputs file/string for a manager blueprint (in JSON format) --task-retries=5 How many times should a task be retried in case it fails --task-retry-interval=30 How many seconds to wait before each task is retried -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- dev
Executes fabric tasks on the management machine
Cloudify’s CLI provides an interface to running premade fabric tasks on the management server.
This supplies an easy way to run personalized, complex ssh scripts on the manager without having to manually connect to it.
Note
The tasks don’t have to be decorated with the @task decorator as they’re directly called from the cli’s code just like any other python function. Also, as fabric is one of the cli’s dependencies, you don’t have to install it separately unless you’re using the cli as a binary in which case you’ll have to install fabric yourself.
Example:
cfy dev --tasks-file my_tasks.py -v -t my_task -a --arg1=something --arg2=otherthing ... cfy dev -v -t my_task -a arg1_value arg2_value ...
--tasks-file my_tasks.py can be omitted if a tasks.py file exists in your current working directory.
So for instance, if you want to echo something in your currently running manager, all you have to do is supply a tasks.py file with the following:
from fabric.api import run def echo(text): run('echo {0}'.format(text))
and then run:
cfy dev -t echo -a something
Cloudify provides a tasks repo from which users can obtain tasks and to which developers should contribute for the benefit of all.
usage: cfy dev [-h] [-t TASK] [-p TASKS_FILE] [-a ...] [-v] [--debug]
- Options:
-t, --task name of fabric task to run -p, --tasks-file Path to a tasks file -a, --args arguments for the fabric task -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- deployments
Manages and Executes Cloudify’s Deployments
usage: cfy deployments [-h] {outputs,create,list,delete} ...
- init
Initialize configuration files for a specific cloud provider
Initializing a configuration for a specific provider is a deprecated feature and will be removed in a future version.
usage: cfy init [-h] [-p PROVIDER] [-r] [-v] [--debug]
- Options:
-p, --provider Command for initializing configuration files for a specific provider -r=False, --reset-config=False A flag indicating overwriting existing configuration is allowed -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- local
Execute workflows locally
usage: cfy local [-h] {execute,install-plugins,instances,init,create-requirements,outputs} ...
- events
Manages Cloudify’s events
usage: cfy events [-h] {list} ...
blueprints¶
usage: cfy blueprints [-h] {download,validate,list,upload,delete} ...
- Sub-commands:
- download
command for downloading a blueprint from the management server
usage: cfy blueprints download [-h] [-o OUTPUT] -b BLUEPRINT_ID [-v] [--debug]
- Options:
-o, --output The output file path of the blueprint to be downloaded -b, --blueprint-id The id of the blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- validate
command for validating a blueprint
usage: cfy blueprints validate [-h] -p BLUEPRINT_FILE [-v] [--debug]
- Options:
-p, --blueprint-path Path to the application’s blueprint file -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- list
command for listing all uploaded blueprints
usage: cfy blueprints list [-h] [-v] [--debug]
- Options:
-v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- upload
command for uploading a blueprint to the management server
usage: cfy blueprints upload [-h] -p BLUEPRINT_FILE -b BLUEPRINT_ID [-v] [--debug]
- Options:
-p, --blueprint-path Path to the application’s blueprint file -b, --blueprint-id The id of the blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- delete
command for deleting an uploaded blueprint
usage: cfy blueprints delete [-h] -b BLUEPRINT_ID [-v] [--debug]
- Options:
-b, --blueprint-id The id of the blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
deployments¶
usage: cfy deployments [-h] {outputs,create,list,delete} ...
- Sub-commands:
- outputs
command for getting a specific deployment outputs
usage: cfy deployments outputs [-h] -d DEPLOYMENT_ID [-v] [--debug]
- Options:
-d, --deployment-id The id of the deployment to get outputs for -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- create
command for creating a deployment of a blueprint
usage: cfy deployments create [-h] -d DEPLOYMENT_ID [-i INPUTS] -b BLUEPRINT_ID [-v] [--debug]
- Options:
-d, --deployment-id A unique id that will be assigned to the created deployment -i, --inputs Inputs file/string for the deployment creation (in JSON format) -b, --blueprint-id The id of the blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- list
command for listing all deployments or all deployments of a blueprint
usage: cfy deployments list [-h] [-b BLUEPRINT_ID] [-v] [--debug]
- Options:
-b, --blueprint-id The id of the blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- delete
command for deleting a deployment
usage: cfy deployments delete [-h] [-f] -d DEPLOYMENT_ID [-v] [--debug]
- Options:
-f=False, --ignore-live-nodes=False A flag indicating whether or not to delete the deployment even if there exist live nodes for it -d, --deployment-id the id of the deployment to delete -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
executions¶
usage: cfy executions [-h] {cancel,start,list,get} ...
- Sub-commands:
- cancel
Cancel an execution by its id
usage: cfy executions cancel [-h] -e EXECUTION_ID [-f] [-v] [--debug]
- Options:
-e, --execution-id The id of the execution to cancel -f=False, --force=False A flag indicating authorization to terminate the execution abruptly rather than request an orderly termination -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- start
Command for starting a workflow execution on a deployment
usage: cfy executions start [-h] [--allow-custom-parameters] -d DEPLOYMENT_ID [-p PARAMETERS] [-f] [--timeout TIMEOUT] -w WORKFLOW [-l] [-v] [--debug]
- Options:
--allow-custom-parameters=False A flag for allowing the passing of custom parameters (parameters which were not defined in the workflow’s schema in the blueprint) to the execution -d, --deployment-id The deployment id -p={}, --parameters={} Parameters for the workflow execution (in JSON format) -f=False, --force=False Whether the workflow should execute even if there is an ongoing execution for the provided deployment --timeout=900 Operation timeout in seconds (The execution itself will keep going, it is the CLI that will stop waiting for it to terminate) -w, --workflow The workflow to start -l=False, --include-logs=False A flag whether to include logs in returned events -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- list
command for listing all executions of a deployment
usage: cfy executions list [-h] -d DEPLOYMENT_ID [-v] [--debug]
- Options:
-d, --deployment-id filter executions for a given deployment by the deployment’s id -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- get
command for getting an execution by its id
usage: cfy executions get [-h] -e EXECUTION_ID [-v] [--debug]
- Options:
-e, --execution-id The id of the execution to get -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
local¶
usage: cfy local [-h] {execute,install-plugins,instances,init,create-requirements,outputs} ...
- Sub-commands:
- execute
Execute a workflow locally
usage: cfy local execute [-h] [--allow-custom-parameters] [-p PARAMETERS] [--task-retries TASK_RETRIES] -w WORKFLOW [--task-thread-pool-size TASK_THREAD_POOL_SIZE] [--task-retry-interval TASK_RETRY_INTERVAL] [-v] [--debug]
- Options:
--allow-custom-parameters=False A flag for allowing the passing of custom parameters (parameters which were not defined in the workflow’s schema in the blueprint) to the execution -p={}, --parameters={} Parameters for the workflow execution (in JSON format) --task-retries=0 How many times should a task be retried in case it fails -w, --workflow The workflow to execute locally --task-thread-pool-size=1 The size of the thread pool size to execute tasks in --task-retry-interval=1 How many seconds to wait before each task is retried -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- install-plugins
Installs the necessary plugins for a given blueprint
usage: cfy local install-plugins [-h] -p BLUEPRINT_PATH [-v] [--debug]
- Options:
-p, --blueprint-path Path to a blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- instances
Display node instances
usage: cfy local instances [-h] [--node-id NODE_ID] [-v] [--debug]
- Options:
--node-id Only display node instances of this node id -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- init
Init a local workflow execution environment in in the current working directory
usage: cfy local init [-h] [--install-plugins] -p BLUEPRINT_PATH [-i INPUTS] [-v] [--debug]
- Options:
--install-plugins=False Install necessary plugins of the given blueprint. -p, --blueprint-path Path to a blueprint -i, --inputs Inputs file/string for the local workflow creation (in JSON format) -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- create-requirements
Creates a PIP compliant requirements file for the given blueprint
usage: cfy local create-requirements [-h] [-o REQUIREMENTS_OUTPUT] -p BLUEPRINT_PATH [-v] [--debug]
- Options:
-o, --output Path to a file that will hold the requirements of the blueprint -p, --blueprint-path Path to a blueprint -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- outputs
Display outputs
usage: cfy local outputs [-h] [-v] [--debug]
- Options:
-v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
events¶
usage: cfy events [-h] {list} ...
- Sub-commands:
- list
Displays Events for different executions
usage: cfy events list [-h] -e EXECUTION_ID [-l] [-v] [--debug]
- Options:
-e, --execution-id The id of the execution to list events for -l=False, --include-logs=False A flag whether to include logs in returned events -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
workflows¶
usage: cfy workflows [-h] {list,get} ...
- Sub-commands:
- list
command for listing workflows for a deployment
usage: cfy workflows list [-h] -d DEPLOYMENT_ID [-v] [--debug]
- Options:
-d, --deployment-id The id of the deployment whose workflows to list -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output
- get
command for getting a workflow by its name and deployment
usage: cfy workflows get [-h] -d DEPLOYMENT_ID -w WORKFLOW [-v] [--debug]
- Options:
-d, --deployment-id The id of the deployment for which the workflow belongs -w, --workflow The id of the workflow to get -v=False, --verbose=False A flag for setting verbose output --debug=False A flag for setting debug output