code: def register(self, id, name, address, port=None, tags=None, check=None):
          
          service = {}
          service['ID'] = id
          service['Name'] = name
          service['Address'] = address
          if port:
              service['Port'] = int(port)
          if tags:
              service['Tags'] = tags
          if check:
              service['Check'] = check
          r = requests.put(self.url_register, json=service)
          if r.status_code != 200:
              raise consulRegistrationError(
                  'PUT returned {}'.format(r.status_code))
          return r
docs: Register a new service with the local consul agent