REST:使用SoftLayer_Hardware :: createObject代替SoftLayer_Product_Order :: placeOrder [英] REST: use SoftLayer_Hardware::createObject instead of SoftLayer_Product_Order::placeOrder

查看:49
本文介绍了REST:使用SoftLayer_Hardware :: createObject代替SoftLayer_Product_Order :: placeOrder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要订购两台裸机服务器 我是通过REST API完成的:SoftLayer_Product_Order/placeOrder 具有以下有效负载.

I want to order two bare metal servers I did it via REST api: SoftLayer_Product_Order/placeOrder with the following payload.

 "useHourlyPricing": true,
          "quantity": 2,
          "location": 448994,
          "packageId": 200,
          "presetId": 95,
          "prices": [
            {
              "id": 36365
            },
            {
              "id": 52795
            },
            {
              "id": 1800
            },
            {
              "id": 21
            },
            {
              "id": 906
            },
            {
              "id": 420
            },
            {
              "id": 418
            }
          ]

但是,使用单独的vLAN创建的服务器. 如何使多个服务器的顺序共享相同的vLAN?

However, the servers created with separate vLANs. How to make the order of multiple servers share the same vLANs?

推荐答案

不幸的是,我无法为程序包200(快速服务器)定义VLAN ,这意味着您将无法通过 SoftLayer_Hardware_Server :: createObject

Unfortunately, it's not possible to define VLANS for package 200 (Fast Servers), it means that you will not be able to do this through SoftLayer_Hardware_Server::createObject

如果尝试使用其他裸机服务器软件包,则可以设置VLAN(甚至子网).

You will be able to set VLANS (even subnets), if you try with a different package for Bare Metal Servers.

以防万一,这里是一个示例,用于订购定义VLAN和子网的服务器(这是针对VSI,但对于裸机服务器也应采用相同的想法)

Just in case, here an example to order a Server defining the vlans and subnets (This is for VSI, but the same idea should be applied for Bare Metal Servers)

注意: SoftLayer_Hardware_Server :: createObject 该方法允许订购软件包50和200(设置预设配置时为软件包200),如果要订购软件包50(无预设配置),则可以设置VLAN和子网.

Note: SoftLayer_Hardware_Server::createObject method allows to order packages 50 and 200 (package 200 when you set preset configuration), in case that you wish to order package 50 (without preset config), you will be able to set vlans and subnets.

已更新


检索VLAN-可用的子网基于包和位置

虚拟局域网应该属于您要下订单的同一数据中心,要获取虚拟局域网和子网(公共/专用)信息可用于包和位置,您可以尝试以下请求:


Retrieve Vlans - Subnets available based on Package and Location

The vlans should belong in the same datacenter in which you wish to place the order, to get vlan and subnets (public/private) information available for the package and location, you can try the following request:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Order/getVlans

Method: Post

{
  "parameters": 
   [
       448994, 50
   ]
}

替换:用您自己的信息替换$ user和$ apiKey.另外, 448994表示locationId,50表示packageId ,将它们替换为所需的值

Replace: $user and $apiKey with you own information. Also 448994 refers to locationId and 50 refers to packageId, replace them with the values that you wish

参考文献: - SoftLayer_Product_Order :: getVlans

这篇关于REST:使用SoftLayer_Hardware :: createObject代替SoftLayer_Product_Order :: placeOrder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆