Add dyn remove, dyn add commands

master
Tait Hoyem 2 years ago
parent 6ec62dc50f
commit dcc0ad9e48

@ -1,5 +1,6 @@
use crate::{ use crate::{
responses::{ responses::{
IPAddress,
VMListResponse, VMListResponse,
BillingCreditResponse, BillingCreditResponse,
LNImageListResponse, LNImageListResponse,
@ -9,6 +10,8 @@ use crate::{
ZoneListResponse, ZoneListResponse,
RecordListResponse, RecordListResponse,
DynListResponse, DynListResponse,
DynAddResponse,
DynRemoveResponse,
SshKeyResponse, SshKeyResponse,
PlanListResponse, PlanListResponse,
RegionListResponse, RegionListResponse,
@ -53,6 +56,8 @@ pub enum SshKeySubArgs {
#[derive(Serialize, Deserialize, Debug, clap::Subcommand)] #[derive(Serialize, Deserialize, Debug, clap::Subcommand)]
pub enum DynSubArgs { pub enum DynSubArgs {
List(DynListRequest), List(DynListRequest),
Remove(DynRemoveRequest),
Add(DynAddRequest),
} }
#[derive(Serialize, Deserialize, Debug, clap::Subcommand)] #[derive(Serialize, Deserialize, Debug, clap::Subcommand)]
@ -245,7 +250,9 @@ impl Args {
Self::Image(ImageSubArgs::List(image_list)) => print_req(image_list)?, Self::Image(ImageSubArgs::List(image_list)) => print_req(image_list)?,
Self::Billing(BillingSubArgs::Credit(billing_credit)) => print_req(billing_credit)?, Self::Billing(BillingSubArgs::Credit(billing_credit)) => print_req(billing_credit)?,
Self::Zone(ZoneSubArgs::List(zone_list)) => print_req(zone_list)?, Self::Zone(ZoneSubArgs::List(zone_list)) => print_req(zone_list)?,
Self::Dyn(DynSubArgs::Add(dyn_add_req)) => print_req(dyn_add_req)?,
Self::Dyn(DynSubArgs::List(dyn_list)) => print_req(dyn_list)?, Self::Dyn(DynSubArgs::List(dyn_list)) => print_req(dyn_list)?,
Self::Dyn(DynSubArgs::Remove(dyn_del)) => print_req(dyn_del)?,
Self::Plan(PlanSubArgs::List(plan_list)) => print_req(plan_list)?, Self::Plan(PlanSubArgs::List(plan_list)) => print_req(plan_list)?,
Self::Region(RegionSubArgs::List(reg_list)) => print_req(reg_list)?, Self::Region(RegionSubArgs::List(reg_list)) => print_req(reg_list)?,
Self::Email(EmailSubArgs::Usage(email_usage)) => print_req(email_usage)?, Self::Email(EmailSubArgs::Usage(email_usage)) => print_req(email_usage)?,
@ -365,3 +372,16 @@ pub struct EmailUserSetPasswordRequest {
pub struct VmIpListRequest { pub struct VmIpListRequest {
vm_id: String, vm_id: String,
} }
#[lunanode_request(response="DynRemoveResponse", endpoint="dns/dyn-remove/")]
pub struct DynRemoveRequest {
dyn_id: i32,
}
#[lunanode_request(response="DynAddResponse", endpoint="dns/dyn-add/")]
pub struct DynAddRequest {
/// The data string for the record. This is usually a FQDN, followed by a period. If you wanted to set a record for `dev.example.org`, you would put `dev.example.com.` in this field.
name: String,
/// An ip address to associate with the FQDN. This type should be stricter: TODO.
ip: String,
}

@ -640,3 +640,9 @@ pub struct VmIp {
pub struct VmIpListResponse { pub struct VmIpListResponse {
ips: std::collections::HashMap<String, VmIp>, ips: std::collections::HashMap<String, VmIp>,
} }
#[lunanode_response]
pub struct DynRemoveResponse {}
#[lunanode_response]
pub struct DynAddResponse {}

Loading…
Cancel
Save