@Override
  public RequestStatus create(ResourceInstance resource, RequestBody requestBody)
          throws UnsupportedPropertyException,
          SystemException,
          ResourceAlreadyExistsException,
          NoSuchParentResourceException {

    if (!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, null,
      EnumSet.of(RoleAuthorization.CLUSTER_MANAGE_USER_PERSISTED_DATA))) {
      throw new AuthorizationException("The authenticated user does not have authorization " +
        "to create/store user persisted data.");
    }

    if (resource != null) {

      Map<Resource.Type, String> mapResourceIds = resource.getKeyValueMap();
      Resource.Type type = resource.getResourceDefinition().getType();
      Schema schema = m_controller.getSchema(type);

      Set<NamedPropertySet> setProperties = requestBody.getNamedPropertySets();
      if (setProperties.isEmpty()) {
        requestBody.addPropertySet(new NamedPropertySet("", new HashMap<>()));
      }

      for (NamedPropertySet propertySet : setProperties) {
        for (Map.Entry<Resource.Type, String> entry : mapResourceIds.entrySet()) {
          Map<String, Object> mapProperties = propertySet.getProperties();
          String property = schema.getKeyPropertyId(entry.getKey());
          if (!mapProperties.containsKey(property)) {
            mapProperties.put(property, entry.getValue());
          }
        }
      }
      return m_controller.createResources(type, createControllerRequest(requestBody));
    } else {
      throw new NoSuchParentResourceException("Resource is null");
    }
  }
Constructor.

@param controller  the cluster controller
ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java