Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4A6A200C4B for ; Mon, 20 Mar 2017 17:22:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E3738160B81; Mon, 20 Mar 2017 16:22:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 13EB4160B76 for ; Mon, 20 Mar 2017 17:22:46 +0100 (CET) Received: (qmail 38524 invoked by uid 500); 20 Mar 2017 16:22:46 -0000 Mailing-List: contact dev-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list dev@ariatosca.incubator.apache.org Received: (qmail 38513 invoked by uid 99); 20 Mar 2017 16:22:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2017 16:22:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 981E2185F17 for ; Mon, 20 Mar 2017 16:22:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Vdpl5D3ZKJav for ; Mon, 20 Mar 2017 16:22:44 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id F345A5FE03 for ; Mon, 20 Mar 2017 16:22:42 +0000 (UTC) Received: (qmail 38366 invoked by uid 99); 20 Mar 2017 16:22:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2017 16:22:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 29690DFE34; Mon, 20 Mar 2017 16:22:42 +0000 (UTC) From: tliron To: dev@ariatosca.incubator.apache.org Reply-To: dev@ariatosca.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-ariatosca pull request #72: ARIA-105 integrate modeling Content-Type: text/plain Message-Id: <20170320162242.29690DFE34@git1-us-west.apache.org> Date: Mon, 20 Mar 2017 16:22:42 +0000 (UTC) archived-at: Mon, 20 Mar 2017 16:22:48 -0000 Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/72#discussion_r106946846 --- Diff: aria/modeling/models.py --- @@ -0,0 +1,283 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=abstract-method + +from sqlalchemy.ext.declarative import declarative_base + +from . import ( + service_template, + service_instance, + service_changes, + service_common, + orchestration, + mixins, +) + + +aria_declarative_base = declarative_base(cls=mixins.ModelIDMixin) + + +# region service template models + +class ServiceTemplate(aria_declarative_base, service_template.ServiceTemplateBase): + pass + + +class NodeTemplate(aria_declarative_base, service_template.NodeTemplateBase): + pass + + +class GroupTemplate(aria_declarative_base, service_template.GroupTemplateBase): + pass + + +class PolicyTemplate(aria_declarative_base, service_template.PolicyTemplateBase): + pass + + +class SubstitutionTemplate(aria_declarative_base, service_template.SubstitutionTemplateBase): + pass + + +class SubstitutionTemplateMapping(aria_declarative_base, + service_template.SubstitutionTemplateMappingBase): + pass + + +class RequirementTemplate(aria_declarative_base, service_template.RequirementTemplateBase): + pass + + +class RelationshipTemplate(aria_declarative_base, service_template.RelationshipTemplateBase): + pass + + +class CapabilityTemplate(aria_declarative_base, service_template.CapabilityTemplateBase): + pass + + +class InterfaceTemplate(aria_declarative_base, service_template.InterfaceTemplateBase): + pass + + +class OperationTemplate(aria_declarative_base, service_template.OperationTemplateBase): + pass + + +class ArtifactTemplate(aria_declarative_base, service_template.ArtifactTemplateBase): + pass + +# endregion + + +# region service instance models + +class Service(aria_declarative_base, service_instance.ServiceBase): + pass + + +class Node(aria_declarative_base, service_instance.NodeBase): + pass + + +class Group(aria_declarative_base, service_instance.GroupBase): + pass + + +class Policy(aria_declarative_base, service_instance.PolicyBase): + pass + + +class Substitution(aria_declarative_base, service_instance.SubstitutionBase): + pass + + +class SubstitutionMapping(aria_declarative_base, service_instance.SubstitutionMappingBase): + pass + + +class Relationship(aria_declarative_base, service_instance.RelationshipBase): + pass + + +class Capability(aria_declarative_base, service_instance.CapabilityBase): + pass + + +class Interface(aria_declarative_base, service_instance.InterfaceBase): + pass + + +class Operation(aria_declarative_base, service_instance.OperationBase): + pass + + +class Artifact(aria_declarative_base, service_instance.ArtifactBase): + pass + +# endregion + + +# region service changes models + +class ServiceUpdate(aria_declarative_base, service_changes.ServiceUpdateBase): + pass + + +class ServiceUpdateStep(aria_declarative_base, service_changes.ServiceUpdateStepBase): + pass + + +class ServiceModification(aria_declarative_base, service_changes.ServiceModificationBase): + pass + +# endregion + + +# region common service models + +class Parameter(aria_declarative_base, service_common.ParameterBase): + pass + + +class Type(aria_declarative_base, service_common.TypeBase): + pass + + +class Metadata(aria_declarative_base, service_common.MetadataBase): + pass + + +class PluginSpecification(aria_declarative_base, service_common.PluginSpecificationBase): + pass + +# endregion + + +# region orchestration models + +class Execution(aria_declarative_base, orchestration.ExecutionBase): + pass + + +class Plugin(aria_declarative_base, orchestration.PluginBase): + pass + + +class Task(aria_declarative_base, orchestration.TaskBase): + pass + + +class Log(aria_declarative_base, orchestration.LogBase): + pass + +# endregion + + +models_to_register = [ + # Service template models + ServiceTemplate, + NodeTemplate, + GroupTemplate, + PolicyTemplate, + SubstitutionTemplate, + SubstitutionTemplateMapping, + RequirementTemplate, + RelationshipTemplate, + CapabilityTemplate, + InterfaceTemplate, + OperationTemplate, + ArtifactTemplate, + + # Service instance models + Service, + Node, + Group, + Policy, + SubstitutionMapping, + Substitution, + Relationship, + Capability, + Interface, + Operation, + Artifact, + + # Service changes models + ServiceUpdate, + ServiceUpdateStep, + ServiceModification, + + # Common service models + Parameter, + Type, + Metadata, + PluginSpecification, + + # Orchestration models + Execution, + Plugin, + Task, + Log +] + +__all__ = ( --- End diff -- I wanted this to be close to `models_to_register` because they are almost the same, but I will do it your way. I am adding comments though so people will know to update the other list. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---