topology.
"""
- def __init__(self, listenip, port, deploy_sap=False, docker_management=True):
+ def __init__(self, listenip, port, deploy_sap=False, docker_management=False, auto_deploy=False):
self.dcs = {}
self.ip = listenip
self.port = port
dgk.DEPLOY_SAP = deploy_sap
dgk.USE_DOCKER_MGMT = docker_management
+ dgk.AUTODEPLOY = auto_deploy
logging.debug("Created API endpoint %s" % self)
def __repr__(self):
BIDIRECTIONAL_CHAIN = False
# override the management interfaces in the descriptors with default docker0 interfaces in the containers
-USE_DOCKER_MGMT = True
+USE_DOCKER_MGMT = False
+
+# automatically deploy uploaded packages (no need to execute son-access deploy --latest separately)
+AUTO_DEPLOY = True
def generate_subnets(prefix, base, subnet_size=50, mask=24):
# Generate a list of ipaddress in subnets
# create a service object and register it
s = Service(service_uuid, file_hash, upload_path)
GK.register_service_package(service_uuid, s)
+
+ # automatically deploy the service
+ if AUTO_DEPLOY:
+ # ok, we have a service uuid, lets start the service
+ service_instance_uuid = GK.services.get(service_uuid).start_service()
+
# generate the JSON result
return {"service_uuid": service_uuid, "size": size, "sha1": file_hash, "error": None}, 201
except Exception as ex:
rapi1.start()
# add the SONATA dummy gatekeeper to each DC
- sdkg1 = SonataDummyGatekeeperEndpoint("0.0.0.0", 5000, deploy_sap=True)
+ sdkg1 = SonataDummyGatekeeperEndpoint("0.0.0.0", 5000, deploy_sap=True, auto_deploy=True, docker_management=True)
sdkg1.connectDatacenter(dc1)
# run the dummy gatekeeper (in another thread, don't block)
sdkg1.start()