NEW YORK — The Yankees made their first big moves to reshape for 2015, agreeing Friday to a $36 million, four-year contract with reliever Andrew Miller and obtaining shortstop Didi Gregorius from Arizona as part of a three-team trade that sent right-hander Shane Greene to Detroit.

Miller’s acquisition gives the Yankees a bit of insurance in case they don’t re-sign closer David Robertson, who is a free agent.

“I can’t predict yet as his free agency continues where he’s going to land,” Yankees General Manager Brian Cashman said. “I certainly would not allude to the level of our participation. We’ve been in touch with his agency, and I’ll just leave it at that.”

A 29-year-old left-hander, Miller held opponents to a .153 average this year while going 5-5 with a 2.02 ERA for Boston and Baltimore. He joins a bullpen that includes hard-throwing right-hander Dellin Betances, who finished third in AL Rookie of the Year voting.

Gregorius, a 24-year-old left-handed hitter, becomes the favorite to take over at shortstop following the retirement of Yankees captain Derek Jeter. Gregorious hit his first big league homer at Yankee Stadium in April 2013 but lost the starting shortstop job to Chris Owings during spring training this year and was sent to the minors.

He was recalled when Cliff Pennington tore a thumb ligament and became the regular shortstop when Owings injured a shoulder.

Gregorius batted .226 with six homers and 27 RBI in 80 games this year but hit .137 (7 for 51) against left-handers.

NATIONALS: Washington outfielder Jayson Werth was convicted Friday of reckless driving and sentenced to 10 days in jail for driving his Porsche over 100 mph on the Capital Beltway earlier this year.

RAYS: Kevin Cash is the new manager in Tampa Bay.

The Rays announced the former Cleveland Indians bullpen coach as Joe Maddon’s replacement, selecting him over ex-Seattle Mariners manager and current Kansas City Royals bench coach Don Wakamatsu.

Cash, 37, has no previous managerial experience. He’s a former big-league catcher who appeared in 13 games with Tampa Bay in 2005 and served as Cleveland’s bullpen coach for the past two seasons.

DODGERS: Los Angeles claimed catcher Ryan Lavarnway from Boston and designated catcher Drew Butera for assignment.

Lavarnway appeared in 97 games with the Red Sox from 2011-14, and he also played seven seasons in the team’s minor-league club. Last season, when he was limited by a strained left wrist he hit .285 with a .389 on-base percentage, four homers and 24 RBI in 67 combined minor league games while also appearing in nine games with Boston.