OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// 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 UpdateTag.
/// </summary>
/// <param name="createRequest"></param>
/// <returns></returns>
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 UpdateTag.
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 UpdateTag .
public CreateTagResponse CreateTag(CreateTagRequest createRequest)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.TagNamespaces, this.Region)}/{createRequest.TagNamespaceId}/tags");
            using (var webResponse = this.RestClient.Post(uri, createRequest.CreateTagDetails, new HttpRequestHeaderParam() { OpcRetryToken = createRequest.OpcRetryToken }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new CreateTagResponse()
                {
                    Tag = JsonSerializer.Deserialize<Tag>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id")
                };
            }
        }
public CreateTagResponse CreateTag ( CreateTagRequest createRequest ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . TagNamespaces , this . Region ) } / { createRequest . TagNamespaceId } /tags " ) ; using ( var webResponse = this . RestClient . Post ( uri , createRequest . CreateTagDetails , new HttpRequestHeaderParam ( ) { OpcRetryToken = createRequest . OpcRetryToken } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new CreateTagResponse ( ) { Tag = JsonSerializer . Deserialize < Tag > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) } ; } }
Creates a new tag in the specified tag namespace.
Creates a new tag in the specified tag namespace .
None
createRequest
CreateTagRequest
None