network_sources
Creates, updates, deletes, gets or lists a network_sources resource.
Overview​
| Name | network_sources |
| Type | Resource |
| Id | oci.identity.network_sources |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The network source was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the network source. |
name | string | The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed. |
compartmentId | string | The OCID of the tenancy containing the network source. The tenancy is the root compartment. |
definedTags | object | Defined 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"}} |
description | string | The description you assign to the network source. Does not have to be unique, and it's changeable. |
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](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
inactiveStatus | integer (int64) | The detailed status of INACTIVE lifecycleState. |
lifecycleState | string | The 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) |
publicSourceList | array | A list of allowed public IPs and CIDR ranges. |
services | array | -- The services attribute has no effect and is reserved for use by Oracle. -- |
timeCreated | string (date-time) | Date and time the network source was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
virtualSourceList | array | A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ] |
A network source specifies a list of source IP addresses that are allowed to make authorization requests.<br />Use the network source in policy statements to restrict access to only requests that come from the specified IPs.<br />For more information, see [Managing Network Sources](/Content/Identity/Tasks/managingnetworksources.htm).<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the network source. |
name | string | The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed. |
compartmentId | string | The OCID of the tenancy (root compartment) containing the network source. |
definedTags | object | Defined 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"}} |
description | string | The description you assign to the network source. Does not have to be unique, and it's changeable. |
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](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
lifecycleState | string | The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (x-obmcs-enumref: #/definitions/NetworkSources/lifecycleState) |
publicSourceList | array | A list of allowed public IP addresses and CIDR ranges. |
services | array | -- The services attribute has no effect and is reserved for use by Oracle. -- |
timeCreated | string (date-time) | Date and time the network source was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
virtualSourceList | array | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | networkSourceId, region | Gets the specified network source's information.<br /> | |
list | select | compartmentId, region | page, limit, name, sortBy, sortOrder, lifecycleState | Lists 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 /> |
create | insert | region, name, compartmentId, description | opc-retry-token | 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 /> |
update | update | networkSourceId, region | if-match | Updates the specified network source.<br /> |
delete | delete | networkSourceId, region | if-match | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The OCID of the compartment (remember that the tenancy is simply the root compartment). |
networkSourceId | string | The OCID of the network source. |
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) |
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 only return resources that match the given lifecycle state. The state value is case-insensitive. |
limit | integer | The maximum number of items to return in a paginated "List" call. |
name | string | A filter to only return resources that match the given name exactly. |
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 (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected). |
page | string | The value of the opc-next-page response header from the previous "List" call. |
sortBy | string | The 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. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). The NAME sort order is case sensitive. |
SELECT examples​
- get
- list
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
;
Lists 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 />
SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
publicSourceList,
services,
timeCreated,
virtualSourceList
FROM oci.identity.network_sources
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND name = '{{ name }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: network_sources
props:
- name: region
value: "{{ region }}"
description: Required parameter for the network_sources resource.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The OCID of the tenancy (root compartment) containing the network source object.
- 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](/Content/General/Concepts/resourcetags.htm).
Example: `{"Operations": {"CostCenter": "42"}}`
- name: description
value: "{{ description }}"
description: |
The description you assign to the network source during creation. Does not have to be unique, and it's changeable.
- 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](/Content/General/Concepts/resourcetags.htm).
Example: `{"Department": "Finance"}`
- name: name
value: "{{ name }}"
description: |
The name you assign to the network source during creation. The name must be unique across all groups
in the tenancy and cannot be changed.
- name: publicSourceList
value:
- "{{ publicSourceList }}"
description: |
A list of allowed public IP addresses and CIDR ranges.
- name: services
value:
- "{{ services }}"
description: |
-- The services attribute has no effect and is reserved for use by Oracle. --
- name: virtualSourceList
description: |
A list of allowed VCN OCID and IP range pairs.
Example:`"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]`
value:
- ipRanges: "{{ ipRanges }}"
vcnId: "{{ vcnId }}"
- 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 (e.g., 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 (e.g., 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 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​
- delete
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 }}'
;