Skip to content

Commit

Permalink
Merge pull request #8 from bepsoccer/dev
Browse files Browse the repository at this point in the history
Add Set-VerkadaCameName
  • Loading branch information
bepsoccer authored Mar 2, 2023
2 parents 586fdf0 + 958d67d commit 34de9a7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 3 deletions.
58 changes: 58 additions & 0 deletions Public/Set-VerkadaCameraName.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
function Set-VerkadaCameraName
{
<#
.SYNOPSIS
Set the name of a camera in an organization
.DESCRIPTION
.NOTES
.EXAMPLE
.LINK
#>

[CmdletBinding(PositionalBinding = $true, DefaultParameterSetName = 'email')]
Param(
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[String]$org_id = $Global:verkadaConnection.org_id,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[Alias("cameraId")]
[String]$camera_id,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[Alias("name")]
[String]$camera_name,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$x_verkada_token = $Global:verkadaConnection.csrfToken,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$x_verkada_auth = $Global:verkadaConnection.userToken
)

Begin {
#if (!($org_id)){Write-Warning 'Missing org_id which is required'; return}
#if (!($Global:verkadaConnection)){Write-Warning 'Missing auth token which is required'; return}
#if ($Global:verkadaConnection.authType -ne 'UnPwd'){Write-Warning 'Un/Pwd auth is required'; return}

$url = "https://vprovision.command.verkada.com/camera/name/set"
$response = @()
} #end begin

Process {
$body_params = @{
"cameraId" = $camera_id
"name" = $camera_name
}

$res = Invoke-VerkadaRestMethod $url $org_id $body_params -x_verkada_token $x_verkada_token -x_verkada_auth $x_verkada_auth -Method 'POST' -UnPwd
$response += $res.cameras

} #end process

End {
return $response
}
} #end function
6 changes: 3 additions & 3 deletions verkadaModule.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Brad Parker
#
# Generated on: 2/22/2023
# Generated on: 3/2/2023
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'verkadaModule.psm1'

# Version number of this module.
ModuleVersion = '0.0.5'
ModuleVersion = '0.0.6'

# Supported PSEditions
CompatiblePSEditions = 'Desktop', 'Core'
Expand Down Expand Up @@ -73,7 +73,7 @@ FunctionsToExport = 'Add-VerkadaAccessBadgeToUser', 'Add-VerkadaAccessUser',
'Add-VerkadaAccessUserToGroup', 'Connect-Verkada',
'Disconnect-Verkada', 'Get-VerkadaAccessUser', 'Get-VerkadaCameras',
'Get-VerkadaCloudBackupSettings', 'Read-VerkadaCommandUsers',
'Set-VerkadaCloudBackupSettings'
'Set-VerkadaCameraName', 'Set-VerkadaCloudBackupSettings'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand Down

0 comments on commit 34de9a7

Please sign in to comment.