Skip to main content

remote_accesses

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

Overview​

Nameremote_accesses
TypeResource
Idovh.over_the_box.remote_accesses

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
remote_access_idstringThe id of the remote access (wire: remoteAccessId)
acceptedbooleanIf the remote access was accepted by the remote user
ask_datestring (date-time)The date of the remote access demand (wire: askDate)
authorized_bystringThe user that authorized the remote access (wire: authorizedBy)
connection_infosobjectAll the infos needed to connect yourself to your OTB (wire: connectionInfos)
deleted_atstring (date-time)When the remote access was deleted (wire: deletedAt)
docker_versionstringInfo about the docker version (wire: dockerVersion)
expiration_datestring (date-time)When the remote access will be automatically deleted (wire: expirationDate)
exposed_portintegerThe device's port which will be exposed (wire: exposedPort)
remote_user_infosobjectInfos about the remote user (wire: remoteUserInfos)
statusstringStatus of the remote access (active, creating, deleted, deleting, pendingValidation, recreating, toDelete, toRecreate)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectremote_access_id, service_nameGet a remote access of an OverTheBox service. Returns the exposed port, status, acceptance, connection information, the user who authorized it and its expiration date.
listselectservice_namex_pagination_modeList the remote accesses of an OverTheBox service. Returns the IDs of the remote accesses created to reach the device of the service.
createinsertservice_name, exposed_portCreate a remote access on an OverTheBox service. Exposes a port of the device for a remote user, until the expiration date (one day by default), from an allowed IP block.
deletedeleteremote_access_id, service_nameDelete a remote access of an OverTheBox service. Removes the remote access, and the device port is no longer exposed.
authorizeexecremoteAccessId, serviceNameAuthorize a remote access of an OverTheBox service. Allows the remote access, so that the device exposes its port to the remote user.

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"}})
remoteAccessIdstringThe id of the remote access
remote_access_idstringThe id of the remote access (wire: remoteAccessId)
serviceNamestringThe internal name of your overTheBox offer
service_namestringThe internal name of your overTheBox offer (wire: serviceName)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a remote access of an OverTheBox service. Returns the exposed port, status, acceptance, connection information, the user who authorized it and its expiration date.

SELECT
remote_access_id,
accepted,
ask_date,
authorized_by,
connection_infos,
deleted_at,
docker_version,
expiration_date,
exposed_port,
remote_user_infos,
status
FROM ovh.over_the_box.remote_accesses
WHERE remote_access_id = '{{ remote_access_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a remote access on an OverTheBox service. Exposes a port of the device for a remote user, until the expiration date (one day by default), from an allowed IP block.

INSERT INTO ovh.over_the_box.remote_accesses (
allowed_ip,
expiration_date,
exposed_port,
public_key,
service_name
)
SELECT
'{{ allowed_ip }}',
'{{ expiration_date }}',
{{ exposed_port }} /* required */,
'{{ public_key }}',
'{{ service_name }}'
RETURNING
remote_access_id,
accepted,
ask_date,
authorized_by,
connection_infos,
deleted_at,
docker_version,
expiration_date,
exposed_port,
remote_user_infos,
status
;

DELETE examples​

Delete a remote access of an OverTheBox service. Removes the remote access, and the device port is no longer exposed.

DELETE FROM ovh.over_the_box.remote_accesses
WHERE remote_access_id = '{{ remote_access_id }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Authorize a remote access of an OverTheBox service. Allows the remote access, so that the device exposes its port to the remote user.

EXEC ovh.over_the_box.remote_accesses.authorize
@remoteAccessId='{{ remoteAccessId }}' --required,
@serviceName='{{ serviceName }}' --required
;