client.dns_connections
इस नेमस्पेस का हर मेथड: उसका सिग्नेचर, उसके पैरामीटर, वह क्या लौटाता है और एक उदाहरण।
मेथड
The DNS provider accounts connected to the workspace, through which OpenEmail writes the records of a domain itself: list them, read what disconnecting one would leave behind, and disconnect it. Connecting one is done in the app, because the provider asks the person to sign in.
dns_connections.list
List the DNS provider accounts connected to the workspace
list(api_key: nil) -> HashReturns every DNS provider account connected to the workspace, through which OpenEmail writes the records of a domain itself, as the Providers tab of the domains page in the app shows them. Each one names the domains it serves, how many records OpenEmail wrote through it and still keeps, and whether it is active, needs connecting again (needs-reauth) or was disconnected (revoked).
configured is false when this server cannot connect a provider at all. A connection is made in the app, because the provider asks the person to sign in, so there is no method to create one.
पैरामीटर
api_keyStringOverrides the client's API key for this call only.
लौटाता है
A Hash with configured and every connection in data, an Array of Hashes, disconnected ones included.
उदाहरण
connections = client.dns_connections.list connections[:data].each do |connection| puts "#{connection[:subject]} #{connection[:status]} #{connection[:domains].length}"endटिप्पणियाँ
A GET is retried automatically on network failure and on 408, 429 and 5xx responses, up to the client's
max_retries.
इनमें भी उपलब्ध
dns_connections.get
Read a DNS connection and what disconnecting it would leave behind
get(id, api_key: nil) -> HashReturns one connection with what disconnecting it would do: the domains it serves, the records OpenEmail wrote through it, busy for the domains a sync is running on right now, which hold a disconnect back until it ends, and keepsMail for the verified domains that stop receiving mail once their records come down.
पैरामीटर
idStringआवश्यकA connection id from
list.api_keyStringOverrides the client's API key for this call only.
लौटाता है
A Hash with the fields of a connection in dns_connections.list, plus busy and keepsMail, each an Array of domain names.
उदाहरण
connection = client.dns_connections.get("dnsl_3f9a1c2e7b4d4e6f8a0b2c3d") puts "These stop receiving mail: #{connection[:keepsMail].join(", ")}" if connection[:keepsMail].any?टिप्पणियाँ
A connection id that is not in this workspace is a 404
resource_not_found.A GET is retried automatically on network failure and on 408, 429 and 5xx responses, up to the client's
max_retries.
इनमें भी उपलब्ध
dns_connections.delete
Disconnect a DNS provider account
delete(id, api_key: nil) -> HashDisconnects the account as Disconnect does in the app: the records OpenEmail wrote through it come down, every domain it serves is detached, and the connection is revoked at the provider. A verified domain whose records come down stops receiving mail, so read get first. detached counts what came down and lists the records still published, to delete by hand.
A connection that is already disconnected is removed from the list instead, once no domain and no record is left on it, and removed says so.
पैरामीटर
idStringआवश्यकA connection id from
list.api_keyStringOverrides the client's API key for this call only.
लौटाता है
A Hash for the connection with removed, confirmed and detached.
उदाहरण
result = client.dns_connections.delete("dnsl_3f9a1c2e7b4d4e6f8a0b2c3d") puts result[:removed] ? "Removed from the list" : "#{result.dig(:detached, :detached) || 0} domains detached"टिप्पणियाँ
A sync running on one of its domains is refused with 409
dns_busy, and nothing is revoked. A disconnected connection that still has domains or records on it is refused with 409dns_connection_in_use.A key or an access token limited to particular addresses or domains is refused with 422
capability_unsupported. An access token acting for a member also needsworkspace:managein their role, or it is refused with 403insufficient_authority.An OAuth access token needs a verification code for this call, and is refused with 403
step_up_requireduntil the app has verified one in the last 60 minutes.step_up_required?on the error says so. An API key is never asked for a code.Not retried by the SDK.