tooling for cloud provider (OVH) for the infrastructure : ovhcli etc ...

Virgil Ollivier 3f0ed75e33 add generated README 5 ヶ月 前
config cba634939d first commit 5 ヶ月 前
handlers f468163c97 add CreateSSHKey, DeleteSSHKey functions 5 ヶ月 前
middleware acecc9825e add source ip into middleware/logging.go 5 ヶ月 前
models.bak 906e7a3da6 move models to .bak maybe not used for the moment 5 ヶ月 前
routes f468163c97 add CreateSSHKey, DeleteSSHKey functions 5 ヶ月 前
.gitignore 218a0f5e43 add gitignore 5 ヶ月 前
README.md 3f0ed75e33 add generated README 5 ヶ月 前
go.mod 1f2846644c update go mod 5 ヶ月 前
go.sum 1f2846644c update go mod 5 ヶ月 前
main.go acecc9825e add source ip into middleware/logging.go 5 ヶ月 前

README.md

BYOM Infrastructure API

Overview

RESTful API service for OVH infrastructure management, built with Go.

Architecture

  • HTTP Server (port 8080)
  • Middleware for logging and security
  • OVH API integration
  • SSH key management system

Prerequisites

  • Go 1.x
  • OVH Account
  • Linux/Unix environment

Quick Start

git clone [repo-url]
cd byom-infra-api
go mod download
go run main.go

Environment Configuration

OVH_APPLICATION_KEY=your_key
OVH_APPLICATION_SECRET=your_secret
OVH_CONSUMER_KEY=your_consumer_key
OVH_ENDPOINT=ovh-eu

API Endpoints

SSH Keys

Method Endpoint Description
GET /sshkey List all keys
GET /sshkey/{id} Get specific key
POST /sshkey Create new key
DELETE /sshkey/{keyName} Delete key

Request Examples

# List SSH keys
curl http://localhost:8080/sshkey

# Create SSH key
curl -X POST http://localhost:8080/sshkey \
  -H "Content-Type: application/json" \
  -d '{"keyName": "mykey", "key": "ssh-ed25519 AAAA..."}'

Project Structure

byom-infra-api/
├── config/         # OVH configuration
├── handlers/       # Request handlers
├── middleware/     # HTTP middleware
├── routes/         # API routes
├── main.go        # Entry point
└── README.md      # Documentation

Development

Running Tests

go test ./...

Building

go build -o byom-api

Dependencies

  • github.com/gorilla/mux
  • github.com/ovh/go-ovh

Security

  • TLS support
  • Request logging
  • IP tracking
  • OVH authentication

License

MIT License

Contributing

  1. Fork repository
  2. Create feature branch
  3. Submit pull request