def rest_initialiser(cluster_init_check=False, version_check=False, enterprise_check=None):
    'rest_initialiser is a decorator that does common subcommand tasks.\n\n    The decorator will always creates a cluster manager and assign it to the subcommand variable rest\n    :param cluster_init_check: if true it will check if the cluster is initialized before executing the subcommand\n    :param version_check: if true it will check if the cluster and CLI version match if they do not it prints a warning\n    :param enterprise_check: if true it will check if the cluster is enterprise and fail if not. If it is false it does\n        the check but it does not fail if not enterprise. If none it does not perform the check. The result of the check\n        is stored on the instance parameter enterprise\n    '

    def inner(fn):

        def decorator(self, opts):
            self.rest = ClusterManager(opts.cluster, opts.username, opts.password, opts.ssl, opts.ssl_verify, opts.cacert, opts.debug)
            if cluster_init_check:
                check_cluster_initialized(self.rest)
            if version_check:
                check_versions(self.rest)
            if (enterprise_check is not None):
                (enterprise, errors) = self.rest.is_enterprise()
                _exit_if_errors(errors)
                if (enterprise_check and (not enterprise)):
                    _exit_if_errors(['Command only available in enterprise edition'])
                self.enterprise = enterprise
            return fn(self, opts)
        return decorator
    return inner
rest_initialiser is a decorator that does common subcommand tasks.

The decorator will always creates a cluster manager and assign it to the subcommand variable rest
:param cluster_init_check: if true it will check if the cluster is initialized before executing the subcommand
:param version_check: if true it will check if the cluster and CLI version match if they do not it prints a warning
:param enterprise_check: if true it will check if the cluster is enterprise and fail if not. If it is false it does
    the check but it does not fail if not enterprise. If none it does not perform the check. The result of the check
    is stored on the instance parameter enterprise
def rest_initialiser(cluster_init_check=False, version_check=False, enterprise_check=None):
    'rest_initialiser is a decorator that does common subcommand tasks.\n\n    The decorator will always creates a cluster manager and assign it to the subcommand variable rest\n    :param cluster_init_check: if true it will check if the cluster is initialized before executing the subcommand\n    :param version_check: if true it will check if the cluster and CLI version match if they do not it prints a warning\n    :param enterprise_check: if true it will check if the cluster is enterprise and fail if not. If it is false it does\n        the check but it does not fail if not enterprise. If none it does not perform the check. The result of the check\n        is stored on the instance parameter enterprise\n    '

    def inner(fn):

        def decorator(self, opts):
            self.rest = ClusterManager(opts.cluster, opts.username, opts.password, opts.ssl, opts.ssl_verify, opts.cacert, opts.debug)
            if cluster_init_check:
                check_cluster_initialized(self.rest)
            if version_check:
                check_versions(self.rest)
            if (enterprise_check is not None):
                (enterprise, errors) = self.rest.is_enterprise()
                _exit_if_errors(errors)
                if (enterprise_check and (not enterprise)):
                    _exit_if_errors(['Command only available in enterprise edition'])
                self.enterprise = enterprise
            return fn(self, opts)
        return decorator
    return inner