<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Ambari REST API request not appearing in &amp;quot;Background Operations&amp;quot; in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102248#M14824</link>
    <description>&lt;P&gt;OK - I think I answered my own question: sorry for the confusion. Ambari 2.2.x appears to be smarter than its predecessors. The reason my initial REST request "failed" was because HDFS was already running, so Ambari simply ignored the request. &lt;/P&gt;&lt;P&gt;REST API requests used to always show up in the "Background Operations" window, but now they do not if the service doesn't need starting. That decision seems fine with me - just caught me off guard!&lt;/P&gt;&lt;P&gt;Thanks for providing feedback.&lt;/P&gt;&lt;P&gt;-Rich&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2016 06:07:48 GMT</pubDate>
    <dc:creator>rich1</dc:creator>
    <dc:date>2016-01-13T06:07:48Z</dc:date>
    <item>
      <title>Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102243#M14819</link>
      <description>&lt;P&gt;I am trying to startup services using the REST API on a newly-installed cluster named "horton" using Ambari 2.2.0.0. The following command used to work on prior versions of Ambari, but now it returns an error:&lt;/P&gt;&lt;PRE&gt;$ curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Start HDFS"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' &lt;A href="http://namenode:8080/api/v1/clusters/horton/services/HDFS" target="_blank"&gt;http://namenode:8080/api/v1/clusters/horton/services/HDFS&lt;/A&gt; &lt;/PRE&gt;&lt;P&gt;The response I get back is:&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 200 OK
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
User: admin
Set-Cookie: AMBARISESSIONID=zs3kuvep5dte6gie9q6lb5u5;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/plain
Content-Length: 0
Server: Jetty(8.1.17.v20150415)
&lt;/PRE&gt;&lt;P&gt;Any help would be greatly appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 05:43:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102243#M14819</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-01-13T05:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102244#M14820</link>
      <description>&lt;P&gt;This should be against the requests endpoint, e.g.,
&lt;A href="http://ambariserver:8080/api/v1/clusters/horton/requests" target="_blank"&gt;http://ambariserver:8080/api/v1/clusters/horton/requests&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 05:44:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102244#M14820</guid>
      <dc:creator>afernandez</dc:creator>
      <dc:date>2016-01-13T05:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102245#M14821</link>
      <description>&lt;P&gt;That response does not look like an error.  You are getting back a success code:&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 200 OK&lt;/PRE&gt;&lt;P&gt;The "deny" header value you see is for web clients to indicate that the response is not to be displayed in a browser frame.  In this context, the header does not apply.  Due to the way Ambari is structured, it does not particularly know what the expected destination of the response is, so the header is sent no matter what. This goes for the X-XSS-Protection header as well. &lt;/P&gt;&lt;PRE&gt;X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2016 05:50:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102245#M14821</guid>
      <dc:creator>rlevas</dc:creator>
      <dc:date>2016-01-13T05:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102246#M14822</link>
      <description>&lt;P&gt;Changing "services" to "requests" resulted in a bad request - maybe I need to change something else? I have never started a service using "requests" before:&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 400 Bad Request

{
  "status" : 400,
  "message" : "org.apache.ambari.server.controller.spi.UnsupportedPropertyException: The properties [ServiceInfo/state] specified in the request or predicate are not supported for the resource type Request."
}
&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2016 05:58:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102246#M14822</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-01-13T05:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102247#M14823</link>
      <description>&lt;P&gt;If the request is not being denied, then my question should be changed. The REST request above used to work - but now on Ambari 2.2 it does not have any affect. Here is something else that is interesting - when I try to start all services using the following request:&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Start all services"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' &lt;A href="http://namenode:8080/api/v1/clusters/horton/services?ServiceInfo" target="_blank" rel="nofollow noopener noreferrer"&gt;http://namenode:8080/api/v1/clusters/horton/services?ServiceInfo&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;this request gets accepted by Ambari, but here is what it does:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1302-screen-shot-2016-01-12-at-30054-pm.png" style="width: 1032px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/23722iA02E002B760BB427/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1302-screen-shot-2016-01-12-at-30054-pm.png" alt="1302-screen-shot-2016-01-12-at-30054-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That image is not cropped - all that happens is Pig, Slider, Sqoop and the Tez Client get installed. What I expected to see was all of my services starting. Again, this is based on the curl command above that I have used with Ambari 2.1 regularly. &lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:17:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102247#M14823</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2019-08-19T12:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102248#M14824</link>
      <description>&lt;P&gt;OK - I think I answered my own question: sorry for the confusion. Ambari 2.2.x appears to be smarter than its predecessors. The reason my initial REST request "failed" was because HDFS was already running, so Ambari simply ignored the request. &lt;/P&gt;&lt;P&gt;REST API requests used to always show up in the "Background Operations" window, but now they do not if the service doesn't need starting. That decision seems fine with me - just caught me off guard!&lt;/P&gt;&lt;P&gt;Thanks for providing feedback.&lt;/P&gt;&lt;P&gt;-Rich&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 06:07:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102248#M14824</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-01-13T06:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari REST API request not appearing in "Background Operations"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102249#M14825</link>
      <description>&lt;P&gt;Note that the requests don't work if the service is in maintenance mode. So to be safe, I usually disable it before interacting with the service via API. This worked for me. Change the exported variables accordingly for your setup&lt;/P&gt;&lt;PRE&gt;export SERVICE=HDFS
export PASSWORD=admin
export AMBARI_HOST=localhost
export CLUSTER=Sandbox

#get status
curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X GET &lt;A href="http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE" target="_blank"&gt;http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE&lt;/A&gt;

#disable maintenance mode
curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Remove HDFS from maintenance mode"}, "Body": {"ServiceInfo": {"maintenance_state": "OFF"}}}' &lt;A href="http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/HDFS" target="_blank"&gt;http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/HDFS&lt;/A&gt;

#stop service
curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' &lt;A href="http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE" target="_blank"&gt;http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE&lt;/A&gt;

#start service
curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Start $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' &lt;A href="http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE" target="_blank"&gt;http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE&lt;/A&gt;


&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2016 06:09:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-REST-API-request-not-appearing-in-quot-Background/m-p/102249#M14825</guid>
      <dc:creator>abajwa</dc:creator>
      <dc:date>2016-01-13T06:09:55Z</dc:date>
    </item>
  </channel>
</rss>

