milestonexprotectwspython.xpwrecordercommandservice

Module: xpwrecordercommandservice.py

Revision History

Date Version Description
2023/07/11 1.0.0.0 Initial Version.

@export
class XPWRecorderCommandService(milestonexprotectwspython.xpwwebservicebase.XPWWebServiceBase):

The Recorder Command Service SOAP web service provides access to XProtect Recording Server functions in a given installation.

XPWRecorderCommandService( loginInfo: milestonexprotectwspython.xpwlogininfo.XPWLoginInfo = None)

Initializes a new instance of the class.

Arguments:
  • loginInfo (XPWLoginInfo): Login Information class that contains login token information. This class is returned on a successful call to any of the LoginX methods from classes that inherit from XPWWebServiceBase. This allows you to share the same Login Information (token, etc) between service classes.
    Specify null / None to not share Login Information; if doing so, then your first call must be to one of the Login methods (e.g. LoginBasicUser, LoginWindowsUser, etc).
    Default is null / None.
Raises:
  • XPWException: The method fails for any reason.
RecordingServerUrlPrefix: str

URL prefix of the XProtect Recording Server.

Returns:

The RecordingServerUrlPrefix property value.

This url prefix is used to call various web-services that are hosted by the XProtect Recording Server. These services include the RecorderCommandService.asmx, etc.

It should only contain the server name (and port number if required) portion of the server url (e.g. "https://xprotectrecordingserver.example.com", or "https://xprotectrecordingserver.example.com:443").

It should NOT contain any of the server web-service method names or paths (e.g. "https://xprotectrecordingserver.example.com/RecorderCommandService/RecorderCommandService.asmx").

def IsManualRecording( self, deviceIds: list[str]) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Returns the manual recording status of one or more specified device id's.

Arguments:
  • deviceIds (list[str]): A list of device id strings to query for manual recording status.
Returns:

A collection of XPWManualRecording objects that contain manual recording statuses for the specified device id(s).

Raises:
  • XPWException: deviceIds argument is null, or an empty list, or is not of type list.
    Login authentication type "X" not implemented for this method.
    The method fails for any other reason.

If manual recording on a device is not active (false), it does not necessarily mean that the device has stopped recording. The device might still record because of other recording rules, just not because of manual recording. If a given device is not recognized then the value sent back for the device is false.

An XPWManualRecording item is still created if a device id is not found; in this case, it's IsManualRecording property will be set to False. XProtect web-services does not treat this as an error condition, so neither do we.

Sample Code

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# determine if device(s) is manually recording.
items:XPWCollection = svc.IsManualRecording(["f0f31f69-36a2-46a3-80b6-48e4bf617db8", "71cab37e-8718-4383-8e86-146b38168e42"])
print("** IsManualRecording Item Summary:\n{0}\n".format(items))

def JPEGGetAt( self, deviceId: str, time: datetime.datetime, title: str = None) -> milestonexprotectwspython.xpwjpegdata.XPWJpegData:

Get image from a given device as JPEG, at a given time or the nearest one (either before or after).

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • time (datetime): Requested image time as UTC
  • title (str): Title to assign to the image.
    If null, then the deviceId argument value will be used.
Returns:

An XPWJpegData class that contains JPEG image data.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    time argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

If no image is available, the response is a JPEGData structure with time set to minimum dateTime and data set to nothing.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwjpegdata import XPWJpegData
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get first jpeg image at or near the specified time.
item:XPWJpegData = svc.JPEGGetAt("71cab37e-8718-4383-8e86-146b38168e42", datetime(2023,9,21), "My Camera")
print("** JPEGGetAt Item Summary:\n{0}\n".format(item))

# save jpeg image to file.
if (item.HasData):
    item.SaveToFile("./tests/logfiles/TestCase_JPEGGetAt_{title}_{time}.jpg")
    print("** JPEGGetAt Item Saved:\n{0}\n".format(item.SaveToFilePath))

def JPEGGetAtOrAfter( self, deviceId: str, time: datetime.datetime, title: str = None) -> milestonexprotectwspython.xpwjpegdata.XPWJpegData:

Get image from a given device as JPEG, at a given time or the nearest one after.

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • time (datetime): Requested image time as UTC
  • title (str): Title to assign to the image.
    If null, then the deviceId argument value will be used.
Returns:

An XPWJpegData class that contains JPEG image data.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    time argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

If no image is available, the response is a JPEGData structure with time set to minimum dateTime and data set to nothing.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwjpegdata import XPWJpegData
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get first jpeg image at or after the specified time.
item:XPWJpegData = svc.JPEGGetAtOrAfter("71cab37e-8718-4383-8e86-146b38168e42", datetime(2023,9,21), "My Camera")
print("** JPEGGetAtOrAfter Item Summary:\n{0}\n".format(item))

# save jpeg image to file.
if (item.HasData):
    item.SaveToFile("./tests/logfiles/TestCase_JPEGGetAtOrAfter_{title}_{time}.jpg")
    print("** JPEGGetAtOrAfter Item Saved:\n{0}\n".format(item.SaveToFilePath))

def JPEGGetAtOrBefore( self, deviceId: str, time: datetime.datetime, title: str = None) -> milestonexprotectwspython.xpwjpegdata.XPWJpegData:

Get image from a given device as JPEG, at a given time or the nearest one before.

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • time (datetime): Requested image time as UTC
  • title (str): Title to assign to the image.
    If null, then the deviceId argument value will be used.
Returns:

An XPWJpegData class that contains JPEG image data.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    time argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

If no image is available, the response is a JPEGData structure with time set to minimum dateTime and data set to nothing.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwjpegdata import XPWJpegData
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get first jpeg image at or before the specified time.
item:XPWJpegData = svc.JPEGGetAtOrBefore("71cab37e-8718-4383-8e86-146b38168e42", datetime(2023,9,21), "My Camera")
print("** JPEGGetAtOrBefore Item Summary:\n{0}\n".format(item))

# save jpeg image to file.
if (item.HasData):
    item.SaveToFile("./tests/logfiles/TestCase_JPEGGetAtOrBefore_{title}_{time}.jpg")
    print("** JPEGGetAtOrBefore Item Saved:\n{0}\n".format(item.SaveToFilePath))

def JPEGGetLive( self, deviceId: str, maxWidth: int = 100, maxHeight: int = 100, title: str = None) -> milestonexprotectwspython.xpwjpegdata.XPWJpegData:

Gets a live image from a given device as JPEG (i.e. encoded from last keyframe).

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • maxWidth (int): Maximum width of the returned image.
    Note that this will never be larger than the max resolution that the device supports.
    Default is 100 pixels.
  • maxHeight (int): Maximum height of the returned image.
    Note that this will never be larger than the max resolution that the device supports.
    Default is 100 pixels.
  • title (str): Title to assign to the image.
    If null, then the deviceId argument value will be used.
Returns:

An XPWJpegData class that contains JPEG image data.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    maxWidth argument is null or less than 100.
    maxHeight argument is null or less than 100.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

If no image is available, the response is a JPEGData structure with time set to minimum dateTime and data set to nothing.

Sample Code

# package imports.
from milestonexprotectwspython.xpwjpegdata import XPWJpegData
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get live jpeg image in 1280 x 720 resolution.
item:XPWJpegData = svc.JPEGGetLive("71cab37e-8718-4383-8e86-146b38168e42", 1280, 720, "My Camera (1280x720)")
print("** JPEGGetLive Item Summary:\n{0}\n".format(item))

# save jpeg image to file.
if (item.HasData):
    item.SaveToFile("./tests/logfiles/TestCase_JPEGGetLive_{title}_{time}.jpg")
    print("** JPEGGetLive Item Saved:\n{0}\n".format(item.SaveToFilePath))

# get live jpeg image in 100 x 100 resolution.
item:XPWJpegData = svc.JPEGGetLive("71cab37e-8718-4383-8e86-146b38168e42", 100, 100, "My Camera (100x100)")
print("** JPEGGetLive Item Summary:\n{0}\n".format(item))

# save jpeg image to file.
if (item.HasData):
    item.SaveToFile("./tests/logfiles/TestCase_JPEGGetLive_{title}_{time}.jpg")
    print("** JPEGGetLive Item Saved:\n{0}\n".format(item.SaveToFilePath))

def SequencesGet( self, deviceId: str, sequenceType: str, minTime: datetime.datetime, maxTime: datetime.datetime, maxCount: int) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Get chronological list of sequences for a given sequence type with specified minimum time, maximum time and maximum count.

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • sequenceType (str): The requested sequence type id.
    This should be a value returned from a call to the SequencesGetTypes method.
  • minTime (datetime): Minimum sequence date and time to search for, in UTC format.
  • maxTime (datetime): Maximum sequence date and time to search for, in UTC format.
  • maxCount (int): Maximum number of sequences to return.
Returns:

A collection of XPWRecorderSequenceEntry objects that contains sequence types for the specified device id.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    sequenceType argument is null or an empty string.
    minTime argument is null, or year is less than 1800, or greater than datetime.max.
    maxTime argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

Sequences are processed onwards from minTime and are sorted by TimeBegin.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService
from milestonexprotectwspython.xpwrecordersequencetype import XPWRecorderSequenceType

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get sequences between datetimes for specified device id.
items:XPWCollection = svc.SequencesGet("71cab37e-8718-4383-8e86-146b38168e42", XPWRecorderSequenceType.RECORDING_SEQUENCE, datetime(2023,9,20), datetime(2023,9,21,23,59,59), 5)
print("** SequencesGet Item Summary:\n{0}\n".format(items))

def SequencesGetAround( self, deviceId: str, sequenceType: str, centerTime: datetime.datetime, maxCountBefore: int, maxCountAfter: int) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Get chronological list of sequences for a given sequence type with specified center time, maximum count before center time and maximum count after center time.

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • sequenceType (str): The requested sequence type id.
    This should be a value returned from a call to the SequencesGetAroundTypes method.
  • centerTime (datetime): Minimum sequence date and time to search for, in UTC format.
  • maxCountBefore (int): Maximum number of sequences before the centerTime to return.
  • maxCountAfter (int): Maximum number of sequences after the centerTime to return.
Returns:

A collection of XPWRecorderSequenceEntry objects that contains sequence types for the specified device id.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    sequenceType argument is null or an empty string.
    centerTime argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

A sequence with TimeBegin equal to centertime will increase "after" count.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService
from milestonexprotectwspython.xpwrecordersequencetype import XPWRecorderSequenceType

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get sequences around datetime for specified device id.
items:XPWCollection = svc.SequencesGetAround("71cab37e-8718-4383-8e86-146b38168e42", XPWRecorderSequenceType.RECORDING_SEQUENCE, datetime(2023,7,20,15,16), 2, 2)
print("** SequencesGetAround Item Summary:\n{0}\n".format(items))

def SequencesGetAroundWithSpan( self, deviceId: str, sequenceType: str, centerTime: datetime.datetime, maxTimeBefore: int, maxCountBefore: int, maxTimeAfter: int, maxCountAfter: int) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Get chronological list of sequences for a given sequence type with specified center time, maximum count before center time and maximum count after center time. Furthermore, search is limited before and after centertime by maximum timespans.

Arguments:
  • deviceId (str): Device ID to obtain the data from.
  • sequenceType (str): The requested sequence type id.
    This should be a value returned from a call to the SequencesGetAroundWithSpanTypes method.
  • centerTime (datetime): Minimum sequence date and time to search for, in UTC format.
  • maxTimeBefore (int): Maximum amount of time (in milliseconds) before the centerTime to return sequences for.
  • maxCountBefore (int): Maximum number of sequences before the centerTime to return.
  • maxTimeAfter (int): Maximum amount of time (in milliseconds) after the centerTime to return sequences for.
  • maxCountAfter (int): Maximum number of sequences after the centerTime to return.
Returns:

A collection of XPWRecorderSequenceEntry objects that contains sequence types for the specified device id.

Raises:
  • XPWException: deviceId argument is null or an empty string.
    sequenceType argument is null or an empty string.
    centerTime argument is null, or year is less than 1800, or greater than datetime.max.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

Sample Code

# external package imports.
from datetime import datetime

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService
from milestonexprotectwspython.xpwrecordersequencetype import XPWRecorderSequenceType

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get sequences around datetime with span for specified device id.
items:XPWCollection = svc.SequencesGetAroundWithSpan("71cab37e-8718-4383-8e86-146b38168e42", XPWRecorderSequenceType.RECORDING_SEQUENCE, datetime(2023,9,21,2,30), 6000000000, 5, 6000000000, 5)
print("** SequencesGetAroundWithSpan Item Summary:\n{0}\n".format(items))

def SequencesGetTypes( self, deviceId: str) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Gets a collection of available sequence types for a given device.

Arguments:
  • deviceId (str): The device id string to query for sequence types.
Returns:

A collection of XPWRecorderSequenceType objects that contains sequence types for the specified device id.

Raises:
  • XPWException: deviceId argument is null or an empty list.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

Common sequence types are: RecordingSequence = {F9C62604-D0C5-4050-AE25-72DE51639B14}
MotionSequence = {53CB5E33-2183-44bd-9491-8364D2457480}
RecordingWithTriggerSequence = {0601D294-B7E5-4d93-9614-9658561AD5E4}

Sample Code

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService
from milestonexprotectwspython.xpwrecordersequencetype import XPWRecorderSequenceType

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# get sequence types for device id.
items:XPWCollection = svc.SequencesGetTypes("f0f31f69-36a2-46a3-80b6-48e4bf617db8")
print("** SequencesGetTypes Item Summary:\n{0}\n".format(items))

def StartManualRecording( self, deviceIds: list[str]) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Requests a start of manual recording on a device(s).

Arguments:
  • deviceIds (list[str]): A list of device id strings to start manually recording on.
Returns:

A collection of XPWManualRecordingResult objects that contain manual recording statuses for the specified device id(s).

Raises:
  • XPWException: deviceIds argument is null, or an empty list, or is not of type list.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

The start manual recording request will start recording on the device if recording has not already been started because of other rules. A service channel event is sent when the evaluation of start manual recording has been made. If manual recording is already active, the command is simply ignored, but the request is still successful.

Sample Code

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# start recording manually for the device(s).
items:XPWCollection = svc.StartManualRecording(["f0f31f69-36a2-46a3-80b6-48e4bf617db8", "71cab37e-8718-4383-8e86-146b38168e42"])
print("** StartManualRecording Item Summary:\n{0}\n".format(items))

def StopManualRecording( self, deviceIds: list[str]) -> milestonexprotectwspython.xpwcollection.XPWCollection:

Requests a stop of manual recording on a device(s).

Arguments:
  • deviceIds (list[str]): A list of device id strings to stop manually recording on.
Returns:

A collection of XPWManualRecordingResult objects that contain manual recording statuses for the specified device id(s).

Raises:
  • XPWException: deviceIds argument is null, or an empty list, or is not of type list.
    Login.Authentication type "X" not implemented for this method.
    The method failed for any other reason.

Note that stopping manual recording does not necessary mean that the device stops recording. The device might still record because of other recording rules, just not because of manual recording. A service channel event is sent when the evaluation of stop manual recording has been made. If manual recording is already stopped, the command is simply ignored but the request is still successful.

Sample Code

# package imports.
from milestonexprotectwspython.xpwcollection import XPWCollection
from milestonexprotectwspython.xpwlogininfo import XPWLoginInfo
from milestonexprotectwspython.xpwrecordercommandservice import XPWRecorderCommandService

# create service instance and set server prefixes for our environment.
svc:XPWRecorderCommandService = XPWRecorderCommandService()
svc.ManagementServerUrlPrefix = "https://mymanagementserver.example.com"
svc.RecordingServerUrlPrefix =  "http://myrecordingserver.example.com:7563"
svc.IsSslVerifyEnabled = False

# authenticate using xprotect windows auth credentials.
loginInfo:XPWLoginInfo = svc.LoginWindowsUser("MYDOMAIN\XProtectUser", "MyPassword&1")
print("** Login Details:\n{0}\n".format(loginInfo))

# stop recording manually for the device(s).
items:XPWCollection = svc.StopManualRecording(["f0f31f69-36a2-46a3-80b6-48e4bf617db8", "71cab37e-8718-4383-8e86-146b38168e42"])
print("** StopManualRecording Item Summary:\n{0}\n".format(items))