-
-
Save mzk-vct/89d2795c86771fe22ad0ead47b89f04a to your computer and use it in GitHub Desktop.
Script for creating schedule. Generates POOL_UPGRADE command that can be send useing CLI to cluster
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
# Script for creating schedule | |
# Generates POOL_UPGRADE command that can be send useing CLI to cluster | |
```from datetime import datetime, timedelta | |
from dateutil import tz | |
tempalte = "send POOL_UPGRADE name={name} version={version} sha256={sha256} " \ | |
"action={action} schedule={schedule} timeout={timeout}"\ | |
now = datetime.utcnow().replace(tzinfo=tz.tzutc()) + timedelta(minutes=5) | |
nodeIds = [ | |
"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv", | |
"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb", | |
"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya", | |
"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA", | |
"28QFrtVKbbmhJ8nWXsWfLApCi182JkKCMUy5KR4MCNQeCaAs3oVnU4ycFGp6uapcb4UC9RW57X9g2RoUhe95GtQg" | |
] | |
schedule = dict((nodeId, str(now + (timedelta(minutes=5) * i))) | |
for i, nodeId in enumerate(nodeIds)) | |
command = tempalte.format(name="upgrade-11", | |
version="0.1", | |
sha256="aad1242", | |
action="start", | |
schedule=schedule, | |
timeout=10) | |
print(command) | |
exit()``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note that you need to specify own
nodeIds
,version
andname