Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Create a View Alias using Python

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.

Download the script

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

Components

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

Authentication Parameters

  • -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

Other Parameters

  • -n, --viewname: name of new view to create
  • -a, --aliasname: name of alias to create
  • -f, --folderpath: (optional) path to share (default is /)