drg_attachments
Creates, updates, deletes, gets or lists a drg_attachments resource.
Overview​
| Name | drg_attachments |
| Type | Resource |
| Id | oci.network.drg_attachments |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The DrgAttachment was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The DRG attachment's Oracle ID ([OCID](/iaas/Content/General/Concepts/identifiers.htm)). |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the DRG attachment. |
definedTags | object | Defined 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"}} |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
drgId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG. |
drgRouteTableId | string | The [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. |
exportDrgRouteDistributionId | string | The [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. |
freeformTags | object | Free-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"} |
isCrossTenancy | boolean | Indicates whether the DRG attachment and attached network live in a different tenancy than the DRG. Example: false |
lifecycleState | string | The DRG attachment's current state. (ATTACHING, ATTACHED, DETACHING, DETACHED) |
networkDetails | object | |
routeTableId | string | The [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. |
timeCreated | string (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 |
vcnId | string | The [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. |
A DRG attachment serves as a link between a DRG and a network resource. A DRG can be attached to a VCN,<br />IPSec tunnel, remote peering connection, or virtual circuit.<br /><br />For more information, see [Overview of the Networking Service](/iaas/Content/Network/Concepts/overview.htm).<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The DRG attachment's Oracle ID ([OCID](/iaas/Content/General/Concepts/identifiers.htm)). |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the DRG attachment. |
definedTags | object | Defined 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"}} |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
drgId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG. |
drgRouteTableId | string | The [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. |
exportDrgRouteDistributionId | string | The [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. |
freeformTags | object | Free-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"} |
isCrossTenancy | boolean | Indicates whether the DRG attachment and attached network live in a different tenancy than the DRG. Example: false |
lifecycleState | string | The DRG attachment's current state. (ATTACHING, ATTACHED, DETACHING, DETACHED) |
networkDetails | object | |
routeTableId | string | The [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. |
timeCreated | string (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 |
vcnId | string | The [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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | drgAttachmentId, region | Gets the DrgAttachment resource. | |
list | select | compartmentId, region | vcnId, drgId, limit, page, networkId, attachmentType, drgRouteTableId, displayName, sortBy, sortOrder, lifecycleState | Lists 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 /> |
create | insert | region, drgId | opc-retry-token | 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 /> |
update | update | drgAttachmentId, region | if-match | Updates the display name and routing information for the specified DrgAttachment.<br />Avoid entering confidential information.<br /> |
delete | delete | drgAttachmentId, region | if-match | 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 /> |
remove_export_drg_route_distribution | exec | drgAttachmentId, region | opc-request-id, if-match | Removes 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment. |
drgAttachmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG attachment. |
region | string | OCI 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) |
attachmentType | string | The type for the network resource attached to the DRG. |
displayName | string | A filter to return only resources that match the given display name exactly. |
drgId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG. |
drgRouteTableId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG route table assigned to the DRG attachment. |
if-match | string | 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. |
lifecycleState | string | A filter to return only resources that match the specified lifecycle state. The value is case insensitive. |
limit | integer | For 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 |
networkId | string | The [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-id | string | Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
opc-retry-token | string | 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 may be rejected). |
page | string | For 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). |
sortBy | string | The 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. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). The DISPLAYNAME sort order is case sensitive. |
vcnId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VCN. |
SELECT examples​
- get
- list
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
;
Lists 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 />
SELECT
id,
compartmentId,
definedTags,
displayName,
drgId,
drgRouteTableId,
exportDrgRouteDistributionId,
freeformTags,
isCrossTenancy,
lifecycleState,
networkDetails,
routeTableId,
timeCreated,
vcnId
FROM oci.network.drg_attachments
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND vcnId = '{{ vcnId }}'
AND drgId = '{{ drgId }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND networkId = '{{ networkId }}'
AND attachmentType = '{{ attachmentType }}'
AND drgRouteTableId = '{{ drgRouteTableId }}'
AND displayName = '{{ displayName }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: drg_attachments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the drg_attachments resource.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined 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"}}`
- name: displayName
value: "{{ displayName }}"
description: |
A user-friendly name. Does not have to be unique, and it's changeable.
Avoid entering confidential information.
- name: drgId
value: "{{ drgId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the DRG.
- name: drgRouteTableId
value: "{{ drgRouteTableId }}"
description: |
The [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.
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-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"}`
- name: networkDetails
value:
id: "{{ id }}"
type: "{{ type }}"
- name: routeTableId
value: "{{ routeTableId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the route table used by the DRG attachment.
If you don't specify a route table here, the DRG attachment is created without an associated route
table. The Networking service does NOT automatically associate the attached VCN's default route table
with the DRG attachment.
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 specify the VCN route table for this attachment.
- name: vcnId
value: "{{ vcnId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VCN.
This field is deprecated. Instead, use the `networkDetails` field to specify the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the attached resource.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: 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 may be rejected).
description: 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 may be rejected).
UPDATE examples​
- update
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​
- delete
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​
- remove_export_drg_route_distribution
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 }}'
;