huskar_api/api/infra_config.py
def delete(self, application_name, infra_type, infra_name):
        """Deletes the infrastructure configuration in specified application.

        :param application_name: The application which uses infrastructure.
        :param infra_type: ``database``, ``redis`` or ``amqp``.
        :param infra_name: The unique code-reference name of infrastructure.
        :query scope_type: ``idcs`` or ``clusters``.
        :query scope_name: The ezone id or clsuter name.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: The same as ``GET``.
        """
        check_application_auth(application_name, Authority.WRITE)
        check_infra_type(infra_type)

        scope_type = request.args['scope_type']
        scope_name = request.args['scope_name']
        check_scope(scope_type, scope_name)

        infra_info = InfraInfo(
            huskar_client.client, application_name, infra_type)
        infra_info.load()
        old_value = infra_info.get_by_name(infra_name, scope_type, scope_name)
        infra_info.delete_by_name(infra_name, scope_type, scope_name)
        with audit_log(
                audit_log.types.DELETE_INFRA_CONFIG,
                application_name=application_name,
                infra_type=infra_type, infra_name=infra_name,
                scope_type=scope_type, scope_name=scope_name,
                old_value=old_value, new_value=None):
            infra_info.save()

        with suppress_exceptions('infra config deletion'):
            old_urls = infra_info.extract_urls(old_value or {}, as_dict=True)
            for field_name in frozenset(extract_application_names(old_urls)):
                InfraDownstream.unbind(
                    application_name, infra_type, infra_name, scope_type,
                    scope_name, field_name)

        infra_config = infra_info.list_by_infra_name(infra_name)
        return api_response({'infra_config': dump_infra_config(infra_config)})
Deletes the infrastructure configuration in specified application.

        :param application_name: The application which uses infrastructure.
        :param infra_type: ``database``, ``redis`` or ``amqp``.
        :param infra_name: The unique code-reference name of infrastructure.
        :query scope_type: ``idcs`` or ``clusters``.
        :query scope_name: The ezone id or clsuter name.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: The same as ``GET``.
        
Deletes the infrastructure configuration in specified application.
Deletes the infrastructure configuration in specified application .
def delete(self, application_name, infra_type, infra_name):
        check_application_auth(application_name, Authority.WRITE)
        check_infra_type(infra_type)
        scope_type = request.args['scope_type']
        scope_name = request.args['scope_name']
        check_scope(scope_type, scope_name)
        infra_info = InfraInfo(
            huskar_client.client, application_name, infra_type)
        infra_info.load()
        old_value = infra_info.get_by_name(infra_name, scope_type, scope_name)
        infra_info.delete_by_name(infra_name, scope_type, scope_name)
        with audit_log(
                audit_log.types.DELETE_INFRA_CONFIG,
                application_name=application_name,
                infra_type=infra_type, infra_name=infra_name,
                scope_type=scope_type, scope_name=scope_name,
                old_value=old_value, new_value=None):
            infra_info.save()
        with suppress_exceptions('infra config deletion'):
            old_urls = infra_info.extract_urls(old_value or {}, as_dict=True)
            for field_name in frozenset(extract_application_names(old_urls)):
                InfraDownstream.unbind(
                    application_name, infra_type, infra_name, scope_type,
                    scope_name, field_name)
        infra_config = infra_info.list_by_infra_name(infra_name)
        return api_response({'infra_config': dump_infra_config(infra_config)})
def delete ( self , application_name , infra_type , infra_name ) : check_application_auth ( application_name , Authority . WRITE ) check_infra_type ( infra_type ) scope_type = request . args [ 'scope_type' ] scope_name = request . args [ 'scope_name' ] check_scope ( scope_type , scope_name ) infra_info = InfraInfo ( huskar_client . client , application_name , infra_type ) infra_info . load ( ) old_value = infra_info . get_by_name ( infra_name , scope_type , scope_name ) infra_info . delete_by_name ( infra_name , scope_type , scope_name ) with audit_log ( audit_log . types . DELETE_INFRA_CONFIG , application_name = application_name , infra_type = infra_type , infra_name = infra_name , scope_type = scope_type , scope_name = scope_name , old_value = old_value , new_value = None ) : infra_info . save ( ) with suppress_exceptions ( 'infra config deletion' ) : old_urls = infra_info . extract_urls ( old_value or { } , as_dict = True ) for field_name in frozenset ( extract_application_names ( old_urls ) ) : InfraDownstream . unbind ( application_name , infra_type , infra_name , scope_type , scope_name , field_name ) infra_config = infra_info . list_by_infra_name ( infra_name ) return api_response ( { 'infra_config' : dump_infra_config ( infra_config ) } )
Deletes the infrastructure configuration in specified application.
Deletes the infrastructure configuration in specified application .
"""Deletes the infrastructure configuration in specified application.

        :param application_name: The application which uses infrastructure.
        :param infra_type: ``database``, ``redis`` or ``amqp``.
        :param infra_name: The unique code-reference name of infrastructure.
        :query scope_type: ``idcs`` or ``clusters``.
        :query scope_name: The ezone id or clsuter name.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: The same as ``GET``.
        """
self
application_name
The application which uses infrastructure.
The application which uses infrastructure .
infra_type
None
infra_name
The unique code-reference name of infrastructure.
The unique code - reference name of infrastructure .
query
None
query
The ezone id or clsuter name.
The ezone id or clsuter name .
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
status
The same as ``GET``.
The same as ` ` GET ` ` .