306 Commits

Author SHA1 Message Date
Dietmar Maurer
4c741b67c7 api: add dump_enum_properties(), make dump_api_parameter pub 2021-02-08 09:13:55 +01:00
Dietmar Maurer
0bc93f5695 bump proxmox to 0.10.2-1 2021-02-05 12:37:11 +01:00
Dietmar Maurer
d014c6f2d1 CliCommandMap: add usage_skip_options to suppress options in generate_usage_str()
This is useful for commands where sub-commands all takes the same options.
You can supress them in the generated manual pages (printdoc), and instead
document them somewhere else.
2021-02-05 12:37:11 +01:00
Wolfgang Bumiller
cc520cd4a0 cleanup: remove serde_derive dependency
this comes from the 'derive' feature in serde

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-04 11:43:22 +01:00
Wolfgang Bumiller
9ee0276f13 doc fixup
not sure if it's worth looking up that link?

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
034dd3fe5e updaters: docs and exports
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
ab06665649 schema: introduce Updatable and Updater traits
The `Updatable` trait is our mechanism for "updating"
values. The `Updater` trait is a serde-helper to allow using
`skip_serializing_if` on api type structs which
`#[derive(Updater)]`

All basic types implement `Updatable<Updater = Option<T>>`,
and all `Option<T>` where `T: Updatable` are implicitly also
updatable from `Option<T>`.

With the update to the `#[api]` macro, all `#[api]` types
will implicitly `#[derive(Updatable)]` via the default
implementation (which simply assignes from an
`Option<Self>`), unless they explicitly also
`#[derive(Updater)]` in which case an implementation is
derived which goes through each "field" found in the
updater. To prevent fields from being updatable via an
Updater `#[updater(fixed)]` can be used.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
237f206235 schema: fix AllOf property iteration for nested objects
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:00 +01:00
Wolfgang Bumiller
544c7e7171 schema: support AllOf in ExtractValueDeserializer
fixes nested AllOfs in api methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:53:33 +01:00
Dietmar Maurer
aad324c38b bump proxmox to 0.10.1-1 2021-02-03 08:31:40 +01:00
Dietmar Maurer
3b4f6f2d35 cli: improve completion of array arguments 2021-02-03 08:28:27 +01:00
Fabian Grünbichler
dc5b2bebf1 debcargo: fix maintainer directive
and remove accidentally committed files

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-01 11:26:33 +01:00
Fabian Grünbichler
c09d8e1442 clippy: use std::ptr::null
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 15:04:49 +01:00
Wolfgang Bumiller
2f7b0872ea clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-15 14:20:55 +01:00
Fabian Grünbichler
d44c032dd5 bump proxmox to 0.10.0-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 15:43:19 +01:00
Fabian Grünbichler
43e9cf10af move ParameterSchema from router to schema
it's the place where it belongs, and unbreaks the --no-default-features
build

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-13 13:40:04 +01:00
Wolfgang Bumiller
a5b8f9d340 fix u2f example
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-13 11:29:33 +01:00
Fabian Grünbichler
e05dd0074d tokio 1.0: drop TimeoutFutureExt
tokio's Sleep/Delay/Timeout are no longer Unpin, complicating this
wrapper. we can just use tokio::time::timeout directly as needed..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
0319030ed9 update to tokio 1.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
c65246e9bd update to rustyline 7
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
27799ccb6d Cargo.toml: update to tokio 1.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
4d93fa0666 time: fix parsing non-full-hour TZ offsets
and add a test case to avoid regressions in the future.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-12-31 08:26:47 +01:00
Dietmar Maurer
04417d1df5 update control files, fix changelogs 2020-12-22 13:29:09 +01:00
Dietmar Maurer
43e0e6c7de update proxmox to 0.9.1-1 2020-12-22 13:25:56 +01:00
Stefan Reiter
78aacb67da add tools::future with TimeoutFutureExt
Implements shorthands to automatically cancel a long-running future
after a timeout is reached.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-12-22 13:24:36 +01:00
Dietmar Maurer
b53de8b7c0 proxmox: correctly depend on proxmox-api-macro 0.3 2020-12-22 08:06:02 +01:00
Dietmar Maurer
f6e7463ec1 bump versions to 0.9.0-1/0.3.0-1 2020-12-22 07:54:32 +01:00
Wolfgang Bumiller
630fd801d2 proxmox changelog update
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:27:11 +01:00
Wolfgang Bumiller
a9318a43aa proxmox: temporary d/changelog update
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:26:29 +01:00
Wolfgang Bumiller
3d1432a788 schema: ParameterSchema at 'api' level
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:23:33 +01:00
Wolfgang Bumiller
de749b1a52 schema: ExtractValueDeserializer
A deserializer which takes an `&mut Value` and an object
schema reference and deserializes by extracting (removing)
the values from the references serde Value.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:20:05 +01:00
Wolfgang Bumiller
0cdd47c8fc schema: allow AllOf schema as method parameter
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:17:47 +01:00
Wolfgang Bumiller
3f490368cf schema: support AllOf schemas
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:03:37 +01:00
Wolfgang Bumiller
e8998851f8 schema: support optional return values
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:02:17 +01:00
Wolfgang Bumiller
89a3dd5b1f formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:00:46 +01:00
Wolfgang Bumiller
84d0859ddb document forward_de/serialize_to_display/from_str
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-09 10:19:59 +01:00
Wolfgang Bumiller
4a0f06d084 doc fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-09 10:18:58 +01:00
Hannes Laimer
9de5b2a58e correct email in changelog
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-12-07 11:43:11 +01:00
Dietmar Maurer
c9c28f7631 bump proxmox version to 0.8.1-1 2020-12-06 09:08:41 +01:00
Dietmar Maurer
c7be237b57 trait ReadExt: add read_exact_or_eof and skip_to_end 2020-12-06 09:05:26 +01:00
Wolfgang Bumiller
a793453944 proxmox: fix example array in Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-03 09:58:02 +01:00
Fabian Grünbichler
cce052e97f build: track d/control in git
and check build-dependencies before building..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-30 15:13:01 +01:00
Wolfgang Bumiller
09b2a5961e bump proxmox to 0.8.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-11-30 11:18:57 +01:00
Wolfgang Bumiller
194f2605e4 minor clippy lints
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-11-30 11:18:37 +01:00
Wolfgang Bumiller
3d29fbf15e introduce FdRef and BorrowedFd
Types used to reprecent borrowed raw file descriptors.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-11-30 10:48:05 +01:00
Wolfgang Bumiller
2216b348a1 make_tmp_file: properly guard file descriptor
and return an Fd

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-11-30 09:43:00 +01:00
Fabian Grünbichler
b210ad69eb run 'cargo fmt'
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-27 11:43:55 +01:00
Fabian Grünbichler
97509b63ad fix clippy warnings
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-27 11:43:21 +01:00
Dietmar Maurer
1d2a0d9e81 bump version to 0.7.2-1 2020-11-24 13:24:11 +01:00
Dietmar Maurer
e7cb1f20d0 implement cli command alias feature 2020-11-24 12:44:54 +01:00