GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python_api_sample/db/db_createInstance.py at master · fromcloud/python_api_sample

Expand file tree

/

db_createInstance.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
64 lines (55 loc) · 1.92 KB
/

db_createInstance.py

Copy path

File metadata and controls

executable file
·
64 lines (55 loc) · 1.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
import sys
sys.path.insert(0, "../config/")
sys.path.insert(0, "../ucloudbiz/")
import ucloudbiz
import urllib2
import urllib
import hashlib
import hmac
import base64
import urlparse
import linecache
import url_config
import user_config
baseurl = url_config.db_url
apikey = user_config.apikey
secretkey = user_config.secretkey
import string
import random
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
instancename=id_generator()
storagesize='50' # 10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300 (GB)
perfclass='2x2' # 0.37X0.5, 1X1, 1X2, 2X2, 2X4, 4X4, 4X8, 8X8, 8X16, 8X32, 12X16, 12X32 (vCoreXGB)
maintenanceweekday='sun' # sunday
parametergroupid='21' # 21 = mysql5.6.24_default1_small, 22 = mysql5.6.25_default_medium, 23 = mysql5.6.24_default1_large
dbmastername='root' # mysql admin account
dbmasterpassword='admin12345' # mysql admin password
dbname='sakila' # mysql database name
dbengineversion='5.6.24' # mysql version
usageplantype='hourly' # billing period = hourly, monthly
zone='kr-1' # kr-0 (Seoul-M), kr-1 (Central-A), kr-2 (Central-B)
if apikey:
request={}
request['command']='createInstance'
request['instancename']=instancename
request['perfclass']=perfclass
request['storagesize']=storagesize
request['maintenanceweekday']=maintenanceweekday
request['parametergroupid']=parametergroupid
request['dbmastername']=dbmastername
request['dbmasterpassword']=dbmasterpassword
request['dbname']=dbname
request['dbengineversion']=dbengineversion
request['usageplantype']=usageplantype
request['zone']=zone
request['response']='xml'
request['apikey']=apikey
req_url=ucloudbiz.get_sig_request(request, secretkey, baseurl)
print "Request URL = %s\n" % req_url
#res=urllib2.urlopen(req_url)
#print res.read()
#res.close()
else:
print ""
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.