forwards_v2
GoDaddy Domains v2 API, scoped to a customer: customer_id is resolved from the GODADDY_CUSTOMER_ID environment variable when set, otherwise it is a required parameter (a WHERE value always wins). Accepts a Personal Access Token (Bearer) or a classic sso-key credential.
Overview
| Name | forwards_v2 |
| Type | Resource |
| Id | godaddy.dns.forwards_v2 |
Fields
The following fields are returned by SELECT queries:
- list
Request was successful
| Name | Datatype | Description |
|---|---|---|
fqdn | string | The fqdn (domain or sub domain) to forward (ex somedomain.com or sub.somedomain.com) |
mask | object | |
type | string | The type of forwarding to implement - MASKED — Prevents the forwarded domain or subdomain URL from displaying in the browser's address bar. - REDIRECT_PERMANENT (default) — Redirects to the url specified in the forwardTo field using a 301 Moved Permanently HTTP response. Tells user-agents (including search engines) that the location has permanently moved. - REDIRECT_TEMPORARY — Redirects to the url specified in the forwardTo field using a 302 Found HTTP response. Tells user-agents (including search engines) that the location has temporarily moved. (MASKED, REDIRECT_PERMANENT, REDIRECT_TEMPORARY) (default: REDIRECT_PERMANENT) |
url | string (url) | Forwards http(s) traffic to this destination url (ex. http://www.somedomain.com/) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | fqdn, customer_id | include_subs | Returns the forwarding configuration for the FQDN including destination URL and redirect type. Returns 404 if no forwarding rule exists. |
create | insert | fqdn, type, url, customer_id | Creates or replaces the forwarding configuration for the FQDN. Idempotent - replaying the same request produces the same rule. Returns 204 No Content. | |
replace | update | fqdn, type, url, customer_id | Updates the forwarding configuration for the FQDN. Only fields included in the request are modified. Returns 204 No Content. | |
delete | delete | fqdn, customer_id | Removes the forwarding configuration for the FQDN. Returns 204 No Content. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
customer_id | string (uuid) | GoDaddy customer identifier (UUID, not the numeric shopper number). Resolved from the GODADDY_CUSTOMER_ID environment variable when it is set (server variable, x-stackQL-envVar); otherwise required on every method of this resource. A WHERE value always takes precedence over the environment. API resellers acting on behalf of a subaccount pass the subaccount customer identifier. |
fqdn | string | The fully qualified domain name whose forwarding details are to be deleted. |
include_subs | boolean | Optionally include all sub domains if the fqdn specified is a domain and not a sub domain. (wire: includeSubs) |
SELECT examples
- list
Returns the forwarding configuration for the FQDN including destination URL and redirect type. Returns 404 if no forwarding rule exists.
SELECT
fqdn,
mask,
type,
url
FROM godaddy.dns.forwards_v2
WHERE fqdn = '{{ fqdn }}' -- required
AND customer_id = '{{ customer_id }}' -- required unless GODADDY_CUSTOMER_ID is set
AND include_subs = '{{ include_subs }}'
;
INSERT examples
- create
- Manifest
Creates or replaces the forwarding configuration for the FQDN. Idempotent - replaying the same request produces the same rule. Returns 204 No Content.
INSERT INTO godaddy.dns.forwards_v2 (
type,
url,
mask,
fqdn
)
SELECT
'{{ type }}' /* required */,
'{{ url }}' /* required */,
'{{ mask }}',
'{{ fqdn }}'
;
# Description fields are for documentation purposes
- name: forwards_v2
props:
- name: fqdn
value: "{{ fqdn }}"
description: Required parameter for the forwards_v2 resource.
- name: type
value: "{{ type }}"
description: |
The type of forwarding to implement
- **MASKED** — Prevents the forwarded domain or subdomain URL from displaying in the browser's address bar.
- **REDIRECT_PERMANENT** (default) — Redirects to the url specified in the forwardTo field using a `301 Moved Permanently` HTTP response. Tells user-agents (including search engines) that the location has permanently moved.
- **REDIRECT_TEMPORARY** — Redirects to the url specified in the forwardTo field using a `302 Found` HTTP response. Tells user-agents (including search engines) that the location has temporarily moved.
valid_values: ['MASKED', 'REDIRECT_PERMANENT', 'REDIRECT_TEMPORARY']
default: REDIRECT_PERMANENT
- name: url
value: "{{ url }}"
description: |
Forwards http(s) traffic to this destination url (ex. http://www.somedomain.com/)
- name: mask
value:
title: "{{ title }}"
description: "{{ description }}"
keywords: "{{ keywords }}"
UPDATE examples
- replace
Updates the forwarding configuration for the FQDN. Only fields included in the request are modified. Returns 204 No Content.
UPDATE godaddy.dns.forwards_v2
SET
type = '{{ type }}',
url = '{{ url }}',
mask = '{{ mask }}'
WHERE
fqdn = '{{ fqdn }}' --required
AND type = '{{ type }}' --required
AND url = '{{ url }}' --required;
DELETE examples
- delete
Removes the forwarding configuration for the FQDN. Returns 204 No Content.
DELETE FROM godaddy.dns.forwards_v2
WHERE fqdn = '{{ fqdn }}' --required
AND customer_id = '{{ customer_id }}' -- required unless GODADDY_CUSTOMER_ID is set
;