示例#1
0
        },
        {
            "name": "postWeatherData",
            "access":
            ["Aggregator", "Supplier", "MDC", "DSO", "Prosumer", "ESCo"],
            "description":
            "Send weather forecasts or weather sensor observations",
        },
    ],
}


@flexmeasures_api_v1_1.route("/getConnection", methods=["GET"])
@as_response_type("GetConnectionResponse")
@auth_token_required
@usef_roles_accepted(*list_access(v1_1_service_listing, "getConnection"))
def get_connection():
    """API endpoint to get the user's connections as entity addresses ordered from newest to oldest.

    .. :quickref: User; Retrieve entity addresses of connections


    **Example request**

    .. code-block:: json

        {
            "type": "GetConnectionRequest",
        }

    **Example response**
示例#2
0
    "including control set points",
})
v1_2_service_listing["services"].append({
    "name":
    "postUdiEvent",
    "access": ["Prosumer", "ESCo"],
    "description":
    "Send a description of some flexible consumption or production process as a USEF Device "
    "Interface (UDI) event, including device capabilities (control constraints)",
})


@flexmeasures_api_v1_2.route("/getDeviceMessage", methods=["GET"])
@as_response_type("GetDeviceMessageResponse")
@auth_token_required
@account_roles_accepted(*list_access(v1_2_service_listing, "getDeviceMessage"))
def get_device_message():
    """API endpoint to get device message.

    .. :quickref: Control; Download control signal from the platform

    **Optional fields**

    - "duration" (6 hours by default; can be increased to plan further into the future)

    **Example request**

    This "GetDeviceMessageRequest" message requests targeted consumption for UDI event 203 of device 10 of owner 7.

    .. code-block:: json