OpenStack Compute (Nova) Client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

server_external_events.py 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. External event triggering for servers, not to be used by users.
  16. """
  17. from novaclient import base
  18. class Event(base.Resource):
  19. def __repr__(self):
  20. return "<Event: %s>" % self.name
  21. class ServerExternalEventManager(base.Manager):
  22. resource_class = Event
  23. def create(self, events):
  24. """Create one or more server events.
  25. :param:events: A list of dictionaries containing 'server_uuid', 'name',
  26. 'status', and 'tag' (which may be absent)
  27. """
  28. body = {'events': events}
  29. return self._create('/os-server-external-events', body, 'events',
  30. return_raw=True)
  31. manager_class = ServerExternalEventManager
  32. name = 'server_external_events'