示例#1
0
class HostParameters(BaseSchema):
    """All the parameters for the hosts list.

    Examples:

        >>> p = HostParameters()
        >>> p.load({})['columns']
        [Column(hosts.name: string)]

        >>> p.load({})['sites']
        []

    """

    sites = fields.List(
        gui_fields.SiteField(),
        description="Restrict the query to this particular site.",
        load_default=[],
    )
    query = gui_fields.query_field(Hosts, required=False)
    columns = gui_fields.column_field(Hosts, mandatory=[Hosts.name], example=["name"])
示例#2
0
    fields.List(
        gui_fields.SiteField(),
        description="Restrict the query to this particular site.",
        load_default=list,
    ),
    "query":
    gui_fields.query_field(
        Services,
        required=False,
        example='{"op": "=", "left": "host_name", "right": "example.com"}',
    ),
    "columns":
    gui_fields.column_field(
        Services,
        mandatory=[
            Services.host_name,
            Services.description,
        ],
        example=["host_name", "description"],
    ),
}]


@Endpoint(
    object_action_href("host", "{host_name}", "show_service"),
    "cmk/show",
    method="get",
    path_params=[HOST_NAME],
    query_params=[{
        "service_description":
        fields.String(
            description="The service description of the selected host",
示例#3
0
    fields.List(
        fields.SiteField(),
        description="Restrict the query to this particular site.",
        missing=list,
    ),
    'query':
    fields.query_field(
        Services,
        required=False,
        example='{"op": "=", "left": "host_name", "right": "example.com"}',
    ),
    'columns':
    fields.column_field(
        Services,
        mandatory=[
            Services.host_name,
            Services.description,
        ],
    )
}]


@Endpoint(object_action_href('host', '{host_name}', 'show_service'),
          'cmk/show',
          method='get',
          path_params=[HOST_NAME],
          query_params=[{
              "service_description":
              fields.String(
                  description="The service description of the selected host",
                  example="Filesystem %boot",