subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview
| Name | subscriptions |
| Type | Resource |
| Id | cloudflare.zones.subscriptions |
Fields
The following fields are returned by SELECT queries:
- list
Zone Subscription Details response
| Name | Datatype | Description |
|---|---|---|
id | string | Subscription identifier tag. (example: 506e3185e9c882d175a2d0cb0093d9f2) |
currency | string | The monetary unit in which pricing information is displayed. (example: USD) |
current_period_end | string (date-time) | The end of the current period and also when the next billing is due. (example: 2014-03-31T12:20:00Z) |
current_period_start | string (date-time) | When the current billing period started. May match initial_period_start if this is the first period. (example: 2014-05-11T12:20:00Z) |
frequency | string | How often the subscription is renewed automatically. (weekly, monthly, quarterly, yearly, not-applicable) (example: monthly) |
price | number | The price of the subscription that will be billed, in US dollars. |
rate_plan | object | The rate plan applied to the subscription. |
state | string | The state that the subscription is in. (Trial, Provisioned, Paid, AwaitingPayment, Cancelled, Failed, Expired) (example: Paid) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | Lists zone subscription details. | |
create | insert | zone_id | Create a zone subscription, either plan or add-ons. | |
update | replace | zone_id | Updates zone subscriptions, either plan or add-ons. |
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 |
|---|---|---|
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- list
Lists zone subscription details.
SELECT
id,
currency,
current_period_end,
current_period_start,
frequency,
price,
rate_plan,
state
FROM cloudflare.zones.subscriptions
WHERE zone_id = '{{ zone_id }}' -- required
;
INSERT examples
- create
- Manifest
Create a zone subscription, either plan or add-ons.
INSERT INTO cloudflare.zones.subscriptions (
frequency,
rate_plan,
zone_id
)
SELECT
'{{ frequency }}',
'{{ rate_plan }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: subscriptions
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the subscriptions resource.
- name: frequency
value: "{{ frequency }}"
description: |
How often the subscription is renewed automatically.
valid_values: ['weekly', 'monthly', 'quarterly', 'yearly']
- name: rate_plan
description: |
The rate plan applied to the subscription.
value:
currency: "{{ currency }}"
externally_managed: {{ externally_managed }}
id: "{{ id }}"
is_contract: {{ is_contract }}
public_name: "{{ public_name }}"
scope: "{{ scope }}"
sets:
- "{{ sets }}"
REPLACE examples
- update
Updates zone subscriptions, either plan or add-ons.
REPLACE cloudflare.zones.subscriptions
SET
frequency = '{{ frequency }}',
rate_plan = '{{ rate_plan }}'
WHERE
zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;