region_gateways
Creates, updates, deletes, gets or lists a region_gateways resource.
Overview​
| Name | region_gateways |
| Type | Resource |
| Id | ovh.cloud_network.region_gateways |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the gateway |
name | string | Name of the gateway |
external_information | object | External information (wire: externalInformation) |
interfaces | array | Interfaces list of the gateway |
model | string | Model of the gateway (2xl, 3xl, l, m, s, xl) |
region | string | Gateway region |
status | string | Status of the gateway (active, building, down, error) |
type | string | Type fo the gateway (private, public) |
Gateway
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the gateway |
name | string | Name of the gateway |
external_information | object | External information (wire: externalInformation) |
interfaces | array | Interfaces list of the gateway |
model | string | Model of the gateway (2xl, 3xl, l, m, s, xl) |
region | string | Gateway region |
status | string | Status of the gateway (active, building, down, error) |
type | string | Type fo the gateway (private, public) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, region_name, service_name | Get gateway | |
list | select | region_name, service_name | limit, marker, subnet_id, with_subnets | List gateways |
create | insert | region_name, service_name, model, name, network | Create new Gateway and new Private Network with new Subnet | |
update | update | id, region_name, service_name, model, name | Update a gateway | |
delete | delete | id, region_name, service_name | Delete gateway | |
expose | exec | id, regionName, service_name | Expose gateway to public network by adding a public port on it. |
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 |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
id | string (uuid) | Id |
regionName | string | Region name |
region_name | string | Region name (wire: regionName) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
limit | integer | Gateway listing limit (default and max is 50) |
marker | string | Gateway to start listing from |
subnet_id | string | Attached interface's subnet id (wire: subnetId) |
with_subnets | boolean | Include subnets to response (wire: withSubnets) |
SELECT examples​
- get
- list
Get gateway
SELECT
id,
name,
external_information,
interfaces,
model,
region,
status,
type
FROM ovh.cloud_network.region_gateways
WHERE id = '{{ id }}' -- required
AND region_name = '{{ region_name }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
List gateways
SELECT
id,
name,
external_information,
interfaces,
model,
region,
status,
type
FROM ovh.cloud_network.region_gateways
WHERE region_name = '{{ region_name }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND limit = '{{ limit }}'
AND marker = '{{ marker }}'
AND subnet_id = '{{ subnet_id }}'
AND with_subnets = '{{ with_subnets }}'
;
INSERT examples​
- create
- Manifest
Create new Gateway and new Private Network with new Subnet
INSERT INTO ovh.cloud_network.region_gateways (
model,
name,
network,
region_name,
service_name
)
SELECT
'{{ model }}' /* required */,
'{{ name }}' /* required */,
'{{ network }}' /* required */,
'{{ region_name }}',
'{{ service_name }}'
RETURNING
id,
resource_id,
action,
completed_at,
created_at,
progress,
regions,
started_at,
status,
sub_operations
;
# Description fields are for documentation purposes
- name: region_gateways
props:
- name: region_name
value: "{{ region_name }}"
description: Required parameter for the region_gateways resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the region_gateways resource.
- name: model
value: "{{ model }}"
description: |
Model of the gateway
valid_values: ['2xl', '3xl', 'l', 'm', 's', 'xl']
- name: name
value: "{{ name }}"
description: |
Name of the gateway
- name: network
description: |
Information to create the network for the gateway
value:
name: "{{ name }}"
subnet:
allocationPools:
- end: "{{ end }}"
start: "{{ start }}"
cidr: "{{ cidr }}"
dnsNameServers:
- "{{ dnsNameServers }}"
enableDhcp: {{ enableDhcp }}
gatewayIp: "{{ gatewayIp }}"
hostRoutes:
- destination: "{{ destination }}"
nextHop: "{{ nextHop }}"
ipVersion: {{ ipVersion }}
name: "{{ name }}"
useDefaultPublicDNSResolver: {{ useDefaultPublicDNSResolver }}
vlanId: {{ vlanId }}
UPDATE examples​
- update
Update a gateway
UPDATE ovh.cloud_network.region_gateways
SET
model = '{{ model }}',
name = '{{ name }}'
WHERE
id = '{{ id }}' --required
AND region_name = '{{ region_name }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND model = '{{ model }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
external_information,
interfaces,
model,
region,
status,
type;
DELETE examples​
- delete
Delete gateway
DELETE FROM ovh.cloud_network.region_gateways
WHERE id = '{{ id }}' --required
AND region_name = '{{ region_name }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- expose
Expose gateway to public network by adding a public port on it.
EXEC ovh.cloud_network.region_gateways.expose
@id='{{ id }}' --required,
@regionName='{{ regionName }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;