huskar_api/models/instance/management.py
def delete_cluster(self, cluster_name):
        """Deletes the cluster by its name.

        A cluster which could be deleted shall not include any instance or any
        using cluster info.

        :prama cluster_name: The name of cluster which will be deleted.
        :raises MalformedDataError: The data source is malformed.
        :raises NotEmptyError: if the cluster is not empty.
        :raises OutOfSyncError: if the operation need to be retried.
        :returns: ``None`` if the cluster does not exist, an instance of
                  :class:`ClusterInfo` if the cluster has been deleted.
        """
        service_info = self._make_service_info()
        service_info.load()

        cluster_info = self._make_cluster_info(cluster_name)
        cluster_info.load()

        if service_info.stat is None or cluster_info.stat is None:
            return

        outgoing_cluster_names = frozenset(
            itertools.chain.from_iterable(
                service_info.get_dependency().itervalues()
            )
        )

        if cluster_name in outgoing_cluster_names:
            raise NotEmptyError('There are outgoing routes in this cluster')
        if cluster_info.get_route() or cluster_info.get_link():
            raise NotEmptyError('There are routes or links in this cluster')
        if cluster_info.get_info():
            raise NotEmptyError('There are lb info in this cluster')
        if cluster_info.stat.children_count != 0:
            raise NotEmptyError('There are instances in this cluster')

        cluster_info.delete()
        return cluster_info
Deletes the cluster by its name.

        A cluster which could be deleted shall not include any instance or any
        using cluster info.

        :prama cluster_name: The name of cluster which will be deleted.
        :raises MalformedDataError: The data source is malformed.
        :raises NotEmptyError: if the cluster is not empty.
        :raises OutOfSyncError: if the operation need to be retried.
        :returns: ``None`` if the cluster does not exist, an instance of
                  :class:`ClusterInfo` if the cluster has been deleted.
        
Deletes the cluster by its name.
A cluster which could be deleted shall not include any instance or any
using cluster info.
Deletes the cluster by its name . A cluster which could be deleted shall not include any instance or any using cluster info .
def delete_cluster(self, cluster_name):
        service_info = self._make_service_info()
        service_info.load()
        cluster_info = self._make_cluster_info(cluster_name)
        cluster_info.load()
        if service_info.stat is None or cluster_info.stat is None:
            return
        outgoing_cluster_names = frozenset(
            itertools.chain.from_iterable(
                service_info.get_dependency().itervalues()
            )
        )
        if cluster_name in outgoing_cluster_names:
            raise NotEmptyError('There are outgoing routes in this cluster')
        if cluster_info.get_route() or cluster_info.get_link():
            raise NotEmptyError('There are routes or links in this cluster')
        if cluster_info.get_info():
            raise NotEmptyError('There are lb info in this cluster')
        if cluster_info.stat.children_count != 0:
            raise NotEmptyError('There are instances in this cluster')
        cluster_info.delete()
        return cluster_info
def delete_cluster ( self , cluster_name ) : service_info = self . _make_service_info ( ) service_info . load ( ) cluster_info = self . _make_cluster_info ( cluster_name ) cluster_info . load ( ) if service_info . stat is None or cluster_info . stat is None : return outgoing_cluster_names = frozenset ( itertools . chain . from_iterable ( service_info . get_dependency ( ) . itervalues ( ) ) ) if cluster_name in outgoing_cluster_names : raise NotEmptyError ( 'There are outgoing routes in this cluster' ) if cluster_info . get_route ( ) or cluster_info . get_link ( ) : raise NotEmptyError ( 'There are routes or links in this cluster' ) if cluster_info . get_info ( ) : raise NotEmptyError ( 'There are lb info in this cluster' ) if cluster_info . stat . children_count != 0 : raise NotEmptyError ( 'There are instances in this cluster' ) cluster_info . delete ( ) return cluster_info
Deletes the cluster by its name.
Deletes the cluster by its name .
"""Deletes the cluster by its name.

        A cluster which could be deleted shall not include any instance or any
        using cluster info.

        :prama cluster_name: The name of cluster which will be deleted.
        :raises MalformedDataError: The data source is malformed.
        :raises NotEmptyError: if the cluster is not empty.
        :raises OutOfSyncError: if the operation need to be retried.
        :returns: ``None`` if the cluster does not exist, an instance of
                  :class:`ClusterInfo` if the cluster has been deleted.
        """
``None`` if the cluster does not exist, an instance of
:class:`ClusterInfo` if the cluster has been deleted.
` ` None ` ` if the cluster does not exist an instance of : class : ` ClusterInfo ` if the cluster has been deleted .
The data source is malformed.
The data source is malformed .
MalformedDataError
if the cluster is not empty.
if the cluster is not empty .
NotEmptyError
if the operation need to be retried.
if the operation need to be retried .
OutOfSyncError
self
cluster_name
prama
The name of cluster which will be deleted.
The name of cluster which will be deleted .