|
|
|
@ -10,7 +10,9 @@ use crate::{
|
|
|
|
|
ZoneListResponse,
|
|
|
|
|
ZoneAddResponse,
|
|
|
|
|
ZoneRemoveResponse,
|
|
|
|
|
RecordType,
|
|
|
|
|
RecordListResponse,
|
|
|
|
|
RecordAddResponse,
|
|
|
|
|
DynListResponse,
|
|
|
|
|
DynAddResponse,
|
|
|
|
|
DynRemoveResponse,
|
|
|
|
@ -404,3 +406,33 @@ pub struct ZoneAddRequest {
|
|
|
|
|
pub struct ZoneRemoveRequest {
|
|
|
|
|
zone_id: i32,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Eq, Hash, PartialEq)]
|
|
|
|
|
#[serde(rename_all="lowercase")]
|
|
|
|
|
pub enum RecordPolicyType {
|
|
|
|
|
r#None,
|
|
|
|
|
LatLong,
|
|
|
|
|
Region,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[lunanode_request(response="RecordAddResponse", endpoint="dns2/record-add/")]
|
|
|
|
|
pub struct RecordAddRequest {
|
|
|
|
|
zone_id: i32,
|
|
|
|
|
name: String,
|
|
|
|
|
data: String,
|
|
|
|
|
ttl: i32,
|
|
|
|
|
r#type: RecordType,
|
|
|
|
|
/// The priority for certain record types, like MX and SRV.
|
|
|
|
|
aux: Option<i32>,
|
|
|
|
|
policy: Option<RecordPolicyType>,
|
|
|
|
|
/// The record weight (this is used for balancing or non-round-robin DNS failover).
|
|
|
|
|
weight: Option<i32>,
|
|
|
|
|
/// latitude if policy is `latlong`
|
|
|
|
|
latitude: Option<String>,
|
|
|
|
|
/// longitude if policy is `latlong`
|
|
|
|
|
longitude: Option<String>,
|
|
|
|
|
/// The ID of a monitor check (see `monitor check list`), this record will be disabled if the check fails.
|
|
|
|
|
monitor_id: Option<String>,
|
|
|
|
|
/// If set, update the existing record with this ID instead of creating a new record.
|
|
|
|
|
orig_record_id: Option<String>,
|
|
|
|
|
}
|
|
|
|
|