RPCHandler
hololinked.server.http.handlers.RPCHandler
Bases: BaseHandler
Handler for property read-write and method calls.
Source code in repo/hololinked/hololinked/server/http/handlers.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
Functions
is_method_allowed
async
Checks if the method is allowed for the property:
- Access control (authentication & authorization)
- if the HTTP method is allowed for the resource.
- if its GET method with message id for no-block response.
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in repo/hololinked/hololinked/server/http/handlers.py
options
async
Options for the resource.
Main functionality is to inform the client is a specific HTTP method is supported by the property or the action (Access-Control-Allow-Methods).
Source code in repo/hololinked/hololinked/server/http/handlers.py
handle_through_thing
async
Handles the Thing operations and writes the reply to the HTTP client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
operation to be performed on the Thing, like |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the |
Source code in repo/hololinked/hololinked/server/http/handlers.py
write_reply
async
Write the event loop's reply onto the wire.
Source code in repo/hololinked/hololinked/server/http/handlers.py
handle_no_block_response
async
Handles the no-block response for the noblock calls.
Source code in repo/hololinked/hololinked/server/http/handlers.py
PropertyHandler
Bases: RPCHandler
handles property requests.
Source code in repo/hololinked/hololinked/server/http/handlers.py
Functions
get
async
Read the property, or fetch the reply of an earlier no-block read.
Source code in repo/hololinked/hololinked/server/http/handlers.py
post
async
Write the property.
put
async
Write the property.
delete
async
Delete the property.
ActionHandler
Bases: RPCHandler
handles action requests.
Source code in repo/hololinked/hololinked/server/http/handlers.py
Functions
get
async
Invoke the action, or fetch the reply of an earlier no-block invocation.
Source code in repo/hololinked/hololinked/server/http/handlers.py
post
async
Invoke the action.
put
async
Invoke the action.
delete
async
Invoke the action.
RWMultiplePropertiesHandler
Bases: ActionHandler
handles read-write of multiple properties via an action.
Source code in repo/hololinked/hololinked/server/http/handlers.py
Functions
initialize
initialize(resource: ActionAffordance, config: RuntimeConfig, logger: BoundLogger, thing: Thing, metadata: HandlerMetadata | None = None, **kwargs) -> None
Set up the handler with the affordances that read and write multiple properties.
Source code in repo/hololinked/hololinked/server/http/handlers.py
get
async
Read multiple properties, or fetch the reply of an earlier no-block read.
Source code in repo/hololinked/hololinked/server/http/handlers.py
post
async
Reject the request with 405, multiple properties are written with PUT or PATCH.
Source code in repo/hololinked/hololinked/server/http/handlers.py
put
async
Write multiple properties.
Source code in repo/hololinked/hololinked/server/http/handlers.py
patch
async
Write multiple properties.