diff --git a/DattoAPI/DattoAPI.psd1 b/DattoAPI/DattoAPI.psd1 index 6110de0..2ea4a4b 100644 Binary files a/DattoAPI/DattoAPI.psd1 and b/DattoAPI/DattoAPI.psd1 differ diff --git a/DattoAPI/Private/apiCalls/ConvertTo-DattoQueryString.ps1 b/DattoAPI/Private/apiCalls/ConvertTo-DattoQueryString.ps1 index 57689a3..5bb4f6a 100644 --- a/DattoAPI/Private/apiCalls/ConvertTo-DattoQueryString.ps1 +++ b/DattoAPI/Private/apiCalls/ConvertTo-DattoQueryString.ps1 @@ -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', 'saasCustomerId','externalSubscriptionId' + 'endpoint_Domains', 'endpoint_CustomerSeats', 'endpoint_CustomerApps', 'saasCustomerId','externalSubscriptionId','seatType','remoteId','actionType' $query_Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty) diff --git a/DattoAPI/Private/apiCalls/Invoke-DattoRequest.ps1 b/DattoAPI/Private/apiCalls/Invoke-DattoRequest.ps1 index 6be8f7f..f9d7997 100644 --- a/DattoAPI/Private/apiCalls/Invoke-DattoRequest.ps1 +++ b/DattoAPI/Private/apiCalls/Invoke-DattoRequest.ps1 @@ -14,7 +14,7 @@ function Invoke-DattoRequest { Defines the type of API method to use Allowed values: - 'GET' + 'GET', 'PUT' .PARAMETER resource_Uri Defines the resource uri (url) to use when creating the API call @@ -63,7 +63,7 @@ function Invoke-DattoRequest { [CmdletBinding()] param ( [Parameter(Mandatory = $false)] - [ValidateSet('GET')] + [ValidateSet('GET','PUT')] [String]$method = 'GET', [Parameter(Mandatory = $true)] @@ -96,7 +96,7 @@ function Invoke-DattoRequest { if ($null -eq $data) { $body = $null } else { - $body = @{'data'= $data} | ConvertTo-Json -Depth $Datto_JSON_Conversion_Depth + $body = $data | ConvertTo-Json -Depth $Datto_JSON_Conversion_Depth } try { diff --git a/DattoAPI/Public/SaaS/Get-DattoBulkSeatAssignment.ps1 b/DattoAPI/Public/SaaS/Get-DattoBulkSeatAssignment.ps1 deleted file mode 100644 index 2ecde88..0000000 --- a/DattoAPI/Public/SaaS/Get-DattoBulkSeatAssignment.ps1 +++ /dev/null @@ -1,57 +0,0 @@ -function Get-DattoBulkSeatAssignment { -<# - .SYNOPSIS - Get SaaS Protection bulk seats assignment - - .DESCRIPTION - The Get-DattoBulkSeatAssignment cmdlet get SaaS Protection - bulk seats assignment - - .PARAMETER saasCustomerId - Defines the id of the customer to get SaaS information from - - .PARAMETER externalSubscriptionId - Defines the external Subscription Id of the customer to - get SaaS bulk seat information from - - .EXAMPLE - Get-DattoBulkSeatAssignment -saasCustomerId "12345678" -externalSubscriptionId 'ab23-bdf234-1234-asdf' - - Gets the Datto SaaS protection seats from the define customer id - - .NOTES - N\A - - .LINK - https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html -#> - - [CmdletBinding(DefaultParameterSetName = 'index')] - Param ( - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index')] - [ValidateNotNullOrEmpty()] - [string]$saasCustomerId, - - [Parameter(Mandatory = $true, ParameterSetName = 'index')] - [ValidateNotNullOrEmpty()] - [string]$externalSubscriptionId - ) - - begin { - - $resource_uri = "/saas/$saasCustomerId/$externalSubscriptionId/bulkSeatAssignment" - - } - - process { - - Write-Verbose "Running the [ $($PSCmdlet.ParameterSetName) ] parameterSet" - - Set-Variable -Name 'Datto_bulkSeatParameters' -Value $PSBoundParameters -Scope Global -Force - - Invoke-DattoRequest -method GET -resource_Uri $resource_Uri -uri_Filter $PSBoundParameters - - } - - end {} -} diff --git a/DattoAPI/Public/SaaS/Set-DattoBulkSeatChange.ps1 b/DattoAPI/Public/SaaS/Set-DattoBulkSeatChange.ps1 new file mode 100644 index 0000000..f450b79 --- /dev/null +++ b/DattoAPI/Public/SaaS/Set-DattoBulkSeatChange.ps1 @@ -0,0 +1,98 @@ +function Set-DattoBulkSeatChange { +<# + .SYNOPSIS + Sets Datto SaaS Protection bulk seat changes + + .DESCRIPTION + The Set-DattoBulkSeatChange cmdlet is used to set SaaS Protection bulk seat changes + + .PARAMETER saasCustomerId + Defines the id of the Organization to set SaaS information from + + .PARAMETER externalSubscriptionId + Defines the external Subscription ID of the SaaS Protection Organization used to set SaaS bulk seat changes + + .EXAMPLE + Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:Office365:123456' -seatType "User" -remoteId "ab23-bdf234-1234-asdf" -actionType "License" + + Sets the Datto SaaS protection seats from the defined Office365 customer id + + .EXAMPLE + Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:GoogleApps:123456' -seatType "SharedDrive" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "Pause" + + Sets the Datto SaaS protection seats from the defined Google customer id + + .NOTES + N\A + + .LINK + https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html +#> + + [CmdletBinding(DefaultParameterSetName = 'index', SupportsShouldProcess = $true)] + Param ( + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'index')] + [ValidateNotNullOrEmpty()] + [string]$saasCustomerId, + + [Parameter(Mandatory = $true, ParameterSetName = 'index')] + [ValidateNotNullOrEmpty()] + [string]$externalSubscriptionId, + + # Parameter help description + [Parameter( + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true, + ParameterSetName = 'index' + )] + [ValidateNotNullOrEmpty()] + [string]$seatType, + + # Valid methods are 'License' to "Protect", 'Pause' to "Pause", and 'Unlicense' to "Unprotect" + [Parameter( + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true, + ParameterSetName = 'index' + )] + [ValidateSet('License','Pause','Unlicense')] + [ValidateNotNullOrEmpty()] + [string]$actionType, + + # Either like 'Classic:Office365:123456', or 'Classic:GoogleApps:123456' + [Parameter( + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true, + ParameterSetName = 'index' + )] + [ValidateNotNullOrEmpty()] + [string[]]$remoteId + ) + + begin { + + $resource_uri = "/saas/$saasCustomerId/$externalSubscriptionId/bulkSeatChange" + + $requestBody = @{ + seat_type = $seatType + action_type = $actionType + ids = $remoteId + } + + } + + process { + + if ($PSCmdlet.ShouldProcess("saasCustomerId: $saasCustomerId, externalSubscriptionId: $externalSubscriptionId, $remoteId", "$actionType $seatType")) { + Write-Verbose "Running the [ $($PSCmdlet.ParameterSetName) ] parameterSet" + Set-Variable -Name 'Datto_bulkSeatParameters' -Value $PSBoundParameters -Scope Global -Force + + Invoke-DattoRequest -method PUT -resource_Uri $resource_Uri -uri_Filter $PSBoundParameters -data $requestBody + } + + } + + end {} +} \ No newline at end of file diff --git a/README.md b/README.md index ab43154..1d2e2c5 100644 --- a/README.md +++ b/README.md @@ -86,9 +86,10 @@ The [DattoAPI](https://www.datto.com/) offers users the ability to extract data - :book: Project documentation can be found on [Github Pages](https://celerium.github.io/Datto-PowerShellWrapper/) - :book: Datto's REST API documentation on their management portal [here](https://portal.dattobackup.com/integrations/api) *[ Requires a login ]*. -Datto features a REST API that makes use of common HTTPs GET actions. In order to maintain PowerShell best practices, only approved verbs are used. +Datto features a REST API that makes use of common HTTP request methods. In order to maintain PowerShell best practices, only approved verbs are used. - GET -> Get- +- PUT -> Set- Additionally, PowerShell's `verb-noun` nomenclature is respected. Each noun is prefixed with `Datto` in an attempt to prevent naming problems. @@ -131,12 +132,12 @@ After installing this module, you will need to configure both the *base URI* & * - By default, Datto's `https://api.datto.com/v1` URI is used. - If you have your own API gateway or proxy, you may put in your own custom URI by specifying the `-base_uri` parameter: - `Add-DattoBaseURI -base_uri http://myapi.gateway.celerium.org` -
+
2. Run `Add-DattoAPIKey -Api_Key_Public 12345 -Api_Key_Secret 123456789` - It will prompt you to enter your API access tokens if you do not specify them. - Datto API access tokens are generated via the Datto portal at *Admin > Integrations* -
+
3. [**optional**] Run `Export-DattoModuleSettings` - This will create a config file at `%UserProfile%\DattoAPI` that holds the *base uri* & *API access tokens* information. @@ -153,22 +154,22 @@ Calling an API resource is as simple as running `Get-Datto` - The following is a table of supported functions and their corresponding API resources: - Table entries with [ `-` ] indicate that the functionality is **NOT** supported by the Datto API at this time. -| Section | API Resource | Create | Read | Update | Delete | -|--------- | -------------- | --------- | ------------------------- | --------- | --------- | -| Reporting | ActivityLog | - | `Get-DattoActivityLog` | - | - | -| BCDR | Agent | - | `Get-DattoAgent` | - | - | -| BCDR | Alert | - | `Get-DattoAlert` | - | - | -| BCDR | Asset | - | `Get-DattoAsset` | - | - | -| BCDR | **BCDR** * | - | `Get-DattoBCDR` | - | - | -| BCDR | Device | - | `Get-DattoDevice` | - | - | -| BCDR | Share | - | `Get-DattoShare` | - | - | -| BCDR | VMRestore | - | `Get-DattoGet-DattoVMRestore` | - | - | -| BCDR | Volume | - | `Get-DattoVolume` | - | - | -| SaaS | **SaaS** * | - | `Get-DattoSaaS` | - | - | -| SaaS | Domains | - | `Get-DattoDomain` | - | - | -| SaaS | Seats | - | `Get-DattoSeat` | - | - | -| SaaS | Applications | - | `Get-DattoApplication` | - | - | -| SaaS | BulkSeatAssignment | - | `Get-DattoBulkSeatAssignment` | - | - | +| Section | API Resource | Create | Read | Update | Delete | +| --------- | ------------------ | ------ | ----------------------------- | ------------------------- | ------ | +| Reporting | ActivityLog | - | `Get-DattoActivityLog` | - | - | +| BCDR | Agent | - | `Get-DattoAgent` | - | - | +| BCDR | Alert | - | `Get-DattoAlert` | - | - | +| BCDR | Asset | - | `Get-DattoAsset` | - | - | +| BCDR | **BCDR** * | - | `Get-DattoBCDR` | - | - | +| BCDR | Device | - | `Get-DattoDevice` | - | - | +| BCDR | Share | - | `Get-DattoShare` | - | - | +| BCDR | VMRestore | - | `Get-DattoGet-DattoVMRestore` | - | - | +| BCDR | Volume | - | `Get-DattoVolume` | - | - | +| SaaS | **SaaS** * | - | `Get-DattoSaaS` | - | - | +| SaaS | Domains | - | `Get-DattoDomain` | - | - | +| SaaS | Seats | - | `Get-DattoSeat` | - | - | +| SaaS | Applications | - | `Get-DattoApplication` | - | - | +| SaaS | BulkSeatChange | - | - | `Set-DattoBulkSeatChange` | - | - :warning: `Get-DattoBCDR` & `Get-DattoSaaS` are special functions. - These are **NOT** endpoints in Datto's REST API and are a single set of commands that can run endpoints in their associate sections. diff --git a/docs/Contributing.md b/docs/Contributing.md index b30c9fd..c358ee9 100644 --- a/docs/Contributing.md +++ b/docs/Contributing.md @@ -14,9 +14,9 @@ nav_order: 3 ## **Did you find a bug?** -* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/Celerium/DattoAPI/issues). +* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/Celerium/Datto-PowerShellWrapper/issues). -* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/Celerium/DattoAPI/issues/new/choose). +* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/Celerium/Datto-PowerShellWrapper/issues/new/choose). * Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. ## **Did you write a patch that fixes a bug?** diff --git a/docs/DattoAPI.md b/docs/DattoAPI.md index 056ad56..4435dd6 100644 --- a/docs/DattoAPI.md +++ b/docs/DattoAPI.md @@ -36,9 +36,6 @@ Gets Datto BCDR alerts for a given device. ### [Get-DattoAPIKey](site/Internal/Get-DattoAPIKey.md) Gets the Datto API public & secret key global variables. -### [Get-DattoApplication](site/SaaS/Get-DattoApplication.md) -Get Datto SaaS protection backup data for a given customer - ### [Get-DattoAsset](site/BCDR/Get-DattoAsset.md) Get Datto BCDR assets (agents and shares) for a given device @@ -48,15 +45,9 @@ Shows the Datto base URI global variable. ### [Get-DattoBCDR](site/BCDR/Get-DattoBCDR.md) Gets Datto BCDR devices and assets -### [Get-DattoBulkSeatAssignment](site/SaaS/Get-DattoBulkSeatAssignment.md) -Get SaaS Protection bulk seats assignment - ### [Get-DattoDevice](site/BCDR/Get-DattoDevice.md) Gets Datto BCDR devices from the the Datto API. -### [Get-DattoDomain](site/SaaS/Get-DattoDomain.md) -Get Datto SaaS protection data about what domains are being protected - ### [Get-DattoMetaData](site/Internal/Get-DattoMetaData.md) Gets various Api metadata values @@ -66,9 +57,18 @@ Gets the saved Datto configuration settings ### [Get-DattoSaaS](site/SaaS/Get-DattoSaaS.md) Gets Datto SaaS protection data +### [Get-DattoApplication](site/SaaS/Get-DattoApplication.md) +Get Datto SaaS protection backup data for a given customer + +### [Get-DattoDomain](site/SaaS/Get-DattoDomain.md) +Get Datto SaaS protection data about what domains are being protected + ### [Get-DattoSeat](site/SaaS/Get-DattoSeat.md) Get Datto SaaS protection seats for a given customer +### [Set-DattoBulkSeatChange](site/SaaS/Set-DattoBulkSeatChange.md) +Sets Datto SaaS Protection bulk seat changes + ### [Get-DattoShare](site/BCDR/Get-DattoShare.md) Gets Datto BCDR shares for a given device diff --git a/docs/Endpoints.csv b/docs/Endpoints.csv index 5bd62de..21a071a 100644 --- a/docs/Endpoints.csv +++ b/docs/Endpoints.csv @@ -25,7 +25,7 @@ Internal,,DELETE,Remove-DattoModuleSettings,YES, Internal,,GET,Test-DattoAPIKey,YES, Reporting,/report/activity-log,GET,Get-DattoActivityLog,YES, SaaS,/sass/{sassCustomerId}/applications,GET,Get-DattoApplication,YES, -SaaS,/saas/{saasCustomerId}/{externalSubscriptionId}/bulkSeatAssignment,GET,Get-DattoBulkSeatAssignment,YES,Cannot fully validate at this time +SaaS,/saas/{saasCustomerId}/{externalSubscriptionId}/bulkSeatAssignment,SET,Set-DattoBulkSeatChange,YES, SaaS,/sass/domains,GET,Get-DattoDomain,YES, SaaS,/sass/,GET,Get-DattoSaaS,YES,Special command that combines all SaaS endpoints SaaS,/sass/{sassCustomerId}/seats,GET,Get-DattoSeat,YES, diff --git a/docs/TrackingCSV.md b/docs/TrackingCSV.md index 80b1ceb..20a9096 100644 --- a/docs/TrackingCSV.md +++ b/docs/TrackingCSV.md @@ -17,35 +17,35 @@ I recommend downloading the CSV from the link provided rather then viewing the t ## CSV markdown table -|Category |EndpointUri |Method|Function |Complete|Notes | -|---------|------------------------------------------------------------------|------|---------------------------|--------|-----------------------------------------------------| -|BCDR |/bcdr/agent |GET |Get-DattoAgent |YES |As of 2022-04 this endpoint does not return any data.| -|BCDR |/bcdr/device/{serialNumber}/asset/agent |GET |Get-DattoAgent |YES | | -|BCDR |/bcdr/device/{serialNumber}/alert |GET |Get-DattoAlert |YES | | -|BCDR |/bcdr/device/{serialNumber}/asset |GET |Get-DattoAsset |YES | | -|BCDR |/bcdr/ |GET |Get-DattoBCDR |YES |Special command that combines all BCDR endpoints | -|BCDR |/bcdr/device |GET |Get-DattoDevice |YES | | -|BCDR |/bcdr/device/{serialNumber} |GET |Get-DattoDevice |YES | | -|BCDR |/bcdr/device/{serialNumber}/asset/share |GET |Get-DattoShare |YES | | -|BCDR |/bcdr/device/{serialNumber}/vm-restores |GET |Get-DattoVMRestore |Yes |Cannot fully validate at this time | -|BCDR |/bcdr/device/{serialNumber}/asset/{volumeName} |GET |Get-DattoVolume |YES | | -|Internal | |POST |Add-DattoAPIKey |YES | | -|Internal | |POST |Add-DattoBaseURI |YES | | -|Internal | |PUT |ConvertTo-DattoQueryString |YES | | -|Internal | |GET |Export-DattoModuleSettings |YES | | -|Internal | |GET |Get-DattoAPIKey |YES | | -|Internal | |GET |Get-DattoBaseURI |YES | | -|Internal | |GET |Get-DattoMetaData |YES | | -|Internal | |GET |Get-DattoModuleSettings |YES | | -|Internal | |GET |Import-DattoModuleSettings |YES | | -|Internal | |GET |Invoke-DattoRequest |YES | | -|Internal | |DELETE|Remove-DattoAPIKey |YES | | -|Internal | |DELETE|Remove-DattoBaseURI |YES | | -|Internal | |DELETE|Remove-DattoModuleSettings |YES | | -|Internal | |GET |Test-DattoAPIKey |YES | | -|Reporting|/report/activity-log |GET |Get-DattoActivityLog |YES | | -|SaaS |/sass/{sassCustomerId}/applications |GET |Get-DattoApplication |YES | | -|SaaS |/saas/{saasCustomerId}/{externalSubscriptionId}/bulkSeatAssignment|GET |Get-DattoBulkSeatAssignment|YES |Cannot fully validate at this time | -|SaaS |/sass/domains |GET |Get-DattoDomain |YES | | -|SaaS |/sass/ |GET |Get-DattoSaaS |YES |Special command that combines all SaaS endpoints | -|SaaS |/sass/{sassCustomerId}/seats |GET |Get-DattoSeat |YES | | +| Category | EndpointUri | Method | Function | Complete | Notes | +| --------- | ------------------------------------------------------------ | ------ | -------------------------- | -------- | ----------------------------------------------------- | +| BCDR | /bcdr/agent | GET | Get-DattoAgent | YES | As of 2022-04 this endpoint does not return any data. | +| BCDR | /bcdr/device/{serialNumber}/asset/agent | GET | Get-DattoAgent | YES | | +| BCDR | /bcdr/device/{serialNumber}/alert | GET | Get-DattoAlert | YES | | +| BCDR | /bcdr/device/{serialNumber}/asset | GET | Get-DattoAsset | YES | | +| BCDR | /bcdr/ | GET | Get-DattoBCDR | YES | Special command that combines all BCDR endpoints | +| BCDR | /bcdr/device | GET | Get-DattoDevice | YES | | +| BCDR | /bcdr/device/{serialNumber} | GET | Get-DattoDevice | YES | | +| BCDR | /bcdr/device/{serialNumber}/asset/share | GET | Get-DattoShare | YES | | +| BCDR | /bcdr/device/{serialNumber}/vm-restores | GET | Get-DattoVMRestore | Yes | Cannot fully validate at this time | +| BCDR | /bcdr/device/{serialNumber}/asset/{volumeName} | GET | Get-DattoVolume | YES | | +| Internal | | POST | Add-DattoAPIKey | YES | | +| Internal | | POST | Add-DattoBaseURI | YES | | +| Internal | | PUT | ConvertTo-DattoQueryString | YES | | +| Internal | | GET | Export-DattoModuleSettings | YES | | +| Internal | | GET | Get-DattoAPIKey | YES | | +| Internal | | GET | Get-DattoBaseURI | YES | | +| Internal | | GET | Get-DattoMetaData | YES | | +| Internal | | GET | Get-DattoModuleSettings | YES | | +| Internal | | GET | Import-DattoModuleSettings | YES | | +| Internal | | GET | Invoke-DattoRequest | YES | | +| Internal | | DELETE | Remove-DattoAPIKey | YES | | +| Internal | | DELETE | Remove-DattoBaseURI | YES | | +| Internal | | DELETE | Remove-DattoModuleSettings | YES | | +| Internal | | GET | Test-DattoAPIKey | YES | | +| Reporting | /report/activity-log | GET | Get-DattoActivityLog | YES | | +| SaaS | /sass/{sassCustomerId}/applications | GET | Get-DattoApplication | YES | | +| SaaS | /saas/{saasCustomerId}/{externalSubscriptionId}/bulkSeatAssignment | SET | Set-DattoBulkSeatChange | YES | | +| SaaS | /sass/domains | GET | Get-DattoDomain | YES | | +| SaaS | /sass/ | GET | Get-DattoSaaS | YES | Special command that combines all SaaS endpoints | +| SaaS | /sass/{sassCustomerId}/seats | GET | Get-DattoSeat | YES | | diff --git a/docs/en-US/DattoAPI-help.xml b/docs/en-US/DattoAPI-help.xml index e25d78e..b339d9f 100644 --- a/docs/en-US/DattoAPI-help.xml +++ b/docs/en-US/DattoAPI-help.xml @@ -3659,19 +3659,19 @@ - Get-DattoBulkSeatAssignment - Get - DattoBulkSeatAssignment + Set-DattoBulkSeatChange + Set + DattoBulkSeatChange - Get SaaS Protection bulk seats assignment + Set SaaS Protection bulk seats assignment - The Get-DattoBulkSeatAssignment cmdlet get SaaS Protection bulk seats assignment + The Set-DattoBulkSeatChange cmdlet sets SaaS Protection bulk seats assignment - Get-DattoBulkSeatAssignment + Set-DattoBulkSeatChange saasCustomerId @@ -3734,7 +3734,7 @@ -------------------------- EXAMPLE 1 -------------------------- - Get-DattoBulkSeatAssignment -saasCustomerId "12345678" -externalSubscriptionId 'ab23-bdf234-1234-asdf' + Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'ab23-bdf234-1234-asdf' Gets the Datto SaaS protection seats from the define customer id @@ -3742,8 +3742,8 @@ - https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html - https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html + https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html + https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html diff --git a/docs/index.md b/docs/index.md index 8d0f7a5..c05d1aa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -141,12 +141,12 @@ After install this module, you will need to configure both the *base URI* & *API - By default, Datto's `https://api.datto.com/v1` uri is used. - If you have your own API gateway or proxy, you may put in your own custom uri by specifying the `-base_uri` parameter: - `Add-DattoBaseURI -base_uri http://myapi.gateway.celerium.org` -
+
2. Run `Add-DattoAPIKey -Api_Key_Public 12345 -Api_Key_Secret 123456789` - It will prompt you to enter in your API access tokens if you do not specify them. - Datto API access tokens are generated via the Datto portal at *Admin > Integrations* -
+
3. [**optional**] Run `Export-DattoModuleSettings` - This will create a config file at `%UserProfile%\DattoAPI` that holds the *base uri* & *API access tokens* information. @@ -163,22 +163,22 @@ Calling an API resource is as simple as running `Get-Datto` - The following is a table of supported functions and their corresponding API resources: - Table entries with [ `-` ] indicate that the functionality is **NOT** supported by the Datto API at this time. -| Section | API Resource | Create | Read | Update | Delete | -|--------- | -------------- | --------- | ------------------------- | --------- | --------- | -| Reporting | ActivityLog | - | `Get-DattoActivityLog` | - | - | -| BCDR | Agent | - | `Get-DattoAgent` | - | - | -| BCDR | Alert | - | `Get-DattoAlert` | - | - | -| BCDR | Asset | - | `Get-DattoAsset` | - | - | -| BCDR | **BCDR** * | - | `Get-DattoBCDR` | - | - | -| BCDR | Device | - | `Get-DattoDevice` | - | - | -| BCDR | Share | - | `Get-DattoShare` | - | - | -| BCDR | VMRestore | - | `Get-DattoGet-DattoVMRestore` | - | - | -| BCDR | Volume | - | `Get-DattoVolume` | - | - | -| SaaS | **SaaS** * | - | `Get-DattoSaaS` | - | - | -| SaaS | Domains | - | `Get-DattoDomain` | - | - | -| SaaS | Seats | - | `Get-DattoSeat` | - | - | -| SaaS | Applications | - | `Get-DattoApplication` | - | - | -| SaaS | BulkSeatAssignment | - | `Get-DattoBulkSeatAssignment` | - | - | +| Section | API Resource | Create | Read | Update | Delete | +| --------- | ------------------ | ------ | ----------------------------- | ------------------------- | ------ | +| Reporting | ActivityLog | - | `Get-DattoActivityLog` | - | - | +| BCDR | Agent | - | `Get-DattoAgent` | - | - | +| BCDR | Alert | - | `Get-DattoAlert` | - | - | +| BCDR | Asset | - | `Get-DattoAsset` | - | - | +| BCDR | **BCDR** * | - | `Get-DattoBCDR` | - | - | +| BCDR | Device | - | `Get-DattoDevice` | - | - | +| BCDR | Share | - | `Get-DattoShare` | - | - | +| BCDR | VMRestore | - | `Get-DattoGet-DattoVMRestore` | - | - | +| BCDR | Volume | - | `Get-DattoVolume` | - | - | +| SaaS | **SaaS** * | - | `Get-DattoSaaS` | - | - | +| SaaS | Domains | - | `Get-DattoDomain` | - | - | +| SaaS | Seats | - | `Get-DattoSeat` | - | - | +| SaaS | Applications | - | `Get-DattoApplication` | - | - | +| SaaS | BulkSeatAssignment | - | - | `Set-DattoBulkSeatChange` | - | - :warning: `Get-DattoBCDR` & `Get-DattoSaaS` are special functions. - They are **NOT** endpoints in Datto's REST API and are a single set of commands the can run endpoints in their associate sections. diff --git a/docs/site/SaaS/Get-DattoBulkSeatAssignment.md b/docs/site/SaaS/Get-DattoBulkSeatAssignment.md deleted file mode 100644 index afe5db9..0000000 --- a/docs/site/SaaS/Get-DattoBulkSeatAssignment.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -external help file: DattoAPI-help.xml -grand_parent: SaaS -Module Name: DattoAPI -online version: https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html -parent: GET -schema: 2.0.0 -title: Get-DattoBulkSeatAssignment ---- - -# Get-DattoBulkSeatAssignment - -## SYNOPSIS -Get SaaS Protection bulk seats assignment - -## SYNTAX - -```powershell -Get-DattoBulkSeatAssignment -saasCustomerId -externalSubscriptionId [] -``` - -## DESCRIPTION -The Get-DattoBulkSeatAssignment cmdlet get SaaS Protection -bulk seats assignment - -## EXAMPLES - -### EXAMPLE 1 -```powershell -Get-DattoBulkSeatAssignment -saasCustomerId "12345678" -externalSubscriptionId 'ab23-bdf234-1234-asdf' -``` - -Gets the Datto SaaS protection seats from the define customer id - -## PARAMETERS - -### -saasCustomerId -Defines the id of the customer to get SaaS information from - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -externalSubscriptionId -Defines the external Subscription Id of the customer to -get SaaS bulk seat information from - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES -N\A - -## RELATED LINKS - -[https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html](https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Get-DattoBulkSeatAssignment.html) - diff --git a/docs/site/SaaS/Set-DattoBulkSeatChange.md b/docs/site/SaaS/Set-DattoBulkSeatChange.md new file mode 100644 index 0000000..5a3a732 --- /dev/null +++ b/docs/site/SaaS/Set-DattoBulkSeatChange.md @@ -0,0 +1,157 @@ +--- +external help file: DattoAPI-help.xml +grand_parent: SaaS +Module Name: DattoAPI +online version: https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html +parent: GET +schema: 2.0.0 +title: Set-DattoBulkSeatChange +--- + +# Set-DattoBulkSeatChange + +## SYNOPSIS +Sets Datto SaaS Protection bulk seat changes + +## SYNTAX + +```powershell +Set-DattoBulkSeatChange -saasCustomerId -externalSubscriptionId -seatType -remoteId -actionType [] +``` + +## DESCRIPTION +The `Set-DattoBulkSeatChange` cmdlet sets the Datto SaaS Protection bulk seat changes + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:Office365:123456' -seatType "User" -remoteId "ab23-bdf234-1234-asdf" -actionType "License" +``` + +Sets the Datto SaaS protection seats from the defined Office365 customer id + +### EXAMPLE 2 +```powershell +Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:GoogleApps:123456' -seatType "SharedDrive" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "Pause" +``` + +Sets the Datto SaaS protection seats from the defined Google customer id + +## PARAMETERS + +### -saasCustomerId +Defines the id of the Organization to set SaaS information from + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -externalSubscriptionId +Defines the external Subscription ID of the SaaS Protection Organization used to set SaaS bulk seat changes + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -seatType +Defines the seat type of the SaaS Protection SaaS bulk seat change + +:warning: Input is case-sensitive, begin with Capital, and use PascalCase when needed. + +e.g. +> Valid seat_type for O365: +> `User`, +> `SharedMailbox`, +> `Site`, +> `TeamSite`, +> `Team` +> +> Valid seat_type for Google: +> `User`, +> `SharedDrive` + + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -actionType +Defines the action type of the SaaS Protection bulk seat change + +:warning: Input is case-sensitive, begin with Capital, and use PascalCase when needed. + +e.g. +> Valid action_type: +> `License`, +> `Pause`, +> `Unlicense` + + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -remoteId +Defines the remote ID of the SaaS Protection Organization used to set SaaS bulk seat changes + +For Microsoft this is the Entra / Azure **Object ID** + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES +N\A + +## RELATED LINKS + +[https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html](https://celerium.github.io/Datto-PowerShellWrapper/site/SaaS/Set-DattoBulkSeatChange.html) + diff --git a/tests/Public/SaaS/Get-DattoBulkSeatAssignment.Tests.ps1 b/tests/Public/SaaS/Set-DattoBulkSeatChange.Tests.ps1 similarity index 100% rename from tests/Public/SaaS/Get-DattoBulkSeatAssignment.Tests.ps1 rename to tests/Public/SaaS/Set-DattoBulkSeatChange.Tests.ps1