feat: 添加 command-review API

This commit is contained in:
Bai
2022-12-06 18:26:07 +08:00
committed by Jiangjie.Bai
parent 71e76e5075
commit c9bf99468c
12 changed files with 134 additions and 39 deletions

View File

@@ -104,7 +104,7 @@ class CommandFilterACL(UserAssetAccountBaseACL):
def __str__(self):
return self.name
def create_command_confirm_ticket(self, run_command, session, cmd_filter_rule, org_id):
def create_command_review_ticket(self, run_command, session, cmd_filter_acl, org_id):
from tickets.const import TicketType
from tickets.models import ApplyCommandTicket
data = {
@@ -116,8 +116,7 @@ class CommandFilterACL(UserAssetAccountBaseACL):
'apply_run_account': str(session.account),
'apply_run_command': run_command[:4090],
'apply_from_session_id': str(session.id),
'apply_from_cmd_filter_rule_id': str(cmd_filter_rule.id),
'apply_from_cmd_filter_id': str(cmd_filter_rule.filter.id),
'apply_from_cmd_filter_acl_id': str(cmd_filter_acl.id),
'org_id': org_id,
}
ticket = ApplyCommandTicket.objects.create(**data)