HPE OneView
1753607 Members
5945 Online
108797 Solutions
New Discussion

HPE OneView - Remove Server via API (with force)

 
SOLVED
Go to solution
ThomasSchwamm
Occasional Visitor

HPE OneView - Remove Server via API (with force)

Hello Guys,

I'm trying to remove servers from an HPE OneView Instance via rest API with a forced command.

Cannot find any documentation about it as the reference guide has still not been updated for the DELETE Command as already discussed here: https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/td-p/7044396#.X61AWpNKhTZ

Long story short: 

How can we delete servers from HPE OneView via Rest API with force: true?

curl --insecure \
--header "auth: TOKEN" \
--data '{"force":true}' \
--request DELETE https://INSTANCE/rest/server-hardware/ID

doesn't work.

 

Thanks for your help.

 

3 REPLIES 3
DaveArko
Occasional Advisor
Solution

Re: HPE OneView - Remove Server via API (with force)

The force option is a query parameter, so specify it via the URL (https://INSTANCE/rest/server-hardware/ID?force=true).

The DELETE server-hardware API for some reason wasn't documented until the 5.10 release of OneView.  And is only documented for the VM version of OneView (not Synergy where it is not allowed).

Hope that helps,
--Dave

ChrisLynch
HPE Pro

Re: HPE OneView - Remove Server via API (with force)

To add to @DaveArko , this API call is not supported with BladeSystem or Synergy.  To remove a BL or SY server/compute from the enclosure/frame, you need to physically remove it.

As for the API documentation, it was added to the 5.30 and newer API docs.  The same API call can be used for any OneView API version, as that API call has not changed since X-API-Version 1.

It is documented as DELETE /rest/server-hardware/{id}.

 


I am an HPE employee

Accept or Kudo

ThomasSchwamm
Occasional Visitor

Re: HPE OneView - Remove Server via API (with force)

Thank you Dave & Chris!

That has solved it.