hs_restclient.endpoints package

Submodules

hs_restclient.endpoints.resources module

class hs_restclient.endpoints.resources.BaseEndpoint(hs)[source]

Bases: object

class hs_restclient.endpoints.resources.FilesSubEndpoint(hs, pid)[source]

Bases: object

all()[source]
Returns:array of file objects (200 status code)
metadata(file_path, params=None)[source]
Params:title: string keywords: array extra_metadata: array temporal_coverage: coverage object spatial_coverage: coverage object
Returns:file metadata object (200 status code)
class hs_restclient.endpoints.resources.FunctionsSubEndpoint(hs, pid)[source]

Bases: object

move_or_rename(payload)[source]

Moves or renames a file

Parameters:payload – source_path: string target_path: string
Returns:(object) target_rel_path: tgt_path
rep_res_bag_to_irods_user_zone()[source]

Replicate data bag to iRODS user zone.

param payload:
zip_with_rel_path: string remove_original_zip: boolean
Returns:(object) unzipped_path: string
set_file_type(payload)[source]

Sets a file to a specific HydroShare file type (e.g. NetCDF, GeoRaster, GeoFeature etc)

Parameters:payload – file_path: string (relative path of the file to be set to a specific file type) hs_file_type: string (one of the supported files types: SingleFile, NetCDF, GeoRaster, RefTimeseries, TimeSeries and GeoFeature)
Returns:(object) message: string
unzip(payload)[source]

Unzips a file

Parameters:payload – zip_with_rel_path: string remove_original_zip: boolean
Returns:(object) unzipped_path: string
zip(payload)[source]

Zips a resource file

Parameters:payload – input_coll_path: (string) input collection path output_zip_file_name: (string) remove_original_after_zip: (boolean)
Returns:(object) name: output_zip_fname size: size of the zipped file type: ‘zip’
class hs_restclient.endpoints.resources.ResourceEndpoint(hs, pid)[source]

Bases: hs_restclient.endpoints.resources.BaseEndpoint

copy()[source]

Creates a copy of a resource.

Returns:string resource id
discoverable(boolean)[source]

Pass through helper function for flag function.

files(payload)[source]

Upload a file to a hydroshare resource.

Parameters:payload – file: File object to upload to server folder: folder path to upload the file to
Returns:json object resource_id: string resource id, file_name: string name of file
flag(payload)[source]

Set a single flag on a resource.

Parameters:payload – t: can be one of make_public, make_private, make_shareable, make_not_shareable, make_discoverable, make_not_discoverable
Returns:empty but with 202 status_code
public(boolean)[source]

Pass through helper function for flag function.

shareable(boolean)[source]

Pass through helper function for flag function.

version()[source]

Create a new version of a resource.

Returns:resource id (string)
class hs_restclient.endpoints.resources.ResourceList(hs, **kwargs)[source]

Bases: hs_restclient.endpoints.resources.BaseEndpoint

class hs_restclient.endpoints.resources.ScimetaSubEndpoint(hs, pid)[source]

Bases: object

custom(payload)[source]
Parameters:payload – a key/value object containing the scimeta you want to store e.g. {“weather”: “sunny”, “temperature”: “80C” }
Returns:empty (200 status code)
get()[source]
Parameters:payload – a key/value object containing the scimeta you want to store e.g. {“weather”: “sunny”, “temperature”: “80C” }
Returns:empty (200 status code)
hs_restclient.endpoints.resources.default_progress_callback(monitor)[source]

Module contents