def stage_tc_create_security_label(self, label, resource):
        """Add a security label to a resource.

        Args:
            label (str): The security label (must exit in ThreatConnect).
            resource (obj): An instance of tcex resource class.
        """
        sl_resource = resource.security_labels(label)
        sl_resource.http_method = 'POST'
        sl_response = sl_resource.request()
        if sl_response.get('status') != 'Success':
            self.log.warning(
                '[tcex] Failed adding security label "{}" ({}).'.format(
                    label, sl_response.get('response').text
                )
            )
def stage_tc_create_security_label ( self , label , resource ) : sl_resource = resource . security_labels ( label ) sl_resource . http_method = 'POST' sl_response = sl_resource . request ( ) if sl_response . get ( 'status' ) != 'Success' : self . log . warning ( '[tcex] Failed adding security label "{}" ({}).' . format ( label , sl_response . get ( 'response' ) . text ) )
Add a security label to a resource.

        Args:
            label (str): The security label (must exit in ThreatConnect).
            resource (obj): An instance of tcex resource class.