Share via


Add a Service to a Plan

 

Applies To: Windows Azure Pack

Adds a service to a plan.

Request

Specify the Add Plan Service request as follows: Replace <ServiceMgmt> with your Service Management API endpoint address. <PlanId> should be replaced with the identifier of the plan.

Method

Request URI

HTTP version

PUT

https://<ServiceMgmt>:30004/plans/<PlanId>/services

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes required and optional request headers.

Request header

Description

Authorization: Bearer

Required. The authorization bearer token.

x-ms-principal-id

Required. The principal identifier.

x-ms-client-request-id

Optional. The client request identifier.

x-ms-client-session-id

Optional. The client session identifier.

x-ms-principal-liveid

Optional. The principal Live identifier.

Request Body

The following table describes the elements of the request body.

Element name

Description

Name

The name of the service.

InstanceId

The identifier of the instance.

ConfigState

The quota configuration state.

Response

The response includes an HTTP status code, a set of response headers, and a response body. 409 is returned if the service already exists

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The following table describes the key elements of the response body.

Element name

Description

Name

The name of the service.

InstanceId

The identifier of the service instance.

ConfigState

The state of the quota configuration.

Example

The following code example shows an Add Plan Service request.

POST https://<Computer>:30004/plans/GoldPhihoq8oa/services HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: 21f73545-7f64-4819-99b8-61485ce32549-2013-06-28 18:05:40Z
x-ms-client-session-id: d19ca528-d7bf-4a62-9d4d-03adbb4f6c74
x-ms-principal-id: <COMPUTER>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <COMPUTER>\Administrator
Content-Type: application/json; charset=utf-8
Host: <Computer>:30004
Content-Length: 91
Expect: 100-continue

{
  "Name": "mysqlservers",
  "InstanceId": "33CC0954-8412-4CE1-924F-B9CB1525FA96",
  "ConfigState": 0
}

The following code example shows an Add Plan Service response.

{
  "Name": "mysqlservers",
  "InstanceId": "33CC0954-8412-4CE1-924F-B9CB1525FA96",
  "ConfigState": 0
}

Remarks

A list of the available of services can be obtained by calling Retrieve a Collection of Resource Providers.

See Also

Administrator Plan Interfaces