Skip to main content

drg_attachments

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

Overview​

Namedrg_attachments
TypeResource
Idoci.network.drg_attachments

Fields​

The following fields are returned by SELECT queries:

The DrgAttachment was retrieved.

NameDatatypeDescription
idstringThe DRG attachment's Oracle ID ([OCID](/iaas/Content/General/Concepts/identifiers.htm)).
compartmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the DRG attachment.
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.
drgIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG.
drgRouteTableIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG route table that is assigned to this attachment. The DRG route table manages traffic inside the DRG.
exportDrgRouteDistributionIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the export route distribution used to specify how routes in the assigned DRG route table are advertised to the attachment. If this value is null, no routes are advertised through this attachment.
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"}
isCrossTenancybooleanIndicates whether the DRG attachment and attached network live in a different tenancy than the DRG. Example: false
lifecycleStatestringThe DRG attachment's current state. (ATTACHING, ATTACHED, DETACHING, DETACHED)
networkDetailsobject
routeTableIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the route table the DRG attachment is using. For information about why you would associate a route table with a DRG attachment, see: * [Transit Routing: Access to Multiple VCNs in Same Region](/iaas/Content/Network/Tasks/transitrouting.htm) * [Transit Routing: Private Access to Oracle Services](/iaas/Content/Network/Tasks/transitroutingoracleservices.htm) This field is deprecated. Instead, use the networkDetails field to view the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the attached resource.
timeCreatedstring (date-time)The date and time the DRG attachment was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z
vcnIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VCN. This field is deprecated. Instead, use the networkDetails field to view the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the attached resource.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdrgAttachmentId, regionGets the DrgAttachment resource.
listselectcompartmentId, regionvcnId, drgId, limit, page, networkId, attachmentType, drgRouteTableId, displayName, sortBy, sortOrder, lifecycleStateLists the DrgAttachment resource for the specified compartment. You can filter the<br />results by DRG, attached network, attachment type, DRG route table or<br />VCN route table.<br /><br />The LIST API lists DRG attachments by attachment type. It will default to list VCN attachments,<br />but you may request to list ALL attachments of ALL types.<br />
createinsertregion, drgIdopc-retry-tokenAttaches the specified DRG to the specified network resource. A VCN can be attached to only one DRG<br />at a time, but a DRG can be attached to more than one VCN. The response includes a DrgAttachment<br />object with its own [OCID](/iaas/Content/General/Concepts/identifiers.htm). For more information about DRGs, see<br />[Dynamic Routing Gateways (DRGs)](/iaas/Content/Network/Tasks/managingDRGs.htm).<br /><br />You may optionally specify a display name for the attachment, otherwise a default is provided.<br />It does not have to be unique, and you can change it. Avoid entering confidential information.<br /><br />For the purposes of access control, the DRG attachment is automatically placed into the currently selected compartment.<br />For more information about compartments and access control, see<br />[Overview of the IAM Service](/iaas/Content/Identity/Concepts/overview.htm).<br />
updateupdatedrgAttachmentId, regionif-matchUpdates the display name and routing information for the specified DrgAttachment.<br />Avoid entering confidential information.<br />
deletedeletedrgAttachmentId, regionif-matchDetaches a DRG from a network resource by deleting the corresponding DrgAttachment resource. This is an asynchronous<br />operation. The attachment's lifecycleState will temporarily change to DETACHING until the attachment<br />is completely removed.<br />
remove_export_drg_route_distributionexecdrgAttachmentId, regionopc-request-id, if-matchRemoves the export route distribution from the DRG attachment so no routes are advertised to it.<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.
drgAttachmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG attachment.
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.
displayNamestringA filter to return only resources that match the given display name exactly.
drgIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG.
drgRouteTableIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG route table assigned to the DRG attachment.
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.
lifecycleStatestringA filter to return only resources that match the specified lifecycle state. The value is case insensitive.
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
networkIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the resource (virtual circuit, VCN, IPSec tunnel, or remote peering connection) attached to the DRG.
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).
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by availability domain if the scope of the resource type is within a single availability domain. If you call one of these "List" operations without specifying an availability domain, the resources are grouped by availability domain, then sorted.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC). The DISPLAYNAME sort order is case sensitive.
vcnIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VCN.

SELECT examples​

Gets the DrgAttachment resource.

SELECT
id,
compartmentId,
definedTags,
displayName,
drgId,
drgRouteTableId,
exportDrgRouteDistributionId,
freeformTags,
isCrossTenancy,
lifecycleState,
networkDetails,
routeTableId,
timeCreated,
vcnId
FROM oci.network.drg_attachments
WHERE drgAttachmentId = '{{ drgAttachmentId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Attaches the specified DRG to the specified network resource. A VCN can be attached to only one DRG<br />at a time, but a DRG can be attached to more than one VCN. The response includes a DrgAttachment<br />object with its own [OCID](/iaas/Content/General/Concepts/identifiers.htm). For more information about DRGs, see<br />[Dynamic Routing Gateways (DRGs)](/iaas/Content/Network/Tasks/managingDRGs.htm).<br /><br />You may optionally specify a display name for the attachment, otherwise a default is provided.<br />It does not have to be unique, and you can change it. Avoid entering confidential information.<br /><br />For the purposes of access control, the DRG attachment is automatically placed into the currently selected compartment.<br />For more information about compartments and access control, see<br />[Overview of the IAM Service](/iaas/Content/Identity/Concepts/overview.htm).<br />

INSERT INTO oci.network.drg_attachments (
definedTags,
displayName,
drgId,
drgRouteTableId,
freeformTags,
networkDetails,
routeTableId,
vcnId,
region,
opc-retry-token
)
SELECT
'{{ definedTags }}',
'{{ displayName }}',
'{{ drgId }}' /* required */,
'{{ drgRouteTableId }}',
'{{ freeformTags }}',
'{{ networkDetails }}',
'{{ routeTableId }}',
'{{ vcnId }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
definedTags,
displayName,
drgId,
drgRouteTableId,
exportDrgRouteDistributionId,
freeformTags,
isCrossTenancy,
lifecycleState,
networkDetails,
routeTableId,
timeCreated,
vcnId
;

UPDATE examples​

Updates the display name and routing information for the specified DrgAttachment.<br />Avoid entering confidential information.<br />

UPDATE oci.network.drg_attachments
SET
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
drgRouteTableId = '{{ drgRouteTableId }}',
exportDrgRouteDistributionId = '{{ exportDrgRouteDistributionId }}',
freeformTags = '{{ freeformTags }}',
networkDetails = '{{ networkDetails }}',
routeTableId = '{{ routeTableId }}'
WHERE
drgAttachmentId = '{{ drgAttachmentId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
definedTags,
displayName,
drgId,
drgRouteTableId,
exportDrgRouteDistributionId,
freeformTags,
isCrossTenancy,
lifecycleState,
networkDetails,
routeTableId,
timeCreated,
vcnId;

DELETE examples​

Detaches a DRG from a network resource by deleting the corresponding DrgAttachment resource. This is an asynchronous<br />operation. The attachment's lifecycleState will temporarily change to DETACHING until the attachment<br />is completely removed.<br />

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

Lifecycle Methods​

Removes the export route distribution from the DRG attachment so no routes are advertised to it.<br />

EXEC oci.network.drg_attachments.remove_export_drg_route_distribution
@drgAttachmentId='{{ drgAttachmentId }}' --required,
@region='{{ region }}' --required,
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
;