Ejemplo n.º 1
0
class Configuration(Document):
    '''Create config document. One configuration per customer'''
    name = TextField()
    type = TextField(default="configuration")
    jenkins_url = TextField(
        default="http://build-at-scale-jenkins.default:8080/")
    jenkins_user = TextField(default="admin")
    jenkins_pass = TextField(default="admin")
    scm_url = TextField(default="http://build-at-scale-gitlab.default")
    scm_user = TextField(default="admin")
    scm_pass = TextField(default="admin")
    scm_type = TextField(default="gitlab")
    git_volume = TextField(default="build_at_scale_gitlab")
    scm_purge_limit = IntegerField(default=50)
    container_registry = TextField(
        default="build-at-scale-docker-registry:30450")
    service_username = TextField(default="admin")
    service_password = TextField(default="admin")
    web_service_url = TextField(
        default="http://build-at-scale-webservice.default:80")
    workspace_pod_image = TextField(
        default="theiaide/theia-python:0.4.0-next.6243fc63")
    user_workspace_limit = IntegerField(default=10)
    ontap_api = TextField()
    ontap_apiuser = TextField()
    ontap_apipass = TextField()
    ontap_svm_name = TextField()
    ontap_aggr_name = TextField()
    ontap_data_ip = TextField()
    registry_type = TextField(default="docker-registry")
Ejemplo n.º 2
0
class RingsSchema(Document):
    _id = TextField()
    added = DateTimeField(default=datetime.now)
    license = TextField()
    public = BooleanField(default=False)
    rings = ListField(
        DictField(
            Mapping.build(RingName=TextField(),
                          RingLabel=TextField(),
                          RingDescription=TextField(),
                          RingVersion=TextField(),
                          RingURI=TextField(),
                          RingBuild=TextField(),
                          RingParent=TextField())))
    fields = ListField(
        DictField(
            Mapping.build(
                FieldId=TextField(),
                FieldName=TextField(),
                FieldLabel=TextField(),
                FieldSemantic=TextField(),
                FieldType=TextField(),
                FieldSource=TextField(),
                FieldWidget=TextField(),
                FieldOrder=IntegerField(),
                FieldCardinality=TextField(),
                FieldMultilingual=BooleanField(),
                FieldRequired=BooleanField(),
                FieldDefault=TextField(),
                FieldHint=TextField(),
                FieldLayer=IntegerField(),
            )))
Ejemplo n.º 3
0
class User(Document):
    '''Class for handling workspace documents in db'''
    name = TextField()
    type = TextField(default="user")
    email = TextField()
    uid = IntegerField()
    gid = IntegerField()
    creation_date = DateTimeField(default=datetime.now)
Ejemplo n.º 4
0
class Picture(Document):
    name = TextField()
    width = IntegerField()
    height = IntegerField()
    mime_type = TextField()
    size = IntegerField()
    phash = TextField()
    created = DateTimeField(default=datetime.now)
Ejemplo n.º 5
0
class Configuration(Document):
    """
    Create config document. One configuration per customer
    For release 1.1
    """
    name = TextField()
    type = TextField(default="configuration")

    # ONTAP
    ontap_svm_name = TextField()
    ontap_aggr_name = TextField()
    ontap_data_ip = TextField()

    # SCM
    scm_service_name = TextField()
    scm_pvc_name = TextField()
    scm_url = TextField()
    scm_user = TextField(default="root")
    scm_pass = TextField(default="root_devopsatscale")
    scm_volume = TextField()
    scm_type = TextField(default="gitlab")
    scm_purge_limit = IntegerField(default=50)

    # JENKINS
    jenkins_service_name = TextField()
    jenkins_pvc_name = TextField()
    jenkins_url = TextField()
    jenkins_user = TextField(default="admin")
    jenkins_pass = TextField(default="admin")

    # Database CouchDB
    database_service_name = TextField()
    database_pvc_name = TextField()

    # Artifactory
    registry_service_name = TextField()
    registry_pvc_name = TextField()
    registry_type = TextField(default="artifactory")

    # Webservice
    web_service_name = TextField()
    web_pvc_name = TextField()
    web_service_url = TextField()
    web_service_username = TextField(default="admin")
    web_service_password = TextField(default="admin")

    # Kube specifics
    service_type = TextField()
    kube_namespace = TextField(default='default')
    devops_at_scale_version = TextField(default='1.2')
    storage_class = TextField()

    # User Workspace
    workspace_pod_image = TextField(default="theiaide/theia-python:0.4.0-next.6243fc63")
    user_workspace_limit = IntegerField(default=10)
Ejemplo n.º 6
0
class Project(Document):
    '''Class for handling project documents in db'''
    name = TextField()
    type = TextField(default="project")
    volume = TextField()
    scm_url = TextField()
    jenkins_url = TextField()
    workspace_purge_limit = IntegerField(default=21)
    creation_date = DateTimeField(default=datetime.now)
    ci_purge_limit = IntegerField(default=50)
    export_policy = TextField()
Ejemplo n.º 7
0
class Workspace(Document):
    '''Class for handling workspace documents in db'''
    name = TextField()
    type = TextField(default="workspace")
    project = TextField()
    parent_snapshot = TextField()
    uid = IntegerField()
    gid = IntegerField()
    username = TextField()
    creation_date = DateTimeField(default=datetime.now)
    ide_url = TextField()
    pod_name = TextField()
Ejemplo n.º 8
0
class TestCaseDoc(Document):
    doctype = TextField(default='TestCase')
    campaign_id = TextField()
    crash_signature = TextField()
    seed_file = TextField()  # _id of the File document containing the seed
    fuzzed_file = TextField(
    )  # _id of the File document containing the fuzzed file
    minimized_file = TextField(
    )  # _id of the File document containing the minimized file
    # Attachments: Any files that do not have the same extension as the associated seed file
    bitwise_hd = IntegerField()
    bytewise_hd = IntegerField()
Ejemplo n.º 9
0
class Content(Document):
    termo = TextField()
    urls = ListField(
        DictField(
            Mapping.build(url=TextField(),
                          tf_idf=DecimalField(),
                          frequencia=IntegerField())))
Ejemplo n.º 10
0
class FileDoc(Document):
    doctype = TextField(default='File')
    filename = TextField()
    extension = TextField()
    sha1 = TextField()
    size_in_bytes = IntegerField()
    derived_from_file_id = TextField()
Ejemplo n.º 11
0
class Observation(Document):
    object_id = TextField()
    session_id = TextField()
    frame_number = IntegerField()
    Type = TextField(default="Observation")
    by_object_id = ViewField(
        'observations', '''\
        function(doc) {
        if(doc.Type == "Observation")
            emit(doc.object_id, doc)
        }
    ''')

    by_frame_number = ViewField(
        'observations', '''\
        function(doc) {
            if(doc.Type == "Observation")
                emit(doc.frame_number, doc)
        }
    ''')

    by_session_id = ViewField(
        'observations', '''\
        function(doc) {
            if(doc.Type == "Observation")
                emit(doc.session_id, doc)
        }
    ''')

    @classmethod
    def sync(cls, db):
        cls.by_session_id.sync(db)
        cls.by_object_id.sync(db)
        cls.by_frame_number.sync(db)
Ejemplo n.º 12
0
class TweetData(Document):
    _id = TextField()
    original_text = TextField()
    text = TextField()
    no_spell_text = TextField()
    label = IntegerField()
    tfid_features = TextField()
    features = TextField()
    geo_code = TextField()
    is_read = BooleanField()
    has_processed = BooleanField()
    coordinates = TextField()
    columns = DictField()
    lga_code = IntegerField()
    tag_food = BooleanField()
    tag_politic = BooleanField()
Ejemplo n.º 13
0
class Volts(Document):
    sensor_sn = TextField()
    logger_sn = IntegerField()
    location = TextField()
    gps = TextField()
    date = DateTimeField()
    volts = TextField()
Ejemplo n.º 14
0
 class UsageData(Document):
     """
     Document that represents the stored data.
     """
     url = TextField()
     ua_browser = TextField()
     ua_language = TextField()
     ua_platform = TextField()
     ua_version = TextField()
     blueprint = TextField()
     view_args = TextField()
     status = IntegerField()
     remote_addr = TextField()
     authorization = BooleanField()
     ip_info = TextField()
     path = TextField()
     speed = FloatField()
     datetime = DateTimeField(default=datetime.now)
     username = TextField()
     track_var = TextField()
     by_date = ViewField(
         'start-end', '''function(doc, req) {
         if (!doc._conflicts) {
             emit(doc.datetime, doc);
         }
     }''')
Ejemplo n.º 15
0
class UserQuestionnairePreferenceDocument(DocumentBase):
    user_id = IntegerField()
    project_id = TextField()
    analysis_fields = DictField()

    def __init__(self):
        DocumentBase.__init__(self, document_type='UserQuestionnairePreference')
Ejemplo n.º 16
0
class User(Document):
    name = TextField()
    password = TextField()
    exclusions = ListField(TextField())
    dataInstances = ListField(
        DictField(
            Mapping.build(task_name=TextField(),
                          start_time=DateTimeField(),
                          end_time=DateTimeField(),
                          suggested_time=IntegerField(),
                          pre_energy=IntegerField(),
                          user_feedback=IntegerField(),
                          auto_rating=BooleanField())))
    breakInstances = ListField(
        DictField(
            Mapping.build(break_start_time=DateTimeField(),
                          break_end_time=DateTimeField())))

    usernameView = ViewField(
        'users', '''\
         function(doc) {
             emit(doc.name, doc);
         }''')

    def get_favorites(self):
        favs = []
        for inst in self.dataInstances:
            if inst.task_name not in favs and inst.task_name not in self.exclusions:
                favs.append(inst.task_name)
        return favs

    @property
    def is_active(self):
        return True

    @property
    def is_authenticated(self):
        return True

    @property
    def is_anonymous(self):
        return False

    def get_id(self):
        return unicode(self.name)
Ejemplo n.º 17
0
class Snapshot(Document):
    '''Class for handling snapshot documents in db'''
    name = TextField()
    type = TextField(default="snapshot")
    volume = TextField()
    project = TextField()
    jenkins_build = IntegerField()
    build_status = TextField()
    creation_date = DateTimeField(default=datetime.now)
Ejemplo n.º 18
0
class Workspace(Document):
    '''Class for handling workspace documents in db'''
    name = TextField()
    clone = TextField()
    mount = TextField()
    type = TextField(default="workspace")
    pipeline = TextField()
    build_name = TextField()
    pvc = TextField()
    source_pvc = TextField()
    service = TextField()
    pod = TextField()
    pv = TextField()
    uid = IntegerField()
    gid = IntegerField()
    username = TextField()
    creation_date = DateTimeField(default=datetime.now)
    source_workspace_pvc = TextField()
    ide_url = TextField()
Ejemplo n.º 19
0
class City(Document):
    id = IntegerField()
    country = TextField()
    city = TextField()
    region = TextField()
    postalcode = TextField()
    metrocode = TextField()
    longitude = FloatField()
    latitude = FloatField()
    areacode = TextField()
Ejemplo n.º 20
0
class Tweet(Document):
    user = TextField()
    text = TextField()
    date = TextField()
    last_update = TextField()
    process = IntegerField()
    img_id = ListField(TextField)
    geo = ListField(TextField)
    hashtags = ListField(TextField)
    tags = ListField(TextField)
Ejemplo n.º 21
0
class UsersData(Document):
    email = TextField(name='id')
    first_name = TextField(name='first_name')
    last_name = TextField(name='last_name')
    organization = TextField(name='organization')
    password = TextField(name='passcode')
    phone_number = TextField(name='phone_number')
    wallet = IntegerField(name='wallet', default=100)
    per_request = IntegerField(name='per_requests', default=1)
    status = TextField(name='status', default='active')
    email_verified = TextField(name='email_verified', default=False)
    created_on = DateTimeField(default=datetime.now)
    last_modified = DateTimeField(default=datetime.now, name='last_modified')
    last_login = DateTimeField(default=datetime.now, name='last_login')
    client_id = TextField(default=uuid.uuid4)
    client_secret = TextField(name='client_secret', default=secret_key)
    verification_code = TextField(name='verification_code')

    def __str__(self):
        return self._rev
Ejemplo n.º 22
0
class File(Document):
    # Fields of the documment File
    name = TextField()
    extension = TextField()
    size = IntegerField()
    # If the upload_date isn't given, upload_date will be the today date in seconds since the Epoch
    uploaded_date = FloatField(default=time)
    # If the expiring_date isn't given, expiring_date will be today date in a week in seconds since the Epoch
    expiring_date = FloatField(default=expiring)
    owner_id = TextField()
    shared = ListField(TextField())
    md5 = TextField()
Ejemplo n.º 23
0
class Article(Document):
    """
        Represents articles stored in DB. Used for both reading and inserting articles datas
    """

    type = TextField()
    title = TextField()
    text = TextField()
    source = TextField()
    pub_date = TextField()
    cluster = IntegerField()
    by_source = ViewField(
        'source', '''\
        function(doc) {
            if (doc.type=='article'){emit(doc.source, doc);};
        }''')
    by_article = ViewField(
        'article', '''\
        function(doc) {
            if (doc.type=='article'){emit(doc);};
        }''')

    @staticmethod
    def check_article_url(url):
        #permanent view
        result = COUCHDB.view('source/by_source')
        if not list(result[url]):
            return True

    def _set_article(self, article):
        self.type = 'article'
        self.source = article.url
        self.title = article.title
        self.text = article.text
        if article.publish_date:
            self.pub_date = str(article.publish_date[0].date())
        else:  # just in case publishing date cannot be retrieved, stores 'None'
            self.pub_date = str(article.publish_date)

    def save_article(self, article):
        self._set_article(article)
        self.store(COUCHDB)

    @staticmethod
    def get_all_articles():
        options = {"include_docs": True}
        result = Article.view(COUCHDB, 'article/by_article', **options)
        return list(result)

    def update_article(self, cluster_key):

        self.cluster = cluster_key
        self.store(COUCHDB)
Ejemplo n.º 24
0
class PlantDeviceReading(Document):
    username = TextField()
    devicetype = TextField()
    device_id = TextField()
    timeReading = TextField()
    datetime = IntegerField()
    values = DictField(
        Mapping.build(
            moistureLevel=TextField(),
            waterLevel=TextField(),
            pumpStatus=TextField(),
        ))
Ejemplo n.º 25
0
class Test_Run(Document):
    status = TextField()
    slot = TextField()
    test_runner = TextField()
    test_group = TextField()
    trigger_on = DateTimeField()
    build_id = TextField()
    hash_key = TextField()
    os_label = TextField()
    handlers = ListField(TextField(), name='handler')
    finish_time = DateTimeField()
    count = IntegerField()
    filename = TextField()
    project = TextField()
    platform = TextField()
    test_env = TextField()
    type = TextField()
    start_time = DateTimeField()
Ejemplo n.º 26
0
class Per_Conf(Document):
    id = TextField()
    build_id = TextField()
    count = IntegerField()
    hash_key = TextField()
    os_label = TextField()
    test_runner = TextField()
    handlers = ListField(TextField(), name='handler')
    schedule_time = DateTimeField()
    shedule = ListField(TextField(), name='day')
    to_run = BooleanField()
    slot = TextField()
    filename = TextField()
    project = TextField()
    platform = TextField()
    test_group = ListField(TextField(), name='group')
    schedule_type = TextField()
    test_env = TextField()
    type = TextField()
Ejemplo n.º 27
0
class People(Document):
    suburb = TextField()
    born_country = TextField()
    num = IntegerField()
Ejemplo n.º 28
0
class Result(Document):
   name = TextField()
   question = TextField()
   score = IntegerField()
   added = DateTimeField(default=datetime.datetime.now())
Ejemplo n.º 29
0
class Transaction(Document):
    transaction_number = IntegerField()
    amount = IntegerField()

    def __str__(self):
        return "\t{Transaction: id=%s, amount=%d" & (id, self.amount)
Ejemplo n.º 30
0
class Counttrack(Document):
    """
    This class contains fields for Count related information
    """
    entity = TextField()
    count = IntegerField()