You see these terms used somewhat interchangeably on the web, but
there is a distinction. URIs are a superset of URLs and also include URNs
(Uniform Resource Name). URLs must specify the location of a resource and
the manner in which it can be accessed. So,
http://sahba:8000/api/v1/ssp/test/1 is a URL, but a bare path like
/api/v1/ssp/test/1 is not. (Technically, it's not a URI, either, but we
can treat it like a unique name in our local namespace.)
The upshot: if a variable name has 'url', expect that it already has
an http://, if a variable name has 'uri' it may need an http:// and a
server name.
|
|
|
|
|
get_standard_url(uri)
Given a URL or just a path, return a canonical URL that can be used
to grab a resource from the server. |
|
|
|
item_get_or_add(uri,
**kwargs)
Return the single item matching the keyword arguments, or add the
item to the database. |
|
|
|
item_query(uri,
**kwargs)
Get one or more items matching the keyword arguments as a list of
IDs. |
|
|
|
item_add(uri,
**kwargs)
Add an item with properties set from the keyword arguments. |
|
|
|
item_get(uri,
**kwargs)
Return the deserialized item from the provided URL. |
|
|
|
item_delete(uri)
Return the deserialized item from the provided URL. |
|
|
|
save_files(item,
compress=None,
file_dir=' . ' ,
overwrite=True,
create_dir=False)
Iterate over the values in the provided item (which must have a
values method) and write all files to disk. |
|
|
|
format_HTTPError(err)
Print the exception; this should contain information about the HTTP
Error and message. |
|
|
|
run_client(main,
last_stage,
**kwargs)
Run the provided 'main' function, nicely display any errors that
result. |
|
|