forked from aws/aws-sdk-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The CreateDefaultVPC API enables you to create a new default VPC . Yo…
…u no longer need to contact AWS support, if your default VPC has been deleted.
- Loading branch information
1 parent
149f1c3
commit 4332ac8
Showing
12 changed files
with
613 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
sdk/src/Services/EC2/Generated/Model/CreateDefaultVpcRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
using System.Text; | ||
using System.IO; | ||
|
||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
|
||
namespace Amazon.EC2.Model | ||
{ | ||
/// <summary> | ||
/// Container for the parameters to the CreateDefaultVpc operation. | ||
/// Creates a default VPC with a size <code>/16</code> IPv4 CIDR block and a default subnet | ||
/// in each Availability Zone. For more information about the components of a default | ||
/// VPC, see <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html">Default | ||
/// VPC and Default Subnets</a> in the <i>Amazon Virtual Private Cloud User Guide</i>. | ||
/// You cannot specify the components of the default VPC yourself. | ||
/// | ||
/// | ||
/// <para> | ||
/// You can create a default VPC if you deleted your previous default VPC. You cannot | ||
/// have more than one default VPC per region. | ||
/// </para> | ||
/// | ||
/// <para> | ||
/// If your account supports EC2-Classic, you cannot use this action to create a default | ||
/// VPC in a region that supports EC2-Classic. If you want a default VPC in a region that | ||
/// supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. | ||
/// Is that possible?" in the <a href="http://aws.amazon.com/vpc/faqs/#Default_VPCs">Default | ||
/// VPCs FAQ</a>. | ||
/// </para> | ||
/// </summary> | ||
public partial class CreateDefaultVpcRequest : AmazonEC2Request | ||
{ | ||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
sdk/src/Services/EC2/Generated/Model/CreateDefaultVpcResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
using System.Text; | ||
using System.IO; | ||
|
||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
|
||
namespace Amazon.EC2.Model | ||
{ | ||
/// <summary> | ||
/// Contains the output of CreateDefaultVpc. | ||
/// </summary> | ||
public partial class CreateDefaultVpcResponse : AmazonWebServiceResponse | ||
{ | ||
private Vpc _vpc; | ||
|
||
/// <summary> | ||
/// Gets and sets the property Vpc. | ||
/// <para> | ||
/// Information about the VPC. | ||
/// </para> | ||
/// </summary> | ||
public Vpc Vpc | ||
{ | ||
get { return this._vpc; } | ||
set { this._vpc = value; } | ||
} | ||
|
||
// Check to see if Vpc property is set | ||
internal bool IsSetVpc() | ||
{ | ||
return this._vpc != null; | ||
} | ||
|
||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...EC2/Generated/Model/Internal/MarshallTransformations/CreateDefaultVpcRequestMarshaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Text; | ||
using System.Xml.Serialization; | ||
|
||
using Amazon.EC2.Model; | ||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
using Amazon.Runtime.Internal.Transform; | ||
using Amazon.Runtime.Internal.Util; | ||
namespace Amazon.EC2.Model.Internal.MarshallTransformations | ||
{ | ||
/// <summary> | ||
/// CreateDefaultVpc Request Marshaller | ||
/// </summary> | ||
public class CreateDefaultVpcRequestMarshaller : IMarshaller<IRequest, CreateDefaultVpcRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> | ||
{ | ||
/// <summary> | ||
/// Marshaller the request object to the HTTP request. | ||
/// </summary> | ||
/// <param name="input"></param> | ||
/// <returns></returns> | ||
public IRequest Marshall(AmazonWebServiceRequest input) | ||
{ | ||
return this.Marshall((CreateDefaultVpcRequest)input); | ||
} | ||
|
||
/// <summary> | ||
/// Marshaller the request object to the HTTP request. | ||
/// </summary> | ||
/// <param name="publicRequest"></param> | ||
/// <returns></returns> | ||
public IRequest Marshall(CreateDefaultVpcRequest publicRequest) | ||
{ | ||
IRequest request = new DefaultRequest(publicRequest, "Amazon.EC2"); | ||
request.Parameters.Add("Action", "CreateDefaultVpc"); | ||
request.Parameters.Add("Version", "2016-11-15"); | ||
|
||
if(publicRequest != null) | ||
{ | ||
} | ||
return request; | ||
} | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
.../Generated/Model/Internal/MarshallTransformations/CreateDefaultVpcResponseUnmarshaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Xml.Serialization; | ||
|
||
using Amazon.EC2.Model; | ||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
using Amazon.Runtime.Internal.Transform; | ||
using Amazon.Runtime.Internal.Util; | ||
namespace Amazon.EC2.Model.Internal.MarshallTransformations | ||
{ | ||
/// <summary> | ||
/// Response Unmarshaller for CreateDefaultVpc operation | ||
/// </summary> | ||
public class CreateDefaultVpcResponseUnmarshaller : EC2ResponseUnmarshaller | ||
{ | ||
/// <summary> | ||
/// Unmarshaller the response from the service to the response class. | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <returns></returns> | ||
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) | ||
{ | ||
CreateDefaultVpcResponse response = new CreateDefaultVpcResponse(); | ||
|
||
int originalDepth = context.CurrentDepth; | ||
int targetDepth = originalDepth + 1; | ||
if (context.IsStartOfDocument) | ||
targetDepth = 2; | ||
|
||
while (context.ReadAtDepth(originalDepth)) | ||
{ | ||
if (context.IsStartElement || context.IsAttribute) | ||
{ | ||
|
||
if (context.TestExpression("vpc", targetDepth)) | ||
{ | ||
var unmarshaller = VpcUnmarshaller.Instance; | ||
response.Vpc = unmarshaller.Unmarshall(context); | ||
continue; | ||
} | ||
} | ||
} | ||
|
||
return response; | ||
} | ||
|
||
/// <summary> | ||
/// Unmarshaller error response to exception. | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <param name="innerException"></param> | ||
/// <param name="statusCode"></param> | ||
/// <returns></returns> | ||
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) | ||
{ | ||
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); | ||
return new AmazonEC2Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); | ||
} | ||
private static CreateDefaultVpcResponseUnmarshaller _instance = new CreateDefaultVpcResponseUnmarshaller(); | ||
|
||
internal static CreateDefaultVpcResponseUnmarshaller GetInstance() | ||
{ | ||
return _instance; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the singleton. | ||
/// </summary> | ||
public static CreateDefaultVpcResponseUnmarshaller Instance | ||
{ | ||
get | ||
{ | ||
return _instance; | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.