Replies: 2 comments 2 replies
-
405 Method not Allowed can also mean your request gets mapped to another (wrong) endpoint, which doesn't accept POST. |
Beta Was this translation helpful? Give feedback.
-
@paullatzelsperger it was not the problem of wrong endpoint, which doesn't accept POST. The issue was, that within the asset definition you can set the field "method" which value gets overritten if you set "proxyMethod". The meaning of the "method" field is quite unclear to me, because you cannot define a body within the asset definition. I solved this issue as follows: Creating an Asset:I create the asset by sending the following json to the provider {
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@id": "post__influxdb_read_query",
"@type": "Asset",
"properties": {
"description": "This asset requires Membership to view and negotiate."
},
"dataAddress": {
"@type": "DataAddress",
"type": "HttpData",
"baseUrl": "http://{{INFLUX_DB}}/api/v2/query?orgID={{ORGID}}",
"header:Authorization": "Token {{TOKEN}}",
"proxyPath": "true",
"proxyMethod": "true",
"proxyBody": "true"
}
} Policy, Contract, NegotiationCreating Policy and Contract as in https://github.com/eclipse-edc/Samples/tree/main/transfer/transfer-01-negotiation TransferI initialized the transfer by sending the json to the consumer after setting the fileds counterPartyAddress and contractId. {
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@type": "TransferRequestDto",
"connectorId": "provider",
"counterPartyAddress": "",
"contractId": "",
"protocol": "dataspace-protocol-http",
"transferType": "HttpData-PULL"
} After requesting the Authorization-Token for the provider, i send the following header and body to the public layer of the provider header = {
"Authorization": authorization_key,
"content-type": "application/vnd.flux"
}
data = "from(bucket: \"OpenHAB\") |> range(start: -60m) |> filter(fn: (r) => r[\"item\"] == \"temp_diningroom\")" As a result i get the last changes within 60 Minutes of the OpenHAB-Item "temp_diningroom"
|
Beta Was this translation helpful? Give feedback.
-
Hi,
i am trying to access a time series of the influxDB platform using assets within a connector. To access this data in general we need to send a POST-Request such as:
Using this request we get the last values of the OpenHAB item "temp_diningroom" within 30 minutes. Our goal is to put this POST-Request within the asset definition so that when accessing the data of the asset using a consumer connector the POST-request is sent automatically and the values of the item is presented.
Is there a documentation anywhere around here that describes all keys within the json for asset-creation? Is it possible to change the Request to POST instead of GET? My first trials did not work so i come to you. Here is the latest json-file for the body of the asset-creation
As a result of accessing the asset-data i get the following message:
This leads to the assumption that the field "method" does not change the request to a POST-Request within the Asset.
Beta Was this translation helpful? Give feedback.
All reactions