<?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>topic Re: getting error, but command works for changing server power state in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100914#M5575</link>
    <description>&lt;P&gt;This is an error within Bash, and your use of &lt;FONT face="courier new,courier"&gt;jq&lt;/FONT&gt;.&amp;nbsp; I found a &lt;A href="https://stackoverflow.com/questions/34794007/parse-error-invalid-numeric-literal-at-line-1-column-9" target="_blank" rel="noopener"&gt;thread&lt;/A&gt; on this over on Stackoverflow.&amp;nbsp; The HTTP response from this request will be either an HTTP Error (400-, 500- series code) or HTTP 202 for success.&amp;nbsp; There will be no JSON response until you get the &lt;FONT face="courier new,courier"&gt;Location&lt;/FONT&gt; HTTP header for the async task from the HTTP 202 response.&amp;nbsp; Otherwise, what are you trying to parse with &lt;FONT face="courier new,courier"&gt;jq&lt;/FONT&gt; in your pipeline?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 18:17:00 GMT</pubDate>
    <dc:creator>ChrisLynch</dc:creator>
    <dc:date>2020-09-10T18:17:00Z</dc:date>
    <item>
      <title>getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100872#M5573</link>
      <description>&lt;P&gt;The command is working, but I am getting a parse error: Invalid numeric literal at line 1, column 9&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATA='{"powerState":"Off","powerControl":"MomentaryPress"}'
curl --insecure \
       --header "content-type: application/json" \
       --header "X-API-Version: ${currentVersion}" \
       --header "auth: ${sessionID}" \
       --include \
       --data "${DATA}" \
       --request PUT ${OneView}/rest/server-hardware/{id}/powerState | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;The server is powering off, but I'm getting that error.&amp;nbsp; If I change the powerState to On and apply, that works also, but with the same parse error.&amp;nbsp; Anyone have a clue what could be wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 12:38:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100872#M5573</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2020-09-10T12:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100914#M5575</link>
      <description>&lt;P&gt;This is an error within Bash, and your use of &lt;FONT face="courier new,courier"&gt;jq&lt;/FONT&gt;.&amp;nbsp; I found a &lt;A href="https://stackoverflow.com/questions/34794007/parse-error-invalid-numeric-literal-at-line-1-column-9" target="_blank" rel="noopener"&gt;thread&lt;/A&gt; on this over on Stackoverflow.&amp;nbsp; The HTTP response from this request will be either an HTTP Error (400-, 500- series code) or HTTP 202 for success.&amp;nbsp; There will be no JSON response until you get the &lt;FONT face="courier new,courier"&gt;Location&lt;/FONT&gt; HTTP header for the async task from the HTTP 202 response.&amp;nbsp; Otherwise, what are you trying to parse with &lt;FONT face="courier new,courier"&gt;jq&lt;/FONT&gt; in your pipeline?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 18:17:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100914#M5575</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2020-09-10T18:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100921#M5576</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;I have no idea.&amp;nbsp; &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;It's my standard response when sending a command to the REST API.&amp;nbsp; I'll remove it and see what messages I'm receiving.&amp;nbsp; It is working.&amp;nbsp; So, that part is good.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 18:53:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100921#M5576</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2020-09-10T18:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100922#M5577</link>
      <description>I'm no Bash expert, but I can't see why one would use jq here when the reply doesn't include a JSON reply. If it did, and you wanted to parse the response, then it could be used.</description>
      <pubDate>Thu, 10 Sep 2020 18:56:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100922#M5577</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2020-09-10T18:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100925#M5578</link>
      <description>&lt;P&gt;No, totally my fault.&amp;nbsp; I did not look at the specs close enough to notice it was not a json output.&amp;nbsp; Sorry!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 19:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100925#M5578</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2020-09-10T19:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: getting error, but command works for changing server power state</title>
      <link>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100975#M5579</link>
      <description>&lt;P&gt;I fixed with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATA='{"powerState":"Off","powerControl":"MomentaryPress"}'
TASKURI=$(curl --insecure \
       --header "content-type: application/json" \
       --header "X-API-Version: ${currentVersion}" \
       --header "auth: ${sessionID}" \
       --include \
       --data "${DATA}" \
       --request PUT ${OneView}/rest/server-hardware/{id}/powerState |  grep '^Location:' | awk '{ print $2})&lt;/LI-CODE&gt;&lt;P&gt;Can then check the status of the task with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --insecure \
       --header "X-API-Version: ${currentVersion}" \
       --header "auth: ${sessionID}" \
       --request GET ${OneView}${TASKURI} | jq -r '.'&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Sep 2020 10:32:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/getting-error-but-command-works-for-changing-server-power-state/m-p/7100975#M5579</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2020-09-11T10:32:21Z</dc:date>
    </item>
  </channel>
</rss>

