/
computerInventory.go
558 lines (522 loc) · 29 KB
/
computerInventory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
package jamf
import (
"fmt"
"net/url"
"strconv"
"strings"
"time"
)
const uriComputerInventory = "/api/v1/computers-inventory"
const uriComputerInventoryDetail = "/api/v1/computers-inventory-detail"
type ComputerInventoriesResponse struct {
TotalCount int `json:"totalCount,omitempty"`
Results []ComputerInventory `json:"results,omitempty"`
}
type ComputerInventory struct {
ID string `json:"id,omitempty"`
Udid string `json:"udid,omitempty"`
General *ComputerInventoryDataSubsetGeneral `json:"general,omitempty"`
DiskEncryption *ComputerInventoryDataSubsetDiskEncryption `json:"diskEncryption,omitempty"`
Purchasing *ComputerInventoryDataSubsetPurchasing `json:"purchasing,omitempty"`
Applications *[]ComputerInventoryDataSubsetApplications `json:"applications,omitempty"`
Storage *ComputerInventoryDataSubsetStorage `json:"storage,omitempty"`
UserAndLocation *ComputerInventoryDataSubsetUserAndLocation `json:"userAndLocation,omitempty"`
ConfigurationProfiles *[]ComputerInventoryDataSubsetConfigurationProfiles `json:"configurationProfiles,omitempty"`
Printers *[]ComputerInventoryDataSubsetPrinters `json:"printers,omitempty"`
Services *[]ComputerInventoryDataSubsetServices `json:"services,omitempty"`
Hardware *ComputerInventoryDataSubsetHardware `json:"hardware,omitempty"`
LocalUserAccounts *[]ComputerInventoryDataSubsetLocalUserAccounts `json:"localUserAccounts,omitempty"`
Certificates *[]ComputerInventoryDataSubsetCertificates `json:"certificates,omitempty"`
Attachments *[]ComputerInventoryDataSubsetAttachments `json:"attachments,omitempty"`
Plugins *[]ComputerInventoryDataSubsetPlugins `json:"plugins,omitempty"`
PackageReceipts *ComputerInventoryDataSubsetPackageReceipts `json:"packageReceipts,omitempty"`
Fonts *[]ComputerInventoryDataSubsetFonts `json:"fonts,omitempty"`
Security *ComputerInventoryDataSubsetSecurity `json:"security,omitempty"`
OperatingSystem *ComputerInventoryDataSubsetOperatingSystem `json:"operatingSystem,omitempty"`
LicensedSoftware *[]ComputerInventoryDataSubsetLicensedSoftware `json:"licensedSoftware,omitempty"`
Ibeacons *[]ComputerInventoryDataSubsetIbeacons `json:"ibeacons,omitempty"`
SoftwareUpdates *[]ComputerInventoryDataSubsetSoftwareUpdates `json:"softwareUpdates,omitempty"`
ExtensionAttributes *[]ComputerInventoryDataSubsetExtensionAttributes `json:"extensionAttributes,omitempty"`
ContentCaching *ComputerInventoryDataSubsetContentCaching `json:"contentCaching,omitempty"`
GroupMemberships *[]ComputerInventoryDataSubsetGroupMemberships `json:"groupMemberships,omitempty"`
}
type ComputerInventoryDataSubsetGeneral struct {
Name string `json:"name,omitempty"`
LastIPAddress string `json:"lastIpAddress,omitempty"`
LastReportedIP string `json:"lastReportedIp,omitempty"`
JamfBinaryVersion string `json:"jamfBinaryVersion,omitempty"`
Platform string `json:"platform,omitempty"`
Barcode1 string `json:"barcode1,omitempty"`
Barcode2 string `json:"barcode2,omitempty"`
AssetTag string `json:"assetTag,omitempty"`
RemoteManagement struct {
Managed bool `json:"managed,omitempty"`
ManagementUsername string `json:"managementUsername,omitempty"`
} `json:"remoteManagement,omitempty"`
Supervised bool `json:"supervised,omitempty"`
MdmCapable struct {
Capable bool `json:"capable,omitempty"`
CapableUsers []string `json:"capableUsers,omitempty"`
} `json:"mdmCapable,omitempty"`
ReportDate time.Time `json:"reportDate,omitempty"`
LastContactTime time.Time `json:"lastContactTime,omitempty"`
LastCloudBackupDate time.Time `json:"lastCloudBackupDate,omitempty"`
LastEnrolledDate time.Time `json:"lastEnrolledDate,omitempty"`
MdmProfileExpiration time.Time `json:"mdmProfileExpiration,omitempty"`
InitialEntryDate string `json:"initialEntryDate,omitempty"`
DistributionPoint string `json:"distributionPoint,omitempty"`
EnrollmentMethod struct {
ID string `json:"id,omitempty"`
ObjectName string `json:"objectName,omitempty"`
ObjectType string `json:"objectType,omitempty"`
} `json:"enrollmentMethod,omitempty"`
Site struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
} `json:"site,omitempty"`
ItunesStoreAccountActive bool `json:"itunesStoreAccountActive,omitempty"`
EnrolledViaAutomatedDeviceEnrollment bool `json:"enrolledViaAutomatedDeviceEnrollment,omitempty"`
UserApprovedMdm bool `json:"userApprovedMdm,omitempty"`
ExtensionAttributes []struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
} `json:"extensionAttributes,omitempty"`
}
type ComputerInventoryDataSubsetDiskEncryption struct {
BootPartitionEncryptionDetails struct {
PartitionName string `json:"partitionName,omitempty"`
PartitionFileVault2State string `json:"partitionFileVault2State,omitempty"`
PartitionFileVault2Percent int `json:"partitionFileVault2Percent,omitempty"`
} `json:"bootPartitionEncryptionDetails,omitempty"`
IndividualRecoveryKeyValidityStatus string `json:"individualRecoveryKeyValidityStatus,omitempty"`
InstitutionalRecoveryKeyPresent bool `json:"institutionalRecoveryKeyPresent,omitempty"`
DiskEncryptionConfigurationName string `json:"diskEncryptionConfigurationName,omitempty"`
FileVault2EnabledUserNames []string `json:"fileVault2EnabledUserNames,omitempty"`
FileVault2EligibilityMessage string `json:"fileVault2EligibilityMessage,omitempty"`
}
type ComputerInventoryDataSubsetPurchasing struct {
Leased bool `json:"leased,omitempty"`
Purchased bool `json:"purchased,omitempty"`
PoNumber string `json:"poNumber,omitempty"`
PoDate string `json:"poDate,omitempty"`
Vendor string `json:"vendor,omitempty"`
WarrantyDate string `json:"warrantyDate,omitempty"`
AppleCareID string `json:"appleCareId,omitempty"`
LeaseDate string `json:"leaseDate,omitempty"`
PurchasePrice string `json:"purchasePrice,omitempty"`
LifeExpectancy int `json:"lifeExpectancy,omitempty"`
PurchasingAccount string `json:"purchasingAccount,omitempty"`
PurchasingContact string `json:"purchasingContact,omitempty"`
ExtensionAttributes []struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
} `json:"extensionAttributes,omitempty"`
}
type ComputerInventoryDataSubsetApplications struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
MacAppStore bool `json:"macAppStore,omitempty"`
SizeMegabytes int `json:"sizeMegabytes,omitempty"`
BundleID string `json:"bundleId,omitempty"`
UpdateAvailable bool `json:"updateAvailable,omitempty"`
ExternalVersionID string `json:"externalVersionId,omitempty"`
}
type ComputerInventoryDataSubsetStorage struct {
BootDriveAvailableSpaceMegabytes int `json:"bootDriveAvailableSpaceMegabytes,omitempty"`
Disks []struct {
ID string `json:"id,omitempty"`
Device string `json:"device,omitempty"`
Model string `json:"model,omitempty"`
Revision string `json:"revision,omitempty"`
SerialNumber string `json:"serialNumber,omitempty"`
SizeMegabytes int `json:"sizeMegabytes,omitempty"`
SmartStatus string `json:"smartStatus,omitempty"`
Type string `json:"type,omitempty"`
Partitions []struct {
Name string `json:"name,omitempty"`
SizeMegabytes int `json:"sizeMegabytes,omitempty"`
AvailableMegabytes int `json:"availableMegabytes,omitempty"`
PartitionType string `json:"partitionType,omitempty"`
PercentUsed int `json:"percentUsed,omitempty"`
FileVault2State string `json:"fileVault2State,omitempty"`
FileVault2ProgressPercent int `json:"fileVault2ProgressPercent,omitempty"`
LvmManaged bool `json:"lvmManaged,omitempty"`
} `json:"partitions,omitempty"`
} `json:"disks,omitempty"`
}
type ComputerInventoryDataSubsetUserAndLocation struct {
Username string `json:"username,omitempty"`
Realname string `json:"realname,omitempty"`
Email string `json:"email,omitempty"`
Position string `json:"position,omitempty"`
Phone string `json:"phone,omitempty"`
DepartmentID string `json:"departmentId,omitempty"`
BuildingID string `json:"buildingId,omitempty"`
Room string `json:"room,omitempty"`
ExtensionAttributes []struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
} `json:"extensionAttributes,omitempty"`
}
type ComputerInventoryDataSubsetConfigurationProfiles struct {
ID string `json:"id,omitempty"`
Username string `json:"username,omitempty"`
LastInstalled time.Time `json:"lastInstalled,omitempty"`
Removable bool `json:"removable,omitempty"`
DisplayName string `json:"displayName,omitempty"`
ProfileIdentifier string `json:"profileIdentifier,omitempty"`
}
type ComputerInventoryDataSubsetPrinters struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
URI string `json:"uri,omitempty"`
Location string `json:"location,omitempty"`
}
type ComputerInventoryDataSubsetServices struct {
Name string `json:"name,omitempty"`
}
type ComputerInventoryDataSubsetHardware struct {
Make string `json:"make,omitempty"`
Model string `json:"model,omitempty"`
ModelIdentifier string `json:"modelIdentifier,omitempty"`
SerialNumber string `json:"serialNumber,omitempty"`
ProcessorSpeedMhz int `json:"processorSpeedMhz,omitempty"`
ProcessorCount int `json:"processorCount,omitempty"`
CoreCount int `json:"coreCount,omitempty"`
ProcessorType string `json:"processorType,omitempty"`
ProcessorArchitecture string `json:"processorArchitecture,omitempty"`
BusSpeedMhz int `json:"busSpeedMhz,omitempty"`
CacheSizeKilobytes int `json:"cacheSizeKilobytes,omitempty"`
NetworkAdapterType string `json:"networkAdapterType,omitempty"`
MacAddress string `json:"macAddress,omitempty"`
AltNetworkAdapterType string `json:"altNetworkAdapterType,omitempty"`
AltMacAddress string `json:"altMacAddress,omitempty"`
TotalRAMMegabytes int `json:"totalRamMegabytes,omitempty"`
OpenRAMSlots int `json:"openRamSlots,omitempty"`
BatteryCapacityPercent int `json:"batteryCapacityPercent,omitempty"`
SmcVersion string `json:"smcVersion,omitempty"`
NicSpeed string `json:"nicSpeed,omitempty"`
OpticalDrive string `json:"opticalDrive,omitempty"`
BootRom string `json:"bootRom,omitempty"`
BleCapable bool `json:"bleCapable,omitempty"`
SupportsIosAppInstalls bool `json:"supportsIosAppInstalls,omitempty"`
AppleSilicon bool `json:"appleSilicon,omitempty"`
ExtensionAttributes []struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
} `json:"extensionAttributes,omitempty"`
}
type ComputerInventoryDataSubsetLocalUserAccounts struct {
UID string `json:"uid,omitempty"`
Username string `json:"username,omitempty"`
FullName string `json:"fullName,omitempty"`
Admin bool `json:"admin,omitempty"`
HomeDirectory string `json:"homeDirectory,omitempty"`
HomeDirectorySizeMb int `json:"homeDirectorySizeMb,omitempty"`
FileVault2Enabled bool `json:"fileVault2Enabled,omitempty"`
UserAccountType string `json:"userAccountType,omitempty"`
PasswordMinLength int `json:"passwordMinLength,omitempty"`
PasswordMaxAge int `json:"passwordMaxAge,omitempty"`
PasswordMinComplexCharacters int `json:"passwordMinComplexCharacters,omitempty"`
PasswordHistoryDepth int `json:"passwordHistoryDepth,omitempty"`
PasswordRequireAlphanumeric bool `json:"passwordRequireAlphanumeric,omitempty"`
ComputerAzureActiveDirectoryID string `json:"computerAzureActiveDirectoryId,omitempty"`
UserAzureActiveDirectoryID string `json:"userAzureActiveDirectoryId,omitempty"`
AzureActiveDirectoryID string `json:"azureActiveDirectoryId,omitempty"`
}
type ComputerInventoryDataSubsetCertificates struct {
CommonName string `json:"commonName,omitempty"`
Identity bool `json:"identity,omitempty"`
ExpirationDate time.Time `json:"expirationDate,omitempty"`
Username string `json:"username,omitempty"`
LifecycleStatus string `json:"lifecycleStatus,omitempty"`
CertificateStatus string `json:"certificateStatus,omitempty"`
}
type ComputerInventoryDataSubsetAttachments struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
FileType string `json:"fileType,omitempty"`
SizeBytes int `json:"sizeBytes,omitempty"`
}
type ComputerInventoryDataSubsetPlugins struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Path string `json:"path,omitempty"`
}
type ComputerInventoryDataSubsetPackageReceipts struct {
InstalledByJamfPro []string `json:"installedByJamfPro,omitempty"`
InstalledByInstallerSwu []string `json:"installedByInstallerSwu,omitempty"`
Cached []string `json:"cached,omitempty"`
}
type ComputerInventoryDataSubsetFonts struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Path string `json:"path,omitempty"`
}
type ComputerInventoryDataSubsetSecurity struct {
SipStatus string `json:"sipStatus,omitempty"`
GatekeeperStatus string `json:"gatekeeperStatus,omitempty"`
XprotectVersion string `json:"xprotectVersion,omitempty"`
AutoLoginDisabled bool `json:"autoLoginDisabled,omitempty"`
RemoteDesktopEnabled bool `json:"remoteDesktopEnabled,omitempty"`
ActivationLockEnabled bool `json:"activationLockEnabled,omitempty"`
RecoveryLockEnabled bool `json:"recoveryLockEnabled,omitempty"`
FirewallEnabled bool `json:"firewallEnabled,omitempty"`
SecureBootLevel string `json:"secureBootLevel,omitempty"`
ExternalBootLevel string `json:"externalBootLevel,omitempty"`
BootstrapTokenAllowed bool `json:"bootstrapTokenAllowed,omitempty"`
}
type ComputerInventoryDataSubsetOperatingSystem struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Build string `json:"build,omitempty"`
ActiveDirectoryStatus string `json:"activeDirectoryStatus,omitempty"`
FileVault2Status string `json:"fileVault2Status,omitempty"`
SoftwareUpdateDeviceID string `json:"softwareUpdateDeviceId,omitempty"`
ExtensionAttributes []struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
} `json:"extensionAttributes,omitempty"`
}
type ComputerInventoryDataSubsetLicensedSoftware struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
type ComputerInventoryDataSubsetIbeacons struct {
Name string `json:"name,omitempty"`
}
type ComputerInventoryDataSubsetSoftwareUpdates struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
PackageName string `json:"packageName,omitempty"`
}
type ComputerInventoryDataSubsetExtensionAttributes struct {
DefinitionID string `json:"definitionId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
MultiValue bool `json:"multiValue,omitempty"`
Values []string `json:"values,omitempty"`
DataType string `json:"dataType,omitempty"`
Options []string `json:"options,omitempty"`
InputType string `json:"inputType,omitempty"`
}
type ComputerInventoryDataSubsetContentCaching struct {
ComputerContentCachingInformationID string `json:"computerContentCachingInformationId,omitempty"`
Parents []struct {
ContentCachingParentID string `json:"contentCachingParentId,omitempty"`
Address string `json:"address,omitempty"`
Alerts struct {
ContentCachingParentAlertID string `json:"contentCachingParentAlertId,omitempty"`
Addresses []interface{} `json:"addresses,omitempty"`
ClassName string `json:"className,omitempty"`
PostDate time.Time `json:"postDate,omitempty"`
} `json:"alerts,omitempty"`
Details struct {
ContentCachingParentDetailsID string `json:"contentCachingParentDetailsId,omitempty"`
AcPower bool `json:"acPower,omitempty"`
CacheSizeBytes int `json:"cacheSizeBytes,omitempty"`
Capabilities struct {
ContentCachingParentCapabilitiesID string `json:"contentCachingParentCapabilitiesId,omitempty"`
Imports bool `json:"imports,omitempty"`
Namespaces bool `json:"namespaces,omitempty"`
PersonalContent bool `json:"personalContent,omitempty"`
QueryParameters bool `json:"queryParameters,omitempty"`
SharedContent bool `json:"sharedContent,omitempty"`
Prioritization bool `json:"prioritization,omitempty"`
} `json:"capabilities,omitempty"`
Portable bool `json:"portable,omitempty"`
LocalNetwork []struct {
ContentCachingParentLocalNetworkID string `json:"contentCachingParentLocalNetworkId,omitempty"`
Speed int `json:"speed,omitempty"`
Wired bool `json:"wired,omitempty"`
} `json:"localNetwork,omitempty"`
} `json:"details,omitempty"`
GUID string `json:"guid,omitempty"`
Healthy bool `json:"healthy,omitempty"`
Port int `json:"port,omitempty"`
Version string `json:"version,omitempty"`
} `json:"parents,omitempty"`
Alerts []struct {
CacheBytesLimit int `json:"cacheBytesLimit,omitempty"`
ClassName string `json:"className,omitempty"`
PathPreventingAccess string `json:"pathPreventingAccess,omitempty"`
PostDate time.Time `json:"postDate,omitempty"`
ReservedVolumeBytes int `json:"reservedVolumeBytes,omitempty"`
Resource string `json:"resource,omitempty"`
} `json:"alerts,omitempty"`
Activated bool `json:"activated,omitempty"`
Active bool `json:"active,omitempty"`
ActualCacheBytesUsed int `json:"actualCacheBytesUsed,omitempty"`
CacheDetails []struct {
ComputerContentCachingCacheDetailsID string `json:"computerContentCachingCacheDetailsId,omitempty"`
CategoryName string `json:"categoryName,omitempty"`
DiskSpaceBytesUsed int `json:"diskSpaceBytesUsed,omitempty"`
} `json:"cacheDetails,omitempty"`
CacheBytesFree int64 `json:"cacheBytesFree,omitempty"`
CacheBytesLimit int `json:"cacheBytesLimit,omitempty"`
CacheStatus string `json:"cacheStatus,omitempty"`
CacheBytesUsed int `json:"cacheBytesUsed,omitempty"`
DataMigrationCompleted bool `json:"dataMigrationCompleted,omitempty"`
DataMigrationProgressPercentage int `json:"dataMigrationProgressPercentage,omitempty"`
DataMigrationError struct {
Code int `json:"code,omitempty"`
Domain string `json:"domain,omitempty"`
UserInfo []struct {
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
} `json:"userInfo,omitempty"`
} `json:"dataMigrationError,omitempty"`
MaxCachePressureLast1HourPercentage int `json:"maxCachePressureLast1HourPercentage,omitempty"`
PersonalCacheBytesFree int64 `json:"personalCacheBytesFree,omitempty"`
PersonalCacheBytesLimit int `json:"personalCacheBytesLimit,omitempty"`
PersonalCacheBytesUsed int `json:"personalCacheBytesUsed,omitempty"`
Port int `json:"port,omitempty"`
PublicAddress string `json:"publicAddress,omitempty"`
RegistrationError string `json:"registrationError,omitempty"`
RegistrationResponseCode int `json:"registrationResponseCode,omitempty"`
RegistrationStarted time.Time `json:"registrationStarted,omitempty"`
RegistrationStatus string `json:"registrationStatus,omitempty"`
RestrictedMedia bool `json:"restrictedMedia,omitempty"`
ServerGUID string `json:"serverGuid,omitempty"`
StartupStatus string `json:"startupStatus,omitempty"`
TetheratorStatus string `json:"tetheratorStatus,omitempty"`
TotalBytesAreSince time.Time `json:"totalBytesAreSince,omitempty"`
TotalBytesDropped int `json:"totalBytesDropped,omitempty"`
TotalBytesImported int `json:"totalBytesImported,omitempty"`
TotalBytesReturnedToChildren int `json:"totalBytesReturnedToChildren,omitempty"`
TotalBytesReturnedToClients int `json:"totalBytesReturnedToClients,omitempty"`
TotalBytesReturnedToPeers int `json:"totalBytesReturnedToPeers,omitempty"`
TotalBytesStoredFromOrigin int `json:"totalBytesStoredFromOrigin,omitempty"`
TotalBytesStoredFromParents int `json:"totalBytesStoredFromParents,omitempty"`
TotalBytesStoredFromPeers int `json:"totalBytesStoredFromPeers,omitempty"`
}
type ComputerInventoryDataSubsetGroupMemberships struct {
GroupID string `json:"groupId,omitempty"`
GroupName string `json:"groupName,omitempty"`
SmartGroup bool `json:"smartGroup,omitempty"`
}
type ComputerInventoryDataSubsetName string
const (
ComputerInventoryDataSubsetNameGeneral ComputerInventoryDataSubsetName = "GENERAL"
ComputerInventoryDataSubsetNameLocation ComputerInventoryDataSubsetName = "DISK_ENCRYPTION"
ComputerInventoryDataSubsetNamePurchasing ComputerInventoryDataSubsetName = "PURCHASING"
ComputerInventoryDataSubsetNameApplications ComputerInventoryDataSubsetName = "APPLICATIONS"
ComputerInventoryDataSubsetNameStorage ComputerInventoryDataSubsetName = "STORAGE"
ComputerInventoryDataSubsetNameUserAndLocation ComputerInventoryDataSubsetName = "USER_AND_LOCATION"
ComputerInventoryDataSubsetNameConfigurationProfiles ComputerInventoryDataSubsetName = "CONFIGURATION_PROFILES"
ComputerInventoryDataSubsetNamePrinters ComputerInventoryDataSubsetName = "PRINTERS"
ComputerInventoryDataSubsetNameServices ComputerInventoryDataSubsetName = "SERVICES"
ComputerInventoryDataSubsetNameHardware ComputerInventoryDataSubsetName = "HARDWARE"
ComputerInventoryDataSubsetNameLocalUserAccounts ComputerInventoryDataSubsetName = "LOCAL_USER_ACCOUNTS"
ComputerInventoryDataSubsetNameCertificates ComputerInventoryDataSubsetName = "CERTIFICATES"
ComputerInventoryDataSubsetNameAttachments ComputerInventoryDataSubsetName = "ATTACHMENTS"
ComputerInventoryDataSubsetNamePlugins ComputerInventoryDataSubsetName = "PLUGINS"
ComputerInventoryDataSubsetNamePackageReceipts ComputerInventoryDataSubsetName = "PACKAGE_RECEIPTS"
ComputerInventoryDataSubsetNameFonts ComputerInventoryDataSubsetName = "FONTS"
ComputerInventoryDataSubsetNameSecurity ComputerInventoryDataSubsetName = "SECURITY"
ComputerInventoryDataSubsetNameOperatingSystem ComputerInventoryDataSubsetName = "OPERATING_SYSTEM"
ComputerInventoryDataSubsetNameLicensedSoftware ComputerInventoryDataSubsetName = "LICENSED_SOFTWARE"
ComputerInventoryDataSubsetNameIBeacons ComputerInventoryDataSubsetName = "IBEACONS"
ComputerInventoryDataSubsetNameSoftwareUpdates ComputerInventoryDataSubsetName = "SOFTWARE_UPDATES"
ComputerInventoryDataSubsetNameExtensionAttributes ComputerInventoryDataSubsetName = "EXTENSION_ATTRIBUTES"
ComputerInventoryDataSubsetNameContentCaching ComputerInventoryDataSubsetName = "CONTENT_CACHING"
ComputerInventoryDataSubsetNameGroupMemberships ComputerInventoryDataSubsetName = "GROUP_MEMBERSHIPS"
)
type ComputerInventoriesQuery struct {
Sections *[]ComputerInventoryDataSubsetName
Page int
PageSize int
Sort *[]string
Filter string
}
func (c *Client) GetComputerInventories(query *ComputerInventoriesQuery) (*ComputerInventoriesResponse, error) {
var out *ComputerInventoriesResponse
additionalHeaders := url.Values{}
if query != nil {
if query.Sections != nil {
for _, section := range *query.Sections {
additionalHeaders.Add("section", string(section))
}
}
if query.Page != 0 {
additionalHeaders.Add("page", strconv.Itoa(query.Page))
}
if query.PageSize != 0 {
additionalHeaders.Add("page-size", strconv.Itoa(query.PageSize))
}
if query.Sort != nil {
additionalHeaders.Add("sort", strings.Join(*query.Sort, ","))
}
if query.Filter != "" {
additionalHeaders.Add("filter", query.Filter)
}
}
err := c.DoRequest("GET", uriComputerInventory, nil, &additionalHeaders, &out)
return out, err
}
func (c *Client) GetComputerInventoryByID(id string, sections ...ComputerInventoryDataSubsetName) (*ComputerInventory, error) {
var out *ComputerInventory
uri := fmt.Sprintf("%s/%v", uriComputerInventoryDetail, id)
additionalHeaders := url.Values{}
for _, section := range sections {
additionalHeaders.Add("section", string(section))
}
err := c.DoRequest("GET", uri, nil, &additionalHeaders, &out)
return out, err
}
func (c *Client) DeleteComputerInventoryByID(id string) error {
var out *ComputerInventory
uri := fmt.Sprintf("%s/%v", uriComputerInventoryDetail, id)
additionalHeaders := url.Values{}
err := c.DoRequest("DELETE", uri, nil, &additionalHeaders, &out)
return err
}
func (c *Client) GetComputerInventoryDetailByID(id string) (*ComputerInventory, error) {
var out *ComputerInventory
uri := fmt.Sprintf("%s/%v", uriComputerInventoryDetail, id)
err := c.DoRequest("GET", uri, nil, nil, &out)
return out, err
}
func (c *Client) UpdateComputerInventoryDetailByID(id string, computer ComputerInventory) (*ComputerInventory, error) {
var out *ComputerInventory
uri := fmt.Sprintf("%s/%v", uriComputerInventoryDetail, id)
err := c.DoRequest("PATCH", uri, computer, nil, &out)
return out, err
}