Giter VIP home page Giter VIP logo

velix's Introduction

Velix

Elixir wrapper for verx package

Installation

From packages by adding velix to dependencies list mix.exs:

def deps do
  [
    {:velix, "~> 0.1.0"}
  ]
end

Examples

git clone https://github.com/sunchess/velix.git

cd velix

mix deps.get
mix deps.compile
iex -S mix

Retrive virtual machines

Velix.Vm.list

{:ok,
 %{
   running: [
     {"one-61",
      <<219, 177, 187, 102, 214, 22, 77, 2, 175, 135, 87, 105, 193, 78, 17, 61>>,
      6},
     {"one-69",
      <<37, 14, 249, 61, 43, 60, 64, 106, 179, 120, 172, 89, 19, 102, 238, 101>>,
      10},
     {"one-57",
      <<213, 198, 142, 92, 107, 184, 78, 205, 182, 130, 250, 212, 235, 67, 184,
        51>>, 5},
     {"one-65",
      <<250, 129, 29, 199, 127, 252, 68, 47, 161, 44, 243, 65, 140, 63, 218,
        78>>, 11},
     {"one-73",
      <<136, 111, 76, 103, 246, 239, 72, 4, 151, 29, 144, 66, 3, 121, 253, 191>>,
      12},
     {"one-60",
      <<214, 17, 150, 131, 186, 172, 69, 198, 147, 65, 93, 183, 46, 212, 250,
        197>>, 7}
   ],
   shutoff: []
 }}

Create a virtural machine from XML file

# if you have path to xml /root/vmsdump/test5.xml

Velix.Vm.create_xml

#or

Velix.Vm.create_xml("path/to/xml")

Active Domains: 7
{:ok, 7}

Velix.Vm.list
{:ok,
 %{
   running: [
     {"one-61",
      <<219, 177, 187, 102, 214, 22, 77, 2, 175, 135, 87, 105, 193, 78, 17, 61>>,
      6},
     {"one-69",
      <<37, 14, 249, 61, 43, 60, 64, 106, 179, 120, 172, 89, 19, 102, 238, 101>>,
      10},
     {"one-57",
      <<213, 198, 142, 92, 107, 184, 78, 205, 182, 130, 250, 212, 235, 67, 184,
        51>>, 5},
     {"one-65",
      <<250, 129, 29, 199, 127, 252, 68, 47, 161, 44, 243, 65, 140, 63, 218,
        78>>, 11},
     {"one-73",
      <<136, 111, 76, 103, 246, 239, 72, 4, 151, 29, 144, 66, 3, 121, 253, 191>>,
      12},
     {"one-60",
      <<214, 17, 150, 131, 186, 172, 69, 198, 147, 65, 93, 183, 46, 212, 250,
        197>>, 7},
     {"one-666",
      <<97, 205, 203, 18, 222, 118, 17, 231, 128, 193, 154, 33, 76, 240, 147,
        174>>, 18}
   ],
   shutoff: []
 }}

The identifier argument is virtual machine's id or name

Stop a virtual machine.

Velix.Vm.stop("one-666")
{:ok,
 {"one-666",
  <<97, 205, 203, 18, 222, 118, 17, 231, 128, 193, 154, 33, 76, 240, 147, 174>>,
  18}}

Velix.Vm.list
{:ok,
 %{
   running: [
     {"one-61",
      <<219, 177, 187, 102, 214, 22, 77, 2, 175, 135, 87, 105, 193, 78, 17, 61>>,
      6},
     {"one-69",
      <<37, 14, 249, 61, 43, 60, 64, 106, 179, 120, 172, 89, 19, 102, 238, 101>>,
      10},
     {"one-57",
      <<213, 198, 142, 92, 107, 184, 78, 205, 182, 130, 250, 212, 235, 67, 184,
        51>>, 5},
     {"one-65",
      <<250, 129, 29, 199, 127, 252, 68, 47, 161, 44, 243, 65, 140, 63, 218,
        78>>, 11},
     {"one-73",
      <<136, 111, 76, 103, 246, 239, 72, 4, 151, 29, 144, 66, 3, 121, 253, 191>>,
      12},
     {"one-60",
      <<214, 17, 150, 131, 186, 172, 69, 198, 147, 65, 93, 183, 46, 212, 250,
        197>>, 7}
   ],
   shutoff: [
     {"one-666",
      <<97, 205, 203, 18, 222, 118, 17, 231, 128, 193, 154, 33, 76, 240, 147,
        174>>, -1}
   ]
 }}

Run a virtual machine

Velix.Vm.run("one-666")
Active Domains: 7
:ok

Remove a virtual machine

Velix.Vm.remove("one-666")
:ok

Networks

Retrive networks

Velix.Net.list
{:ok,
 %{
   running: [
     {"default",
      <<61, 156, 232, 239, 226, 81, 77, 0, 156, 41, 125, 64, 107, 73, 240, 209>>}
   ],
   shutoff: []
 }}

Create a network from xml

Velix.Net.create_xml("path/to/xml")
{:ok,
 [
   {"ovs-network",
    <<103, 92, 185, 11, 103, 229, 67, 132, 157, 143, 14, 194, 93, 206, 68, 45>>}
 ]}

Velix.Net.list
{:ok,
 %{
   running: [
     {"default",
      <<61, 156, 232, 239, 226, 81, 77, 0, 156, 41, 125, 64, 107, 73, 240, 209>>},
     {"ovs-network",
      <<103, 92, 185, 11, 103, 229, 67, 132, 157, 143, 14, 194, 93, 206, 68,
        45>>}
   ],
   shutoff: []
 }}

Remove a network

Velix.Net.remove
:ok

 Velix.Net.list
{:ok,
 %{
   running: [
     {"default",
      <<61, 156, 232, 239, 226, 81, 77, 0, 156, 41, 125, 64, 107, 73, 240, 209>>}
   ],
   shutoff: []
}}

velix's People

Contributors

sunchess avatar simmsb 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.