# createCluster.py
# 20080705
# copyright (c), 2008, by Arthur Kevin McGrath
# All rights reserved


# createCluster
# parameters:
#    nameOfCluster
#        String - the name of the cluster to create
#    createReplicationDomain
#        boolean - should we also create a replication domain for this cluster
#        if no value is passed, the default is false
#        In this version of Jython, 0 means false and 1 means true
# returns:
#    nothing
def createCluster( nameOfCluster, createReplicationDomain = 0 ):
  cluster = None
  # create the cluster
  print "  . . . creating a " + nameOfCluster + " cluster"
  if createReplicationDomain == 0:
    cluster = AdminTask.createCluster('[-clusterConfig [-clusterName ' + nameOfCluster + ']]')
  else:
    cluster = AdminTask.createCluster('[-clusterConfig [-clusterName ' + nameOfCluster + '] -replicationDomain [-createDomain true] ]')
  print cluster
  whatFilesChanged()
  return

# common routines
# The methods that follow are NEVER expected to be called
# by code outside of this file

# whatFilesChanged
# Reports the configuration files that will be changed
# as a result of any code in this file
# The changes will take effect when you call AdminConfig.save()
def whatFilesChanged():
  print "The following congfiguration files have changes pending:"
  print AdminConfig.queryChanges()
  return



