Python Sahara client for APIv2


There is also support for Sahara’s experimental APIv2.

Supported operations

Plugin ops

class saharaclient.api.plugins.PluginManagerV2(api)[source]

Get information about a Plugin.

get_version_details(plugin_name, plugin_version)[source]

Get version details

Get the list of Services and Service Parameters for a specified Plugin and Plugin Version.


Get a list of Plugins.

update(plugin_name, values)

Update plugin and then return updated result to user

Image Registry ops

class saharaclient.api.images.ImageManagerV2(api)[source]

Get information about an image


Get a list of registered images.


Remove an Image from Sahara Image Registry.

update_image(image_id, user_name, desc=None)

Create or update an Image in Image Registry.

Node Group Template ops

class saharaclient.api.node_group_templates.NodeGroupTemplateManagerV2(api)[source]
create(name, plugin_name, plugin_version, flavor_id, description=None, volumes_per_node=None, volumes_size=None, node_processes=None, node_configs=None, floating_ip_pool=None, security_groups=None, auto_security_group=None, availability_zone=None, volumes_availability_zone=None, volume_type=None, image_id=None, is_proxy_gateway=None, volume_local_to_instance=None, use_autoconfig=None, shares=None, is_public=None, is_protected=None, volume_mount_prefix=None, boot_from_volume=None, boot_volume_type=None, boot_volume_availability_zone=None, boot_volume_local_to_instance=None)[source]

Create a Node Group Template.


Delete a Node Group Template.


Export a Node Group Template.


Get information about a Node Group Template.

list(search_opts=None, marker=None, limit=None, sort_by=None, reverse=None)

Get a list of Node Group Templates.

update(ng_template_id, name=NotUpdated, plugin_name=NotUpdated, plugin_version=NotUpdated, flavor_id=NotUpdated, description=NotUpdated, volumes_per_node=NotUpdated, volumes_size=NotUpdated, node_processes=NotUpdated, node_configs=NotUpdated, floating_ip_pool=NotUpdated, security_groups=NotUpdated, auto_security_group=NotUpdated, availability_zone=NotUpdated, volumes_availability_zone=NotUpdated, volume_type=NotUpdated, image_id=NotUpdated, is_proxy_gateway=NotUpdated, volume_local_to_instance=NotUpdated, use_autoconfig=NotUpdated, shares=NotUpdated, is_public=NotUpdated, is_protected=NotUpdated, volume_mount_prefix=NotUpdated, boot_from_volume=NotUpdated, boot_volume_type=NotUpdated, boot_volume_availability_zone=NotUpdated, boot_volume_local_to_instance=NotUpdated)[source]

Update a Node Group Template.

Cluster Template ops

class saharaclient.api.cluster_templates.ClusterTemplateManagerV2(api)[source]
create(name, plugin_name, plugin_version, description=None, cluster_configs=None, node_groups=None, anti_affinity=None, net_id=None, default_image_id=None, use_autoconfig=None, shares=None, is_public=None, is_protected=None, domain_name=None)[source]

Create a Cluster Template.


Delete a Cluster Template.


Export a Cluster Template.


Get information about a Cluster Template.

list(search_opts=None, marker=None, limit=None, sort_by=None, reverse=None)

Get list of Cluster Templates.

update(cluster_template_id, name=NotUpdated, plugin_name=NotUpdated, plugin_version=NotUpdated, description=NotUpdated, cluster_configs=NotUpdated, node_groups=NotUpdated, anti_affinity=NotUpdated, net_id=NotUpdated, default_image_id=NotUpdated, use_autoconfig=NotUpdated, shares=NotUpdated, is_public=NotUpdated, is_protected=NotUpdated, domain_name=NotUpdated)[source]

Update a Cluster Template.

Cluster ops

class saharaclient.api.clusters.ClusterManagerV2(api)[source]
create(name, plugin_name, plugin_version, cluster_template_id=None, default_image_id=None, is_transient=None, description=None, cluster_configs=None, node_groups=None, user_keypair_id=None, anti_affinity=None, net_id=None, count=None, use_autoconfig=None, shares=None, is_public=None, is_protected=None)[source]

Launch a Cluster.


Delete a Cluster.


Force Delete a Cluster.

get(cluster_id, show_progress=False)

Get information about a Cluster.

list(search_opts=None, limit=None, marker=None, sort_by=None, reverse=None)

Get a list of Clusters.

scale(cluster_id, scale_object)[source]

Scale an existing Cluster.


scale_object – dict that describes scaling operation


The following scale_object can be used to change the number of instances in the node group (optionally specifiying which instances to delete) or add instances of a new node group to an existing cluster:

    "add_node_groups": [
            "count": 3,
            "name": "new_ng",
            "node_group_template_id": "ngt_id"
    "resize_node_groups": [
            "count": 2,
            "name": "old_ng",
            "instances": ["instance_id1", "instance_id2"]
update(cluster_id, name=NotUpdated, description=NotUpdated, is_public=NotUpdated, is_protected=NotUpdated, shares=NotUpdated)

Update a Cluster.


Reflect an updated keypair on the cluster.

verification_update(cluster_id, status)

Start a verification for a Cluster.

Data Source ops

class saharaclient.api.data_sources.DataSourceManagerV2(api)[source]
create(name, description, data_source_type, url, credential_user=None, credential_pass=None, is_public=None, is_protected=None, s3_credentials=None)

Create a Data Source.


Delete a Data Source.


Get information about a Data Source.

list(search_opts=None, limit=None, marker=None, sort_by=None, reverse=None)

Get a list of Data Sources.

update(data_source_id, update_data)

Update a Data Source.


update_data (dict) – dict that contains fields that should be updated with new values.

Fields that can be updated:

  • name

  • description

  • type

  • url

  • is_public

  • is_protected

  • credentials - dict with the keys user and password for data source in Swift, or with the keys accesskey, secretkey, endpoint, ssl, and bucket_in_path for data source in S3

Job Binary ops

class saharaclient.api.job_binaries.JobBinariesManagerV2(api)[source]
create(name, url, description=None, extra=None, is_public=None, is_protected=None)

Create a Job Binary.


extra (dict) – authentication info needed for some job binaries, containing the keys user and password for job binary in Swift or the keys accesskey, secretkey, and endpoint for job binary in S3


Delete a Job Binary.


Get information about a Job Binary.


Download a Job Binary.

list(search_opts=None, limit=None, marker=None, sort_by=None, reverse=None)

Get a list of Job Binaries.

update(job_binary_id, data)

Update Job Binary.


data (dict) – dict that contains fields that should be updated with new values.

Fields that can be updated:

  • name

  • description

  • url

  • is_public

  • is_protected

  • extra - dict with the keys user and password for job binary in Swift, or with the keys accesskey, secretkey, and endpoint for job binary in S3

Job Template ops

class saharaclient.api.v2.job_templates.JobTemplatesManagerV2(api)[source]
create(name, type, mains=None, libs=None, description=None, interface=None, is_public=None, is_protected=None)[source]

Create a Job Template.


Delete a Job Template.


Get information about a Job Template.


Get config hints for a specified Job Template type.

list(search_opts=None, limit=None, marker=None, sort_by=None, reverse=None)[source]

Get a list of Job Templates.

update(job_id, name=NotUpdated, description=NotUpdated, is_public=NotUpdated, is_protected=NotUpdated)[source]

Update a Job Template.

Job ops

create(job_template_id, cluster_id, input_id=None, output_id=None, configs=None, interface=None, is_public=None, is_protected=None)[source]

Launch a Job.


Delete a Job.


Get information about a Job.

list(search_opts=None, marker=None, limit=None, sort_by=None, reverse=None)[source]

Get a list of Jobs.


Refresh Job Status.

update(obj_id, is_public=NotUpdated, is_protected=NotUpdated)[source]

Update a Job.

Job Types ops

class saharaclient.api.job_types.JobTypesManager(api)[source]

Get a list of job types supported by plugins.