Skip to main content

log_groups

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

Overview​

Namelog_groups
TypeResource
Idoci.logging.log_groups

Fields​

The following fields are returned by SELECT queries:

Log group was retrieved.

NameDatatypeDescription
idstringThe OCID of the resource.
compartmentIdstringThe OCID of the compartment that the resource belongs to.
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"}}
descriptionstringDescription for this resource.
displayNamestringThe user-friendly display name. This must be unique within the enclosing resource, 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](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
lifecycleStatestringThe log group object state. (CREATING, ACTIVE, UPDATING, INACTIVE, DELETING, FAILED) (x-obmcs-top-level-enum: #/definitions/LogGroupLifecycleState)
timeCreatedstring (date-time)Time the resource was created.
timeLastModifiedstring (date-time)Time the resource was last modified.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlogGroupId, regionopc-request-idGet the specified log group's information.
listselectcompartmentId, regionisCompartmentIdInSubtree, displayName, page, limit, sortBy, sortOrder, opc-request-idLists all log groups for the specified compartment or tenancy.
createinsertregion, compartmentId, displayNameopc-retry-token, opc-request-idCreate a new log group with a unique display name. This call fails<br />if the log group is already created with the same displayName in the compartment.<br />
updateupdatelogGroupId, regionif-match, opc-request-idUpdates the existing log group with the associated configuration. This call<br /> fails if the log group does not exist.<br />
deletedeletelogGroupId, regionif-match, opc-request-idDeletes the specified log group.
change_compartmentexeclogGroupId, regionif-match, opc-request-idMoves a log group into a different compartment within the same tenancy. When provided, the If-Match is checked against the resource ETag values.<br />For information about moving resources between compartments, see [Moving Resources Between Compartments](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<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
compartmentIdstringCompartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
logGroupIdstringOCID of a log group to work with.
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)
displayNamestringResource name.
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.
isCompartmentIdInSubtreebooleanSpecifies whether or not nested compartments should be traversed. Defaults to false.
limitintegerWhen setting the page limit, specifies the maximum number of unfiltered records that can be fetched from the data store in one request. Filtering happens after the records are retrieved. Subsequent pages might include results that match the query criteria.
opc-request-idstringUnique Oracle-assigned 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 (e.g., 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 or opc-previous-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 (one column only). Default sort order is ascending exception of timeCreated and timeLastModified columns (descending).
sortOrderstringThe sort order to use, whether 'asc' or 'desc'.

SELECT examples​

Get the specified log group's information.

SELECT
id,
compartmentId,
definedTags,
description,
displayName,
freeformTags,
lifecycleState,
timeCreated,
timeLastModified
FROM oci.logging.log_groups
WHERE logGroupId = '{{ logGroupId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Create a new log group with a unique display name. This call fails<br />if the log group is already created with the same displayName in the compartment.<br />

INSERT INTO oci.logging.log_groups (
compartmentId,
definedTags,
description,
displayName,
freeformTags,
region,
opc-retry-token,
opc-request-id
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ description }}',
'{{ displayName }}' /* required */,
'{{ freeformTags }}',
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-request-id }}'
;

UPDATE examples​

Updates the existing log group with the associated configuration. This call<br /> fails if the log group does not exist.<br />

UPDATE oci.logging.log_groups
SET
definedTags = '{{ definedTags }}',
description = '{{ description }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}'
WHERE
logGroupId = '{{ logGroupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}';

DELETE examples​

Deletes the specified log group.

DELETE FROM oci.logging.log_groups
WHERE logGroupId = '{{ logGroupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;

Lifecycle Methods​

Moves a log group into a different compartment within the same tenancy. When provided, the If-Match is checked against the resource ETag values.<br />For information about moving resources between compartments, see [Moving Resources Between Compartments](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br />

EXEC oci.logging.log_groups.change_compartment
@logGroupId='{{ logGroupId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;