Executes a script at runtime for a VNFR of a defined VNFD in a running NSR.

@param idNsr the ID of the NetworkServiceRecord
@param idVnfr the ID of the VNFR to be upgraded
@param script the script to execute
@throws SDKException if the request fails
189020
@Help(
    help =
        "Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id"
  )
  public void executeScript(final String idNsr, final String idVnfr, String script)
      throws SDKException {
    String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/execute-script";
    requestPost(url, script);
  }
44023
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlInterface == null) {
			this.container = script;
			this.sarlInterface = SarlFactory.eINSTANCE.createSarlInterface();
			script.getXtendTypes().add(this.sarlInterface);
			this.sarlInterface.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlInterface.setName(name);
			}
		}
	}
398253
public static void setExecutePermissions(final File scriptfile) throws IOException {
        if (!scriptfile.setExecutable(true, true)) {
            System.err.println("Unable to set executable bit on temp script file, execution may fail: " + scriptfile
                .getAbsolutePath());
        }
    }
1017384
private void executeGalaxyScript(final String scriptName) {
    final String bashScript = String.format("cd %s; if [ -d .venv ]; then . .venv/bin/activate; fi; %s", getPath(), scriptName);
    IoUtils.executeAndWait("bash", "-c", bashScript);
  }
340422
private void executeMethod(String script) {
    parent.assertConnected();
    debugger.callFunctionOnObject(script, objectId, false);
  }
1206623
public void setPostInstallScript( final String script) {
        setPostInstallProgram(readProgram(script));
        if ( script != null) format.getHeader().createEntry( POSTINSCRIPT, script);
	}
1149741
@Override
    public Script freshOutputScript(KeyPurpose purpose) {
        DeterministicKey followedKey = getKey(purpose);
        ImmutableList.Builder<ECKey> keys = ImmutableList.<ECKey>builder().add(followedKey);
        for (DeterministicKeyChain keyChain : followingKeyChains) {
            DeterministicKey followingKey = keyChain.getKey(purpose);
            checkState(followedKey.getChildNumber().equals(followingKey.getChildNumber()), "Following keychains should be in sync");
            keys.add(followingKey);
        }
        List<ECKey> marriedKeys = keys.build();
        Script redeemScript = ScriptBuilder.createRedeemScript(sigsRequiredToSpend, marriedKeys);
        return ScriptBuilder.createP2SHOutputScript(redeemScript);
    }
116880
public void init(
            Document iddDoc,
            Document extensionDoc,
            final String service,
            String packageName,
            final String basedir,
            final String genSrcDir,
            final Log log,
            final String outputDir,
            boolean client,
            boolean server)
            throws Exception {

        try {
            output = new File(basedir, genSrcDir);
            if (outputDir != null) {
                iDDOutputDir = new File(basedir+"/"+outputDir);
                if (!iDDOutputDir.exists()) {
                    if (!iDDOutputDir.mkdirs()) {
                        throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" could not be created");
                    }
                }
                if (!iDDOutputDir.isDirectory() || (!iDDOutputDir.canWrite())) {
                    throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" is not a directory or cannot be written to.");
                }
            }
            config = new Configuration();
            config.setClassForTemplateLoading(IDLReader.class, "/templates");

            config.setStrictSyntaxMode(true);
            this.log = log;
            this.packageName = packageName;
            this.service = service;
            this.client = client;
            this.server = server || !client; // server must be true if client if false.

            dataModel = NodeModel.wrap(iddDoc.cloneNode(true));

            if (extensionDoc != null) {
                NodeModel extensionModel = NodeModel.wrap(extensionDoc);
                mergeExtensionsIntoDocument(getRootNode(dataModel),
                        getRootNode(extensionModel));
                removeUndefinedOperations(getRootNode(dataModel),
                        getRootNode(extensionModel));
            }
            if(log.isDebugEnabled()) {
                log.debug(serialize());
            }
        } catch (final Exception e) {
            log.error("Failed to initialise FTL", e);
            throw e;
        }
    }
352653
private void executeInitScript() {
    if (initScript != null && initScript.exists()) {
      try {
        Runtime run = Runtime.getRuntime();
        Process proc = run.exec(new String[] {
            "/bin/bash", "-c", initScript.getAbsolutePath()
        });
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        String line;

        logInfo("Output of running script is");
        while ((line = br.readLine()) != null) {
          logInfo(line);
        }
        proc.waitFor(); // Wait for the process to finish.
        logInfo("Script executed successfully %s", initScript.getAbsolutePath());
      } catch (IOException e) {
        logDebug(debug, "Error executing script for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      } catch (InterruptedException e) {
        logDebug(debug, "Script execution interrupted for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      }
    }
  }
1309486
@RequestMapping(value = "/api/scripts/{scriptIdentifier}", method = RequestMethod.DELETE)
    public
    @ResponseBody
    HashMap<String, Object> deleteScript(Model model, @PathVariable String scriptIdentifier) throws Exception {
        int scriptId = Integer.parseInt(scriptIdentifier);

        ScriptService.getInstance().removeScript(scriptId);
        return this.getScripts(model, null);
    }
455944
public static String executeGroovy(String script, @Nonnull VirtualChannel channel) throws IOException, InterruptedException {
        return channel.call(new Script(script));
    }
842758
protected void runScript(String mapperScript, Slurper slurper, Builder builder)
            throws ActivityException, TransformerException {

        CompilerConfiguration compilerConfig = new CompilerConfiguration();
        compilerConfig.setScriptBaseClass(CrossmapScript.class.getName());

        Binding binding = new Binding();
        binding.setVariable("runtimeContext", getRuntimeContext());
        binding.setVariable(slurper.getName(), slurper.getInput());
        binding.setVariable(builder.getName(), builder);
        GroovyShell shell = new GroovyShell(getPackage().getCloudClassLoader(), binding, compilerConfig);
        Script gScript = shell.parse(mapperScript);
        gScript.run();
    }
355382
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlCapacity == null) {
			this.sarlCapacity = SarlFactory.eINSTANCE.createSarlCapacity();
			script.getXtendTypes().add(this.sarlCapacity);
			this.sarlCapacity.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlCapacity.setName(name);
			}
		}
	}
1057054
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEnumeration == null) {
			this.container = script;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			script.getXtendTypes().add(this.sarlEnumeration);
			this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
1055720
@Help(help = "Delete the Security of a NetworkServiceDescriptor with specific id")
  public void deleteSecurity(final String idNsd, final String idSecurity) throws SDKException {
    String url = idNsd + "/security" + "/" + idSecurity;
    requestDelete(url);
  }
443798
function (sspiClient) {
      if (!initializeExecutionCompleted) {
        // You cannot user process.nextTick() here as it will block all
        // I/O which means initialization in native code will never get
        // a chance to run and the process will just hang.
        setImmediate(invokeGetNextBlob, sspiClient);
      } else if (!initializeSucceeded) {
        cb(null, null, initializeErrorCode, initializeErrorString);
      } else {
        sspiClient.sspiClientImpl.getNextBlob(serverResponse, serverResponseBeginOffset, serverResponseLength,
          // Cannot use => function syntax here as that does not have the 'arguments'.
          function() {
            sspiClient.getNextBlobInProgress = false;
            cb.apply(null, arguments);
          });
      }
    }
628963
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlSkill == null) {
			this.sarlSkill = SarlFactory.eINSTANCE.createSarlSkill();
			script.getXtendTypes().add(this.sarlSkill);
			this.sarlSkill.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlSkill.setName(name);
			}
		}
	}