コード例 #1
0
 def download_blueprint_resource(self,
                                 blueprint_id,
                                 resource_path,
                                 logger,
                                 target_path=None):
     return manager.download_blueprint_resource(blueprint_id, resource_path,
                                                logger, target_path)
コード例 #2
0
 def download_blueprint_resource(self, resource_path, target_path=None):
     blueprint_id = self.workflow_ctx.blueprint.id
     logger = self.workflow_ctx.logger
     return download_blueprint_resource(blueprint_id=blueprint_id,
                                        resource_path=resource_path,
                                        target_path=target_path,
                                        logger=logger)
コード例 #3
0
 def download_blueprint_resource(self,
                                 resource_path,
                                 target_path=None):
     blueprint_id = self.workflow_ctx.blueprint.id
     logger = self.workflow_ctx.logger
     return download_blueprint_resource(blueprint_id=blueprint_id,
                                        resource_path=resource_path,
                                        target_path=target_path,
                                        logger=logger)
コード例 #4
0
 def download_blueprint_resource(self,
                                 blueprint_id,
                                 resource_path,
                                 logger,
                                 target_path=None):
     return manager.download_blueprint_resource(blueprint_id,
                                                resource_path,
                                                logger,
                                                target_path)
コード例 #5
0
 def download_blueprint_resource(self,
                                 blueprint_id,
                                 resource_path,
                                 logger,
                                 target_path=None,
                                 template_variables=None):
     resource = manager.download_blueprint_resource(
         blueprint_id=blueprint_id,
         resource_path=resource_path,
         logger=logger,
         target_path=target_path)
     return self._render_resource_if_needed(
         resource=resource,
         template_variables=template_variables,
         download=True)
コード例 #6
0
ファイル: workflows.py プロジェクト: LazyWill/cfy3
def kube_create(**kwargs):
  setfabenv(kwargs)
  url=kwargs['url']
  #get manifest
  if(url[0:4]=='http'):
    #external
    run("wget -O /tmp/manifest.yaml "+url)
  else:
    #in blueprint dir

    res=manager.download_blueprint_resource(ctx.blueprint.id,url,ctx.logger)
    
    put(res,"/tmp/manifest.yaml")

  run("./kubectl -s http://localhost:8080 create -f /tmp/manifest.yaml")
コード例 #7
0
 def download_blueprint_resource(self,
                                 blueprint_id,
                                 resource_path,
                                 logger,
                                 target_path=None,
                                 template_variables=None):
     resource = manager.download_blueprint_resource(
         blueprint_id=blueprint_id,
         resource_path=resource_path,
         logger=logger,
         target_path=target_path)
     return self._render_resource_if_needed(
         resource=resource,
         template_variables=template_variables,
         download=True)
コード例 #8
0
def kube_create(**kwargs):
    setfabenv(kwargs)
    url = kwargs['url']
    #get manifest
    if (url[0:4] == 'http'):
        #external
        run("wget -O /tmp/manifest.yaml " + url)
    else:
        #in blueprint dir
        with open("/tmp/log", "a") as f:
            f.write("getting manifest\n")

        res = manager.download_blueprint_resource(ctx.blueprint.id, url,
                                                  ctx.logger)

        put(res, "/tmp/manifest.yaml")

    run("./kubectl -s http://localhost:8080 create -f /tmp/manifest.yaml")
コード例 #9
0
ファイル: tasks.py プロジェクト: mahak/cloudify-script-plugin
def execute_workflow(script_path, **kwargs):
    ctx = workflows_ctx._get_current_object()
    script_path = download_blueprint_resource(ctx.blueprint_id,
                                              script_path,
                                              ctx.logger)
    return process(eval_script, script_path, ctx)