Teresa Ho cd3b40c9c7 Add new version of subscription API
Support of the new version 1 subscription API as well as the
previous version 1 API.

Test Plan:
Tested with ptpdemo app.
Pass: Subscribe ptp notification using old API
Pass: Subscribe ptp notification using new API
Pass: List all subscriptions (both old and new versions)
Pass: Get a subscription by ID (both old and new versions)
Pass: Delete subscription by ID

Story: 2010056
Task: 45688

Change-Id: I153ec23b2abb712d30279aa9e1c84e038a69a24c
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
2022-06-30 09:01:59 -04:00

26 lines
759 B
Python

#
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sqlalchemy import Float, Integer, ForeignKey, String, Column
from notificationclientsdk.model.orm.base import OrmBase
class Subscription(OrmBase):
__tablename__ = 'subscription'
SubscriptionId = Column(String(128), primary_key=True)
UriLocation = Column(String(512))
ResourceType = Column(String(64))
EndpointUri = Column(String(512))
InitialDeliveryTimestamp = Column(Float)
Status = Column(Integer)
CreateTime = Column(Float)
LastUpdateTime = Column(Float)
ResourceQualifierJson = Column(String)
ResourceAddress = Column(String(512))
def create_tables(orm_engine):
Subscription.metadata.create_all(orm_engine)