Skip to content
Snippets Groups Projects
Verified Commit c3c750d3 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Update oss-params and add call to provisioning proxy

parent 90fbe034
No related branches found
No related tags found
2 merge requests!11Feature/test provisioning proxy,!10Make create_device use provisioning proxy
{ {
"GENERAL": {
"public_hostname": "https://gap.geant.org"
},
"RESOURCE_MANAGER_API_PREFIX": "http://localhost:44444", "RESOURCE_MANAGER_API_PREFIX": "http://localhost:44444",
"IPAM": { "IPAM": {
"INFOBLOX": { "INFOBLOX": {
...@@ -22,4 +25,4 @@ ...@@ -22,4 +25,4 @@
"auth": "Bearer <token>", "auth": "Bearer <token>",
"api_version": 1123 "api_version": 1123
} }
} }
\ No newline at end of file
import logging import logging
from gso.products.product_types.device \ from gso.products.product_types.device import DeviceBlock
import DeviceBlock
from gso import settings from gso import settings
# import requests import requests
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -17,8 +16,13 @@ def provision_node( ...@@ -17,8 +16,13 @@ def provision_node(
logger.debug(f'[disabled] provisioning node {node_subscription_params}') logger.debug(f'[disabled] provisioning node {node_subscription_params}')
# r = requests.get( parameters = {
# f'https://{pp_params.api_base}' 'callback': oss.GENERAL.public_hostname, # TODO: implement
# f'/api/version', 'device': node_subscription_params.dict()
# params=node_subscription_params.dict()) }
# r.raise_for_status()
r = requests.post(
f'https://{pp_params.api_base}'
f'/api/device',
params=parameters)
r.raise_for_status()
...@@ -4,6 +4,10 @@ import os ...@@ -4,6 +4,10 @@ import os
from pydantic import BaseSettings from pydantic import BaseSettings
class GeneralParams:
public_hostname: str
class InfoBloxParams(BaseSettings): class InfoBloxParams(BaseSettings):
scheme: str scheme: str
wapi_version: str wapi_version: str
...@@ -40,6 +44,7 @@ class ProvisioningProxyParams(BaseSettings): ...@@ -40,6 +44,7 @@ class ProvisioningProxyParams(BaseSettings):
class OSSParams(BaseSettings): class OSSParams(BaseSettings):
GENERAL: GeneralParams
IPAM: IPAMParams IPAM: IPAMParams
RESOURCE_MANAGER_API_PREFIX: str # api prefix RESOURCE_MANAGER_API_PREFIX: str # api prefix
PROVISIONING_PROXY: ProvisioningProxyParams PROVISIONING_PROXY: ProvisioningProxyParams
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment