def __init__(self, id=None, alias=None, recipient=None, user=None, note=None, source=None): """ Used to hold required parameters of Add Recipient to Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#addRecipientRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. recipient : str, required The new recipient that will be added. user : str, optional Sets default owner of the execution. Default is owner of account. note : str, optional Additional alert note source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.recipient = recipient self.user = user self.note = note self.source = source
def __init__(self, created_after=None, created_before=None, updated_after=None, updated_before=None, limit=None, status=None, tags=None, tags_operator=None): """ Used to hold required parameters of Count Alerts Request call. https://www.opsgenie.com/docs/web-api/alert-api#countAlertRequest Parameters ---------- created_after : datetime, optional UTC datetime. Filter alerts created after specified time. created_before : datetime, optional UTC datetime. Filter alerts created before specified time. updated_after : datetime, optional UTC datetime. Filter alerts updated after specified time. updated_before : datetime, optional UTC datetime. Filter alerts updated before specified time. limit : int, optional Page size. (Default is 20, Max is 100) status : {'open', 'acked', 'unacked', 'seen', 'notseen', 'closed'} Unix timestamp in nanoseconds. Filter alerts with status. tags : list of str, optional List of tags to be used to filter alerts. tags_operator : {'and', 'or'}, optional Operator of filtering alerts using tags. Default is and """ BaseRequest.__init__(self) self.created_after = created_after self.created_before = created_before self.updated_after = updated_after self.updated_before = updated_before self.limit = limit self.status = status self.tags = tags self.tags_operator = tags_operator
def __init__(self, id=None, alias=None, recipients=None, user=None, note=None, source=None): """ Used to hold required parameters of Renotify Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#renotifyRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. recipients : list of str, optional The user names of individual users or groups. If not specified alert recipients will be renotified. user : str, optional Sets default owner of the execution. Default is owner of account. note : str, optional Additional alert note source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.recipients = recipients self.user = user self.note = note self.source = source
def __init__(self, id=None, alias=None, tags=None, user=None, source=None, note=None): """ Used to hold required parameters of Remove Tags to Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#removeTagsRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. tags : list of str, required List of tags that will be removed. note : str, required Note text that will be added user : str, optional Sets default owner of the execution. Default is owner of account. source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tags = tags self.user = user self.source = source self.note = note
def __init__(self, id=None, alias=None, tiny_id=None, order_by=None, count=None, text=None, details=None): """ Parameters ---------- id : str alias : str tiny_id : six.string_types order_by count text details """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tiny_id = tiny_id self.order_by = order_by self.count = count self.text = text self.details = details
def __init__(self, id=None, alias=None, limit=None, order=None, last_key=None): """ Used to hold required parameters of List Alert Notes Request call. https://www.opsgenie.com/docs/web-api/alert-api#listNotes One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. limit : int, optional Page size. (Default is 20, Max is 100) order : {'asc', 'desc'}, optional Sort order of the result set. Default is 'desc' last_key : str, optional Key which will be used in pagination. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.limit = limit self.order = order self.last_key = last_key
def __init__(self, id=None, alias=None, attachment=None, user=None, source=None, index_file=None, note=None): """ Used to hold required parameters of Attach File to Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#attachmentRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. attachment : str, required Path of the file to be attached. index_file : str, optional Name of html file which will be shown when attachment clicked on UI. See doc for more. note : str, required Note text that will be added user : str, optional Sets default owner of the execution. Default is owner of account. source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.attachment = attachment self.user = user self.source = source self.index_file = index_file self.note = note
def __init__(self, id=None, alias=None, keys=None, user=None, source=None, note=None): """ Used to hold required parameters of Remove Details From Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#removeDetailsRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. keys : list of str, required List of keys to be removed from alert details. note : str, required Note text that will be added user : str, optional Sets default owner of the execution. Default is owner of account. source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.keys = keys self.user = user self.source = source self.note = note
def __init__(self, id=None, alias=None, end_date=None, time_zone=None, user=None, note=None, source=None): """ Used to hold required parameters of Snooze Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#snoozeRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. end_date : datetime.datetime, required The date and time snooze will end in. time_zone : str, optional Time zone of the date to be converted user : str, optional Sets default owner of the execution. Default is owner of account. note : str, optional Additional alert note source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.end_date = end_date self.time_zone = time_zone self.user = user self.note = note self.source = source
def __init__(self, id=None, alias=None, owner=None, user=None, note=None, source=None): """ Used to hold required parameters of Assign Owner to Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#assignRequest One of the [id, alias] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. owner : str, required The user who will be the owner of the alert after the execution. user : str, optional Sets default owner of the execution. Default is owner of account. note : str, optional Additional alert note source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.owner = owner self.user = user self.note = note self.source = source
def __init__(self, message=None, teams=None, alias=None, description=None, recipients=None, actions=None, source=None, tags=None, details=None, entity=None, user=None, note=None): """ Used to hold required parameters of Create Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#createAlertRequest Parameters ---------- message : str, required Alert message limited to 130 characters. teams : list of str, optional List of team names which will be responsible for the alert. alias : str, optional A user defined identifier for the alert. description : str, optional Field for details of an alert. recipients : list of str, optional User, group, schedule or escalation names defines which users will receive the notifications of the alert. actions : list of str, optional Custom actions which can be executed for the alert. source : str, optional Field to specify source of alert. Default is IP address of incoming request tags : list of str, optional A comma separated list of labels attached to the alert. details : dict, optional User defined properties. entity : str, optional The entity the alert is related to. user : str, optional Sets default owner of the execution. Default is owner of account. note : str, optional Additional alert note """ BaseRequest.__init__(self) self.message = message self.teams = teams self.alias = alias self.description = description self.recipients = recipients self.actions = actions self.source = source self.tags = tags self.details = details self.entity = entity self.user = user self.note = note
def __init__(self, id=None, alias=None, tiny_id=None, user=None, note=None, source=None): """ Used to hold required parameters of UnAcknowledge Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#unacknowledgeRequest One of the [id, alias, tiny_id] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert that will be un-acknowledged. alias : str, optional Alias of the alert that will be un-acknowledged. tiny_id : str, optional Short id assigned to the alert. All requests supports tiny_id but using this field is not recommended because it rolls. user : str, optional Default owner of the execution. If user is not specified, the system becomes owner of the execution note : str, optional Additional alert note source : str, optional User defined field to specify source of unacknowledge action """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tiny_id = tiny_id self.user = user self.note = note self.source = source @required_one_of(["id", "alias", "tiny_id"]) def validate(self): pass def decode(self): return { 'id': self.id, 'alias': self.alias, 'tiny_id': self.tiny_id, 'user': self.user, 'note': self.note, 'source': self.source }
def __init__(self, created_after=None, created_before=None, updated_after=None, updated_before=None, limit=None, status=None, sort_by=None, order=None, tags=None, tags_operator=None): """ Used to hold required parameters of List Alerts Request call. https://www.opsgenie.com/docs/web-api/alert-api#listAlertRequest Parameters ---------- created_after : datetime, optional UTC datetime. Filter alerts created after specified time. created_before : datetime, optional UTC datetime. Filter alerts created before specified time. updated_after : datetime, optional UTC datetime. Filter alerts updated after specified time. updated_before : datetime, optional UTC datetime. Filter alerts updated before specified time. limit : int, optional Page size. (Default is 20, Max is 100) status : {'open', 'acked', 'unacked', 'seen', 'notseen', 'closed'} Unix timestamp in nanoseconds. Filter alerts with status. sort_by : {'createdAt', 'updatedAt'}, optional Sort result set using specified parameter. Default is 'createdAt' order : {'asc', 'desc'}, optional Sort order of the result set. Default is 'desc' tags : list of str, optional List of tags to be used to filter alerts. tags_operator : {'and', 'or'}, optional Operator of filtering alerts using tags. Default is and """ BaseRequest.__init__(self) self.created_after = created_after self.created_before = created_before self.updated_after = updated_after self.updated_before = updated_before self.limit = limit self.status = status self.sort_by = sort_by self.order = order self.tags = tags self.tags_operator = tags_operator
def __init__(self, id=None, alias=None): """ Used to hold required parameters of List Alert Recipients Request call. https://www.opsgenie.com/docs/web-api/alert-api#listRecipients Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. """ BaseRequest.__init__(self) self.id = id self.alias = alias
def __init__(self, id=None, alias=None, tiny_id=None, escalation_id=None, escalation_name=None, note=None, user=None, source=None): """ Used to hold required parameters of Escalate To Next Request call. https://www.opsgenie.com/docs/web-api/alert-api#escalateToNextRequest One of the [id, alias, tiny_id] parameters must be given, can not be given together. Alias option can only be used for open alerts. One of the [escalation_id, escalation_name] parameters must be given, cannot be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. tiny_id : str, optional short id assigned to the alert. All requests supports tinyId but using this field is not recommended because it rolls escalation_id : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!, optional Id of the escalation that will be escalated to the next level escalation_name : str, optional Name of the escalation that will be escalated to the next level note : str, required Note text that will be added user : str, optional Sets default owner of the execution. Default is owner of account. source : str, optional User defined field to specify source of close action. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tiny_id = tiny_id self.escalation_id = escalation_id self.escalation_name = escalation_name self.note = note self.user = user self.source = source
def __init__(self, identifier, expand=''): """ Used to hold required parameters of Get User Request call. https://docs.opsgenie.com/docs/user-api#section-get-user In-Line Parameters ---------- identifier : str, required Username or id of the user Query Parameters ---------- expand : str Comma separated list of strings to create a more detailed response. The only expandable field for user api is contact """ BaseRequest.__init__(self) self.identifier = identifier self.expand = expand
def __init__(self, identifier, identifierType='id'): """ Used to hold required parameters of Get Team Request call. https://docs.opsgenie.com/docs/team-api#section-get-team In-Line Parameters ---------- identifier : str, required Identifier of the team Query Parameters ---------- identifierType : str Type of the identifier that is provided as an in-line parameter. Possible values are id and name. Default value is id """ BaseRequest.__init__(self) self.identifier = identifier self.identifierType = identifierType
def __init__(self, id=None, alias=None, tiny_id=None): """ Used to hold required parameters of Get Alert Request call. https://www.opsgenie.com/docs/web-api/alert-api#getAlertRequest One of the [id, alias, tinyId] parameters must be given, can not be given together. Parameters ---------- id : str, optional Id of the alert to be retrieved. alias : str, optional Alias of the alert to be retrieved. Using alias will only retrieve an open alert with that alias. tiny_id : int, optional Short id assigned to the alert. All requests supports tinyId but using this field is not recommended. """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tiny_id = tiny_id
def __init__(self, id=None, alias=None, tiny_id=None, order_by=None, count=None, text=None, details=None): """ Parameters ---------- id : str alias : str tiny_id : basestring order_by count text details """ BaseRequest.__init__(self) self.id = id self.alias = alias self.tiny_id = tiny_id self.order_by = order_by self.count = count self.text = text self.details = details
def __init__(self): """ Used to hold required parameters of Get Account Request call. https://docs.opsgenie.com/docs/account-api#section-get-account-info """ BaseRequest.__init__(self)
def __init__(self, message, alias=None, description=None, responders=None, visibleTo=None, actions=None, tags=None, details=None, entity=None, source=None, priority='P3', user=None, note=None): """ Used to hold required parameters of Create Alert Request call. https://docs.opsgenie.com/docs/alert-api#section-create-alert Parameters ---------- message : str, required (limited to 130 characters) Message of the alert alias : str, optional (limited to 512 characters) A user defined identifier of the alert, that is also the key element of Alert De-Duplication (https://docs.opsgenie.com/docs/alert-deduplication). description : str, optional (limited to 15000 characters) Description field of the alert that is generally used to provide a detailed information about the alert. responders : list of dicts, optional (limited to 50 teams, users, escalations or schedules) Teams, users, escalations and schedules that the alert will be routed to send notifications. `type` field is mandatory for each item, where possible values are team, user, escalation and schedule. If the API Key belongs to a team integration, this field will be overwritten with the owner team. Either id or name of each responder should be provided. visibleTo : list of dicts, optional (50 teams or users in total) Teams and users that the alert will become visible to without sending any notification. `type` field is mandatory for each item, where possible values are team and user. In addition to the type field, either id or name should be given for teams and either id or username should be given for users. Please note: that alert will be visible to the teams that are specified withinteams field by default, so there is no need to re-specify them within visibleTo field. actions : list of str, optional Custom actions which can be executed for the alert. tags : list of str, optional A comma separated list of labels attached to the alert. details : dict, optional Map of key-value pairs to use as custom properties of the alert. entity : str, optional Entity field of the alert that is generally used to specify which domain alert is related to. source : str, optional Field to specify source of alert. Default is IP address of incoming request priority : str, optional Priority level of the alert. Possible values are P1, P2, P3, P4 and P5. Default value is P3. user : str, optional (limited to 100 characters) Sets default owner of the execution. Default is owner of account. note : str, optional (limited to 25000 characters) Additional note that will be added while creating the alert. """ BaseRequest.__init__(self) self.message = message self.alias = alias self.description = description self.responders = responders self.visibleTo = visibleTo self.actions = actions self.tags = tags self.details = details self.entity = entity self.source = source self.priority = priority self.user = user self.note = note