# System Functions

System functions are used to access the hardware resources on which the inSCADA Platform is running. It is also used to shut down, restart, and manage the list of requests made from the system.

## Get System Requests

#### ins.getSystemRequests()

It receives a list of requests received to the system.

Return Value: Returns a list of requests to the system as an array.

#### Syntax

```javascript
var requests=ins.getSystemRequests();
var i=0;
if (requests!==null) { return -1}; 
if (requests.length>0) {      // check new a req

    for (i=0;i<requests.length;i++) {
    
        switch (requests[i].type) {
            case "warm_restart":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            case "cold_restart":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            case "set_date_time":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            default:
            // undefined System Requests
            ins.deleteSystemRequests(requests[i]);
            break;
        }
    }
}
```

## Delete System Requests

#### ins.deleteSystemRequests(object requests)

Deletes a request to the system.

object requests: The request object in the list.

#### Syntax <a href="#syntax-1" id="syntax-1"></a>

```javascript
var requests=ins.getSystemRequests();
var i=0;
if (requests!==null) { return -1}; 
if (requests.length>0) {      // check new a req

    for (i=0;i<requests.length;i++) {
    
        switch (requests[i].type) {
            case "warm_restart":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            case "cold_restart":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            case "set_date_time":
            // to do
            ins.deleteSystemRequests(requests[i]);
            break;
            
            default:
            // undefined System Requests
            ins.deleteSystemRequests(requests[i]);
            break;
        }
    }
}
```

## Get System Status

#### ins.getSystemStats()

It gives information about the system resources and usage amounts.

Return Value: Does not return any value.

#### Syntax

```javascript
var system=ins.getSystemStats();
return system;
```

## Shutdown System

#### ins.shutdown() <a href="#ins-shutdown" id="ins-shutdown"></a>

Turns off the system.

Return Value: Does not return any value.

#### Syntax

```javascript
ins.shutdown();
```

## Restart System

#### ins.restart() <a href="#ins-restart" id="ins-restart"></a>

Restarts the system.

Return Value: Does not return any value.

#### Syntax

```javascript
ins.restart();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://inscada.gitbook.io/ins/en-1/programing/apis/system-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
