Skip to main content

drgs

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

Overview​

Namedrgs
TypeResource
Idoci.network.drgs

Fields​

The following fields are returned by SELECT queries:

The DRG was retrieved.

NameDatatypeDescription
idstringThe DRG's Oracle ID ([OCID](/iaas/Content/General/Concepts/identifiers.htm)).
compartmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the DRG.
defaultDrgRouteTablesobjectThe default DRG route table for this DRG. Each network type has a default DRG route table. You can update a network type to use a different DRG route table, but each network type must have a default DRG route table. You cannot delete a default DRG route table.
defaultExportDrgRouteDistributionIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of this DRG's default export route distribution for the DRG attachments.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
displayNamestringA user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
lifecycleStatestringThe DRG's current state. (PROVISIONING, AVAILABLE, TERMINATING, TERMINATED)
timeCreatedstring (date-time)The date and time the DRG was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdrgId, regionGets the specified DRG's information.
listselectcompartmentId, regionlimit, pageLists the DRGs in the specified compartment.<br />
createinsertregion, compartmentIdopc-retry-tokenCreates a new dynamic routing gateway (DRG) in the specified compartment. For more information,<br />see [Dynamic Routing Gateways (DRGs)](/iaas/Content/Network/Tasks/managingDRGs.htm).<br /><br />For the purposes of access control, you must provide the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want<br />the DRG to reside. Notice that the DRG doesn't have to be in the same compartment as the VCN,<br />the DRG attachment, or other Networking Service components. If you're not sure which compartment<br />to use, put the DRG in the same compartment as the VCN. For more information about compartments<br />and access control, see [Overview of the IAM Service](/iaas/Content/Identity/Concepts/overview.htm).<br />For information about OCIDs, see [Resource Identifiers](/iaas/Content/General/Concepts/identifiers.htm).<br /><br />You may optionally specify a display name for the DRG, otherwise a default is provided.<br />It does not have to be unique, and you can change it. Avoid entering confidential information.<br />
updateupdatedrgId, regionif-matchUpdates the specified DRG's display name or tags. Avoid entering confidential information.<br />
deletedeletedrgId, regionif-matchDeletes the specified DRG. The DRG must not be attached to a VCN or be connected to your on-premise<br />network. Also, there must not be a route table that lists the DRG as a target. This is an asynchronous<br />operation. The DRG's lifecycleState will change to TERMINATING temporarily until the DRG is completely<br />removed.<br />
get_all_drg_attachmentsexecdrgId, regionopc-request-id, limit, page, attachmentType, isCrossTenancyReturns a complete list of DRG attachments that belong to a particular DRG.<br />
upgrade_drgexecdrgId, regionopc-request-id, opc-retry-tokenUpgrades the DRG. After upgrade, you can control routing inside your DRG<br />via DRG attachments, route distributions, and DRG route tables.<br />

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
compartmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
drgIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
attachmentTypestringThe type for the network resource attached to the DRG.
if-matchstringFor 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.
isCrossTenancybooleanWhether the DRG attachment lives in a different tenancy than the DRG.
limitintegerFor list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50
opc-request-idstringUnique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA 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 may be rejected).
pagestringFor list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).

SELECT examples​

Gets the specified DRG's information.

SELECT
id,
compartmentId,
defaultDrgRouteTables,
defaultExportDrgRouteDistributionId,
definedTags,
displayName,
freeformTags,
lifecycleState,
timeCreated
FROM oci.network.drgs
WHERE drgId = '{{ drgId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new dynamic routing gateway (DRG) in the specified compartment. For more information,<br />see [Dynamic Routing Gateways (DRGs)](/iaas/Content/Network/Tasks/managingDRGs.htm).<br /><br />For the purposes of access control, you must provide the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want<br />the DRG to reside. Notice that the DRG doesn't have to be in the same compartment as the VCN,<br />the DRG attachment, or other Networking Service components. If you're not sure which compartment<br />to use, put the DRG in the same compartment as the VCN. For more information about compartments<br />and access control, see [Overview of the IAM Service](/iaas/Content/Identity/Concepts/overview.htm).<br />For information about OCIDs, see [Resource Identifiers](/iaas/Content/General/Concepts/identifiers.htm).<br /><br />You may optionally specify a display name for the DRG, otherwise a default is provided.<br />It does not have to be unique, and you can change it. Avoid entering confidential information.<br />

INSERT INTO oci.network.drgs (
compartmentId,
definedTags,
displayName,
freeformTags,
region,
opc-retry-token
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ displayName }}',
'{{ freeformTags }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
defaultDrgRouteTables,
defaultExportDrgRouteDistributionId,
definedTags,
displayName,
freeformTags,
lifecycleState,
timeCreated
;

UPDATE examples​

Updates the specified DRG's display name or tags. Avoid entering confidential information.<br />

UPDATE oci.network.drgs
SET
defaultDrgRouteTables = '{{ defaultDrgRouteTables }}',
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}'
WHERE
drgId = '{{ drgId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
defaultDrgRouteTables,
defaultExportDrgRouteDistributionId,
definedTags,
displayName,
freeformTags,
lifecycleState,
timeCreated;

DELETE examples​

Deletes the specified DRG. The DRG must not be attached to a VCN or be connected to your on-premise<br />network. Also, there must not be a route table that lists the DRG as a target. This is an asynchronous<br />operation. The DRG's lifecycleState will change to TERMINATING temporarily until the DRG is completely<br />removed.<br />

DELETE FROM oci.network.drgs
WHERE drgId = '{{ drgId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;

Lifecycle Methods​

Returns a complete list of DRG attachments that belong to a particular DRG.<br />

EXEC oci.network.drgs.get_all_drg_attachments
@drgId='{{ drgId }}' --required,
@region='{{ region }}' --required,
@opc-request-id='{{ opc-request-id }}',
@limit='{{ limit }}',
@page='{{ page }}',
@attachmentType='{{ attachmentType }}',
@isCrossTenancy={{ isCrossTenancy }}
;