Blueprints API

class cloudify_rest_client.blueprints.Blueprint(blueprint)[source]

Bases: dict

id
Returns:The identifier of the blueprint.
created_at
Returns:Timestamp of blueprint creation.
main_file_name
Returns:Blueprint main file name.
plan

Gets the plan the blueprint represents: nodes, relationships etc...

Returns:The content of the blueprint.
description

Gets the description of the blueprint

Returns:The description of the blueprint.
class cloudify_rest_client.blueprints.BlueprintsClient(api)[source]

Bases: object

list(_include=None, **kwargs)[source]

Returns a list of currently stored blueprints.

Parameters:
  • _include – List of fields to include in response.
  • kwargs – Optional filter fields. For a list of available fields see the REST service’s models.BlueprintState.fields
Returns:

Blueprints list.

publish_archive(archive_location, blueprint_id, blueprint_filename=None)[source]

Publishes a blueprint archive to the Cloudify manager.

Parameters:
  • archive_location – Path or Url to the archive file.
  • blueprint_id – Id of the uploaded blueprint.
  • blueprint_filename – The archive’s main blueprint yaml filename.
Returns:

Created blueprint.

Archive file should contain a single directory in which there is a blueprint file named blueprint_filename (if blueprint_filename is None, this value will be passed to the REST service where a default value should be used). Blueprint ID parameter is available for specifying the blueprint’s unique Id.

upload(blueprint_path, blueprint_id)[source]

Uploads a blueprint to Cloudify’s manager.

Parameters:
  • blueprint_path – Main blueprint yaml file path.
  • blueprint_id – Id of the uploaded blueprint.
Returns:

Created blueprint.

Blueprint path should point to the main yaml file of the blueprint to be uploaded. Its containing folder will be packed to an archive and get uploaded to the manager. Blueprint ID parameter is available for specifying the blueprint’s unique Id.

get(blueprint_id, _include=None)[source]

Gets a blueprint by its id.

Parameters:
  • blueprint_id – Blueprint’s id to get.
  • _include – List of fields to include in response.
Returns:

The blueprint.

delete(blueprint_id)[source]

Deletes the blueprint whose id matches the provided blueprint id.

Parameters:blueprint_id – The id of the blueprint to be deleted.
Returns:Deleted blueprint.
download(blueprint_id, output_file=None)[source]

Downloads a previously uploaded blueprint from Cloudify’s manager.

Parameters:
  • blueprint_id – The Id of the blueprint to be downloaded.
  • output_file – The file path of the downloaded blueprint file (optional)
Returns:

The file path of the downloaded blueprint.