Commit 446d343a63c26a44b6a4d4d2c52d7b5ef61d26d2

Stephen Moloney 2016-02-18T22:40:35

add more examples to readme

diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/CHANGELOG.md
diff --git a/README.md b/README.md
index 7319dd9..71ecb95 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,7 @@ Add the supervisor to your supervision tree:
   end
   ```
 
-# SHOW HOW TO ADD ANOTHER CLIENT HERE .... LATER.....
+## SHOW HOW TO ADD ANOTHER CLIENT HERE LATER.....
 
 
 ## Example Usage(s)
@@ -138,7 +138,6 @@ Add the supervisor to your supervision tree:
 ### Example 1: 
 
 
-
 Get account details and containers for given account
   ```elixir
   alias ExOvh.Query.Openstack.Swift, as: Query
@@ -167,9 +166,41 @@ Get the count of containers again
   ```
   
   
+### Example 2: 
+
+Adding an object to the "default" container in OVH Webstorage
+
+    import ExOvh.Query.Openstack.Swift
+    alias ExOvh.Ovh.OpenstackApi.Webstorage.Cache, as: OpenCache
+    client = ExOvh
+    service = "cdnwebstorage-<your_service_name>"
+    account = OpenCache.get_account(client, service)
+    
+    object_name = "client_file.txt"
+    client_object = Kernel.to_string(:code.priv_dir(:ex_ovh)) <> "/" <> object_name
+    container = "default"
+    server_object = String.replace(object_name, "client", "server")
+    create_file_request = create_object(account, container, client_object, server_object)
+    
+    ExOvh.ovh_request(create_file_request, %{ openstack: :true, webstorage: service })
 
 
-# TO BE CONTINUED..... LATER ....
+# Listing all objects for "default" container to see if the new `server_object` is there.
+
+    import ExOvh.Query.Openstack.Swift
+    alias ExOvh.Ovh.OpenstackApi.Webstorage.Cache, as: OpenCache
+    client = ExOvh
+    service = "cdnwebstorage-<your_service_name>"
+    account = OpenCache.get_account(client, service)
+    request = get_objects(account, "default")
+    
+    {:ok, resp} = ExOvh.ovh_request(request, %{ openstack: :true, webstorage: service })
+    objects = Enum.map(resp.body, &(Map.get(&1, "name")))
+    
+    Enum.member?(objects, server_object)
+      
+
+## Add more examples ....