|
Resources
Sample Code and Libraries
C# Library for Amazon EC2
 |
C# Library for Amazon EC2
| Submitted By: |
Elena@AWS
|
| AWS Products Used: |
Amazon EC2 |
| Language(s): |
C# |
| License: |
Apache License 2.0 |
|
|
 |
IMPORTANT: This library has been deprecated and will no longer be updated. We recommend developers switch to the new AWS SDK for .NET, which is almost identical to this library, where you’ll continue to get new feature updates and bug fixes. To learn more about the AWS SDK for .NET, and for support with migration, see http://aws.amazon.com/sdkfornet.
About this Library
- Based on the 2009-08-15 API version.
What's New?
- 2009-09-29:
- Fix typo and response transformation on VpcAttachment
- 2009-09-28:
- 2009-09-23:
- Support for Shared Snapshots API
- 2009-09-10:
- Fix for missing VPC fields on RunningInstance
- 2009-08-25:
- 2009-05-17:
- Support for monitoring API
- 2009-04-09:
- Support for reserved instances API
- 2008-12-26:
- Support empty parameter values
- 2008-12-23:
- Fix for UTF8 url encoding for signature version 2
- 2008-12-17:
- Support for regions, signature version 2, https endpoint.
- 2008-10-21:
- Support for Windows Bundling, new API version - 2008-08-08
- 2008-08-20:
- Initial release, support for Amazon Elastic Block Store
Prerequisites
Package Content
| Directory |
Overview |
|
src
|
Source distribution of the library. All sources including code samples that demonstrate the use of the library located under this directory.
|
Quick Start
Library comes with C# solution and two pre-configured C# projects.
- Amazon.EC2.csproj - main library project
- Amazon.EC2.Samples.csproj - library samples project
To get started with the library, follow these steps:
- Extract the amazon-ec2-2009-08-15-cs-library.zip file into a working directory.
- Open Amazon.EC2.sln solution file in Visual Studio 2005
- Hit F5 key and follow on screen instruction
Running Samples
Steps to run particular sample
- Open AmazonEC2Samples.cs file under Amazon.EC2.Samples project
- Set AWS Access Key ID and AWS Secret Access Key
String accessKeyId = "<Your Access Key ID>";
String secretAccessKey = "<Your Secret Access Key>";
- Set request parameters. For example, find following pre-generated snippet:
// DescribeImagesRequest request = new DescribeImagesRequest();
// @TODO: set request parameters here
// DescribeImagesSample.InvokeDescribeImages(service, request);
- Uncomment first and third line and set ImageId of the image to describe
DescribeImagesRequest request = new DescribeImagesRequest();
request.ImageId.Add("ami-be3adfd7");
DescribeImagesSample.InvokeDescribeImages(service, request);
Hit F5 to run sample. You should see the output
similar to the following:
DescribeImagesResponse
DescribeImagesResult
Image
ImageId
ami-be3adfd7
ImageLocation
ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml
ImageState
available
KernelId
aki-4438dd2d
RamdiskId
ari-4538dd2c
...
Note, to return all images, simply omit specifying ImageId parameter.
Experiment with other samples, examine samples sources. When ready, add library project to your solution, and use it.
Happy coding!
Comments, Questions or Feedback
If you have any comments, questions or feedback on the library, please start discussion here.
|
|
|
Perfect Code , yet One Problem so far.., Oct 27, 2008 3:38 PM
Reviewer: george gergues
Thank you for sharing this code, I have been working on a similar one myself, and there was no way I would have done it that detailed and complete.
One Problem compiling the libary though , I waned to share with the community of users
.
C# is case sensitive , on the file ,
You will need to add those 2 lines at the beaning with the includes
using Amazon.EC2.Util;
using Amazon.EC2.Mock;
Also there is a typo at the middle around
if (!s3.isSetUploadPolicy())
You will need to change that with
if (!s3.IsSetUploadPolicy())
now you can have real Happy Coding :)
sure compiled fine.
Thanks
-George Gergues-
|
|
|
|
 |
|
|