/// <summary> /// Initiates the asynchronous execution of the CreateSecurityGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSecurityGroup 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<CreateSecurityGroupResponse> CreateSecurityGroupAsync(CreateSecurityGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSecurityGroupRequestMarshaller(); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateSecurityGroupRequest,CreateSecurityGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void CreateSecurityGroupMarshallTest() { var operation = service_model.FindOperation("CreateSecurityGroup"); var request = InstantiateClassGenerator.Execute<CreateSecurityGroupRequest>(); var marshaller = new CreateSecurityGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData()); var response = CreateSecurityGroupResponseUnmarshaller.Instance.Unmarshall(context) as CreateSecurityGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Creates a security group. /// /// /// <para> /// A security group is for use with instances either in the EC2-Classic platform or in /// a specific VPC. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Amazon /// EC2 Security Groups</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> and /// <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html">Security /// Groups for Your VPC</a> in the <i>Amazon Virtual Private Cloud User Guide</i>. /// </para> /// <important> /// <para> /// EC2-Classic: You can have up to 500 security groups. /// </para> /// /// <para> /// EC2-VPC: You can create up to 100 security groups per VPC. /// </para> /// </important> /// <para> /// When you create a security group, you specify a friendly name of your choice. You /// can have a security group for use in EC2-Classic with the same name as a security /// group for use in a VPC. However, you can't have two security groups for use in EC2-Classic /// with the same name or two security groups for use in a VPC with the same name. /// </para> /// /// <para> /// You have a default security group for use in EC2-Classic and a default security group /// for use in your VPC. If you don't specify a security group when you launch an instance, /// the instance is launched into the appropriate default security group. A default security /// group includes a default rule that grants instances unrestricted network access to /// each other. /// </para> /// /// <para> /// You can add or remove rules from your security groups using <a>AuthorizeSecurityGroupIngress</a>, /// <a>AuthorizeSecurityGroupEgress</a>, <a>RevokeSecurityGroupIngress</a>, and <a>RevokeSecurityGroupEgress</a>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateSecurityGroup service method.</param> /// /// <returns>The response from the CreateSecurityGroup service method, as returned by EC2.</returns> public CreateSecurityGroupResponse CreateSecurityGroup(CreateSecurityGroupRequest request) { var marshaller = new CreateSecurityGroupRequestMarshaller(); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.Instance; return Invoke<CreateSecurityGroupRequest,CreateSecurityGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateSecurityGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSecurityGroup operation on AmazonEC2Client.</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 EndCreateSecurityGroup /// operation.</returns> public IAsyncResult BeginCreateSecurityGroup(CreateSecurityGroupRequest request, AsyncCallback callback, object state) { var marshaller = new CreateSecurityGroupRequestMarshaller(); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.Instance; return BeginInvoke<CreateSecurityGroupRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeCreateSecurityGroup(CreateSecurityGroupRequest createSecurityGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateSecurityGroupRequestMarshaller().Marshall(createSecurityGroupRequest); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Creates a security group.</para> <para>A security group is for use with instances either in the EC2-Classic platform or in a specific /// VPC. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Amazon EC2 Security /// Groups</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> and <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html">Security Groups for Your VPC</a> in the <i>Amazon /// Virtual Private Cloud User Guide</i> .</para> <para><b>IMPORTANT:</b> EC2-Classic: You can have up to 500 security groups. EC2-VPC: You can /// create up to 100 security groups per VPC. </para> <para>When you create a security group, you specify a friendly name of your choice. You /// can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two /// security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.</para> <para>You have /// a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when /// you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default /// rule that grants instances unrestricted network access to each other.</para> <para>You can add or remove rules from your security groups /// using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.</para> /// </summary> /// /// <param name="createSecurityGroupRequest">Container for the necessary parameters to execute the CreateSecurityGroup service method on /// AmazonEC2.</param> /// /// <returns>The response from the CreateSecurityGroup service method, as returned by AmazonEC2.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateSecurityGroupResponse> CreateSecurityGroupAsync(CreateSecurityGroupRequest createSecurityGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSecurityGroupRequestMarshaller(); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateSecurityGroupRequest, CreateSecurityGroupResponse>(createSecurityGroupRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateSecurityGroup operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CreateSecurityGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSecurityGroup 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 async Task<CreateSecurityGroupResponse> CreateSecurityGroupAsync(CreateSecurityGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSecurityGroupRequestMarshaller(); var unmarshaller = CreateSecurityGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateSecurityGroupRequest, CreateSecurityGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }