Defines the contract for a cluster repository to store clusters in a persistent state.
Deletes the cluster from persistent state.
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster to delete from persistent state |
---|
Retrieves the cluster by the given name.
Parameters: | name (str) – name of the cluster (identifier) |
---|---|
Returns: | instance of elasticluster.cluster.Cluster that matches the given name |
Retrieves all stored clusters from the persistent state.
Returns: | list of elasticluster.cluster.Cluster |
---|
Save or update the cluster in a persistent state. Elasticluster will call this method multiple times, so the implementation should handle save and update seamlessly
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster object to store |
---|
This implementation of AbstractClusterRepository stores the cluster on the local disc using pickle. Therefore the cluster object and all its dependencies will be saved in a pickle (binary) file.
Parameters: | storage_path (str) – path to the folder to store the cluster information |
---|
Deletes the cluster from persistent state.
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster to delete from persistent state |
---|
Retrieves the cluster with the given name.
Parameters: | name (str) – name of the cluster (identifier) |
---|---|
Returns: | elasticluster.cluster.Cluster |
Retrieves all clusters from the persistent state.
Returns: | list of elasticluster.cluster.Cluster |
---|
Save or update the cluster to persistent state.
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster to save or update |
---|
This implementation of AbstractClusterRepository stores the clusters in memory, without actually saving the data on disk.
Deletes the cluster from memory.
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster to delete |
---|
Retrieves the cluster by the given name.
Parameters: | name (str) – name of the cluster (identifier) |
---|---|
Returns: | instance of elasticluster.cluster.Cluster that matches the given name |
Retrieves all stored clusters from the memory.
Returns: | list of elasticluster.cluster.Cluster |
---|
Save or update the cluster in a memory.
Parameters: | cluster (elasticluster.cluster.Cluster) – cluster object to store |
---|