Een plan maken
Van toepassing op: Windows Azure Pack
Hiermee maakt u een nieuw plan.
Aanvraag
Geef de aanvraag Plan maken als volgt op: Vervang <ServiceMgmt> door het eindpuntadres van uw Service Management-API:
Methode |
Aanvraag-URI |
HTTP-versie |
---|---|---|
POST |
<https:// ServiceMgmt>:30004/plans |
HTTP/1.1 |
URI-parameters
Geen.
Aanvraagheaders
In de volgende tabel worden vereiste en optionele aanvraagheaders beschreven.
Aanvraagheader |
Beschrijving |
---|---|
Autorisatie: Bearer |
Vereist. Het bearer-token voor autorisatie. |
x-ms-principal-id |
Vereist. De principal-id. |
x-ms-client-request-id |
Optioneel. De clientaanvraag-id. |
x-ms-client-session-id |
Optioneel. De clientsessie-id. |
x-ms-principal-liveid |
Optioneel. De live-principal-id. |
Aanvraagbody
In de volgende tabel worden de elementen van de aanvraagbody beschreven.
Elementnaam |
Beschrijving |
---|---|
Plannen |
Zie Plan (Administrator-object) voor meer informatie. |
Antwoord
Het antwoord bevat een HTTP-statuscode, een set antwoordheaders en een antwoordtekst.
Statuscode
Een geslaagde bewerking retourneert statuscode 201 (CREATED). 409 (CONFLICT) wordt geretourneerd als de aangevraagde plannaam al bestaat.
Zie Status- en foutcodes (Windows Azure Pack Service Management) voor meer informatie over statuscodes.
Antwoordheaders
Het antwoord voor deze bewerking bevat standaard HTTP-headers. Alle standaardheaders voldoen aan de HTTP/1.1-protocolspecificatie.
Hoofdtekst van antwoord
In de volgende tabel worden de belangrijkste elementen van de antwoordtekst beschreven:
Elementnaam |
Beschrijving |
---|---|
Plannen |
Het nieuwe plan. Zie Een plan bijwerken voor meer informatie. |
Voorbeeld
In het volgende voorbeeld ziet u de aanvraag Plan maken .
POST https://<Computer>:30004/plans HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: e995f8b2-9a85-446e-a680-c424347c2a07-2013-06-28 17:58:52Z
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: 1132
Expect: 100-continue
{
"Id": "GoldPhihoq8oa",
"DisplayName": "Gold_Plan-1",
"State": 0,
"ConfigState": 0,
"QuotaSyncState": 2,
"LastErrorMessage": null,
"Advertisements": [
{
"LanguageCode": "en-us",
"DisplayName": "Gold_Plan-1",
"Description": null
}
],
"ServiceQuotas": [
{
"ServiceName": "webspaces",
"ServiceInstanceId": "0EA2F3E5-90D1-4CF0-B53D-5A111FF43122",
"ServiceDisplayName": "Web Site Cloud",
"ServiceInstanceDisplayName": null,
"ConfigState": 0,
"QuotaSyncState": 2,
"Settings": [
]
},
{
"ServiceName": "sqlservers",
"ServiceInstanceId": "7BAD5022-79CA-4B53-8177-1ACAEEAFA099",
"ServiceDisplayName": "SQL Servers",
"ServiceInstanceDisplayName": null,
"ConfigState": 0,
"QuotaSyncState": 2,
"Settings": [
]
},
{
"ServiceName": "servicebus",
"ServiceInstanceId": "51680204-CF5D-43DD-B264-4D5CB6076E02",
"ServiceDisplayName": "Service Bus",
"ServiceInstanceDisplayName": null,
"ConfigState": 0,
"QuotaSyncState": 2,
"Settings": [
]
}
],
"SubscriptionCount": 0,
"MaxSubscriptionsPerAccount": 1,
"AddOnReferences": [
{
"AddOnId": "SqlAOwlcnkya2zmcn1xhz",
"AddOnInstanceId": null,
"AcquisitionTime": null
},
{
"AddOnId": "SqlAOtqjctbuhtvmjmkyg",
"AddOnInstanceId": null,
"AcquisitionTime": null
}
],
"AddOns": [
],
"InvitationCode": null,
"Price": null
}
In het volgende codevoorbeeld ziet u het antwoord Plan maken .
{
"Id": "GoldPhihoq8oa",
"DisplayName": "Gold_Plan-1",
"State": 0,
"ConfigState": 1,
"QuotaSyncState": 0,
"LastErrorMessage": null,
"Advertisements": [
{
"LanguageCode": "en-us",
"DisplayName": "Gold_Plan-1",
"Description": null
}
],
"ServiceQuotas": [
{
"ServiceName": "webspaces",
"ServiceInstanceId": "0EA2F3E5-90D1-4CF0-B53D-5A111FF43122",
"ServiceDisplayName": "Web Site Cloud",
"ServiceInstanceDisplayName": "autotest1",
"ConfigState": 1,
"QuotaSyncState": 0,
"Settings": [
{
"Key": "BytesReceived_Shared_WebSpace_Limited",
"Value": "{\"ComputeMode\":0,\"CustomActionName\":null,\"EnforcementScope\":0,\"ExceededAction\":0,\"Limit\":-1,\"Period\":1440,\"QuotaName\":\"BytesReceived\",\"ResourceName\":\"BytesReceived\",\"SiteMode\":\"Limited\",\"Unit\":1,\"WebPlan\":null}"
}
]
},
{
"ServiceName": "sqlservers",
"ServiceInstanceId": "7BAD5022-79CA-4B53-8177-1ACAEEAFA099",
"ServiceDisplayName": "SQL Servers",
"ServiceInstanceDisplayName": "SQL Servers",
"ConfigState": 1,
"QuotaSyncState": 0,
"Settings": [
{
"Key": "Editions",
"Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":\"10\",\"resourceSize\":\"1024\",\"resourceSizeLimit\":\"1024\",\"offerEditionId\":\"062813055853\",\"groupType\":null}]"
}
]
},
{
"ServiceName": "servicebus",
"ServiceInstanceId": "51680204-CF5D-43DD-B264-4D5CB6076E02",
"ServiceDisplayName": "Service Bus Cloud",
"ServiceInstanceDisplayName": "MyServiceBusFarm",
"ConfigState": 1,
"QuotaSyncState": 0,
"Settings": [
]
}
],
"SubscriptionCount": 0,
"MaxSubscriptionsPerAccount": 1,
"AddOnReferences": [
{
"AddOnId": "SqlAOwlcnkya2zmcn1xhz",
"AddOnInstanceId": null,
"AcquisitionTime": null
},
{
"AddOnId": "SqlAOtqjctbuhtvmjmkyg",
"AddOnInstanceId": null,
"AcquisitionTime": null
}
],
"AddOns": [
{
"Id": "SqlAOwlcnkya2zmcn1xhz",
"DisplayName": "SqlAOwlcnkya2",
"State": 0,
"ConfigState": 1,
"QuotaSyncState": 0,
"LastErrorMessage": null,
"Advertisements": [
{
"LanguageCode": "en-us",
"DisplayName": "SqlAOwlcnkya2",
"Description": null
}
],
"ServiceQuotas": [
{
"ServiceName": "sqlservers",
"ServiceInstanceId": "7BAD5022-79CA-4B53-8177-1ACAEEAFA099",
"ServiceDisplayName": "SQL Servers",
"ServiceInstanceDisplayName": "SQL Servers",
"ConfigState": 1,
"QuotaSyncState": 0,
"Settings": [
{
"Key": "Editions",
"Value": "[{\"groupName\":\"Default\",\"resourceCount\":\"2\",\"resourceSize\":\"10\",\"offerEditionId\":\"1367541399669\"}]"
}
]
}
],
"SubscriptionCount": 1,
"AssociatedPlans": [
],
"MaxOccurrencesPerPlan": 1,
"Price": null
},
{
"Id": "SqlAOtqjctbuhtvmjmkyg",
"DisplayName": "SqlAOtqjctbuh",
"State": 0,
"ConfigState": 1,
"QuotaSyncState": 0,
"LastErrorMessage": null,
"Advertisements": [
{
"LanguageCode": "en-us",
"DisplayName": "SqlAOtqjctbuh",
"Description": null
}
],
"ServiceQuotas": [
{
"ServiceName": "sqlservers",
"ServiceInstanceId": "7BAD5022-79CA-4B53-8177-1ACAEEAFA099",
"ServiceDisplayName": "SQL Servers",
"ServiceInstanceDisplayName": "SQL Servers",
"ConfigState": 1,
"QuotaSyncState": 0,
"Settings": [
{
"Key": "Editions",
"Value": "[{\"groupName\":\"Default\",\"resourceCount\":\"2\",\"resourceSize\":\"10\",\"offerEditionId\":\"1367541399669\"}]"
}
]
}
],
"SubscriptionCount": 1,
"AssociatedPlans": [
],
"MaxOccurrencesPerPlan": 1,
"Price": null
}
],
"InvitationCode": null,
"Price": null
}
Opmerkingen
Binnen Windows Azure Pack moeten plannen een unieke DisplayName-waarde voor het planobject (Administrator-object) en de waardevoor de id van het planobject hebben. Als u een lijst met de huidige abonnementen wilt ophalen, belt u De beschikbare abonnementen ophalen. Gebruik deze informatie om unieke waarden voor DisplayName en Id te garanderen bij het maken van een nieuw plan.
Toegestane tekens voor id zijn ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=