-
Notifications
You must be signed in to change notification settings - Fork 5
Feature: ipv4 and missing service #221
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
Conversation
55fdfdc
to
3a96bdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are different things to fix, like the delete_ports logic that shouldn't work, and also take into account the REMOVING
status also on messages as valid as PROCESSED
. Also, the test should be useful that these tests are not testing anything indeed.
The other are only method renaming suggestions to improve the clarity.
…VERSION` `SCHEDULER_URL`
…egister_service` to add any service on top
…new method `register_authenticated_service` to add any service on top
…n getting instance allocations
24e9dc1
to
a275c89
Compare
This PR add missing services inside the SDK
crn
scheduler
dns
port_forwarder
andutils
to simplify usage for instancesRelated ClickUp, GitHub or Jira tickets : ALEPH-XXX
Self proofreading checklist
Changes
This pull request introduces significant enhancements to the Aleph SDK client, primarily focusing on service modularization, authenticated service registration, and improved API interactions. Key changes include the addition of several service classes, the ability to register services dynamically, and updates to existing methods to use new models and validation techniques.
Service Modularization and API Enhancements:
Added new service classes: Introduced modular service classes such as
CrnService
,DNSService
,PortForwarder
,AuthenticatedPortForwarder
, andSchedulerService
to encapsulate specific API interactions. These classes streamline operations like fetching CRN lists, managing DNS records, configuring port forwarding, and interacting with the scheduler API. (src/aleph/sdk/client/service/crn/http_crn.py
- [1]src/aleph/sdk/client/service/dns/http_dns.py
- [2]src/aleph/sdk/client/service/port_forwarder/http_port_forwarder.py
- [3]src/aleph/sdk/client/service/port_forwarder/authenticated_port_forwarder.py
- [4]src/aleph/sdk/client/service/scheduler/http_scheduler.py
- [5]Introduced
BaseService
andAggregateConfig
: Added a generic base classBaseService
and a container modelAggregateConfig
to handle aggregate data and simplify service implementations. (src/aleph/sdk/client/service/base.py
- src/aleph/sdk/client/service/base.pyR1-R47)Service Registration and Initialization:
Dynamic service registration: Added methods
register_service
andregister_authenticated_service
to dynamically register services for both authenticated and non-authenticated clients. This allows for flexible service instantiation during client initialization. (src/aleph/sdk/client/authenticated_http.py
- [1]src/aleph/sdk/client/http.py
- [2]Service initialization in
__aenter__
: Enhanced the__aenter__
method inAlephHttpClient
andAuthenticatedAlephHttpClient
to initialize default and registered services when the client is entered. (src/aleph/sdk/client/authenticated_http.py
- [1]src/aleph/sdk/client/http.py
- [2]Code Improvements:
parse_obj
withmodel_validate
for improved validation in methods likecreate_store
. (src/aleph/sdk/client/authenticated_http.py
- src/aleph/sdk/client/authenticated_http.pyL395-R425)These changes collectively enhance the SDK's flexibility, maintainability, and ease of use for developers interacting with the Aleph network.