Skip to main content

region_gateways

Creates, updates, deletes, gets or lists a region_gateways resource.

Overview​

Nameregion_gateways
TypeResource
Idovh.cloud_network.region_gateways

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)ID of the gateway
namestringName of the gateway
external_informationobjectExternal information (wire: externalInformation)
interfacesarrayInterfaces list of the gateway
modelstringModel of the gateway (2xl, 3xl, l, m, s, xl)
regionstringGateway region
statusstringStatus of the gateway (active, building, down, error)
typestringType fo the gateway (private, public)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, region_name, service_nameGet gateway
listselectregion_name, service_namelimit, marker, subnet_id, with_subnetsList gateways
createinsertregion_name, service_name, model, name, networkCreate new Gateway and new Private Network with new Subnet
updateupdateid, region_name, service_name, model, nameUpdate a gateway
deletedeleteid, region_name, service_nameDelete gateway
exposeexecid, regionName, service_nameExpose 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.

NameDatatypeDescription
api_hoststringThe 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"}})
idstring (uuid)Id
regionNamestringRegion name
region_namestringRegion name (wire: regionName)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
limitintegerGateway listing limit (default and max is 50)
markerstringGateway to start listing from
subnet_idstringAttached interface's subnet id (wire: subnetId)
with_subnetsbooleanInclude subnets to response (wire: withSubnets)

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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 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 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
;