"<ID>": {"METHODS": ("GET", "DELETE")}
},
"vim_accounts": {"METHODS": ("GET", "POST"),
- "<ID>": {"METHODS": ("GET", "DELETE")}
+ "<ID>": {"METHODS": ("GET", "DELETE", "PATCH")}
},
"sdns": {"METHODS": ("GET", "POST"),
- "<ID>": {"METHODS": ("GET", "DELETE")}
+ "<ID>": {"METHODS": ("GET", "DELETE", "PATCH")}
},
}
},
cherrypy.response.status = HTTPStatus.NO_CONTENT.value
outdata = None
else:
- outdata = {"id": self.engine.edit_item(session, engine_item, args[1], indata, kwargs)}
+ outdata = {"id": self.engine.edit_item(session, engine_item, _id, indata, kwargs)}
+ elif method == "PATCH":
+ if not indata and not kwargs:
+ raise NbiException("Nothing to update. Provide payload and/or query string",
+ HTTPStatus.BAD_REQUEST)
+ outdata = {"id": self.engine.edit_item(session, engine_item, _id, indata, kwargs)}
else:
raise NbiException("Method {} not allowed".format(method), HTTPStatus.METHOD_NOT_ALLOWED)
return self._format_out(outdata, session, _format)
sdn_properties = {
"name": name_schema,
+ "description": description_schema,
"dpid": {"type": "string", "pattern": "^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
"ip": ip_schema,
"port": port_schema,
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": sdn_properties,
- "required": ["name", "port", 'ip', 'dpid', 'type'],
+ # "required": ["name", "port", 'ip', 'dpid', 'type'],
"additionalProperties": False
}
sdn_port_mapping_schema = {