Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3FAFF186B9 for ; Thu, 21 Jan 2016 00:07:40 +0000 (UTC) Received: (qmail 10438 invoked by uid 500); 21 Jan 2016 00:07:40 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 10401 invoked by uid 500); 21 Jan 2016 00:07:39 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 10369 invoked by uid 99); 21 Jan 2016 00:07:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2016 00:07:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C68D02C0453 for ; Thu, 21 Jan 2016 00:07:39 +0000 (UTC) Date: Thu, 21 Jan 2016 00:07:39 +0000 (UTC) From: "Ajit Kumar (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-14750) Provide CRUD API support for settings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-14750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ajit Kumar updated AMBARI-14750: -------------------------------- Attachment: rb42339.patch > Provide CRUD API support for settings > ------------------------------------- > > Key: AMBARI-14750 > URL: https://issues.apache.org/jira/browse/AMBARI-14750 > Project: Ambari > Issue Type: Task > Components: ambari-server > Affects Versions: 2.4.0 > Reporter: Ajit Kumar > Assignee: Ajit Kumar > Fix For: 2.4.0 > > Attachments: rb42339.patch > > > 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)