Example #1
0
 def root_create(self, req, body, tenant_id, instance_id, is_cluster):
     if is_cluster:
         raise exception.ClusterOperationNotSupported(
             operation='enable_root')
     LOG.info("Enabling root for instance '%s'.", instance_id)
     LOG.info("req : '%s'\n\n", req)
     context = req.environ[wsgi.CONTEXT_KEY]
     password = DefaultRootController._get_password_from_body(body)
     root = models.Root.create(context, instance_id, password)
     return wsgi.Result(views.RootCreatedView(root).data(), 200)
Example #2
0
 def instance_root_create(self, req, body, instance_id,
                          cluster_instances=None):
     LOG.info(_LI("Enabling root for instance '%s'.") % instance_id)
     LOG.info(_LI("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     user_name = context.user
     password = ClusterRootController._get_password_from_body(body)
     root = models.ClusterRoot.create(context, instance_id, user_name,
                                      password, cluster_instances)
     return wsgi.Result(views.RootCreatedView(root).data(), 200)
Example #3
0
 def instance_root_create(self, req, body, instance_id,
                          cluster_instances=None):
     LOG.info(_LI("Enabling root for instance '%s'.") % instance_id)
     LOG.info(_LI("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     user_name = context.user
     if body:
         password = body['password'] if 'password' in body else None
     else:
         password = None
     root = models.VerticaRoot.create(context, instance_id, user_name,
                                      password, cluster_instances)
     return wsgi.Result(views.RootCreatedView(root).data(), 200)
Example #4
0
 def root_create(self, req, body, tenant_id, instance_id, is_cluster):
     if is_cluster:
         raise exception.ClusterOperationNotSupported(
             operation='enable_root')
     LOG.info(_LI("Enabling root for instance '%s'.") % instance_id)
     LOG.info(_LI("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     user_name = context.user
     if body:
         password = body['password'] if 'password' in body else None
     else:
         password = None
     root = models.Root.create(context, instance_id, user_name, password)
     return wsgi.Result(views.RootCreatedView(root).data(), 200)