Skip to content

Commit

Permalink
Generated container-group-profile commands and added container group …
Browse files Browse the repository at this point in the history
…properties for reuse scenario (#26604)

* Generated container-group-profile commands and added container group properties for reuse scenario

* fix container instance

* revert test change

* try

* fixes

* test change

* fine

* new object

* test fixes

* final

* fix

* changes

* fix

* Updated examples for container group profiles

* Reverted AssemblyInfo.cs

* Modified the docs

* Modified the get cg profile doc

* changes

* example change

* readme change

* Revert changes for no default object

* Revert "example change"

This reverts commit c9e9c6f.

* Modified the parameters for default container object

* Converting requestcpu and requestmemory as double

* Enforcing non-nullable values for request cpu and memory

* Supressing the breaking change mentioned in the pipeline as double -> nullable[double] is not a breaking change (false positive)

* Reverted the changes for container instance object

---------

Co-authored-by: Drishti Peshwani <[email protected]>
  • Loading branch information
kaushik-ms and drishtipeshwani09 authored Nov 6, 2024
1 parent 80349e2 commit 4feee22
Show file tree
Hide file tree
Showing 109 changed files with 5,512 additions and 1,755 deletions.
2 changes: 2 additions & 0 deletions src/ContainerInstance/ContainerInstance.Autorest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
license.txt
/*.ps1
/*.psd1
/*.ps1xml
/*.psm1
/*.snk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.ContainerInstance.private.dll'
FormatsToProcess = './Az.ContainerInstance.format.ps1xml'
FunctionsToExport = 'Add-AzContainerInstanceOutput', 'Get-AzContainerGroup', 'Get-AzContainerInstanceCachedImage', 'Get-AzContainerInstanceCapability', 'Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint', 'Get-AzContainerInstanceLog', 'Get-AzContainerInstanceUsage', 'Invoke-AzContainerInstanceCommand', 'New-AzContainerGroup', 'New-AzContainerGroupImageRegistryCredentialObject', 'New-AzContainerGroupPortObject', 'New-AzContainerGroupVolumeObject', 'New-AzContainerInstanceEnvironmentVariableObject', 'New-AzContainerInstanceHttpHeaderObject', 'New-AzContainerInstanceInitDefinitionObject', 'New-AzContainerInstanceObject', 'New-AzContainerInstancePortObject', 'New-AzContainerInstanceVolumeMountObject', 'Remove-AzContainerGroup', 'Remove-AzContainerInstanceSubnetServiceAssociationLink', 'Restart-AzContainerGroup', 'Start-AzContainerGroup', 'Stop-AzContainerGroup', 'Update-AzContainerGroup', '*'
FunctionsToExport = 'Add-AzContainerInstanceOutput', 'Get-AzContainerGroup', 'Get-AzContainerInstanceCachedImage', 'Get-AzContainerInstanceCapability', 'Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint', 'Get-AzContainerInstanceContainerGroupProfile', 'Get-AzContainerInstanceContainerGroupProfileRevision', 'Get-AzContainerInstanceLog', 'Get-AzContainerInstanceUsage', 'Invoke-AzContainerInstanceCommand', 'New-AzContainerGroup', 'New-AzContainerGroupImageRegistryCredentialObject', 'New-AzContainerGroupPortObject', 'New-AzContainerGroupVolumeObject', 'New-AzContainerInstanceContainerGroupProfile', 'New-AzContainerInstanceEnvironmentVariableObject', 'New-AzContainerInstanceHttpHeaderObject', 'New-AzContainerInstanceInitDefinitionObject', 'New-AzContainerInstanceNoDefaultObject', 'New-AzContainerInstanceObject', 'New-AzContainerInstancePortObject', 'New-AzContainerInstanceVolumeMountObject', 'Remove-AzContainerGroup', 'Remove-AzContainerInstanceContainerGroupProfile', 'Remove-AzContainerInstanceSubnetServiceAssociationLink', 'Restart-AzContainerGroup', 'Start-AzContainerGroup', 'Stop-AzContainerGroup', 'Update-AzContainerGroup', 'Update-AzContainerInstanceContainerGroupProfile', '*'
AliasesToExport = 'Get-AzContainerGroupOutboundNetworkDependencyEndpoint', '*'
PrivateData = @{
PSData = @{
Expand Down
14 changes: 2 additions & 12 deletions src/ContainerInstance/ContainerInstance.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
This directory contains the PowerShell module for the ContainerInstance service.

---
## Status
[![Az.ContainerInstance](https://img.shields.io/powershellgallery/v/Az.ContainerInstance.svg?style=flat-square&label=Az.ContainerInstance "Az.ContainerInstance")](https://www.powershellgallery.com/packages/Az.ContainerInstance/)

## Info
- Modifiable: yes
- Generated: all
Expand All @@ -30,13 +27,13 @@ For information on how to develop for `Az.ContainerInstance`, see [how-to.md](ho
> see https://aka.ms/autorest
``` yaml
commit: 81562c6c057a510ddde50ff40720d254bd5f6dbf
commit: 400510ae981419169f35012c3a217b268e779b2b
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- $(repo)/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2022-10-01-preview/containerInstance.json
- $(repo)/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/containerInstance.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-swagger

Expand Down Expand Up @@ -98,13 +95,6 @@ directive:
parameter-name: ImageRegistryCredentials
set:
parameter-name: ImageRegistryCredential
# Sets OSType equal Linux by default
- where:
parameter-name: OSType
set:
default:
description: Sets OSType equal Linux by default.
script: '"Linux"'
# 1. Set IPAddressPort equals $Container.Port
# 2. Set Location mandatory
- where:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"resourceType": "containerGroupProfiles/revisions",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance"
},
"commands": [
{
"name": "Get-AzContainerInstanceContainerGroupProfile",
"description": "Gets the properties of the specified container group profile in the specified subscription and resource group.\nThe operation returns the properties of container group profile including containers, image registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions/{revisionNumber}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance/get-azcontainerinstancecontainergroupprofile"
},
"parameterSets": [
{
"parameters": [
"-Name <String>",
"-ResourceGroupName <String>",
"-RevisionNumber <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets the properties of the specified revision of the container group profile in the given subscription and resource group. The operation returns the properties of container group profile including containers, image registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc.",
"parameters": [
{
"name": "-Name",
"value": "[Path.containerGroupProfileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-RevisionNumber",
"value": "[Path.revisionNumber]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"resourceType": "containerGroupProfiles",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance"
},
"commands": [
{
"name": "Get-AzContainerInstanceContainerGroupProfile",
"description": "Gets the properties of the specified container group profile in the specified subscription and resource group.\nThe operation returns the properties of container group profile including containers, image registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance/get-azcontainerinstancecontainergroupprofile"
},
"parameterSets": [
{
"parameters": [
"-Name <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets the properties of the specified container group profile in the specified subscription and resource group. The operation returns the properties of container group profile including containers, image registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc.",
"parameters": [
{
"name": "-Name",
"value": "[Path.containerGroupProfileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzContainerInstanceContainerGroupProfile",
"description": "Delete the specified container group profile in the specified subscription and resource group.\nThe operation does not delete other resources provided by the user, such as volumes.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance/remove-azcontainerinstancecontainergroupprofile"
},
"parameterSets": [
{
"parameters": [
"-Name <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Delete the specified container group profile in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes.",
"parameters": [
{
"name": "-Name",
"value": "[Path.containerGroupProfileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "containerGroups/containers",
"apiVersion": "2022-10-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "containerGroups",
"apiVersion": "2022-10-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "virtualNetworks/subnets",
"apiVersion": "2022-10-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.containerinstance"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public partial class InvokeAzContainerInstanceCommand_ExecuteExpanded : global::
/// on that response. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20221001Preview.IContainerExecResponse"
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20240501Preview.IContainerExecResponse"
/// /> from the remote call</param>
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
/// immediately (set to true to skip further processing )</param>
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20221001Preview.IContainerExecResponse> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20240501Preview.IContainerExecResponse> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
{
var containerExecResponse = response.ConfigureAwait(false).GetAwaiter().GetResult();
socket = new System.Net.WebSockets.ClientWebSocket();
Expand Down
Loading

0 comments on commit 4feee22

Please sign in to comment.