Skip to content

Commit

Permalink
fix core v3 endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
emoscardini committed Apr 17, 2024
1 parent eed2bd4 commit f1457c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.1] - 2024-04-17

### Changed

- Fix core v3 endpoint.

## [1.4.0] - 2024-03-22

### Added
Expand Down
10 changes: 5 additions & 5 deletions router_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def check_registration_key(registration_key):
:return NetFoundry MOP endpoint
"""
if len(registration_key) == 10:
return 'https://gateway.production.netfoundry.io/core/v2/edge-routers'
return 'https://gateway.production.netfoundry.io/core/v2/edge-routers/register'
if len(registration_key) == 11:
return 'https://gateway.production.netfoundry.io/core/v3/edge-router-registrations'
if registration_key.startswith("SA"):
Expand All @@ -87,8 +87,8 @@ def check_registration_key(registration_key):
key_environment = 'development'
if len(registration_key) == 12:
if key_environment == 'development':
return 'http://localhost:9300/core/v2/edge-routers'
return 'https://gateway.' + str(key_environment) + '.netfoundry.io/core/v2/edge-routers'
return 'http://localhost:9300/core/v2/edge-routers/register'
return 'https://gateway.' + str(key_environment) + '.netfoundry.io/core/v2/edge-routers/register'
if len(registration_key) == 13:
if key_environment == 'development':
return 'http://localhost:9300/core/v3/edge-router-registrations'
Expand Down Expand Up @@ -285,7 +285,7 @@ def create_parser():
:return: A Namespace containing arguments
"""
__version__ = '1.4.0'
__version__ = '1.4.1'
parser = argparse.ArgumentParser()

mgroup = parser.add_mutually_exclusive_group(required=True)
Expand Down Expand Up @@ -468,7 +468,7 @@ def get_mop_router_information(endpoint_url, registration_key):
"""
try:
headers = {'content-type': 'application/json'}
endpoint_url = f"{endpoint_url}/register/{registration_key}"
endpoint_url = f"{endpoint_url}/{registration_key}"
logging.debug("Connecting to: %s", endpoint_url)
response = requests.post(endpoint_url,
headers=headers,
Expand Down

0 comments on commit f1457c0

Please sign in to comment.