Order-cloud-backup

From Hostway API Documentation
Jump to: navigation, search

Contents

Order a new cloud backup

This example provides the steps to order cloud backup through the Hostway Ordering API. == Create a new ord er == Use POST /orders to create a new order

Request

POST /orders
Content-Type: application/json; charset=UTF-8

{}
 

Response

201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf
Set-Cookie : OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/

{
 "orderId": "0000013ad6dd95746a399f90000a71384bf242cf",
 "links": [
  {"href": "https://api.hostway.com/orders/", "rel": "self"},
  {"href": "https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf", "rel": "item"}
 ]
}
 

Create a new account for the order

Use PUT /orders/{order_id}/account to create an account or add an existing one to the order.

Request

PUT /orders/0000013ad6dd95746a399f90000a71384bf242cf/account
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/

{
 "currency": "USD",
 "language": "en-US"
}
 

Response

204 No Content
 

Add "Linux Web Start" product to the order

The product specification offerings can be determined using the Hostway Product Catalog API. Then add the new product to the order by using POST /orders/{order_id}/account/products.

Request

POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/

{
  "offering": "https://api.hostway.com/productSpecifications/core.plan.linux.webstart/offerings/USD-12"
}
 

Response

201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf
 

Add the cloud backup service to the new product

The service specification offerings can be determined using the Hostway Product Catalog API for the core.plan.linux.webstart product. Then add the new cloud backup service to the order by using POST /orders/{order_id}/account/products/{product_id}/services.

Request

POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf/services

Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/

{
 "name": "test-domain.com",
 "serviceSpecification": "https://api.hostway.com/serviceSpecifications/core.cloudbackup.hs2.2gb",
 "billingCycle": 12,
  "attributes": { "displayName": "test-domain.com" } 
}
 

Response

201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf/services/0000013fe6dd95726c399e54500a71384bf242cf
 


Submit the order

Use POST /orders/{order_id}/action to submit the order and invoke the cloud backup provisioning.

Request

POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/action
Content-Type: application/json; charset=UTF-8

{
  "action": "submit"
}
 

Response

202 Accepted
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox