You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Ajit Kumar (JIRA)" <ji...@apache.org> on 2016/02/01 19:11:40 UTC
[jira] [Created] (AMBARI-14869) Rename Admin Setting API
Ajit Kumar created AMBARI-14869:
-----------------------------------
Summary: Rename Admin Setting API
Key: AMBARI-14869
URL: https://issues.apache.org/jira/browse/AMBARI-14869
Project: Ambari
Issue Type: Task
Components: ambari-server
Affects Versions: 2.4.0
Reporter: Ajit Kumar
Assignee: Ajit Kumar
Fix For: 2.4.0
Currently API endpoint is /admin-settings. Change it to /settings and all modelling accordingly.
POST
{code}
curl -u admin:admin -H 'X-Requested-By: ambari' -X POST http://SERVER-NAME:8080/api/v1/settings -d '{"Settings" : {
"content" : "{test_content : test_value}",
"name" : "motd",
"setting_type" : "ambari-server"
}}'
Response:
{
"resources" : [
{
"href" : "http://SERVER-NAME:8080/api/v1/settings/motd",
"Settings" : {
"name" : "motd"
}
}
]
}
{code}
GET
{code}
curl -u admin:admin -H 'X-Requested-By: ambari' -X GET http://SERVER-NAME:8080/api/v1/settings/motd
Response:
{
"href" : "http://SERVER-NAME:8080/api/v1/settings/motd",
"Settings" : {
"content" : "{test_content : test_value}",
"name" : "motd",
"setting_type" : "ambari-server",
"update_timestamp" : 1454102699484,
"updated_by" : "admin"
}
}
{code}
PUT
{code}
curl -u admin:admin -H 'X-Requested-By: ambari' -X PUT http://SERVER-NAME:8080/api/v1/settings/motd -d '{"Settings" : {
"content" : "{test_content1 : test_value1}",
"setting_type" : "ambari-server"
}}'
{code}
LIST
{code}
curl -u admin:admin -H 'X-Requested-By: ambari' -X GET http://SERVER-NAME:8080/api/v1/settings
Response:
{
"href" : "http://SERVER-NAME:8080/api/v1/settings",
"items" : [
{
"href" : "http://SERVER-NAME:8080/api/v1/settings/motd",
"Settings" : {
"name" : "motd"
}
}
]
}
{code}
DELETE
{code}
curl -u admin:admin -H 'X-Requested-By: ambari' -X DELETE http://SERVER-NAME:8080/api/v1/settings/motd
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)