I had an asthma attack.

Literal

Asthma [possessive-の] attack [subject-が] happened.

A medical statement. 喘息 (ぜんそく) 'asthma'. 発作 (ほっさ) 'attack, seizure, sudden onset of medical symptoms' — used for asthma attacks, heart attacks, panic attacks, seizures. 起きる ('to arise, happen') is the standard verb for something occurring. The construction X が起きる is 'X happens, X occurs'.