summaryrefslogtreecommitdiff
path: root/novaclient/v2/contrib/server_external_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/v2/contrib/server_external_events.py')
-rw-r--r--novaclient/v2/contrib/server_external_events.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/novaclient/v2/contrib/server_external_events.py b/novaclient/v2/contrib/server_external_events.py
new file mode 100644
index 0000000..a45914b
--- /dev/null
+++ b/novaclient/v2/contrib/server_external_events.py
@@ -0,0 +1,43 @@
1# Copyright (C) 2014, Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15"""
16External event triggering for servers, not to be used by users.
17"""
18
19from novaclient import base
20
21
22class Event(base.Resource):
23 def __repr__(self):
24 return "<Event: %s>" % self.name
25
26
27class ServerExternalEventManager(base.Manager):
28 resource_class = Event
29
30 def create(self, events):
31 """Create one or more server events.
32
33 :param:events: A list of dictionaries containing 'server_uuid', 'name',
34 'status', and 'tag' (which may be absent)
35 """
36
37 body = {'events': events}
38 return self._create('/os-server-external-events', body, 'events',
39 return_raw=True)
40
41
42manager_class = ServerExternalEventManager
43name = 'server_external_events'