Are you using maya? All you need to do is set up a few controls, a global, one for the rotation, and one for the pivot of the bluish top piece. Self group the controls to ensure that the get the proper inputs and make sure the pivots are where you want them. Then parent constrain the controls to the needed geometry. Then…
Well then I can do nothing for you lol. Rigging hard surface stuff is really straight forward in Maya, so I am sure a intro rigging tutorial would teach you what you need.