CREATE COLUMN TABLE "CAMERA_FEED_DB"."CameraFeed.data::feed.Image"(
"id" NVARCHAR(20) NOT NULL,
"camera_id" NVARCHAR(20),
"payload" NCLOB MEMORY THRESHOLD 1000,
"createdat" LONGDATE CS_LONGDATE,
PRIMARY KEY (
"id"
)
)
CameraFeed/service/dataservice.xsodata
service {
"CameraFeed.data::feed.Image" as "Image";
}
https://sampleusecaseserver.jp1.hana.ondemand.com/CameraFeed/service/dataservice.xsodata/Image
. In addition to that, we can also use a user, with my_project_user and ABcD1234, to perform CRUD on the table./captured-image/001.jpg
to our OData endpoint:
USERNAME='my_project_user'
PASSWORD='ABcD1234'
CAMERA_FEED_URL='https://sampleusecaseserver.jp1.hana.ondemand.com/CameraFeed/service/dataservice.xsodata/Image'
CAMERA_ID = 'cam1'
image_path = '/captured-image/001.jpg'
request_headers = {
'Content-Type': 'application/json'
}
current_time_millis = lambda: int(round(time.time() * 1000))
def get_base64_encoded_image(image_path):
with open(image_path, "rb") as img_file:
return base64.b64encode(img_file.read()).decode('utf-8')
image_base64 = get_base64_encoded_image(image_path)
now = current_time_millis()
image_payload_body={"id": "%s" % now,
"camera_id":CAMERA_ID,
"payload":image_base64,
"createdat":"/Date(%s)/" % now}
response = requests.post(url=CAMERA_FEED_URL, json=image_payload_body, headers=request_headers, auth=(USERNAME, PASSWORD))
/captured-image/001.jpg
as a Base64 encoded image into the CameraFeed.data::feed.Image table. You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
6 | |
6 | |
6 |