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 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711
defmodule ExOvh.Ovh.V1.Cloud.Query do
@moduledoc ~s"""
Helper functions for building queries directed at the `/cloud` part of the ovh api.
## 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}
## Example
ExOvh.Ovh.V1.Cloud.Cloudstorage.Query.get_containers(service_name) |> ExOvh.Ovh.request!()
"""
alias ExOvh.Ovh.Query
@doc ~s"""
List available services
## Api Call
GET /cloud/project
## Example
ExOvh.Ovh.V1.Cloud.Query.list_services() |> ExOvh.Ovh.request!()
"""
@spec list_services() :: Query.t
def list_services() do
%Query{
method: :get,
uri: "/cloud/services",
params: :nil
}
end
@doc ~s"""
Get all users
## Api Call
GET /cloud/project/{serviceName}/user
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.get_users(service_name) |> ExOvh.Ovh.request!()
"""
@spec get_users(String.t) :: Query.t
def get_users(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/user",
params: :nil
}
end
@doc ~s"""
Create user
## Api Call
POST /cloud/project/{serviceName}/user
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `description`: description ascribed to the new user.
## Example
ExOvh.Ovh.V1.Cloud.Query.create_user(service_name, "ex_ovh") |> ExOvh.Ovh.request!()
"""
@spec create_user(String.t, String.t) :: Query.t
def create_user(service_name, description) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/user",
params: %{
"description" => description
}
|> Poison.encode!()
}
end
@doc ~s"""
Get user details. Returns the user_id and username and other details.
## Api Call
GET /cloud/project/{serviceName}/user/{userId}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `user_id`: corresponds to user_id. See `get_users/1`
## Example
ExOvh.Ovh.V1.Cloud.Query.get_user_details(service_name, user_id) |> ExOvh.Ovh.request!()
"""
@spec get_user_details(String.t, String.t) :: Query.t
def get_user_details(service_name, user_id) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/user/#{user_id}",
params: :nil
}
end
@doc ~s"""
Delete a specific user.
## Api Call
DELETE /cloud/project/{serviceName}/user/{userId}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `user_id`: The user_id. See `get_users/1`
## Example
ExOvh.Ovh.V1.Cloud.Query.delete_user(service_name, user_id) |> ExOvh.Ovh.request!()
"""
@spec delete_user(String.t, String.t) :: Query.t
def delete_user(service_name, user_id) do
%Query{
method: :delete,
uri: "/cloud/project/#{service_name}/user/#{user_id}",
params: :nil
}
end
@doc ~s"""
Get RC file of OpenStack. This file is a bash script with much of the openstack credentials. Makes it easier for
setting up a swift client from the terminal.
## Api Call
GET /cloud/project/{serviceName}/user/{userId}/openrc
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `user_id`: user_id for user accessing the service.
- `region`: region for which the rc file will be created. Defaults to "SBG1" if left absent.
## Example
ExOvh.Ovh.V1.Cloud.Query.download_openrc_script(service_name, user_id, "SBG1") |> ExOvh.Ovh.request!()
"""
@spec download_openrc_script(String.t, String.t, String.t) :: Query.t
def download_openrc_script(service_name, user_id, region \\ "SBG1") do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/user/#{user_id}/openrc",
params: %{
region: region
}
}
end
@doc ~s"""
Regenerate user password and other credentials.
## Api Call
POST /cloud/project/{serviceName}/user/{userId}/regeneratePassword
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `user_id`: user_id for accessing the project. See `get_users/1`
## Example
ExOvh.Ovh.V1.Cloud.Query.regenerate_credentials(service_name, user_id) |> ExOvh.Ovh.request!()
"""
@spec regenerate_credentials(String.t, String.t) :: Query.t
def regenerate_credentials(service_name, user_id) do
%Query{
method: :post,
uri: "/cloud/project/#{service_name}/user/#{user_id}/regeneratePassword",
params: :nil
}
end
@doc ~s"""
Get the token for the user (very similar to keystone identity)
## Api Call
POST /cloud/project/{serviceName}/user/{userId}/token
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `user_id`: The swift user_id to login with. See `get_users/1`.
- `password`: The swift password to login with. See `regenerate_credentials/2`
## Example
ExOvh.Ovh.V1.Cloud.Query.swift_identity(service_name, user_id) |> ExOvh.Ovh.request!()
"""
@spec swift_identity(String.t, String.t, String.t) :: Query.t
def swift_identity(service_name, user_id, password) do
%Query{
method: :post,
uri: "/cloud/project/#{service_name}/user/#{user_id}/token",
params: %{
"password" => password
}
|> Poison.encode!()
}
end
@doc ~s"""
Create a new Cloud Project.
## Api Call
POST /cloud/createProject
## Arguments
- `description`: project description
- `voucher`: ovh voucher code
## Example
ExOvh.Ovh.V1.Cloud.Query.create_project(description, voucher) |> ExOvh.Ovh.request!()
"""
@spec create_project(String.t, String.t) :: Query.t
def create_project(description, voucher) do
%Query{
method: :post,
uri: "/cloud/createProject",
params: %{
"description" => description,
"voucher" => voucher
}
|> Poison.encode!()
}
end
@doc ~s"""
Get services prices for the OVH public cloud.
## Api Call
GET /cloud/price
## Arguments
- `region`: prices for a particular region (optional)
- `flavor_id`: ovh voucher code (optional)
## Example
ExOvh.Ovh.V1.Cloud.Query.get_prices() |> ExOvh.Ovh.request!()
"""
@spec get_prices(String.t | :nil, String.t | :nil) :: Query.t
def get_prices(region \\ :nil, flavor_id \\ :nil) do
params =
cond do
region == :nil and flavor_id == :nil -> :nil
region != :nil and flavor_id == :nil -> %{"region" => region}
region == :nil and flavor_id != :nil -> %{"flavorId" => flavor_id}
region != :nil and flavor_id != :nil -> %{ "region" => region, "flavorId" => flavor_id }
end
%Query{
method: :get,
uri: "/cloud/createProject",
params: params
}
end
@doc ~s"""
Get details for a given project.
## Api Call
GET /cloud/project/{serviceName}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.project_info(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_info(String.t) :: Query.t
def project_info(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}",
params: :nil
}
end
@doc ~s"""
Modify the project description for a project.
## Api Call
PUT /cloud/project/{serviceName}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.modify_project(service_name, new_description) |> ExOvh.Ovh.request!()
"""
@spec modify_project(String.t, String.t) :: Query.t
def modify_project(service_name, new_description) do
%Query{
method: :put,
uri: "/cloud/project/#{service_name}",
params: %{
"description" => new_description
}
|> Poison.encode!()
}
end
@doc ~s"""
Get administration information about the project
## Api Call
GET /cloud/project/{serviceName}/serviceInfos
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.project_administrative_info(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_administrative_info(String.t) :: Query.t
def project_administrative_info(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/serviceInfos",
params: :nil
}
end
@doc ~s"""
Get project quotas.
## Api Call
GET /cloud/project/{serviceName}/quota
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.project_quotas(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_quotas(String.t) :: Query.t
def project_quotas(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/quota",
params: :nil
}
end
@doc ~s"""
Get project regions.
## Api Call
GET /cloud/project/{serviceName}/region
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.project_regions(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_regions(String.t) :: Query.t
def project_regions(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/region",
params: :nil
}
end
@doc ~s"""
Get project details about a project region.
## Api Call
GET /cloud/project/{serviceName}/region/{regionName}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.project_region_info(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_region_info(String.t, String.t) :: Query.t
def project_region_info(service_name, region_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/region/#{region_name}",
params: :nil
}
end
@doc ~s"""
Get project details about a project consumption.
*Note:* Will only allow for up to one month of data to be returned.
## Api Call
GET /cloud/project/{serviceName}/consumption
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `date_from`: starting date in `ISO 8601` format. defaults to 4 weeks/28 days ago (UTC time) if left absent.
- `date_to`: end date in `ISO 8601` format. defaults to now (UTC time) if left absent.
## Example
ExOvh.Ovh.V1.Cloud.Query.project_consumption(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_consumption(String.t, String.t, String.t) :: Query.t
def project_consumption(service_name, date_from \\ :nil, date_to \\ :nil) do
date_from = if date_from == :nil, do: Calendar.DateTime.now_utc!() |> Calendar.DateTime.add!(-(60*60*24*28)) |> Calendar.DateTime.Format.rfc3339(), else: date_from
date_to = if date_to == :nil, do: Calendar.DateTime.now_utc!() |> Calendar.DateTime.Format.rfc3339(), else: date_to
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/consumption",
params: %{from: date_from, to: date_to}
}
end
@doc ~s"""
Get project details about a project bills.
## Api Call
GET /cloud/project/{serviceName}/bill
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `date_from`: starting date in `ISO 8601` format. defaults to 4 weeks/28 days ago (UTC time) if left absent.
- `date_to`: end date in `ISO 8601` format. defaults to now (UTC time) if left absent.
## Example
ExOvh.Ovh.V1.Cloud.Query.project_bills(service_name) |> ExOvh.Ovh.request!()
"""
@spec project_bills(String.t, String.t, String.t) :: Query.t
def project_bills(service_name, date_from \\ :nil, date_to \\ :nil) do
date_from = if date_from == :nil, do: Calendar.DateTime.now_utc!() |> Calendar.DateTime.add!(-(60*60*24*28)) |> Calendar.DateTime.Format.rfc3339(), else: date_from
date_to = if date_to == :nil, do: Calendar.DateTime.now_utc!() |> Calendar.DateTime.Format.rfc3339(), else: date_to
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/bill",
params: %{from: date_from, to: date_to}
}
end
@doc ~s"""
Get a list of project alert ids. These project alert ids can then be looked up in a separate query for more information.
## Api Call
GET /cloud/project/{serviceName}/alerting
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.get_project_alerts(service_name) |> ExOvh.Ovh.request!()
"""
@spec get_project_alerts(String.t) :: Query.t
def get_project_alerts(service_name) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/alerting",
params: :nil
}
end
@doc ~s"""
Create a new project alert.
*Notes:*
It seems only one alert is allowed per project. To create a new one alter the old one or delete the old one and add a new one.
Once the monthly threshold in the given currency is exceeded, then the alert email is sent.
## Api Call
POST /cloud/project/{serviceName}/alerting
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `delay`: The delay between each alert in seconds. This has to be selected from an enumerable (a list). 3600 is the lowest. defaults to 3600. (1 hour)
- `email`: The email to send the alert to.
- `monthlyThreshold`: The maximum monetary (cash) usage allowed in one month. This is an integer value. Ask OVH about how the currency is chosen.
## Example
ExOvh.Ovh.V1.Cloud.Query.create_project_alert(service_name, "email_address@email.email", 5) |> ExOvh.Ovh.request!()
"""
@spec create_project_alert(String.t, String.t, integer, String.t) :: Query.t | no_return
def create_project_alert(service_name, email, monthly_threshold, delay \\ "3600") do
unless is_integer(monthly_threshold), do: Og.log_return(__ENV__, "monthly_threshold should be an integer!", :error) |> raise()
%Query{
method: :post,
uri: "/cloud/project/#{service_name}/alerting",
params: %{
"delay" => delay,
"email" => email,
"monthlyThreshold" => monthly_threshold
} |> Poison.encode!()
}
end
@doc ~s"""
Get detailed information about a project alert.
## Api Call
GET /cloud/project/{serviceName}/alerting/{id}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `alert_id`: The id of the project alert. See `get_project_alerts/1`
## Example
ExOvh.Ovh.V1.Cloud.Query.get_project_alert_info(service_name, alert_id) |> ExOvh.Ovh.request!()
"""
@spec get_project_alert_info(String.t, String.t) :: Query.t
def get_project_alert_info(service_name, alert_id) do
%Query{
method: :get,
uri: "/cloud/project/#{service_name}/alerting/#{alert_id}",
params: :nil
}
end
@doc ~s"""
Modify an existing project alert.
## Api Call
PUT /cloud/project/{serviceName}/alerting/{id}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `alert_id`: The alert to be modified.
- `delay`: The delay between each alert in seconds. This has to be selected from an enumerable (a list). 3600 is the lowest. defaults to 3600. (1 hour)
- `email`: The email to send the alert to.
- `monthlyThreshold`: The maximum monetary (cash) usage allowed in one month. This is an integer value. Ask OVH about how the currency is chosen.
## Example
ExOvh.Ovh.V1.Cloud.Query.modify_project_alert(service_name, alert_id, "email_address@email.email", 5) |> ExOvh.Ovh.request!()
"""
@spec modify_project_alert(String.t, String.t, String.t, integer, String.t) :: Query.t
def modify_project_alert(service_name, alert_id, email, monthly_threshold, delay \\ "3600") do
unless is_integer(monthly_threshold), do: Og.log_return(__ENV__, "monthly_threshold should be an integer!", :error) |> raise()
%Query{
method: :put,
uri: "/cloud/project/#{service_name}/alerting/#{alert_id}",
params: %{
"delay" => delay,
"email" => email,
"monthlyThreshold" => monthly_threshold
} |> Poison.encode!()
}
end
@doc ~s"""
Delete a project alert.
## Api Call
DELETE /cloud/project/{serviceName}/alerting/{id}
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
- `alert_id`: The id of the project alert. See `get_project_alerts/1`
## Example
ExOvh.Ovh.V1.Cloud.Query.get_project_alert_info(service_name, alert_id) |> ExOvh.Ovh.request!()
"""
@spec delete_project_alert(String.t, String.t) :: Query.t
def delete_project_alert(service_name, alert_id) do
%Query{
method: :delete,
uri: "/cloud/project/#{service_name}/alerting/#{alert_id}",
params: :nil
}
end
@doc ~s"""
Terminate a cloud project.
## Api Call
POST /cloud/project/{serviceName}/terminate
## Arguments
- `service_name`: corresponds to project_id or tenant_id. See `list_services/0`
## Example
ExOvh.Ovh.V1.Cloud.Query.terminate_project(service_name) |> ExOvh.Ovh.request!()
"""
@spec terminate_project(String.t) :: Query.t
def terminate_project(service_name) do
%Query{
method: :post,
uri: "/cloud/project/#{service_name}/terminate",
params: :nil
}
end
end