Skip to content

eusuntcarol/rust-web-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Agent

Implement a web agent service that monitors a server.

Routes

/status

Method: GET

{
    "cpus": 2,
    "memory": {
        "total": 100,
        "used": 30
    },
    "uptime": 10,
    "usage": 30
}

/cpus

List the cpus

Method: GET

[
    {
        "model": "cpu model",
        "manufacturer": "cpu manufacturer",
        "speed": 1000,
        "usage": 30
    }
]

/cpus/<cpu_number>

List the information about one cpu

Methods: GET

{
    "model": "cpu model",
    "manufacturer": "cpu manufacturer",
    "speed": 1000,
    "usage": 30
}

/processes

Return the list of processes PIDs

[
    1, 2, 3, 46, 110234, ...
]

/processes/<pid>

Return information about a process

{
    "command": "....",
    "arguments": ["...", "..."],
    "memory": {
        "vsz": 1000,
        "rss": 300
    }
}

/processes/kill/<pid>

Stop a process

{
    "status": "ok or error",
    "erroor": 0
}

/processes/start

Method POST

{
    "command": "command to run",
    "arguments": ["argument1", "argument2"],
    "environment" {
        "variable1": "value",
        "variable2": "value",
        "variable3": "value"
    }
}

Response

{
    "status": "ok or error",
    "error": 0
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages