Пример #1
0
class FolderSchema(Linkable):
    domainType = fields.Constant(
        "folder_config",
        required=True,
    )
    id = fields.String()
    title = fields.String()
    members = fields.Nested(FolderMembers())
Пример #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.",
    )
Пример #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',
        ))
Пример #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,
    )
Пример #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',
        ))
Пример #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,
    )
Пример #7
0
class ServiceGroup(DomainObject):
    domainType = fields.Constant(
        "service_group",
        required=True,
    )
Пример #8
0
class ContactGroup(DomainObject):
    domainType = fields.Constant(
        "contact_group",
        required=True,
    )
Пример #9
0
class FolderSchema(Linkable):
    domainType = fields.Constant("folder_config")
    id = fields.String()
    title = fields.String()
    members = fields.Nested(FolderMembers())
    extensions = fields.Dict()
Пример #10
0
class HostGroup(DomainObject):
    domainType = fields.Constant(
        "host_group",
        required=True,
    )
Пример #11
0
class ObjectCollectionMember(ObjectMemberBase):
    memberType = fields.Constant('collection')
    value = fields.List(fields.Nested(LinkSchema()))
Пример #12
0
class ConcreteHostTagGroup(DomainObject):
    domainType = fields.Constant(
        "host_tag_group",
        required=True,
        description="The domain type of the object.",
    )
Пример #13
0
class ContactGroup(DomainObject):
    domainType = fields.Constant("contact_group",
                                 required=True,
                                 description="The domain type of the object.")
Пример #14
0
class ObjectActionMember(ObjectMemberBase):
    memberType = fields.Constant('action')
    parameters = fields.Dict()
    name = fields.String(example="frobnicate_foo")
Пример #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.")
Пример #16
0
class FolderCollection(DomainObjectCollection):
    domainType = fields.Constant("folder_config")
    value = fields.List(fields.Nested(ConcreteFolder))
Пример #17
0
class Configuration(DomainObject):
    domainType = fields.Constant("config", required=True)
Пример #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.")
Пример #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.")
Пример #20
0
class ObjectActionMember(ObjectMemberBase):
    memberType = fields.Constant('action')
Пример #21
0
class ObjectPropertyMember(ObjectMemberBase):
    memberType = fields.Constant('property')
Пример #22
0
class SiteState(Linkable):
    domainType = fields.Constant("site-state", required=True)
    members = fields.Nested(SiteStateMembers,
                            description="All the members of the host object.")
Пример #23
0
class HostCollection(Linkable):
    domainType = fields.Constant("host_config", required=True)
    id = fields.String()
    title = fields.String()
    value = fields.List(fields.Nested(ConcreteHost))
Пример #24
0
class ConcreteHostTagGroup(DomainObject):
    domainType = fields.Constant(
        "host_tag_group",
        required=True,
    )
Пример #25
0
class ObjectCollectionMember(ObjectMemberBase):
    memberType = fields.Constant('collection')
    value = fields.List(fields.Nested(LinkSchema()))
    name = fields.String(example="important_values")
Пример #26
0
class ObjectPropertyMember(ObjectMemberBase):
    memberType = fields.Constant('property')
    name = fields.String(example="important_value")
Пример #27
0
class ServiceGroup(DomainObject):
    domainType = fields.Constant("service_group",
                                 required=True,
                                 description="The domain type of the object.")