Skip to main content

network_sources

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

Overview​

Namenetwork_sources
TypeResource
Idoci.identity.network_sources

Fields​

The following fields are returned by SELECT queries:

The network source was retrieved.

NameDatatypeDescription
idstringThe OCID of the network source.
namestringThe name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
compartmentIdstringThe OCID of the tenancy containing the network source. The tenancy is the root compartment.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
descriptionstringThe description you assign to the network source. Does not have to be unique, and it's changeable.
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](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
inactiveStatusinteger (int64)The detailed status of INACTIVE lifecycleState.
lifecycleStatestringThe network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED)
publicSourceListarrayA list of allowed public IPs and CIDR ranges.
servicesarray-- The services attribute has no effect and is reserved for use by Oracle. --
timeCreatedstring (date-time)Date and time the network source was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
virtualSourceListarrayA list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnetworkSourceId, regionGets the specified network source's information.<br />
listselectcompartmentId, regionpage, limit, name, sortBy, sortOrder, lifecycleStateLists the network sources in your tenancy. You must specify your tenancy's OCID as the value for<br />the compartment ID (remember that the tenancy is simply the root compartment).<br />See [Where to Get the Tenancy's OCID and User's OCID](/Content/API/Concepts/apisigningkey.htm#five).<br />
createinsertregion, name, compartmentId, descriptionopc-retry-tokenCreates a new network source in your tenancy.<br /><br />You must specify your tenancy's OCID as the compartment ID in the request object (remember that the tenancy<br />is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies)<br />reside within the tenancy itself, unlike cloud resources such as compute instances, which typically<br />reside within compartments inside the tenancy. For information about OCIDs, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />You must also specify a name for the network source, which must be unique across all network sources in your<br />tenancy, and cannot be changed.<br />You can use this name or the OCID when writing policies that apply to the network source. For more information<br />about policies, see [How Policies Work](/Content/Identity/policieshow/how-policies-work.htm).<br /><br />You must also specify a description for the network source (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with [UpdateNetworkSource](#/en/identity/20160918/NetworkSource/UpdateNetworkSource).<br /><br />After you send your request, the new object's lifecycleState will temporarily be CREATING. Before using the<br />object, first make sure its lifecycleState has changed to ACTIVE.<br /><br />After your network resource is created, you can use it in policy to restrict access to only requests made from an allowed<br />IP address specified in your network source. For more information, see [Managing Network Sources](/Content/Identity/Tasks/managingnetworksources.htm).<br />
updateupdatenetworkSourceId, regionif-matchUpdates the specified network source.<br />
deletedeletenetworkSourceId, regionif-matchDeletes the specified network source.<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 of the compartment (remember that the tenancy is simply the root compartment).
networkSourceIdstringThe OCID of the network source.
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)
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 only return resources that match the given lifecycle state. The state value is case-insensitive.
limitintegerThe maximum number of items to return in a paginated "List" call.
namestringA filter to only return resources that match the given name exactly.
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 (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe value of the opc-next-page response header from the previous "List" call.
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME 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 NAME sort order is case sensitive.

SELECT examples​

Gets the specified network source's information.<br />

SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
publicSourceList,
services,
timeCreated,
virtualSourceList
FROM oci.identity.network_sources
WHERE networkSourceId = '{{ networkSourceId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new network source in your tenancy.<br /><br />You must specify your tenancy's OCID as the compartment ID in the request object (remember that the tenancy<br />is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies)<br />reside within the tenancy itself, unlike cloud resources such as compute instances, which typically<br />reside within compartments inside the tenancy. For information about OCIDs, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />You must also specify a name for the network source, which must be unique across all network sources in your<br />tenancy, and cannot be changed.<br />You can use this name or the OCID when writing policies that apply to the network source. For more information<br />about policies, see [How Policies Work](/Content/Identity/policieshow/how-policies-work.htm).<br /><br />You must also specify a description for the network source (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with [UpdateNetworkSource](#/en/identity/20160918/NetworkSource/UpdateNetworkSource).<br /><br />After you send your request, the new object's lifecycleState will temporarily be CREATING. Before using the<br />object, first make sure its lifecycleState has changed to ACTIVE.<br /><br />After your network resource is created, you can use it in policy to restrict access to only requests made from an allowed<br />IP address specified in your network source. For more information, see [Managing Network Sources](/Content/Identity/Tasks/managingnetworksources.htm).<br />

INSERT INTO oci.identity.network_sources (
compartmentId,
definedTags,
description,
freeformTags,
name,
publicSourceList,
services,
virtualSourceList,
region,
opc-retry-token
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ description }}' /* required */,
'{{ freeformTags }}',
'{{ name }}' /* required */,
'{{ publicSourceList }}',
'{{ services }}',
'{{ virtualSourceList }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
publicSourceList,
services,
timeCreated,
virtualSourceList
;

UPDATE examples​

Updates the specified network source.<br />

UPDATE oci.identity.network_sources
SET
definedTags = '{{ definedTags }}',
description = '{{ description }}',
freeformTags = '{{ freeformTags }}',
publicSourceList = '{{ publicSourceList }}',
services = '{{ services }}',
virtualSourceList = '{{ virtualSourceList }}'
WHERE
networkSourceId = '{{ networkSourceId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
publicSourceList,
services,
timeCreated,
virtualSourceList;

DELETE examples​

Deletes the specified network source.<br />

DELETE FROM oci.identity.network_sources
WHERE networkSourceId = '{{ networkSourceId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;