Skip to content

Latest commit

 

History

History
627 lines (444 loc) · 21.8 KB

File metadata and controls

627 lines (444 loc) · 21.8 KB

PSAdGuardDNS.PSAdGuardDNS\Api.DevicesApi

All URIs are relative to https://api.adguard-dns.io

Method HTTP request Description
New-Device POST /oapi/v1/devices Creates a new device
Get-Device GET /oapi/v1/devices/{device_id} Gets an existing device by ID
Get-DoHMobileConfig GET /oapi/v1/devices/{device_id}/doh.mobileconfig Gets DNS-over-HTTPS .mobileconfig file.
Get-DoTMobileConfig GET /oapi/v1/devices/{device_id}/dot.mobileconfig Gets DNS-over-TLS .mobileconfig file.
Invoke-LinkDedicatedIPv4Address POST /oapi/v1/devices/{device_id}/dedicated_addresses/ipv4 Link dedicated IPv4 to the device
Invoke-ListDedicatedAddressesForDevice GET /oapi/v1/devices/{device_id}/dedicated_addresses List dedicated IPv4 and IPv6 addresses for a device
Invoke-ListDevices GET /oapi/v1/devices Lists devices
Remove-Device DELETE /oapi/v1/devices/{device_id} Removes a device
Reset-DOHPassword PUT /oapi/v1/devices/{device_id}/doh_password/reset Generate and set new DNS-over-HTTPS password
Invoke-UnlinkDedicatedIPv4Address DELETE /oapi/v1/devices/{device_id}/dedicated_addresses/ipv4 Unlink dedicated IPv4 from the device
Update-Device PUT /oapi/v1/devices/{device_id} Updates an existing device
Update-DeviceSettings PUT /oapi/v1/devices/{device_id}/settings Updates device settings

New-Device

Device New-Device
        [-DeviceCreate]

Creates a new device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceCreate = Initialize-DeviceCreate -DeviceType "WINDOWS" -DnsServerId "a9f29be1" -Name "My android" # DeviceCreate | 

# Creates a new device
try {
    $Result = New-Device -DeviceCreate $DeviceCreate
} catch {
    Write-Host ("Exception occurred when calling New-Device: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceCreate DeviceCreate

Return type

Device (PSCustomObject)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: application/json
  • Accept: /, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-Device

Device Get-Device
        [-DeviceId]

Gets an existing device by ID

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 

# Gets an existing device by ID
try {
    $Result = Get-Device -DeviceId $DeviceId
} catch {
    Write-Host ("Exception occurred when calling Get-Device: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String

Return type

Device (PSCustomObject)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-DoHMobileConfig

void Get-DoHMobileConfig
        [-DeviceId]
        [-ExcludeWifiNetworks] <String[]>
        [-ExcludeDomain] <String[]>

Gets DNS-over-HTTPS .mobileconfig file.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$ExcludeWifiNetworks = "MyExcludeWifiNetworks" # String[] | List Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabled (optional)
$ExcludeDomain = "MyExcludeDomain" # String[] | List domains that will use default DNS servers instead of AdGuard DNS (optional)

# Gets DNS-over-HTTPS .mobileconfig file.
try {
    $Result = Get-DoHMobileConfig -DeviceId $DeviceId -ExcludeWifiNetworks $ExcludeWifiNetworks -ExcludeDomain $ExcludeDomain
} catch {
    Write-Host ("Exception occurred when calling Get-DoHMobileConfig: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
ExcludeWifiNetworks String[] List Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabled [optional]
ExcludeDomain String[] List domains that will use default DNS servers instead of AdGuard DNS [optional]

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-DoTMobileConfig

void Get-DoTMobileConfig
        [-DeviceId]
        [-ExcludeWifiNetworks] <String[]>
        [-ExcludeDomain] <String[]>

Gets DNS-over-TLS .mobileconfig file.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$ExcludeWifiNetworks = "MyExcludeWifiNetworks" # String[] | List Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabled (optional)
$ExcludeDomain = "MyExcludeDomain" # String[] | List domains that will use default DNS servers instead of AdGuard DNS (optional)

# Gets DNS-over-TLS .mobileconfig file.
try {
    $Result = Get-DoTMobileConfig -DeviceId $DeviceId -ExcludeWifiNetworks $ExcludeWifiNetworks -ExcludeDomain $ExcludeDomain
} catch {
    Write-Host ("Exception occurred when calling Get-DoTMobileConfig: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
ExcludeWifiNetworks String[] List Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabled [optional]
ExcludeDomain String[] List domains that will use default DNS servers instead of AdGuard DNS [optional]

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-LinkDedicatedIPv4Address

void Invoke-LinkDedicatedIPv4Address
        [-DeviceId]
        [-LinkDedicatedIPv4]

Link dedicated IPv4 to the device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$LinkDedicatedIPv4 = Initialize-LinkDedicatedIPv4 -Ip "MyIp" # LinkDedicatedIPv4 | 

# Link dedicated IPv4 to the device
try {
    $Result = Invoke-LinkDedicatedIPv4Address -DeviceId $DeviceId -LinkDedicatedIPv4 $LinkDedicatedIPv4
} catch {
    Write-Host ("Exception occurred when calling Invoke-LinkDedicatedIPv4Address: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
LinkDedicatedIPv4 LinkDedicatedIPv4

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-ListDedicatedAddressesForDevice

DedicatedIps Invoke-ListDedicatedAddressesForDevice
        [-DeviceId]

List dedicated IPv4 and IPv6 addresses for a device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 

# List dedicated IPv4 and IPv6 addresses for a device
try {
    $Result = Invoke-ListDedicatedAddressesForDevice -DeviceId $DeviceId
} catch {
    Write-Host ("Exception occurred when calling Invoke-ListDedicatedAddressesForDevice: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String

Return type

DedicatedIps (PSCustomObject)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-ListDevices

Device[] Invoke-ListDevices

Lists devices

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"



# Lists devices
try {
    $Result = Invoke-ListDevices
} catch {
    Write-Host ("Exception occurred when calling Invoke-ListDevices: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

This endpoint does not need any parameter.

Return type

Device[] (PSCustomObject)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Remove-Device

void Remove-Device
        [-DeviceId]

Removes a device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 

# Removes a device
try {
    $Result = Remove-Device -DeviceId $DeviceId
} catch {
    Write-Host ("Exception occurred when calling Remove-Device: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Reset-DOHPassword

void Reset-DOHPassword
        [-DeviceId]

Generate and set new DNS-over-HTTPS password

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 

# Generate and set new DNS-over-HTTPS password
try {
    $Result = Reset-DOHPassword -DeviceId $DeviceId
} catch {
    Write-Host ("Exception occurred when calling Reset-DOHPassword: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-UnlinkDedicatedIPv4Address

void Invoke-UnlinkDedicatedIPv4Address
        [-DeviceId]
        [-Ip]

Unlink dedicated IPv4 from the device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$Ip = "MyIp" # String | Dedicated IPv4

# Unlink dedicated IPv4 from the device
try {
    $Result = Invoke-UnlinkDedicatedIPv4Address -DeviceId $DeviceId -Ip $Ip
} catch {
    Write-Host ("Exception occurred when calling Invoke-UnlinkDedicatedIPv4Address: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
Ip String Dedicated IPv4

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update-Device

void Update-Device
        [-DeviceId]
        [-DeviceUpdate]

Updates an existing device

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$DeviceUpdate = Initialize-DeviceUpdate -DeviceType "WINDOWS" -DnsServerId "a9f29be1" -Name "My android" # DeviceUpdate | 

# Updates an existing device
try {
    $Result = Update-Device -DeviceId $DeviceId -DeviceUpdate $DeviceUpdate
} catch {
    Write-Host ("Exception occurred when calling Update-Device: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
DeviceUpdate DeviceUpdate

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update-DeviceSettings

void Update-DeviceSettings
        [-DeviceId]
        [-DeviceSettingsUpdate]

Updates device settings

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: ApiKey
$Configuration.ApiKey.Authorization = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.Authorization = "Bearer"


$DeviceId = "MyDeviceId" # String | 
$DeviceSettingsUpdate = Initialize-DeviceSettingsUpdate -DetectDohAuthOnly $false -ProtectionEnabled $false # DeviceSettingsUpdate | 

# Updates device settings
try {
    $Result = Update-DeviceSettings -DeviceId $DeviceId -DeviceSettingsUpdate $DeviceSettingsUpdate
} catch {
    Write-Host ("Exception occurred when calling Update-DeviceSettings: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
DeviceId String
DeviceSettingsUpdate DeviceSettingsUpdate

Return type

void (empty response body)

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]