Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix s3 csharp doc #7027

Merged
merged 5 commits into from Jan 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions doc/radosgw/s3/csharp.rst
Expand Up @@ -21,7 +21,7 @@ This creates a connection so that you can interact with the server.
AmazonS3Config config = new AmazonS3Config();
config.ServiceURL = "objects.dreamhost.com";

AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(
AmazonS3Client s3Client = new AmazonS3Client(
accessKey,
secretKey,
config
Expand All @@ -36,7 +36,7 @@ This also prints out the bucket name and creation date of each bucket.

.. code-block:: csharp

ListBucketResponse response = client.ListBuckets();
ListBucketsResponse response = client.ListBuckets();
foreach (S3Bucket b in response.Buckets)
{
Console.WriteLine("{0}\t{1}", b.BucketName, b.CreationDate);
Expand Down Expand Up @@ -112,7 +112,7 @@ This creates a file ``hello.txt`` with the string ``"Hello World!"``
.. code-block:: csharp

PutObjectRequest request = new PutObjectRequest();
request.Bucket = "my-new-bucket";
request.BucketName = "my-new-bucket";
request.Key = "hello.txt";
request.ContentType = "text/plain";
request.ContentBody = "Hello World!";
Expand All @@ -127,17 +127,17 @@ This makes the object ``hello.txt`` to be publicly readable, and

.. code-block:: csharp

SetACLRequest request = new SetACLRequest();
PutACLRequest request = new PutACLRequest();
request.BucketName = "my-new-bucket";
request.Key = "hello.txt";
request.CannedACL = S3CannedACL.PublicRead;
client.SetACL(request);
client.PutACL(request);

SetACLRequest request2 = new SetACLRequest();
PutACLRequest request2 = new PutACLRequest();
request2.BucketName = "my-new-bucket";
request2.Key = "secret_plans.txt";
request2.CannedACL = S3CannedACL.Private;
client.SetACL(request2);
client.PutACL(request2);


Download an Object (to a file)
Expand All @@ -150,7 +150,7 @@ This downloads the object ``perl_poetry.pdf`` and saves it in

GetObjectRequest request = new GetObjectRequest();
request.BucketName = "my-new-bucket";
request.Key = "perl_poetry.pdf"
request.Key = "perl_poetry.pdf";
GetObjectResponse response = client.GetObject(request);
response.WriteResponseStreamToFile("C:\\Users\\larry\\Documents\\perl_poetry.pdf");

Expand Down