Skip to content

Latest commit

 

History

History
 
 

createS3View

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Create an S3 View using PowerShell

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 powershell script creates an S3 View on Cohesity.

Download the script

Run these commands from PowerShell to download the script(s) into your current directory

# Begin download commands
$scriptName = 'createS3View'
$repoURL = 'https://raw.githubusercontent.com/bseltz-cohesity/scripts/master/powershell'
(Invoke-WebRequest -Uri "$repoUrl/$scriptName/$scriptName.ps1").content | Out-File "$scriptName.ps1"; (Get-Content "$scriptName.ps1") | Set-Content "$scriptName.ps1"
(Invoke-WebRequest -Uri "$repoUrl/cohesity-api/cohesity-api.ps1").content | Out-File cohesity-api.ps1; (Get-Content cohesity-api.ps1) | Set-Content cohesity-api.ps1
# End download commands

Components

  • createS3View.ps1: the main powershell script
  • cohesity-api.ps1: the Cohesity REST API helper module

Place both files in a folder together and run the main script like so:

#example
./createS3View.ps1 -vip mycluster `
                   -username myusername `
                   -domain mydomain.net `
                   -viewName newview1 `
                   -whiteList 192.168.1.0/24, 192.168.2.11/32 `
                   -qosPolicy 'TestAndDev High' `
                   -quotaLimitGB 20 `
                   -quotaAlertGB 18 `
                   -storageDomain mystoragedomain `
                   -showKeys
#end example

Parameters

  • -vip: Cohesity cluster to connect to
  • -username: Cohesity username
  • -domain: (optional) Active Directory domain (defaults to 'local')
  • -viewName: name of new view to create
  • -qosPolicy: (optional) defaults to 'Backup Target Low' or choose 'Backup Target High', 'TestAndDev High' or 'TestAndDev Low'
  • -storageDomain: (optional) name of storage domain to place view data. Defaults to DefaultStorageDomain
  • -quotaLimitGB: (optional) logical quota in GiB
  • -quotaAlertGB: (optional) alert threshold in GiB
  • -whiteList: (optional) one or more CIDR addresses (comma separated) e.g. 192.168.2.0/24, 192.168.2.11/32
  • -caseSensitive: (optional) make file names case sensitive
  • -showKeys: (optional) display S3 access key and secret key