4 use proxmox_router
::{cli::*, ApiHandler, RpcEnvironment}
;
5 use proxmox_schema
::api
;
7 use proxmox_backup
::api2
;
13 schema
: OUTPUT_FORMAT
,
19 /// Read subscription info.
20 fn get(param
: Value
, rpcenv
: &mut dyn RpcEnvironment
) -> Result
<Value
, Error
> {
21 let output_format
= get_output_format(¶m
);
23 let info
= &api2
::node
::subscription
::API_METHOD_GET_SUBSCRIPTION
;
24 let mut data
= match info
.handler
{
25 ApiHandler
::Sync(handler
) => (handler
)(param
, info
, rpcenv
)?
,
29 let options
= default_table_format_options();
30 format_and_print_result_full(&mut data
, &info
.returns
, &output_format
, &options
);
35 pub fn subscription_commands() -> CommandLineInterface
{
36 let cmd_def
= CliCommandMap
::new()
37 .insert("get", CliCommand
::new(&API_METHOD_GET
))
40 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_SET_SUBSCRIPTION
)
41 .fixed_param("node", "localhost".into())
46 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_CHECK_SUBSCRIPTION
)
47 .fixed_param("node", "localhost".into()),
51 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_DELETE_SUBSCRIPTION
)
52 .fixed_param("node", "localhost".into()),