private void addSubresources(Resource res, RepositoryVersionEntity entity) {
    JsonNodeFactory factory = JsonNodeFactory.instance;

    ArrayNode subs = factory.arrayNode();

    for (RepoOsEntity os : entity.getRepoOsEntities()) {
      ObjectNode osBase = factory.objectNode();

      ObjectNode osElement = factory.objectNode();
      osElement.put(PropertyHelper.getPropertyName(OperatingSystemResourceProvider.OPERATING_SYSTEM_AMBARI_MANAGED_REPOS),
          os.isAmbariManaged());
      osElement.put(PropertyHelper.getPropertyName(OperatingSystemResourceProvider.OPERATING_SYSTEM_OS_TYPE_PROPERTY_ID),
          os.getFamily());

      osElement.put(PropertyHelper.getPropertyName(OperatingSystemResourceProvider.OPERATING_SYSTEM_STACK_NAME_PROPERTY_ID),
          entity.getStackName());
      osElement.put(PropertyHelper.getPropertyName(OperatingSystemResourceProvider.OPERATING_SYSTEM_STACK_VERSION_PROPERTY_ID),
          entity.getStackVersion());

      osBase.put(PropertyHelper.getPropertyCategory(OperatingSystemResourceProvider.OPERATING_SYSTEM_AMBARI_MANAGED_REPOS),
          osElement);

      ArrayNode reposArray = factory.arrayNode();
      for (RepoDefinitionEntity repo : os.getRepoDefinitionEntities()) {
        ObjectNode repoBase = factory.objectNode();

        ObjectNode repoElement = factory.objectNode();

        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_BASE_URL_PROPERTY_ID),
            repo.getBaseUrl());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_OS_TYPE_PROPERTY_ID),
            os.getFamily());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_REPO_ID_PROPERTY_ID),
            repo.getRepoID());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_REPO_NAME_PROPERTY_ID),
            repo.getRepoName());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_DISTRIBUTION_PROPERTY_ID),
            repo.getDistribution());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_COMPONENTS_PROPERTY_ID),
            repo.getComponents());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_STACK_NAME_PROPERTY_ID),
            entity.getStackName());
        repoElement.put(PropertyHelper.getPropertyName(RepositoryResourceProvider.REPOSITORY_STACK_VERSION_PROPERTY_ID),
            entity.getStackVersion());

        @Experimental(feature = ExperimentalFeature.CUSTOM_SERVICE_REPOS,
          comment = "Remove logic for handling custom service repos after enabling multi-mpack cluster deployment")
               ArrayNode applicableServicesNode = factory.arrayNode();
        if(repo.getApplicableServices() != null) {
          for (String applicableService : repo.getApplicableServices()) {
            applicableServicesNode.add(applicableService);
          }
        }
        repoElement.put(PropertyHelper.getPropertyName(
          RepositoryResourceProvider.REPOSITORY_APPLICABLE_SERVICES_PROPERTY_ID), applicableServicesNode);

        ArrayNode tagsNode = factory.arrayNode();
        for (RepoTag repoTag : repo.getTags()) {
          tagsNode.add(repoTag.toString());
        }
        repoElement.put(PropertyHelper.getPropertyName(
            RepositoryResourceProvider.REPOSITORY_TAGS_PROPERTY_ID), tagsNode);

        repoBase.put(PropertyHelper.getPropertyCategory(RepositoryResourceProvider.REPOSITORY_BASE_URL_PROPERTY_ID),
            repoElement);

        reposArray.add(repoBase);
      }

      osBase.put(new RepositoryResourceDefinition().getPluralName(), reposArray);

      subs.add(osBase);
    }

    res.setProperty(new OperatingSystemResourceDefinition().getPluralName(), subs);
  }
Provide the dry-run entity with fake sub-resources.  These are not queryable by normal API.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java