百度智能云

All Product Document

          Dedicated Cloud Compute

          Create a DCC

          Create a DCC

          • This interface is used to create one or multiple DCCs with the same configuration.

          Request structure

          POST /v{version}/dedicatedHost?clientToken={clientToken} HTTP/1.1
          Host: dcc.bj.baidubce.com
          Authorization authorization string
          
          {
              "vCpu": vCpu,  //Number of the virtual CPU cores
              "name": "name",  //Name of the DCC
              "flavorName": "flavorName",  //Package type: "C01"
              "purchaseCount": purchaseCount,  //Purchased quantity with the minimum of 1
              "billing":{
                  "paymentTiming": paymentTiming,  //Payment time, including the prepaid and postpaid.
                  "reservation": {
                      "reservationLength": reservationLength  //Purchased duration with the minimum of 1
                  }
              },
              "zoneName": zoneName   //zone information, the default of which is empty.
          }

          Request header field

          No other special header fields are available, except for common header fields.

          Request parameters

          Parameter Name Type Required Parameter position Description
          version String Yes URI parameter API version number
          clientToken String Yes Query parameter It is an idempotent Token, which is an ASCII character string with the length of no more than 64 bits
          vCpu int No RequestBody parameter The number of the virtual CPU cores to be created for the DCC, which cannot exceed twice the number of the physical CPU cores
          flavorName String Yes RequestBody parameter Package type, including the optional calculation types of C01 and C02, and the optional big data storage types of S01 and S02
          purchaseCount int No RequestBody parameter The number of the dedicated virtual hosts created (purchased) in batch, which is an optional parameter. It must be an integer greater than 0, and its default value is 1.
          name String No RequestBody parameter Name of a DCC (optional) The name is not specified by default. If the name is specified: name is used as the prefix of the DCC’s name in batch. A suffix is attached to the backend name. The suffix generation mode is name{-sequence number}. If no name is specified, a name is generated automatically in the mode of {instance-8-bit random string-Sequence number}. Note: The random string is composed of digital numbers of 0-9 and English letters of a-z. The sequence number is increased by the order of count. If the count is 100, the sequence number is increased from 000 to 100. If it is 10, the sequence number is increased from 00 to 10
          billing [Billing](DCC/API Reference/Appendix.md#Billing) Yes RequestBody parameter Order and billing-related parameter
          zoneName String No RequestBody parameter It specifies the zone information, which is null by default and automatically selected by the system

          Return header field

          No other special header fields are available, except for common header fields.

          Return parameters

          Parameter Name Type Description
          dedicatedHostIds List It is a set of the DCC IDs, where the ID is a string with a fixed length in line with the BCE specification, and contains only uppercase and lowercase English letters, numbers, hyphens (-), and underscores (_)

          Error code

          Error Code Error Description HTTP Status Code Explanation
          dedicatedHost.dedicatedHostBeBanned The DCC is banned. Contact technical support for assistance. 403 The DCC service is banned
          dedicatedHost.GlobalhostQuotaLimitExceeded Quota exceeds limit for regional prepaid DCC pool. Contact technical support for further assistance. 413 The number of the prepaid DCCs exceeds the limit of the presale quota in the current region
          dedicatedHost.dedicatedHostQuotaLimitExceeded Quota exceeds limit. 413 The number of DCCs exceeds the limit

          Request example

          POST /v1/dedicatedHost?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
          Host: dcc.bj.baidubce.com
          ContentType: application/json    
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          
          {
              "cCpu": 22,  //Number of virtual CPU cores
              "flavorName": "C01",  //Package configuration: "C01"
              "purchaseCount": 1,  //Purchased quantity with the minimum of 1
              "billing":{
                  "paymentTiming": "prepaid",  //Payment time, including the prepaid and postpaid.
                  "reservation": {
                      "reservationLength": 1 //Purchased duration with the minimum of 1
                  }
              }
          }

          Return example

          HTTP/1.1 200 OK
          x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
          Date: Wed, 03 Dec 2014 06:42:19 GMT
          Content-Type: application/json;charset=UTF-8
          Server: BWS
          
          {
              "dedicatedHostIds": [
                  "d-qw2Pf3wB"
              ]
          }
          Previous
          DCC Renewal
          Next
          Bind a Tag to DCC