Skip to content

Commit

Permalink
{Compute} az sig share Migrate to aaz based (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanzhudd authored Jan 14, 2025
2 parents d61e6d2 + 8f85db5 commit e8251f1
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Commands/sig/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Manage shared image gallery.
- [image-version](/Commands/sig/image-version/readme.md)
: Manage shared gallery image version with VM

- [share](/Commands/sig/share/readme.md)
: Manage gallery sharing profile.

## Commands

- [create](/Commands/sig/_create.md)
Expand Down
9 changes: 9 additions & 0 deletions Commands/sig/share/_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _sig share update_

Update sharing profile of a gallery.

## Versions

### [2023-07-03](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2dhbGxlcmllcy97fS9zaGFyZQ==/2023-07-03.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share 2023-07-03 -->
8 changes: 8 additions & 0 deletions Commands/sig/share/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _sig share_

Manage gallery sharing profile.

## Commands

- [update](/Commands/sig/share/_update.md)
: Update sharing profile of a gallery.
33 changes: 33 additions & 0 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -214674,6 +214674,39 @@
"sig",
"image-version"
]
},
"share": {
"commands": {
"update": {
"help": {
"short": "Update sharing profile of a gallery."
},
"names": [
"sig",
"share",
"update"
],
"versions": [
{
"name": "2023-07-03",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share",
"plane": "mgmt-plane",
"version": "2023-07-03"
}
]
}
]
}
},
"help": {
"short": "Manage gallery sharing profile."
},
"names": [
"sig",
"share"
]
}
},
"commands": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share", "version": "2023-07-03", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9nYWxsZXJpZXMve2dhbGxlcnlOYW1lfS9zaGFyZQ==/V/MjAyMy0wNy0wMw=="}], "commandGroups": [{"name": "sig share", "commands": [{"name": "update", "version": "2023-07-03", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share", "version": "2023-07-03", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9nYWxsZXJpZXMve2dhbGxlcnlOYW1lfS9zaGFyZQ==/V/MjAyMy0wNy0wMw=="}], "argGroups": [{"name": "", "args": [{"type": "string", "var": "$Path.galleryName", "options": ["r", "gallery-name"], "required": true, "group": "", "idPart": "name", "help": {"short": "The name of the Shared Image Gallery."}}, {"type": "ResourceGroupName", "var": "$Path.resourceGroupName", "options": ["g", "resource-group"], "required": true, "idPart": "resource_group"}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}]}, {"name": "SharingUpdate", "args": [{"type": "array<object>", "var": "$sharingUpdate.groups", "options": ["groups"], "group": "SharingUpdate", "help": {"short": "A list of sharing profile groups."}, "item": {"type": "object", "args": [{"type": "array<string>", "var": "$sharingUpdate.groups[].ids", "options": ["ids"], "help": {"short": "A list of subscription/tenant ids the gallery is aimed to be shared to."}, "item": {"type": "string"}}, {"type": "string", "var": "$sharingUpdate.groups[].type", "options": ["type"], "help": {"short": "This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.**"}, "enum": {"items": [{"name": "AADTenants", "value": "AADTenants"}, {"name": "Subscriptions", "value": "Subscriptions"}]}}]}}, {"type": "string", "var": "$sharingUpdate.operationType", "options": ["operation-type"], "required": true, "group": "SharingUpdate", "help": {"short": "Specify the operation type of gallery sharing update. Possible values are: Add, Remove, Reset, EnableCommunity."}, "enum": {"items": [{"name": "Add", "value": "Add"}, {"name": "EnableCommunity", "value": "EnableCommunity"}, {"name": "Remove", "value": "Remove"}, {"name": "Reset", "value": "Reset"}]}}]}], "operations": [{"longRunning": {"finalStateVia": "azure-async-operation"}, "operationId": "GallerySharingProfile_Update", "http": {"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share", "request": {"method": "post", "path": {"params": [{"type": "string", "name": "galleryName", "arg": "$Path.galleryName", "required": true}, {"type": "string", "name": "resourceGroupName", "arg": "$Path.resourceGroupName", "required": true}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2023-07-03"}, "type": "string", "name": "api-version", "required": true}]}, "body": {"json": {"schema": {"type": "object", "name": "sharingUpdate", "required": true, "props": [{"type": "array<object>", "name": "groups", "arg": "$sharingUpdate.groups", "item": {"type": "object", "props": [{"type": "array<string>", "name": "ids", "arg": "$sharingUpdate.groups[].ids", "item": {"type": "string"}}, {"type": "string", "name": "type", "arg": "$sharingUpdate.groups[].type", "enum": {"items": [{"value": "AADTenants"}, {"value": "Subscriptions"}]}}]}}, {"type": "string", "name": "operationType", "arg": "$sharingUpdate.operationType", "required": true, "enum": {"items": [{"value": "Add"}, {"value": "EnableCommunity"}, {"value": "Remove"}, {"value": "Reset"}]}}], "clientFlatten": true}}}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"type": "array<object>", "name": "groups", "item": {"type": "object", "props": [{"type": "array<string>", "name": "ids", "item": {"type": "string"}}, {"type": "string", "name": "type", "enum": {"items": [{"value": "AADTenants"}, {"value": "Subscriptions"}]}}]}}, {"type": "string", "name": "operationType", "required": true, "enum": {"items": [{"value": "Add"}, {"value": "EnableCommunity"}, {"value": "Remove"}, {"value": "Reset"}]}}], "cls": "SharingUpdate_read"}}}}, {"statusCode": [202], "body": {"json": {"var": "$Instance", "schema": {"type": "@SharingUpdate_read"}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}], "confirmation": ""}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share" version="2023-07-03" swagger="mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9nYWxsZXJpZXMve2dhbGxlcnlOYW1lfS9zaGFyZQ==/V/MjAyMy0wNy0wMw=="/>
<commandGroup name="sig share">
<command name="update" version="2023-07-03" confirmation="">
<resource id="/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/galleries/{}/share" version="2023-07-03" swagger="mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9nYWxsZXJpZXMve2dhbGxlcnlOYW1lfS9zaGFyZQ==/V/MjAyMy0wNy0wMw=="/>
<argGroup name="">
<arg type="string" var="$Path.galleryName" options="gallery-name r" required="True" group="" idPart="name">
<help short="The name of the Shared Image Gallery."/>
</arg>
<arg type="ResourceGroupName" var="$Path.resourceGroupName" options="resource-group g" required="True" idPart="resource_group"/>
<arg type="SubscriptionId" var="$Path.subscriptionId" options="subscription" required="True" idPart="subscription"/>
</argGroup>
<argGroup name="SharingUpdate">
<arg type="array<object>" var="$sharingUpdate.groups" options="groups" group="SharingUpdate">
<help short="A list of sharing profile groups."/>
<item type="object">
<arg type="array<string>" var="$sharingUpdate.groups[].ids" options="ids">
<help short="A list of subscription/tenant ids the gallery is aimed to be shared to."/>
<item type="string"/>
</arg>
<arg type="string" var="$sharingUpdate.groups[].type" options="type">
<help short="This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.**"/>
<enum>
<item name="AADTenants" value="&quot;AADTenants&quot;"/>
<item name="Subscriptions" value="&quot;Subscriptions&quot;"/>
</enum>
</arg>
</item>
</arg>
<arg type="string" var="$sharingUpdate.operationType" options="operation-type" required="True" group="SharingUpdate">
<help short="Specify the operation type of gallery sharing update. Possible values are: Add, Remove, Reset, EnableCommunity."/>
<enum>
<item name="Add" value="&quot;Add&quot;"/>
<item name="EnableCommunity" value="&quot;EnableCommunity&quot;"/>
<item name="Remove" value="&quot;Remove&quot;"/>
<item name="Reset" value="&quot;Reset&quot;"/>
</enum>
</arg>
</argGroup>
<operation operationId="GallerySharingProfile_Update">
<longRunning finalStateVia="azure-async-operation"/>
<http path="/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share">
<request method="post">
<path>
<param type="string" name="galleryName" arg="$Path.galleryName" required="True"/>
<param type="string" name="resourceGroupName" arg="$Path.resourceGroupName" required="True"/>
<param type="string" name="subscriptionId" arg="$Path.subscriptionId" required="True"/>
</path>
<query>
<const readOnly="True" const="True" type="string" name="api-version" required="True">
<default value="&quot;2023-07-03&quot;"/>
</const>
</query>
<body>
<json>
<schema type="object" name="sharingUpdate" required="True" clientFlatten="True">
<prop type="array<object>" name="groups" arg="$sharingUpdate.groups">
<item type="object">
<prop type="array<string>" name="ids" arg="$sharingUpdate.groups[].ids">
<item type="string"/>
</prop>
<prop type="string" name="type" arg="$sharingUpdate.groups[].type">
<enum>
<item value="&quot;AADTenants&quot;"/>
<item value="&quot;Subscriptions&quot;"/>
</enum>
</prop>
</item>
</prop>
<prop type="string" name="operationType" arg="$sharingUpdate.operationType" required="True">
<enum>
<item value="&quot;Add&quot;"/>
<item value="&quot;EnableCommunity&quot;"/>
<item value="&quot;Remove&quot;"/>
<item value="&quot;Reset&quot;"/>
</enum>
</prop>
</schema>
</json>
</body>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object" cls="SharingUpdate_read">
<prop type="array<object>" name="groups">
<item type="object">
<prop type="array<string>" name="ids">
<item type="string"/>
</prop>
<prop type="string" name="type">
<enum>
<item value="&quot;AADTenants&quot;"/>
<item value="&quot;Subscriptions&quot;"/>
</enum>
</prop>
</item>
</prop>
<prop type="string" name="operationType" required="True">
<enum>
<item value="&quot;Add&quot;"/>
<item value="&quot;EnableCommunity&quot;"/>
<item value="&quot;Remove&quot;"/>
<item value="&quot;Reset&quot;"/>
</enum>
</prop>
</schema>
</json>
</body>
</response>
<response statusCode="202">
<body>
<json var="$Instance">
<schema type="@SharingUpdate_read"/>
</json>
</body>
</response>
<response isError="True">
<body>
<json>
<schema type="@ODataV4Format"/>
</json>
</body>
</response>
</http>
</operation>
<output type="object" ref="$Instance" clientFlatten="True"/>
</command>
</commandGroup>
</CodeGen>

0 comments on commit e8251f1

Please sign in to comment.