ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajit Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-14750) Provide CRUD API support for settings
Date Wed, 20 Jan 2016 23:08:39 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-14750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ajit Kumar updated AMBARI-14750:
--------------------------------
    Description: 
Introduce a new API for *admin-settings*
{code}
api/v1/admin-settings
{code}

There can be several class of system wide admin settings - motd  etc. These are like configurations
- basically named property bags. It doesn't need version support.

*CRUD*
* create a new entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X POST  http://localhost:8080/api/v1/admin-settings
-d 
'{
   "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "name" : "motd1",
    "setting_type" : "ambari-server",
    "updated_by" : "admin"
  }
}' 
{code}
* read any entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X GET  http://localhost:8080/api/v1/admin-settings/motd1
Response:
{
  "href" : "http://localhost:8080/api/v1/admin-settings/motd1",
  "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "name" : "motd1",
    "setting_type" : "ambari-server",
    "update_timestamp" : 1453315409437,
    "updated_by" : "admin"
  }
}
{code}
* update - update an entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT  http://localhost:8080/api/v1/admin-settings/motd
-d
 '{
   "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "setting_type" : "ambari-server",
    "updated_by" : "admin"
  }
}' 
{code}
* delete an entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://localhost:8080/api/v1/admin-settings/motd
{code}

  was:
Introduce a new API for *admin-settings*
{code}
api/v1/admin-settings
{code}

There can be several class of system wide admin settings - motd  etc. These are like configurations
- basically named property bags. It doesn't need version support.

*CRUD*
* create a new entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X POST  http://localhost:8080/api/v1/admin-settings
-d 
'{   "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "name" : "motd1",
    "setting_type" : "ambari-server",
    "updated_by" : "admin"
  }
}' 
{code}
* read any entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X GET  http://localhost:8080/api/v1/admin-settings/motd1
Response:
{
  "href" : "http://localhost:8080/api/v1/admin-settings/motd1",
  "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "name" : "motd1",
    "setting_type" : "ambari-server",
    "update_timestamp" : 1453315409437,
    "updated_by" : "admin"
  }
}
{code}
* update - update an entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT  http://localhost:8080/api/v1/admin-settings/motd
-d '{   "AdminSettings" : {
    "content" : "{test_content1 : test_value1}",
    "setting_type" : "ambari-server",
    "updated_by" : "admin"
  }
}' 
{code}
* delete an entry
{code}
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://localhost:8080/api/v1/admin-settings/motd
{code}


> Provide CRUD API support for settings
> -------------------------------------
>
>                 Key: AMBARI-14750
>                 URL: https://issues.apache.org/jira/browse/AMBARI-14750
>             Project: Ambari
>          Issue Type: Task
>            Reporter: Ajit Kumar
>            Assignee: Ajit Kumar
>
> Introduce a new API for *admin-settings*
> {code}
> api/v1/admin-settings
> {code}
> There can be several class of system wide admin settings - motd  etc. These are like
configurations - basically named property bags. It doesn't need version support.
> *CRUD*
> * create a new entry
> {code}
> curl -u admin:admin -H "X-Requested-By: ambari" -X POST  http://localhost:8080/api/v1/admin-settings
-d 
> '{
>    "AdminSettings" : {
>     "content" : "{test_content1 : test_value1}",
>     "name" : "motd1",
>     "setting_type" : "ambari-server",
>     "updated_by" : "admin"
>   }
> }' 
> {code}
> * read any entry
> {code}
> curl -u admin:admin -H "X-Requested-By: ambari" -X GET  http://localhost:8080/api/v1/admin-settings/motd1
> Response:
> {
>   "href" : "http://localhost:8080/api/v1/admin-settings/motd1",
>   "AdminSettings" : {
>     "content" : "{test_content1 : test_value1}",
>     "name" : "motd1",
>     "setting_type" : "ambari-server",
>     "update_timestamp" : 1453315409437,
>     "updated_by" : "admin"
>   }
> }
> {code}
> * update - update an entry
> {code}
> curl -u admin:admin -H "X-Requested-By: ambari" -X PUT  http://localhost:8080/api/v1/admin-settings/motd
-d
>  '{
>    "AdminSettings" : {
>     "content" : "{test_content1 : test_value1}",
>     "setting_type" : "ambari-server",
>     "updated_by" : "admin"
>   }
> }' 
> {code}
> * delete an entry
> {code}
> curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://localhost:8080/api/v1/admin-settings/motd
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message