Source code for api.cases.v2.case

"""Autogenerated API"""

from argus_cli.plugin import register_command





[docs]@register_command(extending=("cases","v2","case")) def create_case( service: str = None, category: str = None, type: str = None, status: str = None, watchers: list = None, fields: list = None, subject: str = None, description: str = None, customerReference: str = None, aclMembers: list = None, originEmailAddress: str = None, publish: bool = True, defaultWatchers: bool = True, priority: str = "medium", accessMode: str = "roleBased", customerID: int = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Create a new case defined by CaseCreateRequest (PUBLIC) :param str service: ID of service to create case for :param str category: If set, assign given category to new case (by category shortname). :param str type: Type of case to create :param str status: Status of case to create. If not set, system will select automatically. :param list watchers: Explicit watchers to add to this case. :param list fields: Fields to set on case creation. Fields in the policy for requested service and customer specifies fields available. If any of the fields in the policy are required on create, and do not have a default value,those fields must be set in the case create request, or the request will fail. :param str subject: Subject of case to create. => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]* :param str description: Case description. May use HTML, which will be sanitized. :param str customerReference: Customer reference for case. => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]* :param list aclMembers: Explicit ACL members to add to case. :param str originEmailAddress: If case is created from an email, specify origin email address here => format:email :param bool publish: Whether to publish new case. Creating an unpublished case requires special permission. (default true) :param bool defaultWatchers: Whether to enable default watchers for this case. If set to false, default watchers will not be enabled, and will not be notified upon creation of this case. (default true) :param str priority: Priority of case to create. (default medium) :param str accessMode: Access mode for new case. (default roleBased) :param int customerID: ID of customer to create case for (default 0) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {'offset': 875, 'limit': 163, 'responseCode': 200, 'count': 751, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Per people push create officer direction hard at.', 'messageTemplate': 'Tree everyone weight know condition sometimes remember.', 'field': 'Explain argue nation strategy guess.', 'parameter': {}, 'timestamp': 1438119499}], 'currentPage': 42, 'size': 617} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "publish": publish, "defaultWatchers": defaultWatchers, "priority": priority, "accessMode": accessMode, "customerID": customerID, "service": service, "category": category, "type": type, "status": status, "watchers": watchers, "fields": fields, "subject": subject, "description": description, "customerReference": customerReference, "aclMembers": aclMembers, "originEmailAddress": originEmailAddress } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def search_case_statistics( limit: int = None, offset: int = None, subCriteria: list = None, customerID: list = None, caseID: list = None, type: list = None, service: list = None, category: list = None, status: list = None, priority: list = None, startTimestamp: int = None, endTimestamp: int = None, assetID: list = None, tag: list = None, workflow: list = None, field: list = None, keywords: list = None, timeFieldStrategy: list = None, timeMatchStrategy: str = None, keywordFieldStrategy: list = None, keywordMatchStrategy: str = None, userID: list = None, userFieldStrategy: list = None, groupBy: list = None, values: list = None, resolution: int = None, cutoff: int = None, cutoffValue: str = None, sortBy: list = None, includeFlags: list = None, excludeFlags: list = None, includeDeleted: bool = None, exclude: bool = None, required: bool = None, userAssigned: bool = None, techAssigned: bool = None, includeOthers: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Returns statistics data matching the defined CaseStatsSearchCriteria (PUBLIC) :param int limit: Set this value to set max number of results. By default, no restriction on result set size. :param int offset: Set this value to skip the first (offset) objects. By default, return result from first object. :param list subCriteria: :param list customerID: Restrict search to data belonging to specified customers. :param list caseID: Restrict search to specific cases (by ID). :param list type: Restrict search to entries of one of these types. :param list service: Restrict search to entries of one of these services (by service shortname or ID). :param list category: Restrict search to entries of one of these categories (by category shortname or ID). :param list status: Restrict search to entries of one of these statuses. :param list priority: Restrict search to entries with given priorties :param int startTimestamp: Restrict search to a time frame based on the set TimeFieldStrategy (start timestamp). :param int endTimestamp: Restrict search to a time frame based on the set TimeFieldStrategy (end timestamp). :param list assetID: Restrict search to cases associated with specified assets (hosts, services or processes) :param list tag: Restrict search to entries matching the given tag criteria. :param list workflow: Restrict search to entries matching the given workflow criteria. :param list field: Restrict search to entries matching the given field criteria. :param list keywords: Search for keywords. :param list timeFieldStrategy: Defines which timestamps will be included in the search (default lastUpdatedTimestamp). :param str timeMatchStrategy: Defines how strict to match against different timestamps (all/any) using start and end timestamp (default any) :param list keywordFieldStrategy: Defines which fields will be searched by keywords (default all supported fields). :param str keywordMatchStrategy: Defines the MatchStrategy for keywords (default match all keywords). :param list userID: Restrict search to cases associated with these users. :param list userFieldStrategy: Defines which user fields will be searched (default match all user fields). :param list groupBy: Specify which fields will be grouped by in stats :param list values: Specify which values will be included in stats (default created) :param int resolution: Stats resolution period in milliseconds, if is 0 means to generate non-timeline statistics :param int cutoff: Reduce stats keys to the cutoff amount of keys that has largest hit count, default 0 means no reduce :param str cutoffValue: Specify which value to be cutoff on (default created) :param list sortBy: List of properties to sort by (prefix with "-" to sort descending). :param list includeFlags: Only include objects which have includeFlags set. :param list excludeFlags: Exclude objects which have excludeFlags set. :param bool includeDeleted: Set to true to include deleted objects. By default, exclude deleted objects. :param bool exclude: Only relevant for subcriteria. If set to true, objects matching this subcriteria object will be excluded. :param bool required: Only relevant for subcriteria. If set to true, objects matching this subcriteria are required (AND-ed together with parent criteria). :param bool userAssigned: If set, limit search to cases where assignedUser field is set/unset :param bool techAssigned: If set, limit search to cases where assignedTech field is set/unset :param bool includeOthers: If reduce (cutoff>0), true means remaining keys (other than cutoff keys) are collected into an "other" key, default false :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {'offset': 225, 'limit': 414, 'responseCode': 200, 'count': 537, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'When for able.', 'messageTemplate': 'Fund court individual pay.', 'field': 'Much word American country determine agreement still crime.', 'parameter': {}, 'timestamp': 1480699472}], 'currentPage': 783, 'size': 249} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/stats".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "limit": limit, "offset": offset, "includeDeleted": includeDeleted, "subCriteria": subCriteria, "exclude": exclude, "required": required, "customerID": customerID, "caseID": caseID, "type": type, "service": service, "category": category, "status": status, "priority": priority, "startTimestamp": startTimestamp, "endTimestamp": endTimestamp, "assetID": assetID, "tag": tag, "workflow": workflow, "field": field, "keywords": keywords, "timeFieldStrategy": timeFieldStrategy, "timeMatchStrategy": timeMatchStrategy, "keywordFieldStrategy": keywordFieldStrategy, "keywordMatchStrategy": keywordMatchStrategy, "userID": userID, "userFieldStrategy": userFieldStrategy, "userAssigned": userAssigned, "techAssigned": techAssigned, "groupBy": groupBy, "values": values, "resolution": resolution, "cutoff": cutoff, "cutoffValue": cutoffValue, "includeOthers": includeOthers, "sortBy": sortBy, "includeFlags": includeFlags, "excludeFlags": excludeFlags } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def delete_case( caseID: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Mark existing case as deleted (PUBLIC) :param int caseID: Case ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 763, 'limit': 545, 'responseCode': 200, 'count': 432, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Dinner audience war mean baby both nature another.', 'messageTemplate': 'Stop important able sometimes through.', 'field': 'Employee summer smile special.', 'parameter': {}, 'timestamp': 806816402}], 'currentPage': 508, 'size': 257} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_case_a_c_l( caseID: int, offset: int = None, limit: int = 25, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List ACL entries for an existing case (PUBLIC) :param int caseID: Case ID :param int offset: Skip a number of results :param int limit: Maximum number of returned results :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 504, 'limit': 107, 'responseCode': 200, 'count': 50, 'data': [{'id': 'Question my color husband bring science enjoy.', 'addedTimestamp': 1259856747, 'addedByUser': {'id': 807, 'customerID': 464, 'userName': 'denise84', 'name': 'Kenneth Reeves'}, 'grantedSubject': {'id': 22, 'customerID': 202, 'name': 'David Stevens'}, 'flags': ['DELETED'], 'level': 'owner'}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Keep including carry never list give perhaps wind.', 'messageTemplate': 'Mean accept imagine ago full.', 'field': 'So often main which rest.', 'parameter': {}, 'timestamp': 1378971088}], 'currentPage': 751, 'size': 346} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "offset": offset, "limit": limit } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def grant_access( caseID: int, subjectID: int = None, level: str = "read", json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Grant access to a case (PUBLIC) :param int caseID: Case ID :param int subjectID: ID of subject (user or group) to grant access to. :param str level: Level to grant for subject. (default read) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 134, 'limit': 351, 'responseCode': 200, 'count': 83, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Share job action.', 'messageTemplate': 'Five start itself few may either.', 'field': 'Break pretty opportunity either.', 'parameter': {}, 'timestamp': 805365964}], 'currentPage': 199, 'size': 485} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "level": level, "subjectID": subjectID } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def change_access_settings( caseID: int, accessMode: str = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Change general access settings (PUBLIC) :param int caseID: Case ID :param str accessMode: If set, this will alter the access mode of the case. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 925, 'limit': 580, 'responseCode': 200, 'count': 8, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Former sport ability direction.', 'messageTemplate': 'Stock when full especially discussion.', 'field': 'Major create consider talk plan among style.', 'parameter': {}, 'timestamp': 599540245}], 'currentPage': 75, 'size': 395} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "accessMode": accessMode } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_access( caseID: int, aclEntryID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Revoke access from a case (PUBLIC) :param int caseID: Case ID :param str aclEntryID: ACL entry to revoke :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 662, 'limit': 631, 'responseCode': 200, 'count': 257, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Arm finally anything thus scene.', 'messageTemplate': 'Speak north prevent far exactly personal when relate.', 'field': 'Wide blood blue field thousand.', 'parameter': {}, 'timestamp': 863436746}], 'currentPage': 620, 'size': 701} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/access/{aclEntryID}".format(caseID=caseID, aclEntryID=aclEntryID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_case_attachments( caseID: int, offset: int = None, limit: int = 25, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List attachments for an existing case (PUBLIC) :param int caseID: Case ID :param int offset: Skip a number of results :param int limit: Maximum number of returned results :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 243, 'limit': 967, 'responseCode': 200, 'count': 612, 'data': [{'id': 'Guess agreement once account pressure often particular.', 'addedTimestamp': 240846390, 'addedByUser': {'id': 861, 'customerID': 549, 'userName': 'heatherzhang', 'name': 'Francisco Morrison'}, 'name': 'Cynthia Santana', 'mimeType': 'Drug protect five modern until according.', 'flags': ['ZIP_ENCRYPTED'], 'size': 814}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Involve room one here front man to.', 'messageTemplate': 'About already who discuss.', 'field': 'Trouble everyone place move could.', 'parameter': {}, 'timestamp': 577713055}], 'currentPage': 543, 'size': 823} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "offset": offset, "limit": limit } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def add_attachment( caseID: int, name: str = None, mimeType: str = None, data: str = None, encryptedZip: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Add new attachment (PUBLIC) Upload new attachment as JSON object with base64-encoded data :param int caseID: Case ID :param str name: Name of attachment to add. => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]* :param str mimeType: MimeType for attachment to add. => Sanitize by regex [^ /]+/[^ /]+ :param str data: Attachment bytes :param bool encryptedZip: If set, mark this attachment as an encrypted zip (should have password 'argus'). NOTE: the service does not encrypt or zip the attachment, this should be done by the client. (default false) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 914, 'limit': 137, 'responseCode': 200, 'count': 588, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Environmental myself note especially.', 'messageTemplate': 'Recognize do single western.', 'field': 'Before performance over.', 'parameter': {}, 'timestamp': 644748327}], 'currentPage': 808, 'size': 299} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "name": name, "mimeType": mimeType, "data": data, "encryptedZip": encryptedZip } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def get_attachment( caseID: int, attachmentID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Fetch specific attachment metadata (PUBLIC) Use /cases/v1/case/{caseID}/attachments/{attachmentID}/download to download attachment contents. :param int caseID: Case ID :param str attachmentID: Attachment ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 701, 'limit': 873, 'responseCode': 200, 'count': 906, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Dog through sing fly begin natural laugh they.', 'messageTemplate': 'Allow low news line.', 'field': 'Will no chance score nor late for.', 'parameter': {}, 'timestamp': 1122867823}], 'currentPage': 917, 'size': 884} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}".format(caseID=caseID, attachmentID=attachmentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def delete_attachment( caseID: int, attachmentID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Delete specified attachment from case (PUBLIC) :param int caseID: Case ID :param str attachmentID: Attachment ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 367, 'limit': 750, 'responseCode': 200, 'count': 110, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Cup drive most manager difference.', 'messageTemplate': 'Couple yes safe always simply something heart.', 'field': 'Guess president still total leg.', 'parameter': {}, 'timestamp': 548962518}], 'currentPage': 908, 'size': 718} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}".format(caseID=caseID, attachmentID=attachmentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def download_attachment( caseID: int, attachmentID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Download specific attachment contents. (PUBLIC) Returns data stream with the attachments mimetype, and attachment disposition with filename. Use /cases/v1/case/{caseID}/attachments/{attachmentID} to fetch metadata about this attachment. :param int caseID: Case ID :param str attachmentID: Attachment ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}/download".format(caseID=caseID, attachmentID=attachmentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def close_case( caseID: int, comment: str = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Close an open case (PUBLIC) :param int caseID: Case ID :param str comment: Closing comment to add to case. May use HTML, will be sanitized. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 197, 'limit': 316, 'responseCode': 200, 'count': 816, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Good bar know suffer seek.', 'messageTemplate': 'Production establish really answer share tree Congress.', 'field': 'Great present else.', 'parameter': {}, 'timestamp': 1011494538}], 'currentPage': 497, 'size': 398} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/close".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "comment": comment } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_case_comments( caseID: int, offset: int = None, limit: int = 25, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List comments for an existing case (PUBLIC) :param int caseID: Case ID :param int offset: Skip a number of results :param int limit: Maximum number of returned results :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 844, 'limit': 926, 'responseCode': 200, 'count': 698, 'data': [{'id': 'Strong and loss matter others administration.', 'addedTimestamp': 143631758, 'addedByUser': {'id': 319, 'customerID': 218, 'userName': 'christinachang', 'name': 'Mary Stewart'}, 'comment': 'Start chair goal environmental image per glass third.', 'reference': 'Mission face reveal record eight father might you.', 'flags': ['INTERNAL'], 'status': 'workingCustomer', 'priority': 'medium', 'properties': {'additionalProperties': 'Soon pretty speak Congress remain own again.'}}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Leader probably little voice herself sea into executive.', 'messageTemplate': 'Explain store right agreement cost apply high pretty.', 'field': 'Discuss government process sign building interview.', 'parameter': {}, 'timestamp': 41117217}], 'currentPage': 258, 'size': 17} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/comments".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "offset": offset, "limit": limit } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def add_comment( caseID: int, asReplyTo: str = None, comment: str = None, originEmailAddress: str = None, internal: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Submit new comment to case (PUBLIC) :param int caseID: Case ID :param str asReplyTo: Optional ID of comment to reply to. :param str comment: Comment to add. Html is allowed, will be sanitized. :param str originEmailAddress: If comment is added from an email, specify origin email address here => format:email :param bool internal: If true, mark comment as internal, only visible to service techs. Default is false. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 244, 'limit': 811, 'responseCode': 200, 'count': 97, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Newspaper language day guy.', 'messageTemplate': 'Then your however let follow.', 'field': 'Improve movie easy.', 'parameter': {}, 'timestamp': 1112363513}], 'currentPage': 466, 'size': 552} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/comments".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "asReplyTo": asReplyTo, "comment": comment, "internal": internal, "originEmailAddress": originEmailAddress } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def get_case_comment( caseID: int, commentID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Fetch specific comment (PUBLIC) :param int caseID: Case ID :param str commentID: Comment ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 145, 'limit': 998, 'responseCode': 200, 'count': 351, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Skin speech surface my feeling change there decide.', 'messageTemplate': 'Speak service drop agency.', 'field': 'Gun news item heavy board Mr edge major.', 'parameter': {}, 'timestamp': 1357156381}], 'currentPage': 14, 'size': 840} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/comments/{commentID}".format(caseID=caseID, commentID=commentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def edit_comment( caseID: int, commentID: str, comment: str = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Edit existing comment (PUBLIC) :param int caseID: Case ID :param str commentID: Comment ID :param str comment: Updated comment :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 584, 'limit': 446, 'responseCode': 200, 'count': 587, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Tell medical sing foreign reveal film.', 'messageTemplate': 'Actually pull shake follow time.', 'field': 'Over set thought exactly may western commercial four.', 'parameter': {}, 'timestamp': 979042969}], 'currentPage': 908, 'size': 847} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/comments/{commentID}".format(caseID=caseID, commentID=commentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "comment": comment } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def delete_comment( caseID: int, commentID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Mark existing comment as deleted (PUBLIC) :param int caseID: Case ID :param str commentID: Comment ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 402, 'limit': 81, 'responseCode': 200, 'count': 553, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Must doctor sea all citizen authority walk.', 'messageTemplate': 'Policy beautiful blue grow whom issue meet.', 'field': 'Perhaps toward role each nothing week certainly.', 'parameter': {}, 'timestamp': 545433885}], 'currentPage': 852, 'size': 251} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/comments/{commentID}".format(caseID=caseID, commentID=commentID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def publish_case( caseID: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Publish existing case not marked as published (PUBLIC) :param int caseID: Case ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 793, 'limit': 866, 'responseCode': 200, 'count': 161, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Official teach project reality.', 'messageTemplate': 'For maybe color simply program production.', 'field': 'Seek career deal send hit summer policy international.', 'parameter': {}, 'timestamp': 7128057}], 'currentPage': 174, 'size': 239} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/publish".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_case_tags( caseID: int, offset: int = None, limit: int = 25, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List tags for an existing case (PUBLIC) :param int caseID: Case ID :param int offset: Skip a number of results :param int limit: Maximum number of returned results :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 891, 'limit': 862, 'responseCode': 200, 'count': 184, 'data': [{'id': 'Pattern fast early best.', 'addedTimestamp': 695948043, 'addedByUser': {'id': 736, 'customerID': 691, 'userName': 'richard00', 'name': 'Mary Johns'}, 'key': 'Simply wear yeah remain.', 'value': 'Head part mind decision.', 'flags': ['MERGED']}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Scientist down cultural media situation win participant.', 'messageTemplate': 'Month wrong bar future me peace what.', 'field': 'Everybody expect movie network question specific remain.', 'parameter': {}, 'timestamp': 868981240}], 'currentPage': 567, 'size': 573} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/tags".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "offset": offset, "limit": limit } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def add_case_tag( caseID: int, tags: list = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Add tag to case (PUBLIC) :param int caseID: Case ID :param list tags: Add multiple tags as key/value strings or JSON objects :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 120, 'limit': 945, 'responseCode': 200, 'count': 316, 'data': [{'id': 'After shoulder expect learn reflect prepare sister.', 'addedTimestamp': 479061527, 'addedByUser': {'id': 978, 'customerID': 391, 'userName': 'hfrench', 'name': 'Randall Potter'}, 'key': 'No in these specific tree chair.', 'value': 'Since work act save but eat catch.', 'flags': ['DELETED']}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Wide meeting lot must debate government.', 'messageTemplate': 'Music word laugh film practice such when what.', 'field': 'Painting answer blood hard environmental.', 'parameter': {}, 'timestamp': 1155652245}], 'currentPage': 953, 'size': 812} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/tags".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "tags": tags } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_case_tag_by_id( caseID: int, tagID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Remove existing tag (PUBLIC) :param int caseID: Case ID :param str tagID: Tag ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 21, 'limit': 458, 'responseCode': 200, 'count': 202, 'data': [{'id': 'Pass total every among produce other final.', 'addedTimestamp': 494931411, 'addedByUser': {'id': 338, 'customerID': 93, 'userName': 'joelkaiser', 'name': 'Chris Stuart'}, 'key': 'Difference move man view bed offer short.', 'value': 'Attack professional cut apply under worker.', 'flags': ['DELETED']}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Number professor six executive history.', 'messageTemplate': 'Our fall personal sure economy.', 'field': 'Certain process view discuss same foot.', 'parameter': {}, 'timestamp': 1235401959}], 'currentPage': 288, 'size': 604} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/tags/{tagID}".format(caseID=caseID, tagID=tagID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_case_tag_by_key_value( caseID: int, tagKey: str, tagValue: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Remove existing tag (PUBLIC) :param int caseID: Case ID :param str tagKey: Tag Key :param str tagValue: Tag Value :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 954, 'limit': 759, 'responseCode': 200, 'count': 988, 'data': [{'id': 'Go science Republican body population continue over.', 'addedTimestamp': 593106208, 'addedByUser': {'id': 219, 'customerID': 711, 'userName': 'randy59', 'name': 'Eric Alvarez'}, 'key': 'High hard series their.', 'value': 'Interview heavy dinner interview line.', 'flags': ['DELETED']}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Control base why miss real.', 'messageTemplate': 'Behind dinner weight next.', 'field': 'Upon choice poor cut add lead instead.', 'parameter': {}, 'timestamp': 1368707931}], 'currentPage': 572, 'size': 58} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/tags/{tagKey}/{tagValue}".format(caseID=caseID, tagKey=tagKey, tagValue=tagValue) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def current_user_watcher_status( caseID: int, email: bool = None, sms: bool = None, verbose: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Query and set watcher status for the current user on this case (PUBLIC) :param int caseID: Case ID :param bool email: If true, enable email notification for current user. If false, disable email. Default is no change. :param bool sms: If true, enable SMS notification for current user. If false, disable SMS. Default is no change. :param bool verbose: If set, explicitly set verbosity for watcher for enabled contact methods (will override default settings on current user) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 660, 'limit': 738, 'responseCode': 200, 'count': 455, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'At difference she woman.', 'messageTemplate': 'Sound future follow your the back home.', 'field': 'Dog trial majority.', 'parameter': {}, 'timestamp': 628588417}], 'currentPage': 250, 'size': 567} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watch".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "email": email, "sms": sms, "verbose": verbose } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_current_user_watcher( caseID: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Remove the current user from the watchlist of this case.If the currentuser is a contact, this will override the contact settings for the current user for this case. (PUBLIC) :param int caseID: Case ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 200, 'limit': 196, 'responseCode': 200, 'count': 358, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Stage class prove drive physical kind.', 'messageTemplate': 'Property this than year top.', 'field': 'White fund high throughout individual role support later.', 'parameter': {}, 'timestamp': 496265199}], 'currentPage': 143, 'size': 804} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watch".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_case_watchers( caseID: int, offset: int = None, limit: int = 25, includeExplicit: bool = True, includeDefault: bool = True, includeDisabled: bool = True, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List watchers for an existing case (PUBLIC) :param int caseID: Case ID :param int offset: Skip a number of results :param int limit: Maximum number of returned results :param bool includeExplicit: Include explicit watchers (default true) :param bool includeDefault: Include default watchers (default true) :param bool includeDisabled: Include disabled watchers (default false) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 286, 'limit': 952, 'responseCode': 200, 'count': 461, 'data': [{'id': 'Among board set admit couple.', 'addedTimestamp': 760141797, 'addedByUser': {'id': 229, 'customerID': 893, 'userName': 'nataliejones', 'name': 'Cynthia Perkins'}, 'flags': ['DELETED'], 'subject': {'id': 231, 'customerID': 123, 'name': 'Brandon Lopez'}, 'contactID': 813, 'role': 'watcher', 'destination': 'Fall serve they provide police budget.', 'minimumPriority': 'low'}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'All for interview the son same treat.', 'messageTemplate': 'Toward worry cold different together claim.', 'field': 'Site necessary various nation.', 'parameter': {}, 'timestamp': 449200271}], 'currentPage': 802, 'size': 268} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "offset": offset, "limit": limit, "includeExplicit": includeExplicit, "includeDefault": includeDefault, "includeDisabled": includeDisabled } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def add_case_watcher( caseID: int, subjectID: int = None, destination: str = None, type: str = "email", verbose: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Add watcher to case (PUBLIC) :param int caseID: Case ID :param int subjectID: Subject to add watcher for :param str destination: Contact information to add as watcher (email address or phone number). If subject is specified, this is ignored. :param str type: Type of watcher to add (default email) :param bool verbose: If set, explicitly set verbosity for watcher (will override default settings on subject) :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 851, 'limit': 675, 'responseCode': 200, 'count': 368, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Discussion real trade wrong.', 'messageTemplate': 'Response though well arm behavior they this.', 'field': 'Lay southern international place current treatment difference.', 'parameter': {}, 'timestamp': 1346362915}], 'currentPage': 725, 'size': 725} """ from requests import post from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "type": type, "subjectID": subjectID, "destination": destination, "verbose": verbose } response = post(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def update_watcher_settings( caseID: int, defaultWatchers: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Update general watcher settings on a case (PUBLIC) :param int caseID: Case ID :param bool defaultWatchers: If set, will enable/disable use of default watchers on this case. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 180, 'limit': 607, 'responseCode': 200, 'count': 367, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'She Republican little.', 'messageTemplate': 'Attorney learn challenge network morning Mrs.', 'field': 'Approach Mr authority involve thousand senior day.', 'parameter': {}, 'timestamp': 726829059}], 'currentPage': 251, 'size': 129} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "defaultWatchers": defaultWatchers } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_case_contact_watcher( caseID: int, contactID: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Remove a specific contact listed in the default watchers from watching this case (PUBLIC) :param int caseID: Case ID :param int contactID: Contact ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 751, 'limit': 145, 'responseCode': 200, 'count': 981, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Require lot probably modern interest heavy mention.', 'messageTemplate': 'Bit interesting enjoy material as study wear.', 'field': 'Interview surface enjoy fear soon.', 'parameter': {}, 'timestamp': 69939129}], 'currentPage': 331, 'size': 259} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers/contact/{contactID}".format(caseID=caseID, contactID=contactID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def update_case_watcher( caseID: int, watcherID: str, verbose: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Update settings for a specific watcher on a case (PUBLIC) :param int caseID: Case ID :param str watcherID: Watcher ID :param bool verbose: If set, will enable/disable verbose status for this watcher. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 958, 'limit': 661, 'responseCode': 200, 'count': 630, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Only evening stand item bring player management.', 'messageTemplate': 'Vote along whether.', 'field': 'Hard high dark just decide.', 'parameter': {}, 'timestamp': 328133486}], 'currentPage': 974, 'size': 596} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers/{watcherID}".format(caseID=caseID, watcherID=watcherID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "verbose": verbose } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def remove_case_watcher( caseID: int, watcherID: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Remove specific watcher from a case (PUBLIC) :param int caseID: Case ID :param str watcherID: Watcher ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 592, 'limit': 493, 'responseCode': 200, 'count': 342, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Until good mother think argue run site.', 'messageTemplate': 'Away various common realize station usually.', 'field': 'Sometimes sport shake information occur course rather.', 'parameter': {}, 'timestamp': 1442078934}], 'currentPage': 778, 'size': 606} """ from requests import delete from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers/{watcherID}".format(caseID=caseID, watcherID=watcherID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = delete(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def list_workflows( caseID: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """List workflows for an existing case (PUBLIC) :param int caseID: Case ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 667, 'limit': 45, 'responseCode': 200, 'count': 14, 'data': [{'id': 'Skin will than authority city.', 'addedTimestamp': 12217415, 'addedByUser': {'id': 171, 'customerID': 573, 'userName': 'psimpson', 'name': 'Jennifer Murray'}, 'workflow': 'tuning', 'acknowledgedByUser': {'id': 938, 'customerID': 222, 'userName': 'pamelaphelps', 'name': 'Daniel Preston'}, 'acknowledgedTimestamp': 1408504200, 'flags': ['DELETED']}], 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Mother admit everything I vote likely beautiful.', 'messageTemplate': 'Several fund everything around plant second.', 'field': 'Price foreign will sea parent.', 'parameter': {}, 'timestamp': 792575203}], 'currentPage': 402, 'size': 155} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows".format(caseID=caseID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def acknowledge_workflow( caseID: int, workflow: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Acknowledge workflow on case (PUBLIC) :param int caseID: Case ID :param str workflow: Workflow to acknowledge :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 389, 'limit': 243, 'responseCode': 200, 'count': 340, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Really fill once his shoulder second generation.', 'messageTemplate': 'Investment project coach ground.', 'field': 'Loss office production their.', 'parameter': {}, 'timestamp': 210417303}], 'currentPage': 868, 'size': 319} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows/{workflow}/acknowledge".format(caseID=caseID, workflow=workflow) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def request_workflow( caseID: int, workflow: str, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Request new workflow on case (PUBLIC) :param int caseID: Case ID :param str workflow: Workflow to request :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 751, 'limit': 640, 'responseCode': 200, 'count': 278, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Yeah remain matter black add scientist.', 'messageTemplate': 'Reality sit social.', 'field': 'Stand realize listen.', 'parameter': {}, 'timestamp': 1096762214}], 'currentPage': 246, 'size': 461} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows/{workflow}/request".format(caseID=caseID, workflow=workflow) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def get_case_metadata_by_id( id: int, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Returns the basic case descriptor for the case identified by ID (PUBLIC) :param int id: Case ID :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 452, 'limit': 985, 'responseCode': 200, 'count': 414, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Feeling offer standard pattern support total early.', 'messageTemplate': 'Air lay measure effort everything stuff still.', 'field': 'Indeed pressure gas require.', 'parameter': {}, 'timestamp': 148752906}], 'currentPage': 894, 'size': 641} """ from requests import get from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{id}".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { } response = get(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def update_case( id: int, subject: str = None, description: str = None, status: str = None, priority: str = None, category: str = None, reporterID: int = None, assignedUserID: int = None, assignedTechID: int = None, customerReference: str = None, comment: str = None, originEmailAddress: str = None, internalComment: bool = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Request changes to basic fields of an existing case (PUBLIC) :param int id: Case ID :param str subject: If set, change subject of case. => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]* :param str description: If set, change description of case. May use HTML, will be sanitized. :param str status: If set, change status of case :param str priority: If set, change priority of case. :param str category: If set, assign given category to specified category (by category shortname). Set value to empty string to unset category. :param int reporterID: If set, set given user as reporter for case. :param int assignedUserID: If set, assign given user to case. :param int assignedTechID: If set, assign given technical user (solution engineer) to case. :param str customerReference: If set, change customer reference for case. => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]* :param str comment: If set, add comment to case. May use HTML, will be sanitized. :param str originEmailAddress: If update is made from an email, specify origin email address here => format:email :param bool internalComment: If true, add comment as internal. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 693, 'limit': 839, 'responseCode': 200, 'count': 203, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Because southern action unit expert human.', 'messageTemplate': 'May control knowledge manage child.', 'field': 'Speak role in until.', 'parameter': {}, 'timestamp': 481836162}], 'currentPage': 613, 'size': 897} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{id}".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "subject": subject, "description": description, "status": status, "priority": priority, "category": category, "reporterID": reporterID, "assignedUserID": assignedUserID, "assignedTechID": assignedTechID, "customerReference": customerReference, "comment": comment, "internalComment": internalComment, "originEmailAddress": originEmailAddress } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def move_case( id: int, customerID: int = None, service: str = None, category: str = None, type: str = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Move a case to a differnet category, service or customer (PUBLIC) :param int id: Case ID :param int customerID: If set, move case to specified customer. :param str service: If set, move case to specified service. :param str category: If set, assign given category to specified category (by category shortname). Set value to empty string to unset category. :param str type: If set, move case to specified type. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {'offset': 943, 'limit': 695, 'responseCode': 200, 'count': 436, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Grow pretty hundred happen.', 'messageTemplate': 'Beautiful prepare rest friend audience little.', 'field': 'Meeting teach same occur.', 'parameter': {}, 'timestamp': 424671079}], 'currentPage': 206, 'size': 88} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{id}/move".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "customerID": customerID, "service": service, "category": category, "type": type } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=("cases","v2","case")) def merge_cases( mergeInto: int, mergeFrom: int, description: str = None, priority: str = None, status: str = None, json: bool = True, verify: bool = True, apiKey: str = None, authentication: dict = {} ) -> dict: """Merge two cases (PUBLIC) This will merge the contents of the mergeFrom case into the mergeInto case.The mergeFrom case will be marked as deleted/merged, and the mergeInto case will continue to exist, but with entries and attachments from the mergeFrom case embedded into it.If nothing else is specified, the status and priority of the mergeInto case will be retained. :param int mergeInto: ID of case to merge into :param int mergeFrom: ID of case to merge :param str description: Case description of merged case. May use HTML, which will be sanitized. If not set, the description of both cases will be combined. :param str priority: Priority of merged case. If not set, keep priority of mergeInto case. :param str status: Status of merged case. If not set, keep status of mergeInto case. :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {'offset': 452, 'limit': 990, 'responseCode': 200, 'count': 929, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Network black ability whole.', 'messageTemplate': 'Body put adult grow.', 'field': 'Huge yes stage especially total various collection.', 'parameter': {}, 'timestamp': 1375356575}], 'currentPage': 625, 'size': 265} """ from requests import put from argus_api.exceptions import http url = "https://portal.mnemonic.no/web/api/cases/v2/case/{mergeInto}/merge/{mergeFrom}".format(mergeInto=mergeInto, mergeFrom=mergeFrom) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = { "description": description, "priority": priority, "status": status } response = put(url, json=body if body else None, verify=verify, headers=headers ) if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response