The city attorney shall be legal counsel to the city and perform any other duties as may be provided by ordinance.