Skip to content

Commit e41132b

Browse files
authored
Merge pull request #252 from hpe-container-platform-community/snowch/implement-datatap-module-250
add create to datatap
2 parents d2bc338 + 67731a7 commit e41132b

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

hpecp/cli/datatap.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(self):
3737
def __dir__(self):
3838
"""Return the CLI method names."""
3939
return [
40+
"create_hdfs_with_kerberos",
4041
"get",
4142
"list",
4243
"delete",
@@ -53,3 +54,74 @@ def examples(self):
5354
""" # noqa: E501
5455
)
5556
)
57+
58+
def create_hdfs_with_kerberos(
59+
self,
60+
name,
61+
description,
62+
path_from_endpoint,
63+
kdc_data_host,
64+
kdc_data_port,
65+
realm,
66+
client_principal,
67+
browse_only,
68+
host,
69+
keytab,
70+
service_id,
71+
backup_host,
72+
endpoint_type,
73+
endpoint_port,
74+
read_only,
75+
):
76+
"""TODO.
77+
78+
Parameters
79+
----------
80+
name : [type]
81+
[description]
82+
description : [type]
83+
[description]
84+
path_from_endpoint : [type]
85+
[description]
86+
kdc_data_host : [type]
87+
[description]
88+
kdc_data_port : [type]
89+
[description]
90+
realm : [type]
91+
[description]
92+
client_principal : [type]
93+
[description]
94+
browse_only : [type]
95+
[description]
96+
host : [type]
97+
[description]
98+
keytab : [type]
99+
[description]
100+
service_id : [type]
101+
[description]
102+
backup_host : [type]
103+
[description]
104+
endpoint_type : [type]
105+
[description]
106+
endpoint_port : [type]
107+
[description]
108+
read_only : [type]
109+
[description]
110+
"""
111+
base.get_client().datatap.create(
112+
name,
113+
description,
114+
path_from_endpoint,
115+
kdc_data_host,
116+
kdc_data_port,
117+
realm,
118+
client_principal,
119+
browse_only,
120+
host,
121+
keytab,
122+
service_id,
123+
backup_host,
124+
endpoint_type,
125+
endpoint_port,
126+
read_only,
127+
)

hpecp/datatap.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,81 @@ class DatatapController(AbstractResourceController):
109109
resource_list_path = "data_connectors"
110110

111111
resource_class = Datatap
112+
113+
def create_hdfs_with_kerberos(
114+
self,
115+
name,
116+
description,
117+
path_from_endpoint,
118+
kdc_data_host,
119+
kdc_data_port,
120+
realm,
121+
client_principal,
122+
browse_only,
123+
host,
124+
keytab,
125+
service_id,
126+
backup_host,
127+
endpoint_type,
128+
endpoint_port,
129+
read_only,
130+
):
131+
"""TODO.
132+
133+
Parameters
134+
----------
135+
name : [type]
136+
[description]
137+
description : [type]
138+
[description]
139+
path_from_endpoint : [type]
140+
[description]
141+
kdc_data_host : [type]
142+
[description]
143+
kdc_data_port : [type]
144+
[description]
145+
realm : [type]
146+
[description]
147+
client_principal : [type]
148+
[description]
149+
browse_only : [type]
150+
[description]
151+
host : [type]
152+
[description]
153+
keytab : [type]
154+
[description]
155+
service_id : [type]
156+
[description]
157+
backup_host : [type]
158+
[description]
159+
endpoint_type : [type]
160+
[description]
161+
endpoint_port : [type]
162+
[description]
163+
read_only : [type]
164+
[description]
165+
"""
166+
_data = {
167+
"bdfs_root": {"path_from_endpoint": path_from_endpoint},
168+
"endpoint": {
169+
"kdc_data": [{"host": kdc_data_host, "port": kdc_data_port}],
170+
"realm": realm,
171+
"client_principal": client_principal,
172+
"browse_only": browse_only,
173+
"host": host,
174+
"keytab": keytab,
175+
"service_id": service_id,
176+
"backup_host": backup_host,
177+
"type": endpoint_type,
178+
"port": endpoint_port,
179+
},
180+
"flags": {"read_only": read_only},
181+
"label": {"name": name, "description": description},
182+
}
183+
184+
self.client._request(
185+
url=DatatapController.base_resource_path,
186+
http_method="post",
187+
description="datatap/create",
188+
data=_data,
189+
)

0 commit comments

Comments
 (0)