Api for ASF's hyp3 system
Reason this release was yanked:
Deprciated!
Project description
==========
asf_hyp3 API CLASS
==========
Works with the hyp3-api and does all the get requests as well as saving
the repeated data between request, like the username and api_key.
formats: json by default which will be converted into appropriate data type,
csv or any orther format returns string of data recieved
functions are:
get_jobs
get_job
get_products
get_process
get_processes
one_time_process
get_subscriptions
get_subscription
create_subscription
remove_subscription
enable_subscription
disable_subscription
go to https://api.hyp3.asf.alaska.edu/ for more documentation
get_jobs
--------
Parameters: Required - None
Optional - id(can be a list of ids), status, sub_id, granule, format
Returns a list of dictionaries containing job information with the specified attributes.
Job info:
- id, sub_id, user_id, process_id, status, granule,
granule_url, other_granules, other_granule_urls,
request_time, processed_time, priority, message
get_job
-------
Parameters: Required - id
Optional - None
Returns a dictionary just like the one referenced in get_jobs
get_products
------------
Parameters: Required - None
Optional - id, sub_id, creation_date, name, format
Returns a list of dictionaries product information with the specified
attributes.
Product info contains fields:
- id, sub_id, name, url, browse_url,
size, creation_date
get_product
-----------
Parameters: Required - id
Optional - None
Returns a dictionary just like the one referenced in get_product
get_process
-----------
Parameters: Required - id
Optional - format
Returns a dictionary or a string depending on format containing information about the process.
return fields are:
- id, name, description, requires_pair,
supports_time_series_processing, requires_dual_pol
get_processes
-------------
Parameters: Required - None
Optional - format
Returns a list of dictionaries all available processes. Each entry is as
described by get_process.
one_time_process
----------------
Parameters: Required - granule, process_id
Optional - other_granules, priority, message
granule: can be passed a single granule, a list of granule strings, a file name
or an open file with granules in it.
All granule operations are done with the given process_id.
Schedules a new processing request and returns a dictionary
indicating whether or not the request succeeded, and an error message.
If the process_id specifies a process that requires a granule pair,
then other_granules must also be supplied.
Returns:
{"status": "SUCCESS", "message": null} or
{"status": "SUCCESS", "id": 1234} or
{"status": "ERROR", "message": *A Contextual Message*}
one_time_process_batch
----------------------
Schedules any number of new processing requests through an input file containing
descriptions of the jobs.
Parameters: Required - filename
File (CSV):
granule,process_id,other_granules,priority,message
S1_GRANULE,2,,10,sample message
S1_GRANULE,10,S1_GRANULE,,,
create_subscription
-------------------
Parameters: Required - polarization, crop_to_selection, name, process_id,
platform, location
Optional - start_date, end_date, description,
extra_arguments, enable
Schedules a new subscription and returns a dictionary indicating
whether or not the request succeeded, as well as an error message in
the event of failure. If you pass a file path to shapefilepath this will
override your entry for location. The shapefilepath must point to one of
the files necessary to create your geometry object, not simply their parent
directory.
Returns:
{"status": "SUCCESS", "id": 1234} or
{"status": "ERROR", "message": *A Contextual Message*}
get_subscriptions
-----------------
Parameters: Required - None
Optional - id, process_id, name, location, start_date, end_date,
enable, format
Returns a array of subscription information with the specified
attributes or a string depending on format. Subscription info contains fields:
- id, process_id, user_id, name, location,
start_date, end_date, enabled
get_subscription
----------------
Parameters: Required - id
Optional - None
Returns a JSON or CSV array with information belonging to the subscription holding
the subscription id passed. Subscriptions info contains fields:
- id, process_id, user_id, name, location,
start_date, end_date, enabled
disable_subscription
--------------------
Returns a dictionary just like the one referenced in get_subscriptions
Sets the property 'enabled' of a subscription to False. No further
actions will be taken based on this subscription until it is enabled
again. Returns a dictionary indicating whether or not the request
succeeded, and an error message in the event it did not.
enable_subscription
-------------------
Returns a dictionary just like the one referenced in get_subscriptions
Sets the property 'enabled' of a subscription to False. No further
actions will be taken based on this subscription until it is enabled
again. Returns a dictionary indicating whether or not the request
succeeded, and an error message in the event it did not.
asf_hyp3 API CLASS
==========
Works with the hyp3-api and does all the get requests as well as saving
the repeated data between request, like the username and api_key.
formats: json by default which will be converted into appropriate data type,
csv or any orther format returns string of data recieved
functions are:
get_jobs
get_job
get_products
get_process
get_processes
one_time_process
get_subscriptions
get_subscription
create_subscription
remove_subscription
enable_subscription
disable_subscription
go to https://api.hyp3.asf.alaska.edu/ for more documentation
get_jobs
--------
Parameters: Required - None
Optional - id(can be a list of ids), status, sub_id, granule, format
Returns a list of dictionaries containing job information with the specified attributes.
Job info:
- id, sub_id, user_id, process_id, status, granule,
granule_url, other_granules, other_granule_urls,
request_time, processed_time, priority, message
get_job
-------
Parameters: Required - id
Optional - None
Returns a dictionary just like the one referenced in get_jobs
get_products
------------
Parameters: Required - None
Optional - id, sub_id, creation_date, name, format
Returns a list of dictionaries product information with the specified
attributes.
Product info contains fields:
- id, sub_id, name, url, browse_url,
size, creation_date
get_product
-----------
Parameters: Required - id
Optional - None
Returns a dictionary just like the one referenced in get_product
get_process
-----------
Parameters: Required - id
Optional - format
Returns a dictionary or a string depending on format containing information about the process.
return fields are:
- id, name, description, requires_pair,
supports_time_series_processing, requires_dual_pol
get_processes
-------------
Parameters: Required - None
Optional - format
Returns a list of dictionaries all available processes. Each entry is as
described by get_process.
one_time_process
----------------
Parameters: Required - granule, process_id
Optional - other_granules, priority, message
granule: can be passed a single granule, a list of granule strings, a file name
or an open file with granules in it.
All granule operations are done with the given process_id.
Schedules a new processing request and returns a dictionary
indicating whether or not the request succeeded, and an error message.
If the process_id specifies a process that requires a granule pair,
then other_granules must also be supplied.
Returns:
{"status": "SUCCESS", "message": null} or
{"status": "SUCCESS", "id": 1234} or
{"status": "ERROR", "message": *A Contextual Message*}
one_time_process_batch
----------------------
Schedules any number of new processing requests through an input file containing
descriptions of the jobs.
Parameters: Required - filename
File (CSV):
granule,process_id,other_granules,priority,message
S1_GRANULE,2,,10,sample message
S1_GRANULE,10,S1_GRANULE,,,
create_subscription
-------------------
Parameters: Required - polarization, crop_to_selection, name, process_id,
platform, location
Optional - start_date, end_date, description,
extra_arguments, enable
Schedules a new subscription and returns a dictionary indicating
whether or not the request succeeded, as well as an error message in
the event of failure. If you pass a file path to shapefilepath this will
override your entry for location. The shapefilepath must point to one of
the files necessary to create your geometry object, not simply their parent
directory.
Returns:
{"status": "SUCCESS", "id": 1234} or
{"status": "ERROR", "message": *A Contextual Message*}
get_subscriptions
-----------------
Parameters: Required - None
Optional - id, process_id, name, location, start_date, end_date,
enable, format
Returns a array of subscription information with the specified
attributes or a string depending on format. Subscription info contains fields:
- id, process_id, user_id, name, location,
start_date, end_date, enabled
get_subscription
----------------
Parameters: Required - id
Optional - None
Returns a JSON or CSV array with information belonging to the subscription holding
the subscription id passed. Subscriptions info contains fields:
- id, process_id, user_id, name, location,
start_date, end_date, enabled
disable_subscription
--------------------
Returns a dictionary just like the one referenced in get_subscriptions
Sets the property 'enabled' of a subscription to False. No further
actions will be taken based on this subscription until it is enabled
again. Returns a dictionary indicating whether or not the request
succeeded, and an error message in the event it did not.
enable_subscription
-------------------
Returns a dictionary just like the one referenced in get_subscriptions
Sets the property 'enabled' of a subscription to False. No further
actions will be taken based on this subscription until it is enabled
again. Returns a dictionary indicating whether or not the request
succeeded, and an error message in the event it did not.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asf_hyp3-0.0.20.tar.gz
(13.1 kB
view hashes)