CSS API¶
The Cloud Search Service Class¶
The css high-level interface is available through the css
member of a Connection
object. The
css
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Cluster Operations¶
- class otcextensions.sdk.css.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 CSS 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
- Parameters:
cluster – key id or an instance of
Cluster
- Returns:
None
- extend_cluster(cluster, add_nodes)
Scaling Out a Cluster with only Common Nodes
- Parameters:
cluster – key id or an instance of
Cluster
add_nodes – Number of common nodes to be scaled out.
- Returns:
None
- extend_cluster_nodes(cluster, **attrs)
Scaling Out a Cluster with Special Nodes
- Parameters:
cluster – key id or an instance of
Cluster
data – Cluster scale-out request data.
- Returns:
None
- delete_cluster(cluster, ignore_missing=True)
Delete a cluster
- Parameters:
cluster – The value can be the ID of a cluster or a
Cluster
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group 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.css.v1._proxy.Proxy(session, *args, **kwargs)
- snapshots(cluster)
List all Snapshots of a cluster.
- create_snapshot(cluster, **attrs)
Create a cluster Snapshot from attributes
- delete_snapshot(cluster, snapshot, ignore_missing=True)
Delete a snapshot
- Parameters:
- Returns:
None
- set_snapshot_configuration(cluster, auto_configure=False, **attrs)
Setting Basic Configurations of a Cluster Snapshot
- Parameters:
- Returns:
None
- disable_snapshot_function(cluster, ignore_missing=False)
Disable the snapshot function of a cluster.
- Parameters:
cluster – key id or an instance of
Cluster
- Returns:
None
- set_snapshot_policy(cluster, **attrs)
Set parameters related to automatic snapshot creation.
- get_snapshot_policy(cluster)
Query the automatic snapshot creation policy for a cluster.
- Parameters:
cluster – key id or an instance of
Cluster
- Returns:
instance of
SnapshotPolicy
- restore_snapshot(cluster, snapshot, **attrs)
Restore a snapshot.