Sorry for my english.
You can do that with the next steps:
1- Select your Animationplayer node.
1.5- (Create the animation if you don't have yet)
2- Select CollisionShape node.
3- In the inspector tab you can now see a little key next to all the propierties.
4- Select shape for see the collision dimension it self.
5- Now click in the key next to shape and the name of the propierty what show in the step 4.
6- Now in your animation in animationplayer node you can see a little diamond around the time line.
7- Move around the animation and change the propierties with the values that you want(don't forget click in the keys for save in the animation)
8- In your code only call the method play of animationplayer.
Something like this:
$AnimationPlayer.play("anim_name")