Package codes.thischwa.cf.fluent
Interface RecordOperations
- All Known Implementing Classes:
RecordOperationsImpl
public interface RecordOperations
Fluent interface for record-level operations.
Provides a chainable API for CRUD operations on DNS records.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(RecordType type, String content, int ttl) Creates a new DNS record with the specified parameters.voiddelete(RecordType... types) Deletes DNS records of the specified types for the selected subdomain.get()Retrieves DNS records for the selected subdomain.Updates an existing DNS record with new content.
-
Method Details
-
get
Retrieves DNS records for the selected subdomain.- Returns:
- a list of RecordEntity objects matching the criteria
- Throws:
CloudflareApiException- if an error occurs while retrieving records
-
create
Creates a new DNS record with the specified parameters.- Parameters:
type- the DNS record type (e.g., A, AAAA, CNAME)content- the content of the DNS record (e.g., IP address)ttl- the time-to-live value in seconds- Returns:
- the created RecordEntity
- Throws:
CloudflareApiException- if an error occurs while creating the record
-
update
Updates an existing DNS record with new content.- Parameters:
newContent- the new content for the DNS record- Returns:
- the updated RecordEntity
- Throws:
CloudflareApiException- if an error occurs while updating the record
-
delete
Deletes DNS records of the specified types for the selected subdomain. The types passed here determine which records are deleted, independently of any type filter used to select the subdomain. If no types are specified, records of all types for that subdomain are selected for deletion. ACloudflareApiExceptionfrom an individual deletion is logged and does not stop later attempts. No per-record result is returned, so returning normally does not guarantee that all selected records were deleted.- Parameters:
types- the DNS record types to delete- Throws:
CloudflareApiException- if an error occurs while retrieving records to delete
-