百度智能云

All Product Document

          Simple Cache Service SCS

          Create an Instance

          Description

          • This interface is used to create one or more “redis” instances.
          • To create an instance, you need to perform identity verification. The user who does not pass the identity verification can perform the identity verification under security authentication in the console of the Baidu Open Cloud official website.
          • For a postpaid (billing method) instance, the account cash balance + general-type voucher is greater than 100; for a prepaid instance, the account cash balance is greater than or equal to the instance fee.
          • The batch creation is supported;if one instance fails to be created during the creation process, all instances will be rolled back.
          • The creation interface is created asynchronously. You can query the instance status by querying the specified instance interface details.

          Request Structure

          POST /v{version}/instance?clientToken={clientToken} HTTP/1.1
          HOST: redis.{region}.baidubce.com
          Authorization authorization string

          Request Header Field

          There are no other special header fields except the public header field.

          Request Parameter

          Parameters Type Required Parameter Position Description
          version string Yes URI Parameter API version No.
          clientToken string Yes Query parameters It is an idempotent Token, which is an ASCII character string with length of no more than 64 bits.
          Billing Billing Yes RequestBody parameter Parameters for billing. Structure and value references
          instanceName String Yes RequestBody parameter User-defined instance name requirements: 1) Support uppercase and lowercase letters, numbers, and special characters such as -_ /. And start with a letter; 2) The length is up to 1-64 bits;
          nodeType string Yes RequestBody parameter See node types in the appendix
          port int Yes RequestBody parameter Port number 1025 < port <22222 ,22222 < port < 65535
          engineVersion String Yes RequestBody parameter Engine version, Cluster: 3.2; Master-slave: 3.2, 4.0
          purchaseCount int Yes RequestBody parameter Number of purchases, up to 10, default 1
          shardNum int Yes RequestBody parameter Multipart number
          proxyNum int Yes RequestBody parameter Number of proxy nodes, currently supported values: master-slave version: 0 cluster version: number of proxy nodes = number of Multiparts
          clusterType string Yes RequestBody parameter Cluster types: “Cluster”, “master_slave”
          replicationNum int No RequestBody parameter Number of copies, 1 for single copy, 2 for double copy, and so on for multiple copies
          vpcId string Yes RequestBody parameter For vpc, if not provided, it is the default vpc. You can query the available VPC by calling the Query VPC List interface.
          subnets List<SubnetMap> No RequestBody parameter Input it when subnet IP is insufficient, You can query the subnet list by calling the Query Subnet Interface.autoRenewTimeUnit
          autoRenewTimeUnit String No RequestBody parameter Pay monthly or yearly, "month" or "year"
          autoRenewTime int No RequestBody parameter The automatic renewal time is 1-9 per month and 1-3 per year

          SubnetMap

          Parameter Name Type Description
          zoneName String It specifies the “zone” information, which is null by default and is automatically selected by the system. You can query the availability zone list by calling the Availability Zone List interface. The ZoneName naming convention is "country-region-availability zone sequence” represented by lowercase letters, for example, Beijing availability zone A is represented with "cn-bj-a". The dedicated instance uses the zone where the dedicated server is located, without specifying this field.
          subnetId String It is the subnet Id, if it is null, the default subnet is used.

          Request Example

          POST /v2/instance?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
          HOST: redis.bj.baidubce.com
          ContentType: application/json  
          Authorization bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
            
          {
              "billing": {
                  "paymentTiming": "Prepaid",
                  "reservation": {
                      "reservationLength": 1
                  }
              },
              "purchaseCount": 1,
              "instanceName": "scs_name",
              "nodeType": "cache.n1.medium",
              "shardNum": 1,
              "proxyNum": 0,
              "clusterType": "master_slave",
              "replicationNum": 2,
              "port": 6379,
              "engineVersion": "3.2",
              "vpcId": "vpc-1n1wqxfu4iuu",
              "subnets": [
                  {
                      "zoneName": "cn-bj-a",
                      "subnetId": "sbn-rvv87cdd0gv9"
                  }
              ]
          }

          Return Header Field

          There are no other special header fields except the common header field.

          Return Parameters

          Parameter Name Type Description
          instanceIds List InstanceId The array comprised of InstanceIds

          Return Example

          {
              "instanceIds":["scs-bj-cxisuftlkquj"]
          }

          Error Code

          No special return parameters.

          Previous
          General Introductions
          Next
          Release an Instance