Container for the parameters to the CreateLogGroup operation. Creates a log group with the specified name.

You can create up to 5000 log groups per account.

You must use the following guidelines when naming a log group:

  • Log group names must be unique within a region for an AWS account.

  • Log group names can be between 1 and 512 characters long.

  • Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).

Inheritance: AmazonCloudWatchLogsRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudWatchLogs.Model.CreateLogGroupRequest();

            if (cmdletContext.KmsKeyId != null)
            {
                request.KmsKeyId = cmdletContext.KmsKeyId;
            }
            if (cmdletContext.LogGroupName != null)
            {
                request.LogGroupName = cmdletContext.LogGroupName;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateLogGroup operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CreateLogGroupResponse> CreateLogGroupAsync(CreateLogGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateLogGroupRequestMarshaller();
            var unmarshaller = CreateLogGroupResponseUnmarshaller.Instance;

            return InvokeAsync<CreateLogGroupRequest,CreateLogGroupResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Creates a new log group with the specified name. The name of the log group must be
        /// unique within a region for an AWS account. You can create up to 500 log groups per
        /// account. 
        /// 
        ///  
        /// <para>
        ///  You must use the following guidelines when naming a log group: <ul> <li>Log group
        /// names can be between 1 and 512 characters long.</li> <li>Allowed characters are a-z,
        /// A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).</li>
        /// </ul> 
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup service method.</param>
        /// 
        /// <returns>The response from the CreateLogGroup service method, as returned by CloudWatchLogs.</returns>
        /// <exception cref="Amazon.CloudWatchLogs.Model.InvalidParameterException">
        /// Returned if a parameter of the request is incorrectly specified.
        /// </exception>
        /// <exception cref="Amazon.CloudWatchLogs.Model.LimitExceededException">
        /// Returned if you have reached the maximum number of resources that can be created.
        /// </exception>
        /// <exception cref="Amazon.CloudWatchLogs.Model.OperationAbortedException">
        /// Returned if multiple requests to update the same resource were in conflict.
        /// </exception>
        /// <exception cref="Amazon.CloudWatchLogs.Model.ResourceAlreadyExistsException">
        /// Returned if the specified resource already exists.
        /// </exception>
        /// <exception cref="Amazon.CloudWatchLogs.Model.ServiceUnavailableException">
        /// Returned if the service cannot complete the request.
        /// </exception>
        public CreateLogGroupResponse CreateLogGroup(CreateLogGroupRequest request)
        {
            var marshaller = new CreateLogGroupRequestMarshaller();
            var unmarshaller = CreateLogGroupResponseUnmarshaller.Instance;

            return Invoke<CreateLogGroupRequest,CreateLogGroupResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateLogGroup operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup operation on AmazonCloudWatchLogsClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateLogGroup
        ///         operation.</returns>
        public IAsyncResult BeginCreateLogGroup(CreateLogGroupRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateLogGroupRequestMarshaller();
            var unmarshaller = CreateLogGroupResponseUnmarshaller.Instance;

            return BeginInvoke<CreateLogGroupRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 private Amazon.CloudWatchLogs.Model.CreateLogGroupResponse CallAWSServiceOperation(IAmazonCloudWatchLogs client, Amazon.CloudWatchLogs.Model.CreateLogGroupRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch Logs", "CreateLogGroup");
     try
     {
         #if DESKTOP
         return(client.CreateLogGroup(request));
         #elif CORECLR
         return(client.CreateLogGroupAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        IAsyncResult invokeCreateLogGroup(CreateLogGroupRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new CreateLogGroupRequestMarshaller();
            var unmarshaller = CreateLogGroupResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateLogGroup operation.
 /// <seealso cref="Amazon.CloudWatchLogs.IAmazonCloudWatchLogs"/>
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup operation on AmazonCloudWatchLogsClient.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateLogGroup
 ///         operation.</returns>
 public IAsyncResult BeginCreateLogGroup(CreateLogGroupRequest request, AsyncCallback callback, object state)
 {
     return invokeCreateLogGroup(request, callback, state, false);
 }
 /// <summary>
 /// Creates a new log group with the specified name. The name of the log group must be
 /// unique within a region for an AWS account. You can create up to 500 log groups per
 /// account. 
 /// 
 ///  
 /// <para>
 ///  You must use the following guidelines when naming a log group: <ul> <li>Log group
 /// names can be between 1 and 512 characters long.</li> <li>Allowed characters are a-z,
 /// A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).</li>
 /// </ul> 
 /// </para>
 /// </summary>
 /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup service method.</param>
 /// 
 /// <returns>The response from the CreateLogGroup service method, as returned by CloudWatchLogs.</returns>
 /// <exception cref="InvalidParameterException">
 /// Returned if a parameter of the request is incorrectly specified.
 /// </exception>
 /// <exception cref="LimitExceededException">
 /// Returned if you have reached the maximum number of resources that can be created.
 /// </exception>
 /// <exception cref="OperationAbortedException">
 /// Returned if multiple requests to update the same resource were in conflict.
 /// </exception>
 /// <exception cref="ResourceAlreadyExistsException">
 /// Returned if the specified resource already exists.
 /// </exception>
 /// <exception cref="ServiceUnavailableException">
 /// Returned if the service cannot complete the request.
 /// </exception>
 public CreateLogGroupResponse CreateLogGroup(CreateLogGroupRequest request)
 {
     IAsyncResult asyncResult = invokeCreateLogGroup(request, null, null, true);
     return EndCreateLogGroup(asyncResult);
 }
 /// <summary>
 /// Creates a new log group with the specified name. The name of the log group must be
 /// unique within a region for an AWS account. You can create up to 500 log groups per
 /// account. 
 /// 
 ///  
 /// <para>
 ///  You must use the following guidelines when naming a log group: <ul> <li>Log group
 /// names can be between 1 and 512 characters long.</li> <li>Allowed characters are a-z,
 /// A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).</li>
 /// </ul> 
 /// </para>
 /// </summary>
 /// <param name="request">Container for the necessary parameters to execute the CreateLogGroup service method.</param>
 /// 
 /// <returns>The response from the CreateLogGroup service method, as returned by CloudWatchLogs.</returns>
 /// <exception cref="InvalidParameterException">
 /// Returned if a parameter of the request is incorrectly specified.
 /// </exception>
 /// <exception cref="LimitExceededException">
 /// Returned if you have reached the maximum number of resources that can be created.
 /// </exception>
 /// <exception cref="OperationAbortedException">
 /// Returned if multiple requests to update the same resource were in conflict.
 /// </exception>
 /// <exception cref="ResourceAlreadyExistsException">
 /// Returned if the specified resource already exists.
 /// </exception>
 /// <exception cref="ServiceUnavailableException">
 /// Returned if the service cannot complete the request.
 /// </exception>
 public CreateLogGroupResponse CreateLogGroup(CreateLogGroupRequest request)
 {
     var task = CreateLogGroupAsync(request);
     try
     {
         return task.Result;
     }
     catch(AggregateException e)
     {
         ExceptionDispatchInfo.Capture(e.InnerException).Throw();
         return null;
     }
 }