def register(self, id, name, address, port=None, tags=None, check=None):
        """Register a new service with the local consul agent"""
        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
Register a new service with the local consul agent