Accounts-account-dedicatedServers:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision)
 
(2 intermediate revisions by 2 users not shown)
Line 39: Line 39:
 
             "serverName": "{serverName}",  
 
             "serverName": "{serverName}",  
 
             "details": "http://{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server_id}",
 
             "details": "http://{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server_id}",
 +
            "productName": "{productName}",
 +
            "displayName": "{displayName}",
 +
            "serviceName": "{serviceName}",
 +
            "partnerId": "{partnerId}",
 +
            "serverLocation": "{serverLocation}",
 +
            "services": "http://{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server_id}/services"
 
         }
 
         }
 
     ],
 
     ],
Line 64: Line 70:
 
         }
 
         }
 
       ]
 
       ]
}
+
} </nowiki>
</nowiki>
+
  
 
==== Parameters ====
 
==== Parameters ====
Line 73: Line 78:
 
; details - ''string''
 
; details - ''string''
 
: hypermedia to the give dedicated server
 
: hypermedia to the give dedicated server
 +
 +
; productName - ''string''
 +
: Name of the product
 +
 +
; displayName - ''string''
 +
: Custom display name of the product
 +
 +
; serviceName- ''string''
 +
: Name of the service
 +
 +
; partnerId- ''string''
 +
: Parner id
 +
 +
; serverLocation - ''string''
 +
: Location of the server - chicago, tampa, etc.
 +
 +
; services - ''string''
 +
: link to services for each dedicated server
  
 
; links - ''list''
 
; links - ''list''
Line 95: Line 118:
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
GET accounts/test-account123/dedicatedServers
+
GET accounts/test-account123/dedicatedServers </nowiki>
</nowiki>
+
  
 
'''Response'''
 
'''Response'''
Line 104: Line 126:
 
         {
 
         {
 
             "serverName": "Server Name 1",  
 
             "serverName": "Server Name 1",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
 +
            "productName": "Server10",
 +
            "displayName": "Advantage Dedicated Server",
 +
            "serviceName": "Advantage Dedicated Server",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
 
         },
 
         },
 
         {
 
         {
 
             "serverName": "Server Name 2",  
 
             "serverName": "Server Name 2",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
 +
            "productName": "Server20",
 +
            "displayName": "Advantage Dedicated Server 2",
 +
            "serviceName": "Advantage Dedicated Server 2",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
 
         },
 
         },
 
         {
 
         {
 
             "serverName": "Server Name 3",  
 
             "serverName": "Server Name 3",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3",
 +
            "productName": "Server30",
 +
            "displayName": "Advantage Dedicated Server 3",
 +
            "serviceName": "Advantage Dedicated Server 3",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3/services"
 
         }
 
         }
 
     ],
 
     ],
Line 121: Line 161:
 
         }
 
         }
 
     ]
 
     ]
}
+
} </nowiki>
</nowiki>
+
  
 
=== Get a list of dedicated servers sorted by server name in an descending order ===
 
=== Get a list of dedicated servers sorted by server name in an descending order ===
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
GET accounts/test-account123/dedicatedServers?sortField=serverName&sortOrder=desc
+
GET accounts/test-account123/dedicatedServers?sortField=serverName&sortOrder=desc </nowiki>
</nowiki>
+
  
 
'''Response'''
 
'''Response'''
Line 136: Line 174:
 
         {
 
         {
 
             "serverName": "Server Name 3",  
 
             "serverName": "Server Name 3",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3",
 +
            "productName": "Server30",
 +
            "displayName": "Advantage Dedicated Server 3",
 +
            "serviceName": "Advantage Dedicated Server 3",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3/services"
 
         },
 
         },
 
         {
 
         {
 
             "serverName": "Server Name 2",  
 
             "serverName": "Server Name 2",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
 +
            "productNmae": "Server20",
 +
            "displayName": "Advantage Dedicated Server 2",
 +
            "serviceName": "Advantage Dedicated Server 2",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
 
         },
 
         },
 
         {
 
         {
 
             "serverName": "Server Name 1",  
 
             "serverName": "Server Name 1",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
 +
            "productName": "Server10",
 +
            "displayName": "Advantage Dedicated Server",
 +
            "serviceName": "Advantage Dedicated Server",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
 
         }
 
         }
 
     ],
 
     ],
Line 153: Line 209:
 
         }
 
         }
 
     ]
 
     ]
}
+
} </nowiki>
</nowiki>
+
  
 
=== Get a list of dedicated servers with pagination ===
 
=== Get a list of dedicated servers with pagination ===
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
GET accounts/test-account123/test.com/dedicatedServers?page=2&pageSize=2
+
GET accounts/test-account123/test.com/dedicatedServers?page=2&pageSize=2 </nowiki>
</nowiki>
+
  
 
'''Response'''
 
'''Response'''
Line 168: Line 222:
 
         {
 
         {
 
             "serverName": "Server Name 1",  
 
             "serverName": "Server Name 1",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
 +
            "productName": "Server10",
 +
            "displayName": "Advantage Dedicated Server",
 +
            "serviceName": "Advantage Dedicated Server",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
 
         },
 
         },
 
         {
 
         {
 
             "username": "Server Name 2",  
 
             "username": "Server Name 2",  
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2"
+
             "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
 +
            "productName": "Server20",
 +
            "displayName": "Advantage Dedicated Server 2",
 +
            "serviceName": "Advantage Dedicated Server 2",
 +
            "partnerId": "",
 +
            "serverLocation": "chicago",
 +
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
 
         }
 
         }
 
     ],
 
     ],
Line 197: Line 263:
 
         }
 
         }
 
     ]
 
     ]
}
+
} </nowiki>
</nowiki>
+
  
 
== See also ==
 
== See also ==

Latest revision as of 13:35, 30 May 2016

GET /accounts/{account_number}/dedicatedServers

Retrieves a list of fully provisioned dedicated servers

Contents


Request

GET /accounts/{account_number}/dedicatedServers

GET /accounts/{account_number}/dedicatedServers?page=page&pageSize=page-size&sortField=sortField&sortOrder=sortOrder

Request Parameters

account_number - string
The user account owning the dedicated servers

URI Parameters

page - integer
Specifies which page should be displayed. Requires a pageSize parameter to also be provided.
pageSize - integer
Specifies the number of entries to be displayed on a page. Requires a page parameter to also be provided
sortField - string
Specifies if the resulting list is to be sorted by a given field. Allowed value is serverName. If the field is missing the list will be ordered by serverName.
sortOrder - string
The order in which the sorting is to be done. Allowed values are asc and desc. If the field is missing the order is asc.

Request Headers

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

Response

Response Body

{
    "list": [
        {
            "serverName": "{serverName}", 
            "details": "http://{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server_id}",
            "productName": "{productName}",
            "displayName": "{displayName}",
            "serviceName": "{serviceName}",
            "partnerId": "{partnerId}",
            "serverLocation": "{serverLocation}",
            "services": "http://{server_name}/accounts/{account_number}/dedicatedServers/{dedicated_server_id}/services"
        }
    ],
   "links":
      [
         {
            "href" : "http://{server_name}/accounts/{account_number}/dedicatedServers?page=2&pageSize=2",
            "rel" : "self"
         },
         {
            "href" : "http://{server_name}/accounts/{account_number}/dedicatedServers?page=1&pageSize=2",
            "rel" : "first"
         },
         {
            "href" : "http://{server_name}/accounts/{account_number}/dedicatedServers?page=1&pageSize=2",
            "rel" : "previous"
         },
         {
            "href" : "http://{server_name}/accounts/{account_number}/dedicatedServers?page=1&pageSize=3",
            "rel" : "next"
         },
         {
            "href" : "http://{server_name}/accounts/{account_number}/dedicatedServers?page=1&pageSize=3",
            "rel" : "last"
         }
      ]
} 

Parameters

serverName - string
The name of an individual dedicated server
details - string
hypermedia to the give dedicated server
productName - string
Name of the product
displayName - string
Custom display name of the product
serviceName- string
Name of the service
partnerId- string
Parner id
serverLocation - string
Location of the server - chicago, tampa, etc.
services - string
link to services for each dedicated server
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

Expected Response Codes

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 does not exist.

Examples

Get a list of dedicated servers

Request

GET accounts/test-account123/dedicatedServers 

Response

{
    "list": [
        {
            "serverName": "Server Name 1", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
            "productName": "Server10",
            "displayName": "Advantage Dedicated Server",
            "serviceName": "Advantage Dedicated Server",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
        },
        {
            "serverName": "Server Name 2", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
            "productName": "Server20",
            "displayName": "Advantage Dedicated Server 2",
            "serviceName": "Advantage Dedicated Server 2",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
        },
        {
            "serverName": "Server Name 3", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3",
            "productName": "Server30",
            "displayName": "Advantage Dedicated Server 3",
            "serviceName": "Advantage Dedicated Server 3",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3/services"
        }
    ],
    "links": [
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/",
            "rel": "self"
        }
    ]
} 

Get a list of dedicated servers sorted by server name in an descending order

Request

GET accounts/test-account123/dedicatedServers?sortField=serverName&sortOrder=desc 

Response

{
    "list": [
        {
            "serverName": "Server Name 3", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3",
            "productName": "Server30",
            "displayName": "Advantage Dedicated Server 3",
            "serviceName": "Advantage Dedicated Server 3",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-3/services"
        },
        {
            "serverName": "Server Name 2", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
            "productNmae": "Server20",
            "displayName": "Advantage Dedicated Server 2",
            "serviceName": "Advantage Dedicated Server 2",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
        },
        {
            "serverName": "Server Name 1", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
            "productName": "Server10",
            "displayName": "Advantage Dedicated Server",
            "serviceName": "Advantage Dedicated Server",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
        }
    ],
    "links": [
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?sortField=serverName&sortOrder=desc",
            "rel": "self"
        }
    ]
} 

Get a list of dedicated servers with pagination

Request

GET accounts/test-account123/test.com/dedicatedServers?page=2&pageSize=2 

Response

{
    "list": [
        {
            "serverName": "Server Name 1", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1",
            "productName": "Server10",
            "displayName": "Advantage Dedicated Server",
            "serviceName": "Advantage Dedicated Server",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-1/services"
        },
        {
            "username": "Server Name 2", 
            "details": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2",
            "productName": "Server20",
            "displayName": "Advantage Dedicated Server 2",
            "serviceName": "Advantage Dedicated Server 2",
            "partnerId": "",
            "serverLocation": "chicago",
            "services": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers/server-id-2/services"
        }
    ],
    "links": [
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?page=2&pageSize=2",
            "rel": "self"
        },
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?page=1&pageSize=2",
            "rel": "first"
        },
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?page=1&pageSize=2",
            "rel": "previous"
        },
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?page=3&pageSize=2",
            "rel": "next"
        },
        {
            "href": "{{APIBaseURL}}/accounts/test-account123/dedicatedServers?page=3&pageSize=2",
            "rel": "last"
        }
    ]
} 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox