urls
REST API URL Construction ModuleLink
Provides utilities for building URLs for the PlantDB REST API without performing network calls. These helpers make it easy to generate consistent endpoint URLs based on host, port, optional prefixes, and SSL settings, which is essential for client applications that need to interact with PlantDB services.
Key FeaturesLink
- Construct base origin URLs with optional scheme, port, and SSL flag.
- Generate full endpoint URLs for authentication (login, logout, register, token handling).
- Build URLs for scans, individual scan data, preview images, and task‑specific images.
- Create URLs for archive access, configuration files, and reconstruction pipelines.
- Support custom host, port, URL prefix, and SSL toggles via environment variables or function arguments.
- Validate and sanitize dataset names before forming URLs.
- Provide helper to list image URIs with size and base64 options.
Environment variablesLink
PLANTDB_HOST: default hostname to PlantDB REST APIPLANTDB_PORT: default port to PlantDB REST APIPLANTDB_PREFIX: default URL prefix for the plantdb REST API
Usage ExamplesLink
>>> from plantdb.client.rest_api.urls import plantdb_url, scan_url, scan_image_url
>>> # Base PlantDB API URL with custom port, prefix and HTTPS
>>> base = plantdb_url('localhost', port=5000, prefix='plantdb', ssl=True)
>>> base
'https://localhost:5000/plantdb'
>>> # URL for a specific scan
>>> scan = scan_url('localhost', 'real_plant')
>>> scan
'http://localhost/api/v1/scans/real_plant'
>>> # URL for a thumbnail image of a scan
>>> img = scan_image_url('localhost', 'real_plant', 'images', '00000_rgb', size='thumb')
>>> img
'http://localhost/api/v1/assets/image/real_plant/images/00000_rgb?size=thumb'
api_token_url
Link
api_token_url(host, **kwargs)
Generate the full URL for the PlantDB API token endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import api_token_url
>>> # Basic usage with default configuration
>>> url = api_token_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/token/create-api-token
Source code in plantdb/client/rest_api/urls.py
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 | |
archive_url
Link
Generates a formatted URL for accessing the archive of a specific dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
Name of the dataset to access in the archive. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
Fully constructed URL for accessing the specified dataset archive. |
Examples:
>>> from plantdb.client.rest_api.urls import archive_url
>>> archive_url('localhost', 'arabidopsis000')
'http://localhost/api/v1/assets/archive/arabidopsis000'
>>> archive_url('localhost', '../arabidopsis000')
'http://localhost/api/v1/assets/archive/arabidopsis000'
>>> archive_url('localhost', 'arabidopsis+000')
ValueError: Invalid dataset name: 'arabidopsis+000'. Dataset names must be alphanumeric and can include underscores or dashes.
>>> archive_url('localhost', 'arabidopsis000', prefix='/plantdb')
'http://localhost/plantdb/api/v1/assets/archive/arabidopsis000'
Source code in plantdb/client/rest_api/urls.py
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
list_task_images_uri
Link
Get the list of images URI for a given dataset and task name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The name of the dataset to retrieve the images for. |
required |
|
str
|
The name of the task to retrieve the images from. Defaults to 'images'. |
'images'
|
|
(orig, large, thumb)
|
If an integer, use it as the size of the cached image to create and return.
Else, should be a string, defaulting to |
'orig'
|
|
bool
|
A boolean flag indicating whether to return an image as a base64 string. |
True
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
list of str
|
The list of image URI strings for the PlantDB REST API. |
Examples:
>>> # Start a test PlantDB REST API server first, in a terminal:
>>> # $ fsdb_rest_api --test
>>> from plantdb.client.rest_api.urls import list_task_images_uri
>>> print(list_task_images_uri('localhost', 'real_plant')[2])
http://localhost/api/v1/assets/image/real_plant/images/00002_rgb?size=orig
>>> print(list_task_images_uri('localhost', 'real_plant', size=100)[2])
http://localhost/api/v1/assets/image/real_plant/images/00002_rgb?size=100
Source code in plantdb/client/rest_api/urls.py
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 | |
login_url
Link
login_url(host, **kwargs)
Generate the full URL for the PlantDB API login endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified login URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import login_url
>>> # Default URL using module level constants
>>> url = login_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/login
>>> # Override host, add a prefix and enable SSL
>>> url = login_url('dev.romi.local', prefix="/plantdb", ssl=True)
>>> print(url)
https://dev.romi.local/plantdb/api/v1/auth/login
Source code in plantdb/client/rest_api/urls.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
logout_url
Link
logout_url(host, **kwargs)
Generate the full URL for the PlantDB API logoutn endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified logoutn URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import logout_url
>>> # Basic usage with default configuration
>>> url = logout_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/logout
>>> # Specify a custom prefix and enable SSL
>>> url = logout_url('dev.romi.local', prefix="/plantdb", ssl=True)
>>> print(url)
https://dev.romi.local/plantdb/api/v1/auth/logout
Source code in plantdb/client/rest_api/urls.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
origin_url
Link
Construct a URL string from host, optional port, and SSL flag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Hostname or URL. May optionally include a scheme (e.g., |
required |
|
int or str
|
Port number to append to the host. If an |
None
|
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
url
|
The fully‑qualified URL string constructed from the supplied parts. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
Notes
The function does not validate that the resulting URL points to a
reachable endpoint; it only assembles the string. Supplying both a scheme
in host and ssl=True will result in the scheme dictated by the
original host (HTTPS if the original scheme contains s).
Examples:
>>> from plantdb.client.rest_api.urls import origin_url
>>> origin_url('example.com')
'http://example.com'
>>> origin_url('example.com', 8080)
'http://example.com:8080'
>>> origin_url('https://example.com')
'https://example.com'
>>> origin_url('https://example.com/api/v1')
'https://example.com'
>>> origin_url('http://example.com', ssl=True)
'https://example.com'
>>> origin_url('example.com', port='443', ssl=True)
'https://example.com:443'
Source code in plantdb/client/rest_api/urls.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
plantdb_url
Link
Generates the root URL for the PlantDB REST API using the specified host and port.
This function returns the server root (scheme + host [+ port] + optional
deployment prefix). The API version prefix '/api/v1' is not included:
it is only added by the api_endpoints.* builders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
int or str
|
The port number of the PlantDB REST API server. Defaults to |
PLANTDB_PORT
|
|
str
|
Deployment (reverse-proxy) prefix under which the server is reachable,
e.g. |
PLANTDB_PREFIX
|
|
bool
|
Flag indicating whether to use HTTPS ( |
False
|
Returns:
| Type | Description |
|---|---|
str
|
A properly formatted server-root URL for the PlantDB REST API
(e.g. |
Examples:
>>> from plantdb.client.rest_api.urls import plantdb_url
>>> plantdb_url('localhost')
'http://localhost'
>>> plantdb_url('api.example.com', port=8443, ssl=True)
'https://api.example.com:8443'
>>> plantdb_url('localhost', port=5000, prefix='/plantdb')
'http://localhost:5000/plantdb'
Source code in plantdb/client/rest_api/urls.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
refresh_url
Link
Generates a formatted URL for refreshing a specific dataset or the entire database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str or None
|
The name of the dataset for which the refresh URL needs to be generated.
If not provided, the refresh URL for the entire server is returned instead.
Defaults to |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
A correctly formatted URL for refreshing the specified dataset or the entire PlantDB REST API server. |
Examples:
>>> from plantdb.client.rest_api.urls import refresh_url
>>> refresh_url('localhost', "real_plant")
'http://localhost/api/v1/refresh?scan_id=real_plant'
>>> refresh_url('localhost', "real_plant", prefix='/plantdb')
'http://localhost/plantdb/api/v1/refresh?scan_id=real_plant'
Source code in plantdb/client/rest_api/urls.py
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | |
register_url
Link
register_url(host, **kwargs)
Generate the full URL for the PlantDB API register endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified register URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import register_url
>>> # Basic usage with default configuration
>>> url = register_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/register
>>> # Specify a custom prefix and enable SSL
>>> url = register_url('dev.romi.local', prefix="/plantdb", ssl=True)
>>> print(url)
https://dev.romi.local/plantdb/api/v1/auth/register
Source code in plantdb/client/rest_api/urls.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
scan_config_url
Link
Return the scan URL to access the scanning configuration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The name of the dataset. |
required |
|
str
|
The name of the TOML scan file, defaults to |
'scan.toml'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The URL to the scanning configuration file. |
Examples:
>>> from plantdb.client.rest_api.urls import scan_config_url
>>> scan_config_url('localhost', 'real_plant')
'http://localhost/api/v1/assets/files/real_plant/scan.toml'
>>> scan_config_url('localhost', 'real_plant', prefix='/plantdb')
'http://localhost/plantdb/api/v1/assets/files/real_plant/scan.toml'
Source code in plantdb/client/rest_api/urls.py
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | |
scan_file_url
Link
Build the URL for accessing a dataset file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The path to the file in the databse. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The complete URL for the dataset file. |
Source code in plantdb/client/rest_api/urls.py
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | |
scan_image_url
Link
Get the URL to the image for a scan dataset and task fileset served by the PlantDB REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The name of the scan dataset to be retrieved. |
required |
|
str
|
The name of the fileset containing the image to be retrieved. |
required |
|
str
|
The name of the image file to be retrieved. |
required |
|
(orig, large, thumb)
|
If an integer, use it as the size of the cached image to create and return.
Else, should be a string, defaulting to |
'orig'
|
|
bool
|
A boolean flag indicating whether to return an image as a base64 string. |
False
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The URL to an image of a scan dataset and task fileset. |
Examples:
>>> from plantdb.client.rest_api.urls import scan_image_url
>>> scan_image_url('localhost', "real_plant", "images", "00000_rgb")
'http://localhost/api/v1/assets/image/real_plant/images/00000_rgb?size=orig'
>>> scan_image_url('localhost', "real_plant", "images", "00000_rgb", as_base64=True)
'http://localhost/api/v1/assets/image/real_plant/images/00000_rgb?size=orig&as_base64=true'
>>> scan_image_url('localhost', "real_plant", "images", "00000_rgb", prefix='/plantdb')
'http://localhost/plantdb/api/v1/assets/image/real_plant/images/00000_rgb?size=orig'
Source code in plantdb/client/rest_api/urls.py
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | |
scan_preview_image_url
Link
Get the URL to the preview image for a scan dataset served by the PlantDB REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The name of the scan dataset to be retrieved. |
required |
|
(orig, large, thumb)
|
If an integer, use it as the size of the cached image to create and return.
Else, should be a string, defaulting to |
'orig'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The URL to the preview image for a scan dataset. |
Examples:
>>> # Start a test PlantDB REST API server first, in a terminal:
>>> # $ fsdb_rest_api --test
>>> from plantdb.client.rest_api.urls import scan_preview_image_url
>>> img_url = scan_preview_image_url('localhost', 'real_plant')
>>> print(img_url)
http://localhost/api/v1/assets/image/real_plant/images/00000_rgb?size=thumb
>>> img_url = scan_preview_image_url('localhost', 'real_plant', size=100)
>>> print(img_url)
http://localhost/api/v1/assets/image/real_plant/images/00000_rgb?size=100
>>> # Download and display the image
>>> import requests
>>> from PIL import Image
>>> from io import BytesIO
>>> response = requests.get(img_url) # Send a GET request to the URL
>>> image = Image.open(BytesIO(response.content)) # Open the image from the bytes data
>>> image.show() # Display the image
Source code in plantdb/client/rest_api/urls.py
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 577 578 579 580 581 | |
scan_reconstruction_url
Link
Return the scan URL to access the reconstruction configuration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
|
str
|
The name of the dataset. |
required |
|
str
|
The name of the TOML scan file, defaults to |
'pipeline.toml'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The URL to the reconstruction configuration file. |
Examples:
>>> from plantdb.client.rest_api.urls import scan_reconstruction_url
>>> scan_reconstruction_url('localhost', 'real_plant')
'http://localhost/api/v1/assets/files/real_plant/pipeline.toml'
>>> scan_reconstruction_url('localhost', 'real_plant', prefix='/plantdb')
'http://localhost/plantdb/api/v1/assets/files/real_plant/pipeline.toml'
Source code in plantdb/client/rest_api/urls.py
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | |
scan_url
Link
scan_url(host, scan_id, **kwargs)
Generates the URL pointing to the scan JSON from the PlantDB REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset to retrieve the JSON from. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
A properly formatted URL of the PlantDB REST API pointing to the scans list. |
Examples:
>>> from plantdb.client.rest_api.urls import scan_url
>>> scan_url('localhost', "real_plant")
'http://localhost/api/v1/scans/real_plant'
>>> scan_url('localhost', "real_plant", prefix='/plantdb')
'http://localhost/plantdb/api/v1/scans/real_plant'
Source code in plantdb/client/rest_api/urls.py
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 | |
scans_url
Link
scans_url(host, **kwargs)
Generates the URL listing the scans from the PlantDB REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
A properly formatted URL of the PlantDB REST API pointing to the scans list. |
Examples:
>>> from plantdb.client.rest_api.urls import scans_url
>>> scans_url('127.0.0.1')
'http://127.0.0.1/api/v1/scans'
>>> scans_url('localhost', prefix='/plantdb')
'http://localhost/plantdb/api/v1/scans'
>>> scans_url('dev.romi.local', prefix='/plantdb/', ssl=True)
'https://dev.romi.local/plantdb/api/v1/scans'
Source code in plantdb/client/rest_api/urls.py
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 | |
token_refresh_url
Link
token_refresh_url(host, **kwargs)
Generate the full URL for the PlantDB API token refresh endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified register URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import token_refresh_url
>>> # Basic usage with default configuration
>>> url = token_refresh_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/token/refresh
Source code in plantdb/client/rest_api/urls.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
token_validation_url
Link
token_validation_url(host, **kwargs)
Generate the full URL for the PlantDB API token validation endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
port |
int
|
The PlantDB API port number, defaults to |
prefix |
str
|
A path prefix for the PlantDB API, defaults to |
ssl |
bool
|
A boolean flag indicating whether to use HTTPS ( |
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified register URL as a string. |
Examples:
>>> from plantdb.client.rest_api.urls import token_validation_url
>>> # Basic usage with default configuration
>>> url = token_validation_url('localhost')
>>> print(url)
http://localhost/api/v1/auth/token/validation
Source code in plantdb/client/rest_api/urls.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |