Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mt190502 committed Sep 6, 2023
1 parent df85f3c commit 0e632da
Show file tree
Hide file tree
Showing 26 changed files with 705 additions and 446 deletions.
80 changes: 66 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,70 @@
## Kurulum
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![GPL License][license-shield]][license-url]

- `%PROGRAMFILES%\hyper-v-rest` klasörü oluşturulur.
- `hyper-v-rest.exe` dosyası, `%PROGRAMFILES%\hyper-v-rest` klasörüne kopyalanır.
- Windows PowerShell, yönetici olarak açılır ve aşağıdaki komutlar çalıştırılır:
[![Readme in English](https://img.shields.io/badge/Readme-English-blue)](README.md)
[![Readme in Turkish](https://img.shields.io/badge/Readme-Turkish-red)](README.tr.md)

cd "$env:PROGRAMFILES\hyper-v-rest"
.\hyper-v-rest.exe --service=install
.\hyper-v-rest.exe --service=start
<div align="center">
<a href="https://mono.net.tr/">
<img src="https://monobilisim.com.tr/images/mono-bilisim.svg" width="340"/>
</a>

## Kullanım
<h2 align="center">hyper-v-api-wmi</h2>
<b>hyper-v-api-wmi</b> is a tool for accessing Hyper-V VM information through RESTful APIs.
</div>

- Tüm VM'ler: `/vms`
- Processor sayısı ve GuestOS: `/vms/<Name>/summary`
- Memory: `/vms/<Name>/memory`
- Disk bilgisi `/vms/<Name>/vhd`
- IP numaraları `/vms/<Name>/ip`
- Versiyon: `/version`
---

## Table of Contents

- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

---

## Installation

1. Create the `%PROGRAMFILES%\hyper-v-rest-ps` directory.
2. Copy the `hyper-v-rest-ps.exe` file to the `%PROGRAMFILES%\hyper-v-rest-ps` directory.
3. Open Windows PowerShell as an administrator and execute the following commands:

```powershell
PS C:\WINDOWS\system32> cd "$env:PROGRAMFILES\hyper-v-rest-ps"
PS C:\Program Files\hyper-v-rest-ps> .\hyper-v-rest-ps.exe --service=install
PS C:\Program Files\hyper-v-rest-ps> .\hyper-v-rest-ps.exe --service=start
```

## Usage

- All virtual machines: `/vms`
- CPU information: `/vms/<VM-ID>/processor`
- CPU information for all virtual machines: `/vms/all/processor`
- RAM information: `/vms/<VM-ID>/memory`
- RAM information for all virtual machines: `/vms/all/memory`
- Disk information: `/vms/<VM-ID>/vhd`
- Disk information for all virtual machines: `/vms/all/vhd`
- Network information: `/vms/<VM-ID>/network`
- Network information for all virtual machines: `/vms/all/network`
- Version: `/version`

---

## License

hyper-v-rest-ps is GPL-3.0 licensed. See [LICENSE](LICENSE) file for details.

[contributors-shield]: https://img.shields.io/github/contributors/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[contributors-url]: https://github.com/monobilisim/hyper-v-rest-ps/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[forks-url]: https://github.com/monobilisim/hyper-v-rest-ps/network/members
[stars-shield]: https://img.shields.io/github/stars/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[stars-url]: https://github.com/monobilisim/hyper-v-rest-ps/stargazers
[issues-shield]: https://img.shields.io/github/issues/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[issues-url]: https://github.com/monobilisim/hyper-v-rest-ps/issues
[license-shield]: https://img.shields.io/github/license/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[license-url]: https://github.com/monobilisim/hyper-v-rest-ps/blob/master/LICENSE
70 changes: 70 additions & 0 deletions README.tr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![GPL License][license-shield]][license-url]

[![Readme in English](https://img.shields.io/badge/Readme-English-blue)](README.md)
[![Readme in Turkish](https://img.shields.io/badge/Readme-Turkish-red)](README.tr.md)

<div align="center">
<a href="https://mono.net.tr/">
<img src="https://monobilisim.com.tr/images/mono-bilisim.svg" width="340"/>
</a>

<h2 align="center">hyper-v-api-wmi</h2>
<b>hyper-v-api-wmi</b> Hyper-V sanal makine bilgilerine RESTful API'lar aracılığıyla erişim sağlamak için bir araçtır.
</div>

---

## İçindekiler

- [İçindekiler](#i̇çindekiler)
- [Kurulum](#kurulum)
- [Kullanım](#kullanım)
- [Lisans](#lisans)

---

## Kurulum

1. `%PROGRAMFILES%\hyper-v-rest-ps` dizinini oluşturun.
2. `hyper-v-rest-ps.exe` dosyasını `%PROGRAMFILES%\hyper-v-rest-ps` dizinine kopyalayın.
3. Yönetici olarak Windows PowerShell'i açın ve aşağıdaki komutları çalıştırın:

```powershell
PS C:\WINDOWS\system32> cd "$env:PROGRAMFILES\hyper-v-rest-ps"
PS C:\Program Files\hyper-v-rest-ps> .\hyper-v-rest-ps.exe --service=install
PS C:\Program Files\hyper-v-rest-ps> .\hyper-v-rest-ps.exe --service=start
```

## Kullanım

- Tüm sanal makineler: `/vms`
- CPU bilgileri: `/vms/<VM-ID>/processor`
- Tüm sanal makinelerin CPU bilgileri: `/vms/all/processor`
- RAM bilgileri: `/vms/<VM-ID>/memory`
- Tüm sanal makinelerin RAM bilgileri: `/vms/all/memory`
- Disk bilgileri: `/vms/<VM-ID>/vhd`
- Tüm sanal makinelerin disk bilgileri: `/vms/all/vhd`
- Ağ bilgileri: `/vms/<VM-ID>/network`
- Tüm sanal makinelerin ağ bilgileri: `/vms/all/network`
- Sürüm: `/version`

---

## Lisans

hyper-v-rest-ps, GPL-3.0 lisanslıdır. Detaylar için [LICENSE](LICENSE) dosyasına bakınız.

[contributors-shield]: https://img.shields.io/github/contributors/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[contributors-url]: https://github.com/monobilisim/hyper-v-rest-ps/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[forks-url]: https://github.com/monobilisim/hyper-v-rest-ps/network/members
[stars-shield]: https://img.shields.io/github/stars/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[stars-url]: https://github.com/monobilisim/hyper-v-rest-ps/stargazers
[issues-shield]: https://img.shields.io/github/issues/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[issues-url]: https://github.com/monobilisim/hyper-v-rest-ps/issues
[license-shield]: https://img.shields.io/github/license/monobilisim/hyper-v-rest-ps.svg?style=for-the-badge
[license-url]: https://github.com/monobilisim/hyper-v-rest-ps/blob/master/LICENSE
1 change: 1 addition & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
port: 8080
49 changes: 35 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
module hyper-v-rest
module hyper-v-rest-wmi

go 1.18
go 1.20

require (
github.com/StackExchange/wmi v1.2.1
github.com/gorilla/mux v1.8.0
github.com/bhendo/go-powershell v0.0.0-20190719160123-219e7fb4e41e
github.com/gin-gonic/gin v1.9.1
github.com/kardianos/service v1.2.2
github.com/spf13/viper v1.14.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.16.0
)

require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/errors v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
golang.org/x/text v0.4.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 0e632da

Please sign in to comment.