VMware Workspace ONE Community
SpefData
Contributor
Contributor

API for Internal/External Storage

Hi All,

With the implementation 2101 (https://docs.vmware.com/en/VMware-Workspace-ONE-UEM/2101/rn/Workspace-ONE-UEM-2101-Release-Notes.htm...) we now have the Internal and External storage displaying on Device Info Page.

While this is great it would be really good to be able to see this information with the API, I have looked through API Explorer and have been unable to find anything that retrieves this Internal/External storage value.

Does anyone Know if the is an API that is able to retrieve this? End goal would be sending enrolment user a notification when the device is nearing capacity.

Regards
Andrew.

Labels (1)
Reply
0 Kudos
1 Reply
i-nsert-co-in
Contributor
Contributor

Using Powershell:


 

Clear-Host

$deviceID = ""

$baseAPIurl = "https://as#.awmdm.com/api"

$credentials = Get-Credential -Credential "domain\"

$user = $credentials.GetNetworkCredential().Domain + "\" + $credentials.GetNetworkCredential().UserName
$pass = $credentials.GetNetworkCredential().Password
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user, $pass)))


$headerAuth = "Basic " + $base64AuthInfo + ""
$headerTenant = ""
$headerApplication = "application/json;version=3"

$headers =  @{ 
    'Authorization' = $headerAuth
    'aw-tenant-code' = $headerTenant
    'Accept' = $headerApplication
}

$deviceQueriedByID = Invoke-RestMethod -Method get -Uri "$baseAPIurl/mdm/devices/$deviceID" -Headers $headers | ConvertTo-Json
$Uuid = $deviceQueried | ConvertFrom-Json | Select Uuid

$UuidToQuery = $Uuid.Uuid
$deviceQueriedByUUID = Invoke-RestMethod -Method get -Uri "$baseAPIurl/mdm/devices/$UuidToQuery" -Headers $headers | ConvertTo-Json

$internalStorageUsage = $deviceQueriedByUUID | ConvertFrom-Json | Select total_storage_bytes, available_physical_memory_bytes
$internalStorageUsage

 

 

Reply
0 Kudos