Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## lifebit-ai/cloudos-cli: changelog

## v2.81.2 (2026-03-04)

### Patch

- Adds `--image-version` option for `procurement set` subcommand

## v2.81.1 (2026-02-24)

### Patch
Expand Down
2 changes: 1 addition & 1 deletion cloudos_cli/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.81.1'
__version__ = '2.81.2'
7 changes: 5 additions & 2 deletions cloudos_cli/procurement/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def list_images(ctx,
@click.option('--region', help='The cloud region. Only aws regions are supported.', required=True)
@click.option('--image-id', help='The new image id value.', required=True)
@click.option('--image-name', help='The new image name value.', required=False)
@click.option('--image-version', help='The new image version value.', required=True)
@click.option('--disable-ssl-verification',
help=('Disable SSL certificate verification. Please, remember that this option is ' +
'not generally recommended for security reasons.'),
Expand All @@ -110,14 +111,15 @@ def set_organisation_image(ctx,
procurement_id,
organisation_id,
image_type,
image_version,
provider,
region,
image_id,
image_name,
disable_ssl_verification,
ssl_cert,
profile):
"""Set a new image id or name to image associated with an organisations of a given procurement."""
"""Set a new image id, name, or version to image associated with an organisations of a given procurement."""
verify_ssl = ssl_selector(disable_ssl_verification, ssl_cert)

procurement_images = Images(
Expand All @@ -135,7 +137,8 @@ def set_organisation_image(ctx,
provider,
region,
image_id,
image_name
image_name,
image_version
)
console = Console()
console.print(result)
Expand Down
7 changes: 5 additions & 2 deletions cloudos_cli/procurement/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def list_procurement_images(self):

return response

def set_procurement_organisation_image(self, organisation_id, image_type, provider, region, image_id, image_name):
def set_procurement_organisation_image(self, organisation_id, image_type, provider, region, image_id, image_name, image_version):
"""
Sets the value for a procurement image of a given organisation.

Expand Down Expand Up @@ -104,6 +104,8 @@ def set_procurement_organisation_image(self, organisation_id, image_type, provid
The new value for image Id. Required.
imageName
The new value for image name. Optional.
imageVersion
The new value for image version. Required.
"""

headers = {
Expand All @@ -116,7 +118,8 @@ def set_procurement_organisation_image(self, organisation_id, image_type, provid
"imageName": image_name,
"provider": provider,
"region": region,
"imageId": image_id
"imageId": image_id,
"imageVersion": image_version
}
r = retry_requests_put("{}/api/v1/procurements/{}/images".format(self.cloudos_url, self.procurement_id),
headers=headers, data=json.dumps(payload), verify=self.verify)
Expand Down
18 changes: 12 additions & 6 deletions tests/test_procurement/test_set_procurement_organisation_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def test_set_procurement_organisation_image():
"provider": "aws",
"region": "eu-west-2",
"imageId": "ami-0123456789abcdef0",
"imageName": "Custom-Job-Image"
"imageName": "Custom-Job-Image",
"imageVersion": "1.0.0"
}

# Mock endpoint
Expand All @@ -54,7 +55,8 @@ def test_set_procurement_organisation_image():
provider="aws",
region="eu-west-2",
image_id="ami-0123456789abcdef0",
image_name="Custom-Job-Image"
image_name="Custom-Job-Image",
image_version="1.0.0"
)

# Verify the image configuration details
Expand Down Expand Up @@ -108,7 +110,8 @@ def test_set_procurement_organisation_image_different_types():
"provider": "aws",
"region": "eu-west-2",
"imageId": f"ami-{image_type.lower()[:8]}123",
"imageName": f"Custom-{image_type}-Image"
"imageName": f"Custom-{image_type}-Image",
"imageVersion": "1.0.0"
}

responses.add(
Expand All @@ -135,7 +138,8 @@ def test_set_procurement_organisation_image_different_types():
provider="aws",
region="eu-west-2",
image_id=f"ami-{image_type.lower()[:8]}123",
image_name=f"Custom-{image_type}-Image"
image_name=f"Custom-{image_type}-Image",
image_version="1.0.0"
)

assert result["imageType"] == image_type
Expand Down Expand Up @@ -165,7 +169,8 @@ def test_set_procurement_organisation_image_without_image_name():
"provider": "aws",
"region": "eu-west-2",
"imageId": "ami-0123456789abcdef0",
"imageName": None
"imageName": None,
"imageVersion": "1.0.0"
}

responses.add(
Expand All @@ -190,7 +195,8 @@ def test_set_procurement_organisation_image_without_image_name():
provider="aws",
region="eu-west-2",
image_id="ami-0123456789abcdef0",
image_name=None
image_name=None,
image_version="1.0.0"
)

assert result["imageName"] is None