pub struct RrsetsApi<'a> { /* private fields */ }Expand description
RRset endpoints, scoped to one domain.
Implementations§
Source§impl<'a> RrsetsApi<'a>
impl<'a> RrsetsApi<'a>
Sourcepub async fn create(&self, rrset: &NewRrset) -> Result<Rrset>
pub async fn create(&self, rrset: &NewRrset) -> Result<Rrset>
POST /domains/{name}/rrsets/ — creates one RRset.
Sourcepub async fn create_bulk(&self, rrsets: &[NewRrset]) -> Result<Vec<Rrset>>
pub async fn create_bulk(&self, rrsets: &[NewRrset]) -> Result<Vec<Rrset>>
POST /domains/{name}/rrsets/ with an array — creates several RRsets atomically.
All of them are published or none are. A validation failure comes back as a
positional array; read it with
ApiError::bulk_items, whose indices line up with
rrsets.
Sourcepub fn list(&self) -> ListRequest<Rrset>
pub fn list(&self) -> ListRequest<Rrset>
GET /domains/{name}/rrsets/ — lists RRsets.
Narrow with subname and
record_type, which combine.
Sourcepub async fn get(
&self,
subname: &Subname,
record_type: &RecordType,
) -> Result<Rrset>
pub async fn get( &self, subname: &Subname, record_type: &RecordType, ) -> Result<Rrset>
GET /domains/{name}/rrsets/{subname}/{type}/ — retrieves one RRset.
Sourcepub async fn try_get(
&self,
subname: &Subname,
record_type: &RecordType,
) -> Result<Option<Rrset>>
pub async fn try_get( &self, subname: &Subname, record_type: &RecordType, ) -> Result<Option<Rrset>>
As get, with 404 mapped onto None.
Sourcepub async fn patch(
&self,
subname: &Subname,
record_type: &RecordType,
patch: &RrsetPatch,
) -> Result<Rrset>
pub async fn patch( &self, subname: &Subname, record_type: &RecordType, patch: &RrsetPatch, ) -> Result<Rrset>
PATCH …/{subname}/{type}/ — updates the fields the patch sets.
Works at the apex, and a TTL-only patch leaves the records untouched.
Sourcepub async fn replace(
&self,
subname: &Subname,
record_type: &RecordType,
ttl: u32,
records: impl IntoIterator<Item = impl Into<String>>,
) -> Result<Rrset>
pub async fn replace( &self, subname: &Subname, record_type: &RecordType, ttl: u32, records: impl IntoIterator<Item = impl Into<String>>, ) -> Result<Rrset>
PUT …/{subname}/{type}/ — replaces one RRset outright.
The body’s subname and type are taken from the same arguments that build the
path, so they cannot disagree with it.
Sourcepub async fn delete(
&self,
subname: &Subname,
record_type: &RecordType,
) -> Result<()>
pub async fn delete( &self, subname: &Subname, record_type: &RecordType, ) -> Result<()>
DELETE …/{subname}/{type}/ — deletes one RRset.
Idempotent: succeeds whether or not the RRset was there.
Sourcepub async fn patch_bulk(&self, patches: &[BulkPatch]) -> Result<Vec<Rrset>>
pub async fn patch_bulk(&self, patches: &[BulkPatch]) -> Result<Vec<Rrset>>
PATCH /domains/{name}/rrsets/ — creates, updates and deletes atomically.
The verb of choice for a mixed batch, and the only one that can delete without also supplying a TTL.
Sourcepub async fn replace_bulk(&self, rrsets: &[BulkPut]) -> Result<Vec<Rrset>>
pub async fn replace_bulk(&self, rrsets: &[BulkPut]) -> Result<Vec<Rrset>>
PUT /domains/{name}/rrsets/ — replaces RRsets atomically, creating what is
missing.
Every item needs every field, including a ttl on an item whose records is
empty. Prefer patch_bulk for deletions.
Sourcepub async fn delete_bulk(
&self,
rrsets: impl IntoIterator<Item = (Subname, RecordType)>,
) -> Result<Vec<Rrset>>
pub async fn delete_bulk( &self, rrsets: impl IntoIterator<Item = (Subname, RecordType)>, ) -> Result<Vec<Rrset>>
Deletes several RRsets in one atomic request.
Sends a bulk PATCH with empty record lists. PUT would reject the same request
for lacking a ttl.