Beispiel #1
0
class FolderSchema(Linkable):
    domainType = fields.Constant(
        "folder_config",
        required=True,
    )
    id = fields.String()
    title = fields.String()
    members = fields.Nested(FolderMembers())
Beispiel #2
0
class FolderCollection(DomainObjectCollection):
    domainType = fields.Constant(
        "folder_config",
        description="The domain type of the objects in the collection.",
    )
    value = fields.List(
        fields.Nested(ConcreteFolder),
        description="A list of folder objects.",
    )
Beispiel #3
0
class ActionResultScalar(ActionResultBase):
    resultType = fields.Constant('scalar')
    result = fields.Nested(
        Schema.from_dict(
            {
                'links': fields.List(
                    fields.Nested(LinkSchema),
                    required=True,
                ),
                'value': fields.String(
                    required=True,
                    example="Done.",
                )
            },
            name='ActionResultScalarValue',
        ))
Beispiel #4
0
class LinkSchema(BaseSchema):
    """A Link representation according to A-24 (2.7)

    """
    domainType = fields.Constant("link", required=True)
    rel = fields.String(
        description=
        ("Indicates the nature of the relationship of the related resource to the "
         "resource that generated this representation"),
        required=True,
        example="self",
    )
    href = fields.Str(
        description=
        ("The (absolute) address of the related resource. Any characters that are "
         "invalid in URLs must be URL encoded."),
        required=True,
        example="https://.../api_resource",
    )
    method = fields.String(
        description=
        "The HTTP method to use to traverse the link (get, post, put or delete)",
        required=True,
        pattern="GET|PUT|POST|DELETE",
        example="GET",
    )
    type = fields.String(
        description="The content-type that the linked resource will return",
        required=True,
        example="application/json",
    )
    title = fields.String(
        description=
        ("string that the consuming application may use to render the link without "
         "having to traverse the link in advance"),
        allow_none=True,
        example="The object itself",
    )
    body_params = fields.Dict(
        description=
        ("A map of values that shall be sent in the request body. If this is present,"
         "the request has to be sent with a content-type of 'application/json'."
         ),
        required=False,
    )
Beispiel #5
0
class ActionResultObject(ActionResultBase):
    resultType = fields.Constant('object')
    result = fields.Nested(
        Schema.from_dict(
            {
                'links':
                fields.List(
                    fields.Nested(LinkSchema),
                    required=True,
                ),
                'value':
                fields.Dict(
                    required=True,
                    example={'duration': '5 seconds.'},
                )
            },
            name='ActionResultObjectValue',
        ))
Beispiel #6
0
class LinkSchema(BaseSchema):
    """A Link representation according to A-24 (2.7)

    """
    domainType = fields.Constant("link", required=True)
    rel = fields.String(
        description=
        ("Indicates the nature of the relationship of the related resource to the "
         "resource that generated this representation"),
        required=True,
        example="self",
    )
    href = fields.Str(
        description=
        ("The (absolute) address of the related resource. Any characters that are "
         "invalid in URLs must be URL encoded."),
        required=True,
        example="https://.../api_resource",
    )
    method = fields.String(
        description=
        "The HTTP method to use to traverse the link (get, post, put or delete)",
        required=True,
        pattern="GET|PUT|POST|DELETE",
        example="GET",
    )
    type = fields.String(
        description="The media type that the linked resource will return",
        required=True,
        example="application/json",
    )
    title = fields.String(
        description=
        ("string that the consuming application may use to render the link without "
         "having to traverse the link in advance"),
        allow_none=True,
        example="The object itself",
    )
    arguments = fields.Dict(
        description=
        ("map that may be used as the basis for any data (arguments or properties) "
         "required to follow the link."),
        allow_none=True,
    )
Beispiel #7
0
class ServiceGroup(DomainObject):
    domainType = fields.Constant(
        "service_group",
        required=True,
    )
Beispiel #8
0
class ContactGroup(DomainObject):
    domainType = fields.Constant(
        "contact_group",
        required=True,
    )
Beispiel #9
0
class FolderSchema(Linkable):
    domainType = fields.Constant("folder_config")
    id = fields.String()
    title = fields.String()
    members = fields.Nested(FolderMembers())
    extensions = fields.Dict()
Beispiel #10
0
class HostGroup(DomainObject):
    domainType = fields.Constant(
        "host_group",
        required=True,
    )
Beispiel #11
0
class ObjectCollectionMember(ObjectMemberBase):
    memberType = fields.Constant('collection')
    value = fields.List(fields.Nested(LinkSchema()))
Beispiel #12
0
class ConcreteHostTagGroup(DomainObject):
    domainType = fields.Constant(
        "host_tag_group",
        required=True,
        description="The domain type of the object.",
    )
Beispiel #13
0
class ContactGroup(DomainObject):
    domainType = fields.Constant("contact_group",
                                 required=True,
                                 description="The domain type of the object.")
Beispiel #14
0
class ObjectActionMember(ObjectMemberBase):
    memberType = fields.Constant('action')
    parameters = fields.Dict()
    name = fields.String(example="frobnicate_foo")
Beispiel #15
0
class HostConfigSchema(Linkable):
    domainType = fields.Constant("host_config", required=True)
    id = fields.String()
    title = fields.String()
    members = fields.Nested(HostMembers,
                            description="All the members of the host object.")
Beispiel #16
0
class FolderCollection(DomainObjectCollection):
    domainType = fields.Constant("folder_config")
    value = fields.List(fields.Nested(ConcreteFolder))
Beispiel #17
0
class Configuration(DomainObject):
    domainType = fields.Constant("config", required=True)
Beispiel #18
0
class ActionResultScalar(ActionResultBase):
    resultType = fields.Constant('scalar')
    value = fields.String(required=True,
                          allow_none=True,
                          example="Done.",
                          description="The return value of this action.")
Beispiel #19
0
class ActionResultObject(ActionResultBase):
    resultType = fields.Constant('object')
    value = fields.Dict(required=True,
                        allow_none=True,
                        example={'foo': 'bar'},
                        description="The return value of this action.")
Beispiel #20
0
class ObjectActionMember(ObjectMemberBase):
    memberType = fields.Constant('action')
Beispiel #21
0
class ObjectPropertyMember(ObjectMemberBase):
    memberType = fields.Constant('property')
Beispiel #22
0
class SiteState(Linkable):
    domainType = fields.Constant("site-state", required=True)
    members = fields.Nested(SiteStateMembers,
                            description="All the members of the host object.")
Beispiel #23
0
class HostCollection(Linkable):
    domainType = fields.Constant("host_config", required=True)
    id = fields.String()
    title = fields.String()
    value = fields.List(fields.Nested(ConcreteHost))
Beispiel #24
0
class ConcreteHostTagGroup(DomainObject):
    domainType = fields.Constant(
        "host_tag_group",
        required=True,
    )
Beispiel #25
0
class ObjectCollectionMember(ObjectMemberBase):
    memberType = fields.Constant('collection')
    value = fields.List(fields.Nested(LinkSchema()))
    name = fields.String(example="important_values")
Beispiel #26
0
class ObjectPropertyMember(ObjectMemberBase):
    memberType = fields.Constant('property')
    name = fields.String(example="important_value")
Beispiel #27
0
class ServiceGroup(DomainObject):
    domainType = fields.Constant("service_group",
                                 required=True,
                                 description="The domain type of the object.")