Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified DattoAPI/DattoAPI.psd1
Binary file not shown.
2 changes: 1 addition & 1 deletion DattoAPI/Private/apiCalls/ConvertTo-DattoQueryString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ param(
'allPages', 'page', 'perPage',
'endpoint_Agents', 'endpoint_Devices', 'endpoint_byDevice', 'endpoint_byDeviceAgent',
'endpoint_byDeviceAlert', 'endpoint_byDeviceAsset', 'endpoint_byDeviceShare', 'endpoint_byDeviceVolume',
'endpoint_Domains', 'endpoint_CustomerSeats', 'endpoint_CustomerApps',
'endpoint_Domains', 'endpoint_CustomerSeats', 'endpoint_CustomerApps', 'endpoint_CustomerDetailedBackupStats',
'saasCustomerId','externalSubscriptionId','seatType','remoteId','actionType'

$query_Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
Expand Down
19 changes: 17 additions & 2 deletions DattoAPI/Public/SaaS/Get-DattoSaaS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ function Get-DattoSaaS {
.PARAMETER endpoint_CustomerSeats
Returns SaaS protection seats for a given customer

Endpoint = /SaaS/domains/{sassCustomerId}/seats
Endpoint = /SaaS/{sassCustomerId}/seats

.PARAMETER endpoint_CustomerApps
Returns SaaS protection backup data for a given customer

Endpoint = /SaaS/domains/{sassCustomerId}/applications
Endpoint = /SaaS/{sassCustomerId}/applications

.PARAMETER endpoint_CustomerDetailedBackupStats
Returns SaaS protection detailed backup stats for a given customer

Endpoint = /SaaS/{sassCustomerId}/detailedBackupStats

.PARAMETER saasCustomerId
Defines the ID of the customer to get SaaS information from
Expand Down Expand Up @@ -68,6 +73,11 @@ function Get-DattoSaaS {

Returns SaaS protection backup data for a given customer

.EXAMPLE
Get-DattoSaaS -endpoint_CustomerDetailedBackupStats -saasCustomerId 123456

Returns SaaS protection detailed backup stats for a given customer

.NOTES
N\A

Expand All @@ -86,8 +96,12 @@ function Get-DattoSaaS {
[Parameter(Mandatory = $true, ParameterSetName = 'index_byCustomerApps')]
[switch]$endpoint_CustomerApps,

[Parameter(Mandatory = $true, ParameterSetName = 'index_byCustomerDetailedBackupStats')]
[switch]$endpoint_CustomerDetailedBackupStats,

[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index_byCustomerSeats' )]
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index_byCustomerApps' )]
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index_byCustomerDetailedBackupStats' )]
[ValidateNotNullOrEmpty()]
[int]$saasCustomerId,

Expand All @@ -106,6 +120,7 @@ function Get-DattoSaaS {
'index_Domains' { $resource_uri = "/saas/domains" }
'index_byCustomerSeats' { $resource_uri = "/saas/$saasCustomerId/seats" }
'index_byCustomerApps' { $resource_uri = "/saas/$saasCustomerId/applications" }
'index_byCustomerDetailedBackupStats' { $resource_uri = "/saas/$saasCustomerId/detailedBackupStats" }
}

}
Expand Down
49 changes: 49 additions & 0 deletions DattoAPI/Public/SaaS/Get-DattoSaaSDetailedBackupStats.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
function Get-DattoSaaSDetailedBackupStats {
<#
.SYNOPSIS
Get Datto SaaS protection detailed backup stats for a given customer

.DESCRIPTION
The Get-DattoSeat cmdlet gets Datto SaaS protection detailed backup stats
for a given customer

.PARAMETER saasCustomerId
Defines the id of the Datto SaaS organization

.EXAMPLE
Get-DattoSaaSDetailedBackupStats -saasCustomerId "123456"

Gets the Datto SaaS protection detailed backup stats from the define customer id

.NOTES
N\A

.LINK
https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoSaaSDetailedBackupStats.html
#>

[CmdletBinding(DefaultParameterSetName = 'index')]
Param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index')]
[ValidateNotNullOrEmpty()]
[int]$saasCustomerId
)

begin {

$resource_uri = "/saas/$saasCustomerId/detailedBackupStats"

}

process {

Write-Verbose "Running the [ $($PSCmdlet.ParameterSetName) ] parameterSet"

Set-Variable -Name 'Datto_SaaSBackupStatsParameters' -Value $PSBoundParameters -Scope Global -Force

Invoke-DattoRequest -method GET -resource_Uri $resource_Uri -uri_Filter $PSBoundParameters

}

end {}
}
3 changes: 3 additions & 0 deletions docs/DattoAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Gets the saved Datto configuration settings
### [Get-DattoSaaS](site/SaaS/Get-DattoSaaS.md)
Gets Datto SaaS protection data

### [Get-DattoSaaSDetailedBackupStats](site/_Unique/Get-DattoSaaSDetailedBackupStats.md)
Get Datto SaaS protection detailed backup stats for a given customer

### [Get-DattoSeat](site/SaaS/Get-DattoSeat.md)
Get Datto SaaS protection seats for a given customer

Expand Down
Binary file not shown.
Binary file not shown.
125 changes: 121 additions & 4 deletions docs/en-US/DattoAPI-help.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Get-DattoSaaSDetailedBackupStats</command:name>
<command:verb>Get</command:verb>
<command:noun>DattoSaaSDetailedBackupStats</command:noun>
<maml:description>
<maml:para>Get Datto SaaS protection detailed backup stats for a given customer</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>The Get-DattoSeat cmdlet gets Datto SaaS protection detailed backup stats for a given customer</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-DattoSaaSDetailedBackupStats</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none">
<maml:name>saasCustomerId</maml:name>
<maml:description>
<maml:para>Defines the id of the Datto SaaS organization</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type>
<maml:name>Int32</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none">
<maml:name>saasCustomerId</maml:name>
<maml:description>
<maml:para>Defines the id of the Datto SaaS organization</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type>
<maml:name>Int32</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes />
<command:returnValues />
<maml:alertSet>
<maml:alert>
<maml:para>N\A</maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>Get-DattoSaaSDetailedBackupStats -saasCustomerId "123456"</dev:code>
<dev:remarks>
<maml:para>Gets the Datto SaaS protection detailed backup stats from the define customer id</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://celerium.github.io/Datto-PowerShellWrapper/site/_Unique/Get-DattoSaaSDetailedBackupStats.html</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoSaaSDetailedBackupStats.html</maml:linkText>
<maml:uri>https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoSaaSDetailedBackupStats.html</maml:uri>
</maml:navigationLink>
</command:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Set-DattoAPIKey</command:name>
Expand Down Expand Up @@ -3782,7 +3852,7 @@
<maml:name>endpoint_CustomerSeats</maml:name>
<maml:description>
<maml:para>Returns SaaS protection seats for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/domains/{sassCustomerId}/seats</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/seats</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
Expand All @@ -3809,7 +3879,7 @@
<maml:name>endpoint_CustomerApps</maml:name>
<maml:description>
<maml:para>Returns SaaS protection backup data for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/domains/{sassCustomerId}/applications</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/applications</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
Expand Down Expand Up @@ -3860,6 +3930,33 @@
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Get-DattoSaaS</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>endpoint_CustomerDetailedBackupStats</maml:name>
<maml:description>
<maml:para>Returns SaaS protection detailed backup stats for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/detailedBackupStats</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none">
<maml:name>saasCustomerId</maml:name>
<maml:description>
<maml:para>Defines the ID of the customer to get SaaS information from</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type>
<maml:name>Int32</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
Expand All @@ -3879,7 +3976,7 @@
<maml:name>endpoint_CustomerSeats</maml:name>
<maml:description>
<maml:para>Returns SaaS protection seats for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/domains/{sassCustomerId}/seats</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/seats</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
Expand All @@ -3892,7 +3989,20 @@
<maml:name>endpoint_CustomerApps</maml:name>
<maml:description>
<maml:para>Returns SaaS protection backup data for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/domains/{sassCustomerId}/applications</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/applications</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>endpoint_CustomerDetailedBackupStats</maml:name>
<maml:description>
<maml:para>Returns SaaS protection detailed backup stats for a given customer</maml:para>
<maml:para>Endpoint = /SaaS/{sassCustomerId}/detailedBackupStats</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
Expand Down Expand Up @@ -3974,6 +4084,13 @@
<maml:para>Returns SaaS protection backup data for a given customer</maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title>
<dev:code>Get-DattoSaaS -endpoint_CustomerDetailedBackupStats -saasCustomerId 123456</dev:code>
<dev:remarks>
<maml:para>Returns SaaS protection detailed backup stats for a given customer</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
Expand Down
35 changes: 32 additions & 3 deletions docs/site/SaaS/Get-DattoSaaS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Get-DattoSaaS [-endpoint_CustomerApps] -saasCustomerId <Int32> [-daysUntil <Int3
[<CommonParameters>]
```

### index_byCustomerDetailedBackupStats
```powershell
Get-DattoSaaS [-endpoint_CustomerDetailedBackupStats] -saasCustomerId <Int32> [<CommonParameters>]
```

## DESCRIPTION
The Get-DattoSaaS cmdlet gets Datto SaaS protection data by combing all endpoints
into a single command.
Expand Down Expand Up @@ -64,6 +69,13 @@ Get-DattoSaaS -endpoint_CustomerApps -saasCustomerId 123456

Returns SaaS protection backup data for a given customer

### EXAMPLE 4
```powershell
Get-DattoSaaS -endpoint_CustomerDetailedBackupStats -saasCustomerId 123456
```

Returns SaaS protection detailed backup stats for a given customer

## PARAMETERS

### -endpoint_Domains
Expand All @@ -86,7 +98,7 @@ Accept wildcard characters: False
### -endpoint_CustomerSeats
Returns SaaS protection seats for a given customer

Endpoint = /SaaS/domains/{sassCustomerId}/seats
Endpoint = /SaaS/{sassCustomerId}/seats

```yaml
Type: SwitchParameter
Expand All @@ -103,7 +115,7 @@ Accept wildcard characters: False
### -endpoint_CustomerApps
Returns SaaS protection backup data for a given customer

Endpoint = /SaaS/domains/{sassCustomerId}/applications
Endpoint = /SaaS/{sassCustomerId}/applications

```yaml
Type: SwitchParameter
Expand All @@ -117,12 +129,29 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -endpoint_CustomerDetailedBackupStats
Returns SaaS protection detailed backup stats for a given customer

Endpoint = /SaaS/{sassCustomerId}/detailedBackupStats

```yaml
Type: SwitchParameter
Parameter Sets: index_byCustomerDetailedBackupStats
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -saasCustomerId
Defines the ID of the customer to get SaaS information from

```yaml
Type: Int32
Parameter Sets: index_byCustomerSeats, index_byCustomerApps
Parameter Sets: index_byCustomerSeats, index_byCustomerApps, index_byCustomerDetailedBackupStats
Aliases:

Required: True
Expand Down
Loading
Loading