DWS API¶
The Data Warehouse Service Class¶
The dws high-level interface is available through the dws
member of a Connection
object. The
dws
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Cluster Operations¶
- class otcextensions.sdk.dws.v1._proxy.Proxy(session, *args, **kwargs)
- clusters(**query)
List all Clusters.
- Returns:
a generator of (
Cluster
) instances
- get_cluster(cluster)
Get the cluster by UUID
- find_cluster(name_or_id, ignore_missing=True)
Find a single cluster
- Parameters:
name_or_id – The name or ID of a DWS cluster
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised if the cluster does not exist. When set toTrue
, no exception will be set when attempting to find a nonexistent cluster.
- Returns:
One
Cluster
orNone
- create_cluster(**attrs)
Create a cluster from attributes
- restart_cluster(cluster)
Get the cluster by UUID
- scale_out_cluster(cluster, node_count)
Scaling Out a Cluster Nodes
- reset_password(cluster, new_password)
Reset the password of cluster administrator.
- delete_cluster(cluster, keep_last_manual_snapshot=0, ignore_missing=True)
Delete a DWS Cluster
- Parameters:
cluster – key id or an instance of
Cluster
keep_last_manual_snapshot (int) – The number of latest manual snapshots that need to be retained for a cluster.
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the cluster does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent cluster.
- Returns:
None
- cluster_tags(cluster)
List tags for a DWS cluster.
- Parameters:
cluster – Cluster ID or an instance of otcextensions.sdk.dws.v1.cluster.Cluster.
- Returns:
List of otcextensions.sdk.dws.v1.tag.Tag instances.
- create_cluster_tag(cluster, tag)
Create a new tag for a DWS cluster.
- Parameters:
cluster – Cluster ID or an instance of otcextensions.sdk.dws.v1.cluster.Cluster.
tag – Dictionary with ‘key’ and ‘value’ for the tag.
- Returns:
Created tag instance.
- delete_cluster_tag(cluster, tag_key, ignore_missing=True)
Delete a single tag from a DWS cluster.
- Parameters:
cluster – Cluster ID or an instance of otcextensions.sdk.dws.v1.cluster.Cluster.
tag_key – The key of the tag to be deleted.
ignore_missing – When False, openstack.exceptions.ResourceNotFound will be raised when the tag does not exist. When True, no exception will be set when attempting to delete a nonexistent tag.
- Returns:
None
- batch_create_cluster_tags(cluster, tags)
Batch addition of tags for a cluster.
- Parameters:
cluster – Cluster ID or an instance of otcextensions.sdk.dws.v1.cluster.Cluster.
tags – List of dictionaries of tags to add.
- Returns:
A list of created otcextensions.sdk.dws.v1.tag.Tag instances.
- batch_delete_cluster_tags(cluster, tags)
Batch deletion of tags from a cluster.
- Parameters:
cluster – Cluster ID or an instance of otcextensions.sdk.dws.v1.cluster.Cluster.
tags – List of dictionaries of tags to delete.
- Returns:
A list of deleted otcextensions.sdk.dws.v1.tag.Tag instances.
Cluster Snapshot Operations¶
- class otcextensions.sdk.dws.v1._proxy.Proxy(session, *args, **kwargs)
- snapshots()
List all Snapshots of a cluster.
- Returns:
a generator of (
Snapshot
) instances
- get_snapshot(snapshot)
Get a Snapshot details
- find_snapshot(name_or_id, ignore_missing=True)
Find a single snapshot
- Parameters:
name_or_id – The name or ID of a snapshot
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised if the snapshot does not exist. When set toTrue
, no exception will be set when attempting to find a nonexistent snapshot.
- Returns:
One
Snapshot
orNone
- create_snapshot(**attrs)
Create a cluster Snapshot from attributes
- create_snapshot(**attrs)
Create a cluster Snapshot from attributes
- delete_snapshot(snapshot, ignore_missing=True)
Delete a snapshot
- Parameters:
snapshot – key id or an instance of
Snapshot
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the snapshot does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent snapshot.
- Returns:
None
Cluster Flavor Operations¶
- class otcextensions.sdk.dws.v1._proxy.Proxy(session, *args, **kwargs)
- flavors()
List all Flavors.
- Returns:
a generator of (
Flavor
) instances