2016-04-07 7 views

Antwort

0

Dies ist ein REST Anfrage eine private Vlan zu bestellen:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder 

Methode: POST Json Nutzlast:

{ 
    "parameters": [ 
    { 
     "location": "AMSTERDAM", 
     "packageId": 0, 
     "prices": [ 
     { 
      "id": 50745 # Private Network Vlan 
     }, 
     { 
      "id": 36696 # 8 Static Public IP Addresses 
     } 
     ], 
     "quantity": 1, 
     "name": "myNewVlan", 
     "complexType": "SoftLayer_Container_Product_Order_Network_Vlan", 
     "itemCategoryQuestionAnswers": [ 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 14, 
      "answer": 4 # TOTAL_IPS_IN_30_DAYS 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 15, 
      "answer": 4 # TOTAL_IPS_IN_12_MONTHS 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 16, 
      "answer": "Description of your need for additional IPs" 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 9, 
      "answer": "Contact name" 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 10, 
      "answer": "Contact job title" 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 11, 
      "answer": "[email protected]" 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 12, 
      "answer": "72578789" # CONTACT_PHONE_NUMBER 
     }, 
     { 
      "categoryId": 53, 
      "categoryCode": "static_sec_ip_addresses", 
      "questionId": 13, 
      "answer": true # CONTACT_VALIDATED 
     } 
     ] 
    } 
    ] 
} 

Hinweis:

  • Anfrage auszuführen , entferne t er kommentiert bitte z. # CONTACT_PHONE_NUMBER, # CONTACT_VALIDATED, # TOTAL_IPS_IN_12_MONTHS, # TOTAL_IPS_IN_30_DAYS.

  • Wenn Ihre Konfiguration fertig ist, wechseln Sie von verifyOrder zu 'placeOrder'. Um valid item prices zu erhalten, führen:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]] 
    
    Method: GET 
    

Wenn Sie mehrere Elemente erstellen möchten, können Sie API clients von Softlayer erstellt verwenden: SoftLayer Api Clients

Referenzen:

SoftLayer_Product_Order

SoftLayer_Product_Order::placeOrder

SoftLayer_Product_Order::verifyOrder

SoftLayer_Container_Product_Order_Network_Vlan

SoftLayer_Product_Item_Price

Softlayer-API-Overview

+0

In diesem Beispiel, ist die Lage "Amsterdam", die * ist sehr * unterscheidet sich von der placeOrder Anruf, wenn zum Beispiel iSCSI Bestellung Festplatten (die die Standort-ID verwenden). Kann ich die Standort-ID anstelle von "AMSTERDAM" oder "ams01" verwenden? Wenn ich nicht kann, wo bekomme ich gültige Werte für den Standortparameter in * diesem bestimmten * API-Aufruf? –

Verwandte Themen