ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Swapan Shridhar (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AMBARI-22366) POST, GET and UPDATE API for cluster settings. (/clusters/{clusterName}/settings)
Date Mon, 06 Nov 2017 04:08:00 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-22366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16239877#comment-16239877
] 

Swapan Shridhar edited comment on AMBARI-22366 at 11/6/17 4:07 AM:
-------------------------------------------------------------------

*Implemented API details:*

*==================================================*
*POST:* 
*=====*

*Single Setting POST*:

POST http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "security_enabled",
    "cluster_setting_value": "false"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 54,
        "cluster_setting_name" : "security_enabled",
        "cluster_setting_value" : "false"
      }
    }
  ]
}
{code}

*Multiple Setting POST*:

POST http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "smokeuser",
    "cluster_setting_value": "smoke_user1"
  }
}, 
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "ignore_groupsusers_create",
    "cluster_setting_value": "false"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 55,
        "cluster_setting_name" : "smokeuser",
        "cluster_setting_value" : "smoke_user1"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 56,
        "cluster_setting_name" : "ignore_groupsusers_create",
        "cluster_setting_value" : "false"
      }
    }
  ]
}
{code}





*==================================================*
*GET*
*====*

*Multiple Setting GET*:

GET http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/",
  "items" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "ignore_groupsusers_create"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "security_enabled"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "smokeuser"
      }
    }
  ]
}
{code}


*Single Setting GET*:

GET http://{{host1}}:8080/api/v1/clusters/c1/settings/smokeuser

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
  "ClusterSettingInfo" : {
    "cluster_id" : 2,
    "cluster_name" : "c1",
    "cluster_setting_id" : 55,
    "cluster_setting_name" : "smokeuser",
    "cluster_setting_value" : "smoke_user1"
  }
}
{code}





*==================================================*
*PUT*
*====*

*Single Setting PUT*:

PUT http://{{host1}}:8080/api/v1/clusters/c1/settings/security_enabled

{code:title=REQUEST}
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_value": "true"
  }
}
] 
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 54,
        "cluster_setting_name" : "security_enabled",
        "cluster_setting_value" : "true"
      }
    }
  ]
}
{code}


*Multiple Setting PUT*:

PUT http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name" : "ignore_groupsusers_create",
    "cluster_setting_value": "true"
  }
},
{
  "ClusterSettingInfo" : {
    "cluster_setting_name" : "smokeuser",
    "cluster_setting_value": "smoke_user2"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 55,
        "cluster_setting_name" : "smokeuser",
        "cluster_setting_value" : "smoke_user2"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 56,
        "cluster_setting_name" : "ignore_groupsusers_create",
        "cluster_setting_value" : "true"
      }
    }
  ]
}
{code}






*==================================================*
*DELETE*
*======*

DELETE http://{{host1}}:8080/api/v1/clusters/c1/settings/security_enabled

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "deleteResult" : [
    {
      "deleted" : {
        "key" : "cluster_name: c1, cluster_setting_name: security_enabled"
      }
    }
  ]
}
{code}


was (Author: swapanshridhar):
*API details:*

*==================================================*
*POST:* 
*=====*

*Single Setting POST*:

POST http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "security_enabled",
    "cluster_setting_value": "false"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 54,
        "cluster_setting_name" : "security_enabled",
        "cluster_setting_value" : "false"
      }
    }
  ]
}
{code}

*Multiple Setting POST*:

POST http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "smokeuser",
    "cluster_setting_value": "smoke_user1"
  }
}, 
{
  "ClusterSettingInfo" : {
    "cluster_setting_name": "ignore_groupsusers_create",
    "cluster_setting_value": "false"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 55,
        "cluster_setting_name" : "smokeuser",
        "cluster_setting_value" : "smoke_user1"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 56,
        "cluster_setting_name" : "ignore_groupsusers_create",
        "cluster_setting_value" : "false"
      }
    }
  ]
}
{code}





*==================================================*
*GET*
*====*

*Multiple Setting GET*:

GET http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/",
  "items" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "ignore_groupsusers_create"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "security_enabled"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_name" : "c1",
        "cluster_setting_name" : "smokeuser"
      }
    }
  ]
}
{code}


*Single Setting GET*:

GET http://{{host1}}:8080/api/v1/clusters/c1/settings/smokeuser

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
  "ClusterSettingInfo" : {
    "cluster_id" : 2,
    "cluster_name" : "c1",
    "cluster_setting_id" : 55,
    "cluster_setting_name" : "smokeuser",
    "cluster_setting_value" : "smoke_user1"
  }
}
{code}





*==================================================*
*PUT*
*====*

*Single Setting PUT*:

PUT http://{{host1}}:8080/api/v1/clusters/c1/settings/security_enabled

{code:title=REQUEST}
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_value": "true"
  }
}
] 
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/security_enabled/security_enabled",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 54,
        "cluster_setting_name" : "security_enabled",
        "cluster_setting_value" : "true"
      }
    }
  ]
}
{code}


*Multiple Setting PUT*:

PUT http://{{host1}}:8080/api/v1/clusters/c1/settings/

{code:title=REQUEST} 
[
{
  "ClusterSettingInfo" : {
    "cluster_setting_name" : "ignore_groupsusers_create",
    "cluster_setting_value": "true"
  }
},
{
  "ClusterSettingInfo" : {
    "cluster_setting_name" : "smokeuser",
    "cluster_setting_value": "smoke_user2"
  }
}
]
{code}

{code:title=RESPONSE}
{
  "resources" : [
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/smokeuser",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 55,
        "cluster_setting_name" : "smokeuser",
        "cluster_setting_value" : "smoke_user2"
      }
    },
    {
      "href" : "http://172.22.87.100:8080/api/v1/clusters/c1/settings/ignore_groupsusers_create",
      "ClusterSettingInfo" : {
        "cluster_id" : 2,
        "cluster_name" : "c1",
        "cluster_setting_id" : 56,
        "cluster_setting_name" : "ignore_groupsusers_create",
        "cluster_setting_value" : "true"
      }
    }
  ]
}
{code}






*==================================================*
*DELETE*
*======*

DELETE http://{{host1}}:8080/api/v1/clusters/c1/settings/security_enabled

{code:title=REQUEST} 
[]
{code}

{code:title=RESPONSE}
{
  "deleteResult" : [
    {
      "deleted" : {
        "key" : "cluster_name: c1, cluster_setting_name: security_enabled"
      }
    }
  ]
}
{code}

> POST, GET and UPDATE API for cluster settings. (/clusters/{clusterName}/settings)
> ---------------------------------------------------------------------------------
>
>                 Key: AMBARI-22366
>                 URL: https://issues.apache.org/jira/browse/AMBARI-22366
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>            Reporter: Swapan Shridhar
>            Assignee: Swapan Shridhar
>             Fix For: 3.0.0
>
>
> *Background:* AMBARI-22196 did the following : 
>  (1). Refactoring work of moving all cluster related configs/settings in cluster-env
to "cluster-settings" files.
>  (2). Implementing READ only API to access *cluster-settings* file *setting(s)* : *http://<host>:<port>/api/v1/cluster_settings/
*
> - This was done to separate cluster related configs from stack related configs.
> *This JIRA implements the following :*
> - POST, GET, UPDATE and DELETE APIs for cluster settings with endpoint : 
>   *http://<host>:<port>/api/v1/clusters/[[clusterName]]/settings*, where

> - the cluster settings may be initially read from the above mentioned read-only API :
*http://<host>:<port>/api/v1/cluster_settings/*. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message