Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def default_api_version(self):
'disk_encryption_sets': '2020-12-01',
'disk_accesses': '2020-05-01',
'snapshots': '2021-12-01',
'galleries': '2021-07-01',
'galleries': '2021-10-01',
'gallery_images': '2021-10-01',
'gallery_image_versions': '2021-10-01',
'gallery_applications': '2021-07-01',
Expand Down
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@
az sig create --resource-group MyResourceGroup --gallery-name MyGallery
"""

helps['sig show'] = """
type: command
short-summary: Retrieve information about a Shared Image Gallery.
"""

helps['sig image-definition'] = """
type: group
short-summary: Manage shared gallery image with VM
Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,10 @@ def load_arguments(self, _):
c.argument('gallery_name', options_list=['--gallery-name', '-r'], id_part='name', help='gallery name')
c.argument('gallery_image_name', options_list=['--gallery-image-definition', '-i'], id_part='child_name_1', help='gallery image definition')

with self.argument_context('sig show') as c:
c.argument('select', help='The select expression to apply on the operation.')
c.argument('sharing_groups', action='store_true', help='The expand query option to query shared gallery groups')

with self.argument_context('sig list-shared') as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('shared_to', shared_to_type)
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/vm/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def load_command_table(self, _):

with self.command_group('sig', compute_galleries_sdk, operation_group='galleries', min_api='2018-06-01') as g:
g.custom_command('create', 'create_image_gallery')
g.show_command('show', 'get')
g.custom_show_command('show', 'show_image_gallery')
g.custom_command('list', 'list_image_galleries')
g.command('delete', 'begin_delete')
g.generic_update_command('update', setter_type=compute_custom, setter_name='update_image_galleries', setter_arg_name='gallery')
Expand Down
7 changes: 7 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4096,6 +4096,13 @@ def update_image_galleries(cmd, resource_group_name, gallery_name, gallery, perm
return client.galleries.begin_create_or_update(resource_group_name, gallery_name, gallery, **kwargs)


def show_image_gallery(cmd, resource_group_name, gallery_name, select=None, sharing_groups=None):
if sharing_groups:
sharing_groups = 'sharingProfile/Groups'
client = _compute_client_factory(cmd.cli_ctx)
return client.galleries.get(resource_group_name, gallery_name, select=select, expand=sharing_groups)


def create_image_gallery(cmd, resource_group_name, gallery_name, description=None,
location=None, no_wait=False, tags=None, permissions=None, soft_delete=None):
Gallery = cmd.get_models('Gallery')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"sig_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002\",\r\n
Expand Down Expand Up @@ -165,7 +165,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"sig_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/sig_000002\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interactions:
User-Agent:
- AZURECLI/2.35.0 azsdk-python-mgmt-compute/1.0.0b1 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003\",\r\n
Expand Down Expand Up @@ -165,7 +165,7 @@ interactions:
User-Agent:
- AZURECLI/2.35.0 azsdk-python-mgmt-compute/1.0.0b1 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003\",\r\n
Expand Down Expand Up @@ -2844,7 +2844,7 @@ interactions:
User-Agent:
- AZURECLI/2.35.0 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-mgmt-compute/1.0.0b1 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007\",\r\n
Expand Down Expand Up @@ -167,7 +167,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-mgmt-compute/1.0.0b1 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007\",\r\n
Expand Down Expand Up @@ -2235,7 +2235,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-07-01&$select=Permissions
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-10-01&$select=Permissions
response:
body:
string: "{\r\n \"name\": \"gellery000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007\",\r\n
Expand Down Expand Up @@ -3930,7 +3930,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-07-01&$select=Permissions
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007?api-version=2021-10-01&$select=Permissions
response:
body:
string: "{\r\n \"name\": \"gellery000007\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000007\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interactions:
User-Agent:
- AZURECLI/2.29.0 azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003\",\r\n
Expand Down Expand Up @@ -165,7 +165,7 @@ interactions:
User-Agent:
- AZURECLI/2.29.0 azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003\",\r\n
Expand Down Expand Up @@ -412,7 +412,7 @@ interactions:
User-Agent:
- AZURECLI/2.29.0 azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003\",\r\n
Expand Down Expand Up @@ -520,7 +520,7 @@ interactions:
User-Agent:
- AZURECLI/2.29.0 azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000003\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interactions:
User-Agent:
- AZURECLI/2.33.1 azsdk-python-azure-mgmt-compute/25.0.0 Python/3.7.9 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004\",\r\n
Expand Down Expand Up @@ -165,7 +165,7 @@ interactions:
User-Agent:
- AZURECLI/2.33.1 azsdk-python-azure-mgmt-compute/25.0.0 Python/3.7.9 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gellery000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000004\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003\",\r\n
Expand Down Expand Up @@ -165,7 +165,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003\",\r\n
Expand Down Expand Up @@ -218,7 +218,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries?api-version=2021-10-01
response:
body:
string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"gallery_000003\",\r\n
Expand Down Expand Up @@ -273,7 +273,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003\",\r\n
Expand Down Expand Up @@ -5755,7 +5755,7 @@ interactions:
User-Agent:
- AZURECLI/2.34.1 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gallery_000003?api-version=2021-10-01
response:
body:
string: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ interactions:
User-Agent:
- AZURECLI/2.35.0 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.9.6 (Windows-10-10.0.19044-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002\",\r\n
Expand Down Expand Up @@ -1085,7 +1085,7 @@ interactions:
User-Agent:
- AZURECLI/2.35.0 azsdk-python-azure-mgmt-compute/26.1.0 Python/3.9.6 (Windows-10-10.0.19044-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2021-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2021-10-01
response:
body:
string: "{\r\n \"name\": \"gallery_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002\",\r\n
Expand Down
Loading