GithubHelp home page GithubHelp logo

duzhanyuan / manageserverapi1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intecture/api

0.0 2.0 0.0 1.37 MB

An API for managing your servers

Home Page: http://intecture.io

License: Mozilla Public License 2.0

Rust 100.00%

manageserverapi1's Introduction

Intecture APIs Build Status Coverage Status Gitter

Intecture is an API for managing your servers. Visit intecture.io.

API docs can be found here: intecture.io/api/intecture_api/.


Intecture's APIs (cough and a binary) are the heart and soul of Intecture. Check out each component's README.md for details:

  • core - The core API that does all the heavy lifting
  • bindings - Rust FFI and language bindings
  • proj - Helpers and boilerplate for building Intecture projects
  • agent - Tiny daemon that exposes the core API as a service (for your hosts!)

Getting started

Intecture is pretty light on external dependencies. In fact, all you'll need to get started is Rust!

Once you've installed Rust, create a new Cargo binary project:

cargo new --bin

Next, add Intecture to your Cargo.toml:

[dependencies]
futures = "0.1"
intecture_api = {git = "https://github.com/intecture/api", version = "0.4"}
tokio-core = "0.1"

This is all we need to do if we only want to manage the local machine. Just make sure you use the Local host type, like so:

// You can ignore these two lines. They are boilerplate from `tokio-core` that
// drive Intecture's asynchronous API.
let mut core = Core::new().unwrap();
let handle = core.handle();

let host = Local::new(&handle).and_then(|host| {
    // Do stuff on the local host...
});

// You can ignore this line. It is more `tokio-core` boilerplate.
core.run(host).unwrap();

You can find some basic examples here: core/examples. Also you should refer to the API docs: intecture.io/api/intecture_api/

For remote hosts only

To manage a remote machine with Intecture, you need to take a few extra steps. On the remote machine...

Install Rust.

Clone this GitHub repository:

git clone https://github.com/intecture/api

Build the project:

cd api && cargo build --release

Then run the agent, specifying an address to bind to:

target/release/intecture_agent --address 0.0.0.0:7101

Remember, the agent must be running in order for the API to connect to this host.

Finally we can get back to what we came here for - Rust codez! To manage this machine, make sure you use the Plain remote host type, like so:

let host = Plain::connect("<ip_of_host>:7101").and_then(|host| {
    // Do stuff on the remote host...
});

Note the type is Plain, rather than Remote. At the moment, Intecture does no encryption, making it unsafe for use over insecure networks (i.e. the internet). The type Plain signifies this. In the future we will add support for encrypted remote host types as well, but for now, we cannot recommend strongly enough that you only use this on a secure local network.

What's new?

Check out RELEASES.md for details.

manageserverapi1's People

Contributors

petehayes102 avatar rushmorem avatar

Watchers

James Cloos avatar netgod avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.