merge the docs out of separate folder and back into the modules
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
diff --git a/README.md b/README.md
index f415bd7..f29dc6e 100644
--- a/README.md
+++ b/README.md
@@ -92,7 +92,7 @@ Cloudstorage.Query.get_containers(service_name) |> ExOvh.request!()
- [ ] Tests for OVH portion of library
- [ ] Option to set the application ttl when running ovh mix task.
-- [ ] Add queries for the remainder of the OVH API. (Webstorage CDN and Cloud are the only ones covered so far)
+- [ ] Add queries for the remainder of the OVH API. (~~Webstorage CDN~~ (now a deprecated service) and Cloud are the only ones covered so far)
- [ ] Basic examples to be added to readme of usage of the api.
- [ ] Add macro for building queries.
- [ ] Write the usage guide - more examples of using the API.
diff --git a/lib/ex_ovh/client.ex b/lib/ex_ovh/client.ex
index 446f5a3..6f742e3 100644
--- a/lib/ex_ovh/client.ex
+++ b/lib/ex_ovh/client.ex
@@ -1,10 +1,73 @@
defmodule ExOvh.Client do
- @moduledoc Module.concat(__MODULE__, Docs).moduledoc()
+ @moduledoc ~s"""
+ A behaviour for setting up an OVH client.
+
+ ## Example setting up the `ExOvh` Client
+
+ Defining a client:
+
+ defmodule ExOvh do
+ @moduledoc :false
+ use ExOvh.Client, otp_app: :ex_ovh, client: __MODULE__
+ end
+
+ Configuring a client:
+
+ config :ex_ovh,
+ ovh: [
+ application_key: System.get_env("EX_OVH_APPLICATION_KEY"),
+ application_secret: System.get_env("EX_OVH_APPLICATION_SECRET"),
+ consumer_key: System.get_env("EX_OVH_CONSUMER_KEY"),
+ endpoint: "ovh-eu",
+ api_version: "1.0"
+ ],
+ httpoison: [
+ connect_timeout: 20000,
+ receive_timeout: 100000
+ ]
+
+ ## Example using the `ExOvh` client
+
+ %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> ExOvh.request!()
+ %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> ExOvh.request!()
+
+ ## Example (2): Setting up an additional `MyApp.MyClient` client.
+
+ Defining the `MyApp.MyClient`
+
+ defmodule MyApp.MyClient do
+ @moduledoc :false
+ use ExOvh.Client, otp_app: :my_app
+ end
+
+ Configuring the `MyApp.MyClient`
+
+ config :my_app, MyApp.MyClient,
+ ovh: [
+ application_key: System.get_env("MY_APP_MY_CLIENT_APPLICATION_KEY"),
+ application_secret: System.get_env("MY_APP_MY_CLIENT_APPLICATION_SECRET"),
+ consumer_key: System.get_env("MY_APP_MY_CLIENT_CONSUMER_KEY")
+ ],
+ httpoison: [ # optional
+ connect_timeout: 20000,
+ receive_timeout: 100000
+ ]
+
+ ## Example using the `MyApp.MyClient` client
+
+ %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> MyApp.MyClient.request!()
+ %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> MyApp.MyClient.request!()
+ """
alias ExOvh.{HttpQuery, Query, Response, Transformation}
defmacro __using__(opts) do
quote bind_quoted: [opts: opts] do
- @moduledoc Module.concat(ExOvh.Client, Docs).ovh_client_docs()
+
+ @moduledoc ~s"""
+ A default client for sending requests to the [OVH API](https://api.ovh.com/console/).
+
+ `ExOvh` is the default client. Additional clients such as `MyApp.MyClient.Ovh` can be created - see `PAGES`.
+ """
alias ExOvh.{Defaults, HttpQuery, Query, Request, Response, ResponseError}
@behaviour ExOvh.Client
diff --git a/lib/ex_ovh/docs/client.ex b/lib/ex_ovh/docs/client.ex
deleted file mode 100644
index 5514b25..0000000
--- a/lib/ex_ovh/docs/client.ex
+++ /dev/null
@@ -1,79 +0,0 @@
-defmodule ExOvh.Client.Docs do
- @moduledoc :false
-
- @doc :false
- def moduledoc() do
- ~s"""
- A behaviour for setting up an OVH client.
-
- ## Example (1): Setting up the `ExOvh` Client
-
- Defining a client:
-
- defmodule ExOvh do
- @moduledoc :false
- use ExOvh.Client, otp_app: :ex_ovh, client: __MODULE__
- end
-
- Configuring a client:
-
- config :ex_ovh,
- ovh: [
- application_key: System.get_env("EX_OVH_APPLICATION_KEY"),
- application_secret: System.get_env("EX_OVH_APPLICATION_SECRET"),
- consumer_key: System.get_env("EX_OVH_CONSUMER_KEY"),
- endpoint: "ovh-eu",
- api_version: "1.0"
- ],
- httpoison: [ # optional
- connect_timeout: 20000,
- receive_timeout: 100000
- ]
-
- ## Example using the `ExOvh` client
-
- %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> ExOvh.request!()
- %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> ExOvh.request!()
-
- ## Example (2): Setting up an additional `MyApp.MyClient` client.
-
- Defining the `MyApp.MyClient`
-
- defmodule MyApp.MyClient do
- @moduledoc :false
- use ExOvh.Client, otp_app: :my_app
- end
-
- Configuring the `MyApp.MyClient`
-
- config :my_app, MyApp.MyClient,
- ovh: [
- application_key: System.get_env("MY_APP_MY_CLIENT_APPLICATION_KEY"),
- application_secret: System.get_env("MY_APP_MY_CLIENT_APPLICATION_SECRET"),
- consumer_key: System.get_env("MY_APP_MY_CLIENT_CONSUMER_KEY")
- # if left out, :endpoint will default to "ovh-eu"
- # if left out, :api_version will default to "1.0"
- ],
- httpoison: [ # optional
- connect_timeout: 20000,
- receive_timeout: 100000
- ]
-
- ## Example using the `MyApp.MyClient` client
-
- %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> MyApp.MyClient.request!()
- %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> MyApp.MyClient.request!()
- """
- end
-
-
- @doc :false
- def ovh_client_docs() do
- ~s"""
- A default client for sending requests to the [OVH API](https://api.ovh.com/console/).
-
- `ExOvh` is the default client. Additional clients such as `MyApp.MyClient.Ovh` can be created - see `PAGES`.
- """
- end
-
-end
\ No newline at end of file
diff --git a/lib/ex_ovh/docs/cloud_query.ex b/lib/ex_ovh/docs/cloud_query.ex
deleted file mode 100644
index 9cf4ecd..0000000
--- a/lib/ex_ovh/docs/cloud_query.ex
+++ /dev/null
@@ -1,57 +0,0 @@
-defmodule ExOvh.Services.V1.Cloud.Query.Docs do
- @moduledoc :false
-
- @doc :false
- def moduledoc() do
- ~s"""
- Helper functions for building queries directed at the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
-
- ## Functions Summary
-
- | Function | Description | OVH API call |
- |---|---|---|
- | `list_services/0` | <small>List available services or list available cloud projects. A returned project id in OVH terms is similar to a tenant id in swift terms</small> | <sub><sup>GET /cloud/project</sup></sub> |
- | `get_users/1` | <small>Get all users</small> | <sub><sup>GET /cloud/project/{serviceName}/user</sup></sub> |
- | `create_user/2` | <small>Create user</small> | <sub><sup>POST /ctsloud/project/{serviceName}/user</sup></sub> |
- | `get_user_details/2` | <small>Get user details. Returns the user_id and username and other details.</small> | <sub><sup>GET /cloud/project/{serviceName}/user/{userId}</sup></sub> |
- | `delete_user/2` | <small>Delete user</small> | <sub><sup>DELETE /cloud/project/{serviceName}/user/{userId}</sup></sub> |
- | `download_openrc_script/3` | <small>Get RC file of OpenStack</small> | <sub><sup>GET /cloud/project/{serviceName}/user/{userId}/openrc</sup></sub> |
- | `regenerate_credentials/2` | <small>Regenerate user credentials including password</small> | <sub><sup>POST /cloud/project/{serviceName}/user/{userId}/regeneratePassword</sup></sub> |
- | `swift_identity/3` | <small>Gets a json object similar to that returned by Keystone Identity. Includes the 'X-Auth-Token'</small> | <sub><sup>POST /cloud/project/{serviceName}/user/{userId}/token</sup></sub> |
- | `create_project/2` | <small>Start a new cloud project in the OVH cloud. Corresponds to creating a new Swift stack with a new tenant_id.</small> | <sub><sup>POST /cloud/createProject</sup></sub> |
- | `get_prices/2` | <small>Get Prices for OVH cloud services.</small> | <sub><sup>GET /cloud/price</sup></sub> |
- | `project_info/1` | <small>Get information about a project with the project_id (tenant_id)</small> | <sub><sup>GET /cloud/project/{serviceName}</sup></sub> |
- | `modify_project/2` | <small>Modify a project properties. Change the project description.</small> | <sub><sup>PUT /cloud/project/{serviceName}</sup></sub> |
- | `project_administrative_info/1` | <small>Get administration information about the project.</small> | <sub><sup>GET /cloud/project/{serviceName}/serviceInfos</sup></sub> |
- | `project_quotas/1` | <small>Get project quotas.</small> | <sub><sup>GET /cloud/project/{serviceName}/quota</sup></sub> |
- | `project_regions/1` | <small>Get project regions.</small> | <sub><sup>GET /cloud/project/{serviceName}/region</sup></sub> |
- | `project_region_info/2` | <small>Get details about a project region.</small> | <sub><sup>GET /cloud/project/{serviceName}/region/{regionName}</sup></sub> |
- | `project_consumption/3` | <small>Get details about a project consumption for a given `date_from` and `date_to`.</small> | <sub><sup>GET /cloud/project/{serviceName}/consumption</sup></sub> |
- | `project_bills/3` | <small>Get details about a project billing for a given `date_from` and `date_to`..</small> | <sub><sup>GET /cloud/project/{serviceName}/bill</sup></sub> |
- | `create_project_alert/4` | <small>Add a new project alert</small> | <sub><sup>POST /cloud/project/{serviceName}/alerting</sup></sub> |
- | `get_project_alert_info/2` | <small>Get detailed information about a project alert.</small> | <sub><sup>GET /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
- | `modify_project_alert/5` | <small>Modify an existing project alert.</small> | <sub><sup>PUT /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
- | `delete_project_alert/2` | <small>Delete an existing project alert.</small> | <sub><sup>DELETE /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
- | `terminate_service/2` | <small>Terminate a cloud project.</small> | <sub><sup>POST /cloud/project/{serviceName}/terminate</sup></sub> |
-
-
- ## TO BE ADDED
-
- GET /cloud/project/{serviceName}/acl
- POST /cloud/project/{serviceName}/acl
- GET /cloud/project/{serviceName}/acl/{accountId}
- DELETE /cloud/project/{serviceName}/acl/{accountId}
-
- ## Notes
-
- - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
-
-
- ## Example
-
- ExOvh.Services.V1.Cloud.Cloudstorage.Query.get_containers(service_name) |> ExOvh.request!()
- """
- end
-
-
-end
\ No newline at end of file
diff --git a/lib/ex_ovh/docs/cloudstorage_query.ex b/lib/ex_ovh/docs/cloudstorage_query.ex
deleted file mode 100644
index 7acfaf8..0000000
--- a/lib/ex_ovh/docs/cloudstorage_query.ex
+++ /dev/null
@@ -1,34 +0,0 @@
-defmodule ExOvh.Services.V1.Cloud.Cloudstorage.Query.Docs do
- @moduledoc :false
-
- @doc :false
- def moduledoc() do
- ~s"""
- Helper functions for building queries directed at the cloudstorage related parts of the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
-
- See `ExOvh.Services.V1.Cloud.Query` for generic cloud requests.
-
- ## Functions Summary
-
- | Function | Description | OVH API call |
- |---|---|---|
- | `get_containers/1` | <small>Get containers for a given swift tenant id (project id or ovh service name)</small> | <sub><sup>GET /cloud/project/{serviceName}/storage </sup></sub> |
- | `create_container/3` | <small>Create a container for a given tenant_id (ovh service_name), a container and a region.</small> | <sub><sup>POST /cloud/project/{serviceName}/storage</sup></sub> |
- | `get_access/1` | <small>Get access details for the Swift API for a given swift tenant_id (ovh service_name)</small> | <sub><sup>GET /cloud/project/{serviceName}/storage/access</sup></sub> |
- | `container_info/2` | <small>Gets details about a container such as objects, size, region, public or not, static_url, name, ...</small> | <sub><sup>GET /cloud/project/{serviceName}/storage/{containerId}</sup></sub> |
- | `delete_container/2` | <small>Deletes a given container.</small> | <sub><sup>DELETE /cloud/project/{serviceName}/storage/{containerId}</sup></sub> |
- | `modify_container_cors/3` | <small>Modify the CORS settings for a container. See [swift docs](http://docs.openstack.org/developer/swift/cors.html)</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/cors Add CORS support on your container</sup></sub> |
- | `deploy_container_as_static_website/2` | <small>Deploy the container files as a static web site.</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/static</sup></sub> |
-
- ## Notes
-
- - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
-
- ## Example
-
- ExOvh.Services.V1.Cloud.Cloudstorage.Query.get_containers(service_name) |> ExOvh.request!()
- """
- end
-
-
-end
\ No newline at end of file
diff --git a/lib/ex_ovh/docs/mix_task.ex b/lib/ex_ovh/docs/mix_task.ex
deleted file mode 100644
index 3ef0483..0000000
--- a/lib/ex_ovh/docs/mix_task.ex
+++ /dev/null
@@ -1,39 +0,0 @@
-defmodule Mix.Tasks.Ovh.Docs do
- @moduledoc :false
-
- @doc :false
- def moduledoc() do
- ~s"""
- A mix task that generates the ex_ovh application secrets on the user's behalf.
-
- ## Steps
-
- - The user needs to set up an ovh account at https://www.ovh.co.uk/ and retrieve a username (nic-handle) and password.
-
- - Then the user is prompted to do some activations.
-
- - Upon completion of activations, the user needs to create an application in the ovh website.
-
- - Then the user can create an application at `https://eu.api.ovh.com/createApp/` or
- alternatively the user can use this mix task to generate the application:
-
- ## Example
-
- Create an app with access to all apis:
-
- mix ovh --login=<username-ovh> --password=<password> --appname='ex_ovh'
-
- Output:
-
- config :ex_ovh,
- ovh: [
- application_key: System.get_env("EX_OVH_APPLICATION_KEY"),
- application_secret: System.get_env("EX_OVH_APPLICATION_SECRET"),
- consumer_key: System.get_env("EX_OVH_CONSUMER_KEY")
- ]
-
- See the [mix task documentation]((https://github.com/stephenmoloney/ex_ovh/blob/master/docs/mix_task.md).
- """
- end
-
-end
\ No newline at end of file
diff --git a/lib/ex_ovh/docs/webstorage_query.ex b/lib/ex_ovh/docs/webstorage_query.ex
deleted file mode 100644
index cfdb118..0000000
--- a/lib/ex_ovh/docs/webstorage_query.ex
+++ /dev/null
@@ -1,27 +0,0 @@
-defmodule ExOvh.Services.V1.Webstorage.Query.Docs do
- @moduledoc :false
-
- @doc :false
- def moduledoc() do
- ~s"""
- Helper functions for building queries directed at the `/cdn/webstorage` part of the [OVH API](https://api.ovh.com/console/).
-
- ## Functions Summary
-
- | Function | Description | OVH API call |
- |---|---|---|
- | `get_services/0` | <small>Get a list of all webstorage cdn services.</small> | <sub><sup>GET /v1/cdn/webstorage</sup></sub> |
- | `get_service/1` | <small>Get the domain, server and storage limits for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}</sup></sub> |
- | `get_service_info/1` | <small>Get a administrative details for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/serviceInfos</sup></sub> |
- | `get_service_stats/2` | <small>Get statistics for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/statistics</sup></sub> |
- | `get_credentials/1` | <small>Get credentials for using the swift compliant api</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/statistics</sup></sub> |
-
-
- ## Example
-
- ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.request()
- """
- end
-
-
-end
\ No newline at end of file
diff --git a/lib/ex_ovh/services/v1/cloud/cloudstorage/query.ex b/lib/ex_ovh/services/v1/cloud/cloudstorage/query.ex
index d588cd4..52458a3 100644
--- a/lib/ex_ovh/services/v1/cloud/cloudstorage/query.ex
+++ b/lib/ex_ovh/services/v1/cloud/cloudstorage/query.ex
@@ -1,5 +1,29 @@
defmodule ExOvh.Services.V1.Cloud.Cloudstorage.Query do
- @moduledoc Module.concat(__MODULE__, Docs).moduledoc()
+ @moduledoc ~s"""
+ Helper functions for building queries directed at the cloudstorage related parts of the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
+
+ See `ExOvh.Services.V1.Cloud.Query` for generic cloud requests.
+
+ ## Functions Summary
+
+ | Function | Description | OVH API call |
+ |---|---|---|
+ | `get_containers/1` | <small>Get containers for a given swift tenant id (project id or ovh service name)</small> | <sub><sup>GET /cloud/project/{serviceName}/storage </sup></sub> |
+ | `create_container/3` | <small>Create a container for a given tenant_id (ovh service_name), a container and a region.</small> | <sub><sup>POST /cloud/project/{serviceName}/storage</sup></sub> |
+ | `get_access/1` | <small>Get access details for the Swift API for a given swift tenant_id (ovh service_name)</small> | <sub><sup>GET /cloud/project/{serviceName}/storage/access</sup></sub> |
+ | `container_info/2` | <small>Gets details about a container such as objects, size, region, public or not, static_url, name, ...</small> | <sub><sup>GET /cloud/project/{serviceName}/storage/{containerId}</sup></sub> |
+ | `delete_container/2` | <small>Deletes a given container.</small> | <sub><sup>DELETE /cloud/project/{serviceName}/storage/{containerId}</sup></sub> |
+ | `modify_container_cors/3` | <small>Modify the CORS settings for a container. See [swift docs](http://docs.openstack.org/developer/swift/cors.html)</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/cors Add CORS support on your container</sup></sub> |
+ | `deploy_container_as_static_website/2` | <small>Deploy the container files as a static web site.</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/static</sup></sub> |
+
+ ## Notes
+
+ - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
+
+ ## Example
+
+ ExOvh.Services.V1.Cloud.Cloudstorage.Query.get_containers(service_name) |> ExOvh.request!()
+ """
alias ExOvh.Query
diff --git a/lib/ex_ovh/services/v1/cloud/query.ex b/lib/ex_ovh/services/v1/cloud/query.ex
index 5d4a727..d608012 100644
--- a/lib/ex_ovh/services/v1/cloud/query.ex
+++ b/lib/ex_ovh/services/v1/cloud/query.ex
@@ -1,5 +1,52 @@
defmodule ExOvh.Services.V1.Cloud.Query do
- @moduledoc Module.concat(__MODULE__, Docs).moduledoc()
+ @moduledoc ~s"""
+ Helper functions for building queries directed at the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
+
+ ## Functions Summary
+
+ | Function | Description | OVH API call |
+ |---|---|---|
+ | `list_services/0` | <small>List available services or list available cloud projects. A returned project id in OVH terms is similar to a tenant id in swift terms</small> | <sub><sup>GET /cloud/project</sup></sub> |
+ | `get_users/1` | <small>Get all users</small> | <sub><sup>GET /cloud/project/{serviceName}/user</sup></sub> |
+ | `create_user/2` | <small>Create user</small> | <sub><sup>POST /ctsloud/project/{serviceName}/user</sup></sub> |
+ | `get_user_details/2` | <small>Get user details. Returns the user_id and username and other details.</small> | <sub><sup>GET /cloud/project/{serviceName}/user/{userId}</sup></sub> |
+ | `delete_user/2` | <small>Delete user</small> | <sub><sup>DELETE /cloud/project/{serviceName}/user/{userId}</sup></sub> |
+ | `download_openrc_script/3` | <small>Get RC file of OpenStack</small> | <sub><sup>GET /cloud/project/{serviceName}/user/{userId}/openrc</sup></sub> |
+ | `regenerate_credentials/2` | <small>Regenerate user credentials including password</small> | <sub><sup>POST /cloud/project/{serviceName}/user/{userId}/regeneratePassword</sup></sub> |
+ | `swift_identity/3` | <small>Gets a json object similar to that returned by Keystone Identity. Includes the 'X-Auth-Token'</small> | <sub><sup>POST /cloud/project/{serviceName}/user/{userId}/token</sup></sub> |
+ | `create_project/2` | <small>Start a new cloud project in the OVH cloud. Corresponds to creating a new Swift stack with a new tenant_id.</small> | <sub><sup>POST /cloud/createProject</sup></sub> |
+ | `get_prices/2` | <small>Get Prices for OVH cloud services.</small> | <sub><sup>GET /cloud/price</sup></sub> |
+ | `project_info/1` | <small>Get information about a project with the project_id (tenant_id)</small> | <sub><sup>GET /cloud/project/{serviceName}</sup></sub> |
+ | `modify_project/2` | <small>Modify a project properties. Change the project description.</small> | <sub><sup>PUT /cloud/project/{serviceName}</sup></sub> |
+ | `project_administrative_info/1` | <small>Get administration information about the project.</small> | <sub><sup>GET /cloud/project/{serviceName}/serviceInfos</sup></sub> |
+ | `project_quotas/1` | <small>Get project quotas.</small> | <sub><sup>GET /cloud/project/{serviceName}/quota</sup></sub> |
+ | `project_regions/1` | <small>Get project regions.</small> | <sub><sup>GET /cloud/project/{serviceName}/region</sup></sub> |
+ | `project_region_info/2` | <small>Get details about a project region.</small> | <sub><sup>GET /cloud/project/{serviceName}/region/{regionName}</sup></sub> |
+ | `project_consumption/3` | <small>Get details about a project consumption for a given `date_from` and `date_to`.</small> | <sub><sup>GET /cloud/project/{serviceName}/consumption</sup></sub> |
+ | `project_bills/3` | <small>Get details about a project billing for a given `date_from` and `date_to`..</small> | <sub><sup>GET /cloud/project/{serviceName}/bill</sup></sub> |
+ | `create_project_alert/4` | <small>Add a new project alert</small> | <sub><sup>POST /cloud/project/{serviceName}/alerting</sup></sub> |
+ | `get_project_alert_info/2` | <small>Get detailed information about a project alert.</small> | <sub><sup>GET /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
+ | `modify_project_alert/5` | <small>Modify an existing project alert.</small> | <sub><sup>PUT /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
+ | `delete_project_alert/2` | <small>Delete an existing project alert.</small> | <sub><sup>DELETE /cloud/project/{serviceName}/alerting/{id}</sup></sub> |
+ | `terminate_service/2` | <small>Terminate a cloud project.</small> | <sub><sup>POST /cloud/project/{serviceName}/terminate</sup></sub> |
+
+
+ ## TO BE ADDED
+
+ GET /cloud/project/{serviceName}/acl
+ POST /cloud/project/{serviceName}/acl
+ GET /cloud/project/{serviceName}/acl/{accountId}
+ DELETE /cloud/project/{serviceName}/acl/{accountId}
+
+ ## Notes
+
+ - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
+
+
+ ## Example
+
+ ExOvh.Services.V1.Cloud.Cloudstorage.Query.get_containers(service_name) |> ExOvh.request!()
+ """
alias ExOvh.Query
diff --git a/lib/ex_ovh/services/v1/webstorage/query.ex b/lib/ex_ovh/services/v1/webstorage/query.ex
index 67999f2..5072d3e 100644
--- a/lib/ex_ovh/services/v1/webstorage/query.ex
+++ b/lib/ex_ovh/services/v1/webstorage/query.ex
@@ -1,5 +1,25 @@
defmodule ExOvh.Services.V1.Webstorage.Query do
- @moduledoc Module.concat(__MODULE__, Docs).moduledoc()
+ @moduledoc ~s"""
+
+ ***NOTE:*** This is a deprecated service!!!
+
+ Helper functions for building queries directed at the `/cdn/webstorage` part of the [OVH API](https://api.ovh.com/console/).
+
+ ## Functions Summary
+
+ | Function | Description | OVH API call |
+ |---|---|---|
+ | `get_services/0` | <small>Get a list of all webstorage cdn services.</small> | <sub><sup>GET /v1/cdn/webstorage</sup></sub> |
+ | `get_service/1` | <small>Get the domain, server and storage limits for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}</sup></sub> |
+ | `get_service_info/1` | <small>Get a administrative details for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/serviceInfos</sup></sub> |
+ | `get_service_stats/2` | <small>Get statistics for a specific webstorage cdn service</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/statistics</sup></sub> |
+ | `get_credentials/1` | <small>Get credentials for using the swift compliant api</small> | <sub><sup>GET /v1/cdn/webstorage/{serviceName}/statistics</sup></sub> |
+
+
+ ## Example
+
+ ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.request()
+ """
alias ExOvh.Query
diff --git a/lib/mix/tasks/ovh.ex b/lib/mix/tasks/ovh.ex
index 76dbe99..bf438b7 100644
--- a/lib/mix/tasks/ovh.ex
+++ b/lib/mix/tasks/ovh.ex
@@ -1,6 +1,36 @@
defmodule Mix.Tasks.Ovh do
@shortdoc "Create a new application and new credentials for accessing ovh api"
- @moduledoc Module.concat(__MODULE__, Docs).moduledoc()
+ @moduledoc ~s"""
+ A mix task that generates the ex_ovh application secrets on the user's behalf.
+
+ ## Steps
+
+ - The user needs to set up an ovh account at https://www.ovh.co.uk/ and retrieve a username (nic-handle) and password.
+
+ - Then the user is prompted to do some activations.
+
+ - Upon completion of activations, the user needs to create an application in the ovh website.
+
+ - Then the user can create an application at `https://eu.api.ovh.com/createApp/` or
+ alternatively the user can use this mix task to generate the application:
+
+ ## Example
+
+ Create an app with access to all apis:
+
+ mix ovh --login=<username-ovh> --password=<password> --appname='ex_ovh'
+
+ Output:
+
+ config :ex_ovh,
+ ovh: [
+ application_key: System.get_env("EX_OVH_APPLICATION_KEY"),
+ application_secret: System.get_env("EX_OVH_APPLICATION_SECRET"),
+ consumer_key: System.get_env("EX_OVH_CONSUMER_KEY")
+ ]
+
+ See the [mix task documentation]((https://github.com/stephenmoloney/ex_ovh/blob/master/docs/mix_task.md).
+ """
use Mix.Task
alias ExOvh.Defaults
@default_headers [{"Content-Type", "application/json; charset=utf-8"}]