Skip to content

Commit 0176a5e

Browse files
committed
add ssh passhrase
1 parent 119b4c4 commit 0176a5e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

hpecp/cli/gateway.py

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def create_with_ssh_key(
5252
proxy_node_hostname,
5353
ssh_key=None,
5454
ssh_key_file=None,
55+
ssh_passphrase=None,
5556
tags=[],
5657
):
5758
"""Create a Gateway using SSH key authentication.
@@ -70,6 +71,8 @@ def create_with_ssh_key(
7071
ssh_key_file: string
7172
The file path to the ssh key. Alternatively, use the
7273
ssh_key parameter.
74+
ssh_passphrase: string
75+
The passphrase
7376
tags: string
7477
Tags to add to the gateway, for example:
7578
"{ 'tag1': 'foo', 'tag2', 'bar' }".
@@ -96,6 +99,7 @@ def create_with_ssh_key(
9699
ip=ip,
97100
proxy_node_hostname=proxy_node_hostname,
98101
ssh_key_data=ssh_key,
102+
ssh_passphrase=ssh_passphrase,
99103
tags=tags,
100104
)
101105
print(gateway_id)

hpecp/gateway.py

+5
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ def create_with_ssh_key(
220220
this name.
221221
ssh_key_data: str
222222
The ssh key data as a string.
223+
ssh_passphrase: str
224+
The ssh passphrase
223225
tags: list
224226
Tags to use, e.g. "{ 'tag1': 'foo', 'tag2', 'bar' }".
225227
@@ -250,6 +252,9 @@ def create_with_ssh_key(
250252
"purpose": "proxy",
251253
}
252254

255+
if ssh_passphrase is not None:
256+
data['credentials']['ssh_passphrase'] = ssh_passphrase
257+
253258
response = self.client._request(
254259
url="/api/v1/workers/",
255260
http_method="post",

0 commit comments

Comments
 (0)