

def ex_apply_tag_to_asset(self, asset, tag_key, value=None):
    '\n        Apply a tag to a Dimension Data Asset\n\n        :param asset: The asset to apply a tag to. (required)\n        :type  asset: :class:`Node` or :class:`NodeImage` or\n                      :class:`DimensionDataNewtorkDomain` or\n                      :class:`DimensionDataVlan` or\n                      :class:`DimensionDataPublicIpBlock`\n\n        :param tag_key: The tag_key to apply to the asset. (required)\n        :type  tag_key: :class:`DimensionDataTagKey` or ``str``\n\n        :param value: The value to be assigned to the tag key\n                      This is only required if the :class:`DimensionDataTagKey`\n                      requires it\n        :type  value: ``str``\n\n        :rtype: ``bool``\n        '
    asset_type = self._get_tagging_asset_type(asset)
    tag_key_name = self._tag_key_to_tag_key_name(tag_key)
    apply_tags = ET.Element('applyTags', {
        'xmlns': TYPES_URN,
    })
    ET.SubElement(apply_tags, 'assetType').text = asset_type
    ET.SubElement(apply_tags, 'assetId').text = asset.id
    tag_ele = ET.SubElement(apply_tags, 'tag')
    ET.SubElement(response, 'tagKeyName').text = tag_key_name
    if (value is not None):
        ET.SubElement(tag_ele, 'value').text = value
    response = self.connection.request_with_orgId_api_2('tag/applyTags', method='POST', data=ET.tostring(apply_tags)).object
    response_code = findtext(response, 'responseCode', TYPES_URN)
    return (response_code in ['IN_PROGRESS', 'OK'])

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/dimensiondata.py DimensionDataNodeDriver.ex_apply_tag_to_asset/VarMisuse@99/419 `tag_ele`->`response`