Images API¶
The Image API allows you to get information about the publicly available images on the CANFAR Science Platform through the CANFAR Harbor Registry. It can be used to get information about all images, or filter by a specific image kind.
Getting Image Information¶
Get image information
from skaha.images import Images
images = Images()
images.fetch()
[
"images.canfar.net/canfar/base-3.12:v0.4.1",
"images.canfar.net/canucs/test:1.2.5",
"images.canfar.net/canucs/canucs:1.2.9",
...,
]
But most of the time, you are only interested in images of a particular type. For example, if you want to get all the images that are available for headless
sessions, you can do the following:
Get headless image information
images.fetch(kind="headless")
[
"images.canfar.net/chimefrb/testing:keep",
"images.canfar.net/lsst/lsst_v19_0_0:0.1",
"images.canfar.net/skaha/lensfit:22.11",
"images.canfar.net/skaha/lensfit:22.10",
"images.canfar.net/skaha/lensingsim:22.07",
"images.canfar.net/skaha/phosim:5.6.11",
"images.canfar.net/skaha/terminal:1.1.2",
"images.canfar.net/skaha/terminal:1.1.1",
"images.canfar.net/uvickbos/pycharm:0.1",
"images.canfar.net/uvickbos/swarp:0.1",
"images.canfar.net/uvickbos/isis:2.2",
"images.canfar.net/uvickbos/find_moving:0.1",
]
API Reference¶
Bases: SkahaClient
Skaha Image Management.
Source code in skaha/images.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
fetch(kind=None)
¶
Get images from Skaha Server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind
|
Optional[str]
|
Type of image. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: A list of images on the skaha server. |
Examples:
>>> from skaha.images import Images
>>> images = Images()
>>> images.fetch(kind="headless")
['images.canfar.net/chimefrb/sample:latest',
...
'images.canfar.net/skaha/terminal:1.1.1']
Source code in skaha/images.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|