vmware-archive / cfops

This is simply an automation that is based on the supported way to back up Pivotal Cloud Foundry
http://www.cfops.io
Apache License 2.0
35 stars 24 forks source link

cfops restore opsmanager should call /api/v0/setup to set up authentication #84

Open jghiloni opened 8 years ago

jghiloni commented 8 years ago

When calling cfops restore on a vanilla opsmanager you have to have authentication configured since it uses the bundled UAA now. There is a documented API endpoint, /api/v0/setup (that currently isn't working) that should allow you to configure it as part of the restore process -- if a user wants to use internal auth, you already all have the necessary info. All bets are off with SAML. Workaround is to manually set auth info first. Below is log from cfops restore:

2016/05/18 09:37:54 I0518 09:37:54.98794 25993 opsmanager.go:133] falling back to basic auth for legacy system <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
2016/05/18 09:37:54 D0518 09:37:54.99755 25993 opsmanager.go:160] called basic auth on legacy ops manager https://cfops-kcg.garmin.com/api/installation_settings <nil>
2016/05/18 09:37:54 E0518 09:37:54.997654 25993 opsmanager.go:147] error in save http request {"error":"The application has not yet been set up.  Please visit the UI or use the API setup endpoint to provide initial parameters."}