Manager API

class cloudify_rest_client.manager.ConfigItem(config)[source]

Bases: dict

A configuration entry

property name

Name of the configuration entry

property value

The setting value

property schema

JSON schema of the configuration value, if any.

When changing the setting, the new value must conform to this schema.

property scope

Components affected by this configuration entry.

Eg. mgmtworker, rest, or agents

property updater_name

Name of the user who last changed this value

property updated_at

Time this value was last changed at

property is_editable

Whether or not it is possible to change this setting.

Settings that are not marked editable can still be changed by setting force=True, however that might lead to unexpected results. Use with caution.

property admin_only

This setting’s value is only viewable (and changeable) by admins

class cloudify_rest_client.manager.ManagerItem(manager)[source]

Bases: dict

A manager entry

property id

Manager’s ID in the DB (unique, incremental) type: int

property hostname

Manager’s hostname (unique) type: string

property private_ip

Manager’s private IP type: string

property public_ip

Manager’s public IP type: string

property version

Manager’s version type: string

property edition

Manager’s edition type: string

property distribution

Manager’s distribution type: string

property distro_release

Manager’s distribution release type: string

property fs_sync_node_id

Manager’s FS sync node id - used by Syncthing replication type: string

property networks

Networks and IPs declared for this manager

Return type:

dict

property ca_cert_content

Content of the CA cert to use for connecting to this manager

class cloudify_rest_client.manager.DBNodeItem(db_node)[source]

Bases: dict

property name

Name of this DB node

property host

IP address of this DB node

property is_external

Is the DB external

class cloudify_rest_client.manager.RabbitMQBrokerItem(broker)[source]

Bases: dict

property name

Name of this broker

property host

IP address of this broker

property username

Admin username for this broker.

Only set if the calling user has the broker_credentials permission.

property password

Admin password for this broker.

Only set if the calling user has the broker_credentials permission.

property management_host

IP address of this broker

property port

The TCP port this broker is listening on

property params

Additional params to use when creating a connection

property ca_cert_content

Content of the CA cert to use for connecting to this broker

property networks

Networks and IPs declared for this broker

Return type:

dict

property is_external

Is the broker external

class cloudify_rest_client.manager.ManagerClient(api)[source]

Bases: object

get_status()[source]
Returns:

Cloudify’s management machine status.

get_config(name=None, scope=None)[source]

Get configuration of the manager.

If name is provided, only return that single value. If scope is provided, return all values for that scope.

put_config(name, value, force=False)[source]

Update a given setting.

Note that the new value must conform to the schema, if any.

Parameters:

force – Force changing non-editable settings

add_manager(hostname, private_ip, public_ip, version, edition, distribution, distro_release, ca_cert_content=None, fs_sync_node_id='', networks=None)[source]

Add a new manager to the managers table

remove_manager(hostname)[source]

Remove a manager from the managers table

Will be used for clustering when a manager needs to be removed from the cluster, not necessarily for uninstalling the manager :param hostname: The manager’s hostname

update_manager(hostname, fs_sync_node_id, bootstrap_cluster)[source]

Updating a manager’s FS sync node id used by Syncthing replication

Parameters:
  • hostname – hostname of the manager to update

  • fs_sync_node_id – Syncthing node ID

  • bootstrap_cluster – Whether it is the 1st manager in the cluster or not

get_managers(hostname=None, _include=None)[source]

Get all the managers in the managers table or Get a specific manager based on ‘hostname’ :param hostname: hostname of manager to return :param _include: list of columns to include in the returned list

add_broker(name, address, port=None, networks=None)[source]

Add a broker to the brokers table.

This will allow cloudify components to use this broker. It will not actually create the broker- the creation should be done beforehand using cfy_manager.

Parameters:
  • name – The broker’s name.

  • address – The broker’s address.

  • port – The broker’s port, if not default (5671).

  • networks – The broker’s networks. This will default to having a default network with the address parameter. If this is supplied, the address in the address parameter must belong to one of the networks.

Returns:

The broker that was created.

remove_broker(name)[source]

Remove a broker from the brokers table.

This will stop cloudify components from talking directly to the specified broker. It will not take any action against the broker itself, which should be removed using cfy_manager.

Parameters:

name – The broker’s name.

Returns:

The broker that was deleted.

update_broker(name, networks)[source]

Update a broker.

Update a broker, adding or changing networks for that broker. Networks cannot be deleted from a broker without deleting that broker.

Parameters:
  • name – The broker’s name.

  • networks – The networks to add or change.

Returns:

The updated broker.

get_brokers()[source]
update_db_nodes()[source]

Force updating DB information on all manager nodes.

Returns:

A list of DB nodes in the cluster.

get_db_nodes()[source]
get_version()[source]
Returns:

Cloudify’s management machine version information.

get_context(_include=None)[source]

Gets the context which was stored on management machine bootstrap. The context contains Cloudify specific information and Cloud provider specific information.

Parameters:

_include – List of fields to include in response.

Returns:

Context stored in manager.

create_context(name, context)[source]

Creates context in Cloudify’s management machine. This method is usually invoked right after management machine bootstrap with relevant Cloudify and cloud provider context information.

Parameters:
  • name – Cloud provider name.

  • context – Context as dict.

Returns:

Create context result.

update_context(name, context)[source]

Updates context in Cloudify’s management machine. The context is imperative for the manager to function properly, only use this method if you know exactly what you are doing. Note that if the provider context does not exist, this call will result with an error.

Parameters:
  • name – Cloud provider name.

  • context – Context as dict.