Skip to content

Commit 3e9c7e9

Browse files
authored
add ucdn product (#17)
FEATURE: - Add `UCDN` product
1 parent 5647df4 commit 3e9c7e9

File tree

18 files changed

+2668
-264
lines changed

18 files changed

+2668
-264
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ venv.bak/
112112
# Debug
113113
*.stackdump
114114
examples/debug
115+
bdd/
116+
.version

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ gen:
8888
--lang python3 \
8989
--template ${UCLOUD_TEMPLATE_PATH}/scripts-test.tpl \
9090
--output ./scripts/gen-tests.sh
91+
92+
version:
93+
@python -c 'from ucloud.version import version; print(version)'

docs/conf.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = 'ucloud-sdk-python3'
21-
copyright = '2019, ucloud'
22-
author = 'ucloud'
20+
project = "ucloud-sdk-python3"
21+
copyright = "2019, ucloud"
22+
author = "ucloud"
2323

2424

2525
# -- General configuration ---------------------------------------------------
@@ -28,14 +28,14 @@
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
3030
extensions = [
31-
'sphinx.ext.autodoc',
32-
'sphinx.ext.doctest',
33-
'sphinx.ext.todo',
34-
'sphinx.ext.viewcode',
31+
"sphinx.ext.autodoc",
32+
"sphinx.ext.doctest",
33+
"sphinx.ext.todo",
34+
"sphinx.ext.viewcode",
3535
]
3636

3737
# Add any paths that contain templates here, relative to this directory.
38-
templates_path = ['_templates']
38+
templates_path = ["_templates"]
3939

4040
# List of patterns, relative to source directory, that match files and
4141
# directories to ignore when looking for source files.
@@ -48,9 +48,9 @@
4848
# The theme to use for HTML and HTML Help pages. See the documentation for
4949
# a list of builtin themes.
5050
#
51-
html_theme = 'alabaster'
51+
html_theme = "alabaster"
5252

5353
# Add any paths that contain custom static files (such as style sheets) here,
5454
# relative to this directory. They are copied after the builtin static files,
5555
# so a file named "default.css" will overwrite the builtin "default.css".
56-
html_static_path = ['_static']
56+
html_static_path = ["_static"]

docs/services.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
UCloud SDK Services
22
===================
33

4-
PathX
5-
-----
6-
7-
.. autoclass:: ucloud.services.pathx.client.PathXClient
8-
:members:
9-
104
StepFlow
115
--------
126

@@ -19,6 +13,12 @@ UAccount
1913
.. autoclass:: ucloud.services.uaccount.client.UAccountClient
2014
:members:
2115

16+
UCDN
17+
----
18+
19+
.. autoclass:: ucloud.services.ucdn.client.UCDNClient
20+
:members:
21+
2222
UDB
2323
---
2424

@@ -78,4 +78,3 @@ VPC
7878

7979
.. autoclass:: ucloud.services.vpc.client.VPCClient
8080
:members:
81-

scripts/gen-services.sh

Lines changed: 12 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -2,123 +2,15 @@
22

33
# Code is generated by ucloud-model, DO NOT EDIT IT.
44

5-
ucloud-model sdk apis --lang python3 --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/clients.tpl --output ./ucloud/client.py
6-
ucloud-model sdk apis --lang python3 --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/docs.tpl --output ./docs/services.rst
7-
8-
9-
mkdir -p ./ucloud/services/pathx/schemas
10-
touch ./ucloud/services/pathx/__init__.py
11-
touch ./ucloud/services/pathx/schemas/__init__.py
12-
ucloud-model sdk apis --lang python3 --product PathX --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/pathx/schemas/apis.py
13-
ucloud-model sdk apis --lang python3 --product PathX --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/pathx/schemas/models.py
14-
ucloud-model sdk apis --lang python3 --product PathX --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/pathx/client.py
15-
black ucloud/services/pathx
16-
python -m ucloud.services.pathx.client
17-
18-
mkdir -p ./ucloud/services/stepflow/schemas
19-
touch ./ucloud/services/stepflow/__init__.py
20-
touch ./ucloud/services/stepflow/schemas/__init__.py
21-
ucloud-model sdk apis --lang python3 --product StepFlow --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/stepflow/schemas/apis.py
22-
ucloud-model sdk apis --lang python3 --product StepFlow --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/stepflow/schemas/models.py
23-
ucloud-model sdk apis --lang python3 --product StepFlow --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/stepflow/client.py
24-
black ucloud/services/stepflow
25-
python -m ucloud.services.stepflow.client
26-
27-
mkdir -p ./ucloud/services/uaccount/schemas
28-
touch ./ucloud/services/uaccount/__init__.py
29-
touch ./ucloud/services/uaccount/schemas/__init__.py
30-
ucloud-model sdk apis --lang python3 --product UAccount --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/uaccount/schemas/apis.py
31-
ucloud-model sdk apis --lang python3 --product UAccount --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/uaccount/schemas/models.py
32-
ucloud-model sdk apis --lang python3 --product UAccount --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/uaccount/client.py
33-
black ucloud/services/uaccount
34-
python -m ucloud.services.uaccount.client
35-
36-
mkdir -p ./ucloud/services/udb/schemas
37-
touch ./ucloud/services/udb/__init__.py
38-
touch ./ucloud/services/udb/schemas/__init__.py
39-
ucloud-model sdk apis --lang python3 --product UDB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/udb/schemas/apis.py
40-
ucloud-model sdk apis --lang python3 --product UDB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/udb/schemas/models.py
41-
ucloud-model sdk apis --lang python3 --product UDB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/udb/client.py
42-
black ucloud/services/udb
43-
python -m ucloud.services.udb.client
44-
45-
mkdir -p ./ucloud/services/udpn/schemas
46-
touch ./ucloud/services/udpn/__init__.py
47-
touch ./ucloud/services/udpn/schemas/__init__.py
48-
ucloud-model sdk apis --lang python3 --product UDPN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/udpn/schemas/apis.py
49-
ucloud-model sdk apis --lang python3 --product UDPN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/udpn/schemas/models.py
50-
ucloud-model sdk apis --lang python3 --product UDPN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/udpn/client.py
51-
black ucloud/services/udpn
52-
python -m ucloud.services.udpn.client
53-
54-
mkdir -p ./ucloud/services/udisk/schemas
55-
touch ./ucloud/services/udisk/__init__.py
56-
touch ./ucloud/services/udisk/schemas/__init__.py
57-
ucloud-model sdk apis --lang python3 --product UDisk --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/udisk/schemas/apis.py
58-
ucloud-model sdk apis --lang python3 --product UDisk --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/udisk/schemas/models.py
59-
ucloud-model sdk apis --lang python3 --product UDisk --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/udisk/client.py
60-
black ucloud/services/udisk
61-
python -m ucloud.services.udisk.client
62-
63-
mkdir -p ./ucloud/services/uhost/schemas
64-
touch ./ucloud/services/uhost/__init__.py
65-
touch ./ucloud/services/uhost/schemas/__init__.py
66-
ucloud-model sdk apis --lang python3 --product UHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/uhost/schemas/apis.py
67-
ucloud-model sdk apis --lang python3 --product UHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/uhost/schemas/models.py
68-
ucloud-model sdk apis --lang python3 --product UHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/uhost/client.py
69-
black ucloud/services/uhost
70-
python -m ucloud.services.uhost.client
71-
72-
mkdir -p ./ucloud/services/ulb/schemas
73-
touch ./ucloud/services/ulb/__init__.py
74-
touch ./ucloud/services/ulb/schemas/__init__.py
75-
ucloud-model sdk apis --lang python3 --product ULB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/ulb/schemas/apis.py
76-
ucloud-model sdk apis --lang python3 --product ULB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/ulb/schemas/models.py
77-
ucloud-model sdk apis --lang python3 --product ULB --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/ulb/client.py
78-
black ucloud/services/ulb
79-
python -m ucloud.services.ulb.client
80-
81-
mkdir -p ./ucloud/services/umem/schemas
82-
touch ./ucloud/services/umem/__init__.py
83-
touch ./ucloud/services/umem/schemas/__init__.py
84-
ucloud-model sdk apis --lang python3 --product UMem --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/umem/schemas/apis.py
85-
ucloud-model sdk apis --lang python3 --product UMem --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/umem/schemas/models.py
86-
ucloud-model sdk apis --lang python3 --product UMem --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/umem/client.py
87-
black ucloud/services/umem
88-
python -m ucloud.services.umem.client
89-
90-
mkdir -p ./ucloud/services/unet/schemas
91-
touch ./ucloud/services/unet/__init__.py
92-
touch ./ucloud/services/unet/schemas/__init__.py
93-
ucloud-model sdk apis --lang python3 --product UNet --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/unet/schemas/apis.py
94-
ucloud-model sdk apis --lang python3 --product UNet --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/unet/schemas/models.py
95-
ucloud-model sdk apis --lang python3 --product UNet --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/unet/client.py
96-
black ucloud/services/unet
97-
python -m ucloud.services.unet.client
98-
99-
mkdir -p ./ucloud/services/uphost/schemas
100-
touch ./ucloud/services/uphost/__init__.py
101-
touch ./ucloud/services/uphost/schemas/__init__.py
102-
ucloud-model sdk apis --lang python3 --product UPHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/uphost/schemas/apis.py
103-
ucloud-model sdk apis --lang python3 --product UPHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/uphost/schemas/models.py
104-
ucloud-model sdk apis --lang python3 --product UPHost --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/uphost/client.py
105-
black ucloud/services/uphost
106-
python -m ucloud.services.uphost.client
107-
108-
mkdir -p ./ucloud/services/vpc/schemas
109-
touch ./ucloud/services/vpc/__init__.py
110-
touch ./ucloud/services/vpc/schemas/__init__.py
111-
ucloud-model sdk apis --lang python3 --product VPC --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/vpc/schemas/apis.py
112-
ucloud-model sdk apis --lang python3 --product VPC --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/vpc/schemas/models.py
113-
ucloud-model sdk apis --lang python3 --product VPC --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/vpc/client.py
114-
black ucloud/services/vpc
115-
python -m ucloud.services.vpc.client
116-
117-
mkdir -p ./ucloud/services/usms/schemas
118-
touch ./ucloud/services/usms/__init__.py
119-
touch ./ucloud/services/usms/schemas/__init__.py
120-
ucloud-model sdk apis --lang python3 --product USMS --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/usms/schemas/apis.py
121-
ucloud-model sdk apis --lang python3 --product USMS --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/usms/schemas/models.py
122-
ucloud-model sdk apis --lang python3 --product USMS --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/usms/client.py
123-
black ucloud/services/usms
124-
python -m ucloud.services.usms.client
5+
ucloud-model sdk apis --lang python3 --type public --in-db --template ../ucloud-api-model-v2/apisdk/lang/python/templates/clients.tpl --output ./ucloud/client.py
6+
ucloud-model sdk apis --lang python3 --type public --in-db --template ../ucloud-api-model-v2/apisdk/lang/python/templates/docs.tpl --output ./docs/services.rst
7+
8+
9+
mkdir -p ./ucloud/services/ucdn/schemas
10+
touch ./ucloud/services/ucdn/__init__.py
11+
touch ./ucloud/services/ucdn/schemas/__init__.py
12+
ucloud-model sdk apis --lang python3 --product UCDN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/schema.tpl --output ./ucloud/services/ucdn/schemas/apis.py
13+
ucloud-model sdk apis --lang python3 --product UCDN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/model.tpl --output ./ucloud/services/ucdn/schemas/models.py
14+
ucloud-model sdk apis --lang python3 --product UCDN --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/client.tpl --output ./ucloud/services/ucdn/client.py
15+
black ucloud/services/ucdn
16+
python -m ucloud.services.ucdn.client

setup.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
PY3 = sys.version_info[0] == 3 and sys.version_info[1] >= 5
3131

3232
if not PY3:
33-
raise NotImplementedError((
34-
"ucloud-sdk-python3 should be used in 3.5 "
35-
"and above of python interpreter"
36-
))
33+
raise NotImplementedError(
34+
("ucloud-sdk-python3 should be used in 3.5 " "and above of python interpreter")
35+
)
3736

3837

3938
def load_version():
@@ -60,25 +59,21 @@ def load_requirements(requirements_file):
6059

6160
dependencies = load_requirements("requirements.txt")
6261

63-
dependencies_test = dependencies + [
64-
'flake8>=3.6.0',
65-
'pytest',
66-
'pytest-cov',
67-
]
62+
dependencies_test = dependencies + ["flake8>=3.6.0", "pytest", "pytest-cov"]
6863

69-
dependencies_doc = dependencies + ['sphinx']
64+
dependencies_doc = dependencies + ["sphinx"]
7065

7166
dependencies_ci = list(set(dependencies_test + dependencies_doc))
7267

73-
dependencies_dev = list(set(dependencies_ci + ['black']))
68+
dependencies_dev = list(set(dependencies_ci + ["black"]))
7469

7570

7671
def do_setup():
7772
setup(
7873
name="ucloud-sdk-python3",
7974
description="UCloud Service Development Kit - Python",
8075
long_description=load_long_description(),
81-
long_description_content_type='text/markdown',
76+
long_description_content_type="text/markdown",
8277
license="Apache License 2.0",
8378
version=load_version(),
8479
packages=find_packages(exclude=["tests*"]),

0 commit comments

Comments
 (0)