Skip to content

Commit 8ad4774

Browse files
authored
Merge pull request #88 from Tanc009/master
publish jdcloud-sdk-python 1.6.52
2 parents 7a4478b + fc6c7ed commit 8ad4774

68 files changed

Lines changed: 1813 additions & 49 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#更新历史
2+
3+
API版本:v1
4+
5+
| 发布时间 | 版本号 | 更新 | 说明 |
6+
| ---------- | ------ | ------ | --------------------------- |
7+
| 2019-11-19 | 1.0.0 | 初始化 | 初始版本,kafka基本操作接口 |
8+
| 2020-04-02 | 1.0.1 | 更新 | 删除多余接口 |

jdcloud_sdk/services/kafka/__init__.py

Whitespace-only changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class CreateInstanceRequest(JDCloudRequest):
23+
"""
24+
创建一个指定配置的kafka实例
25+
"""
26+
27+
def __init__(self, parameters, header=None, version="v1"):
28+
super(CreateInstanceRequest, self).__init__(
29+
'/regions/{regionId}/instances', 'POST', header, version)
30+
self.parameters = parameters
31+
32+
33+
class CreateInstanceParameters(object):
34+
35+
def __init__(self, regionId, instance, ):
36+
"""
37+
:param regionId: regionId
38+
:param instance: kafka实例的相关配置
39+
"""
40+
41+
self.regionId = regionId
42+
self.instance = instance
43+
self.charge = None
44+
45+
def setCharge(self, charge):
46+
"""
47+
:param charge: (Optional) 计费信息的相关配置,只有prepaid_by_duration和postpaid_by_duration 2种计费模式
48+
"""
49+
self.charge = charge
50+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class DeleteInstanceRequest(JDCloudRequest):
23+
"""
24+
删除按配置计费或包年包月已到期的kafka实例,包年包月未到期不可删除。
25+
状态为创建中和变配中的不可删除。
26+
27+
"""
28+
29+
def __init__(self, parameters, header=None, version="v1"):
30+
super(DeleteInstanceRequest, self).__init__(
31+
'/regions/{regionId}/instances/{instanceId}', 'DELETE', header, version)
32+
self.parameters = parameters
33+
34+
35+
class DeleteInstanceParameters(object):
36+
37+
def __init__(self, regionId, instanceId, ):
38+
"""
39+
:param regionId: regionId
40+
:param instanceId: 实例ID
41+
"""
42+
43+
self.regionId = regionId
44+
self.instanceId = instanceId
45+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class DescribeInstanceRequest(JDCloudRequest):
23+
"""
24+
查询kafka实例的详细信息
25+
"""
26+
27+
def __init__(self, parameters, header=None, version="v1"):
28+
super(DescribeInstanceRequest, self).__init__(
29+
'/regions/{regionId}/instances/{instanceId}', 'GET', header, version)
30+
self.parameters = parameters
31+
32+
33+
class DescribeInstanceParameters(object):
34+
35+
def __init__(self, regionId, instanceId, ):
36+
"""
37+
:param regionId: regionId
38+
:param instanceId: 实例ID
39+
"""
40+
41+
self.regionId = regionId
42+
self.instanceId = instanceId
43+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class DescribeInstancesRequest(JDCloudRequest):
23+
"""
24+
查询kafka实例列表
25+
"""
26+
27+
def __init__(self, parameters, header=None, version="v1"):
28+
super(DescribeInstancesRequest, self).__init__(
29+
'/regions/{regionId}/instances', 'GET', header, version)
30+
self.parameters = parameters
31+
32+
33+
class DescribeInstancesParameters(object):
34+
35+
def __init__(self, regionId, ):
36+
"""
37+
:param regionId: regionId
38+
"""
39+
40+
self.regionId = regionId
41+
self.pageNumber = None
42+
self.pageSize = None
43+
self.filters = None
44+
self.tagFilters = None
45+
46+
def setPageNumber(self, pageNumber):
47+
"""
48+
:param pageNumber: (Optional) 页码,默认1
49+
"""
50+
self.pageNumber = pageNumber
51+
52+
def setPageSize(self, pageSize):
53+
"""
54+
:param pageSize: (Optional) 分页大小,默认10
55+
"""
56+
self.pageSize = pageSize
57+
58+
def setFilters(self, filters):
59+
"""
60+
:param filters: (Optional) 过滤条件:
61+
instanceId -实例Id,精确匹配,支持多个
62+
instanceVersion -实例版本,精确匹配,支持单个
63+
instanceName - 实例名称,模糊匹配,支持单个
64+
instanceStatus - 实例状态,精确匹配,支持多个(running:运行,error:错误,creating:创建中,changing:变配中,stop:已停止,processing:处理中)
65+
chargeMode - 计费类型,按配置postpaid_by_duration或者包年包月prepaid_by_duration
66+
67+
"""
68+
self.filters = filters
69+
70+
def setTagFilters(self, tagFilters):
71+
"""
72+
:param tagFilters: (Optional) 标签过滤条件
73+
"""
74+
self.tagFilters = tagFilters
75+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class ModifyInstanceSpecRequest(JDCloudRequest):
23+
"""
24+
变更kafka实例的配置,实例为running状态才可变更配置
25+
26+
"""
27+
28+
def __init__(self, parameters, header=None, version="v1"):
29+
super(ModifyInstanceSpecRequest, self).__init__(
30+
'/regions/{regionId}/instances/{instanceId}:modifyInstanceSpec', 'POST', header, version)
31+
self.parameters = parameters
32+
33+
34+
class ModifyInstanceSpecParameters(object):
35+
36+
def __init__(self, regionId, instanceId, instanceClassSpec):
37+
"""
38+
:param regionId: regionId
39+
:param instanceId: 实例ID
40+
:param instanceClassSpec: 变更的规格
41+
"""
42+
43+
self.regionId = regionId
44+
self.instanceId = instanceId
45+
self.instanceClassSpec = instanceClassSpec
46+

jdcloud_sdk/services/kafka/apis/__init__.py

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudclient import JDCloudClient
20+
from jdcloud_sdk.core.config import Config
21+
22+
23+
class KafkaClient(JDCloudClient):
24+
25+
def __init__(self, credential, config=None, logger=None):
26+
if config is None:
27+
config = Config('kafka.jdcloud-api.com')
28+
29+
super(KafkaClient, self).__init__(credential, config, 'kafka', '1.0.0', logger)

jdcloud_sdk/services/kafka/client/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)