code: def _create_element(name, element_type, data, server=None):
      '''
      Create a new element
      '''
      # Define property and id from name and properties + remove SaltStack parameters
      if 'properties' in data:
          data['property'] = ''
          for key, value in data['properties'].items():
              if not data['property']:
                  data['property'] += '{0}={1}'.format(key, value.replace(':', '\\:'))
              else:
                  data['property'] += ':{0}={1}'.format(key, value.replace(':', '\\:'))
          del data['properties']
  
      # Send request
      _api_post(element_type, _clean_data(data), server)
      return unquote(namef _create_element(name, element_type, data, server=None):
      '''
      Create a new element
      '''
      # Define property and id from name and properties + remove SaltStack parameters
      if 'properties' in data:
          data['property'] = ''
          for key, value in data['properties'].items():
              if not data['property']:
                  data['property'] += '{0}={1}'.format(key, value.replace(':', '\\:'))
              else:
                  data['property'] += ':{0}={1}'.format(key, value.replace(':', '\\:'))
          del data['properties']
  
      # Send request
      _api_post(element_type, _clean_data(data), server)
      return unquote(name)
docs: Create a new element