Skip to content

Commit 65383f8

Browse files
committed
Change encrypt parameters for importing of images.
1 parent cfab07e commit 65383f8

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

SoftLayer/CLI/image/import.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@
2525
"creating this key see https://console.bluemix.net/docs/"
2626
"services/cloud-object-storage/iam/users-serviceids.html"
2727
"#serviceidapikeys")
28-
@click.option('--root-key-id',
28+
@click.option('--root-key-crn',
2929
default=None,
30-
help="ID of the root key in Key Protect")
30+
help="CRN of the root key in your KMS instance")
3131
@click.option('--wrapped-dek',
3232
default=None,
3333
help="Wrapped Data Encryption Key provided by IBM KeyProtect. "
3434
"For more info see https://console.bluemix.net/docs/"
3535
"services/key-protect/wrap-keys.html#wrap-keys")
36-
@click.option('--kp-id',
37-
default=None,
38-
help="ID of the IBM Key Protect Instance")
3936
@click.option('--cloud-init',
4037
is_flag=True,
4138
help="Specifies if image is cloud-init")
@@ -46,8 +43,8 @@
4643
is_flag=True,
4744
help="Specifies if image is encrypted")
4845
@environment.pass_env
49-
def cli(env, name, note, os_code, uri, ibm_api_key, root_key_id, wrapped_dek,
50-
kp_id, cloud_init, byol, is_encrypted):
46+
def cli(env, name, note, os_code, uri, ibm_api_key, root_key_crn, wrapped_dek,
47+
cloud_init, byol, is_encrypted):
5148
"""Import an image.
5249
5350
The URI for an object storage object (.vhd/.iso file) of the format:
@@ -63,9 +60,8 @@ def cli(env, name, note, os_code, uri, ibm_api_key, root_key_id, wrapped_dek,
6360
os_code=os_code,
6461
uri=uri,
6562
ibm_api_key=ibm_api_key,
66-
root_key_id=root_key_id,
63+
crkCrn=root_key_crn,
6764
wrapped_dek=wrapped_dek,
68-
kp_id=kp_id,
6965
cloud_init=cloud_init,
7066
byol=byol,
7167
is_encrypted=is_encrypted

SoftLayer/managers/image.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def edit(self, image_id, name=None, note=None, tag=None):
121121
return bool(name or note or tag)
122122

123123
def import_image_from_uri(self, name, uri, os_code=None, note=None,
124-
ibm_api_key=None, root_key_id=None,
125-
wrapped_dek=None, kp_id=None, cloud_init=False,
124+
ibm_api_key=None, root_key_crn=None,
125+
wrapped_dek=None, cloud_init=False,
126126
byol=False, is_encrypted=False):
127127
"""Import a new image from object storage.
128128
@@ -137,10 +137,9 @@ def import_image_from_uri(self, name, uri, os_code=None, note=None,
137137
:param string note: Note to add to the image
138138
:param string ibm_api_key: Ibm Api Key needed to communicate with ICOS
139139
and Key Protect
140-
:param string root_key_id: ID of the root key in Key Protect
140+
:param string root_key_crn: CRN of the root key in your KMS
141141
:param string wrapped_dek: Wrapped Data Encryption Key provided by
142-
IBM KeyProtect
143-
:param string kp_id: ID of the IBM Key Protect Instance
142+
your KMS
144143
:param boolean cloud_init: Specifies if image is cloud-init
145144
:param boolean byol: Specifies if image is bring your own license
146145
:param boolean is_encrypted: Specifies if image is encrypted
@@ -152,9 +151,8 @@ def import_image_from_uri(self, name, uri, os_code=None, note=None,
152151
'operatingSystemReferenceCode': os_code,
153152
'uri': uri,
154153
'ibmApiKey': ibm_api_key,
155-
'rootKeyId': root_key_id,
154+
'crkCrn': root_key_crn,
156155
'wrappedDek': wrapped_dek,
157-
'keyProtectId': kp_id,
158156
'cloudInit': cloud_init,
159157
'byol': byol,
160158
'isEncrypted': is_encrypted

tests/managers/image_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_import_image_cos(self):
151151
uri='cos://some_uri',
152152
os_code='UBUNTU_LATEST',
153153
ibm_api_key='some_ibm_key',
154-
root_key_id='some_root_key_id',
154+
root_key_crn='some_root_key_crn',
155155
wrapped_dek='some_dek',
156156
kp_id='some_id',
157157
cloud_init=False,
@@ -167,7 +167,7 @@ def test_import_image_cos(self):
167167
'operatingSystemReferenceCode': 'UBUNTU_LATEST',
168168
'uri': 'cos://some_uri',
169169
'ibmApiKey': 'some_ibm_key',
170-
'rootKeyId': 'some_root_key_id',
170+
'crkCrn': 'some_root_key_crn',
171171
'wrappedDek': 'some_dek',
172172
'keyProtectId': 'some_id',
173173
'cloudInit': False,

0 commit comments

Comments
 (0)