Cluster upgrade extension for Fuel
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.

extension.py 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2015 Mirantis, Inc.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  5. # not use this file except in compliance with the License. You may obtain
  6. # a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. # License for the specific language governing permissions and limitations
  14. # under the License.
  15. import os
  16. from nailgun import extensions
  17. from . import handlers
  18. class ClusterUpgradeExtension(extensions.BaseExtension):
  19. name = 'cluster_upgrade'
  20. version = '0.0.1'
  21. description = "Cluster Upgrade Extension"
  22. urls = [
  23. {'uri': r'/clusters/(?P<cluster_id>\d+)/upgrade/clone/?$',
  24. 'handler': handlers.ClusterUpgradeCloneHandler},
  25. {'uri': r'/clusters/(?P<cluster_id>\d+)/upgrade/assign/?$',
  26. 'handler': handlers.NodeReassignHandler},
  27. {'uri': r'/clusters/(?P<cluster_id>\d+)/upgrade/vips/?$',
  28. 'handler': handlers.CopyVIPsHandler},
  29. {'uri': r'/clusters/(?P<cluster_id>\d+)/upgrade/clone_release/'
  30. r'(?P<release_id>\d+)/?$',
  31. 'handler': handlers.CreateUpgradeReleaseHandler},
  32. ]
  33. @classmethod
  34. def alembic_migrations_path(cls):
  35. return os.path.join(os.path.dirname(__file__),
  36. 'alembic_migrations', 'migrations')
  37. @classmethod
  38. def on_cluster_delete(cls, cluster):
  39. from .objects import relations
  40. relations.UpgradeRelationObject.delete_relation(cluster.id)