You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "John Speidel (JIRA)" <ji...@apache.org> on 2012/11/16 22:35:13 UTC

[jira] [Created] (AMBARI-1018) Add API support for creating multiple sub-resources to multiple resources in a single request

John Speidel created AMBARI-1018:
------------------------------------

             Summary: Add API support for creating multiple sub-resources to multiple resources in a single request
                 Key: AMBARI-1018
                 URL: https://issues.apache.org/jira/browse/AMBARI-1018
             Project: Ambari
          Issue Type: New Feature
            Reporter: John Speidel
            Assignee: John Speidel


Add API functionality for a user to query a resource and add sub-resources(all of the same type) to the matching set of resources.

For example, to add the "SECONDARY_NAMENODE" and "HDFS_CLIENT" host components where the service name is HDFS:

POST http://localhost/api/v1/clusters/mycluster/services?ServiceInfo/service_name=HDFS
{
"components" : [
{"ServiceComponentInfo" : {
        "component_name" : "SECONDARY_NAMENODE"
      }
},
{"ServiceComponentInfo" : {
        "component_name" : "HDFS_CLIENT"
      }
}
] }

The msg body must start with the name of the sub-resource collection that the new resources are to be added to, in this case "components".  This name can be determined by doing a get on the resource that is being queried.  For each resource being added, provide a new array element and provide all of the properties that are required.  It is not necessary(or possible) to provide the values of all foreign key properties for ancestors, they are added implicitly.  So, in this case there is no need to provide the clusterId, or serviceId.  

The resources defined in the body are added as sub-resources to all resources that match the provided query.  In this example, only one service will match the query, but any valid query can be used to match any number of resources.

At the time of this checkin, it is necessary to provide a query for this functionality.  Therefore, to add the sub-resources to all resources, you need to provide a query that will match all resources(It can be a bugs query such as name!=bogus).  This is temporary and will be fixed in a subsequent commit.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMBARI-1018) Add API support for creating multiple sub-resources to multiple resources in a single request

Posted by "John Speidel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMBARI-1018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Speidel updated AMBARI-1018:
---------------------------------

    Attachment: AMBARI-1018.patch
    
> Add API support for creating multiple sub-resources to multiple resources in a single request
> ---------------------------------------------------------------------------------------------
>
>                 Key: AMBARI-1018
>                 URL: https://issues.apache.org/jira/browse/AMBARI-1018
>             Project: Ambari
>          Issue Type: New Feature
>            Reporter: John Speidel
>            Assignee: John Speidel
>         Attachments: AMBARI-1018.patch
>
>
> Add API functionality for a user to query a resource and add sub-resources(all of the same type) to the matching set of resources.
> For example, to add the "SECONDARY_NAMENODE" and "HDFS_CLIENT" host components where the service name is HDFS:
> POST http://localhost/api/v1/clusters/mycluster/services?ServiceInfo/service_name=HDFS
> {
> "components" : [
> {"ServiceComponentInfo" : {
>         "component_name" : "SECONDARY_NAMENODE"
>       }
> },
> {"ServiceComponentInfo" : {
>         "component_name" : "HDFS_CLIENT"
>       }
> }
> ] }
> The msg body must start with the name of the sub-resource collection that the new resources are to be added to, in this case "components".  This name can be determined by doing a get on the resource that is being queried.  For each resource being added, provide a new array element and provide all of the properties that are required.  It is not necessary(or possible) to provide the values of all foreign key properties for ancestors, they are added implicitly.  So, in this case there is no need to provide the clusterId, or serviceId.  
> The resources defined in the body are added as sub-resources to all resources that match the provided query.  In this example, only one service will match the query, but any valid query can be used to match any number of resources.
> At the time of this checkin, it is necessary to provide a query for this functionality.  Therefore, to add the sub-resources to all resources, you need to provide a query that will match all resources(It can be a bugs query such as name!=bogus).  This is temporary and will be fixed in a subsequent commit.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira