Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added lifecycle hook properties to deletion policy * Check if deletion policy has lifecycle hook properties during deletion and perform lifecycle specific actions if it does * Added complete lifecycle API endpoint * Bumped microversion to 1.9 * Added unit-test cases for lifecycle hooks * Added lifecycle hook notification * Added lifecycle hook properties to deletion policy * Modified node_action to process policy preop if it was a derived action with lifecycle hook properties * Modified LB policy to defer deletion of node until node_deletion action is executed if lifecycle hook properties are defined in deletion policy * Added zaqar test driver * Added documentation for lifecycle hook Depends-On: Id7804abc351c063563b58fb69a66074d0d854ecf Change-Id: I888a01c4f26959649121d6f82430017858a4c481
- Loading branch information
Showing
34 changed files
with
1,092 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Sample deletion policy that can be attached to a cluster. | ||
type: senlin.policy.deletion | ||
version: 1.1 | ||
description: A policy for choosing victim node(s) from a cluster for deletion. | ||
properties: | ||
hooks: | ||
# type of lifecycle hook | ||
type: zaqar | ||
params: | ||
# Name of zaqar queue to receive lifecycle hook message | ||
queue: zaqar_queue_name | ||
# Length in number of seconds before the actual deletion happens | ||
timeout: 180 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from senlin.drivers import base | ||
from senlin.drivers.openstack_test import sdk | ||
|
||
FAKE_SUBSCRIPTION_ID = "0d8dbb71-1538-42ac-99fb-bb52d0ad1b6f" | ||
FAKE_MESSAGE_ID = "51db6f78c508f17ddc924357" | ||
FAKE_CLAIM_ID = "51db7067821e727dc24df754" | ||
|
||
|
||
class ZaqarClient(base.DriverBase): | ||
'''Fake zaqar V2 driver for test.''' | ||
|
||
def __init__(self, ctx): | ||
self.fake_subscription = { | ||
"subscription_id": FAKE_SUBSCRIPTION_ID | ||
} | ||
self.fake_claim = { | ||
"messages": [ | ||
{ | ||
"body": { | ||
"event": "BackupStarted" | ||
}, | ||
"age": 239, | ||
"href": "/v2/queues/demoqueue/messages/" + | ||
FAKE_MESSAGE_ID + "?claim_id=" + FAKE_CLAIM_ID, | ||
"ttl": 300 | ||
} | ||
] | ||
} | ||
self.fake_message = { | ||
"resources": [ | ||
"/v2/queues/demoqueue/messages/" + FAKE_MESSAGE_ID | ||
] | ||
} | ||
|
||
def queue_create(self, **attrs): | ||
return | ||
|
||
def queue_exists(self, queue_name): | ||
return True | ||
|
||
def queue_delete(self, queue, ignore_missing=True): | ||
return | ||
|
||
def subscription_create(self, queue_name, **attrs): | ||
return sdk.FakeResourceObject(self.fake_subscription) | ||
|
||
def subscription_delete(self, queue_name, subscription, | ||
ignore_missing=True): | ||
return | ||
|
||
def claim_create(self, queue_name, **attrs): | ||
return sdk.FakeResourceObject(self.fake_claim) | ||
|
||
def claim_delete(self, queue_name, claim, ignore_missing=True): | ||
return | ||
|
||
def message_delete(self, queue_name, message, claim_id=None, | ||
ignore_missing=True): | ||
return | ||
|
||
def message_post(self, queue_name, message): | ||
return sdk.FakeResourceObject(self.fake_message) |
Oops, something went wrong.