HydroShare Dataset Engine Reference

Last Updated: August 5, 2015

Warning

Coming Soon!

The following reference provides a summary the class used to define the HydroShareDatasetEngine objects.

class tethys_dataset_services.engines.HydroShareDatasetEngine(endpoint, apikey=None, username=None, password=None)

Definition for HydroShare Dataset Engine objects.

create_dataset(name, console=False, **kwargs)

Create a new HydroShare resource.

Parameters
  • name (string) -- The id or name of the resource to retrieve.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

create_resource(dataset_id, url=None, file=None, console=False, **kwargs)

Create a new HydroShare file

Parameters
  • dataset_id (string) -- The id or name of the dataset to to which the resource will be added.

  • url (string, optional) -- URL for the resource that will be added to the dataset.

  • file (string, optional) -- Absolute path to a file to upload for the resource.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

delete_dataset(dataset_id, console=False, **kwargs)

Delete HydroShare resource

Parameters
  • dataset_id (string) -- The id or name of the dataset to delete.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

delete_resource(resource_id, console=False, **kwargs)

Delete HydroShare file.

Parameters
  • resource_id (string) -- The id of the resource to delete.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

get_dataset(dataset_id, console=False, **kwargs)

Retrieve HydroShare resource

Parameters
  • dataset_id (string) -- The id or name of the dataset to retrieve.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

get_resource(resource_id, console=False, **kwargs)

Retrieve HydroShare file

Parameters
  • resource_id (string) -- The id of the resource to retrieve.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

list_datasets(with_resources=False, console=False, **kwargs)

List HydroShare resources

Parameters
  • with_resources (bool, optional) -- Return a list of dataset dictionaries. Defaults to False.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

A list of dataset names or a list of dataset dictionaries if with_resources is true.

Return type

list

search_datasets(query, console=False, **kwargs)

Search HydroShare resources that match a query.

Parameters
  • query (dict) -- Key value pairs representing field and values to search for.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

search_resources(query, console=False, **kwargs)

Search HydroShare files that match a query.

Parameters
  • query (dict) -- Key value pairs representing field and values to search for.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

property type

HydroShare Dataset Engine Type

update_dataset(dataset_id, console=False, **kwargs)

Update HydroShare resource

Parameters
  • dataset_id (string) -- The id or name of the dataset to update.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.

update_resource(resource_id, url=None, file=None, console=False, **kwargs)

Update HydroShare file

Parameters
  • resource_id (string) -- The id of the resource that will be updated.

  • url (string, optional) -- URL of the resource that will be added to the dataset.

  • file (string, optional) -- Absolute path to a file to upload for the resource.

  • console (bool, optional) -- Pretty print the result to the console for debugging. Defaults to False.

  • **kwargs -- Any number of optional keyword arguments for the method (see HydroShare docs).

Returns

The response dictionary or None if an error occurs.