<?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: Delete server hard via REST API? in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072392#M4780</link>
    <description>&lt;P&gt;HI Chris,&lt;/P&gt;&lt;P&gt;I just checked in the vs 1200 API reference and I still can't find this documented.&amp;nbsp; Also, the deletion command is working, but I'm not getting any return.&amp;nbsp; No deletion task uri or anything.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 10:16:26 GMT</pubDate>
    <dc:creator>BradV</dc:creator>
    <dc:date>2019-12-10T10:16:26Z</dc:date>
    <item>
      <title>Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044396#M4131</link>
      <description>&lt;P&gt;I'm trying to figure out how to remove a server from OpenView through the REST API.&amp;nbsp; I see POST https://{appl}/rest/server-hardware for adding a server, but don't see anything specific to deleting a server.&amp;nbsp; Does anyone know the correct call for that?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 13:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044396#M4131</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-04-30T13:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044438#M4134</link>
      <description>You would use DELETE /rest/server-hardware/{UUID}. This is documented in our REST API documentation. You could also use our language bindings or scripting SDK's like PowerShell or Python, which include options or examples to remove resources like server hardware.</description>
      <pubDate>Tue, 30 Apr 2019 21:22:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044438#M4134</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2019-04-30T21:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044506#M4136</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;I am logged into our OpenView and pulled up the REST API reference.&amp;nbsp; Looking at the Server Hardware page, I see GET, PUT, PATCH, and POST, but there is no DELETE documented.&amp;nbsp; My systems are all Linux.&amp;nbsp; So, using curl and the REST API, not powershell.&amp;nbsp; I'll do a GET /rest/server-hardware to get a current listing.&amp;nbsp; Then, I'll try the DELETE /rest/server-hardware/{UUID} and see how that works?&amp;nbsp; Might need an engineering change request to update the documentation.&amp;nbsp; :)&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 09:13:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044506#M4136</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-05-01T09:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044513#M4137</link>
      <description>&lt;P&gt;Can report that this worked:&lt;/P&gt;&lt;PRE&gt;UUID=3738638-3330-5536-4F38-323836433D33
DELURI=$(curl --insecure \
     --header "auth: ${sessionID}" \
     --header "X-API-Version: ${currentVersion}" \
     --request DELETE ${OneView}/rest/server-hardware/${UUID} | jq -r ".uri")
curl --insecure \
     --header "auth: ${sessionID}" \
     --header "X-API-Version: ${currentVersion}" \
     --request GET ${OneView}${DELURI} | jq -r '.'&lt;/PRE&gt;&lt;P&gt;Thanks Chris.&amp;nbsp; Please make sure they update the REST API reference!&amp;nbsp; :)&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brad V&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:09:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7044513#M4137</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-05-01T10:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072392#M4780</link>
      <description>&lt;P&gt;HI Chris,&lt;/P&gt;&lt;P&gt;I just checked in the vs 1200 API reference and I still can't find this documented.&amp;nbsp; Also, the deletion command is working, but I'm not getting any return.&amp;nbsp; No deletion task uri or anything.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 10:16:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072392#M4780</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-12-10T10:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072721#M4798</link>
      <description>&lt;P&gt;The task URI will be in the HTTP headers of the responce.&amp;nbsp; As I have stated in other threads, you need to look at the HTTP response code from the cURL call.&amp;nbsp; If it is HTTP 202, then you need to look for the Location HTTP header, which will contain the task URI.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 17:23:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072721#M4798</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2019-12-12T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072722#M4799</link>
      <description>&lt;P&gt;Also, as for the REST API reference documentation, I am looking into it.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 17:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7072722#M4799</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2019-12-12T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete server hard via REST API?</title>
      <link>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7073981#M4815</link>
      <description>&lt;P&gt;Sorry, was floating in the Caribbean.&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;I think I got it worked out.&amp;nbsp; To delete:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# To delete a server
UUID=3738638-3330-5536-4F38-323836433D33
declare -a RESPONS
RESPONS=($(curl --insecure \
     --header "auth: ${sessionID}" \
     --header "X-API-Version: ${currentVersion}" \
     --include \
     --request DELETE ${OneView}/rest/server-hardware/${UUID} | grep -E '^HTTP|^Location'))
if [[ ${RESPONS[1]} -eq 202 ]]; then
   # Accepted
   DELURI=${RESPONS[4]}
   # Check the deletion task status:
   curl --insecure \
        --header "auth: ${sessionID}" \
        --header "X-API-Version: ${currentVersion}" \
        --request GET ${OneView}${DELURI} | jq -r '.'
else
   echo rejected
fi
unset RESPONS&lt;/LI-CODE&gt;&lt;P&gt;To add:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# To add a server:
SERVER="my-hostname-ilo.my.org"
declare -a RESPONS
RESPONS=($(curl --insecure \
      --"content-type: application/json" \
      --header "auth: ${sessionID}" \
      --header "X-API-Version: ${currentVersion}" \
      --include \
      --data "{ \"hostname\": \"${SERVER}\", \"username\": \"Administrator\", \"password\": \"${PASSW}\", \"force\": false, \"licensingIntent\": \"OneView\", \"configurationState\": \"Managed\", \"initialScopeUris\": []}' \
      --request POST ${OneView}/rest/server-hardware | grep -E '^HTTP|^Location'))
if [[ ${RESPONS[1]} -eq 202 ]]; then
   # Accepted
   ADDURI=${RESPONS[4]}
   # Check the addition task status:
   curl --insecure \
        --header "auth: ${sessionID}" \
        --header "X-API-Version: ${currentVersion}" \
        --request GET ${OneView}${ADDURI} | jq -r '.'
else
   echo rejected
fi
unset RESPONS&lt;/LI-CODE&gt;&lt;P&gt;This seems to be working.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 15:46:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/m-p/7073981#M4815</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-12-24T15:46:13Z</dc:date>
    </item>
  </channel>
</rss>

