incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Speidel (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMBARI-1018) Add API support for creating multiple sub-resources to multiple resources in a single request
Date Fri, 16 Nov 2012 21:35:13 GMT
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

Mime
View raw message