Container for the parameters to the RegisterDomain operation.

Registers a new domain.

Access Control

You can use IAM policies to control this action's access to Amazon SWF resources as follows:

  • You cannot use an IAM policy to control domain access for this action. The name of the domain being registered is available as the resource of this action.
  • Use an Action element to allow or deny permission to call this action.
  • You cannot use an IAM policy to constrain this action's parameters.

If the caller does not have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails by throwing OperationNotPermitted . For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows .

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
示例#1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleWorkflow.Model.RegisterDomainRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.WorkflowExecutionRetentionPeriodInDay != null)
            {
                request.WorkflowExecutionRetentionPeriodInDays = cmdletContext.WorkflowExecutionRetentionPeriodInDay;
            }

            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);
        }
示例#2
0
 /// <summary>
 /// Initiates the asynchronous execution of the RegisterDomain operation.
 /// <seealso cref="Amazon.SimpleWorkflow.AmazonSimpleWorkflow.RegisterDomain"/>
 /// </summary>
 /// 
 /// <param name="registerDomainRequest">Container for the necessary parameters to execute the RegisterDomain operation on
 ///          AmazonSimpleWorkflow.</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>
 public IAsyncResult BeginRegisterDomain(RegisterDomainRequest registerDomainRequest, AsyncCallback callback, object state)
 {
     return invokeRegisterDomain(registerDomainRequest, callback, state, false);
 }
示例#3
0
 IAsyncResult invokeRegisterDomain(RegisterDomainRequest registerDomainRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new RegisterDomainRequestMarshaller().Marshall(registerDomainRequest);
     var unmarshaller = RegisterDomainResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
示例#4
0
 /// <summary>
 /// <para> Registers a new domain. </para>
 /// </summary>
 /// 
 /// <param name="registerDomainRequest">Container for the necessary parameters to execute the RegisterDomain service method on
 ///          AmazonSimpleWorkflow.</param>
 /// 
 /// <exception cref="DomainAlreadyExistsException"/>
 /// <exception cref="OperationNotPermittedException"/>
 /// <exception cref="LimitExceededException"/>
 public RegisterDomainResponse RegisterDomain(RegisterDomainRequest registerDomainRequest)
 {
     IAsyncResult asyncResult = invokeRegisterDomain(registerDomainRequest, null, null, true);
     return EndRegisterDomain(asyncResult);
 }
        /// <summary>
        /// <para> Registers a new domain. </para> <para> <b>Access Control</b> </para> <para>You can use IAM policies to control this action's access
        /// to Amazon SWF resources as follows:</para>
        /// <ul>
        /// <li>You cannot use an IAM policy to control domain access for this action. The name of the domain being registered is available as the
        /// resource of this action.</li>
        /// <li>Use an <c>Action</c> element to allow or deny permission to call this action.</li>
        /// <li>You cannot use an IAM policy to constrain this action's parameters.</li>
        /// 
        /// </ul>
        /// <para>If the caller does not have sufficient permissions to invoke the action, or the parameter values fall outside the specified
        /// constraints, the action fails by throwing <c>OperationNotPermitted</c> . For details and example IAM policies, see <a href="http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a>
        /// .</para>
        /// </summary>
        /// 
        /// <param name="registerDomainRequest">Container for the necessary parameters to execute the RegisterDomain service method on
        /// AmazonSimpleWorkflow.</param>
        /// 
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.DomainAlreadyExistsException" />
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.OperationNotPermittedException" />
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.LimitExceededException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<RegisterDomainResponse> RegisterDomainAsync(RegisterDomainRequest registerDomainRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new RegisterDomainRequestMarshaller();
            var unmarshaller = RegisterDomainResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, RegisterDomainRequest, RegisterDomainResponse>(registerDomainRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
		internal RegisterDomainResponse RegisterDomain(RegisterDomainRequest request)
        {
            var task = RegisterDomainAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterDomain operation.
        /// <seealso cref="Amazon.SimpleWorkflow.IAmazonSimpleWorkflow"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RegisterDomain 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<RegisterDomainResponse> RegisterDomainAsync(RegisterDomainRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new RegisterDomainRequestMarshaller();
            var unmarshaller = RegisterDomainResponseUnmarshaller.Instance;

            return InvokeAsync<RegisterDomainRequest,RegisterDomainResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Registers a new domain. 
        /// 
        ///  
        /// <para>
        /// <b>Access Control</b>
        /// </para>
        ///  
        /// <para>
        /// You can use IAM policies to control this action's access to Amazon SWF resources as
        /// follows:
        /// </para>
        ///  <ul> <li>You cannot use an IAM policy to control domain access for this action. The
        /// name of the domain being registered is available as the resource of this action.</li>
        /// <li>Use an <code>Action</code> element to allow or deny permission to call this action.</li>
        /// <li>You cannot use an IAM policy to constrain this action's parameters.</li> </ul>
        /// 
        /// <para>
        /// If the caller does not have sufficient permissions to invoke the action, or the parameter
        /// values fall outside the specified constraints, the action fails by throwing <code>OperationNotPermitted</code>.
        /// For details and example IAM policies, see <a href="http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using
        /// IAM to Manage Access to Amazon SWF Workflows</a>.
        /// </para>
        ///  
        /// <para>
        /// 
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the RegisterDomain service method.</param>
        /// 
        /// <returns>The response from the RegisterDomain service method, as returned by SimpleWorkflow.</returns>
        /// <exception cref="DomainAlreadyExistsException">
        /// Returned if the specified domain already exists. You will get this fault even if
        /// the existing domain is in deprecated status.
        /// </exception>
        /// <exception cref="LimitExceededException">
        /// Returned by any operation if a system imposed limitation has been reached. To address
        /// this fault you should either clean up unused resources or increase the limit by contacting
        /// AWS.
        /// </exception>
        /// <exception cref="OperationNotPermittedException">
        /// Returned when the caller does not have sufficient permissions to invoke the action.
        /// </exception>
        public RegisterDomainResponse RegisterDomain(RegisterDomainRequest request)
        {
            var marshaller = new RegisterDomainRequestMarshaller();
            var unmarshaller = RegisterDomainResponseUnmarshaller.Instance;

            return Invoke<RegisterDomainRequest,RegisterDomainResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterDomain operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RegisterDomain operation on AmazonSimpleWorkflowClient.</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 EndRegisterDomain
        ///         operation.</returns>
        public IAsyncResult BeginRegisterDomain(RegisterDomainRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new RegisterDomainRequestMarshaller();
            var unmarshaller = RegisterDomainResponseUnmarshaller.Instance;

            return BeginInvoke<RegisterDomainRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// <para> Registers a new domain. </para> <para> <b>Access Control</b> </para> <para>You can use IAM policies to control this action's access
        /// to Amazon SWF resources as follows:</para>
        /// <ul>
        /// <li>You cannot use an IAM policy to control domain access for this action. The name of the domain being registered is available as the
        /// resource of this action.</li>
        /// <li>Use an <c>Action</c> element to allow or deny permission to call this action.</li>
        /// <li>You cannot use an IAM policy to constrain this action's parameters.</li>
        /// 
        /// </ul>
        /// <para>If the caller does not have sufficient permissions to invoke the action, or the parameter values fall outside the specified
        /// constraints, the action fails by throwing <c>OperationNotPermitted</c> . For details and example IAM policies, see <a href="http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a>
        /// .</para>
        /// </summary>
        /// 
        /// <param name="registerDomainRequest">Container for the necessary parameters to execute the RegisterDomain service method on
        /// AmazonSimpleWorkflow.</param>
        /// 
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.DomainAlreadyExistsException" />
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.OperationNotPermittedException" />
        /// <exception cref="T:Amazon.SimpleWorkflow.Model.LimitExceededException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<RegisterDomainResponse> RegisterDomainAsync(RegisterDomainRequest registerDomainRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new RegisterDomainRequestMarshaller();
            var unmarshaller = RegisterDomainResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, RegisterDomainRequest, RegisterDomainResponse>(registerDomainRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
		internal RegisterDomainResponse RegisterDomain(RegisterDomainRequest request)
        {
            var task = RegisterDomainAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
示例#12
0
文件: Program.cs 项目: 40a/Samples
        static void RegisterDomain()
        {
            // Register if the domain is not already registered.
              var listDomainRequest = new ListDomainsRequest()
              {
            RegistrationStatus = RegistrationStatus.REGISTERED
              };

              if (swfClient.ListDomains(listDomainRequest).DomainInfos.Infos.FirstOrDefault(
                                                x => x.Name == domainName) == null)
              {
            RegisterDomainRequest request = new RegisterDomainRequest()
            {
              Name = domainName,
              Description = "Hello World Demo",
              WorkflowExecutionRetentionPeriodInDays = "1"
            };

            Console.WriteLine("Setup: Created Domain - " + domainName);
            swfClient.RegisterDomain(request);
              }
        }
 /// <summary>
 /// <para> Registers a new domain. </para>
 /// </summary>
 /// 
 /// <param name="registerDomainRequest">Container for the necessary parameters to execute the RegisterDomain service method on
 ///           AmazonSimpleWorkflow.</param>
 /// 
 /// <exception cref="DomainAlreadyExistsException"/>
 /// <exception cref="OperationNotPermittedException"/>
 /// <exception cref="LimitExceededException"/>
 public RegisterDomainResponse RegisterDomain(RegisterDomainRequest registerDomainRequest)
 {
     IRequest<RegisterDomainRequest> request = new RegisterDomainRequestMarshaller().Marshall(registerDomainRequest);
     RegisterDomainResponse response = Invoke<RegisterDomainRequest, RegisterDomainResponse> (request, this.signer, RegisterDomainResponseUnmarshaller.GetInstance());
     return response;
 }
示例#14
0
 private Amazon.SimpleWorkflow.Model.RegisterDomainResponse CallAWSServiceOperation(IAmazonSimpleWorkflow client, Amazon.SimpleWorkflow.Model.RegisterDomainRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Simple Workflow Service (SWF)", "RegisterDomain");
     try
     {
         #if DESKTOP
         return(client.RegisterDomain(request));
         #elif CORECLR
         return(client.RegisterDomainAsync(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;
     }
 }