mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 02:11:06 +08:00
[update] delete roles, users, attributes
This commit is contained in:
@@ -63,6 +63,7 @@ class AttributeView(APIView):
|
||||
current_app.logger.debug(params)
|
||||
|
||||
attr_id = AttributeManager.add(**params)
|
||||
|
||||
return self.jsonify(attr_id=attr_id)
|
||||
|
||||
@args_validate(AttributeManager.cls)
|
||||
@@ -72,8 +73,10 @@ class AttributeView(APIView):
|
||||
params["choice_value"] = choice_value
|
||||
current_app.logger.debug(params)
|
||||
AttributeManager().update(attr_id, **params)
|
||||
|
||||
return self.jsonify(attr_id=attr_id)
|
||||
|
||||
def delete(self, attr_id):
|
||||
attr_name = AttributeManager.delete(attr_id)
|
||||
|
||||
return self.jsonify(message="attribute {0} deleted".format(attr_name))
|
||||
|
@@ -75,9 +75,9 @@ class AutoDiscoveryRuleTemplateFileView(APIView):
|
||||
|
||||
return self.send_file(bf,
|
||||
as_attachment=True,
|
||||
attachment_filename="cmdb_auto_discovery.json",
|
||||
download_name="cmdb_auto_discovery.json",
|
||||
mimetype='application/json',
|
||||
cache_timeout=0)
|
||||
max_age=0)
|
||||
|
||||
def post(self):
|
||||
f = request.files.get('file')
|
||||
|
@@ -350,9 +350,9 @@ class CITypeTemplateFileView(APIView):
|
||||
|
||||
return self.send_file(bf,
|
||||
as_attachment=True,
|
||||
attachment_filename="cmdb_template.json",
|
||||
download_name="cmdb_template.json",
|
||||
mimetype='application/json',
|
||||
cache_timeout=0)
|
||||
max_age=0)
|
||||
|
||||
@role_required(RoleEnum.CONFIG)
|
||||
def post(self): # import
|
||||
|
Reference in New Issue
Block a user