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=False) 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=False) 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 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=False) 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=False) 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
-