]> git.proxmox.com Git - proxmox.git/log
proxmox.git
5 years agofixup add missing question mark
Wolfgang Bumiller [Tue, 11 Jun 2019 15:12:33 +0000 (17:12 +0200)]
fixup add missing question mark

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi: ApiMethodInfo should be Send + Sync
Wolfgang Bumiller [Mon, 10 Jun 2019 21:04:19 +0000 (23:04 +0200)]
api: ApiMethodInfo should be Send + Sync

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi: ApiFutures need to be Send
Wolfgang Bumiller [Mon, 10 Jun 2019 21:02:20 +0000 (23:02 +0200)]
api: ApiFutures need to be Send

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoformatting cleanup
Wolfgang Bumiller [Mon, 10 Jun 2019 18:05:51 +0000 (20:05 +0200)]
formatting cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agomacro: body type support for router and api macros
Wolfgang Bumiller [Mon, 10 Jun 2019 18:05:20 +0000 (20:05 +0200)]
macro: body type support for router and api macros

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agorewrite parse_object
Wolfgang Bumiller [Mon, 10 Jun 2019 12:10:01 +0000 (14:10 +0200)]
rewrite parse_object

This should support arbitrary expresion, so gobble up
elements up to the next comma and then run it through
syn::parse2.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agomacro: need to allow specifying the body type now
Wolfgang Bumiller [Sun, 9 Jun 2019 12:22:49 +0000 (14:22 +0200)]
macro: need to allow specifying the body type now

TODO:
  - change parse_object to use Punctuated for the fields to
    support longer value types (so we can use actual types
    as fields)
  - allow adding a body type to methods
  - allow adding a body type to routers explicitly

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agorename reload_timezone -> reload-timezone
Wolfgang Bumiller [Sun, 9 Jun 2019 12:22:35 +0000 (14:22 +0200)]
rename reload_timezone -> reload-timezone

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi: add generic Body parameter
Wolfgang Bumiller [Sun, 9 Jun 2019 12:04:53 +0000 (14:04 +0200)]
api: add generic Body parameter

Since we already know we'll want to be using hyper::Body and
bytes::Bytes as API output, we need to allow making routers
for each kind.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agomacro: add wildcard matching to router macro
Wolfgang Bumiller [Sat, 8 Jun 2019 16:53:03 +0000 (18:53 +0200)]
macro: add wildcard matching to router macro

router!{
    /path/{parameter}*: {
        methods...
    }
}

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agorouter: implement 'rest of the path' wildcard matching
Wolfgang Bumiller [Sat, 8 Jun 2019 11:35:05 +0000 (13:35 +0200)]
router: implement 'rest of the path' wildcard matching

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi: move router to router.rs
Wolfgang Bumiller [Sat, 8 Jun 2019 11:11:24 +0000 (13:11 +0200)]
api: move router to router.rs

We'll have a separate router for the command line, so the
http router won't live in the root module.

It is still exported at the root level, though, via
proxmox::api::Router.

Also move ApiType into api_type.rs, makes more sense.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoallow async api methods to return Response<Bytes>
Wolfgang Bumiller [Sat, 8 Jun 2019 11:05:56 +0000 (13:05 +0200)]
allow async api methods to return Response<Bytes>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agorouter: add remaining missing ::proxmox::api:: prefixes
Wolfgang Bumiller [Sat, 8 Jun 2019 08:57:50 +0000 (10:57 +0200)]
router: add remaining missing ::proxmox::api:: prefixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agocleanup
Wolfgang Bumiller [Sat, 8 Jun 2019 08:55:19 +0000 (10:55 +0200)]
cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoallow integer literals as subdirectories
Wolfgang Bumiller [Sat, 8 Jun 2019 08:53:26 +0000 (10:53 +0200)]
allow integer literals as subdirectories

eg: /api/2/ should be legal

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agouse 'quote' in router macro
Wolfgang Bumiller [Sat, 8 Jun 2019 08:52:11 +0000 (10:52 +0200)]
use 'quote' in router macro

get rid of a lot of unreadable TokenTree entries

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix missing proxmox_api -> proxmox::api replacement
Wolfgang Bumiller [Sat, 8 Jun 2019 08:51:41 +0000 (10:51 +0200)]
fix missing proxmox_api -> proxmox::api replacement

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agomacro: switch to using proxmox::api
Wolfgang Bumiller [Fri, 7 Jun 2019 15:29:12 +0000 (17:29 +0200)]
macro: switch to using proxmox::api

and fixup a `bail!` -> `::failure::bail!`

Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
5 years agocargo fmt --all
Wolfgang Bumiller [Wed, 12 Jun 2019 07:43:50 +0000 (09:43 +0200)]
cargo fmt --all

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agostart proxmox-sys module
Dietmar Maurer [Fri, 7 Jun 2019 16:01:26 +0000 (18:01 +0200)]
start proxmox-sys module

5 years agoformatting fixup
Wolfgang Bumiller [Fri, 7 Jun 2019 10:03:13 +0000 (12:03 +0200)]
formatting fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoimport proxmox-api-macro crate
Wolfgang Bumiller [Thu, 6 Jun 2019 13:21:58 +0000 (15:21 +0200)]
import proxmox-api-macro crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agotypo fixup
Wolfgang Bumiller [Thu, 6 Jun 2019 12:47:02 +0000 (14:47 +0200)]
typo fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoAdd more documentation
Wolfgang Bumiller [Thu, 6 Jun 2019 12:45:05 +0000 (14:45 +0200)]
Add more documentation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi: router test file
Wolfgang Bumiller [Thu, 6 Jun 2019 12:07:26 +0000 (14:07 +0200)]
api: router test file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd proxmox-api crate
Wolfgang Bumiller [Thu, 6 Jun 2019 12:06:20 +0000 (14:06 +0200)]
add proxmox-api crate

This contains the router and will get helpers for
generating documentation, and for parsing command line
parameters for api methods.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoinitial import, starting with vec & io helpers
Wolfgang Bumiller [Thu, 6 Jun 2019 11:47:38 +0000 (13:47 +0200)]
initial import, starting with vec & io helpers

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>