Creating a new credential
You can use the representational state transfer (REST) application programming interface (API) to create a new credential.
| URI | /deployment/resources/credentials | |
|---|---|---|
| Method | POST | |
| Request body | JSON | |
| Returns | 201 | Success |
| 4xx | There were problems triggering the operation. The returned error message contains details about the cause of the failure. | |
| 500 | The system encountered an internal error while processing the request. | |
A successful get operation returns a 200 HTTP response code to the caller and the response body contain the JSON representation of the credential resource just created on the system.
A sample request representation is provided in the following example:
{
"name": "myUserCredentials",
"description": "Credential info for myUser",
"username": "myUser",
"password": "myPwd"
}
The most important attributes to consider (besides name and description) are the following:
- password
- The password associated to this credential. This is a required parameter.
- username
- The name of the user this credential refers to. This is a required parameter.
When credentials are queried, the password attribute is never returned in clear-text but it is hidden and its value is replaced with “********”.
A typical response from a GET on /deployment/resources/credentials is the following:
{
"updated_time": "Tue, 23 Aug 2011 07:42:35 GMT",
"state": "available",
"created_time": "Tue, 23 Aug 2011 07:42:35 GMT",
"username": "pippo",
"password": "********",
"name": "test",
"id": "/deployment/resources/credentials/e1381604-06e8-4ba9-a271-92b3adf7457e",
"description": "Credentail info for myUser"
}