The word you mentioned, "anesthesia", can actually be used to describe the state. From wikipedia:
In the practice of medicine (especially surgery and dentistry), anesthesia or anaesthesia (from greek "without sensation") is a state of temporary induced loss of sensation or awareness.
You can also use the word "narcosis". From Collins:
unconsciousness induced by narcotics or general anaesthetics
Your example sentence could then be:
I was under anesthesia during the operation
or
I was in a state of narcosis during the operation