tag_defaults
Creates, updates, deletes, gets or lists a tag_defaults resource.
Overview​
| Name | tag_defaults |
| Type | Resource |
| Id | oci.identity.tag_defaults |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The tag default was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the tag default. |
compartmentId | string | The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged. |
isRequired | boolean | If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked. * If the isRequired flag is set to "true", the value is set during resource creation. * If the isRequired flag is set to "false", the value you enter is set during resource creation. Example: false |
lifecycleState | string | The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it. (ACTIVE) |
locks | array | Locks associated with this resource. |
tagDefinitionId | string | The OCID of the tag definition. The tag default will always assign a default value for this tag definition. |
tagDefinitionName | string | The name used in the tag definition. This field is informational in the context of the tag default. |
tagNamespaceId | string | The OCID of the tag namespace that contains the tag definition. |
timeCreated | string (date-time) | Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
value | string | The default value for the tag definition. This will be applied to all resources created in the compartment. |
Summary information for the specified tag default.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the tag default. |
compartmentId | string | The OCID of the compartment. The tag default will apply to all new resources that are created in the compartment. |
isRequired | boolean | If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked. * If the isRequired flag is set to "true", the value is set during resource creation. * If the isRequired flag is set to "false", the value you enter is set during resource creation. Example: false |
lifecycleState | string | The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it. (ACTIVE) |
locks | array | Locks associated with this resource. |
tagDefinitionId | string | The OCID of the tag definition. The tag default will always assign a default value for this tag definition. |
tagDefinitionName | string | The name used in the tag definition. This field is informational in the context of the tag default. |
tagNamespaceId | string | The OCID of the tag namespace that contains the tag definition. |
timeCreated | string (date-time) | Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
value | string | The default value for the tag definition. This will be applied to all new resources created in the compartment. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | tagDefaultId, region | Retrieves the specified tag default.<br /> | |
list | select | region | page, limit, id, compartmentId, tagDefinitionId, lifecycleState | Lists the tag defaults for tag definitions in the specified compartment.<br /> |
create | insert | region, compartmentId, tagDefinitionId, value | opc-retry-token, opc-request-id | Creates a new tag default in the specified compartment for the specified tag definition.<br /><br />If you specify that a value is required, a value is set during resource creation (either by<br />the user creating the resource or another tag defualt). If no value is set, resource creation<br />is blocked.<br /><br />* If the isRequired flag is set to "true", the value is set during resource creation.<br />* If the isRequired flag is set to "false", the value you enter is set during resource creation.<br /> |
update | update | tagDefaultId, region, value | isLockOverride, if-match, opc-request-id | Updates the specified tag default. If you specify that a value is required, a value is set<br />during resource creation (either by the user creating the resource or another tag defualt).<br />If no value is set, resource creation is blocked.<br /><br />* If the isRequired flag is set to "true", the value is set during resource creation.<br />* If the isRequired flag is set to "false", the value you enter is set during resource creation.<br /> |
delete | delete | tagDefaultId, region | opc-request-id, if-match, isLockOverride | Deletes the the specified tag default.<br /> |
assemble_effective_tag_set | exec | compartmentId, region | lifecycleState | Assembles tag defaults in the specified compartment and any parent compartments to determine<br />the tags to apply. Tag defaults from parent compartments do not override tag defaults<br />referencing the same tag in a compartment lower down the hierarchy. This set of tag defaults<br />includes all tag defaults from the current compartment back to the root compartment.<br /> |
add_tag_default_lock | exec | tagDefaultId, region, type | if-match, opc-request-id, opc-retry-token | Add a resource lock to a tag default.<br /> |
remove_tag_default_lock | exec | tagDefaultId, region, type | if-match, opc-request-id, opc-retry-token | Remove a resource lock from a tag default.<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). |
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) |
tagDefaultId | string | The OCID of the tag default. |
compartmentId | string | The OCID of the compartment (remember that the tenancy is simply the root compartment). |
id | string | A filter to only return resources that match the specified OCID exactly. |
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. |
isLockOverride | boolean | Whether to override locks (if any exist). |
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. |
opc-request-id | string | Unique Oracle-assigned 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 (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. |
tagDefinitionId | string | The OCID of the tag definition. |
SELECT examples​
- get
- list
Retrieves the specified tag default.<br />
SELECT
id,
compartmentId,
isRequired,
lifecycleState,
locks,
tagDefinitionId,
tagDefinitionName,
tagNamespaceId,
timeCreated,
value
FROM oci.identity.tag_defaults
WHERE tagDefaultId = '{{ tagDefaultId }}' -- required
AND region = '{{ region }}' -- required
;
Lists the tag defaults for tag definitions in the specified compartment.<br />
SELECT
id,
compartmentId,
isRequired,
lifecycleState,
locks,
tagDefinitionId,
tagDefinitionName,
tagNamespaceId,
timeCreated,
value
FROM oci.identity.tag_defaults
WHERE region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND id = '{{ id }}'
AND compartmentId = '{{ compartmentId }}'
AND tagDefinitionId = '{{ tagDefinitionId }}'
AND lifecycleState = '{{ lifecycleState }}'
;
INSERT examples​
- create
- Manifest
Creates a new tag default in the specified compartment for the specified tag definition.<br /><br />If you specify that a value is required, a value is set during resource creation (either by<br />the user creating the resource or another tag defualt). If no value is set, resource creation<br />is blocked.<br /><br />* If the isRequired flag is set to "true", the value is set during resource creation.<br />* If the isRequired flag is set to "false", the value you enter is set during resource creation.<br />
INSERT INTO oci.identity.tag_defaults (
compartmentId,
isRequired,
locks,
tagDefinitionId,
value,
region,
opc-retry-token,
opc-request-id
)
SELECT
'{{ compartmentId }}' /* required */,
{{ isRequired }},
'{{ locks }}',
'{{ tagDefinitionId }}' /* required */,
'{{ value }}' /* required */,
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-request-id }}'
RETURNING
id,
compartmentId,
isRequired,
lifecycleState,
locks,
tagDefinitionId,
tagDefinitionName,
tagNamespaceId,
timeCreated,
value
;
# Description fields are for documentation purposes
- name: tag_defaults
props:
- name: region
value: "{{ region }}"
description: Required parameter for the tag_defaults resource.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- name: isRequired
value: {{ isRequired }}
description: |
If you specify that a value is required, a value is set during resource creation (either by
the user creating the resource or another tag defualt). If no value is set, resource
creation is blocked.
* If the `isRequired` flag is set to "true", the value is set during resource creation.
* If the `isRequired` flag is set to "false", the value you enter is set during resource creation.
Example: `false`
- name: locks
description: |
Locks associated with this resource.
value:
- message: "{{ message }}"
relatedResourceId: "{{ relatedResourceId }}"
type: "{{ type }}"
- name: tagDefinitionId
value: "{{ tagDefinitionId }}"
description: |
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- name: value
value: "{{ value }}"
description: |
The default value for the tag definition. This will be applied to all new resources created in the compartment.
- 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).
- name: opc-request-id
value: "{{ opc-request-id }}"
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
UPDATE examples​
- update
Updates the specified tag default. If you specify that a value is required, a value is set<br />during resource creation (either by the user creating the resource or another tag defualt).<br />If no value is set, resource creation is blocked.<br /><br />* If the isRequired flag is set to "true", the value is set during resource creation.<br />* If the isRequired flag is set to "false", the value you enter is set during resource creation.<br />
UPDATE oci.identity.tag_defaults
SET
isRequired = {{ isRequired }},
value = '{{ value }}'
WHERE
tagDefaultId = '{{ tagDefaultId }}' --required
AND region = '{{ region }}' --required
AND value = '{{ value }}' --required
AND isLockOverride = {{ isLockOverride}}
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
compartmentId,
isRequired,
lifecycleState,
locks,
tagDefinitionId,
tagDefinitionName,
tagNamespaceId,
timeCreated,
value;
DELETE examples​
- delete
Deletes the the specified tag default.<br />
DELETE FROM oci.identity.tag_defaults
WHERE tagDefaultId = '{{ tagDefaultId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
AND if-match = '{{ if-match }}'
AND isLockOverride = '{{ isLockOverride }}'
;
Lifecycle Methods​
- assemble_effective_tag_set
- add_tag_default_lock
- remove_tag_default_lock
Assembles tag defaults in the specified compartment and any parent compartments to determine<br />the tags to apply. Tag defaults from parent compartments do not override tag defaults<br />referencing the same tag in a compartment lower down the hierarchy. This set of tag defaults<br />includes all tag defaults from the current compartment back to the root compartment.<br />
EXEC oci.identity.tag_defaults.assemble_effective_tag_set
@compartmentId='{{ compartmentId }}' --required,
@region='{{ region }}' --required,
@lifecycleState='{{ lifecycleState }}'
;
Add a resource lock to a tag default.<br />
EXEC oci.identity.tag_defaults.add_tag_default_lock
@tagDefaultId='{{ tagDefaultId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"message": "{{ message }}",
"relatedResourceId": "{{ relatedResourceId }}",
"type": "{{ type }}"
}'
;
Remove a resource lock from a tag default.<br />
EXEC oci.identity.tag_defaults.remove_tag_default_lock
@tagDefaultId='{{ tagDefaultId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"type": "{{ type }}"
}'
;