Exemplo n.º 1
0
"""

import logging
import os
from uuid import uuid4

from django.core.cache import caches
from django.core.exceptions import ValidationError
from django.db import models

from dtrove import config
from dtrove.providers import get_provider

CACHE = caches["default"]
PROVIDER = get_provider()


class Cluster(models.Model):
    """Datastore Cluster

    This is the Main User facing object it defines the datastore type along
    with the size of the cluster and the other user options.

    :param str name: Name of the cluster
    :param datastore: Datastore of the cluster
    :type datastore: :py:class:`dtrove.models.Datastore`
    :param int size: Number of nodes in the cluster

    When a user creates a new Cluster the system handles provisioning the
    underlining instances and checking on the health of them.
Exemplo n.º 2
0
 def test_get_provider(self):
     from dtrove.providers.openstack import Provider
     from dtrove.providers import get_provider
     p = get_provider()
     self.assertTrue(isinstance(p, Provider))