Create Resources Using POST Requests
Use a POST request to create an Oracle ILOM resource.
Note:
Resources supporting Post operations are listed in the Swagger model under the section post->parameters->name. Properties that can be specified for a resource during the creation operation are listed in the Swagger model under the section post->parameters->schema->properties. Required properties that must be specified for a resource during the creation operation are listed in Swagger model under the section post->parameters->schema->required. For more details about the Swagger model, see Discovering Management Resources.
Request Format
POST <Resource_Path> HTTP/1.1 <Header Name> : <Header Value> <Request Body>
-
Where:
-
Request Body – Each HTTP POST request must specify a <request body> that contains non-default name-value pairs for the resource properties to be created.
-
Request Header Fields Required
The required request header fields are as follows: Authorization
,
Content-Type
, and Host
.
For a description of these required header fields, see Common Request Header Fields.
Response Status Codes
-
Success: HTTP Status = 201 Created, JSON formatted response body
-
Failure: HTTP Status = 4xx, 5xx, JSON formatted error response body.
Example: HTTP Request
In the following HTTP example, a request is sent to the server SP to create a new user resource with the specified name and password.
POST /SP/users HTTP/1.1 Content-Type: application/json {"user_name":"jane", "password":"somepassword"}
Upon successful creation of the new resource, a JSON representation of the newly created user is returned in the response body.
{ "Target":"/rest/v1/SP/users/jane", "user_name":"jane", "role":"o", "password":"*****", "locked":"false", "password_expiration":"no expiry", "Targets":[{ "name":"ssh", "uri":"/rest/v1/SP/users/jane/ssh" }] }