theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 30 forks source link

Add Hybrid Cloud rake task #802

Closed chris1984 closed 1 year ago

chris1984 commented 1 year ago

@ShimShtein

Here is the rake task, I am waiting on getting a token to test with but did confirm with the Insights team that they are seeing the response correctly when I pass in a fake token(foo)

I added the suggestion you wanted with having the ability to override the URL.

Output showing it's connecting:

Paste your token, output will be hidden.
D, [2023-03-01T19:11:01.337382 #8667] DEBUG -- : Failed response with code 500 headers for request url https://ephem-tls.outsrights.cc/api/identity/certificate/registrations are: {:x_amzn_requestid=>"5d07f3bd-6705-4087-b8e3-80f9713ed861", :x_amzn_remapped_content_length=>"174", :set_cookie=>["d7bca3c18ed4c32d59cbf3a6abaf73d6=ad4a508fae5d7b11119e1ca8af7e53df; path=/; HttpOnly; Secure; SameSite=None"], :x_amz_apigw_id=>"BHZy3GGCoAMFTeA=", :x_amzn_remapped_server=>"openresty", :x_content_type_options=>"nosniff", :x_amzn_remapped_date=>"Wed, 01 Mar 2023 19:11:01 GMT", :content_type=>"text/html", :content_length=>"174", :date=>"Wed, 01 Mar 2023 19:11:01 GMT"} and body: <html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty</center>
</body>
</html>

rake aborted!
RestClient::InternalServerError: 500 Internal Server Error
chris1984 commented 1 year ago

@ShimShtein updated with your requested changes.

chris1984 commented 1 year ago

Finally working with the ephem api:

DEBUG -- : Response headers for request url https://ephem-tls.outsrights.cc/api/identity/certificate/registrations are: {:x_amzn_requestid=>"8fe61b81-c4f2-468b-b977-b3a0abb9e81a", :x_amzn_remapped_content_length=>"37", :set_cookie=>["d7bca3c18ed4c32d59cbf3a6abaf73d6=7bc9bdae17b2c1080c52a5bb024bfa88; path=/; HttpOnly; Secure; SameSite=None"], :x_amz_apigw_id=>"BeslRESHIAMFlbg=", :x_amzn_remapped_server=>"openresty", :x_content_type_options=>"nosniff", :x_amzn_remapped_date=>"Wed, 08 Mar 2023 20:48:08 GMT", :content_type=>"text/plain; charset=utf-8", :content_length=>"37", :date=>"Wed, 08 Mar 2023 20:48:07 GMT"}
chris1984 commented 1 year ago

Opening a new PR to clear the branch name as well.

chris1984 commented 1 year ago

New PR https://github.com/theforeman/foreman_rh_cloud/pull/803