Accounts-account-dedicatedServers-server-services:GET

From Hostway API Documentation
Jump to: navigation, search

GET /accounts/{accountId}/dedicatedServers/{serverId}/services

Retrieves a list of components and services that belong to a fully-provisioned dedicated server

Contents


Request

GET /accounts/{accountId}/dedicatedServers/{serverId}/services

Request Parameters

accountId - string
The user account owning the dedicated server
serverId - string
The specified dedicated server Id

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Response

Status Code

200 OK
Success
401 Unauthorized
The supplied credentials are invalid.
403 Forbidden
The authorized user does not have permissions to access the resource. The only user(s) who has access to the dedicated servers list must be a sales agent, the account owner, or the account technical admin.
404 Not Found
The account or server does not exist.

Response Headers

None

Response Body

{
  "list": [
    {
      "name": "Quad Core 10 GHz CPU",
      "quantity": 1,
      "fees": [
        {
          "name": "recurring",
          "amount": "100.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "10.00",
          "recurrences": -1,
          "type": "amount"
        }
      ],
      "service": "{APIBaseURL}/accounts/accountId/products/productId/services/service1"
    },
    {
      "name": "1 GB DIMM Memory",
      "quantity": 8,
      "fees": [
        {
          "name": "recurring",
          "amount": "1.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "0.5",
          "recurrences": -1,
          "type": "amount"
        }
      ],
      "service": "{APIBaseURL}/accounts/accountId/products/productId/services/service2"
    },
    {
      "name": "500 GB Disk Drive",
      "quantity": 2,
      "fees": [
        {
          "name": "recurring",
          "amount": "5.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "0.2",
          "recurrences": -1,
          "type": "percent"
        }
      ],
      "service": "{APIBaseURL}/accounts/accountId/products/productId/services/service3"
    }
  ],
  "links": [
    {
      "href": "{APIBaseURL}/accounts/{accountId}/dedicatedServers/{serverId}/services/", 
      "rel": "self"
    }
  ]
}
 

Parameters

name - string
The name of the service
quantity - integer
Service quantity
fees - list
List of fees for this service
name - string
The name of the fee (i.e. recurring fee, setup fee, etc.)
amount - string
Fee amount
deferred - integer
A flag that specifies whether this fee has delayed billing or not
recurrences - integer
The number of times that this fee may recur. A value of -1 means that the fee will be charged throughout the lifetime of the provisioned service.
discounts - list
List of discounts for this service
priceName - string
The type of fee to which the discount will be applied.
value
The discount amount which will be interpreted based on the type of discount.
recurrences
The number of times that this discount may be applied. A value of -1 indicates that the discount will be applied every time the fee is charged.
type
The type of discount which determines the method used to calculate the amount that is discounted. Possible values include:
amount: Discount will be treated as an exact amount.
percent: The discount will be treated as a percentage of the fee amount.
service - string
A hyperlink that can be used to retrieve more of this service's details
links - list
Hypermedia for this resource. Link to self will preserve sorting and pagination set by the request. Links to the first, last, previous and next pages will also be included if applicable

Examples

Get a list of services for a dedicated server

Request

GET /accounts/account123/dedicatedServers/server1/services
 

Response

200 OK
Content-Type : application/json; charset=UTF-8
{
  "list": [
    {
      "name": "Quad Core 1 GHz CPU",
      "quantity": 1,
      "fees": [
        {
          "name": "recurring",
          "amount": "100.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "10.00",
          "recurrences": -1,
          "type": "amount"
        }
      ],
      "service": "http://localhost:6545/accounts/account123/products/server1/services/service1"
    },
    {
      "name": "1 GB DIMM Memory",
      "quantity": 8,
      "fees": [
        {
          "name": "recurring",
          "amount": "1.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "0.5",
          "recurrences": -1,
          "type": "amount"
        }
      ],
      "service": "http://localhost:6545/accounts/account123/products/server1/services/service2"
    },
    {
      "name": "500 GB Disk Drive",
      "quantity": 2,
      "fees": [
        {
          "name": "recurring",
          "amount": "5.00",
          "deferred": 0,
          "recurrences": -1
        }
      ],
      "discounts": [
        {
          "priceName": "recurring",
          "value": "0.2",
          "recurrences": -1,
          "type": "percent"
        }
      ],
      "service": "http://localhost:6545/accounts/account123/products/server1/services/service3"
    }
  ],
  "links": [
    {
      "href": "http://localhost:6545/accounts/account123/dedicatedServers/server1/services/",
      "rel": "self"
    }
  ]
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox