sparkworks_client.ParticipatorySensingApi
All URIs are relative to https://api.sparkworks.net
Method | HTTP request | Description |
---|---|---|
create_ps_resource | POST /v2/ps/resource | Create a Participatory Sensing Resource with an autogenerated uri |
delete_ps_resource | DELETE /v2/ps/resource/{uuid} | Delete a Participatory Sensing Resource |
publish_ps_data | POST /v2/ps/data | Publish data to a Participatory Sensing Resource. |
create_ps_resource
ResourceDTO create_ps_resource(resource_dto)
Create a Participatory Sensing Resource with an autogenerated uri
Provides means to create a participatory sensing resource and setup its properties in one call, with an autogenerated uri for it
Example
from __future__ import print_function
import time
import sparkworks_client
from sparkworks_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2
configuration = sparkworks_client.Configuration("username", "password", "client_id", "client_secret")
configuration.connect()
# create an instance of the API class
api_instance = sparkworks_client.ParticipatorySensingApi(sparkworks_client.ApiClient(configuration))
resource_dto = sparkworks_client.AParticipatorySensingResourceRequestAPIModel() # AParticipatorySensingResourceRequestAPIModel | Resource to be created and used for participatory sensing.
try:
# Create a Participatory Sensing Resource with an autogenerated uri
api_response = api_instance.create_ps_resource(resource_dto)
pprint(api_response)
except ApiException as e:
print("Exception when calling ParticipatorySensingApi->create_ps_resource: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
resource_dto | AParticipatorySensingResourceRequestAPIModel | Resource to be created and used for participatory sensing. |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_ps_resource
delete_ps_resource(uuid)
Delete a Participatory Sensing Resource
Provides means to delete a participatory sensing resource
Example
from __future__ import print_function
import time
import sparkworks_client
from sparkworks_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2
configuration = sparkworks_client.Configuration("username", "password", "client_id", "client_secret")
configuration.connect()
# create an instance of the API class
api_instance = sparkworks_client.ParticipatorySensingApi(sparkworks_client.ApiClient(configuration))
uuid = 'uuid_example' # str | The Participatory Sensing Resource UUID
try:
# Delete a Participatory Sensing Resource
api_instance.delete_ps_resource(uuid)
except ApiException as e:
print("Exception when calling ParticipatorySensingApi->delete_ps_resource: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
uuid | str | The Participatory Sensing Resource UUID |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
publish_ps_data
PublishDataListDTOAPIModel publish_ps_data(publish_data_list_dto)
Publish data to a Participatory Sensing Resource.
Provides means to publish data to a participatory sensing resource.
Example
from __future__ import print_function
import time
import sparkworks_client
from sparkworks_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2
configuration = sparkworks_client.Configuration("username", "password", "client_id", "client_secret")
configuration.connect()
# create an instance of the API class
api_instance = sparkworks_client.ParticipatorySensingApi(sparkworks_client.ApiClient(configuration))
publish_data_list_dto = sparkworks_client.PublishDataListDTOAPIModel() # PublishDataListDTOAPIModel | List of PublishDataDTO to be published to a participatory sensing resource.
try:
# Publish data to a Participatory Sensing Resource.
api_response = api_instance.publish_ps_data(publish_data_list_dto)
pprint(api_response)
except ApiException as e:
print("Exception when calling ParticipatorySensingApi->publish_ps_data: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
publish_data_list_dto | PublishDataListDTOAPIModel | List of PublishDataDTO to be published to a participatory sensing resource. |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]