Bastion Functions

Package: DBMS_CLOUD_OCI_BT_BASTION

CHANGE_BASTION_COMPARTMENT Function

Moves a bastion into a different compartment.

Syntax

FUNCTION change_bastion_compartment (
  bastion_id varchar2,
  change_bastion_compartment_details dbms_cloud_oci_bastion_change_bastion_compartment_details_t,
  if_match varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_change_bastion_compartment_response_t;

Parameters

Parameter Description

bastion_id

(required) The unique identifier (OCID) of the bastion.

change_bastion_compartment_details

(required) The compartment information to be updated.

if_match

(optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

CREATE_BASTION Function

Creates a new bastion. A bastion provides secured, public access to target resources in the cloud that you cannot otherwise reach from the internet. A bastion resides in a public subnet and establishes the network infrastructure needed to connect a user to a target resource in a private subnet.

Syntax

FUNCTION create_bastion (
  create_bastion_details dbms_cloud_oci_bastion_create_bastion_details_t,
  opc_retry_token varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_create_bastion_response_t;

Parameters

Parameter Description

create_bastion_details

(required) Details for the new bastion.

opc_retry_token

(optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

CREATE_SESSION Function

Creates a new session in a bastion. A bastion session lets authorized users connect to a target resource for a predetermined amount of time. The Bastion service recognizes two types of sessions, managed SSH sessions and SSH port forwarding sessions. Managed SSH sessions require that the target resource has an OpenSSH server and the Oracle Cloud Agent both running.

Syntax

FUNCTION create_session (
  create_session_details dbms_cloud_oci_bastion_create_session_details_t,
  opc_retry_token varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_create_session_response_t;

Parameters

Parameter Description

create_session_details

(required) Details for the new session.

opc_retry_token

(optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

DELETE_BASTION Function

Deletes a bastion identified by the bastion ID.

Syntax

FUNCTION delete_bastion (
  bastion_id varchar2,
  if_match varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_delete_bastion_response_t;

Parameters

Parameter Description

bastion_id

(required) The unique identifier (OCID) of the bastion.

if_match

(optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

DELETE_SESSION Function

Deletes a session identified by the session ID.

Syntax

FUNCTION delete_session (
  session_id varchar2,
  if_match varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_delete_session_response_t;

Parameters

Parameter Description

session_id

(required) The unique identifier (OCID) of the session.

if_match

(optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

GET_BASTION Function

Retrieves a bastion identified by the bastion ID. A bastion provides secured, public access to target resources in the cloud that you cannot otherwise reach from the internet.

Syntax

FUNCTION get_bastion (
  bastion_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_get_bastion_response_t;

Parameters

Parameter Description

bastion_id

(required) The unique identifier (OCID) of the bastion.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

GET_SESSION Function

Retrieves a session identified by the session ID. A bastion session lets authorized users connect to a target resource for a predetermined amount of time.

Syntax

FUNCTION get_session (
  session_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_get_session_response_t;

Parameters

Parameter Description

session_id

(required) The unique identifier (OCID) of the session.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

GET_WORK_REQUEST Function

Gets the status of the work request with the given ID.

Syntax

FUNCTION get_work_request (
  work_request_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_get_work_request_response_t;

Parameters

Parameter Description

work_request_id

(required) The unique identifier (OCID) of the asynchronous request.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

LIST_BASTIONS Function

Retrieves a list of BastionSummary objects in a compartment. Bastions provide secured, public access to target resources in the cloud that you cannot otherwise reach from the internet.

Syntax

FUNCTION list_bastions (
  compartment_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  bastion_lifecycle_state varchar2 DEFAULT NULL,
  bastion_id varchar2 DEFAULT NULL,
  name varchar2 DEFAULT NULL,
  limit number DEFAULT NULL,
  page varchar2 DEFAULT NULL,
  sort_order varchar2 DEFAULT NULL,
  sort_by varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_list_bastions_response_t;

Parameters

Parameter Description

compartment_id

(required) The unique identifier (OCID) of the compartment in which to list resources.

opc_request_id

(optional) The client request ID for tracing.

bastion_lifecycle_state

(optional) A filter to return only resources their lifecycleState matches the given lifecycleState.

Allowed values are: 'CREATING', 'UPDATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'

bastion_id

(optional) The unique identifier (OCID) of the bastion in which to list resources.

name

(optional) A filter to return only resources that match the entire name given.

limit

(optional) The maximum number of items to return.

page

(optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

sort_order

(optional) The sort order to use, either 'asc' or 'desc'.

Allowed values are: 'ASC', 'DESC'

sort_by

(optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending. If no value is specified timeCreated is default.

Allowed values are: 'timeCreated', 'name'

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

LIST_SESSIONS Function

Retrieves a list of SessionSummary objects for an existing bastion. Bastion sessions let authorized users connect to a target resource for a predetermined amount of time.

Syntax

FUNCTION list_sessions (
  bastion_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  display_name varchar2 DEFAULT NULL,
  session_lifecycle_state varchar2 DEFAULT NULL,
  session_id varchar2 DEFAULT NULL,
  limit number DEFAULT NULL,
  page varchar2 DEFAULT NULL,
  sort_order varchar2 DEFAULT NULL,
  sort_by varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_list_sessions_response_t;

Parameters

Parameter Description

bastion_id

(required) The unique identifier (OCID) of the bastion in which to list sessions.

opc_request_id

(optional) The client request ID for tracing.

display_name

(optional) A filter to return only resources that match the entire display name given.

session_lifecycle_state

(optional) A filter to return only resources their lifecycleState matches the given lifecycleState.

Allowed values are: 'CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'

session_id

(optional) The unique identifier (OCID) of the session in which to list resources.

limit

(optional) The maximum number of items to return.

page

(optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

sort_order

(optional) The sort order to use, either 'asc' or 'desc'.

Allowed values are: 'ASC', 'DESC'

sort_by

(optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.

Allowed values are: 'timeCreated', 'displayName'

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

LIST_WORK_REQUEST_ERRORS Function

Return a (paginated) list of errors for a given work request.

Syntax

FUNCTION list_work_request_errors (
  work_request_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  page varchar2 DEFAULT NULL,
  limit number DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_list_work_request_errors_response_t;

Parameters

Parameter Description

work_request_id

(required) The unique identifier (OCID) of the asynchronous request.

opc_request_id

(optional) The client request ID for tracing.

page

(optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

limit

(optional) The maximum number of items to return.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

LIST_WORK_REQUEST_LOGS Function

Return a (paginated) list of logs for a given work request.

Syntax

FUNCTION list_work_request_logs (
  work_request_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  page varchar2 DEFAULT NULL,
  limit number DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_list_work_request_logs_response_t;

Parameters

Parameter Description

work_request_id

(required) The unique identifier (OCID) of the asynchronous request.

opc_request_id

(optional) The client request ID for tracing.

page

(optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

limit

(optional) The maximum number of items to return.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

LIST_WORK_REQUESTS Function

Lists the work requests in a compartment.

Syntax

FUNCTION list_work_requests (
  compartment_id varchar2,
  opc_request_id varchar2 DEFAULT NULL,
  page varchar2 DEFAULT NULL,
  limit number DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_list_work_requests_response_t;

Parameters

Parameter Description

compartment_id

(required) The unique identifier (OCID) of the compartment in which to list resources.

opc_request_id

(optional) The client request ID for tracing.

page

(optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

limit

(optional) The maximum number of items to return.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

UPDATE_BASTION Function

Updates the bastion identified by the bastion ID. A bastion provides secured, public access to target resources in the cloud that you cannot otherwise reach from the internet.

Syntax

FUNCTION update_bastion (
  bastion_id varchar2,
  update_bastion_details dbms_cloud_oci_bastion_update_bastion_details_t,
  if_match varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_update_bastion_response_t;

Parameters

Parameter Description

bastion_id

(required) The unique identifier (OCID) of the bastion.

update_bastion_details

(required) The bastion information to be updated.

if_match

(optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.

UPDATE_SESSION Function

Updates the session identified by the session ID. A bastion session lets authorized users connect to a target resource for a predetermined amount of time.

Syntax

FUNCTION update_session (
  session_id varchar2,
  update_session_details dbms_cloud_oci_bastion_update_session_details_t,
  if_match varchar2 DEFAULT NULL,
  opc_request_id varchar2 DEFAULT NULL,
  region varchar2 DEFAULT NULL, 
  endpoint varchar2 DEFAULT NULL,
  credential_name varchar2 DEFAULT NULL
) RETURN dbms_cloud_oci_bt_bastion_update_session_response_t;

Parameters

Parameter Description

session_id

(required) The unique identifier (OCID) of the session.

update_session_details

(required) The session information to be updated.

if_match

(optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

opc_request_id

(optional) The client request ID for tracing.

region

(optional) OCI region id. e.g us-phoenix-1 for US West (Phoenix).

endpoint

(optional) The endpoint of the service to call using this function. e.g https://bastion.{region}.oci.{secondLevelDomain}.If both endpoint and region are given, then endpoint takes precedence.

credential_name

(optional) The name of the credential for authenticating with the corresponding cloud native API.