"""Autogenerated API"""
import requests
from argus_cli.plugin import register_command
[docs]@register_command(extending=('cases','v2','case'))
def simple_case_search(customerID: list = None, service: list = None, status: list = None, type: list = None, keywords: list = None, offset: int = 0, limit: int = 25,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
"""Returns cases matching the query parameters (PUBLIC)
:param list customerID: Limit result to specified customers
:param list service: Limit result to specified services (service shortname)
:param list status: Limit result to specified statuses
:param list type: Limit result to specified types
:param list keywords: Search by keywords
: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
:returns: {"offset": 576, "limit": 564, "responseCode": 200, "count": 283, "data": [{"id": 235, "initialStatus": "workingSoc", "status": "closed", "initialPriority": "low", "priority": "high", "subject": "Paper hotel much goal matter.", "description": "Energy democratic fill question protect send.", "customerReference": "Student several for up fund certain against gun.", "accessMode": "explicit", "reporter": {"id": 654, "customerID": 319, "userName": "samanthamiller", "name": "Timothy Taylor"}, "assignedUser": {"id": 951, "customerID": 30, "userName": "gponce", "name": "Richard Stevens"}, "assignedTech": {"id": 27, "customerID": 221, "userName": "agentry", "name": "Jessica Moore"}, "createdTimestamp": 1213907281, "createdByUser": {"id": 379, "customerID": 202, "userName": "perezlynn", "name": "Philip House"}, "lastUpdatedTimestamp": 1506896568, "lastUpdatedByUser": {"id": 351, "customerID": 181, "userName": "williamsterri", "name": "Samuel Robinson"}, "closedTimestamp": 1380902467, "closedByUser": {"id": 927, "customerID": 806, "userName": "cisneroskristina", "name": "Reginald Ortiz"}, "publishedTimestamp": 1356150744, "publishedByUser": {"id": 468, "customerID": 550, "userName": "cindy30", "name": "Mrs. Latoya Maldonado MD"}, "flags": ["DEFAULT_CONTACTS"], "properties": {"additionalProperties": "Although fire ever set."}}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Hotel stop long marriage western book very offer.", "messageTemplate": "Success plant recently eat simply.", "field": "Interest worker bar general different small.", "parameter": {}, "timestamp": 895131212}], "currentPage": 46, "size": 33}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case".format()
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if offset:
body.update({"offset": offset})
if limit:
body.update({"limit": limit})
if customerID:
body.update({"customerID": customerID})
if service:
body.update({"service": service})
if status:
body.update({"status": status})
if type:
body.update({"type": type})
if keywords:
body.update({"keywords": keywords})
response = get(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 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 = 0,json: bool = True, verify: bool = True, apiKey: str = "", 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": 883, "limit": 75, "responseCode": 200, "count": 719, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Fly leg recent your.", "messageTemplate": "Bed story drive night modern style successful.", "field": "Wonder step century magazine follow gas.", "parameter": {}, "timestamp": 1328845163}], "currentPage": 344, "size": 270}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case".format()
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if publish:
body.update({"publish": publish})
if defaultWatchers:
body.update({"defaultWatchers": defaultWatchers})
if priority:
body.update({"priority": priority})
if accessMode:
body.update({"accessMode": accessMode})
if customerID:
body.update({"customerID": customerID})
if service:
body.update({"service": service})
if category:
body.update({"category": category})
if type:
body.update({"type": type})
if status:
body.update({"status": status})
if watchers:
body.update({"watchers": watchers})
if fields:
body.update({"fields": fields})
if subject:
body.update({"subject": subject})
if description:
body.update({"description": description})
if customerReference:
body.update({"customerReference": customerReference})
if aclMembers:
body.update({"aclMembers": aclMembers})
if originEmailAddress:
body.update({"originEmailAddress": originEmailAddress})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 advanced_case_search(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, sortBy: list = None, includeFlags: list = None, excludeFlags: list = None, includeDeleted: bool = 'False', exclude: bool = 'False', required: bool = 'False', userAssigned: bool = 'False', techAssigned: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
"""Returns cases matching the defined CaseSearchCriteria (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 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
:raises AuthenticationFailedException: on 401
:raises ValidationErrorException: on 412
:raises AccessDeniedException: on 403
:returns: {"offset": 81, "limit": 404, "responseCode": 200, "count": 636, "data": [{"id": 652, "initialStatus": "pendingClose", "status": "pendingClose", "initialPriority": "low", "priority": "medium", "subject": "Course these team energy attorney.", "description": "However couple occur clearly outside member grow.", "customerReference": "Argue book realize economic.", "accessMode": "explicit", "reporter": {"id": 463, "customerID": 761, "userName": "scotttorres", "name": "Maria Arias"}, "assignedUser": {"id": 183, "customerID": 640, "userName": "john89", "name": "Jeffrey Sanchez"}, "assignedTech": {"id": 280, "customerID": 999, "userName": "sandra75", "name": "Kevin Craig"}, "createdTimestamp": 242354604, "createdByUser": {"id": 398, "customerID": 367, "userName": "noah83", "name": "Lucas Christensen"}, "lastUpdatedTimestamp": 935263562, "lastUpdatedByUser": {"id": 826, "customerID": 599, "userName": "zjackson", "name": "Douglas Green"}, "closedTimestamp": 460807023, "closedByUser": {"id": 463, "customerID": 203, "userName": "wperkins", "name": "Dan Mckinney"}, "publishedTimestamp": 737814164, "publishedByUser": {"id": 845, "customerID": 246, "userName": "matthew90", "name": "Nicole Colon"}, "flags": ["MAIL_UPDATE"], "properties": {"additionalProperties": "Difficult claim smile activity."}}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Two administration under none language lose positive bank.", "messageTemplate": "Hit young capital bar especially matter usually include.", "field": "Machine data fire position however sea.", "parameter": {}, "timestamp": 1156908994}], "currentPage": 217, "size": 182}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/search".format()
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if limit:
body.update({"limit": limit})
if offset:
body.update({"offset": offset})
if includeDeleted:
body.update({"includeDeleted": includeDeleted})
if subCriteria:
body.update({"subCriteria": subCriteria})
if exclude:
body.update({"exclude": exclude})
if required:
body.update({"required": required})
if customerID:
body.update({"customerID": customerID})
if caseID:
body.update({"caseID": caseID})
if type:
body.update({"type": type})
if service:
body.update({"service": service})
if category:
body.update({"category": category})
if status:
body.update({"status": status})
if priority:
body.update({"priority": priority})
if startTimestamp:
body.update({"startTimestamp": startTimestamp})
if endTimestamp:
body.update({"endTimestamp": endTimestamp})
if assetID:
body.update({"assetID": assetID})
if tag:
body.update({"tag": tag})
if workflow:
body.update({"workflow": workflow})
if field:
body.update({"field": field})
if keywords:
body.update({"keywords": keywords})
if timeFieldStrategy:
body.update({"timeFieldStrategy": timeFieldStrategy})
if timeMatchStrategy:
body.update({"timeMatchStrategy": timeMatchStrategy})
if keywordFieldStrategy:
body.update({"keywordFieldStrategy": keywordFieldStrategy})
if keywordMatchStrategy:
body.update({"keywordMatchStrategy": keywordMatchStrategy})
if userID:
body.update({"userID": userID})
if userFieldStrategy:
body.update({"userFieldStrategy": userFieldStrategy})
if userAssigned:
body.update({"userAssigned": userAssigned})
if techAssigned:
body.update({"techAssigned": techAssigned})
if sortBy:
body.update({"sortBy": sortBy})
if includeFlags:
body.update({"includeFlags": includeFlags})
if excludeFlags:
body.update({"excludeFlags": excludeFlags})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = 'False', exclude: bool = 'False', required: bool = 'False', userAssigned: bool = 'False', techAssigned: bool = 'False', includeOthers: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 53, "limit": 954, "responseCode": 200, "count": 686, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Effect answer interest guy base give amount.", "messageTemplate": "Move method exactly company enough theory.", "field": "Over century interest.", "parameter": {}, "timestamp": 107558034}], "currentPage": 367, "size": 373}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/stats".format()
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if limit:
body.update({"limit": limit})
if offset:
body.update({"offset": offset})
if includeDeleted:
body.update({"includeDeleted": includeDeleted})
if subCriteria:
body.update({"subCriteria": subCriteria})
if exclude:
body.update({"exclude": exclude})
if required:
body.update({"required": required})
if customerID:
body.update({"customerID": customerID})
if caseID:
body.update({"caseID": caseID})
if type:
body.update({"type": type})
if service:
body.update({"service": service})
if category:
body.update({"category": category})
if status:
body.update({"status": status})
if priority:
body.update({"priority": priority})
if startTimestamp:
body.update({"startTimestamp": startTimestamp})
if endTimestamp:
body.update({"endTimestamp": endTimestamp})
if assetID:
body.update({"assetID": assetID})
if tag:
body.update({"tag": tag})
if workflow:
body.update({"workflow": workflow})
if field:
body.update({"field": field})
if keywords:
body.update({"keywords": keywords})
if timeFieldStrategy:
body.update({"timeFieldStrategy": timeFieldStrategy})
if timeMatchStrategy:
body.update({"timeMatchStrategy": timeMatchStrategy})
if keywordFieldStrategy:
body.update({"keywordFieldStrategy": keywordFieldStrategy})
if keywordMatchStrategy:
body.update({"keywordMatchStrategy": keywordMatchStrategy})
if userID:
body.update({"userID": userID})
if userFieldStrategy:
body.update({"userFieldStrategy": userFieldStrategy})
if userAssigned:
body.update({"userAssigned": userAssigned})
if techAssigned:
body.update({"techAssigned": techAssigned})
if groupBy:
body.update({"groupBy": groupBy})
if values:
body.update({"values": values})
if resolution:
body.update({"resolution": resolution})
if cutoff:
body.update({"cutoff": cutoff})
if cutoffValue:
body.update({"cutoffValue": cutoffValue})
if includeOthers:
body.update({"includeOthers": includeOthers})
if sortBy:
body.update({"sortBy": sortBy})
if includeFlags:
body.update({"includeFlags": includeFlags})
if excludeFlags:
body.update({"excludeFlags": excludeFlags})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 200, "limit": 816, "responseCode": 200, "count": 104, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Clearly smile it must.", "messageTemplate": "Region second appear medical simple opportunity could institution.", "field": "Condition soon forward red father.", "parameter": {}, "timestamp": 1251190302}], "currentPage": 816, "size": 520}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = 0, limit: int = 25,json: bool = True, verify: bool = True, apiKey: str = "", 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": 849, "limit": 903, "responseCode": 200, "count": 370, "data": [{"id": "Push tonight treatment live high.", "addedTimestamp": 74920002, "addedByUser": {"id": 972, "customerID": 361, "userName": "omccullough", "name": "Ashley Myers"}, "grantedSubject": {"id": 168, "customerID": 395, "name": "Matthew Jordan"}, "flags": ["DELETED"], "level": "read"}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Spring spring year position personal.", "messageTemplate": "Without expert interest weight at authority computer reduce.", "field": "Environmental get hundred learn.", "parameter": {}, "timestamp": 1513762389}], "currentPage": 758, "size": 488}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if offset:
body.update({"offset": offset})
if limit:
body.update({"limit": limit})
response = get(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 204, "limit": 333, "responseCode": 200, "count": 863, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Do language cost age ball fact leader.", "messageTemplate": "Much reduce act finish house coach network art.", "field": "See gun actually protect PM challenge.", "parameter": {}, "timestamp": 37137633}], "currentPage": 867, "size": 464}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if level:
body.update({"level": level})
if subjectID:
body.update({"subjectID": subjectID})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 895, "limit": 269, "responseCode": 200, "count": 478, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Major operation share choice.", "messageTemplate": "Production star executive there.", "field": "Ground rock account program star approach several.", "parameter": {}, "timestamp": 1308543028}], "currentPage": 106, "size": 179}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/access".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if accessMode:
body.update({"accessMode": accessMode})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 156, "limit": 886, "responseCode": 200, "count": 735, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Modern reduce effort you.", "messageTemplate": "Building place ten compare.", "field": "Big black worker expert.", "parameter": {}, "timestamp": 820531731}], "currentPage": 663, "size": 172}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/access/{aclEntryID}".format(caseID=caseID, aclEntryID=aclEntryID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = 0, limit: int = 25,json: bool = True, verify: bool = True, apiKey: str = "", 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": 426, "limit": 252, "responseCode": 200, "count": 100, "data": [{"id": "Positive either field beat drive way stand phone.", "addedTimestamp": 487589842, "addedByUser": {"id": 333, "customerID": 380, "userName": "pjackson", "name": "Angel Monroe"}, "name": "Deanna Shepard", "mimeType": "Recognize act energy woman heart nice summer.", "flags": ["ZIP_ENCRYPTED"], "size": 875}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Around interest begin brother contain door him.", "messageTemplate": "Choice read we according smile.", "field": "Question candidate happen upon allow growth forget.", "parameter": {}, "timestamp": 113321254}], "currentPage": 865, "size": 304}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if offset:
body.update({"offset": offset})
if limit:
body.update({"limit": limit})
response = get(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 906, "limit": 715, "responseCode": 200, "count": 903, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Name fund dinner government already direction necessary.", "messageTemplate": "Maybe reach teach old home for.", "field": "Remember degree performance less indicate instead with.", "parameter": {}, "timestamp": 1172058099}], "currentPage": 547, "size": 466}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if name:
body.update({"name": name})
if mimeType:
body.update({"mimeType": mimeType})
if data:
body.update({"data": data})
if encryptedZip:
body.update({"encryptedZip": encryptedZip})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 450, "limit": 591, "responseCode": 200, "count": 541, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Commercial large management director already international because.", "messageTemplate": "Chair mean interest learn.", "field": "Meet happen subject interest.", "parameter": {}, "timestamp": 227355458}], "currentPage": 934, "size": 669}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}".format(caseID=caseID, attachmentID=attachmentID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 908, "limit": 338, "responseCode": 200, "count": 154, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Friend American town option.", "messageTemplate": "Answer mean measure girl service.", "field": "Recent candidate across common at between I.", "parameter": {}, "timestamp": 1369623222}], "currentPage": 449, "size": 864}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}".format(caseID=caseID, attachmentID=attachmentID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/attachments/{attachmentID}/download".format(caseID=caseID, attachmentID=attachmentID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 622, "limit": 581, "responseCode": 200, "count": 807, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Safe Republican region determine seem.", "messageTemplate": "Guy rise can two never.", "field": "Voice trip adult quickly tell.", "parameter": {}, "timestamp": 1208754713}], "currentPage": 499, "size": 996}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/close".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if comment:
body.update({"comment": comment})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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_links(caseID: int, direction: str = None, type: list = None, offset: int = 0, limit: int = 25,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
"""List links for an existing case (PUBLIC)
:param int caseID: Case ID
:param str direction: Specify direction of links to fetch (default all)
:param list type: Specify link types to fetch (default all)
: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": 338, "limit": 178, "responseCode": 200, "count": 714, "data": [{"id": "Floor spring western method likely draw decade relationship.", "addedTimestamp": 710326173, "addedByUser": {"id": 614, "customerID": 57, "userName": "fstephenson", "name": "Felicia Rodriguez"}, "flags": ["DELETED"], "direction": "incoming"}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Apply wish six price fish.", "messageTemplate": "Nice organization him bag.", "field": "Sea buy week movie these behind skill dream.", "parameter": {}, "timestamp": 1214095435}], "currentPage": 256, "size": 273}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/links".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if offset:
body.update({"offset": offset})
if limit:
body.update({"limit": limit})
if direction:
body.update({"direction": direction})
if type:
body.update({"type": type})
response = get(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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_link(caseID: int, linkID: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
"""Remove existing case link (PUBLIC)
:param int caseID: Case ID
:param str linkID: Link ID
:raises AuthenticationFailedException: on 401
:raises ValidationErrorException: on 412
:raises AccessDeniedException: on 403
:raises ObjectNotFoundException: on 404
:returns: {"offset": 264, "limit": 564, "responseCode": 200, "count": 708, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Follow wide purpose community eat.", "messageTemplate": "Spend radio begin son decade world picture.", "field": "Available imagine move rate add home perform.", "parameter": {}, "timestamp": 337177742}], "currentPage": 294, "size": 158}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/links/{linkID}".format(caseID=caseID, linkID=linkID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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_link(caseID: int, linkToCaseID: int, type: str = None,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
"""Add link to case (PUBLIC)
:param int caseID: ID of case to link from
:param int linkToCaseID: ID of case to link to
:param str type: Type of link to add
:raises AuthenticationFailedException: on 401
:raises ValidationErrorException: on 412
:raises AccessDeniedException: on 403
:raises ObjectNotFoundException: on 404
:returns: {"offset": 607, "limit": 505, "responseCode": 200, "count": 870, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Tax agree despite hard.", "messageTemplate": "Just few event heavy body scientist.", "field": "Strategy minute bag policy.", "parameter": {}, "timestamp": 253834563}], "currentPage": 308, "size": 369}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/links/{linkToCaseID}".format(caseID=caseID, linkToCaseID=linkToCaseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if type:
body.update({"type": type})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 867, "limit": 828, "responseCode": 200, "count": 128, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Compare second line present local.", "messageTemplate": "General visit certain past fall world also time.", "field": "Meeting inside production part majority.", "parameter": {}, "timestamp": 1322832557}], "currentPage": 766, "size": 780}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/publish".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 562, "limit": 326, "responseCode": 200, "count": 499, "data": [{"id": "Structure either expect budget.", "addedTimestamp": 674147504, "addedByUser": {"id": 166, "customerID": 464, "userName": "sbrown", "name": "Glenn Dixon"}, "key": "According behind fight.", "value": "Research admit quality activity attorney population.", "flags": ["MERGED"]}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Image the teach only.", "messageTemplate": "Teacher popular break performance eat sure do.", "field": "Sometimes surface future upon.", "parameter": {}, "timestamp": 73179398}], "currentPage": 592, "size": 712}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/tags".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if tags:
body.update({"tags": tags})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 193, "limit": 150, "responseCode": 200, "count": 688, "data": [{"id": "Time environmental build help least.", "addedTimestamp": 617922040, "addedByUser": {"id": 39, "customerID": 175, "userName": "brandy86", "name": "Joseph Franklin"}, "key": "Yourself continue bar alone similar summer.", "value": "Surface almost loss society so bad film.", "flags": ["DELETED"]}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Especially serious dream size must improve thank.", "messageTemplate": "Like film draw.", "field": "Visit even operation.", "parameter": {}, "timestamp": 854412977}], "currentPage": 674, "size": 370}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/tags/{tagID}".format(caseID=caseID, tagID=tagID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 127, "limit": 454, "responseCode": 200, "count": 941, "data": [{"id": "Main artist fear job commercial each.", "addedTimestamp": 1421670571, "addedByUser": {"id": 571, "customerID": 785, "userName": "zacharysalazar", "name": "Christina Crawford"}, "key": "Sport conference hold hospital later real where.", "value": "Girl community way.", "flags": ["MERGED"]}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Create determine friend scientist wait tell want method.", "messageTemplate": "Card unit program eight able discuss.", "field": "Work member point run suddenly quite beautiful response.", "parameter": {}, "timestamp": 21395483}], "currentPage": 682, "size": 30}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.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/1.0'
}
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)
errors = []
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 = 'False', sms: bool = 'False', verbose: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 738, "limit": 876, "responseCode": 200, "count": 345, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Top night model three else.", "messageTemplate": "Born respond across.", "field": "Range good issue leader right from.", "parameter": {}, "timestamp": 605227340}], "currentPage": 88, "size": 247}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watch".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if email:
body.update({"email": email})
if sms:
body.update({"sms": sms})
if verbose:
body.update({"verbose": verbose})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 783, "limit": 547, "responseCode": 200, "count": 708, "metaData": {"additionalProperties": {}}, "messages": [{"message": "These fall want operation guy tell trade.", "messageTemplate": "Carry himself century still.", "field": "Miss around yard begin live.", "parameter": {}, "timestamp": 1195491410}], "currentPage": 438, "size": 680}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watch".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = 0, limit: int = 25, includeExplicit: bool = 'True', includeDefault: bool = 'True', includeDisabled: bool = 'True',json: bool = True, verify: bool = True, apiKey: str = "", 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": 634, "limit": 21, "responseCode": 200, "count": 943, "data": [{"id": "Central beautiful buy PM.", "addedTimestamp": 1098578306, "addedByUser": {"id": 583, "customerID": 21, "userName": "michelle19", "name": "Evelyn Bean"}, "flags": ["MERGED"], "subject": {"id": 674, "customerID": 940, "name": "Cindy Sutton"}, "contactID": 560, "role": "watcher", "destination": "National white together best cell memory role.", "minimumPriority": "low"}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Test allow oil.", "messageTemplate": "Learn fire middle develop thank.", "field": "Bed born population focus question today question.", "parameter": {}, "timestamp": 164151039}], "currentPage": 326, "size": 936}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if offset:
body.update({"offset": offset})
if limit:
body.update({"limit": limit})
if includeExplicit:
body.update({"includeExplicit": includeExplicit})
if includeDefault:
body.update({"includeDefault": includeDefault})
if includeDisabled:
body.update({"includeDisabled": includeDisabled})
response = get(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 148, "limit": 986, "responseCode": 200, "count": 855, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Similar exactly even loss security production.", "messageTemplate": "Here plant blood.", "field": "Them create home guess.", "parameter": {}, "timestamp": 1374234213}], "currentPage": 873, "size": 188}
"""
from requests import post
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if type:
body.update({"type": type})
if subjectID:
body.update({"subjectID": subjectID})
if destination:
body.update({"destination": destination})
if verbose:
body.update({"verbose": verbose})
response = post(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 86, "limit": 507, "responseCode": 200, "count": 453, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Stand city any focus throughout rich.", "messageTemplate": "Glass body kid help.", "field": "Message well always.", "parameter": {}, "timestamp": 1173196018}], "currentPage": 428, "size": 704}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if defaultWatchers:
body.update({"defaultWatchers": defaultWatchers})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 377, "limit": 747, "responseCode": 200, "count": 621, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Recognize record protect note.", "messageTemplate": "Hand finish successful Republican stand ok family.", "field": "Yard minute hold.", "parameter": {}, "timestamp": 1432563888}], "currentPage": 442, "size": 750}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers/{watcherID}".format(caseID=caseID, watcherID=watcherID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if verbose:
body.update({"verbose": verbose})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 572, "limit": 892, "responseCode": 200, "count": 75, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Teach sit style war would treat.", "messageTemplate": "Political cover shake reason.", "field": "Conference always strategy law western.", "parameter": {}, "timestamp": 779225580}], "currentPage": 788, "size": 613}
"""
from requests import delete
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/watchers/{watcherID}".format(caseID=caseID, watcherID=watcherID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 998, "limit": 707, "responseCode": 200, "count": 743, "data": [{"id": "Feel total can of explain study during.", "addedTimestamp": 1319951070, "addedByUser": {"id": 752, "customerID": 134, "userName": "shealuke", "name": "Tara Phillips"}, "workflow": "tuning", "acknowledgedByUser": {"id": 965, "customerID": 490, "userName": "dale31", "name": "Parker Padilla"}, "acknowledgedTimestamp": 403956353, "flags": ["DELETED"]}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Move popular everybody marriage important plant feel look.", "messageTemplate": "But structure point world nor entire throw.", "field": "Who seat good actually arrive view relate.", "parameter": {}, "timestamp": 191404665}], "currentPage": 750, "size": 851}
"""
from requests import get
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows".format(caseID=caseID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 261, "limit": 917, "responseCode": 200, "count": 261, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Special beyond mean marriage family measure bill.", "messageTemplate": "Moment spring manage system.", "field": "True hard billion professional production.", "parameter": {}, "timestamp": 517955958}], "currentPage": 853, "size": 753}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows/{workflow}/acknowledge".format(caseID=caseID, workflow=workflow)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = "", 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": 623, "limit": 284, "responseCode": 200, "count": 259, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Everybody more care management raise vote.", "messageTemplate": "Protect animal eat service care.", "field": "Too do test talk physical himself increase stock.", "parameter": {}, "timestamp": 1065045967}], "currentPage": 438, "size": 266}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{caseID}/workflows/{workflow}/request".format(caseID=caseID, workflow=workflow)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
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)
errors = []
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 = 'False',json: bool = True, verify: bool = True, apiKey: str = "", 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": 961, "limit": 11, "responseCode": 200, "count": 427, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Leave significant pick voice sign.", "messageTemplate": "Establish own before approach despite especially.", "field": "Difficult discuss later not everyone recently.", "parameter": {}, "timestamp": 1006748879}], "currentPage": 234, "size": 755}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{id}".format(id=id)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if subject:
body.update({"subject": subject})
if description:
body.update({"description": description})
if status:
body.update({"status": status})
if priority:
body.update({"priority": priority})
if category:
body.update({"category": category})
if reporterID:
body.update({"reporterID": reporterID})
if assignedUserID:
body.update({"assignedUserID": assignedUserID})
if assignedTechID:
body.update({"assignedTechID": assignedTechID})
if customerReference:
body.update({"customerReference": customerReference})
if comment:
body.update({"comment": comment})
if internalComment:
body.update({"internalComment": internalComment})
if originEmailAddress:
body.update({"originEmailAddress": originEmailAddress})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 508, "limit": 783, "responseCode": 200, "count": 922, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Color appear order five.", "messageTemplate": "Suggest commercial data understand.", "field": "Now significant position mind full.", "parameter": {}, "timestamp": 1235410943}], "currentPage": 99, "size": 588}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{id}/move".format(id=id)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if customerID:
body.update({"customerID": customerID})
if service:
body.update({"service": service})
if category:
body.update({"category": category})
if type:
body.update({"type": type})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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 = "", 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": 739, "limit": 207, "responseCode": 200, "count": 950, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Effect country wrong.", "messageTemplate": "Whether sense themselves after measure do project.", "field": "Action participant contain man offer.", "parameter": {}, "timestamp": 1496660283}], "currentPage": 287, "size": 789}
"""
from requests import put
from argus_api.exceptions import http
url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/cases/v2/case/{mergeInto}/merge/{mergeFrom}".format(mergeInto=mergeInto, mergeFrom=mergeFrom)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/1.0'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {}
if description:
body.update({"description": description})
if priority:
body.update({"priority": priority})
if status:
body.update({"status": status})
response = put(url, json=body if body else None, verify=verify, headers=headers)
errors = []
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