From 788c7bbea29041fd57ae2e28283c9bc1d31fd7a0 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Mon, 15 Dec 2025 14:19:56 +0800 Subject: [PATCH 1/9] feat: SetLinkPreference API with timeout for WiFi port Signed-off-by: Cheah, Kit Hwa --- config/config.yml | 2 +- go.mod | 2 +- .../controller/httpapi/v1/devicemanagement.go | 4 ++ .../controller/httpapi/v1/linkpreference.go | 31 +++++++++ internal/entity/dto/v1/linkpreference.go | 64 +++++++++++++++++++ internal/usecase/devices/interfaces.go | 2 + internal/usecase/devices/linkpreference.go | 41 ++++++++++++ internal/usecase/devices/wsman/interfaces.go | 1 + internal/usecase/devices/wsman/message.go | 53 +++++++++++++++ 9 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 internal/controller/httpapi/v1/linkpreference.go create mode 100644 internal/entity/dto/v1/linkpreference.go create mode 100644 internal/usecase/devices/linkpreference.go diff --git a/config/config.yml b/config/config.yml index 12dc921e..a450acc6 100644 --- a/config/config.yml +++ b/config/config.yml @@ -2,7 +2,7 @@ app: name: console repo: device-management-toolkit/console version: DEVELOPMENT - encryption_key: "" + encryption_key: "base64encodedkey12345678901234567890123456789012" allow_insecure_ciphers: false http: host: localhost diff --git a/go.mod b/go.mod index 009e31be..c2b9b54e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/device-management-toolkit/console go 1.25 -// replace github.com/device-management-toolkit/go-wsman-messages/v2 => ../go-wsman-messages +replace github.com/device-management-toolkit/go-wsman-messages/v2 => ../go-wsman-messages require ( github.com/Masterminds/squirrel v1.5.4 diff --git a/internal/controller/httpapi/v1/devicemanagement.go b/internal/controller/httpapi/v1/devicemanagement.go index bd5f474b..87014f39 100644 --- a/internal/controller/httpapi/v1/devicemanagement.go +++ b/internal/controller/httpapi/v1/devicemanagement.go @@ -62,5 +62,9 @@ func NewAmtRoutes(handler *gin.RouterGroup, d devices.Feature, amt amtexplorer.F // KVM display settings h.GET("kvm/displays/:guid", r.getKVMDisplays) h.PUT("kvm/displays/:guid", r.setKVMDisplays) + + // Network link preference + h.POST("network/linkPreference/:guid", r.setLinkPreference) } } + diff --git a/internal/controller/httpapi/v1/linkpreference.go b/internal/controller/httpapi/v1/linkpreference.go new file mode 100644 index 00000000..5a9824e8 --- /dev/null +++ b/internal/controller/httpapi/v1/linkpreference.go @@ -0,0 +1,31 @@ +package v1 + +import ( + "net/http" + + "github.com/gin-gonic/gin" + + "github.com/device-management-toolkit/console/internal/entity/dto/v1" +) + +// setLinkPreference sets the link preference (ME or Host) on a device's WiFi port. +func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { + guid := c.Param("guid") + + var req dto.LinkPreferenceRequest + if err := c.ShouldBindJSON(&req); err != nil { + ErrorResponse(c, err) + + return + } + + response, err := r.d.SetLinkPreference(c.Request.Context(), guid, req) + if err != nil { + r.l.Error(err, "http - v1 - setLinkPreference") + ErrorResponse(c, err) + + return + } + + c.JSON(http.StatusOK, response) +} diff --git a/internal/entity/dto/v1/linkpreference.go b/internal/entity/dto/v1/linkpreference.go new file mode 100644 index 00000000..e9179f8f --- /dev/null +++ b/internal/entity/dto/v1/linkpreference.go @@ -0,0 +1,64 @@ +package dto + +// LinkPreferenceRequest represents the request to set link preference on a device. +type LinkPreferenceRequest struct { + LinkPreference int `json:"linkPreference" binding:"required,min=1,max=2"` // 1 for ME, 2 for HOST + Timeout int `json:"timeout" binding:"required,min=0"` // Timeout in seconds +} + +// LinkPreferenceResponse represents the response from setting link preference. +type LinkPreferenceResponse struct { + ReturnValue int `json:"returnValue"` + ReturnValueStr string `json:"returnValueStr"` +} + +// LinkPreference enumeration values +const ( + LinkPreferenceME = 1 // Management Engine + LinkPreferenceHost = 2 // Host +) + +// Return value constants for SetLinkPreference +const ( + ReturnValueSuccess = 0 + ReturnValueNotSupported = 1 + ReturnValueUnknownFailed = 2 + ReturnValueTimeout = 3 + ReturnValueFailed = 4 + ReturnValueInvalidParameter = 5 + ReturnValueInUse = 6 + ReturnValueTransitionStarted = 4096 + ReturnValueInvalidStateTransition = 4097 + ReturnValueTimeoutParameterNotSupport = 4098 + ReturnValueBusy = 4099 +) + +// GetReturnValueString returns a human-readable string for the return value. +func GetReturnValueString(returnValue int) string { + switch returnValue { + case ReturnValueSuccess: + return "SUCCESS" + case ReturnValueNotSupported: + return "NOT_SUPPORTED" + case ReturnValueUnknownFailed: + return "UNKNOWN_FAILED" + case ReturnValueTimeout: + return "TIMEOUT" + case ReturnValueFailed: + return "FAILED" + case ReturnValueInvalidParameter: + return "INVALID_PARAMETER" + case ReturnValueInUse: + return "IN_USE" + case ReturnValueTransitionStarted: + return "TRANSITION_STARTED" + case ReturnValueInvalidStateTransition: + return "INVALID_STATE_TRANSITION" + case ReturnValueTimeoutParameterNotSupport: + return "TIMEOUT_PARAMETER_NOT_SUPPORT" + case ReturnValueBusy: + return "BUSY" + default: + return "UNKNOWN" + } +} diff --git a/internal/usecase/devices/interfaces.go b/internal/usecase/devices/interfaces.go index c3441fd2..207df250 100644 --- a/internal/usecase/devices/interfaces.go +++ b/internal/usecase/devices/interfaces.go @@ -86,5 +86,7 @@ type ( // KVM Screen Settings (IPS_ScreenSettingData) GetKVMScreenSettings(c context.Context, guid string) (dto.KVMScreenSettings, error) SetKVMScreenSettings(c context.Context, guid string, req dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error) + // Link Preference (AMT_EthernetPortSettings) + SetLinkPreference(c context.Context, guid string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error) } ) diff --git a/internal/usecase/devices/linkpreference.go b/internal/usecase/devices/linkpreference.go new file mode 100644 index 00000000..2b4df3f1 --- /dev/null +++ b/internal/usecase/devices/linkpreference.go @@ -0,0 +1,41 @@ +package devices + +import ( + "context" + + dto "github.com/device-management-toolkit/console/internal/entity/dto/v1" +) + +// SetLinkPreference sets the link preference (ME or Host) on a device's WiFi port. +func (uc *UseCase) SetLinkPreference(c context.Context, guid string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error) { + item, err := uc.repo.GetByID(c, guid, "") + if err != nil { + return dto.LinkPreferenceResponse{}, err + } + + if item == nil || item.GUID == "" { + return dto.LinkPreferenceResponse{}, ErrNotFound + } + + // Validate link preference value + if req.LinkPreference != dto.LinkPreferenceME && req.LinkPreference != dto.LinkPreferenceHost { + return dto.LinkPreferenceResponse{}, ErrValidationUseCase.Wrap("SetLinkPreference", "validate link preference", "linkPreference must be 1 (ME) or 2 (Host)") + } + + // Validate timeout + if req.Timeout < 0 { + return dto.LinkPreferenceResponse{}, ErrValidationUseCase.Wrap("SetLinkPreference", "validate timeout", "timeout must be non-negative") + } + + device, _ := uc.device.SetupWsmanClient(*item, false, true) + + returnValue, err := device.SetLinkPreference(req.LinkPreference, req.Timeout) + if err != nil { + return dto.LinkPreferenceResponse{}, err + } + + return dto.LinkPreferenceResponse{ + ReturnValue: returnValue, + ReturnValueStr: dto.GetReturnValueString(returnValue), + }, nil +} diff --git a/internal/usecase/devices/wsman/interfaces.go b/internal/usecase/devices/wsman/interfaces.go index cf345a66..35295a01 100644 --- a/internal/usecase/devices/wsman/interfaces.go +++ b/internal/usecase/devices/wsman/interfaces.go @@ -71,4 +71,5 @@ type Management interface { GetIPSKVMRedirectionSettingData() (kvmredirection.Response, error) SetIPSKVMRedirectionSettingData(data *kvmredirection.KVMRedirectionSettingsRequest) (kvmredirection.Response, error) DeleteCertificate(instanceID string) error + SetLinkPreference(linkPreference, timeout int) (int, error) } diff --git a/internal/usecase/devices/wsman/message.go b/internal/usecase/devices/wsman/message.go index b104bfc3..63a36369 100644 --- a/internal/usecase/devices/wsman/message.go +++ b/internal/usecase/devices/wsman/message.go @@ -81,8 +81,20 @@ var ( // ErrCIRADeviceNotConnected is returned when a CIRA device is not connected or not found. ErrCIRADeviceNotConnected = errors.New("CIRA device not connected/not found") + // ErrWsmanMessage is used for wrapping wsman message errors. + ErrWsmanMessage = &wsmanError{} ) +type wsmanError struct{} + +func (e *wsmanError) Error() string { + return "wsman message error" +} + +func (e *wsmanError) Wrap(operation, context, message string) error { + return errors.New(operation + ": " + context + ": " + message) +} + type ConnectionEntry struct { WsmanMessages wsman.Messages IsCIRA bool @@ -1917,3 +1929,44 @@ func (c *ConnectionEntry) GetIPSKVMRedirectionSettingData() (kvmredirection.Resp func (c *ConnectionEntry) SetIPSKVMRedirectionSettingData(req *kvmredirection.KVMRedirectionSettingsRequest) (kvmredirection.Response, error) { return c.WsmanMessages.IPS.KVMRedirectionSettingData.Put(req) } + +// SetLinkPreference sets the link preference (ME or Host) on the WiFi port. +// linkPreference: 1 for ME, 2 for Host +// timeout: timeout in seconds +// Returns the return value from the AMT device or an error. +func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout int) (int, error) { + // Get all ethernet port settings to find WiFi port + enumResponse, err := c.WsmanMessages.AMT.EthernetPortSettings.Enumerate() + if err != nil { + return -1, err + } + + pullResponse, err := c.WsmanMessages.AMT.EthernetPortSettings.Pull(enumResponse.Body.EnumerateResponse.EnumerationContext) + if err != nil { + return -1, err + } + + // Find WiFi port (PhysicalConnectionType = 3) + var wifiInstanceID string + + for i := range pullResponse.Body.PullResponse.EthernetPortItems { + port := &pullResponse.Body.PullResponse.EthernetPortItems[i] + // PhysicalConnectionType: 3 = Wireless LAN + if port.PhysicalConnectionType == 3 { + wifiInstanceID = port.InstanceID + break + } + } + + if wifiInstanceID == "" { + return -1, ErrWsmanMessage.Wrap("SetLinkPreference", "find WiFi port", "no WiFi port found (PhysicalConnectionType=3)") + } + + // Call SetLinkPreference on the WiFi port + response, err := c.WsmanMessages.AMT.EthernetPortSettings.SetLinkPreference(linkPreference, timeout, wifiInstanceID) + if err != nil { + return -1, err + } + + return response.Body.SetLinkPreferenceResponse.ReturnValue, nil +} From 79ef8559c0484466ad780aabf05718669aedacc0 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Tue, 16 Dec 2025 13:02:04 +0800 Subject: [PATCH 2/9] fix: http status codes for setLinkPreference cases Signed-off-by: Cheah, Kit Hwa --- internal/controller/httpapi/v1/linkpreference.go | 16 +++++++++++++++- internal/usecase/devices/wsman/message.go | 4 +++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/internal/controller/httpapi/v1/linkpreference.go b/internal/controller/httpapi/v1/linkpreference.go index 5a9824e8..15f131ec 100644 --- a/internal/controller/httpapi/v1/linkpreference.go +++ b/internal/controller/httpapi/v1/linkpreference.go @@ -1,11 +1,13 @@ package v1 import ( + "errors" "net/http" "github.com/gin-gonic/gin" "github.com/device-management-toolkit/console/internal/entity/dto/v1" + "github.com/device-management-toolkit/console/internal/usecase/devices/wsman" ) // setLinkPreference sets the link preference (ME or Host) on a device's WiFi port. @@ -22,10 +24,22 @@ func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { response, err := r.d.SetLinkPreference(c.Request.Context(), guid, req) if err != nil { r.l.Error(err, "http - v1 - setLinkPreference") + // Map specific errors to HTTP status codes (matching MPS implementation) + if errors.Is(err, wsman.ErrNoWiFiPort) { + c.JSON(http.StatusNotFound, gin.H{"error": err.Error()}) + return + } ErrorResponse(c, err) return } - c.JSON(http.StatusOK, response) + // Map AMT return value to HTTP status code (matching MPS implementation) + // MPS logic: null -> 404, -1 or non-zero -> 400, 0 -> 200 + httpStatus := http.StatusOK + if response.ReturnValue == -1 || response.ReturnValue != 0 { + httpStatus = http.StatusBadRequest + } + + c.JSON(httpStatus, response) } diff --git a/internal/usecase/devices/wsman/message.go b/internal/usecase/devices/wsman/message.go index 63a36369..e13f5704 100644 --- a/internal/usecase/devices/wsman/message.go +++ b/internal/usecase/devices/wsman/message.go @@ -83,6 +83,8 @@ var ( ErrCIRADeviceNotConnected = errors.New("CIRA device not connected/not found") // ErrWsmanMessage is used for wrapping wsman message errors. ErrWsmanMessage = &wsmanError{} + // ErrNoWiFiPort is returned when no WiFi port is found on the device. + ErrNoWiFiPort = errors.New("no WiFi port found (PhysicalConnectionType=3)") ) type wsmanError struct{} @@ -1959,7 +1961,7 @@ func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout int) (int, e } if wifiInstanceID == "" { - return -1, ErrWsmanMessage.Wrap("SetLinkPreference", "find WiFi port", "no WiFi port found (PhysicalConnectionType=3)") + return -1, ErrNoWiFiPort } // Call SetLinkPreference on the WiFi port From bfb00c0b1743b2565bd4993cfac1922aad1f3ea5 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Wed, 17 Dec 2025 01:09:03 +0800 Subject: [PATCH 3/9] fix: clean up returnValues and error status Signed-off-by: Cheah, Kit Hwa --- .../controller/httpapi/v1/linkpreference.go | 24 +++++---- internal/entity/dto/v1/linkpreference.go | 49 ++----------------- internal/usecase/devices/linkpreference.go | 7 +-- 3 files changed, 20 insertions(+), 60 deletions(-) diff --git a/internal/controller/httpapi/v1/linkpreference.go b/internal/controller/httpapi/v1/linkpreference.go index 15f131ec..23605ca0 100644 --- a/internal/controller/httpapi/v1/linkpreference.go +++ b/internal/controller/httpapi/v1/linkpreference.go @@ -22,24 +22,30 @@ func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { } response, err := r.d.SetLinkPreference(c.Request.Context(), guid, req) + if err != nil { r.l.Error(err, "http - v1 - setLinkPreference") - // Map specific errors to HTTP status codes (matching MPS implementation) + // Handle no WiFi port error with 404 and error message if errors.Is(err, wsman.ErrNoWiFiPort) { - c.JSON(http.StatusNotFound, gin.H{"error": err.Error()}) + c.JSON(http.StatusNotFound, gin.H{ + "error": "Set Link Preference failed: No WiFi port found for guid : " + guid + ".", + }) return } + // For other errors (device not found, validation, etc.), use standard error response ErrorResponse(c, err) - return } - // Map AMT return value to HTTP status code (matching MPS implementation) - // MPS logic: null -> 404, -1 or non-zero -> 400, 0 -> 200 - httpStatus := http.StatusOK - if response.ReturnValue == -1 || response.ReturnValue != 0 { - httpStatus = http.StatusBadRequest + // Map AMT return value to HTTP status code + // Non-zero return value -> 400 Bad Request with error message + // 0 -> 200 OK with success response + if response.ReturnValue != 0 { + c.JSON(http.StatusBadRequest, gin.H{ + "error": "Set Link Preference failed for guid : " + guid + ".", + }) + return } - c.JSON(httpStatus, response) + c.JSON(http.StatusOK, response) } diff --git a/internal/entity/dto/v1/linkpreference.go b/internal/entity/dto/v1/linkpreference.go index e9179f8f..7a99bf2c 100644 --- a/internal/entity/dto/v1/linkpreference.go +++ b/internal/entity/dto/v1/linkpreference.go @@ -8,8 +8,7 @@ type LinkPreferenceRequest struct { // LinkPreferenceResponse represents the response from setting link preference. type LinkPreferenceResponse struct { - ReturnValue int `json:"returnValue"` - ReturnValueStr string `json:"returnValueStr"` + ReturnValue int `json:"returnValue" example:"0"` // Return code. 0 indicates success } // LinkPreference enumeration values @@ -18,47 +17,5 @@ const ( LinkPreferenceHost = 2 // Host ) -// Return value constants for SetLinkPreference -const ( - ReturnValueSuccess = 0 - ReturnValueNotSupported = 1 - ReturnValueUnknownFailed = 2 - ReturnValueTimeout = 3 - ReturnValueFailed = 4 - ReturnValueInvalidParameter = 5 - ReturnValueInUse = 6 - ReturnValueTransitionStarted = 4096 - ReturnValueInvalidStateTransition = 4097 - ReturnValueTimeoutParameterNotSupport = 4098 - ReturnValueBusy = 4099 -) - -// GetReturnValueString returns a human-readable string for the return value. -func GetReturnValueString(returnValue int) string { - switch returnValue { - case ReturnValueSuccess: - return "SUCCESS" - case ReturnValueNotSupported: - return "NOT_SUPPORTED" - case ReturnValueUnknownFailed: - return "UNKNOWN_FAILED" - case ReturnValueTimeout: - return "TIMEOUT" - case ReturnValueFailed: - return "FAILED" - case ReturnValueInvalidParameter: - return "INVALID_PARAMETER" - case ReturnValueInUse: - return "IN_USE" - case ReturnValueTransitionStarted: - return "TRANSITION_STARTED" - case ReturnValueInvalidStateTransition: - return "INVALID_STATE_TRANSITION" - case ReturnValueTimeoutParameterNotSupport: - return "TIMEOUT_PARAMETER_NOT_SUPPORT" - case ReturnValueBusy: - return "BUSY" - default: - return "UNKNOWN" - } -} +// Console-specific return value for no WiFi port found +const ReturnValueNoWiFiPort = -1 diff --git a/internal/usecase/devices/linkpreference.go b/internal/usecase/devices/linkpreference.go index 2b4df3f1..54a22fb7 100644 --- a/internal/usecase/devices/linkpreference.go +++ b/internal/usecase/devices/linkpreference.go @@ -31,11 +31,8 @@ func (uc *UseCase) SetLinkPreference(c context.Context, guid string, req dto.Lin returnValue, err := device.SetLinkPreference(req.LinkPreference, req.Timeout) if err != nil { - return dto.LinkPreferenceResponse{}, err + return dto.LinkPreferenceResponse{ReturnValue: returnValue}, err } - return dto.LinkPreferenceResponse{ - ReturnValue: returnValue, - ReturnValueStr: dto.GetReturnValueString(returnValue), - }, nil + return dto.LinkPreferenceResponse{ReturnValue: returnValue}, nil } From 8dbd392851e94842f29d0dfe189ba9c5c8c4f309 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Wed, 17 Dec 2025 01:53:04 +0800 Subject: [PATCH 4/9] test: add unit tests for setLinkPreference Signed-off-by: Cheah, Kit Hwa --- cmd/app/doc/openapi.json | 7837 +++++++++++++++++ internal/mocks/wsman_mocks.go | 15 + .../usecase/devices/linkpreference_test.go | 192 + 3 files changed, 8044 insertions(+) create mode 100644 cmd/app/doc/openapi.json create mode 100644 internal/usecase/devices/linkpreference_test.go diff --git a/cmd/app/doc/openapi.json b/cmd/app/doc/openapi.json new file mode 100644 index 00000000..f7b1c425 --- /dev/null +++ b/cmd/app/doc/openapi.json @@ -0,0 +1,7837 @@ +{ + "components": { + "schemas": { + "AddAlarmOutput": { + "description": "AddAlarmOutput schema", + "properties": { + "ReturnValue": { + "example": 0, + "type": "integer" + } + }, + "type": "object" + }, + "AlarmClockOccurrence": { + "description": "AlarmClockOccurrence schema", + "properties": { + "DeleteOnCompletion": { + "example": true, + "type": "boolean" + }, + "ElementName": { + "example": "test", + "type": "string" + }, + "InstanceID": { + "example": "test", + "type": "string" + }, + "Interval": { + "example": 1, + "type": "integer" + }, + "IntervalInMinutes": { + "example": 1, + "type": "integer" + }, + "StartTime": { + "properties": { + "Datetime": { + "example": "2024-01-01T00:00:00Z", + "format": "date-time", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "AlarmClockOccurrenceInput": { + "description": "AlarmClockOccurrenceInput schema", + "properties": { + "DeleteOnCompletion": { + "example": true, + "type": "boolean" + }, + "ElementName": { + "example": "test", + "type": "string" + }, + "InstanceID": { + "example": "test", + "type": "string" + }, + "Interval": { + "example": 1, + "type": "integer" + }, + "StartTime": { + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "AuditLog": { + "description": "AuditLog schema", + "properties": { + "records": { + "items": { + "properties": { + "AuditApp": { + "example": "Security Admin", + "type": "string" + }, + "AuditAppId": { + "example": 0, + "type": "integer" + }, + "Event": { + "example": "Provisioning Started", + "type": "string" + }, + "EventId": { + "example": 0, + "type": "integer" + }, + "Ex": { + "example": "", + "type": "string" + }, + "ExStr": { + "example": "Remote WSAMN", + "type": "string" + }, + "Initiator": { + "example": "Local", + "type": "string" + }, + "InitiatorType": { + "example": 0, + "maximum": 255, + "minimum": 0, + "type": "integer" + }, + "MCLocationType": { + "example": 0, + "maximum": 255, + "minimum": 0, + "type": "integer" + }, + "NetAddress": { + "example": "127.0.0.1", + "type": "string" + }, + "Time": { + "example": "2023-04-19T20:38:20.000Z", + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCnt": { + "example": 0, + "type": "integer" + } + }, + "type": "object" + }, + "BootSetting": { + "description": "BootSetting schema", + "properties": { + "action": { + "example": 8, + "type": "integer" + }, + "bootDetails": { + "properties": { + "bootPath": { + "example": "\\OemPba.efi", + "type": "string" + }, + "enforceSecureBoot": { + "example": true, + "type": "boolean" + }, + "password": { + "example": "password", + "type": "string" + }, + "url": { + "example": "https://", + "type": "string" + }, + "username": { + "example": "admin", + "type": "string" + } + }, + "type": "object" + }, + "useSOL": { + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "BootSources": { + "description": "BootSources schema", + "properties": { + "biosBootString": { + "example": "string", + "type": "string" + }, + "bootString": { + "example": "string", + "type": "string" + }, + "elementName": { + "example": "IntelĀ® AMT: Boot Source", + "type": "string" + }, + "failThroughSupported": { + "example": 2, + "type": "integer" + }, + "instanceID": { + "example": "IntelĀ® AMT: Force Hard-drive Boot", + "type": "string" + }, + "structuredBiosBootString": { + "example": "CIM:Hard-Disk:1", + "type": "string" + } + }, + "type": "object" + }, + "CIRAConfig": { + "description": "CIRAConfig schema", + "properties": { + "authMethod": { + "example": 2, + "type": "integer" + }, + "commonName": { + "example": "example.com", + "type": "string" + }, + "configName": { + "example": "My CIRA Config", + "type": "string" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "mpsPort": { + "example": 4433, + "type": "integer" + }, + "mpsRootCertificate": { + "example": "-----BEGIN CERTIFICATE-----\n...", + "type": "string" + }, + "mpsServerAddress": { + "example": "https://example.com", + "type": "string" + }, + "password": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "proxyDetails": { + "example": "http://example.com", + "type": "string" + }, + "serverAddressFormat": { + "example": 201, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "username": { + "example": "my_username", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "CIRAConfigCountResponse": { + "description": "CIRAConfigCountResponse schema", + "properties": { + "data": { + "items": { + "properties": { + "authMethod": { + "example": 2, + "type": "integer" + }, + "commonName": { + "example": "example.com", + "type": "string" + }, + "configName": { + "example": "My CIRA Config", + "type": "string" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "mpsPort": { + "example": 4433, + "type": "integer" + }, + "mpsRootCertificate": { + "example": "-----BEGIN CERTIFICATE-----\n...", + "type": "string" + }, + "mpsServerAddress": { + "example": "https://example.com", + "type": "string" + }, + "password": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "proxyDetails": { + "example": "http://example.com", + "type": "string" + }, + "serverAddressFormat": { + "example": 201, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "username": { + "example": "my_username", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "CertInfo": { + "description": "CertInfo schema", + "properties": { + "cert": { + "example": "-----BEGIN CERTIFICATE-----\n...", + "type": "string" + }, + "isTrusted": { + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "Certificate": { + "description": "Certificate schema", + "properties": { + "commonName": { + "type": "string" + }, + "dnsNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "guid": { + "type": "string" + }, + "issuerName": { + "type": "string" + }, + "notAfter": { + "format": "date-time", + "type": "string" + }, + "notBefore": { + "format": "date-time", + "type": "string" + }, + "publicKeyAlgorithm": { + "type": "string" + }, + "publicKeySize": { + "type": "integer" + }, + "serialNumber": { + "type": "string" + }, + "sha1Fingerprint": { + "type": "string" + }, + "sha256Fingerprint": { + "type": "string" + } + }, + "type": "object" + }, + "DeleteAlarmOccurrenceRequest": { + "description": "DeleteAlarmOccurrenceRequest schema", + "properties": { + "Name": { + "example": "test", + "type": "string" + } + }, + "type": "object" + }, + "DeleteCertificateRequest": { + "description": "DeleteCertificateRequest schema", + "properties": { + "instanceID": { + "example": "cert-instance-123", + "type": "string" + } + }, + "type": "object" + }, + "Device": { + "description": "Device schema", + "properties": { + "allowSelfSigned": { + "type": "boolean" + }, + "certHash": { + "type": "string" + }, + "connectionStatus": { + "type": "boolean" + }, + "deviceInfo": { + "nullable": true, + "properties": { + "currentMode": { + "type": "string" + }, + "features": { + "type": "string" + }, + "fwBuild": { + "type": "string" + }, + "fwSku": { + "type": "string" + }, + "fwVersion": { + "type": "string" + }, + "ipAddress": { + "type": "string" + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "dnsSuffix": { + "type": "string" + }, + "friendlyName": { + "type": "string" + }, + "guid": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "lastConnected": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "lastDisconnected": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "lastSeen": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "mebxpassword": { + "type": "string" + }, + "mpsInstance": { + "type": "string" + }, + "mpspassword": { + "type": "string" + }, + "mpsusername": { + "type": "string" + }, + "password": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tenantId": { + "type": "string" + }, + "useTLS": { + "type": "boolean" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "DeviceCountResponse": { + "description": "DeviceCountResponse schema", + "properties": { + "data": { + "items": { + "properties": { + "allowSelfSigned": { + "type": "boolean" + }, + "certHash": { + "type": "string" + }, + "connectionStatus": { + "type": "boolean" + }, + "deviceInfo": { + "nullable": true, + "properties": { + "currentMode": { + "type": "string" + }, + "features": { + "type": "string" + }, + "fwBuild": { + "type": "string" + }, + "fwSku": { + "type": "string" + }, + "fwVersion": { + "type": "string" + }, + "ipAddress": { + "type": "string" + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "dnsSuffix": { + "type": "string" + }, + "friendlyName": { + "type": "string" + }, + "guid": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "lastConnected": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "lastDisconnected": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "lastSeen": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "mebxpassword": { + "type": "string" + }, + "mpsInstance": { + "type": "string" + }, + "mpspassword": { + "type": "string" + }, + "mpsusername": { + "type": "string" + }, + "password": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tenantId": { + "type": "string" + }, + "useTLS": { + "type": "boolean" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "DeviceStatResponse": { + "description": "DeviceStatResponse schema", + "properties": { + "connectedCount": { + "type": "integer" + }, + "disconnectedCount": { + "type": "integer" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "DiskInfo": { + "description": "DiskInfo schema", + "properties": { + "CIM_MediaAccessDevice": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_PhysicalPackage": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "EventLogs": { + "description": "EventLogs schema", + "properties": { + "hasMoreRecords": { + "type": "boolean" + }, + "records": { + "items": { + "properties": { + "Desc": { + "type": "string" + }, + "DeviceAddress": { + "type": "integer" + }, + "Entity": { + "type": "string" + }, + "EntityInstance": { + "type": "integer" + }, + "EntityStr": { + "type": "string" + }, + "EventData": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "EventOffset": { + "type": "integer" + }, + "EventSensorType": { + "type": "integer" + }, + "EventSeverity": { + "type": "string" + }, + "EventSourceType": { + "type": "integer" + }, + "EventType": { + "type": "integer" + }, + "SensorNumber": { + "type": "integer" + }, + "Time": { + "type": "string" + }, + "eventTypeDesc": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "Features": { + "description": "Features schema", + "properties": { + "enableIDER": { + "example": true, + "type": "boolean" + }, + "enableKVM": { + "example": true, + "type": "boolean" + }, + "enableSOL": { + "example": true, + "type": "boolean" + }, + "httpsBootSupported": { + "example": true, + "type": "boolean" + }, + "kvmAvailable": { + "example": true, + "type": "boolean" + }, + "localPBABootSupported": { + "example": true, + "type": "boolean" + }, + "ocr": { + "example": true, + "type": "boolean" + }, + "optInState": { + "example": 0, + "type": "integer" + }, + "redirection": { + "example": true, + "type": "boolean" + }, + "remoteErase": { + "example": true, + "type": "boolean" + }, + "userConsent": { + "example": "kvm", + "type": "string" + }, + "winREBootSupported": { + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "GeneralSettings": { + "description": "GeneralSettings schema", + "properties": { + "body": { + "nullable": true + }, + "header": { + "nullable": true + } + }, + "type": "object" + }, + "HTTPError": { + "description": "HTTPError schema", + "properties": { + "detail": { + "description": "Human readable error message", + "nullable": true, + "type": "string" + }, + "errors": { + "items": { + "nullable": true, + "properties": { + "more": { + "additionalProperties": { + "description": "Additional information about the error", + "nullable": true + }, + "description": "Additional information about the error", + "nullable": true, + "type": "object" + }, + "name": { + "description": "For example, name of the parameter that caused the error", + "type": "string" + }, + "reason": { + "description": "Human readable error message", + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + }, + "instance": { + "nullable": true, + "type": "string" + }, + "status": { + "description": "HTTP status code", + "example": 403, + "nullable": true, + "type": "integer" + }, + "title": { + "description": "Short title of the error", + "nullable": true, + "type": "string" + }, + "type": { + "description": "URL of the error type. Can be used to lookup the error in a documentation", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "HardwareInfo": { + "description": "HardwareInfo schema", + "properties": { + "CIM_BIOSElement": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_Card": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_Chassis": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_Chip": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_ComputerSystemPackage": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_PhysicalMemory": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_Processor": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "CIM_SystemPackaging": { + "nullable": true, + "properties": { + "response": { + "nullable": true + }, + "responses": { + "items": { + "nullable": true + }, + "nullable": true, + "type": "array" + }, + "status": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "IEEE8021xConfig": { + "description": "IEEE8021xConfig schema", + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "IEEE8021xConfigCountResponse": { + "description": "IEEE8021xConfigCountResponse schema", + "properties": { + "data": { + "items": { + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "KVMScreenSettings": { + "description": "KVMScreenSettings schema", + "properties": { + "displays": { + "items": { + "properties": { + "displayIndex": { + "type": "integer" + }, + "isActive": { + "type": "boolean" + }, + "isDefault": { + "type": "boolean" + }, + "resolutionX": { + "type": "integer" + }, + "resolutionY": { + "type": "integer" + }, + "role": { + "nullable": true, + "type": "string" + }, + "upperLeftX": { + "type": "integer" + }, + "upperLeftY": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "KVMScreenSettingsRequest": { + "description": "KVMScreenSettingsRequest schema", + "properties": { + "displayIndex": { + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "NetworkSettings": { + "description": "NetworkSettings schema", + "properties": { + "wired": { + "nullable": true, + "properties": { + "consoleTCPMaxRetransmissions": { + "nullable": true, + "type": "integer" + }, + "defaultGateway": { + "type": "string" + }, + "dhcpEnabled": { + "type": "boolean" + }, + "elementName": { + "type": "string" + }, + "ieee8021x": { + "properties": { + "availableInS0": { + "type": "boolean" + }, + "enabled": { + "type": "string" + }, + "pxeTimeout": { + "type": "integer" + } + }, + "type": "object" + }, + "instanceID": { + "type": "string" + }, + "ipAddress": { + "type": "string" + }, + "ipSyncEnabled": { + "type": "boolean" + }, + "linkControl": { + "nullable": true, + "type": "string" + }, + "linkIsUp": { + "type": "boolean" + }, + "linkPolicy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "linkPreference": { + "nullable": true, + "type": "string" + }, + "macAddress": { + "type": "string" + }, + "physicalConnectionType": { + "type": "string" + }, + "physicalNICMedium": { + "type": "string" + }, + "primaryDNS": { + "type": "string" + }, + "secondaryDNS": { + "type": "string" + }, + "sharedDynamicIP": { + "type": "boolean" + }, + "sharedMAC": { + "type": "boolean" + }, + "sharedStaticIP": { + "type": "boolean" + }, + "subnetMask": { + "type": "string" + }, + "vlanTag": { + "type": "integer" + }, + "wlanLinkProtectionLevel": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "wireless": { + "nullable": true, + "properties": { + "consoleTCPMaxRetransmissions": { + "nullable": true, + "type": "integer" + }, + "defaultGateway": { + "type": "string" + }, + "dhcpEnabled": { + "type": "boolean" + }, + "elementName": { + "type": "string" + }, + "ieee8021xSettings": { + "items": { + "properties": { + "authenticationProtocol": { + "type": "integer" + }, + "domain": { + "type": "string" + }, + "pacPassword": { + "type": "string" + }, + "password": { + "type": "string" + }, + "protectedAccessCredential": { + "type": "string" + }, + "psk": { + "type": "string" + }, + "roamingIdentity": { + "type": "string" + }, + "serverCertificateName": { + "type": "string" + }, + "serverCertificateNameComparison": { + "type": "integer" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "instanceID": { + "type": "string" + }, + "ipAddress": { + "type": "string" + }, + "ipSyncEnabled": { + "type": "boolean" + }, + "linkControl": { + "nullable": true, + "type": "string" + }, + "linkIsUp": { + "type": "boolean" + }, + "linkPolicy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "linkPreference": { + "nullable": true, + "type": "string" + }, + "macAddress": { + "type": "string" + }, + "physicalConnectionType": { + "type": "string" + }, + "physicalNICMedium": { + "type": "string" + }, + "primaryDNS": { + "type": "string" + }, + "secondaryDNS": { + "type": "string" + }, + "sharedDynamicIP": { + "type": "boolean" + }, + "sharedMAC": { + "type": "boolean" + }, + "sharedStaticIP": { + "type": "boolean" + }, + "subnetMask": { + "type": "string" + }, + "vlanTag": { + "type": "integer" + }, + "wifiNetworks": { + "items": { + "properties": { + "authenticationMethod": { + "type": "string" + }, + "bsstype": { + "type": "string" + }, + "elementName": { + "type": "string" + }, + "encryptionMethod": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "ssid": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "wifiPortConfigService": { + "properties": { + "creationClassName": { + "type": "string" + }, + "elementName": { + "type": "string" + }, + "enabledState": { + "type": "integer" + }, + "healthState": { + "type": "integer" + }, + "lastConnectedSsidUnderMeControl": { + "type": "string" + }, + "localProfileSynchronizationEnabled": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "noHostCsmeSoftwarePolicy": { + "type": "integer" + }, + "requestedState": { + "type": "integer" + }, + "systemCreationClassName": { + "type": "string" + }, + "systemName": { + "type": "string" + }, + "uefiWiFiProfileShareEnabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "wlanLinkProtectionLevel": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "PowerAction": { + "description": "PowerAction schema", + "properties": { + "action": { + "example": 8, + "type": "integer" + } + }, + "type": "object" + }, + "PowerActionResponse": { + "description": "PowerActionResponse schema", + "properties": { + "ReturnValue": { + "example": 0, + "type": "integer" + } + }, + "type": "object" + }, + "PowerCapabilities": { + "description": "PowerCapabilities schema", + "properties": { + "Hibernate": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power cycle": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power down": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power on to IDE-R CDROM": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power on to IDE-R Floppy": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power on to PXE": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power on to diagnostic": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power up": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Power up to BIOS": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to BIOS": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to IDE-R CDROM": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to IDE-R Floppy": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to PXE": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to Secure Erase": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Reset to diagnostic": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Sleep": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Soft-off": { + "example": 0, + "nullable": true, + "type": "integer" + }, + "Soft-reset": { + "example": 0, + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "PowerState": { + "description": "PowerState schema", + "properties": { + "osPowerSavingState": { + "example": 0, + "type": "integer" + }, + "powerstate": { + "example": 0, + "type": "integer" + } + }, + "type": "object" + }, + "Profile": { + "description": "Profile schema", + "properties": { + "activation": { + "example": "activate", + "type": "string" + }, + "amtPassword": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "ciraConfigName": { + "example": "My CIRA Config", + "nullable": true, + "type": "string" + }, + "ciraConfigObject": { + "nullable": true, + "properties": { + "authMethod": { + "example": 2, + "type": "integer" + }, + "commonName": { + "example": "example.com", + "type": "string" + }, + "configName": { + "example": "My CIRA Config", + "type": "string" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "mpsPort": { + "example": 4433, + "type": "integer" + }, + "mpsRootCertificate": { + "example": "-----BEGIN CERTIFICATE-----\n...", + "type": "string" + }, + "mpsServerAddress": { + "example": "https://example.com", + "type": "string" + }, + "password": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "proxyDetails": { + "example": "http://example.com", + "type": "string" + }, + "serverAddressFormat": { + "example": 201, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "username": { + "example": "my_username", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "created_by": { + "example": "admin", + "nullable": true, + "type": "string" + }, + "creationDate": { + "example": "2021-07-01T00:00:00Z", + "nullable": true, + "type": "string" + }, + "dhcpEnabled": { + "example": true, + "type": "boolean" + }, + "generateRandomMEBxPassword": { + "example": true, + "type": "boolean" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "iderEnabled": { + "example": true, + "type": "boolean" + }, + "ieee8021xProfile": { + "nullable": true, + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "ieee8021xProfileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "ipSyncEnabled": { + "example": true, + "type": "boolean" + }, + "kvmEnabled": { + "example": true, + "type": "boolean" + }, + "localWifiSyncEnabled": { + "example": true, + "type": "boolean" + }, + "mebxPassword": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "profileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "solEnabled": { + "example": true, + "type": "boolean" + }, + "tags": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "tlsCerts": { + "nullable": true, + "properties": { + "issuedCertificate": { + "properties": { + "cert": { + "type": "string" + }, + "certBin": { + "type": "string" + }, + "checked": { + "example": true, + "type": "boolean" + }, + "h:": { + "type": "string" + }, + "key": { + "format": "byte", + "type": "string" + }, + "pem": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "privateKeyBin": { + "type": "string" + } + }, + "type": "object" + }, + "rootCertificate": { + "properties": { + "cert": { + "type": "string" + }, + "certBin": { + "type": "string" + }, + "checked": { + "example": true, + "type": "boolean" + }, + "h:": { + "type": "string" + }, + "key": { + "format": "byte", + "type": "string" + }, + "pem": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "privateKeyBin": { + "type": "string" + } + }, + "type": "object" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "tlsMode": { + "example": 1, + "nullable": true, + "type": "integer" + }, + "tlsSigningAuthority": { + "example": "SelfSigned", + "nullable": true, + "type": "string" + }, + "uefiWifiSyncEnabled": { + "example": true, + "type": "boolean" + }, + "userConsent": { + "example": "All", + "nullable": true, + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wifiConfigs": { + "items": { + "nullable": true, + "properties": { + "priority": { + "example": 1, + "nullable": true, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "profileProfileName": { + "example": "My Wireless Profile", + "type": "string" + }, + "tenantId": { + "example": "abc123", + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + } + }, + "type": "object" + }, + "ProfileCountResponse": { + "description": "ProfileCountResponse schema", + "properties": { + "data": { + "items": { + "properties": { + "activation": { + "example": "activate", + "type": "string" + }, + "amtPassword": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "ciraConfigName": { + "example": "My CIRA Config", + "nullable": true, + "type": "string" + }, + "ciraConfigObject": { + "nullable": true, + "properties": { + "authMethod": { + "example": 2, + "type": "integer" + }, + "commonName": { + "example": "example.com", + "type": "string" + }, + "configName": { + "example": "My CIRA Config", + "type": "string" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "mpsPort": { + "example": 4433, + "type": "integer" + }, + "mpsRootCertificate": { + "example": "-----BEGIN CERTIFICATE-----\n...", + "type": "string" + }, + "mpsServerAddress": { + "example": "https://example.com", + "type": "string" + }, + "password": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "proxyDetails": { + "example": "http://example.com", + "type": "string" + }, + "serverAddressFormat": { + "example": 201, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "username": { + "example": "my_username", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "created_by": { + "example": "admin", + "nullable": true, + "type": "string" + }, + "creationDate": { + "example": "2021-07-01T00:00:00Z", + "nullable": true, + "type": "string" + }, + "dhcpEnabled": { + "example": true, + "type": "boolean" + }, + "generateRandomMEBxPassword": { + "example": true, + "type": "boolean" + }, + "generateRandomPassword": { + "example": true, + "type": "boolean" + }, + "iderEnabled": { + "example": true, + "type": "boolean" + }, + "ieee8021xProfile": { + "nullable": true, + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "ieee8021xProfileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "ipSyncEnabled": { + "example": true, + "type": "boolean" + }, + "kvmEnabled": { + "example": true, + "type": "boolean" + }, + "localWifiSyncEnabled": { + "example": true, + "type": "boolean" + }, + "mebxPassword": { + "example": "my_password", + "nullable": true, + "type": "string" + }, + "profileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "solEnabled": { + "example": true, + "type": "boolean" + }, + "tags": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "tlsCerts": { + "nullable": true, + "properties": { + "issuedCertificate": { + "properties": { + "cert": { + "type": "string" + }, + "certBin": { + "type": "string" + }, + "checked": { + "example": true, + "type": "boolean" + }, + "h:": { + "type": "string" + }, + "key": { + "format": "byte", + "type": "string" + }, + "pem": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "privateKeyBin": { + "type": "string" + } + }, + "type": "object" + }, + "rootCertificate": { + "properties": { + "cert": { + "type": "string" + }, + "certBin": { + "type": "string" + }, + "checked": { + "example": true, + "type": "boolean" + }, + "h:": { + "type": "string" + }, + "key": { + "format": "byte", + "type": "string" + }, + "pem": { + "type": "string" + }, + "privateKey": { + "type": "string" + }, + "privateKeyBin": { + "type": "string" + } + }, + "type": "object" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "tlsMode": { + "example": 1, + "nullable": true, + "type": "integer" + }, + "tlsSigningAuthority": { + "example": "SelfSigned", + "nullable": true, + "type": "string" + }, + "uefiWifiSyncEnabled": { + "example": true, + "type": "boolean" + }, + "userConsent": { + "example": "All", + "nullable": true, + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wifiConfigs": { + "items": { + "nullable": true, + "properties": { + "priority": { + "example": 1, + "nullable": true, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "profileProfileName": { + "example": "My Wireless Profile", + "type": "string" + }, + "tenantId": { + "example": "abc123", + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "ProfileExportResponse": { + "description": "ProfileExportResponse schema", + "properties": { + "content": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "type": "object" + }, + "SecuritySettings": { + "description": "SecuritySettings schema", + "properties": { + "certificates": { + "properties": { + "keyManagementItems": { + "items": { + "nullable": true, + "properties": { + "creationClassName": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "enabledDefault": { + "nullable": true, + "type": "integer" + }, + "enabledState": { + "nullable": true, + "type": "integer" + }, + "name": { + "nullable": true, + "type": "string" + }, + "requestedState": { + "nullable": true, + "type": "integer" + }, + "systemCreationClassName": { + "nullable": true, + "type": "string" + }, + "systemName": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + }, + "publicKeyCertificateItems": { + "items": { + "nullable": true, + "properties": { + "associatedProfiles": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "displayName": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "instanceID": { + "nullable": true, + "type": "string" + }, + "issuer": { + "nullable": true, + "type": "string" + }, + "publicKeyHandle": { + "nullable": true, + "type": "string" + }, + "readOnlyCertificate": { + "type": "boolean" + }, + "subject": { + "nullable": true, + "type": "string" + }, + "trustedRootCertificate": { + "type": "boolean" + }, + "x509Certificate": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + } + }, + "type": "object" + }, + "profileAssociation": { + "items": { + "properties": { + "clientCertificate": { + "nullable": true, + "properties": { + "associatedProfiles": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "displayName": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "instanceID": { + "nullable": true, + "type": "string" + }, + "issuer": { + "nullable": true, + "type": "string" + }, + "publicKeyHandle": { + "nullable": true, + "type": "string" + }, + "readOnlyCertificate": { + "type": "boolean" + }, + "subject": { + "nullable": true, + "type": "string" + }, + "trustedRootCertificate": { + "type": "boolean" + }, + "x509Certificate": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "profileID": { + "type": "string" + }, + "publicKey": { + "nullable": true, + "properties": { + "certificateHandle": { + "nullable": true, + "type": "string" + }, + "derKey": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "instanceID": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "rootCertificate": { + "nullable": true, + "properties": { + "associatedProfiles": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "displayName": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "instanceID": { + "nullable": true, + "type": "string" + }, + "issuer": { + "nullable": true, + "type": "string" + }, + "publicKeyHandle": { + "nullable": true, + "type": "string" + }, + "readOnlyCertificate": { + "type": "boolean" + }, + "subject": { + "nullable": true, + "type": "string" + }, + "trustedRootCertificate": { + "type": "boolean" + }, + "x509Certificate": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "publicKeys": { + "properties": { + "publicPrivateKeyPairItems": { + "items": { + "nullable": true, + "properties": { + "certificateHandle": { + "nullable": true, + "type": "string" + }, + "derKey": { + "nullable": true, + "type": "string" + }, + "elementName": { + "nullable": true, + "type": "string" + }, + "instanceID": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "nullable": true, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "SettingDataResponse": { + "description": "SettingDataResponse schema", + "properties": { + "AcceptNonSecureConnections": { + "type": "boolean" + }, + "ElementName": { + "nullable": true, + "type": "string" + }, + "Enabled": { + "type": "boolean" + }, + "InstanceID": { + "nullable": true, + "type": "string" + }, + "MutualAuthentication": { + "type": "boolean" + }, + "NonSecureConnectionsSupported": { + "nullable": true, + "type": "boolean" + }, + "TrustedCN": { + "items": { + "nullable": true, + "type": "string" + }, + "nullable": true, + "type": "array" + } + }, + "type": "object" + }, + "UserConsentCode": { + "description": "UserConsentCode schema", + "properties": { + "consentCode": { + "example": "123456", + "type": "string" + } + }, + "type": "object" + }, + "UserConsentMessage": { + "description": "UserConsentMessage schema", + "properties": { + "Body": { + "nullable": true, + "properties": { + "ReturnValue": { + "example": 0, + "type": "integer" + } + }, + "type": "object" + }, + "Header": { + "nullable": true, + "properties": { + "Action": { + "example": "http://intel.com/wbem/wscim/1/ips-schema/1/IPS_OptInService/StartOptInResponse", + "nullable": true, + "type": "string" + }, + "MessageID": { + "example": "uuid:00000000-8086-8086-8086-000000001ACD", + "nullable": true, + "type": "string" + }, + "Method": { + "example": "StartOptIn", + "nullable": true, + "type": "string" + }, + "RelatesTo": { + "example": "1", + "nullable": true, + "type": "string" + }, + "ResourceURI": { + "example": "http://intel.com/wbem/wscim/1/ips-schema/1/IPS_OptInService", + "nullable": true, + "type": "string" + }, + "To": { + "example": "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "Version": { + "description": "Version schema", + "properties": { + "AMT_SetupAndConfigurationService": { + "properties": { + "response": { + "properties": { + "ConfigurationServerFQDN": { + "nullable": true, + "type": "string" + }, + "CreationClassName": { + "nullable": true, + "type": "string" + }, + "DhcpDNSSuffix": { + "nullable": true, + "type": "string" + }, + "ElementName": { + "nullable": true, + "type": "string" + }, + "EnabledState": { + "nullable": true, + "type": "integer" + }, + "Name": { + "nullable": true, + "type": "string" + }, + "PasswordModel": { + "nullable": true, + "type": "integer" + }, + "ProvisioningMode": { + "nullable": true, + "type": "integer" + }, + "ProvisioningServerOTP": { + "nullable": true, + "type": "string" + }, + "ProvisioningState": { + "nullable": true, + "type": "integer" + }, + "RequestedState": { + "nullable": true, + "type": "integer" + }, + "SystemCreationClassName": { + "nullable": true, + "type": "string" + }, + "SystemName": { + "nullable": true, + "type": "string" + }, + "TrustedDNSSuffix": { + "nullable": true, + "type": "string" + }, + "ZeroTouchConfigurationEnabled": { + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "CIM_SoftwareIdentity": { + "properties": { + "responses": { + "items": { + "properties": { + "InstanceID": { + "type": "string" + }, + "IsEntity": { + "example": true, + "type": "boolean" + }, + "VersionString": { + "example": "\u003cmajor\u003e.\u003cminor\u003e.\u003crevision\u003e.\u003cbuild\u003e", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "WirelessConfig": { + "description": "WirelessConfig schema", + "properties": { + "authenticationMethod": { + "example": 1, + "type": "integer" + }, + "encryptionMethod": { + "example": 3, + "type": "integer" + }, + "ieee8021xProfileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "ieee8021xProfileObject": { + "nullable": true, + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "linkPolicy": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "profileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "pskPassphrase": { + "example": "abc", + "nullable": true, + "type": "string" + }, + "pskValue": { + "example": 3, + "type": "integer" + }, + "ssid": { + "example": "abc", + "type": "string" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "WirelessConfigCountResponse": { + "description": "WirelessConfigCountResponse schema", + "properties": { + "data": { + "items": { + "properties": { + "authenticationMethod": { + "example": 1, + "type": "integer" + }, + "encryptionMethod": { + "example": 3, + "type": "integer" + }, + "ieee8021xProfileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "ieee8021xProfileObject": { + "nullable": true, + "properties": { + "authenticationProtocol": { + "example": 1, + "type": "integer" + }, + "profileName": { + "example": "My Profile", + "type": "string" + }, + "pxeTimeout": { + "example": 60, + "nullable": true, + "type": "integer" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "example": "1.0.0", + "nullable": true, + "type": "string" + }, + "wiredInterface": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "linkPolicy": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "profileName": { + "example": "My Profile", + "nullable": true, + "type": "string" + }, + "pskPassphrase": { + "example": "abc", + "nullable": true, + "type": "string" + }, + "pskValue": { + "example": 3, + "type": "integer" + }, + "ssid": { + "example": "abc", + "type": "string" + }, + "tenantId": { + "example": "abc123", + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "totalCount": { + "type": "integer" + } + }, + "type": "object" + }, + "string": { + "description": "string schema", + "type": "string" + }, + "unknown-interface": { + "description": "unknown-interface schema" + } + } + }, + "info": { + "description": "API for managing console resources", + "title": "Console API", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "paths": { + "/api/v1/admin/amt/alarmOccurrences/{guid}": { + "delete": { + "description": "Delete an alarm occurrence from a device", + "operationId": "DELETE_/api/v1/admin/amt/alarmOccurrences/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/DeleteAlarmOccurrenceRequest" + } + } + }, + "description": "Request body for dto.DeleteAlarmOccurrenceRequest", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete Alarm Occurrence", + "tags": [ + "Device Management" + ] + }, + "get": { + "description": "Retrieve alarm occurrences for a device", + "operationId": "GET_/api/v1/admin/amt/alarmOccurrences/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/AlarmClockOccurrence" + }, + "type": "array" + } + }, + "application/xml": { + "schema": { + "items": { + "$ref": "#/components/schemas/AlarmClockOccurrence" + }, + "type": "array" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Alarm Occurrences", + "tags": [ + "Device Management" + ] + }, + "post": { + "description": "Create an alarm occurrence on a device", + "operationId": "POST_/api/v1/admin/amt/alarmOccurrences/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/AlarmClockOccurrenceInput" + } + } + }, + "description": "Request body for dto.AlarmClockOccurrenceInput", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddAlarmOutput" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/AddAlarmOutput" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create Alarm Occurrence", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/certificates/{guid}": { + "delete": { + "description": "Delete a certificate from the device", + "operationId": "DELETE_/api/v1/admin/amt/certificates/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/DeleteCertificateRequest" + } + } + }, + "description": "Request body for dto.DeleteCertificateRequest", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete Certificate", + "tags": [ + "Device Management" + ] + }, + "get": { + "description": "Retrieve certificate and key information for a device", + "operationId": "GET_/api/v1/admin/amt/certificates/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecuritySettings" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/SecuritySettings" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Certificates", + "tags": [ + "Device Management" + ] + }, + "post": { + "description": "Add a certificate to the device", + "operationId": "POST_/api/v1/admin/amt/certificates/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CertInfo" + } + } + }, + "description": "Request body for dto.CertInfo", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/string" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/string" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Add Certificate", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/diskInfo/{guid}": { + "get": { + "description": "Retrieve disk information for a device", + "operationId": "GET_/api/v1/admin/amt/diskInfo/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DiskInfo" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/DiskInfo" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Disk Info", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/explorer": { + "get": { + "description": "Retrieve supported AMT explorer calls", + "operationId": "GET_/api/v1/admin/amt/explorer", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/string" + }, + "type": "array" + } + }, + "application/xml": { + "schema": { + "items": { + "$ref": "#/components/schemas/string" + }, + "type": "array" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Explorer Calls", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/explorer/{guid}/{call}": { + "get": { + "description": "Execute an AMT explorer call on a device", + "operationId": "GET_/api/v1/admin/amt/explorer/:guid/:call", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Explorer call name", + "in": "path", + "name": "call", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Execute Explorer Call", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/features/{guid}": { + "get": { + "description": "Retrieve feature flags for a device", + "operationId": "GET_/api/v1/admin/amt/features/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Features" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Features" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Features", + "tags": [ + "Device Management" + ] + }, + "post": { + "description": "Update feature flags for a device", + "operationId": "POST_/api/v1/admin/amt/features/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Features" + } + } + }, + "description": "Request body for dto.Features", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Features" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Features" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Set Features", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/generalSettings/{guid}": { + "get": { + "description": "Retrieve general settings for a device", + "operationId": "GET_/api/v1/admin/amt/generalSettings/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralSettings" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/GeneralSettings" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get General Settings", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/hardwareInfo/{guid}": { + "get": { + "description": "Retrieve hardware information for a device", + "operationId": "GET_/api/v1/admin/amt/hardwareInfo/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HardwareInfo" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HardwareInfo" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Hardware Info", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/log/audit/{guid}": { + "get": { + "description": "Retrieve audit log entries for a device", + "operationId": "GET_/api/v1/admin/amt/log/audit/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Start index for pagination", + "in": "query", + "name": "startIndex", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditLog" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/AuditLog" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Audit Log", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/log/audit/{guid}/download": { + "get": { + "description": "Download audit logs as CSV for a device", + "operationId": "GET_/api/v1/admin/amt/log/audit/:guid/download", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/string" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/string" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Download Audit Log", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/log/event/{guid}": { + "get": { + "description": "Retrieve event log entries for a device", + "operationId": "GET_/api/v1/admin/amt/log/event/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventLogs" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/EventLogs" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Event Log", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/log/event/{guid}/download": { + "get": { + "description": "Download event logs as CSV for a device", + "operationId": "GET_/api/v1/admin/amt/log/event/:guid/download", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/string" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/string" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Download Event Log", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/networkSettings/{guid}": { + "get": { + "description": "Retrieve network settings for a device", + "operationId": "GET_/api/v1/admin/amt/networkSettings/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NetworkSettings" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Network Settings", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/action/{guid}": { + "post": { + "description": "Perform a power action on a device", + "operationId": "POST_/api/v1/admin/amt/power/action/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PowerAction" + } + } + }, + "description": "Request body for dto.PowerAction", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PowerActionResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/PowerActionResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Perform Power Action", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/bootOptions/{guid}": { + "post": { + "description": "Set boot options on a device", + "operationId": "POST_/api/v1/admin/amt/power/bootOptions/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + } + }, + "description": "Request body for dto.BootSetting", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Set Boot Options", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/bootSources/{guid}": { + "get": { + "description": "Retrieve available boot sources for a device", + "operationId": "GET_/api/v1/admin/amt/power/bootSources/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/BootSources" + }, + "type": "array" + } + }, + "application/xml": { + "schema": { + "items": { + "$ref": "#/components/schemas/BootSources" + }, + "type": "array" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Boot Sources", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/bootoptions/{guid}": { + "post": { + "description": "Set boot options on a device (alternate path)", + "operationId": "POST_/api/v1/admin/amt/power/bootoptions/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + } + }, + "description": "Request body for dto.BootSetting", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/BootSetting" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Set Boot Options (alt path)", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/capabilities/{guid}": { + "get": { + "description": "Retrieve power capabilities for a device", + "operationId": "GET_/api/v1/admin/amt/power/capabilities/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PowerCapabilities" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/PowerCapabilities" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Power Capabilities", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/power/state/{guid}": { + "get": { + "description": "Retrieve the current power state of a device", + "operationId": "GET_/api/v1/admin/amt/power/state/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PowerState" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/PowerState" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Power State", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/tls/{guid}": { + "get": { + "description": "Retrieve TLS setting data for a device", + "operationId": "GET_/api/v1/admin/amt/tls/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SettingDataResponse" + }, + "type": "array" + } + }, + "application/xml": { + "schema": { + "items": { + "$ref": "#/components/schemas/SettingDataResponse" + }, + "type": "array" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get TLS Setting Data", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/userConsentCode/cancel/{guid}": { + "get": { + "description": "Cancel a previously issued user consent code for a device", + "operationId": "GET_/api/v1/admin/amt/userConsentCode/cancel/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Cancel User Consent Code", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/userConsentCode/{guid}": { + "get": { + "description": "Retrieve the current user consent code for a device", + "operationId": "GET_/api/v1/admin/amt/userConsentCode/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get User Consent Code", + "tags": [ + "Device Management" + ] + }, + "post": { + "description": "Send a user consent code to the device", + "operationId": "POST_/api/v1/admin/amt/userConsentCode/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/UserConsentCode" + } + } + }, + "description": "Request body for dto.UserConsentCode", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/UserConsentMessage" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Send User Consent Code", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/amt/version/{guid}": { + "get": { + "description": "Retrieve AMT/software version information for a device", + "operationId": "GET_/api/v1/admin/amt/version/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Version" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Version" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Version", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/ciraconfigs": { + "get": { + "description": "Retrieve all CIRA configurations with optional pagination", + "operationId": "GET_/api/v1/admin/ciraconfigs", + "parameters": [ + { + "description": "Number of records to return", + "in": "query", + "name": "$top", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of records to skip", + "in": "query", + "name": "$skip", + "schema": { + "type": "integer" + } + }, + { + "description": "Include total count", + "in": "query", + "name": "$count", + "schema": { + "type": "boolean" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CIRAConfigCountResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/CIRAConfigCountResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "List CIRA Configurations", + "tags": [ + "CIRA" + ] + }, + "patch": { + "description": "Update an existing CIRA configuration", + "operationId": "PATCH_/api/v1/admin/ciraconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + } + }, + "description": "Request body for dto.CIRAConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Update CIRA Configuration", + "tags": [ + "CIRA" + ] + }, + "post": { + "description": "Create a new CIRA configuration", + "operationId": "POST_/api/v1/admin/ciraconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + } + }, + "description": "Request body for dto.CIRAConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create CIRA Configuration", + "tags": [ + "CIRA" + ] + } + }, + "/api/v1/admin/ciraconfigs/{name}": { + "delete": { + "description": "Delete a CIRA configuration by profile name", + "operationId": "DELETE_/api/v1/admin/ciraconfigs/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete CIRA Configuration", + "tags": [ + "CIRA" + ] + }, + "get": { + "description": "Retrieve a specific CIRA configuration by profile name", + "operationId": "GET_/api/v1/admin/ciraconfigs/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/CIRAConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get CIRA Configuration by Name", + "tags": [ + "CIRA" + ] + } + }, + "/api/v1/admin/devices": { + "get": { + "description": "Retrieve all devices with optional pagination and filtering", + "operationId": "GET_/api/v1/admin/devices", + "parameters": [ + { + "description": "Number of records to return", + "in": "query", + "name": "$top", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of records to skip", + "in": "query", + "name": "$skip", + "schema": { + "type": "integer" + } + }, + { + "description": "Include total count", + "in": "query", + "name": "$count", + "schema": { + "type": "boolean" + } + }, + { + "description": "Comma-separated list of tags to filter devices", + "in": "query", + "name": "tags", + "schema": { + "type": "string" + } + }, + { + "description": "Method to filter tags (any/all)", + "in": "query", + "name": "method", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceCountResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/DeviceCountResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "List Devices", + "tags": [ + "Devices" + ] + }, + "patch": { + "description": "Update an existing device", + "operationId": "PATCH_/api/v1/admin/devices", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Device" + } + } + }, + "description": "Request body for dto.Device", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Device" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Device" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Update Device", + "tags": [ + "Devices" + ] + }, + "post": { + "description": "Create a new device", + "operationId": "POST_/api/v1/admin/devices", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Device" + } + } + }, + "description": "Request body for dto.Device", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Device" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Device" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create Device", + "tags": [ + "Devices" + ] + } + }, + "/api/v1/admin/devices/cert/{id}": { + "get": { + "description": "Retrieve the certificate for a specific device", + "operationId": "GET_/api/v1/admin/devices/cert/:id", + "parameters": [ + { + "description": "Device ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Certificate" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Certificate" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Device Certificate", + "tags": [ + "Devices" + ] + }, + "post": { + "description": "Pin the certificate for a specific device", + "operationId": "POST_/api/v1/admin/devices/cert/:id", + "parameters": [ + { + "description": "Device ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Pin Device Certificate", + "tags": [ + "Devices" + ] + } + }, + "/api/v1/admin/devices/stats": { + "get": { + "description": "Retrieve statistics for devices", + "operationId": "GET_/api/v1/admin/devices/stats", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceStatResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/DeviceStatResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Device Statistics", + "tags": [ + "Devices" + ] + } + }, + "/api/v1/admin/devices/tags": { + "get": { + "description": "Retrieve a list of all available device tags", + "operationId": "GET_/api/v1/admin/devices/tags", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/string" + }, + "type": "array" + } + }, + "application/xml": { + "schema": { + "items": { + "$ref": "#/components/schemas/string" + }, + "type": "array" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Available Device Tags", + "tags": [ + "Devices" + ] + } + }, + "/api/v1/admin/devices/{id}": { + "delete": { + "description": "Delete a device by ID", + "operationId": "DELETE_/api/v1/admin/devices/:id", + "parameters": [ + { + "description": "Device ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete Device", + "tags": [ + "Devices" + ] + }, + "get": { + "description": "Retrieve a specific device by ID", + "operationId": "GET_/api/v1/admin/devices/:id", + "parameters": [ + { + "description": "Device ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Device" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Device" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Device by ID", + "tags": [ + "Devices" + ] + } + }, + "/api/v1/admin/ieee8021xconfigs": { + "get": { + "description": "Retrieve all IEEE 802.1x configurations with optional pagination", + "operationId": "GET_/api/v1/admin/ieee8021xconfigs", + "parameters": [ + { + "description": "Number of records to return", + "in": "query", + "name": "$top", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of records to skip", + "in": "query", + "name": "$skip", + "schema": { + "type": "integer" + } + }, + { + "description": "Include total count", + "in": "query", + "name": "$count", + "schema": { + "type": "boolean" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfigCountResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfigCountResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "List IEEE 802.1x Configurations", + "tags": [ + "IEEE 802.1x" + ] + }, + "patch": { + "description": "Update an existing IEEE 802.1x configuration", + "operationId": "PATCH_/api/v1/admin/ieee8021xconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + } + }, + "description": "Request body for dto.IEEE8021xConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Update IEEE 802.1x Configuration", + "tags": [ + "IEEE 802.1x" + ] + }, + "post": { + "description": "Create a new IEEE 802.1x configuration", + "operationId": "POST_/api/v1/admin/ieee8021xconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + } + }, + "description": "Request body for dto.IEEE8021xConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create IEEE 802.1x Configuration", + "tags": [ + "IEEE 802.1x" + ] + } + }, + "/api/v1/admin/ieee8021xconfigs/{name}": { + "delete": { + "description": "Delete an IEEE 802.1x configuration by name", + "operationId": "DELETE_/api/v1/admin/ieee8021xconfigs/:name", + "parameters": [ + { + "description": "Configuration name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete IEEE 802.1x Configuration", + "tags": [ + "IEEE 802.1x" + ] + }, + "get": { + "description": "Retrieve a specific IEEE 802.1x configuration by name", + "operationId": "GET_/api/v1/admin/ieee8021xconfigs/:name", + "parameters": [ + { + "description": "Configuration name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/IEEE8021xConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get IEEE 802.1x Configuration by Name", + "tags": [ + "IEEE 802.1x" + ] + } + }, + "/api/v1/admin/kvm/displays/{guid}": { + "get": { + "description": "Retrieve current KVM display settings for a device", + "operationId": "GET_/api/v1/admin/kvm/displays/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KVMScreenSettings" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/KVMScreenSettings" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get KVM displays", + "tags": [ + "Device Management" + ] + }, + "put": { + "description": "Update KVM display settings for a device", + "operationId": "PUT_/api/v1/admin/kvm/displays/:guid", + "parameters": [ + { + "description": "Device GUID", + "in": "path", + "name": "guid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/KVMScreenSettingsRequest" + } + } + }, + "description": "Request body for dto.KVMScreenSettingsRequest", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KVMScreenSettings" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/KVMScreenSettings" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Set KVM displays", + "tags": [ + "Device Management" + ] + } + }, + "/api/v1/admin/profiles": { + "get": { + "description": "Retrieve all profiles with optional pagination", + "operationId": "GET_/api/v1/admin/profiles", + "parameters": [ + { + "description": "Number of records to return", + "in": "query", + "name": "$top", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of records to skip", + "in": "query", + "name": "$skip", + "schema": { + "type": "integer" + } + }, + { + "description": "Include total count", + "in": "query", + "name": "$count", + "schema": { + "type": "boolean" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProfileCountResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/ProfileCountResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "List Profiles", + "tags": [ + "Profiles" + ] + }, + "patch": { + "description": "Update an existing profile", + "operationId": "PATCH_/api/v1/admin/profiles", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + } + }, + "description": "Request body for dto.Profile", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Update Profile", + "tags": [ + "Profiles" + ] + }, + "post": { + "description": "Create a new profile", + "operationId": "POST_/api/v1/admin/profiles", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + } + }, + "description": "Request body for dto.Profile", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create Profile", + "tags": [ + "Profiles" + ] + } + }, + "/api/v1/admin/profiles/export/{name}": { + "get": { + "description": "Export a profile configuration", + "operationId": "GET_/api/v1/admin/profiles/export/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Domain name for export", + "in": "query", + "name": "domainName", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProfileExportResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/ProfileExportResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Export Profile", + "tags": [ + "Profiles" + ] + } + }, + "/api/v1/admin/profiles/{name}": { + "delete": { + "description": "Delete a profile by name", + "operationId": "DELETE_/api/v1/admin/profiles/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete Profile", + "tags": [ + "Profiles" + ] + }, + "get": { + "description": "Retrieve a specific profile by name", + "operationId": "GET_/api/v1/admin/profiles/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Profile" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Profile by Name", + "tags": [ + "Profiles" + ] + } + }, + "/api/v1/admin/wirelessconfigs": { + "get": { + "description": "Retrieve all wireless configurations with optional pagination", + "operationId": "GET_/api/v1/admin/wirelessconfigs", + "parameters": [ + { + "description": "Number of records to return", + "in": "query", + "name": "$top", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of records to skip", + "in": "query", + "name": "$skip", + "schema": { + "type": "integer" + } + }, + { + "description": "Include total count", + "in": "query", + "name": "$count", + "schema": { + "type": "boolean" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WirelessConfigCountResponse" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/WirelessConfigCountResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "List Wireless Configurations", + "tags": [ + "Wireless" + ] + }, + "patch": { + "description": "Update an existing wireless configuration", + "operationId": "PATCH_/api/v1/admin/wirelessconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + } + }, + "description": "Request body for dto.WirelessConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Update Wireless Configuration", + "tags": [ + "Wireless" + ] + }, + "post": { + "description": "Create a new wireless configuration", + "operationId": "POST_/api/v1/admin/wirelessconfigs", + "parameters": [ + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + } + }, + "description": "Request body for dto.WirelessConfig", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Create Wireless Configuration", + "tags": [ + "Wireless" + ] + } + }, + "/api/v1/admin/wirelessconfigs/{name}": { + "delete": { + "description": "Delete a wireless configuration by profile name", + "operationId": "DELETE_/api/v1/admin/wirelessconfigs/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/unknown-interface" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Delete Wireless Configuration", + "tags": [ + "Wireless" + ] + }, + "get": { + "description": "Retrieve a specific wireless configuration by profile name", + "operationId": "GET_/api/v1/admin/wirelessconfigs/:name", + "parameters": [ + { + "description": "Profile name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Accept", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/WirelessConfig" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Bad Request _(validation or deserialization error)_" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/HTTPError" + } + } + }, + "description": "Internal Server Error _(panics)_" + }, + "default": { + "description": "" + } + }, + "summary": "Get Wireless Configuration by Name", + "tags": [ + "Wireless" + ] + } + } + } +} \ No newline at end of file diff --git a/internal/mocks/wsman_mocks.go b/internal/mocks/wsman_mocks.go index 56a1b731..9a620649 100644 --- a/internal/mocks/wsman_mocks.go +++ b/internal/mocks/wsman_mocks.go @@ -733,3 +733,18 @@ func (mr *MockManagementMockRecorder) SetKVMRedirection(enable any) *gomock.Call mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetKVMRedirection", reflect.TypeOf((*MockManagement)(nil).SetKVMRedirection), enable) } + +// SetLinkPreference mocks base method. +func (m *MockManagement) SetLinkPreference(linkPreference, timeout int) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetLinkPreference", linkPreference, timeout) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetLinkPreference indicates an expected call of SetLinkPreference. +func (mr *MockManagementMockRecorder) SetLinkPreference(linkPreference, timeout any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLinkPreference", reflect.TypeOf((*MockManagement)(nil).SetLinkPreference), linkPreference, timeout) +} diff --git a/internal/usecase/devices/linkpreference_test.go b/internal/usecase/devices/linkpreference_test.go new file mode 100644 index 00000000..5a450433 --- /dev/null +++ b/internal/usecase/devices/linkpreference_test.go @@ -0,0 +1,192 @@ +package devices_test + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + gomock "go.uber.org/mock/gomock" + + "github.com/device-management-toolkit/console/internal/entity" + "github.com/device-management-toolkit/console/internal/entity/dto/v1" + "github.com/device-management-toolkit/console/internal/mocks" + devices "github.com/device-management-toolkit/console/internal/usecase/devices" + "github.com/device-management-toolkit/console/internal/usecase/devices/wsman" + "github.com/device-management-toolkit/console/pkg/logger" +) + +func initLinkPreferenceTest(t *testing.T) (*devices.UseCase, *mocks.MockWSMAN, *mocks.MockManagement, *mocks.MockDeviceManagementRepository) { + t.Helper() + + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + + repo := mocks.NewMockDeviceManagementRepository(mockCtl) + wsmanMock := mocks.NewMockWSMAN(mockCtl) + wsmanMock.EXPECT().Worker().Return().AnyTimes() + + management := mocks.NewMockManagement(mockCtl) + log := logger.New("error") + u := devices.New(repo, wsmanMock, mocks.NewMockRedirection(mockCtl), log, mocks.MockCrypto{}) + + return u, wsmanMock, management, repo +} + +func TestSetLinkPreference(t *testing.T) { + t.Parallel() + + device := &entity.Device{ + GUID: "device-guid-123", + TenantID: "tenant-id-456", + } + + request := dto.LinkPreferenceRequest{ + LinkPreference: 1, // ME + Timeout: 300, + } + + tests := []struct { + name string + request dto.LinkPreferenceRequest + manMock func(*mocks.MockWSMAN, *mocks.MockManagement) + repoMock func(*mocks.MockDeviceManagementRepository) + res dto.LinkPreferenceResponse + err error + }{ + { + name: "success - set to ME", + request: request, + manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { + man.EXPECT(). + SetupWsmanClient(gomock.Any(), false, true). + Return(man2, nil) + man2.EXPECT(). + SetLinkPreference(1, 300). + Return(0, nil) + }, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(device, nil) + }, + res: dto.LinkPreferenceResponse{ReturnValue: 0}, + err: nil, + }, + { + name: "success - set to HOST", + request: dto.LinkPreferenceRequest{ + LinkPreference: 2, // HOST + Timeout: 60, + }, + manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { + man.EXPECT(). + SetupWsmanClient(gomock.Any(), false, true). + Return(man2, nil) + man2.EXPECT(). + SetLinkPreference(2, 60). + Return(0, nil) + }, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(device, nil) + }, + res: dto.LinkPreferenceResponse{ReturnValue: 0}, + err: nil, + }, + { + name: "GetById fails - device not found", + request: request, + manMock: func(_ *mocks.MockWSMAN, _ *mocks.MockManagement) {}, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(nil, ErrGeneral) + }, + res: dto.LinkPreferenceResponse{}, + err: devices.ErrGeneral, + }, + { + name: "no WiFi port found", + request: request, + manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { + man.EXPECT(). + SetupWsmanClient(gomock.Any(), false, true). + Return(man2, nil) + man2.EXPECT(). + SetLinkPreference(1, 300). + Return(-1, wsman.ErrNoWiFiPort) + }, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(device, nil) + }, + res: dto.LinkPreferenceResponse{ReturnValue: -1}, + err: wsman.ErrNoWiFiPort, + }, + { + name: "SetLinkPreference fails with AMT error", + request: request, + manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { + man.EXPECT(). + SetupWsmanClient(gomock.Any(), false, true). + Return(man2, nil) + man2.EXPECT(). + SetLinkPreference(1, 300). + Return(5, errors.New("invalid parameter")) + }, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(device, nil) + }, + res: dto.LinkPreferenceResponse{ReturnValue: 5}, + err: errors.New("invalid parameter"), + }, + { + name: "SetLinkPreference fails with general error", + request: request, + manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { + man.EXPECT(). + SetupWsmanClient(gomock.Any(), false, true). + Return(man2, nil) + man2.EXPECT(). + SetLinkPreference(1, 300). + Return(0, ErrGeneral) + }, + repoMock: func(repo *mocks.MockDeviceManagementRepository) { + repo.EXPECT(). + GetByID(context.Background(), device.GUID, ""). + Return(device, nil) + }, + res: dto.LinkPreferenceResponse{ReturnValue: 0}, + err: ErrGeneral, + }, + } + + for _, tc := range tests { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + useCase, wsmanMock, management, repo := initLinkPreferenceTest(t) + + if tc.manMock != nil { + tc.manMock(wsmanMock, management) + } + + tc.repoMock(repo) + + res, err := useCase.SetLinkPreference(context.Background(), device.GUID, tc.request) + + require.Equal(t, tc.res, res) + + if tc.err != nil { + assert.Equal(t, err.Error(), tc.err.Error()) + } + }) + } +} From 2a15aad629140a30f29f5c4a520cdd6c4784b91e Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Thu, 18 Dec 2025 10:25:37 +0800 Subject: [PATCH 5/9] fix: input param datatype to follow AMT SDK spec Signed-off-by: Cheah, Kit Hwa --- internal/entity/dto/v1/linkpreference.go | 6 +++--- internal/usecase/devices/wsman/interfaces.go | 2 +- internal/usecase/devices/wsman/message.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/entity/dto/v1/linkpreference.go b/internal/entity/dto/v1/linkpreference.go index 7a99bf2c..596fda7f 100644 --- a/internal/entity/dto/v1/linkpreference.go +++ b/internal/entity/dto/v1/linkpreference.go @@ -2,13 +2,13 @@ package dto // LinkPreferenceRequest represents the request to set link preference on a device. type LinkPreferenceRequest struct { - LinkPreference int `json:"linkPreference" binding:"required,min=1,max=2"` // 1 for ME, 2 for HOST - Timeout int `json:"timeout" binding:"required,min=0"` // Timeout in seconds + LinkPreference uint32 `json:"linkPreference" binding:"required,min=1,max=2"` // 1 for ME, 2 for HOST + Timeout uint32 `json:"timeout" binding:"required,min=0,max=65535"` // Timeout in seconds } // LinkPreferenceResponse represents the response from setting link preference. type LinkPreferenceResponse struct { - ReturnValue int `json:"returnValue" example:"0"` // Return code. 0 indicates success + ReturnValue int `json:"returnValue" example:"0"` // Return code. 0 indicates success, -1 for no WiFi port } // LinkPreference enumeration values diff --git a/internal/usecase/devices/wsman/interfaces.go b/internal/usecase/devices/wsman/interfaces.go index 35295a01..7ff7a5ab 100644 --- a/internal/usecase/devices/wsman/interfaces.go +++ b/internal/usecase/devices/wsman/interfaces.go @@ -71,5 +71,5 @@ type Management interface { GetIPSKVMRedirectionSettingData() (kvmredirection.Response, error) SetIPSKVMRedirectionSettingData(data *kvmredirection.KVMRedirectionSettingsRequest) (kvmredirection.Response, error) DeleteCertificate(instanceID string) error - SetLinkPreference(linkPreference, timeout int) (int, error) + SetLinkPreference(linkPreference, timeout uint32) (int, error) } diff --git a/internal/usecase/devices/wsman/message.go b/internal/usecase/devices/wsman/message.go index e13f5704..37a87853 100644 --- a/internal/usecase/devices/wsman/message.go +++ b/internal/usecase/devices/wsman/message.go @@ -1936,7 +1936,7 @@ func (c *ConnectionEntry) SetIPSKVMRedirectionSettingData(req *kvmredirection.KV // linkPreference: 1 for ME, 2 for Host // timeout: timeout in seconds // Returns the return value from the AMT device or an error. -func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout int) (int, error) { +func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout uint32) (int, error) { // Get all ethernet port settings to find WiFi port enumResponse, err := c.WsmanMessages.AMT.EthernetPortSettings.Enumerate() if err != nil { From 46d7aa6626cee2c927d3fb41a74bfaed9012e9bb Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Fri, 19 Dec 2025 09:33:41 +0800 Subject: [PATCH 6/9] fix: timeout input validate & fix wifi instanceID Signed-off-by: Cheah, Kit Hwa --- .../controller/httpapi/v1/devicemanagement.go | 1 - .../controller/httpapi/v1/linkpreference.go | 4 ++-- internal/entity/dto/v1/linkpreference.go | 4 ++-- internal/usecase/devices/linkpreference.go | 2 +- internal/usecase/devices/wsman/message.go | 17 +++++++++-------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/controller/httpapi/v1/devicemanagement.go b/internal/controller/httpapi/v1/devicemanagement.go index 87014f39..3b134786 100644 --- a/internal/controller/httpapi/v1/devicemanagement.go +++ b/internal/controller/httpapi/v1/devicemanagement.go @@ -67,4 +67,3 @@ func NewAmtRoutes(handler *gin.RouterGroup, d devices.Feature, amt amtexplorer.F h.POST("network/linkPreference/:guid", r.setLinkPreference) } } - diff --git a/internal/controller/httpapi/v1/linkpreference.go b/internal/controller/httpapi/v1/linkpreference.go index 23605ca0..82aa3715 100644 --- a/internal/controller/httpapi/v1/linkpreference.go +++ b/internal/controller/httpapi/v1/linkpreference.go @@ -10,7 +10,7 @@ import ( "github.com/device-management-toolkit/console/internal/usecase/devices/wsman" ) -// setLinkPreference sets the link preference (ME or Host) on a device's WiFi port. +// setLinkPreference sets the link preference (ME or Host) on a device's WiFi interface. func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { guid := c.Param("guid") @@ -28,7 +28,7 @@ func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { // Handle no WiFi port error with 404 and error message if errors.Is(err, wsman.ErrNoWiFiPort) { c.JSON(http.StatusNotFound, gin.H{ - "error": "Set Link Preference failed: No WiFi port found for guid : " + guid + ".", + "error": "Set Link Preference failed for guid : " + guid + ". - " + err.Error(), }) return } diff --git a/internal/entity/dto/v1/linkpreference.go b/internal/entity/dto/v1/linkpreference.go index 596fda7f..d53ac587 100644 --- a/internal/entity/dto/v1/linkpreference.go +++ b/internal/entity/dto/v1/linkpreference.go @@ -8,7 +8,7 @@ type LinkPreferenceRequest struct { // LinkPreferenceResponse represents the response from setting link preference. type LinkPreferenceResponse struct { - ReturnValue int `json:"returnValue" example:"0"` // Return code. 0 indicates success, -1 for no WiFi port + ReturnValue int `json:"returnValue" example:"0"` // Return code. 0 indicates success, -1 for no WiFi interface } // LinkPreference enumeration values @@ -17,5 +17,5 @@ const ( LinkPreferenceHost = 2 // Host ) -// Console-specific return value for no WiFi port found +// Console-specific return value for no WiFi interface found const ReturnValueNoWiFiPort = -1 diff --git a/internal/usecase/devices/linkpreference.go b/internal/usecase/devices/linkpreference.go index 54a22fb7..318bbb3e 100644 --- a/internal/usecase/devices/linkpreference.go +++ b/internal/usecase/devices/linkpreference.go @@ -6,7 +6,7 @@ import ( dto "github.com/device-management-toolkit/console/internal/entity/dto/v1" ) -// SetLinkPreference sets the link preference (ME or Host) on a device's WiFi port. +// SetLinkPreference sets the link preference (ME or Host) on a device's WiFi interface. func (uc *UseCase) SetLinkPreference(c context.Context, guid string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error) { item, err := uc.repo.GetByID(c, guid, "") if err != nil { diff --git a/internal/usecase/devices/wsman/message.go b/internal/usecase/devices/wsman/message.go index 37a87853..23814c4f 100644 --- a/internal/usecase/devices/wsman/message.go +++ b/internal/usecase/devices/wsman/message.go @@ -83,8 +83,8 @@ var ( ErrCIRADeviceNotConnected = errors.New("CIRA device not connected/not found") // ErrWsmanMessage is used for wrapping wsman message errors. ErrWsmanMessage = &wsmanError{} - // ErrNoWiFiPort is returned when no WiFi port is found on the device. - ErrNoWiFiPort = errors.New("no WiFi port found (PhysicalConnectionType=3)") + // ErrNoWiFiPort is returned when no WiFi interface is found on the device. + ErrNoWiFiPort = errors.New("no WiFi interface found (InstanceID == Intel(r) AMT Ethernet Port Settings 1)") ) type wsmanError struct{} @@ -1932,12 +1932,12 @@ func (c *ConnectionEntry) SetIPSKVMRedirectionSettingData(req *kvmredirection.KV return c.WsmanMessages.IPS.KVMRedirectionSettingData.Put(req) } -// SetLinkPreference sets the link preference (ME or Host) on the WiFi port. +// SetLinkPreference sets the link preference (ME or Host) on the WiFi interface. // linkPreference: 1 for ME, 2 for Host // timeout: timeout in seconds // Returns the return value from the AMT device or an error. func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout uint32) (int, error) { - // Get all ethernet port settings to find WiFi port + // Get all ethernet port settings to find WiFi interface enumResponse, err := c.WsmanMessages.AMT.EthernetPortSettings.Enumerate() if err != nil { return -1, err @@ -1948,13 +1948,14 @@ func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout uint32) (int return -1, err } - // Find WiFi port (PhysicalConnectionType = 3) + // Prefer fixed InstanceID for WiFi interface (do not rely on PhysicalConnectionType) + const wifiInstanceIDConst = "Intel(r) AMT Ethernet Port Settings 1" var wifiInstanceID string for i := range pullResponse.Body.PullResponse.EthernetPortItems { port := &pullResponse.Body.PullResponse.EthernetPortItems[i] - // PhysicalConnectionType: 3 = Wireless LAN - if port.PhysicalConnectionType == 3 { + // Select by InstanceID only + if port.InstanceID == wifiInstanceIDConst { wifiInstanceID = port.InstanceID break } @@ -1964,7 +1965,7 @@ func (c *ConnectionEntry) SetLinkPreference(linkPreference, timeout uint32) (int return -1, ErrNoWiFiPort } - // Call SetLinkPreference on the WiFi port + // Call SetLinkPreference on the WiFi interface response, err := c.WsmanMessages.AMT.EthernetPortSettings.SetLinkPreference(linkPreference, timeout, wifiInstanceID) if err != nil { return -1, err From 59571f97a3a5c0011fd53464184a99cca2db3d75 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Fri, 19 Dec 2025 12:05:14 +0800 Subject: [PATCH 7/9] fix: SetLinkPreference unit test update Signed-off-by: Cheah, Kit Hwa --- internal/mocks/wsman_mocks.go | 2 +- internal/usecase/devices/linkpreference_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/mocks/wsman_mocks.go b/internal/mocks/wsman_mocks.go index 9a620649..e11ebf0e 100644 --- a/internal/mocks/wsman_mocks.go +++ b/internal/mocks/wsman_mocks.go @@ -735,7 +735,7 @@ func (mr *MockManagementMockRecorder) SetKVMRedirection(enable any) *gomock.Call } // SetLinkPreference mocks base method. -func (m *MockManagement) SetLinkPreference(linkPreference, timeout int) (int, error) { +func (m *MockManagement) SetLinkPreference(linkPreference, timeout uint32) (int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetLinkPreference", linkPreference, timeout) ret0, _ := ret[0].(int) diff --git a/internal/usecase/devices/linkpreference_test.go b/internal/usecase/devices/linkpreference_test.go index 5a450433..c3a24bb5 100644 --- a/internal/usecase/devices/linkpreference_test.go +++ b/internal/usecase/devices/linkpreference_test.go @@ -61,9 +61,9 @@ func TestSetLinkPreference(t *testing.T) { manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { man.EXPECT(). SetupWsmanClient(gomock.Any(), false, true). - Return(man2, nil) + Return(wsman.Management(man2), nil) man2.EXPECT(). - SetLinkPreference(1, 300). + SetLinkPreference(uint32(1), uint32(300)). Return(0, nil) }, repoMock: func(repo *mocks.MockDeviceManagementRepository) { @@ -83,9 +83,9 @@ func TestSetLinkPreference(t *testing.T) { manMock: func(man *mocks.MockWSMAN, man2 *mocks.MockManagement) { man.EXPECT(). SetupWsmanClient(gomock.Any(), false, true). - Return(man2, nil) + Return(wsman.Management(man2), nil) man2.EXPECT(). - SetLinkPreference(2, 60). + SetLinkPreference(uint32(2), uint32(60)). Return(0, nil) }, repoMock: func(repo *mocks.MockDeviceManagementRepository) { @@ -116,7 +116,7 @@ func TestSetLinkPreference(t *testing.T) { SetupWsmanClient(gomock.Any(), false, true). Return(man2, nil) man2.EXPECT(). - SetLinkPreference(1, 300). + SetLinkPreference(uint32(1), uint32(300)). Return(-1, wsman.ErrNoWiFiPort) }, repoMock: func(repo *mocks.MockDeviceManagementRepository) { @@ -135,7 +135,7 @@ func TestSetLinkPreference(t *testing.T) { SetupWsmanClient(gomock.Any(), false, true). Return(man2, nil) man2.EXPECT(). - SetLinkPreference(1, 300). + SetLinkPreference(uint32(1), uint32(300)). Return(5, errors.New("invalid parameter")) }, repoMock: func(repo *mocks.MockDeviceManagementRepository) { @@ -154,7 +154,7 @@ func TestSetLinkPreference(t *testing.T) { SetupWsmanClient(gomock.Any(), false, true). Return(man2, nil) man2.EXPECT(). - SetLinkPreference(1, 300). + SetLinkPreference(uint32(1), uint32(300)). Return(0, ErrGeneral) }, repoMock: func(repo *mocks.MockDeviceManagementRepository) { From fb95d9e4f75621a2d6d2e7c22ab46460e9a76e07 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Fri, 19 Dec 2025 23:13:32 +0800 Subject: [PATCH 8/9] test: go mod and ut updates Signed-off-by: Cheah, Kit Hwa --- go.mod | 2 +- internal/mocks/devicemanagement_mocks.go | 15 +++++++++++++++ internal/mocks/wsv1_mocks.go | 15 +++++++++++++++ internal/usecase/devices/linkpreference.go | 4 ++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c2b9b54e..009e31be 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/device-management-toolkit/console go 1.25 -replace github.com/device-management-toolkit/go-wsman-messages/v2 => ../go-wsman-messages +// replace github.com/device-management-toolkit/go-wsman-messages/v2 => ../go-wsman-messages require ( github.com/Masterminds/squirrel v1.5.4 diff --git a/internal/mocks/devicemanagement_mocks.go b/internal/mocks/devicemanagement_mocks.go index d66aa276..79b05eec 100644 --- a/internal/mocks/devicemanagement_mocks.go +++ b/internal/mocks/devicemanagement_mocks.go @@ -761,6 +761,21 @@ func (mr *MockDeviceManagementFeatureMockRecorder) GetHardwareInfo(ctx, guid any return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHardwareInfo", reflect.TypeOf((*MockDeviceManagementFeature)(nil).GetHardwareInfo), ctx, guid) } +// SetLinkPreference mocks base method. +func (m *MockDeviceManagementFeature) SetLinkPreference(c context.Context, guid string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetLinkPreference", c, guid, req) + ret0, _ := ret[0].(dto.LinkPreferenceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetLinkPreference indicates an expected call of SetLinkPreference. +func (mr *MockDeviceManagementFeatureMockRecorder) SetLinkPreference(c, guid, req any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLinkPreference", reflect.TypeOf((*MockDeviceManagementFeature)(nil).SetLinkPreference), c, guid, req) +} + // GetKVMScreenSettings mocks base method. func (m *MockDeviceManagementFeature) GetKVMScreenSettings(c context.Context, guid string) (dto.KVMScreenSettings, error) { m.ctrl.T.Helper() diff --git a/internal/mocks/wsv1_mocks.go b/internal/mocks/wsv1_mocks.go index 5b171733..7ab304aa 100644 --- a/internal/mocks/wsv1_mocks.go +++ b/internal/mocks/wsv1_mocks.go @@ -240,6 +240,21 @@ func (mr *MockFeatureMockRecorder) GetAlarmOccurrences(ctx, guid any) *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAlarmOccurrences", reflect.TypeOf((*MockFeature)(nil).GetAlarmOccurrences), ctx, guid) } +// SetLinkPreference mocks base method. +func (m *MockFeature) SetLinkPreference(c context.Context, guid string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetLinkPreference", c, guid, req) + ret0, _ := ret[0].(dto.LinkPreferenceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetLinkPreference indicates an expected call of SetLinkPreference. +func (mr *MockFeatureMockRecorder) SetLinkPreference(c, guid, req any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLinkPreference", reflect.TypeOf((*MockFeature)(nil).SetLinkPreference), c, guid, req) +} + // GetAuditLog mocks base method. func (m *MockFeature) GetAuditLog(ctx context.Context, startIndex int, guid string) (dto.AuditLog, error) { m.ctrl.T.Helper() diff --git a/internal/usecase/devices/linkpreference.go b/internal/usecase/devices/linkpreference.go index 318bbb3e..e4ddda8e 100644 --- a/internal/usecase/devices/linkpreference.go +++ b/internal/usecase/devices/linkpreference.go @@ -23,8 +23,8 @@ func (uc *UseCase) SetLinkPreference(c context.Context, guid string, req dto.Lin } // Validate timeout - if req.Timeout < 0 { - return dto.LinkPreferenceResponse{}, ErrValidationUseCase.Wrap("SetLinkPreference", "validate timeout", "timeout must be non-negative") + if req.Timeout > 65535 { + return dto.LinkPreferenceResponse{}, ErrValidationUseCase.Wrap("SetLinkPreference", "validate timeout", "timeout max value is 65535") } device, _ := uc.device.SetupWsmanClient(*item, false, true) From a4a95c70fbe5eadde7dd84818d89f584387e7f79 Mon Sep 17 00:00:00 2001 From: "Cheah, Kit Hwa" Date: Fri, 19 Dec 2025 23:37:38 +0800 Subject: [PATCH 9/9] fix: err msg formatting and rm unused type Signed-off-by: Cheah, Kit Hwa --- internal/controller/httpapi/v1/linkpreference.go | 4 ++-- internal/usecase/devices/wsman/message.go | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/internal/controller/httpapi/v1/linkpreference.go b/internal/controller/httpapi/v1/linkpreference.go index 82aa3715..82361203 100644 --- a/internal/controller/httpapi/v1/linkpreference.go +++ b/internal/controller/httpapi/v1/linkpreference.go @@ -28,7 +28,7 @@ func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { // Handle no WiFi port error with 404 and error message if errors.Is(err, wsman.ErrNoWiFiPort) { c.JSON(http.StatusNotFound, gin.H{ - "error": "Set Link Preference failed for guid : " + guid + ". - " + err.Error(), + "error": "Set Link Preference failed for guid: " + guid + ". - " + err.Error(), }) return } @@ -42,7 +42,7 @@ func (r *deviceManagementRoutes) setLinkPreference(c *gin.Context) { // 0 -> 200 OK with success response if response.ReturnValue != 0 { c.JSON(http.StatusBadRequest, gin.H{ - "error": "Set Link Preference failed for guid : " + guid + ".", + "error": "Set Link Preference failed for guid: " + guid + ".", }) return } diff --git a/internal/usecase/devices/wsman/message.go b/internal/usecase/devices/wsman/message.go index 23814c4f..fa58c269 100644 --- a/internal/usecase/devices/wsman/message.go +++ b/internal/usecase/devices/wsman/message.go @@ -81,22 +81,10 @@ var ( // ErrCIRADeviceNotConnected is returned when a CIRA device is not connected or not found. ErrCIRADeviceNotConnected = errors.New("CIRA device not connected/not found") - // ErrWsmanMessage is used for wrapping wsman message errors. - ErrWsmanMessage = &wsmanError{} // ErrNoWiFiPort is returned when no WiFi interface is found on the device. ErrNoWiFiPort = errors.New("no WiFi interface found (InstanceID == Intel(r) AMT Ethernet Port Settings 1)") ) -type wsmanError struct{} - -func (e *wsmanError) Error() string { - return "wsman message error" -} - -func (e *wsmanError) Wrap(operation, context, message string) error { - return errors.New(operation + ": " + context + ": " + message) -} - type ConnectionEntry struct { WsmanMessages wsman.Messages IsCIRA bool