lib/oci/identity/identity_client.rb
# Creates a new tag in the specified tag namespace.
#
# You must specify either the OCID or the name of the tag namespace that will contain this tag definition.
#
# You must also specify a *name* for the tag, which must be unique across all tags in the tag namespace
# and cannot be changed. The name can contain any ASCII character except the space (_) or period (.) characters.
# Names are case insensitive. That means, for example, \"myTag\" and \"mytag\" are not allowed in the same namespace.
# If you specify a name that's already in use in the tag namespace, a 409 error is returned.
#
# You must also specify a *description* for the tag.
# It does not have to be unique, and you can change it with
# {#update_tag update_tag}.
#
# If no 'validator' is set on this tag definition, then any (valid) value can be set for this definedTag.
#
# If a 'validator' is set on this tag definition, then the only valid values that can be set for this
# definedTag those that pass the additional validation imposed by the set 'validator'.
#
# @param [String] tag_namespace_id The OCID of the tag namespace.
#
# @param [OCI::Identity::Models::CreateTagDetails] create_tag_details Request object for creating a new tag in the specified tag namespace.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [String] :opc_retry_token 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).
#
# @return [Response] A Response object with data of type {OCI::Identity::Models::Tag Tag}
Creates a new tag in the specified tag namespace.
You must specify either the OCID or the name of the tag namespace that will contain this tag definition.

You must also specify a *name* for the tag, which must be unique across all tags in the tag namespace
and cannot be changed. The name can contain any ASCII character except the space (_) or period (.) characters.
Names are case insensitive. That means, for example, \"myTag\" and \"mytag\" are not allowed in the same namespace.
If you specify a name that's already in use in the tag namespace, a 409 error is returned.

You must also specify a *description* for the tag.
It does not have to be unique, and you can change it with
{#update_tag update_tag}.

If no 'validator' is set on this tag definition, then any (valid) value can be set for this definedTag.

If a 'validator' is set on this tag definition, then the only valid values that can be set for this
definedTag those that pass the additional validation imposed by the set 'validator'.
Creates a new tag in the specified tag namespace . You must specify either the OCID or the name of the tag namespace that will contain this tag definition . You must also specify a * name * for the tag which must be unique across all tags in the tag namespace and cannot be changed . The name can contain any ASCII character except the space ( _ ) or period ( . ) characters . Names are case insensitive . That means for example \ " myTag \ " and \ " mytag \ " are not allowed in the same namespace . If you specify a name that ' s already in use in the tag namespace a 409 error is returned . You must also specify a * description * for the tag . It does not have to be unique and you can change it with { #update_tag update_tag } . If no ' validator ' is set on this tag definition then any ( valid ) value can be set for this definedTag . If a ' validator ' is set on this tag definition then the only valid values that can be set for this definedTag those that pass the additional validation imposed by the set ' validator ' .
def create_tag(tag_namespace_id, create_tag_details, opts = {})
      logger.debug 'Calling operation IdentityClient#create_tag.' if logger
      raise "Missing the required parameter 'tag_namespace_id' when calling create_tag." if tag_namespace_id.nil?
      raise "Missing the required parameter 'create_tag_details' when calling create_tag." if create_tag_details.nil?
      raise "Parameter value for 'tag_namespace_id' must not be blank" if OCI::Internal::Util.blank_string?(tag_namespace_id)
      path = '/tagNamespaces/{tagNamespaceId}/tags'.sub('{tagNamespaceId}', tag_namespace_id.to_s)
      operation_signing_strategy = :standard
      query_params = {}
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
      header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
      post_body = @api_client.object_to_http_body(create_tag_details)
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'IdentityClient#create_tag') do
        @api_client.call_api(
          :POST,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'OCI::Identity::Models::Tag'
        )
      end
    end
def create_tag ( tag_namespace_id , create_tag_details , opts = { } ) logger . debug 'Calling operation IdentityClient#create_tag.' if logger raise "Missing the required parameter 'tag_namespace_id' when calling create_tag." if tag_namespace_id . nil? raise "Missing the required parameter 'create_tag_details' when calling create_tag." if create_tag_details . nil? raise "Parameter value for 'tag_namespace_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( tag_namespace_id ) path = '/tagNamespaces/{tagNamespaceId}/tags' . sub ( '{tagNamespaceId}' , tag_namespace_id . to_s ) operation_signing_strategy = :standard query_params = { } header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-retry-token ' ] = opts [ :opc_retry_token ] if opts [ :opc_retry_token ] header_params [ :' opc-retry-token ' ] ||= OCI :: Retry . generate_opc_retry_token post_body = @api_client . object_to_http_body ( create_tag_details ) OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'IdentityClient#create_tag' ) do @api_client . call_api ( :POST , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'OCI::Identity::Models::Tag' ) end end
Creates a new tag in the specified tag namespace.
Creates a new tag in the specified tag namespace .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::Identity::Models::Tag Tag}
A Response object with data of type { OCI :: Identity :: Models :: Tag Tag }
Response
tag_namespace_id
<not_specific>
create_tag_details
<not_specific>
opts
:opc_retry_token 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 .
: opc_retry_token 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 .
<not_specific>
opts the optional parameters
opts the optional parameters