summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2015-11-23 13:02:22 -0600
committerPatrick Williams <patrick@stwcx.xyz>2015-11-23 13:02:22 -0600
commit2bcc285386f351fe584a5030705814eb771c6c25 (patch)
tree3c9a4e658bed4213f57e2ee50ea361fabcbfa503
parenta5e87fa837b1ae84bf926f29d8826ba31c5bc3fa (diff)
parenteaf659915cffba460354324834bba5495de82322 (diff)
downloadopenbmc-docs-2bcc285386f351fe584a5030705814eb771c6c25.tar.gz
openbmc-docs-2bcc285386f351fe584a5030705814eb771c6c25.zip
Merge pull request #7 from bradbishop/master
Rest API documentation fixes
-rw-r--r--rest-api.md19
1 files changed, 13 insertions, 6 deletions
diff --git a/rest-api.md b/rest-api.md
index 9b35f23..80e7fb3 100644
--- a/rest-api.md
+++ b/rest-api.md
@@ -73,26 +73,33 @@ A put operation on an object requires a complete object. For partial updates th
Make changes to the file and do a put (upload):
```
-curl -k -H "Content-Type: application/json" -X put -T bios.json https://bmc/org/openbmc/control/flash/bios
-curl -k -H "Content-Type: application/json" -X put -T flasher_path.json https://bmc/org/openbmc/control/flash/bios/attr/flasher_path
+curl -k -H "Content-Type: application/json" -X PUT -T bios.json https://bmc/org/openbmc/control/flash/bios
+curl -k -H "Content-Type: application/json" -X PUT -T flasher_path.json https://bmc/org/openbmc/control/flash/bios/attr/flasher_path
```
Alternatively specify the json inline with -d:
```
-curl -k -H "Content-Type: application/json" -X put -d "{\"data\": <value>}" flasher_path.json https://bmc/org/openbmc/control/flash/bios/attr/flasher_path
+curl -k -H "Content-Type: application/json" -X PUT -d "{\"data\": <value>}" flasher_path.json https://bmc/org/openbmc/control/flash/bios/attr/flasher_path
```
When using '-d' Just remember that json requires double quotes and any shell metacharacters need to be escaped.
## HTTP POST operations
-POST operations are for calling methods, but also for creating new resources when the client doesn't know where to put it.
+POST operations are for calling methods, but also for creating new resources when the client doesn't know where to put it. OpenBMC does not support creating new resources via REST so any attempt to create a new resource will result in a HTTP 403 ( Forbidden ).
These also require a json formatted payload.
To invoke a method with parameters:
```
-curl -k -H "Content-Type: application/json" -x post -d "{\"data\": [<positional-parameters>]}" -k https://bmc/org/openbmc/control/fan0/action/setspeed
+curl -k -H "Content-Type: application/json" -X POST -d "{\"data\": [<positional-parameters>]}" https://bmc/org/openbmc/control/fan0/action/setspeed
```
To invoke a method without parameters:
```
-curl -k -H "Content-Type: application/json" -x post -d "{\"data\": []}" -k https://bmc/org/openbmc/control/fan0/action/getspeed
+curl -k -H "Content-Type: application/json" -X POST -d "{\"data\": []}" https://bmc/org/openbmc/control/fan0/action/getspeed
+```
+
+## HTTP DELETE operations
+DELETE operations are for removing instances. Only DBUS objects (instances) can be removed. If the underlying DBUS object implements the org.openbmc.Object.Delete interface the REST server will call it. If org.openbmc.Object.Delete is not implemented, HTTP 403 will be returned.
+
+```
+curl -k -X DELETE https://bmc/org/openbmc/events/record/0
```
OpenPOWER on IntegriCloud