api_endpoints
API Endpoints for PlantDB client.Link
This module provides helper functions to construct URL paths for the PlantDB REST API. Each function returns the endpoint string with an optional prefix and performs basic sanitization of identifiers.
Key FeaturesLink
- Sanitizes and validates scan, fileset, and file names.
- Supports optional URL prefixes for API versioning.
- Generates paths for authentication, health checks, scans, images, and archives.
Usage ExamplesLink
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.login()
'/api/v1/auth/login'
>>> api_endpoints.scan('plant1')
'/api/v1/scans/plant1'
Resource mappingLink
Hereafter we detail the hierarchy of the resources defined in plantdb.server.api.* submodules and the
Flask REST API in the plantdb.server.cli.fsdb_rest_api submodule.
/api/v1/
├─ health (GET) → REST API status
├─ refresh/ (GET) → Reload the whole database
│ └─ {scan_id} (GET) → Reload the scan
├─ auth/
│ ├─ login (POST) → user login
│ ├─ logout (POST) → user logout
│ ├─ register (POST) → new user registration
│ └─ tokens/
│ ├─ refresh (GET) → retrieve a specific scan
│ ├─ validation (GET) → retrieve a specific scan
│ └─ create-api-token (POST) → create-api-token
├─ scans/
│ ├─ (GET) → list scans
│ ├─ info (GET) → list scans
│ └─ {scan_id}/
│ ├─ (GET) → retrieve a specific scan
│ ├─ (POST) → create a new scan
│ ├─ metadata/
│ │ ├─ (GET) → get `scan_id` metadata
│ │ └─ (POST) → update `scan_id` metadata
│ └─ filesets (GET) → list filesets for scan
├─ filesets/
│ └─ {scan_id}/
│ └─ {fileset_id}/
│ ├─ (POST) → create new fileset
│ ├─ metadata/
│ │ ├─ (GET) → get `scan_id/fileset_id` metadata
│ │ └─ (POST) → update `scan_id/fileset_id` metadata
│ └─ files (GET) → list files
├─ files/
│ └─ {scan_id}/
│ └─ {fileset_id}/
│ └─ {file_id}/
│ ├─ (GET) → retrieve file
│ ├─ (POST) → create new file
│ └─ metadata/ → (GET, POST)
│ ├─ (GET) → get `scan_id/fileset_id/file_id` metadata
│ └─ (POST) → update `scan_id/fileset_id/file_id` metadata
└─ assets/
├─ files/{file_path} (GET) → retrieve a specific scan
├─ archive/{scan_id}
│ ├─ (GET) → retrieve scan archive
│ └─ (POST) → create a new scan by uploading a scan archive
├─ image/{scan_id}/{fileset_id}/{file_id}
│ ├─ (GET) → get `scan_id/fileset_id/file_id` image
│ └─ (POST) → create a new `scan_id/fileset_id/file_id` image
├─ pointcloud/{scan_id} (GET) → retrieve scan pointcloud
├─ mesh/{scan_id} (GET) → retrieve scan triangular mesh
├─ sequence/{scan_id} (GET) → retrieve scan sequence
└─ skeleton/{scan_id} (GET) → retrieve scan skeleton
api_prefix
Link
api_prefix(endpoint_path)
Wrap an endpoint path generator with an optional URL prefix.
The prefix keyword argument, when given, represents a deployment prefix
(e.g. /plantdb for a reverse-proxy at that path). It is composed
in front of the API version prefix (API_PREFIX = "/api/v1").
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.login()
'/api/v1/auth/login'
>>> api_endpoints.login(prefix='/plantdb')
'/plantdb/api/v1/auth/login'
>>> api_endpoints.login(prefix=None)
'/api/v1/auth/login'
Source code in plantdb/commons/api_endpoints.py
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 | |
archive
Link
archive(scan_id, **kwargs)
Return the URL path to the dataset archive endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset to archive. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the dataset archive endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.archive('scan1')
'/api/v1/assets/archive/scan1'
Source code in plantdb/commons/api_endpoints.py
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | |
create_api_token
Link
create_api_token(**kwargs)
Return the URL path to the API token creation endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the API token creation endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.create_api_token()
'/api/v1/auth/token/create-api-token'
Source code in plantdb/commons/api_endpoints.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
file
Link
file(scan_id, fileset_id, file_id, **kwargs)
Return the URL path to the scan/fileset/file endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the file. |
required |
|
str
|
The name of the fileset containing the file. |
required |
|
str
|
The name of the file. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the file endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.file('real_plant', 'images', '00000_rgb')
'/api/v1/files/real_plant/images/00000_rgb'
Source code in plantdb/commons/api_endpoints.py
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | |
file_metadata
Link
file_metadata(scan_id, fileset_id, file_id, key=None, **kwargs)
URL to access the file metadata associated with the given scan and fileset name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
|
str
|
The name of the fileset to access. |
required |
|
str
|
The name of the file to access. |
required |
|
str
|
A specific metadata key to fetch. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to file metadata. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.file_metadata('real_plant', 'images', '00000_rgb')
'/api/v1/files/real_plant/images/00000_rgb/metadata'
Source code in plantdb/commons/api_endpoints.py
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 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 | |
file_path
Link
file_path(file_path, **kwargs)
Return the URL path to the scan/file_path endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The path to the file in the database. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the file path endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.file_path('real_plant/images/00000_rgb.jpg')
'/api/v1/assets/files/real_plant/images/00000_rgb.jpg'
Source code in plantdb/commons/api_endpoints.py
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 | |
fileset
Link
fileset(scan_id, fileset_id, **kwargs)
URL path for a fileset belonging to a scan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
|
str
|
The name of the fileset to access. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to file metadata. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.fileset('real_plant', 'images')
'/api/v1/filesets/real_plant/images'
Source code in plantdb/commons/api_endpoints.py
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 | |
fileset_files_list
Link
fileset_files_list(scan_id, fileset_id, **kwargs)
URL to list the file associated with the given scan and filesets names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
|
str
|
The name of the fileset to access. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the filesets list of files. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.fileset_files_list('real_plant', 'images')
'/api/v1/filesets/real_plant/images/files'
Source code in plantdb/commons/api_endpoints.py
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
fileset_metadata
Link
fileset_metadata(scan_id, fileset_id, key=None, **kwargs)
URL to access the fileset metadata associated with the given scan and fileset name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
|
str
|
The name of the fileset to access. |
required |
|
str or Noe
|
A specific metadata key to fetch. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to fileset metadata. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.fileset_metadata('real_plant', 'images')
'/api/v1/filesets/real_plant/images/metadata'
Source code in plantdb/commons/api_endpoints.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 | |
health
Link
health(**kwargs)
Return the URL path to the health endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the health endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.health()
'/api/v1/health'
Source code in plantdb/commons/api_endpoints.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
home
Link
home(**kwargs)
Return the URL path to the home endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the home endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.home()
'/api/v1/'
>>> api_endpoints.home(prefix='/plantdb')
'/plantdb/api/v1/'
Source code in plantdb/commons/api_endpoints.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
image
Link
image(scan_id, fileset_id, file_id, size=None, as_base64=None, **kwargs)
Return the URL path to the image endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the image. |
required |
|
str
|
The name of the fileset containing the image. |
required |
|
str
|
The name of the image. |
required |
|
str or int
|
The size parameter of the image request. |
None
|
|
bool
|
A boolean flag indicating whether to return an image as a base64 string. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the image endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.image('real_plant', 'images', '00000_rgb', 'orig', False)
'/api/v1/assets/image/real_plant/images/00000_rgb?size=orig&as_base64=false'
>>> api_endpoints.image('real_plant', 'images', '00000_rgb', 'thumb', True)
'/api/v1/assets/image/real_plant/images/00000_rgb?size=thumb&as_base64=true'
Source code in plantdb/commons/api_endpoints.py
815 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 868 869 870 871 872 873 | |
login
Link
login(**kwargs)
Return the URL path to the login endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the login endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.login()
'/api/v1/auth/login'
Source code in plantdb/commons/api_endpoints.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
logout
Link
logout(**kwargs)
Return the URL path to the logout endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the logout endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.logout()
'/api/v1/auth/logout'
Source code in plantdb/commons/api_endpoints.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
mesh
Link
Return the URL path to the mesh endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the mesh. |
required |
|
str or int
|
Query parameter controlling downsampling. Accepted values: * 'orig' - serve the original point cloud. |
None
|
|
bool
|
Query parameter indicating whether to return the vertices coordinates and triangle IDs as JSON. Defaults to 'false', which streams the PLY file. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the mesh endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.mesh('real_plant')
'/api/v1/assets/mesh/real_plant'
>>> api_endpoints.mesh('real_plant', coords=True)
Source code in plantdb/commons/api_endpoints.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 | |
pointcloud
Link
Return the URL path to the point-cloud endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the point-cloud. |
required |
|
str or int or float
|
Query parameter controlling downsampling. Accepted values: * 'orig' - serve the original point cloud. * 'preview' - serve a precomputed preview (default). * A float value - perform on-the-fly voxel downsampling using the specified voxel size. If an invalid string is supplied, the default 'preview' is used. |
None
|
|
bool
|
Query parameter indicating whether to return the point coordinates as JSON. Defaults to 'false', which streams the PLY file. If set, returns the data as a list under the 'coordinates' JSON dictionary entry. |
None
|
|
str or int
|
Query parameter indicating whether to return the reconstructed point cloud (default) or the ground truth ('type=gt'). |
'default'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the point-cloud endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.pointcloud('real_plant')
'/api/v1/assets/pointcloud/real_plant?type=default'
>>> api_endpoints.pointcloud('real_plant', pcd_type='gt')
'/api/v1/assets/pointcloud/real_plant?type=gt'
>>> api_endpoints.pointcloud('real_plant', coords=True)
'/api/v1/assets/pointcloud/real_plant?type=default&coords=True'
Source code in plantdb/commons/api_endpoints.py
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 | |
refresh
Link
refresh(scan_id=None, **kwargs)
Return the URL path to the dataset archive endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str or None
|
The name of the scan dataset to archive. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the refresh endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.refresh()
'/api/v1/refresh'
>>> api_endpoints.refresh('scan1')
'/refresh?scan_id=scan1'
Source code in plantdb/commons/api_endpoints.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
register
Link
register(**kwargs)
Return the URL path to the register endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the register endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.register()
'/api/v1/auth/register'
Source code in plantdb/commons/api_endpoints.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
scan
Link
scan(scan_id, **kwargs)
Return the URL path to the scan endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the scan endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.scan('scan1')
'/api/v1/scans/scan1'
Source code in plantdb/commons/api_endpoints.py
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 | |
scan_filesets_list
Link
scan_filesets_list(scan_id, **kwargs)
URL to list the filesets associated with the given scan name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to filesets. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.scan_filesets_list('real_plant')
'/api/v1/scans/real_plant/filesets'
Source code in plantdb/commons/api_endpoints.py
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 | |
scan_metadata
Link
URL to access the metadata associated with the given scan name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan to access. |
required |
|
str or None
|
A specific metadata key to fetch. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to scan metadata. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.scan_metadata('real_plant')
'/api/v1/scans/real_plant/metadata'
Source code in plantdb/commons/api_endpoints.py
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 582 583 584 585 586 587 588 589 | |
scans
Link
scans(**kwargs)
Return the URL path to the scans' endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the scans' endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.scans()
'/api/v1/scans'
Source code in plantdb/commons/api_endpoints.py
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
scans_info
Link
scans_info(**kwargs)
Return the URL path to the list of scan dataset information endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the list of scan dataset information endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.scans_info()
'/api/v1/scans/info'
Source code in plantdb/commons/api_endpoints.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
sequence
Link
Return the URL path to the sequence endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the angles and internodes sequence. |
required |
|
str
|
The type of measure to request, in |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the angles and internodes sequences endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.sequence('real_plant','all')
'/api/v1/assets/sequence/real_plant?type=all'
Source code in plantdb/commons/api_endpoints.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | |
skeleton
Link
skeleton(scan_id, **kwargs)
Return the URL path to the skeleton endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the scan dataset containing the skeleton. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the skeleton endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.skeleton('real_plant')
'/api/v1/assets/skeleton/real_plant'
Source code in plantdb/commons/api_endpoints.py
1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 | |
timelapse
Link
timelapse(timelapse_id, **kwargs)
Return the URL path to the timelapse endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The identifier of the timelapse to access. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the timelapse endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.timelapse('tl1')
'/api/v1/timelapses/tl1'
Source code in plantdb/commons/api_endpoints.py
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 | |
timelapse_scans
Link
timelapse_scans(timelapse_id, sort=None, **kwargs)
Return the URL path to the timelapse member scans endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The identifier of the timelapse to access. |
required |
|
str
|
Sort parameter, e.g. 'timelapse.scheduled'. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the timelapse member scans endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.timelapse_scans('tl1')
'/api/v1/timelapses/tl1/scans'
Source code in plantdb/commons/api_endpoints.py
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 | |
timelapses
Link
timelapses(**kwargs)
Return the URL path to the timelapses' endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the timelapses' endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.timelapses()
'/api/v1/timelapses'
Source code in plantdb/commons/api_endpoints.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
token_refresh
Link
token_refresh(**kwargs)
Return the URL path to the token refresh endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the token refresh endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.token_refresh()
'/api/v1/auth/token/refresh'
Source code in plantdb/commons/api_endpoints.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
token_validation
Link
token_validation(**kwargs)
Return the URL path to the token validation endpoint.
Other Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
str
|
An optional prefix to prepend to the URL path. |
Returns:
| Type | Description |
|---|---|
str
|
The URL path to the token validation endpoint. |
Examples:
>>> from plantdb.commons import api_endpoints
>>> api_endpoints.token_validation()
'/api/v1/auth/token/validation'
Source code in plantdb/commons/api_endpoints.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |