public MpackRequest getRequest(Request request) throws AmbariException {
     MpackRequest mpackRequest = new MpackRequest();
    Set<Map<String, Object>> properties = request.getProperties();
    for (Map propertyMap : properties) {
      //Mpack Download url is either given in the request body or is fetched using the registry id
      if (!propertyMap.containsKey(MPACK_URI) && !propertyMap.containsKey(REGISTRY_ID)) {
        return null;
      } else if (!propertyMap.containsKey(MPACK_URI)) {
        // Retrieve mpack download url using the given registry id
        mpackRequest.setRegistryId(Long.valueOf((String) propertyMap.get(REGISTRY_ID)));
        mpackRequest.setMpackName((String) propertyMap.get(MPACK_NAME));
        mpackRequest.setMpackVersion((String) propertyMap.get(MPACK_VERSION));
      }
      else {
        //Directly download the mpack using the given url
        mpackRequest.setMpackUri((String) propertyMap.get(MPACK_URI));
      }
    }
    return mpackRequest;
  }
Validates the request body for the required properties in order to create an Mpack resource.

@param mpackRequest
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MpackResourceProvider.java