# Other Functions

Diğer fonksiyonlar olarak gruplandırılan bu bölümde farklı amaçlara yönelik fonksiyonlar ele alınacaktır.

## EXEC A COMMAND ON CMDLINE

#### ins.exec(String\[] command)

inSCADA Platformunun çalıştırıldığı işletim sistemi komut satırında komut çalıştırmak için kullanılır.

String\[] command : Komut satırı komutlarının yazıldığı string dizi.

Return Value : Herhangi bir değer geri döndürmez.

## REST CALL FUNCTIONS

Merhabalar, script için yeni bir API ekledik. Başka API'ları çağırabilme inscada api'ı. Mesela ins.rest(.....) diye çağırabiliyonuz.

Input parametleri, altta gördüğünüz gibi:&#x20;

Map \<String, Object> rest(String httpMethod, String url, String contentType, Object object)

&#x20;httpMethod: "GET", "POST", "PUT", "DELETE". url: herhangi bir çağıracağınız api linki.&#x20;

contentType:  Http için Content-Type, mesela: "application/json" vs. object: bunu "POST"/"PUT" kullanırken Object göndermek için. "GET"/"DELETE" te null olarak girmeniz gerekiyor.

Bu api iki tane property dönüyor:&#x20;

{statusCode: "Http statusCode", body: "her hangi bir body"},&#x20;

body'den ulaşabilirsiniz.

### Örnekler.

"GET":&#x20;

var obj = ins.rest("GET", "<http://localhost:8081/api/projects>", "application/json", null);

ins.notify("info", obj.statusCode, obj.body\[0].name);

"POST":&#x20;

var project = { name:"project 7", ...}&#x20;

var a = ins.rest("POST", "<http://localhost:8081/api/projects>", "application/json", project);&#x20;

ins.notify("info", "New Project", a.body.name);&#x20;

"PUT":&#x20;

ins.rest("PUT", "<http://localhost:8081/api/projects/2>","application/json", project);

"DELETE":&#x20;

ins.rest("DELETE", "<http://localhost:8081/api/projects/2>", "application/json", null);

**Utility Api's :**&#x20;

* ins.getBit(Long value, Integer bitIndex )

Boolean dönüyor . Bir (value) değerin belirtilen indexteki bit değerini dönüyor

* ins.setBit(Long value, Integer bitIndex, Boolean bitValue)

Long dönüyor. Bir (value) değerin belirtilen indexteki bit değerini verilen bit değeri ile değiştirip o asıl değeri dönüyor
