private Command<Void> getUpdateCommand(final Request request, final Resource resource) {
    return new Command<Void>() {
      @Override
      public Void invoke() throws AmbariException {
        Map<String, Object> entityUpdateProperties =
          new HashMap<>(request.getProperties().iterator().next());

        // ensure name is set.  It won't be in case of query
        entityUpdateProperties.put(ARTIFACT_NAME_PROPERTY,
            String.valueOf(resource.getPropertyValue(ARTIFACT_NAME_PROPERTY)));

        artifactDAO.merge(toEntity(entityUpdateProperties,
            request.getRequestInfoProperties().get(Request.REQUEST_INFO_BODY_PROPERTY)));

        return null;
      }
    };
  }
Create a command to update a resource.

@param request   update request
@param resource  resource to update

@return  a update resource command
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java