Beispiel #1
0
class Subscription(RegularResourceC):
    """ See TS-0001 section 9.6.8
        See TS-0004 Table 7.3.7.1-3"""

    eventNotificationCriteria = EntityAttribute(EventNotificationCriteria)
    expirationCounter = Attribute(int)
    notificationURI = ListOfURIsS(mandatory=True)
    groupID = Attribute(AnyURI)
    notificationForwardingURI = Attribute(AnyURI)
    batchNotify = EntityAttribute(BatchNotify)
    rateLimit = EntityAttribute(RateLimit)
    preSubscriptionNotify = Attribute(int,
                                      accesstype=Attribute.WO,
                                      mandatory=False)
    pendingNotification = Attribute(PendingNotificationE)
    notificationStoragePriority = Attribute(int)
    latestNotify = Attribute(bool)
    notificationContentType = Attribute(NotificationContentTypeE)
    notificationEventCat = UnicodeAttribute()  # m2m:eventCat
    creator = IDS(accesstype=Attribute.WO, mandatory=False)
    subscriberURI = Attribute(AnyURI, accesstype=Attribute.WO, mandatory=False)

    __child_types__ = (
        # Schedule,
    )
Beispiel #2
0
class SecurityInfo(OneM2MEntity):
    securityInfoType = Attribute(SecurityInfoTypeE)
    # dasRequest = ListAttribute()   # lists are wrong?
    # dasResponse = ListAttribute()
    dasRequest = EntityAttribute(DynAuthDasRequestC)
    dasResponse = EntityAttribute(DynAuthDasResponseC)
    esprimRandObject = ListAttribute()  # m2m:receiverESPrimRandObject
    esprimObject = ListAttribute()  # m2m:e2eCompactJWE
    escertkeMessage = ListAttribute()  # xs:base64Binary
Beispiel #3
0
class DynAuthDasRequestC(OneM2MEntity):
    originator = UnicodeAttribute()  # m2m:ID
    targetedResourceType = Attribute(ResourceTypeE)
    operation = UnicodeAttribute()  # m2m:operation
    # operation = EntityAttribute(OperationE)
    originatorIP = EntityAttribute(OriginatorIPTypeC)
    originatorLocation = EntityAttribute(LocationRegionC)
    requestTimestamp = TimestampS()
    targetedResourceID = UnicodeAttribute()  # xs:anyURI
    # targetedResourceID = Attribute(AnyURI)
    proposedPrivilegesLifetime = TimestampS()
    # TODO(rkr): is this ok?
    originatorRoleIDs = StringListAttribute()  # list of m2m:roleID
    roleIDsFromACPs = StringListAttribute()  # list of m2m:roleID
    tokenIDs = StringListAttribute()  # list of m2m:tokeID
Beispiel #4
0
class Notification(OneM2MEntity):
    notificationEvent = EntityAttribute(NotificationEventC)
    verificationRequest = Attribute(bool)
    subscriptionDeletion = Attribute(bool)
    subscriptionReference = Attribute(AnyURI)
    creator = UnicodeAttribute()  # ID
    notificationForwardingURI = Attribute(AnyURI)
Beispiel #5
0
class CommunicationChannel(DefaultResource):
    """See TS 102.921 10.42.1."""
    id = UnicodeAttribute(mandatory=False, id_attribute=True)
    channelType = UnicodeAttribute(mandatory=True, accesstype=Attribute.WO)
    contactURI = UnicodeAttribute(accesstype=Attribute.RO)
    channelData = EntityAttribute(accesstype=Attribute.RO,
                                  type=LongPollingChannelData)
Beispiel #6
0
class anpPolicy(SubscribableResource):
    """See TS 102.690 B.2.1.3."""
    # For each Network
    anName = UnicodeAttribute(id_attribute=True)
    # RCAT vs time
    rcatSchedList = EntityAttribute(RcatSchedList)
    # Failed attempts vs block duration (optionnal)
    blockPeriods = EntityAttribute(BlockList)

    def __eq__(self, o):
        if self.anName is not None:
            try:
                return self.anName == o.anName
            except AttributeError:
                return False
        return super(anpPolicy, self).__eq__(o)
Beispiel #7
0
class ResourceC(LabeledResource):
    __child_types__ = ()

    typename = None

    resourceName = UnicodeAttribute(accesstype=Attribute.WO, mandatory=False)

    resourceType = EntityAttribute(ResourceTypeE, accesstype=Attribute.RO)
    resourceID = IDS(accesstype=Attribute.RO)
    parentID = NhURIS(accesstype=Attribute.RO)

    lastModifiedTime = TimestampS(accesstype=Attribute.RO)
    creationTime = TimestampS(accesstype=Attribute.RO)

    childResource = ListAttribute()

    @property
    def name(self):
        return self.resourceName

    @property
    def id(self):
        return self.resourceID

    def __repr__(self):
        return "%s(path='%s', id='%s')" % (type(self).__name__, self.path,
                                           self.id)

    def has_child_type(self, resource_type):
        return resource_type in self.__child_types__
Beispiel #8
0
class AccessControlObjectDetailsC(OneM2MEntity):
    # specifies to which resource type the rule applies
    resourceType = EntityAttribute(ResourceTypeE)
    # TODO(rkr): Child resource types listed in the childResourceType component are subject of
    # TODO       access control for the Create operation only. Once a child resource is created,
    # TODO       the Access Control Policies assigned directly to it apply.
    # for create operation only, list of creatable child resources
    childResourceType = ListAttribute(ResourceTypeE)
    specializationID = Attribute(AnyURI)  # xs:anyURI
Beispiel #9
0
class Notify(Entity):
    """See TS 102.921 table 10.305"""

    statusCode = Attribute(mandatory=True)
    representation = EntityAttribute(dict)
    timeoutReason = UnicodeAttribute()
    subscriptionReference = UnicodeAttribute(mandatory=True)
    contact = UnicodeAttribute()
    requestingEntity = UnicodeAttribute()
Beispiel #10
0
class AnnouncementResource(ExpiringResource):
    id = UnicodeAttribute(id_attribute=True)
    accessRightID = UnicodeAttribute(mandatory=False)  # todo
    searchStrings = ListAttribute(mandatory=True)
    # TODO(rst): workaround -> change back to RW later
    link = UnicodeAttribute(mandatory=True,
                            accesstype=Attribute.RW,
                            update_mandatory=False)
    announceTo = EntityAttribute(mandatory=False,
                                 type=AnnounceTo,
                                 default=None)
Beispiel #11
0
class ContentInstance(DefaultResource):
    """See TS 102.921 10.19.1."""
    id = UnicodeAttribute(mandatory=False, id_attribute=True)
    href = UnicodeAttribute(mandatory=False, path_attribute=True)
    contentTypes = ListAttribute()
    contentSize = Attribute(int)
    # creationTime
    # lastModifiedTime
    delayTolerance = UnicodeAttribute(mandatory=False)  # todo
    content = EntityAttribute(Content)
    searchStrings = ListAttribute(version="2.0")
Beispiel #12
0
class RequestPrimitive(OneM2MEntity):
    operation = EntityAttribute(OperationE)
    to = Attribute(AnyURI)
    from_ = IDS()
    requestIdentifier = RequestIDS()
    resourceType = EntityAttribute(ResourceTypeE)
    name = UnicodeAttribute()
    primitiveContent = UnicodeAttribute()  # m2m:primitiveContent
    role = UnicodeAttribute()  # xs:anyType
    originatingTimestamp = TimestampS()
    requestExpirationTimestamp = TimestampS()  # m2m::absRelTimestamp
    resultExpirationTimestamp = TimestampS()  # m2m::absRelTimestamp
    operationExecutionTime = TimestampS()  # m2m::absRelTimestamp
    responseType = UnicodeAttribute()  # m2m:responseTypeInfo
    resultPersistence = TimestampS()  # m2m::absRelTimestamp
    resultContent = UnicodeAttribute()  # m2m:resultContent
    eventCategory = UnicodeAttribute()  # m2m:eventCat
    deliveryAggregation = Attribute(bool)
    groupRequestIdentifier = UnicodeAttribute()
    filterCriteria = EntityAttribute(FilterCriteria)
    discoveryResultType = EntityAttribute(DiscResTypeE)
Beispiel #13
0
class FilterCriteria(OneM2MEntity):
    createdBefore = TimestampS()
    createdAfter = TimestampS()
    modifiedSince = TimestampS()
    unmodifiedSince = TimestampS()
    stateTagSmaller = Attribute(int)  # xs:positiveInteger
    stateTagBigger = Attribute(int)  # xs:nonNegativeInteger
    expireBefore = TimestampS()
    expireAfter = TimestampS()
    labels = StringListAttribute()
    resourceType = ListAttribute(ResourceTypeE)
    sizeAbove = Attribute(int)  # xs:nonNegativeInteger
    sizeBelow = Attribute(int)  # xs:positiveInteger
    contentType = UnicodeAttribute()  # m2m:typeOfContent
    attribute = ListAttribute()  # m2m:attribute
    filterUsage = EntityAttribute(FilterUsageE)
    limit = Attribute(int)  # xs:nonNegativeInteger
Beispiel #14
0
class Subscription(ExpiringResource):
    """See TS 102.921 10.25.1."""
    # expirationTime
    minimalTimeBetweenNotifications = UnicodeAttribute(mandatory=False)  # todo
    delayTolerance = UnicodeAttribute(mandatory=False)  # todo
    # creationTime
    # lastModifiedTime
    filterCriteria = EntityAttribute(mandatory=False,
                                     accesstype=Attribute.WO,
                                     type=FilterCriteria,
                                     default=None)
    subscriptionType = UnicodeAttribute(mandatory=False,
                                        accesstype=Attribute.WO)  # todo
    contact = Attribute(str, mandatory=True, accesstype=Attribute.WO)
    id = UnicodeAttribute(mandatory=False, id_attribute=True)
    aggregateURI = Attribute(str, version="2.0")
    timeoutReason = UnicodeAttribute(version="2.0")
    noRepresentation = Attribute(bool, version="2.0")
    subscriberId = Attribute(str, version="2.0", accesstype=None)

    def __repr__(self):
        return "openmtc.Subscription(%r, %r)" % (self.id, self.contact)
Beispiel #15
0
class DynAuthDasResponseC(OneM2MEntity):
    # dynamicACPInfo = ListAttribute(DynamicACPInfoC)
    dynamicACPInfo = EntityAttribute(DynamicACPInfoC)
    tokens = StringListAttribute()  # list of simpleType m2m:dynAuthJWT
Beispiel #16
0
class NotificationEventC(OneM2MEntity):
    representation = EntityAttribute(ResourceC)  # xs:anyType
    operationMonitor = EntityAttribute(OperationMonitorTypeC)
    notificationEventType = EntityAttribute(NotificationEventTypeE)
Beispiel #17
0
class Permission(Entity):
    """See TS 102.921 table 11.16"""
    id = Attribute(str, id_attribute=True, mandatory=True)
    permissionFlags = ListAttribute(mandatory=True)
    permissionHolders = EntityAttribute(mandatory=True, type=PermissionHolder)
Beispiel #18
0
class AnnounceableResource(ETSIResource):
    announceTo = EntityAttribute(mandatory=False,
                                 default=None,
                                 type=AnnounceTo)
Beispiel #19
0
class AccessControlContextsC(OneM2MEntity):
    accessControlWindow = StringListAttribute()   # m2m:scheduleEntry
    accessControlIpAddresses = EntityAttribute(AccessControlIpAddressesC)
    accessControlLocationRegion = ListAttribute(LocationRegionC)   # m2m:locationRegion