otupy.profiles.ctxd.data.service.Service
- class Service(service: object = None, name: ~otupy.profiles.ctxd.data.name.Name = None, domain: str = None, namespace: str = None, sid: ~otupy.profiles.ctxd.data.service.SId = None, type: ~otupy.profiles.ctxd.data.service_type.ServiceType = None, subservices: ~otupy.types.base.array_of.ArrayOf.__new__.<locals>.ArrayOf = None, owner: str = None, release: str = None)
Bases:
RecordService components
The Service is any digital resource present in a system, including software, APIs, devices, infrastructures and their elementary components. `Service`s have dependencies between them (aka `Link`s), which describe how they are related and how vulnerabilities might propagate.
A Service may also be an composition of more elementary subservices. In this case, both the Service and its sub`Service`s are described and linked, which allows to expose the system composition and topology with different level of granularity according to the trust level.
The domain and namespace field are kept for backward compatibility, but may be removed in future versions because they are already included in the SId. Do not rely or use these fields.
Methods
Builds instance from dictionary
Converts to dictionary
Attributes
Domain of the service (e.g. OpenStack domain).
Name of the service
Tenant/namespace of the service
owner of the service
Release version of the service
Id of the service, to be create as unique as possible
Subservices of the main service
It identifies the type of the service
- __init__(service: object = None, name: ~otupy.profiles.ctxd.data.name.Name = None, domain: str = None, namespace: str = None, sid: ~otupy.profiles.ctxd.data.service.SId = None, type: ~otupy.profiles.ctxd.data.service_type.ServiceType = None, subservices: ~otupy.types.base.array_of.ArrayOf.__new__.<locals>.ArrayOf = None, owner: str = None, release: str = None)
- classmethod fromdict(dic, e)
Builds instance from dictionary
It is used during deserialization to create an otupy instance from the text message. It takes an
Encoderinstance that is used to recursively build instances of the inner objects (theEncoderprovides standard methods to create instances of base objects like strings, integers, boolean).- Parameters:
dic – The intermediary dictionary representation from which the object is built.
e – The
Encoderthat is being used.
- Returns:
An instance of this class initialized from the dictionary values.
- subservices: ArrayOf = None
Subservices of the main service
- todict(e)
Converts to dictionary
It is used to convert this object to an intermediary representation during serialization. It takes an
Encoderargument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..- Parameters:
e – The
Encoderthat is being used.- Returns:
A dictionary compliants to the Language Specification’s serialization rules.
- type: ServiceType = None
It identifies the type of the service