Skip to content

Feature/31573 add other api clients to interface with and reuse timeseries environment#82

Merged
janny93 merged 6 commits into
mainfrom
feature/31573-add-other-api-clients-to-interface-with-and-reuse-timeseries-environment
Apr 20, 2026
Merged

Feature/31573 add other api clients to interface with and reuse timeseries environment#82
janny93 merged 6 commits into
mainfrom
feature/31573-add-other-api-clients-to-interface-with-and-reuse-timeseries-environment

Conversation

@janny93

@janny93 janny93 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Description

Add other api clients to interface with and reuse timeseries environment

  • Enable pylance basic type validation checks and based on these validation errors change MsalCredential internal type to use generally available TokenCredential instead + properly set HttpClient expected request type
  • Update TimeseriesEnvironment to instead be a generic way to set environment to dev, test or prod. User facing functionality is the same, except for the ability to set API version. As this is a supportive sdk and not our main API, I assume its not critical that user's cant go towards version 1.6 while the default has been and still is 1.7
  • Add IMS Metadata API and related environment, and some endpoints
  • Add IMS Subscriptions API and related environment, and some endpoints
  • Add IMS Subscriptions Management API and related environment, and some endpoints. Meant for internal use. If users discovers it, no harm is done as they anyways would need admin token to be able to use it
  • Should probably add more endpoints at some point, focus now was to have ready endpoints needed for SNB Remap operation, if its decided we will do that after all

Type of change

  • Bug fix (non-breaking change which fixes an issue): Pylance non-critical type validation errors
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected): No longer able to select Timeseries API version 1.6, only default/newest 1.7 is now supported

How Has This Been Tested?

Tested locally with local build (poetry build and pip install dist/omnia_timeseries-x.y.z.tar.gz), and with the following code

# Import existing and new APIs
from omnia_timeseries.api import TimeseriesAPI, IMSMetadataAPI, IMSSubscriptionsAPI, IMSSubscriptionsManagementAPI, TimeseriesEnvironment, FederationSource
import os

# Setup credentials
from azure.identity import DefaultAzureCredential
credentials = DefaultAzureCredential()

# Set environment and API variables
environment=TimeseriesEnvironment.Dev()
api = TimeseriesAPI(azure_credential=credentials, environment=environment)
imsApi = IMSMetadataAPI(azure_credential=credentials, environment=environment)
subApi = IMSSubscriptionsAPI(azure_credential=credentials, environment=environment)
subManApi = IMSSubscriptionsManagementAPI(azure_credential=credentials, environment=environment)

# Ensure existing timeseries api call work, tested one endpoint
api.get_timeseries(limit=10)

# Ensure able to search for IMS Metadata API tags
imsApi.search(limit=10)

# Ensure able to search for IMS Subscriptions API subscriptions
print(subApi.search(limit=3))
print(subApi.search_by_system_code(systemCode="SNB"))
print(subApi.search_by_timeseries_id(timeseriesId="e70fda8b-5624-4089-a979-3c4ad8211a6c"))
print(subApi.search_by_uid(uid="SFB-2675"))

# Ensure able to use IMS Subscriptions API
subManApi.get_subscription_counter_by_system_code(systemCode="SNB")
subManApi.patch_subscription_by_uid(
    uid="SFB-2675",
    request= 
        {
            "propertyX":"valueX"
        }
    )

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

Comment thread examples/usage_examples.ipynb
Comment thread tests/test_api.py
Comment thread src/omnia_timeseries/http_client.py
@janny93 janny93 requested review from a team April 17, 2026 12:40

@torgeirbm torgeirbm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@janny93 janny93 merged commit 94d97c9 into main Apr 20, 2026
6 checks passed
@janny93 janny93 deleted the feature/31573-add-other-api-clients-to-interface-with-and-reuse-timeseries-environment branch April 20, 2026 06:29
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.

3 participants