Warning: this code is provided on a best effort basis and is not in any way officially supported or sanctioned by Cohesity. The code is intentionally kept simple to retain value as example code. The code in this repository is provided as-is and the author accepts no liability for damages resulting from its use.
This python script creates a view alias (additional share) in a Cohesity View.
Run these commands to download the scripts into your current directory
curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/createViewAlias/createViewAlias.py
curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity.py
chmod +x createViewAlias.py- createViewAlias.py: the main python script
- pyhesity.py: the Cohesity REST API helper module
Place both files in a folder together and run the main script like so:
#example
./createViewAlias.py -v mycluster \
-u myusername \
-d mydomain.net \
-n myview \
-a myalias \
-p /folder1
#end example- -v, --vip: (optional) DNS or IP of the Cohesity cluster to connect to (default is helios.cohesity.com)
- -u, --username: (optional) username to authenticate to Cohesity cluster (default is helios)
- -d, --domain: (optional) domain of username (defaults to local)
- -t, --tenant: (optional) multi-tenancy tenant name
- -i, --useApiKey: (optional) use API key for authentication
- -pwd, --password: (optional) password or API key
- -np, --noprompt: (optional) do not prompt for password
- -mcm, --mcm: (optional) connect through MCM
- -c, --clustername: (optional) helios/mcm cluster to connect to
- -m, --mfacode: (optional) MFA code for authentication
- -e --emailmfacode: (optional) send MFA code via email
- -n, --viewname: name of new view to create
- -a, --aliasname: name of alias to create
- -f, --folderpath: (optional) path to share (default is /)