From 858a3daa5aa97472b11e5eefacf8e08c1cf262bc Mon Sep 17 00:00:00 2001 From: abodeuis Date: Mon, 14 Oct 2024 08:43:05 -0500 Subject: [PATCH] Updated Changelog --- CHANGELOG.md | 18 ++++++++++++++++++ cdrhook/connector.py | 14 +++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa11a4e..34bb049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +- Updated cmaas_utils to version 2.0 +- Updated cdr_schemas to version 4.9.0 +- Changed retieve_endpoint to be memver function of cdrConnector +- Updated retrieve and validate functions to be one function, with optional parameters. +- Updated Server.py to for new retrieve and validate calls +- Convert code moved to cmaas_utils from this repo +- Updated Server.py to change convert function calls to use cmaas_utils version +- Updated CogMetadataSchema to conform with cdr_schemas v4.9.0 +- Updated FeatureResults to conform with cdr_schemas v4.9.0 +- Fixed import paths to allow for tests to be run +- Added docstrings for cdrconnector and retrieve api functions +### Tests +- Updated retrieve tests +- Removed validate test functions +- Removed convert tests +- Fixed remaining tests that were failing + ## [0.9.2] - 2024-08-22 ### Added diff --git a/cdrhook/connector.py b/cdrhook/connector.py index cf33e2a..461427e 100644 --- a/cdrhook/connector.py +++ b/cdrhook/connector.py @@ -4,6 +4,9 @@ from pydantic import BaseModel, Field, AnyUrl class CdrConnector(BaseModel): + """ + Class to handle registration and communication with the CDR API. + """ system_name : str = Field( description="The name of the system registering with the CDR") system_version : str = Field( @@ -33,7 +36,16 @@ class CdrConnector(BaseModel): def register(self): """ - Register our system to the CDR using the app_settings + Register our system to the CDR using the app_settings. The register call can fail if + another system with the same name and version is already registered, if this happens + you can manual deregister the other system through the CDR Docs API or change the name + and version of your system. + + Returns: + str: The registration ID returned by the CDR + + Raises: + requests.HTTPError: If the request fails """ headers = {'Authorization': f'Bearer {self.token}'} registration = {