/// <summary> /// Initiates the asynchronous execution of the CreateSubnet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSubnet 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<CreateSubnetResponse> CreateSubnetAsync(CreateSubnetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSubnetRequestMarshaller(); var unmarshaller = CreateSubnetResponseUnmarshaller.Instance; return InvokeAsync<CreateSubnetRequest,CreateSubnetResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void CreateSubnetMarshallTest() { var operation = service_model.FindOperation("CreateSubnet"); var request = InstantiateClassGenerator.Execute<CreateSubnetRequest>(); var marshaller = new CreateSubnetRequestMarshaller(); 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 = CreateSubnetResponseUnmarshaller.Instance.Unmarshall(context) as CreateSubnetResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Creates a subnet in an existing VPC. /// /// /// <para> /// When you create each subnet, you provide the VPC ID and the CIDR block you want for /// the subnet. After you create a subnet, you can't change its CIDR block. The subnet's /// CIDR block can be the same as the VPC's CIDR block (assuming you want only a single /// subnet in the VPC), or a subset of the VPC's CIDR block. If you create more than one /// subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest subnet (and /// VPC) you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 /// netmask (65,536 IP addresses). /// </para> /// <important> /// <para> /// AWS reserves both the first four and the last IP address in each subnet's CIDR block. /// They're not available for use. /// </para> /// </important> /// <para> /// If you add more than one subnet to a VPC, they're set up in a star topology with a /// logical router in the middle. /// </para> /// /// <para> /// If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address /// doesn't change if you stop and restart the instance (unlike a similar instance launched /// outside a VPC, which gets a new IP address when restarted). It's therefore possible /// to have a subnet with no running instances (they're all stopped), but no remaining /// IP addresses available. /// </para> /// /// <para> /// For more information about subnets, see <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html">Your /// VPC and Subnets</a> in the <i>Amazon Virtual Private Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateSubnet service method.</param> /// /// <returns>The response from the CreateSubnet service method, as returned by EC2.</returns> public CreateSubnetResponse CreateSubnet(CreateSubnetRequest request) { var marshaller = new CreateSubnetRequestMarshaller(); var unmarshaller = CreateSubnetResponseUnmarshaller.Instance; return Invoke<CreateSubnetRequest,CreateSubnetResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateSubnet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSubnet 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 EndCreateSubnet /// operation.</returns> public IAsyncResult BeginCreateSubnet(CreateSubnetRequest request, AsyncCallback callback, object state) { var marshaller = new CreateSubnetRequestMarshaller(); var unmarshaller = CreateSubnetResponseUnmarshaller.Instance; return BeginInvoke<CreateSubnetRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeCreateSubnet(CreateSubnetRequest createSubnetRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateSubnetRequestMarshaller().Marshall(createSubnetRequest); var unmarshaller = CreateSubnetResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Creates a subnet in an existing VPC.</para> <para>When you create each subnet, you provide the VPC ID and the CIDR block you want for /// the subnet. After you create a subnet, you can't change its CIDR block. The subnet's CIDR block can be the same as the VPC's CIDR block /// (assuming you want only a single subnet in the VPC), or a subset of the VPC's CIDR block. If you create more than one subnet in a VPC, the /// subnets' CIDR blocks must not overlap. The smallest subnet (and VPC) you can create uses a /28 netmask (16 IP addresses), and the largest /// uses a /16 netmask (65,536 IP addresses).</para> <para><b>IMPORTANT:</b> AWS reserves both the first four and the last IP address in each /// subnet's CIDR block. They're not available for use. </para> <para>If you add more than one subnet to a VPC, they're set up in a star /// topology with a logical router in the middle.</para> <para>For more information about subnets, see <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html">Your VPC and Subnets</a> in the <i>Amazon Virtual Private /// Cloud User Guide</i> .</para> /// </summary> /// /// <param name="createSubnetRequest">Container for the necessary parameters to execute the CreateSubnet service method on AmazonEC2.</param> /// /// <returns>The response from the CreateSubnet 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<CreateSubnetResponse> CreateSubnetAsync(CreateSubnetRequest createSubnetRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSubnetRequestMarshaller(); var unmarshaller = CreateSubnetResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateSubnetRequest, CreateSubnetResponse>(createSubnetRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateSubnet operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CreateSubnet"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateSubnet 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<CreateSubnetResponse> CreateSubnetAsync(CreateSubnetRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateSubnetRequestMarshaller(); var unmarshaller = CreateSubnetResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateSubnetRequest, CreateSubnetResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }