Right but a bit too complicated:
1) Since $\rho g$ is a constant factor, you may ignore it.
2) You don't need to write down the second order equation but only
$H :=y' L_{y'}-L = \mathrm{const}$ with $L= (y-\lambda) \sqrt{1+y'^2}$ we have $H=(y-\lambda)/\sqrt{1+y'^2}$. So we have the 1st order equation from the very beginning:
\begin{equation}
\sqrt{1+y'^2}= A(y-\lambda)\implies \frac{dy}{A^2(y-\lambda)^2-1}=dx
\end{equation}
and integration gives the same answer
\begin{equation}
y= \frac{1}{A}\cosh (A(x-B)) +\lambda.
\end{equation}
We have three parameters and three equations
\begin{equation}
y(x_1)=y_1,\quad y(x_2)=y_2,\quad \int _{x_1}^{x_2} \sqrt{1+y'^2}\,dx = L.
\end{equation}
Since on Quiz if this problem is selected all these equations will be given (f.e. $y(0)=0$, $y(2)=3$ and $\int _0^3 \sqrt{1+y'^2}\,dx = 25$) one should calculate the integral in the third equation explicitly. And may be even calculate $\int _{x_1}^{x_2} y\sqrt{1+y'^2}\,dx= E$