TagDefault

class oci.identity.models.TagDefault(**kwargs)

Bases: object

Tag defaults let you specify a default tag (tagnamespace.tag=”value”) to apply to all resource types in a specified compartment. The tag default is applied at the time the resource is created. Resources that exist in the compartment before you create the tag default are not tagged. The TagDefault object specifies the tag and compartment details.

Tag defaults are inherited by child compartments. This means that if you set a tag default on the root compartment for a tenancy, all resources that are created in the tenancy are tagged. For more information about using tag defaults, see Managing Tag Defaults.

To use any of the API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator.

Attributes

LIFECYCLE_STATE_ACTIVE A constant which can be used with the lifecycle_state property of a TagDefault.
compartment_id [Required] Gets the compartment_id of this TagDefault.
id [Required] Gets the id of this TagDefault.
is_required [Required] Gets the is_required of this TagDefault.
lifecycle_state Gets the lifecycle_state of this TagDefault.
locks Gets the locks of this TagDefault.
tag_definition_id [Required] Gets the tag_definition_id of this TagDefault.
tag_definition_name [Required] Gets the tag_definition_name of this TagDefault.
tag_namespace_id [Required] Gets the tag_namespace_id of this TagDefault.
time_created [Required] Gets the time_created of this TagDefault.
value [Required] Gets the value of this TagDefault.

Methods

__init__(**kwargs) Initializes a new TagDefault object with values from keyword arguments.
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'

A constant which can be used with the lifecycle_state property of a TagDefault. This constant has a value of “ACTIVE”

__init__(**kwargs)

Initializes a new TagDefault object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • id (str) – The value to assign to the id property of this TagDefault.
  • compartment_id (str) – The value to assign to the compartment_id property of this TagDefault.
  • tag_namespace_id (str) – The value to assign to the tag_namespace_id property of this TagDefault.
  • tag_definition_id (str) – The value to assign to the tag_definition_id property of this TagDefault.
  • tag_definition_name (str) – The value to assign to the tag_definition_name property of this TagDefault.
  • value (str) – The value to assign to the value property of this TagDefault.
  • time_created (datetime) – The value to assign to the time_created property of this TagDefault.
  • lifecycle_state (str) – The value to assign to the lifecycle_state property of this TagDefault. Allowed values for this property are: “ACTIVE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • is_required (bool) – The value to assign to the is_required property of this TagDefault.
  • locks (list[oci.identity.models.ResourceLock]) – The value to assign to the locks property of this TagDefault.
compartment_id

[Required] Gets the compartment_id of this TagDefault. 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.

Returns:The compartment_id of this TagDefault.
Return type:str
id

[Required] Gets the id of this TagDefault. The OCID of the tag default.

Returns:The id of this TagDefault.
Return type:str
is_required

[Required] Gets the is_required of this TagDefault. 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

Returns:The is_required of this TagDefault.
Return type:bool
lifecycle_state

Gets the lifecycle_state of this TagDefault. The tag default’s current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.

Allowed values for this property are: “ACTIVE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The lifecycle_state of this TagDefault.
Return type:str
locks

Gets the locks of this TagDefault. Locks associated with this resource.

Returns:The locks of this TagDefault.
Return type:list[oci.identity.models.ResourceLock]
tag_definition_id

[Required] Gets the tag_definition_id of this TagDefault. The OCID of the tag definition. The tag default will always assign a default value for this tag definition.

Returns:The tag_definition_id of this TagDefault.
Return type:str
tag_definition_name

[Required] Gets the tag_definition_name of this TagDefault. The name used in the tag definition. This field is informational in the context of the tag default.

Returns:The tag_definition_name of this TagDefault.
Return type:str
tag_namespace_id

[Required] Gets the tag_namespace_id of this TagDefault. The OCID of the tag namespace that contains the tag definition.

Returns:The tag_namespace_id of this TagDefault.
Return type:str
time_created

[Required] Gets the time_created of this TagDefault. Date and time the TagDefault object was created, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:The time_created of this TagDefault.
Return type:datetime
value

[Required] Gets the value of this TagDefault. The default value for the tag definition. This will be applied to all resources created in the compartment.

Returns:The value of this TagDefault.
Return type:str