huskar_api/api/support.py
def delete(self, container_id):
        """Reregisters all instances bound to this container.

        The site admin authority is required. See :ref:`site_admin` also.

        :param container_id: The container id (a.k.a CID, Task ID).
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 409: The container is still using by another one, and who are
                     registering new service instance on it. It is recommended
                     to try again since the container is truly dead.
        :status 200: The request is successful.
        """
        g.auth.require_admin()

        cm = ContainerManagement(huskar_client, container_id)
        cm.set_barrier()

        for application_name, cluster_name in cm.lookup():
            # Deregister current instance
            old_data = service_facade.get_value(
                application_name, cluster_name, container_id)
            service_facade.delete(
                application_name, cluster_name, container_id, strict=False)
            audit_log.emit(
                audit_log.types.DELETE_SERVICE,
                application_name=application_name, cluster_name=cluster_name,
                key=container_id, old_data=old_data)
            # Release container record
            cm.deregister_from(application_name, cluster_name)

        try:
            cm.destroy()
        except NotEmptyError:
            message = 'Container {0} is still registering new instance'.format(
                container_id)
            abort(409, message)

        return api_response()
Reregisters all instances bound to this container.

        The site admin authority is required. See :ref:`site_admin` also.

        :param container_id: The container id (a.k.a CID, Task ID).
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 409: The container is still using by another one, and who are
                     registering new service instance on it. It is recommended
                     to try again since the container is truly dead.
        :status 200: The request is successful.
        
Reregisters all instances bound to this container.
The site admin authority is required.
Reregisters all instances bound to this container . The site admin authority is required .
def delete(self, container_id):
        g.auth.require_admin()
        cm = ContainerManagement(huskar_client, container_id)
        cm.set_barrier()
        for application_name, cluster_name in cm.lookup():
            old_data = service_facade.get_value(
                application_name, cluster_name, container_id)
            service_facade.delete(
                application_name, cluster_name, container_id, strict=False)
            audit_log.emit(
                audit_log.types.DELETE_SERVICE,
                application_name=application_name, cluster_name=cluster_name,
                key=container_id, old_data=old_data)
            cm.deregister_from(application_name, cluster_name)
        try:
            cm.destroy()
        except NotEmptyError:
            message = 'Container {0} is still registering new instance'.format(
                container_id)
            abort(409, message)
        return api_response()
def delete ( self , container_id ) : g . auth . require_admin ( ) cm = ContainerManagement ( huskar_client , container_id ) cm . set_barrier ( ) for application_name , cluster_name in cm . lookup ( ) : old_data = service_facade . get_value ( application_name , cluster_name , container_id ) service_facade . delete ( application_name , cluster_name , container_id , strict = False ) audit_log . emit ( audit_log . types . DELETE_SERVICE , application_name = application_name , cluster_name = cluster_name , key = container_id , old_data = old_data ) cm . deregister_from ( application_name , cluster_name ) try : cm . destroy ( ) except NotEmptyError : message = 'Container {0} is still registering new instance' . format ( container_id ) abort ( 409 , message ) return api_response ( )
Reregisters all instances bound to this container.
Reregisters all instances bound to this container .
"""Reregisters all instances bound to this container.

        The site admin authority is required. See :ref:`site_admin` also.

        :param container_id: The container id (a.k.a CID, Task ID).
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 409: The container is still using by another one, and who are
                     registering new service instance on it. It is recommended
                     to try again since the container is truly dead.
        :status 200: The request is successful.
        """ # Deregister current instance # Release container record
self
container_id
The container id (a.k.a CID, Task ID).
The container id ( a . k . a CID Task ID ) .
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
status
The container is still using by another one, and who are
registering new service instance on it. It is recommended
to try again since the container is truly dead.
The container is still using by another one and who are registering new service instance on it . It is recommended to try again since the container is truly dead .
status
The request is successful.
The request is successful .