The building official is authorized to serve a notice of violation or order on the person responsible for the erection, construction, alteration, extension, repair, moving, removal, demolition or occupancy of a building or structure in violation of the provisions of this code, or in violation of a permit or certificate issued under the provisions of this code. Such order shall direct the discontinuance of the illegal action or condition and the abatement of the violation.