remote_accesses
Creates, updates, deletes, gets or lists a remote_accesses resource.
Overview​
| Name | remote_accesses |
| Type | Resource |
| Id | ovh.over_the_box.remote_accesses |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
remote_access_id | string | The id of the remote access (wire: remoteAccessId) |
accepted | boolean | If the remote access was accepted by the remote user |
ask_date | string (date-time) | The date of the remote access demand (wire: askDate) |
authorized_by | string | The user that authorized the remote access (wire: authorizedBy) |
connection_infos | object | All the infos needed to connect yourself to your OTB (wire: connectionInfos) |
deleted_at | string (date-time) | When the remote access was deleted (wire: deletedAt) |
docker_version | string | Info about the docker version (wire: dockerVersion) |
expiration_date | string (date-time) | When the remote access will be automatically deleted (wire: expirationDate) |
exposed_port | integer | The device's port which will be exposed (wire: exposedPort) |
remote_user_infos | object | Infos about the remote user (wire: remoteUserInfos) |
status | string | Status of the remote access (active, creating, deleted, deleting, pendingValidation, recreating, toDelete, toRecreate) |
If authorized, a remote access will expose a port, allowing an access to the device remotely
| Name | Datatype | Description |
|---|---|---|
remote_access_id | string | The id of the remote access (wire: remoteAccessId) |
accepted | boolean | If the remote access was accepted by the remote user |
ask_date | string (date-time) | The date of the remote access demand (wire: askDate) |
authorized_by | string | The user that authorized the remote access (wire: authorizedBy) |
connection_infos | object | All the infos needed to connect yourself to your OTB (wire: connectionInfos) |
deleted_at | string (date-time) | When the remote access was deleted (wire: deletedAt) |
docker_version | string | Info about the docker version (wire: dockerVersion) |
expiration_date | string (date-time) | When the remote access will be automatically deleted (wire: expirationDate) |
exposed_port | integer | The device's port which will be exposed (wire: exposedPort) |
remote_user_infos | object | Infos about the remote user (wire: remoteUserInfos) |
status | string | Status of the remote access (active, creating, deleted, deleting, pendingValidation, recreating, toDelete, toRecreate) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | remote_access_id, service_name | 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. | |
list | select | service_name | x_pagination_mode | List the remote accesses of an OverTheBox service. Returns the IDs of the remote accesses created to reach the device of the service. |
create | insert | service_name, exposed_port | 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. | |
delete | delete | remote_access_id, service_name | Delete a remote access of an OverTheBox service. Removes the remote access, and the device port is no longer exposed. | |
authorize | exec | remoteAccessId, serviceName | Authorize 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.
| 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"}}) |
remoteAccessId | string | The id of the remote access |
remote_access_id | string | The id of the remote access (wire: remoteAccessId) |
serviceName | string | The internal name of your overTheBox offer |
service_name | string | The internal name of your overTheBox offer (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
List the remote accesses of an OverTheBox service. Returns the IDs of the remote accesses created to reach the device of the service.
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 service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: remote_accesses
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the remote_accesses resource.
- name: allowed_ip
value: "{{ allowed_ip }}"
description: |
IP block from which the remote access will be allowed (the default value is the IP from which the call is made)
- name: expiration_date
value: "{{ expiration_date }}"
description: |
The expirationDate of the remote access (default 1 day)
- name: exposed_port
value: {{ exposed_port }}
description: |
The port that the device will expose
- name: public_key
value: "{{ public_key }}"
description: |
The remote user public key authorized on the device (for SSH purpose)
DELETE examples​
- delete
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
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
;