fs interface — VMware Salt API

fs interface — VMware Salt API

fs interface

The LoadedMod class allows for the module loaded onto the sub to return custom sequencing, for instance it can be iterated over to return all functions

delete_file(file_uuid: uuid.UUID | None, saltenv: str | None, path: str | None)

Delete a file from the database.

Parameters

file_uuid:UUID of the file in question
saltenv:Salt environment in which to look for the file
path:Fully-qualified path of the file.

Note, use file_uuid or saltenv and path, but not both.

file_exists(file_uuid: uuid.UUID | None, saltenv: str | None, path: str | None)
Returns: <class 'bool'>

Return True if file exists.

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

Parameters

file_uuid:UUID of the file in question
saltenv:Salt environment in which to look for the file
path:Fully-qualified path of the file.

Note, use file_uuid or saltenv and path, but not both.

get_env(saltenv: <class 'str'>, include_fs_metadata: bool | None = True)
Returns: list[dict]

List all files in the given Salt environment.

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

Parameters

saltenv:Salt environment in which to look for the files
include_fs_metadata:If True, include a dictonary key that has metadata associated with the file.
get_envs()
Returns: list[str]

Get a list of all available Salt environments

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

get_file(file_uuid: uuid.UUID | None, saltenv: str | None, path: str | None)
Returns: <class 'dict'>

Get a file from the database. Returns a dictionary with the file's metadata and a data field with the actual file contents.

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

Parameters

file_uuid:UUID of the file in question
saltenv:Salt environment in which to look for the file
path:Fully-qualified path of the file.

Note, use file_uuid or saltenv and path, but not both.

get_file_access(file_uuid: <class 'uuid.UUID'>)
Returns: <class 'dict'>

Return access metadata for this file.

Parameters

file_uuid:UUID referencing desired file.
save_file(file_uuid: uuid.UUID | None, saltenv: str | None, path: str | None, contents: bytes | str | None, content_type: str | None)

Add or update a file to the database

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

Parameters

file_uuid:UUID of the file in question
saltenv:Salt environment in which to look for the file
path:Fully-qualified path of the file.
contents:The file's contents. If the file is plain text then contents is the literal content of the file. If it is a binary format then contents should be base64-encoded.
content_type:MIME content-type. Will be guessed if passed in as None.

Note, use file_uuid or saltenv and path, but not both.

save_file_access(file_uuid: <class 'uuid.UUID'>, access_payload: <class 'dict'>)

Save access metadata for this file.

Parameters

file_uuid:UUID referencing desired file.
access_payload:Dictionary containing role names as keys and a list of allowed access types as values
update_file(file_uuid: uuid.UUID | None, saltenv: str | None, path: str | None, contents: bytes | str | None, content_type: str | None)

Add or update a file to the database

For more information on files and environments, see the VMware Salt documentation on Broadcom's TechDocs.

Parameters

file_uuid:UUID of the file in question
saltenv:Salt environment in which to look for the file
path:Fully-qualified path of the file.
contents:The file's contents. If the file is plain text then contents is the literal content of the file. If it is a binary format then contents should be base64-encoded.
content_type:MIME content-type. Will be guessed if passed in as None.

Note, use file_uuid or saltenv and path, but not both.