Sla (risksense_api.__subject.__sla.__sla
)¶
Sla module defined for different sla related api endpoints.
- class risksense_api.__subject.__sla.__sla.SlaActionType[source]¶
Bases:
object
Types of sla action type
- REMEDIATION_SLA = 'REMEDIATION_SLA'¶
- class risksense_api.__subject.__sla.__sla.SlaMatrix[source]¶
Bases:
object
Types of Sla Matrix
- STANDARD = {'1': [45, 90, 90, 120, 0], '2': [30, 90, 90, 120, 0], '3': [21, 45, 90, 120, 0], '4': [14, 30, 90, 120, 0], '5': [7, 21, 90, 120, 0]}¶
- ACCELERATED = {'1': [30, 60, 90, 90, 0], '2': [21, 45, 90, 90, 0], '3': [14, 30, 60, 90, 0], '4': [7, 21, 45, 90, 0], '5': [3, 14, 30, 90, 0]}¶
- AGGRESSIVE = {'1': [14, 30, 45, 60, 0], '2': [7, 21, 30, 60, 0], '3': [3, 14, 30, 60, 0], '4': [2, 7, 15, 60, 0], '5': [1, 3, 15, 60, 0]}¶
- class risksense_api.__subject.__sla.__sla.SlaDataOperator[source]¶
Bases:
object
Types of sla data operator
- MET_SLA = 'MET_SLA'¶
- OVERDUE = 'OVERDUE'¶
- MISSED_SLA = 'MISSED_SLA'¶
- WITHIN_SLA = 'WITHIN_SLA'¶
- class risksense_api.__subject.__sla.__sla.SlaMatrixProfileType[source]¶
Bases:
object
Types of Sla Matrix Profile Type
- STANDARD = 'STANDARD'¶
- AGGRESSIVE = 'AGGRESSIVE'¶
- ACCELERATED = 'ACCELERATED'¶
- CUSTOM = 'CUSTOM'¶
- class risksense_api.__subject.__sla.__sla.TimeReference[source]¶
Bases:
object
Types of sla time reference
- INGESTION_DATE = 'INGESTION_DATE'¶
- DISCOVERED_DATE = 'DISCOVERED_DATE'¶
- class risksense_api.__subject.__sla.__sla.offsetbasis[source]¶
Bases:
object
Types of sla offset basis
- VRR = 'VRR'¶
- SEVERITY = 'SEVERITY'¶
- class risksense_api.__subject.__sla.__sla.Sla(profile)[source]¶
Bases:
Subject
Sla class
- Parameters:
profile (
object
) –
- __init__(profile)[source]¶
Initialization of sla object.
- Parameters:
profile (
object
) – Profile Object
- create_sla(description, schedule_type='DAILY', hourofday=12, name='Remediation SLAs', csvdump=False, client_id=None, **kwargs)[source]¶
Creates an sla
- Parameters:
name (
str
) – Name of playbook,note for system sla please mention Remediation SLAsdescription (
str
) – Provide description for slaschedule_type (
str
) – Schedule Frequency (ScheduleFreq.DAILY, ScheduleFreq.WEEKLY, ScheduleFreq.MONTHLY, ‘DISABLED’)hourofday (
int
) – Hour of the daycsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client IDArgs (Keyword) – day_of_week(
str
): Day of the week day_of_month(str
): Day of the month
- Return type:
str
- Returns:
Playbook UUID
Example
To create a remediation sla
>>> self.{risksenseobject}.sla.create_sla('remediation sla')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.create_sla('remediation sla',csvdump=True)
- getslarules(playbookuuid, csvdump=False, client_id=None)[source]¶
Get a list of all sla rules for an sla.
- Parameters:
playbookuuid (
str
) – Uuid of the playbook to fetch slacsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
list
- Returns:
Sla rules
Example
To get list of all sla rules
>>> self.{risksenseobject}.sla.getslarules('11ed05cb-e7a0-4f25-b7ab-06933745a4d6')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.getslarules('11ed05cb-e7a0-4f25-b7ab-06933745a4d6',csvdump=True)
- getallslas(csvdump=False, client_id=None)[source]¶
Gets all slas for a particular client.
- Parameters:
csvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
dict
- Returns:
To get all slas
Example
To get all slas
>>> self.{risksenseobject}.getallslas()
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.getallslas(csvdump=True)
- delete_sla(sla_uuid, csvdump=False, client_id=None)[source]¶
Delete a particular sla
- Parameters:
sla_uuid (
str
) – UUID of slacsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
bool
- Returns:
Success
Example
>>> self.{risksenseobject}.sla.delete_sla('1234-123-9f18-b7ab-06933745a4d6')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.delete_sla('1234-123-9f18-b7ab-06933745a4d6')
- get_sla_rule(playbookrulepairinguuid, csvdump=False, client_id=None)[source]¶
Gets all sla rules for a particular client.
- Parameters:
playbookrulepairinguuid (
str
) – Playbook rule pairing uuidcsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
dict
- Returns:
SLA details
Example
To get all sla rules
>>> self.{risksenseobject}.sla.get_sla_rule('12334-123-3bb6-9564-dbbe539b1a74')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.get_sla_rule('187914ba-b06e-3bb6-9564-dbbe539b1a74',csvdump=True)
- get_specified_sla(playbookuuid, csvdump=False, client_id=None)[source]¶
Gets a specified sla for a particular client.
- Parameters:
playbookuuid (
str
) – UUID of playbookcsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
dict
- Returns:
Specific sla data
Example
To get specific sla
>>> self.{risksenseobject}.sla.get_specified_sla('12345st-123-4f25-b7ab-06933745a4d6')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.get_specified_sla('11ed05cb-e7a0-4f25-b7ab-06933745a4d6',csvdump=True)
- get_sla_details(playbookuuid, csvdump=False, client_id=None)[source]¶
Get details of a particular sla playbook.
- Parameters:
playbookuuid (
str
) – SLA Playbook uuidcsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
dict
- Returns:
Returns the sla playbook details
Example
To get sla details
>>> self.{risksenseobject}.sla.get_sla_details('11ed05cb-e7a0-4f25-b7ab-06933745a4d6')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.get_sla_details('11ed05cb-e7a0-4f25-b7ab-06933745a4d6',csvdump=True)
- add_default_sla_rule(sla_uuid, description, priority, timeReference='DISCOVERED_DATE', serviceLevelAgreementMatrix={'1': [45, 90, 90, 120, 0], '2': [30, 90, 90, 120, 0], '3': [21, 45, 90, 120, 0], '4': [14, 30, 90, 120, 0], '5': [7, 21, 90, 120, 0]}, slaMatrixProfileType='STANDARD', offsetBasis='VRR', affectOnlyNewFindings=True, updateSLAIfVRRUpdates=True, inputdata='HOST_FINDING', actionType='REMEDIATION_SLA', csvdump=False, client_id=None)[source]¶
Adds default rule to existing sla playbook.Works only if there is no default rule applied to the playbook
- Parameters:
sla_uuid (
str
) – Sla UUIDdescription (
str
) – Provide description for the default sla rule,priority (
int
) – Priority to be provided to default sla rule , note: default sla priority should be a greater number than the group sla rulestimeReference (
str
) – Timereference to be provided to default sla rule ,serviceLevelAgreementMatrix (
str
) – Provide slamatrix for the particular slaslaMatrixProfileType (
str
) – Provide sla matrix type for the slaoffsetBasis (
str
) – Provide offset basis for particular slaaffectOnlyNewFindings (
bool
) – Choose whether it affects new findingsupdateSLAIfVRRUpdates (
bool
) – Choose if slaupdates with vrrinputdata (
str
) – Type of data provided for slaactionType (
str
) – Type of action for particular slacsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID , if no client id provided , takes default client idaction_type – Action type for the particular sla rule,by default remediation rule is provided
- Return type:
list
- Returns:
List containing dict of rule details.
Example
To add default sla rule
>>> self.{risksenseobject}.add_default_sla_rule('11ed13e6-a1aa-5c28-9fb0-02a87de7e1ee','testing',3)
Note
You can also change the default time Reference or service Level Agreement Matrix or other default arguments
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.add_default_sla_rule('11ed13e6-a1aa-5c28-9fb0-02a87de7e1ee','testing',3,csvdump=True)
- update_default_sla_rule(playbookrulepairinguuid, description, priority, timeReference='DISCOVERED_DATE', serviceLevelAgreementMatrix={'1': [45, 90, 90, 120, 0], '2': [30, 90, 90, 120, 0], '3': [21, 45, 90, 120, 0], '4': [14, 30, 90, 120, 0], '5': [7, 21, 90, 120, 0]}, slaMatrixProfileType='STANDARD', offsetBasis='VRR', affectOnlyNewFindings=True, updateSLAIfVRRUpdates=True, inputdata='HOST_FINDING', actionType='REMEDIATION_SLA', csvdump=False, client_id=None)[source]¶
Updates default rule to existing sla playbook.
- Parameters:
playbookrulepairinguuid (
str
) – Playbook rule pairing uuiddescription (
str
) – Provide description for the default sla rule,priority (
int
) – Priority to be provided to default sla rule , note: default sla priority should be a greater number than the group sla rulestimeReference (
str
) – Timereference to be provided to default sla rule ,serviceLevelAgreementMatrix (
dict
) – Provide slamatrix for the particular slaslaMatrixProfileType (
str
) – Provide sla matrix type for the slaoffsetBasis (
str
) – Provide offset basis for particular slaaffectOnlyNewFindings (
bool
) – Choose whether it affects new findingsupdateSLAIfVRRUpdates (
bool
) – Choose if slaupdates with vrrinputdata (
str
) – Type of data provided for slaactionType (
str
) – Type of action for particular slacsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID , if no client id provided , takes default client id
- Return type:
list
- Returns:
List containing dict of rule details.
Example
To update default sla rule
>>> self.{risksenseobject}.update_default_sla_rule('11ed13e6-a1aa-5c28-9fb0-02a87de7e1ee','testing',3)
Note
You can also change the default time Reference or service Level Agreement Matrix or other default arguments
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.update_default_sla_rule('11ed13e6-a1aa-5c28-9fb0-02a87de7e1ee','testing',3,csvdump=True)
- add_group_sla_rule(sla_uuid, name, description, priority, targetgroupids, timeReference='DISCOVERED_DATE', serviceLevelAgreementMatrix={'1': [45, 90, 90, 120, 0], '2': [30, 90, 90, 120, 0], '3': [21, 45, 90, 120, 0], '4': [14, 30, 90, 120, 0], '5': [7, 21, 90, 120, 0]}, slaMatrixProfileType='STANDARD', offsetBasis='VRR', affectOnlyNewFindings=True, updateSLAIfVRRUpdates=True, inputdata='HOST_FINDING', actionType='REMEDIATION_SLA', csvdump=False, client_id=None)[source]¶
Adds group rule to existing sla playbook for the groups specified.
- Parameters:
sla_uuid (
str
) – Sla UUIDname (
str
) – Name of the group specific sla ruledescription (
str
) – Provide description for the group specific sla rule,priority (
int
) – Priority to be provided to group speicifc sla , note: group sla priority should be a lesser number than the default sla ruletargetgroupids (
list
) – The groups ids where the sla appliestimeReference (
str
) – Timereference to be provided to default sla rule ,serviceLevelAgreementMatrix (
dict
) – Provide slamatrix for the particular slaslaMatrixProfileType (
str
) – Provide sla matrix type for the slaoffsetBasis (
str
) – Provide offset basis for particular slaaffectOnlyNewFindings (
bool
) – Choose whether it affects new findingsupdateSLAIfVRRUpdates (
bool
) – Choose if slaupdates with vrrinputdata (
str
) – Type of data provided for slaactionType (
str
) – Type of action for particular slacsvdump (
bool
) – Dumps data to csvclient_id (
typing.Optional
[int
]) – Client ID , if no client id provided , takes default client id
- Return type:
list
- Returns:
List containing dict of rule details.
Example
>>> self.{risksenseobject}.sla.add_group_sla_rule(sla_uuid='12345st-123-5c28-9fb0-02a87de7e1ee',name='testingnew',description='testingnew',targetgroupids=[],priority=2)
Note
You can also change the default time Reference or service Level Agreement Matrix or other default arguments
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.add_group_sla_rule(sla_uuid='12345st-123-5c28-9fb0-02a87de7e1ee',name='testingnew',description='testingnew',targetgroupids=[],priority=2,csvdump=True)
- update_group_sla_rule(playbookrulepairinguuid, name, description, priority, targetgroupids, timeReference='DISCOVERED_DATE', serviceLevelAgreementMatrix={'1': [45, 90, 90, 120, 0], '2': [30, 90, 90, 120, 0], '3': [21, 45, 90, 120, 0], '4': [14, 30, 90, 120, 0], '5': [7, 21, 90, 120, 0]}, slaMatrixProfileType='STANDARD', offsetBasis='VRR', affectOnlyNewFindings=True, updateSLAIfVRRUpdates=True, inputdata='HOST_FINDING', actionType='REMEDIATION_SLA', csvdump=False, client_id=None)[source]¶
Updates a group sla rule for an already existing playbook
- Parameters:
playbookrulepairinguuid (
str
) – Playbook rule pairing uuidname (
str
) – Name of the group specific sla ruledescription (
str
) – Provide description for the group specific sla rule,priority (
int
) – Priority to be provided to group speicifc sla , note: group sla priority should be a lesser number than the default sla ruletargetgroupids (
list
) – The groups ids where the sla appliestimeReference (
str
) – Timereference to be provided to default sla rule ,serviceLevelAgreementMatrix (
dict
) – Provide slamatrix for the particular slaslaMatrixProfileType (
str
) – Provide sla matrix type for the slaoffsetBasis (
str
) – Provide offset basis for particular slaaffectOnlyNewFindings (
bool
) – Choose whether it affects new findingsupdateSLAIfVRRUpdates (
bool
) – Choose if slaupdates with vrrinputdata (
str
) – Type of data provided for slaactionType (
str
) – Type of action for particular slacsvdump (
bool
) – dumps the data in csvclient_id (
typing.Optional
[int
]) – Client ID , if no client id provided , takes default client idaction_type – Action type for the particular sla rule,by default remediation rule is provided
- Return type:
list
- Returns:
List containing dict of rule details.
Example
To update group sla rule
>>> self.{risksenseobject}.sla.update_group_sla_rule('12345st-123-5c28-9fb0-02a87de7e1ee','testingnew','testingnew',[],2)
Note
You can also change the default time Reference or service Level Agreement Matrix or other default arguments
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.update_group_sla_rule('12345st-123-5c28-9fb0-02a87de7e1ee','testingnew','testingnew',[],2,csvdump=True)
- del_group_sla_rule(playbookuuid, client_id=None)[source]¶
Deletes a particular group sla rule.
- Parameters:
client_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client idplaybookuuid (
str
) – The playbookuuid that needs to be deleted
- Return type:
bool
- Returns:
Returns json of deleted rule
Example
Delete group sla rule
>>> self.{risksenseobject}.sla.del_group_sla_rule('123-123')
- change_order(slauuid, ruleuuids, csvdump=False, client_id=None)[source]¶
Changes the order of the sla rules
- Parameters:
client_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client idslauuid (
str
) – The sla where rules needs to be reorderedruleuuids (
list
) – The order of rules reorderingcsvdump (
bool
) – dumps the data in csv
- Return type:
list
- Returns:
Returns the reordered rule json
Example
>>> self.rs.sla.change_order('123-4567-f4cb-b7ab-06933745a4d6',["97abc-123-3bc0-b606-98aed43c944a"])
Note
You can also dump the data in csv using
csvdump=True
>>> self.rs.sla.change_order('123-4567-f4cb-b7ab-06933745a4d6',["97abc-123-3bc0-b606-98aed43c944a"],csvdump=True)
- sla_run(slauuid, csvdump=False, client_id=None)[source]¶
Runs the sla
- Parameters:
client_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client idslauuid (
str
) – The sla rule that needs to be runcsvdump (
bool
) – Dumps the data in csv
- Return type:
dict
- Returns:
Returns the json of sla
Example
>>> self.{risksenseobject}.sla.sla_run('12345-123ea-4f25-b7ab-06933745a4d6')
- update_sla(sla_uuid, description, schedule_type='DAILY', hourofday=0, dayofmonth='4', dayofweek='5', name='Remediation SLAs', type='System', csvdump=False, client_id=None, **kwargs)[source]¶
Updates an sla
- Parameters:
sla_uuid (
str
) – Sla UUIDname (
str
) – Name of thedescription (
str
) – Provide description for slaschedule_type (
str
) – Schedule Frequency (ScheduleFreq.DAILY, ScheduleFreq.WEEKLY, ScheduleFreq.MONTHLY, ‘DISABLED’)type (
str
) – The type of sla , can be ‘SYSTEM’ or ‘USER’hourofday (
int
) – Hour of the daydayofmonth (
str
) – Day of the monthdayofweek (
str
) – Day of the weekcsvdump (
bool
) – dumps the data in csvclient_id – Client ID , if no client id provided , takes default client id
- Returns:
List containing dict of playbook details.
Example
>>> self.{risksenseobject}.sla.update_sla('1234-1234abc-bfc0-b7ab-06933745a4d6','remediation sla','Testingviascript')
Note
You can also dump the data in csv using
csvdump=True
>>> self.{risksenseobject}.sla.update_sla('1234-1234abc-bfc0-b7ab-06933745a4d6','remediation sla','Testingviascript',csvdump=True)
- disablesla(playbookuuid, client_id=None)[source]¶
Disables a particular sla rule.
- Parameters:
playbookuuid (
str
) – The playbookuuids that needs to be disabledclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
bool
- Returns:
Returns json of disable sla
Example
>>> self.{risksenseobject}.sla.disablesla(['11ed05cb-e7a0-4f25-b7ab-06933745a4d6'])
- enablesla(playbookuuid, client_id=None)[source]¶
Enables a particular sla rule.
- Parameters:
playbookuuid (
list
) – The playbookuuids that needs to be enabledclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
bool
- Returns:
success
Example
>>> self.{risksenseobject}.sla.enablesla(['11ed05cb-e7a0-4f25-b7ab-06933745a4d6'])
- getplaybookslarules(slaid, client_id=None)[source]¶
Gets sla playbook rules for a particular sla.
- Parameters:
slaid (
int
) – Slaid to get the sla rulesclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
dict
- Returns:
Returns json of playbook rules
Example
To get sla playbook rule
>>> self.{risksenseobject}.sla.getplaybookslarules('11ed13e6-a1aa-5c28-9fb0-02a87de7e1ee')
- delete_sla_rule(playbookrulepairinguuid, client_id=None)[source]¶
Deletes a particular sla rule
- Parameters:
playbookrulepairinguuid (
str
) – the playbook rule uuidclient_id (
typing.Optional
[int
]) – Client ID, if no client id provided , gets default client id
- Return type:
bool
- Returns:
Success
Example
To delete an sla rule
>>> self.{risksenseobject}.sla.delete_sla_rule('94945073-3d62-35b6-b176-6412bd324b84')