dremio-professional-services / dremio-cloner

27 stars 21 forks source link

Unable to read/get a single VDS only #31

Closed nshetty15 closed 2 years ago

nshetty15 commented 2 years ago

I tried to simply download the definition of a single VDS. However, looks like dremio-cloner downloads all the folders along with the single VDS.

Here is my folder structure image

Here is the output that I get image In the results output directory, I want to see inherit.json but not the other two folders mk and ck (Both of them actually have VDS's within them but dremio-cloner downloads only the empty folders).

What would be the right config to use here in order to only get the single VDS definition? (get only inherit.json file as output) Below is the desired output. image

Below is the config file used (config_read_dir.json): Along with generating unnecessary folders, it also ends up taking a lot of time when the number of folders are high. (Time is spent making API calls for each folder)

{"dremio_cloner": [
  {"command":"get"},
  {"source": [
    {"endpoint": "https://dremio.nonprod.com/"},
    {"username": "dremio-local-admin"},
    {"password": "****"},
    {"verify_ssl": "True"},
    {"is_community_edition": "False"},
    {"graph_api_support": "True"}]
  },
{"target": [
    {"directory":"results"},
    {"overwrite": "True"}]
    },
    {"options": [
    {"logging.level":"logging.DEBUG"},
    {"logging.format":"%(levelname)s:%(asctime)s:%(message)s"},
    {"logging.filename":"read_log"},
    {"logging.verbose": "False"},

    {"max_errors":"9999"},
    {"http_timeout":"10"},

    {"user.process_mode":"skip"},
    {"group.process_mode":"skip"},
    {"space.process_mode":"skip"},
    {"source.process_mode":"skip"},
    {"reflection.process_mode": "skip"},
    {"wlm.queue.process_mode": "skip"},
    {"wlm.rule.process_mode": "skip"},
    {"wiki.process_mode": "skip"},
    {"tag.process_mode": "skip"},
    {"home.process_mode": "skip"},
    {"vote.process_mode": "skip"},
    {"folder.process_mode": "skip"},
    {"vds.process_mode": "process"},
    {"pds.process_mode": "skip"},

    {"space.filter": "*"},
    {"space.filter.names": ["CICD"]},
    {"space.exclude.filter": ""},
    {"space.folder.filter":"*"},
    {"space.folder.filter.paths": []},
    {"space.folder.exclude.filter":""},

    {"source.filter":"*"},
    {"source.filter.names": []},
    {"source.filter.types": []},
    {"source.exclude.filter":""},
    {"source.folder.filter":"*"},
    {"source.folder.filter.paths": []},
    {"source.folder.exclude.filter":""},

    {"pds.filter":"*"},
    {"pds.filter.names": []},
    {"pds.exclude.filter":""},
    {"pds.list.useapi":"False"},

    {"vds.filter":"*"},
    {"vds.filter.names": ["inherit"]},
    {"vds.exclude.filter":""},
    {"vds.dependencies.process_mode":"ignore"},

    {"reflection.only_for_matching_vds":"True"}]
    }]
}
mxmarg commented 2 years ago

Hi @nshetty15 , I looked into the issue and fixed an inconsistency, where a filter on folder level would impact VDSs, which were not located in folders, i.e. located directly in the space (as in your case). This means, you should now be able to export only VDSs in the root of your space by using {"space.folder.filter":""}, {"space.folder.filter.paths": []}, {"space.folder.exclude.filter":"*"},