You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a context source discovery Subscription within an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimportc_source_subscriptions_apifromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.subscriptionimportSubscriptionfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=c_source_subscriptions_api.CSourceSubscriptionsApi(api_client)
# example passing only required values which don't have defaults setbody=Subscription(None)
try:
api_response=api_instance.create_c_source_subscription(
body=body,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling CSourceSubscriptionsApi->create_c_source_subscription: %s\n"%e)
Selects the schema and serialization of the request body
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Removes a specific Context Source Subscription from an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimportc_source_subscriptions_apifromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=c_source_subscriptions_api.CSourceSubscriptionsApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'subscriptionId': "subscriptionId_example",
}
try:
api_response=api_instance.remove_c_source_subscription(
path_params=path_params,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling CSourceSubscriptionsApi->remove_c_source_subscription: %s\n"%e)
Parameters
Name
Type
Description
Notes
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
path_params
RequestPathParams
Name
Type
Description
Notes
subscriptionId
SubscriptionIdSchema
SubscriptionIdSchema
Type
Description
Notes
str
Return Types, Responses
Code
Class
Description
n/a
api_client.ApiResponseWithoutDeserialization
When skip_deserialization is True this response is returned
204
ApiResponseFor204
No Content. The Subscription was removed successfully
Retrieves the context source discovery subscriptions available in an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimportc_source_subscriptions_apifromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.subscription_listimportSubscriptionListfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=c_source_subscriptions_api.CSourceSubscriptionsApi(api_client)
# example passing only optional valuesquery_params= {
'limit': 1,
}
try:
api_response=api_instance.retrieve_c_source_subscriptions(
query_params=query_params,
)
pprint(api_response)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling CSourceSubscriptionsApi->retrieve_c_source_subscriptions: %s\n"%e)
Parameters
Name
Type
Description
Notes
query_params
RequestQueryParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
query_params
RequestQueryParams
Name
Type
Description
Notes
limit
LimitSchema
optional
LimitSchema
Type
Description
Notes
int
Return Types, Responses
Code
Class
Description
n/a
api_client.ApiResponseWithoutDeserialization
When skip_deserialization is True this response is returned
Retrieves a specific Subscription from an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimportc_source_subscriptions_apifromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.subscriptionimportSubscriptionfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=c_source_subscriptions_api.CSourceSubscriptionsApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'subscriptionId': "subscriptionId_example",
}
try:
api_response=api_instance.retrieve_c_source_subscriptions_by_id(
path_params=path_params,
)
pprint(api_response)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling CSourceSubscriptionsApi->retrieve_c_source_subscriptions_by_id: %s\n"%e)
Parameters
Name
Type
Description
Notes
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
path_params
RequestPathParams
Name
Type
Description
Notes
subscriptionId
SubscriptionIdSchema
SubscriptionIdSchema
Type
Description
Notes
str
Return Types, Responses
Code
Class
Description
n/a
api_client.ApiResponseWithoutDeserialization
When skip_deserialization is True this response is returned
Updates a specific context source discovery Subscription within an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimportc_source_subscriptions_apifromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.subscription_fragmentimportSubscriptionFragmentfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=c_source_subscriptions_api.CSourceSubscriptionsApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'subscriptionId': "subscriptionId_example",
}
body=SubscriptionFragment(
context=LdContext(None),
entities=[
EntityInfo(
id="id_example",
type=Name("_"),
id_pattern="id_pattern_example",
)
],
name="name_example",
description="description_example",
watched_attributes=[
Name("watched_attributes_example")
],
time_interval=0,
expires="1970-01-01T00:00:00.00Z",
is_active=True,
throttling=1,
q="q_example",
geo_q=GeoQuery(
georel=Georel(None),
coordinates=Coordinates(None),
geometry=Geometry("Point"),
),
csf="csf_example",
)
try:
api_response=api_instance.update_c_source_subscription(
path_params=path_params,
body=body,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling CSourceSubscriptionsApi->update_c_source_subscription: %s\n"%e)
Selects the schema and serialization of the request body
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned