def create_blackout(self, environment, service=None, resource=None, event=None, group=None, tags=None, customer=None, start=None, duration=None, text=None): data = { 'environment': environment, 'service': service or list(), 'resource': resource, 'event': event, 'group': group, 'tags': tags or list(), 'customer': customer, 'startTime': start, 'duration': duration, 'text': text } r = self.http.post('/blackout', data) return Blackout.parse(r['blackout'])
def create_blackout(self, environment, service=None, resource=None, event=None, group=None, tags=None, customer=None, start=None, duration=None, text=None): data = { 'environment': environment, 'service': service or list(), 'resource': resource, 'event': event, 'group': group, 'tags': tags or list(), 'customer': customer, 'startTime': start, 'duration': duration, 'text': text } r = self.http.post('/blackout', data) return Blackout.parse(r['blackout'])
def update_blackout(self, id, **kwargs): data = { 'customer': kwargs.get('customer'), 'environment': kwargs.get('environment'), 'service': kwargs.get('service'), 'resource': kwargs.get('resource'), 'event': kwargs.get('event'), 'group': kwargs.get('group'), 'tags': kwargs.get('tags'), 'startTime': kwargs.get('startTime'), 'endTime': kwargs.get('endTime'), 'text': kwargs.get('text'), } r = self.http.put('/blackout/{}'.format(id), data) return Blackout.parse(r['blackout'])
def get_blackouts(self, query=None): r = self.http.get('/blackouts', query) return [Blackout.parse(b) for b in r['blackouts']]
def _blackout_obj(self, blackouts): return [Blackout.parse(blackout) for blackout in blackouts]
def get_blackouts(self, query=None): r = self.http.get('/blackouts', query) return [Blackout.parse(b) for b in r['blackouts']]
def get_blackout(self, id): return Blackout.parse(self.http.get('/blackout/%s' % id)['blackout'])
def get_blackout(self, id): return Blackout.parse(self.http.get('/blackout/%s' % id)['blackout'])