4 use proxmox
::api
::{api, cli::*, RpcEnvironment, ApiHandler}
;
6 use proxmox_backup
::api2
;
12 schema
: OUTPUT_FORMAT
,
18 /// Read subscription info.
19 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
{
37 let cmd_def
= CliCommandMap
::new()
38 .insert("get", CliCommand
::new(&API_METHOD_GET
))
40 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_SET_SUBSCRIPTION
)
41 .fixed_param("node", "localhost".into())
45 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_CHECK_SUBSCRIPTION
)
46 .fixed_param("node", "localhost".into())
49 CliCommand
::new(&api2
::node
::subscription
::API_METHOD_DELETE_SUBSCRIPTION
)
50 .fixed_param("node", "localhost".into())