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",
"IPAM": {
"INFOBLOX": {
......@@ -22,4 +25,4 @@
"auth": "Bearer <token>",
"api_version": 1123
}
}
\ No newline at end of file
}
import logging
from gso.products.product_types.device \
import DeviceBlock
from gso.products.product_types.device import DeviceBlock
from gso import settings
# import requests
import requests
logger = logging.getLogger(__name__)
......@@ -17,8 +16,13 @@ def provision_node(
logger.debug(f'[disabled] provisioning node {node_subscription_params}')
# r = requests.get(
# f'https://{pp_params.api_base}'
# f'/api/version',
# params=node_subscription_params.dict())
# r.raise_for_status()
parameters = {
'callback': oss.GENERAL.public_hostname, # TODO: implement
'device': node_subscription_params.dict()
}
r = requests.post(
f'https://{pp_params.api_base}'
f'/api/device',
params=parameters)
r.raise_for_status()
......@@ -4,6 +4,10 @@ import os
from pydantic import BaseSettings
class GeneralParams:
public_hostname: str
class InfoBloxParams(BaseSettings):
scheme: str
wapi_version: str
......@@ -40,6 +44,7 @@ class ProvisioningProxyParams(BaseSettings):
class OSSParams(BaseSettings):
GENERAL: GeneralParams
IPAM: IPAMParams
RESOURCE_MANAGER_API_PREFIX: str # api prefix
PROVISIONING_PROXY: ProvisioningProxyParams
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment