首页 文章

Softlayer API:订购私有vlan

提问于
浏览
0

我们的要求是在3个不同的vlan中有5个虚拟机 . 在https://control.softlayer.com/network/vlans我没有看到创建私人vlans的选项 . 我想知道有没有办法使用SL API创建多个私人vlans?

1 回答

  • 0

    这是订购 private VlanREST 请求:

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

    方法:POST Json Payload:

    {
      "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": "qe.testing.qe@gmail.com"
            },
            {
              "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
            }
          ]
        }
      ]
    }
    

    Note:

    • 要执行此请求,请删除注释.e.g . #CONTACT_PHONE_NUMBER,#CONTACT_VALIDATED,#TOTAL_IPS_IN_12_MONTHS,#TOTAL_IPS_IN_30_DAYS .

    • 当所有配置准备就绪后,从 verifyOrder 更改为'placeOrder' . 要获得 valid item prices ,请执行:

    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
    

    如果要创建多个项目,可以使用SoftLayer创建的 API clientsSoftLayer Api Clients

    References:

    SoftLayer_Product_Order

    SoftLayer_Product_Order::placeOrder

    SoftLayer_Product_Order::verifyOrder

    SoftLayer_Container_Product_Order_Network_Vlan

    SoftLayer_Product_Item_Price

    Softlayer-API-Overview

相关问题