Documentation
¶
Overview ¶
Package bluecat implements a DNS record management client compatible with the libdns interfaces for Bluecat Address Manager.
Index ¶
- type BluecatResourceRecord
- type Client
- func (c *Client) Authenticate(ctx context.Context) error
- func (c *Client) CreateResourceRecord(ctx context.Context, zoneID int64, zone string, record libdns.Record) (libdns.Record, error)
- func (c *Client) DeleteResourceRecord(ctx context.Context, record libdns.Record) error
- func (c *Client) DeleteResourceRecordByID(ctx context.Context, recordID int64) error
- func (c *Client) DeployZone(ctx context.Context, zoneID int64) error
- func (c *Client) GetResourceRecordByAbsoluteName(ctx context.Context, absoluteName, recordType string) (*BluecatResourceRecord, error)
- func (c *Client) GetResourceRecords(ctx context.Context, zoneID int64, zone string) ([]libdns.Record, error)
- func (c *Client) GetZoneID(ctx context.Context, zone, configName, viewName string) (int64, error)
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BluecatResourceRecord ¶
type BluecatResourceRecord struct {
ID int64 `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
AbsoluteName string `json:"absoluteName,omitempty"`
TTL int `json:"ttl,omitempty"`
RecordType string `json:"recordType,omitempty"`
RData string `json:"rdata,omitempty"`
Text string `json:"text,omitempty"`
LinkedRecordName string `json:"linkedRecordName,omitempty"`
Priority int `json:"priority,omitempty"`
Weight int `json:"weight,omitempty"`
Port int `json:"port,omitempty"`
Addresses []struct {
Address string `json:"address"`
} `json:"addresses,omitempty"`
}
BluecatResourceRecord represents a resource record in the Bluecat API
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with the Bluecat API
func (*Client) Authenticate ¶
Authenticate authenticates with the Bluecat API and stores the token
func (*Client) CreateResourceRecord ¶
func (c *Client) CreateResourceRecord(ctx context.Context, zoneID int64, zone string, record libdns.Record) (libdns.Record, error)
CreateResourceRecord creates a new resource record in the specified zone
func (*Client) DeleteResourceRecord ¶
DeleteResourceRecord deletes a resource record
func (*Client) DeleteResourceRecordByID ¶ added in v0.1.4
DeleteResourceRecordByID deletes a resource record by its ID directly
func (*Client) DeployZone ¶ added in v0.1.1
DeployZone triggers a quick deployment of changes for a specific zone
func (*Client) GetResourceRecordByAbsoluteName ¶ added in v0.1.4
func (c *Client) GetResourceRecordByAbsoluteName(ctx context.Context, absoluteName, recordType string) (*BluecatResourceRecord, error)
GetResourceRecordByAbsoluteName searches for a resource record by its absolute name and type using BlueCat's filter API. This is useful when we need to find a record without knowing which zone it's directly under.
func (*Client) GetResourceRecords ¶
func (c *Client) GetResourceRecords(ctx context.Context, zoneID int64, zone string) ([]libdns.Record, error)
GetResourceRecords retrieves all resource records for a zone. Note: This only fetches the first page of records (up to 1000). For Caddy ACME use case, records are deleted using stored IDs, so full enumeration is not needed.
type Provider ¶
type Provider struct {
// ServerURL is the base URL of the Bluecat Address Manager server
// (e.g., "https://bluecat.example.com")
ServerURL string `json:"server_url,omitempty"`
// Username for authenticating with the Bluecat API
Username string `json:"username,omitempty"`
// Password for authenticating with the Bluecat API
Password string `json:"password,omitempty"`
// Configuration name in Bluecat (optional, defaults to first available)
ConfigurationName string `json:"configuration_name,omitempty"`
// View name in Bluecat (optional, defaults to first available)
ViewName string `json:"view_name,omitempty"`
// contains filtered or unexported fields
}
Provider facilitates DNS record manipulation with Bluecat Address Manager.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone. It returns the records that were added.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the specified records from the zone. It returns the records that were deleted. If records have BlueCat IDs in ProviderData, those are used directly. Otherwise, records are looked up by absoluteName to find their IDs.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.