diff --git a/article/understanding-ordering/index.html b/article/understanding-ordering/index.html index fe4b5400296..aa61f9ba9dc 100644 --- a/article/understanding-ordering/index.html +++ b/article/understanding-ordering/index.html @@ -205,7 +205,7 @@

Understanding and building an order using the Softlayer order CLI

  • Place an order programmatically using Python.
  • -

    Build an order

    +

    Step 1: Understand the order structure

    In the SoftLayer API, an order can consist of multiple order containers. For simplicity, the order CLI only works with one order container, so in these examples and explanations, the terms “order container” and “order” are synonymous.

    A package is the first component to look for when placing an order. Packages are divided among the different top-level products available for ordering in SoftLayer. Some example packages are CLOUD_SERVER for VSIs, BARE_METAL_SERVER for bare metal servers, and STORAGE_AS_A_SERVICE_STAAS for Storage-as-a-Service. Within a package, there are items that are subdivided into categories. Some packages have presets for your convenience and others require that you specify items individually. If a package’s category is required, an item from that category must be chosen to order the package. Depending on the category, items within the category are mutually exclusive (for example, you can’t order both 8 GB and 16 GB of RAM for a VSI). Finally, each order must have an associated location (datacenter).

    @@ -455,7 +455,7 @@

    Step 5: Place the order

    : status : PENDING_APPROVAL : :.........:...........................:

    We now have ordered a bare metal server!

    -

    Place an order programmatically with Python

    +

    Now that we have used the CLI to build an order with the package and items that we want, we can convert this order to Python code and programmatically place the order.

    Safety of item keynames

    Using item keynames is a more hardened way of placing orders. Item IDs may change, and orders placed with hard-coded IDs may not continually work. Keynames will allow orders to consistently work, because price IDs for the order are dynamically retrieved for you.

    @@ -657,7 +657,7 @@

    Various Ordering Examples

    --billing monthly --verify

    Turns into:

    curl -u $SL_USER:$SL_APIKEY -X POST -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" -d '{"parameters": [{"orderContainers": [{"hardware": [{"domain": "test-cgallo.com", "hostname": "testOrderCANCEL"}, {"primaryBackendNetworkComponent": {"networkVlan": {"id": 2257307}}}], "packageId": 257, "quantity": 1, "location": 1854895, "useHourlyPricing": false, "complexType": "SoftLayer_Container_Product_Order_Hardware_Server", "prices": [{"id": 49515}, {"id": 49415}, {"id": 48999}, {"id": 876}, {"id": 49759}, {"id": 50357}, {"id": 274}, {"id": 21}, {"id": 906}, {"id": 418}, {"id": 57}, {"id": 56}, {"id": 420}, {"id": 58}]}]}]}' 'https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/verifyOrder.json'
    -

    Step by Step Example with ibmcloud CLI

    +

    These commands will use the ibmcloud sl command, but it works the same way as slcli. The only big difference is ibmcloud requires Items be a comma seperated list, where slcli requires them be space seperated.

    Here we want to order a Cascade Lake Dual Xeon server.

    Get the package.

    @@ -704,6 +704,114 @@

    “Extras”

    Everything Together

    ibmcloud sl order place DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES  DALLAS13  INTEL_XEON_4210_2_20,RAM_32_GB_DDR4_2133_ECC_NON_REG,OS_DEBIAN_10_X_BUSTER_MINIMAL_64_BIT,1_GBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS,DISK_CONTROLLER_RAID,HARD_DRIVE_2_00_TB_SATA_2,HARD_DRIVE_2_00_TB_SATA_2,BANDWIDTH_1000_GB,REBOOT_KVM_OVER_IP,1_IP_ADDRESS,UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT,NOTIFICATION_EMAIL_AND_TICKET,MONITORING_HOST_PING,AUTOMATED_NOTIFICATION --complex-type SoftLayer_Container_Product_Order_Hardware_Server --extras '{"hardware":[{"hostname":"cgallo-test","domain":"cgallo.com","primaryBackendNetworkComponent": {"networkVlan": {"primarySubnet":{"id": 1942931}}},"primaryNetworkComponent": {"networkVlan": {"id": 2848660}}}],"storageGroups":[{"arrayTypeId": 2,"arraySize": 2000,"hardDrives": [0,1],"partitionTemplateId": 1}],"sshKeys": [{"sshKeyIds":[87634,92868]}],"provisionScripts": ["https://pastebin.com/raw/SCp607Tm"]}' --billing monthly --verify
     
    slcli order place DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES  DALLAS13  INTEL_XEON_4210_2_20 RAM_32_GB_DDR4_2133_ECC_NON_REG OS_DEBIAN_10_X_BUSTER_MINIMAL_64_BIT 1_GBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS DISK_CONTROLLER_RAID HARD_DRIVE_2_00_TB_SATA_2 HARD_DRIVE_2_00_TB_SATA_2 BANDWIDTH_1000_GB REBOOT_KVM_OVER_IP 1_IP_ADDRESS UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT NOTIFICATION_EMAIL_AND_TICKET MONITORING_HOST_PING AUTOMATED_NOTIFICATION --complex-type SoftLayer_Container_Product_Order_Hardware_Server --extras '{"hardware":[{"hostname":"cgallo-test","domain":"cgallo.com","primaryBackendNetworkComponent": {"networkVlan": {"primarySubnet":{"id": 1942931}}},"primaryNetworkComponent": {"networkVlan": {"id": 2848660}}}],"storageGroups":[{"arrayTypeId": 2,"arraySize": 2000,"hardDrives": [0,1],"partitionTemplateId": 1}],"sshKeys": [{"sshKeyIds":[87634,92868]}],"provisionScripts": ["https://pastebin.com/raw/SCp607Tm"]}' --billing monthly --verify
    +
    +

    Lets say you are ordering a server, and want to automate it. For this example, we will build a server that looks like this: +2U_QUAD_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_24_DRIVES

    +

    Most of the information you need to build an API order is on the order form already. The only thing you need to know is that the Intel Xeon 8260 is a Cascade Lake class of processor, so when you look for packages, that is the keyword you will search for.

    +
      +
    1. Find the package:
    2. +
    +
    $> slcli order package-list  | grep -i cascade
    + 1105     Dual Intel Xeon Processor Cascade Lake Scalable Family (4 Drives)     DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES                     BARE_METAL_CPU
    + 1107    Dual Intel Xeon Processor Cascade Lake Scalable Family (12 Drives)       DUAL_INTEL_XEON_PROC_CASCADE_LAKE_SCALABLE_FAMILY_12_DRIVES                       BARE_METAL_CPU
    + 1111          Cascade Lake for VMware vSAN QualifiedNode (12 Drives)                    2U_CASCADE_LAKE_FOR_VMWARE_VSAN_QUALIFIEDNODE                              BARE_METAL_CPU
    + 1113       Quad Xeon Processor Cascade Lake Scalable Family (24 Drives)         2U_QUAD_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_24_DRIVES                      BARE_METAL_CPU
    + 2670          Cascade Lake for VMware vSAN QualifiedNode (24 Drives)                             2U_VMWARE_VSAN_QUALIFIEDNODE                                      BARE_METAL_CPU
    + 2692         Dual Xeon Proc Cascade Lake Multi-GPU Family (24 Drives)              4U_DUAL_XEON_PROC_CASCADE_LAKE_MULTIGPU_FAMILY_24_DRIVES                        BARE_METAL_CPU
    + 2708  CVAD Dual Intel Xeon Processor Cascade Lake Scalable Family (12 Drives)   CVAD_DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_12_DRIVES                     BARE_METAL_CPU
    + 2710  CVAD Dual Intel Xeon Processor Cascade Lake Scalable Family (4 Drives)    CVAD_DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_4_DRIVES                      BARE_METAL_CPU
    + 2796           Cascade Lake for VMware vSAN QualifiedNode (4 Drives)                    1U_CASCADE_LAKE_FOR_VMWARE_VSAN_QUALIFIEDNODE                              BARE_METAL_CPU
    + 2866    Oracle Application Cluster Cascade Lake Scalable Family (4 Drives)     ORACLE_APPLICATION_CLUSTER_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES                    BARE_METAL_CPU
    + 3110            Cascade Lake VMW PMEM Enabled 1.5TB-3TB (12 Drives)                  2U_CASCADE_LAKE_VMW_PMEM_ENABLED_1_5TB_3TB_12_DRIVES                          BARE_METAL_CPU
    + 3116             Cascade Lake VMW PMEM Enabled 3TB-6TB (24 Drives)                      CASCADE_LAKE_VMW_PMEM_ENABLED_3TB6TB_24_DRIVES                             BARE_METAL_CPU
    +

    We want the 2U_QUAD_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_24_DRIVES package here since it has the Quad Processor and Up to 24 Drives mentioned on the order form.

    +
      +
    1. Find all the items you need.
    2. +
    +
    $> slcli order item-list 2U_QUAD_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_24_DRIVES
    +

    We will need the following to match the order:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CategoryKeyName
    bandwidthBANDWIDTH_20000_GB
    disk0HARD_DRIVE_960GB_SSD_SED_5DWPD
    disk_controllerDISK_CONTROLLER_NONRAID
    monitoringMONITORING_HOST_PING
    notificationNOTIFICATION_EMAIL_AND_TICKET
    osOS_CENTOS_STREAM_9_X_64_BIT
    port_speed100_MBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS
    power_supplyREDUNDANT_POWER_SUPPLY
    pri_ip_addresses1_IP_ADDRESS
    ramRAM_384_GB_DDR4_2133_ECC_REG
    remote_managementREBOOT_KVM_OVER_IP
    responseAUTOMATED_NOTIFICATION
    serverINTEL_XEON_8260_2_4_96
    vpn_managementUNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT
    +
      +
    1. Add it all and verify the order
    2. +
    +

    (use slcli -vvv order place to see actual API calls this makes)

    +
    $> slcli order place 2U_QUAD_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_24_DRIVES DALLAS10  BANDWIDTH_20000_GB \
    +HARD_DRIVE_960GB_SSD_SED_5DWPD DISK_CONTROLLER_NONRAID MONITORING_HOST_PING NOTIFICATION_EMAIL_AND_TICKET \
    +OS_CENTOS_STREAM_9_X_64_BIT 100_MBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS REDUNDANT_POWER_SUPPLY 1_IP_ADDRESS \
    +RAM_384_GB_DDR4_2133_ECC_REG REBOOT_KVM_OVER_IP AUTOMATED_NOTIFICATION INTEL_XEON_8260_2_4_96 \
    +UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT \
    +--verify --quantity 1 --billing monthly  --complex-type SoftLayer_Container_Product_Order_Hardware_Server \
    +--extras '{"hardware": [{"hostname": "baremetal01", "domain": "ibmcloud.private"}]}'
    +

    To make this into a pure API call, use the output of slcli -vvv order place and the slcli will convert the item keynames into the required priceIds needed for SoftLayer_Product_Order::placeOrder()

    +
    $> curl -u $SL_USER:$SL_APIKEY -X POST -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" -d '{"parameters": [{"orderContainers": [{"hardware": [{"hostname": "baremetal01", "domain":
    +"ibmcloud.private"}], "packageId": 1113, "quantity": 1, "location": 1441195, "useHourlyPricing": false, "complexType": "SoftLayer_Container_Product_Order_Hardware_Server", "prices": [{"id": 342}, {"id":
    +230475}, {"id": 876}, {"id": 55}, {"id": 57}, {"id": 307539}, {"id": 21513}, {"id": 50221}, {"id": 21}, {"id": 165785}, {"id": 906}, {"id": 58}, {"id": 254988}, {"id": 420}]}]}]}'
    +'https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/placeOrder.json'
     
    diff --git a/go/goroutines/index.html b/go/goroutines/index.html index ed9c40f91f4..a2706a3cabd 100644 --- a/go/goroutines/index.html +++ b/go/goroutines/index.html @@ -165,7 +165,7 @@
    -

    January 1, 0001

    +

    February 16, 2024

    diff --git a/go/index.html b/go/index.html index e6848ba961b..b52849e4ea6 100644 --- a/go/index.html +++ b/go/index.html @@ -168,6 +168,16 @@

    + Goroutines, Pagination and the SoftLayer API Feb 16, 2024
    + Describes some ways to implement concurrency in your golang applications when interacting with the SoftLayer API. A few examples and explanation of softlayer-go's features. +

    + View Example +
    +
    + +
    +
    +

    order_endurance_storage.go Mar 10, 2023
    order_endurance_storage.go

    @@ -1295,16 +1305,6 @@

    -
    -
    -

    - Goroutines, Pagination and the SoftLayer API Jan 1, 0001
    - Describes some ways to implement concurrency in your golang applications when interacting with the SoftLayer API. A few examples and explanation of softlayer-go's features. -

    - View Example -
    -
    -