vim_datastore_file

Datastore file transfer + manipulation.

Three surfaces are used:

  • Datastore.browser.SearchDatastore_Task for listings

  • FileManager for delete / mkdir / move (rename or copy across datastores)

  • HTTP /folder/<ds_path>?dcPath=<dc>&dsName=<ds> for upload/download, authenticated via the SOAP session cookie from saltext.vcf.utils.vim.session_cookie()

saltext.vcf.clients.vim_datastore_file.list_(opts, datacenter, datastore, path='', profile=None)[source]

Return [{path, file_type, size, modification, owner}, ...] for files under path.

saltext.vcf.clients.vim_datastore_file.delete(opts, datacenter, datastore, path, profile=None)[source]

Delete a file or directory. Returns the vim.Task moId.

saltext.vcf.clients.vim_datastore_file.mkdir(opts, datacenter, datastore, path, *, create_parents=True, profile=None)[source]

Create a directory on the datastore. Synchronous (FileManager.MakeDirectory).

saltext.vcf.clients.vim_datastore_file.move(opts, src_datacenter, src_datastore, src_path, dst_datacenter, dst_datastore, dst_path, *, force=False, profile=None)[source]

Move a file across datastores. Returns the vim.Task moId.

saltext.vcf.clients.vim_datastore_file.upload(opts, datacenter, datastore, local_path, ds_path, profile=None)[source]

Stream a local file to [datastore] ds_path via HTTPS POST.

The HTTP request is authenticated with the SOAP session cookie. Returns the HTTP status code on success.

saltext.vcf.clients.vim_datastore_file.download(opts, datacenter, datastore, ds_path, local_path, profile=None)[source]

Stream [datastore] ds_path to disk via HTTPS GET. Returns the byte count written.