Beispiel #1
0
	def post(self):
		#
		# 新規仕様書登録用の書式定義
		#
		schema = {
			'type'          : 'object',
				'properties'	: {
				'config'	: {
					'type'		: 'string',
					'minLength'	: 2,
				},
				'enable'	: {
					'type'		: 'boolean',
				},
				'interval'	: {
					'type'		: 'integer',
				},
			},
			'required'	: ['config']
		}

		#
		# 監視設定の登録
		#
		config = RESTsfulController.post(self, schema, self.request.json_body, unique_columns = [])
		print config

		from module import ping
		self.request.registry.scheduler.add_job(ping, 'interval', args = [config['id']], seconds = 30)

		return config
Beispiel #2
0
	def post(self):
		#
		# 新規登録用の書式定義
		#
		schema = {
			'type'          : 'object',
				'properties'	: {
				'name'		: {
					'type'		: 'string',
				},
			},
			'required'	: ['name']
		}

		#
		# データセンターの作成
		#
		return RESTsfulController.post(self, schema, self.request.json_body, unique_columns = [])
Beispiel #3
0
	def get(self):
		return RESTsfulController.get(self)
Beispiel #4
0
	def __init__(self, request):
		RESTsfulController.__init__(self, Unit)
		self.request = request
Beispiel #5
0
	def __init__(self, request):
		RESTsfulController.__init__(self, MonitoringConfiguration)
		self.request = request
Beispiel #6
0
	def __init__(self, request):
		RESTsfulController.__init__(self, LabelType)
		self.request = request
Beispiel #7
0
 def __init__(self, request):
     RESTsfulController.__init__(self, MonitoringPoint)
     self.request = request