It
could be called a solenoid, but that, IMHO would not be technically correct - a quote from wikipedia :-
https://en.wikipedia.org/wiki/Solenoid
explains this pretty well....
"In engineering, the term may also refer to a variety of transducer devices that convert energy into linear motion. The term is also often used to refer to a
solenoid valve, which is an integrated device containing an electromechanical solenoid which actuates either a
pneumatic or
hydraulic valve, or a solenoid switch, which is a specific type of
relay that internally uses an electromechanical solenoid to operate an electrical switch; for example, an
automobile starter solenoid, or a linear solenoid, which is an electromechanical solenoid.
Solenoid bolts, a type of electronic-mechanical locking mechanism, also exist."
I blinkin knew there was another name that is used, but could I remember it

. Thanks for reminding me