Order-cloud-drive

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision: Release 91)
 

Latest revision as of 10:57, 11 March 2014

Contents

[edit] Order a new cloud drive

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

[edit] Request

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

{}
 

[edit] 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"}
 ]
}
 

[edit] 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.

[edit] 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"
}
 

[edit] Response

204 No Content
 

[edit] 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.

[edit] 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"
}
 

[edit] Response

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

[edit] Add the cloud drive 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 drive service to the order by using POST /orders/{order_id}/account/products/{product_id}/services.

[edit] 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.clouddrive.hs2.1gb",
 "billingCycle": 12,
  "attributes": { "displayName": "test-domain.com" } 
}
 

[edit] Response

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


[edit] Submit the order

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

[edit] Request

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

{
  "action": "submit"
}
 

[edit] Response

202 Accepted
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox