@ -14,6 +14,9 @@ use crate::{
RegionListResponse ,
EmailUsageResponse ,
EmailDomainListResponse ,
MonitorCheckListResponse ,
MonitorCheckTypesResponse ,
MonitorContactListResponse ,
} ,
types ::{
LNError ,
@ -114,6 +117,25 @@ pub enum RegionSubArgs {
List ( RegionListRequest ) ,
}
#[ derive(Serialize, Deserialize, Debug, clap::Subcommand) ]
pub enum MonitorCheckSubArgs {
List ( MonitorCheckListRequest ) ,
Types ( MonitorCheckTypesRequest ) ,
}
#[ derive(Serialize, Deserialize, Debug, clap::Subcommand) ]
pub enum MonitorContactSubArgs {
List ( MonitorContactListRequest ) ,
}
#[ derive(Serialize, Deserialize, Debug, clap::Subcommand) ]
pub enum MonitorSubArgs {
#[ clap(subcommand) ]
Check ( MonitorCheckSubArgs ) ,
#[ clap(subcommand) ]
Contact ( MonitorContactSubArgs ) ,
}
#[ derive(Serialize, Deserialize, Debug, clap::Parser) ]
#[ serde(untagged) ]
pub enum Args {
@ -156,6 +178,9 @@ pub enum Args {
#[ clap(subcommand) ]
/// See `lunanode email help`
Email ( EmailSubArgs ) ,
#[ clap(subcommand) ]
/// See `lunanode monitor help`
Monitor ( MonitorSubArgs ) ,
}
/// Specifies an internal function which can only be called on LunaNodeRequests whoes response type implements Debug. This could be set in the structure itself, and probably should be.
@ -170,6 +195,9 @@ where
impl Args {
pub fn make_request ( & self ) -> Result < ( ) , LNError > {
match self {
Self ::Monitor ( MonitorSubArgs ::Contact ( MonitorContactSubArgs ::List ( contact_list ) ) ) = > print_req ( contact_list ) ? ,
Self ::Monitor ( MonitorSubArgs ::Check ( MonitorCheckSubArgs ::Types ( monitor_check_types ) ) ) = > print_req ( monitor_check_types ) ? ,
Self ::Monitor ( MonitorSubArgs ::Check ( MonitorCheckSubArgs ::List ( monitor_check_list ) ) ) = > print_req ( monitor_check_list ) ? ,
Self ::SshKey ( SshKeySubArgs ::List ( ssk_list ) ) = > print_req ( ssk_list ) ? ,
Self ::Record ( RecordSubArgs ::List ( rec_list ) ) = > print_req ( rec_list ) ? ,
Self ::Network ( NetworkSubArgs ::List ( net_list ) ) = > print_req ( net_list ) ? ,
@ -241,3 +269,12 @@ pub struct EmailUsageRequest {}
#[ lunanode_request(response= " EmailDomainListResponse " , endpoint= " email/domain-list/ " ) ]
pub struct EmailDomainListRequest { }
#[ lunanode_request(response= " MonitorCheckListResponse " , endpoint= " monitor/check-list/ " ) ]
pub struct MonitorCheckListRequest { }
#[ lunanode_request(response= " MonitorCheckTypesResponse " , endpoint= " monitor/check-types/ " ) ]
pub struct MonitorCheckTypesRequest { }
#[ lunanode_request(response= " MonitorContactListResponse " , endpoint= " monitor/contact-list/ " ) ]
pub struct MonitorContactListRequest { }