Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

222 integration of ngsi ld endpoints #247

Open
wants to merge 116 commits into
base: NGSI-LD
Choose a base branch
from

Conversation

djs0109
Copy link
Contributor

@djs0109 djs0109 commented Feb 20, 2024

close #222

Malte96 and others added 30 commits November 2, 2023 15:35
Addes reference to readme
edit authors and alumni
adjusted copyright year
# Conflicts:
#	filip/models/base.py
Add authorization field to fiware-header
…ible-with-Pydantic-v2

fix: updated regex to pattern
matzeteupel and others added 24 commits April 3, 2024 17:49
Debug the context of the datamodels
Define ToDos for the further validation of nested propertys
Signed-off-by: iripiri <iris.m.koester@gmail.com>
…1' into 222-Integration-of-NGSI-LD-endpoints
Signed-off-by: iripiri <iris.m.koester@gmail.com>
…mentation

Signed-off-by: iripiri <iris.m.koester@gmail.com>
finish the cb_entity and test get_properties
add get_context method + unittest
Signed-off-by: iripiri <iris.m.koester@gmail.com>
finalize the unittests
Signed-off-by: iripiri <iris.m.koester@gmail.com>
Signed-off-by: iripiri <iris.m.koester@gmail.com>
…1' into 222-Integration-of-NGSI-LD-endpoints
@iripiri
Copy link
Collaborator

iripiri commented Jun 12, 2024

Endpoints (implemented & tested):

Entities

  • GET /entities
  • POST /entities
  • GET /entities/{entityId}
  • DELETE /entities/{entityId}
  • POST /entities/{entityId}/attrs
  • PATCH /entities/{entityId}/attrs
  • PATCH /entities/{entityId}/attrs/{attrId}
  • DELETE /entities/{entityId}/attrs/{attrId}

Batch operations

  • POST /entityOperations/create
  • POST /entityOperations/update
  • POST /entityOperations/upsert
  • POST /entityOperations/delete

Subscriptions

  • GET /subscriptions
  • POST /subscriptions
  • GET /subscriptions/{subscriptionId}
  • PATCH /subscriptions/{subscriptionId}
  • DELETE /subscriptions/{subscriptionId}

csf: Optional[str] = None,
limit: Optional[PositiveInt] = 100,
response_format: Optional[Union[AttrsFormat, str]] = AttrsFormat.NORMALIZED.value,
) -> Union[Dict[str, Any]]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iripiri The type hint should be adjusted because normally, a list of ContextLDEntity will be returned.

"""
Cleanup entities from test server
"""
entity_test_types = ["MyType", "room"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the cleanup limited to these types of entities?

CB_URL = "http://137.226.248.200:1027"
self.cb_client = ContextBrokerLDClient(url=CB_URL,
fiware_header=self.fiware_header)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a cleanup step here will increase the robustness of the tests

entity_test_types = ["MyType", "room"]

fiware_header = FiwareLDHeader()
with ContextBrokerLDClient(fiware_header=fiware_header) as client:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to implement a clean up function for LD context broker? It can be placed under filip.utils.cleanup

self.cb_client.post_entity(entity=self.entity_2)
entity_list = self.cb_client.get_entity_list()
self.assertEqual(len(entity_list), 2)
self.assertEqual(entity_list[0].id, self.entity.id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can actually not ensure that the order of the entities is not changing.

self.assertEqual(response.status_code, 404)
self.assertEqual(response.json()["title"], "Entity Not Found")

"""Test2"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scenario is different as the the description above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet