diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/CHANGELOG.md b/sdk/resourcemanager/containerinstance/armcontainerinstance/CHANGELOG.md index b0f2f2a2102c..e97ebadeb4b9 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/CHANGELOG.md +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 3.0.0 (2022-11-03) +### Breaking Changes + +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed + +### Features Added + +- New struct `DeploymentExtensionSpec` +- New struct `DeploymentExtensionSpecProperties` +- New field `Identity` in struct `EncryptionProperties` +- New field `Extensions` in struct `ContainerGroupPropertiesProperties` + + ## 2.0.0 (2022-08-26) ### Breaking Changes diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/autorest.md b/sdk/resourcemanager/containerinstance/armcontainerinstance/autorest.md index 3f3aa2d08983..cec6b29eeae9 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/autorest.md +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b23f35dfc3ceee0a84c1380b02bcfdfa7f23049c/specification/containerinstance/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b23f35dfc3ceee0a84c1380b02bcfdfa7f23049c/specification/containerinstance/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerinstance/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerinstance/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0 +module-version: 3.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/constants.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/constants.go index 77084c24de3f..46e7a40b21b3 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/constants.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/constants.go @@ -11,7 +11,7 @@ package armcontainerinstance const ( moduleName = "armcontainerinstance" - moduleVersion = "v2.0.0" + moduleVersion = "v3.0.0" ) // ContainerGroupIPAddressType - Specifies if the IP is exposed to the public internet or private VNET. diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client.go index 5cc6dabb36e1..b2b25b18648e 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client.go @@ -58,7 +58,7 @@ func NewContainerGroupsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create or update container groups with specified configurations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // containerGroup - The properties of the container group to be created or updated. @@ -78,7 +78,7 @@ func (client *ContainerGroupsClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create or update container groups with specified configurations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 func (client *ContainerGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup, options *ContainerGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, containerGroupName, containerGroup, options) if err != nil { @@ -114,7 +114,7 @@ func (client *ContainerGroupsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerGroup) @@ -123,7 +123,7 @@ func (client *ContainerGroupsClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete the specified container group in the specified subscription and resource group. The operation does // not delete other resources provided by the user, such as volumes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientBeginDeleteOptions contains the optional parameters for the ContainerGroupsClient.BeginDelete @@ -143,7 +143,7 @@ func (client *ContainerGroupsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete the specified container group in the specified subscription and resource group. The operation does not // delete other resources provided by the user, such as volumes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 func (client *ContainerGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, containerGroupName, options) if err != nil { @@ -179,7 +179,7 @@ func (client *ContainerGroupsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *ContainerGroupsClient) deleteCreateRequest(ctx context.Context, re // returns the properties of each container group including containers, image registry // credentials, restart policy, IP address type, OS type, state, and volumes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientGetOptions contains the optional parameters for the ContainerGroupsClient.Get method. @@ -228,7 +228,7 @@ func (client *ContainerGroupsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *ContainerGroupsClient) getHandleResponse(resp *http.Response) (Con // GetOutboundNetworkDependenciesEndpoints - Gets all the network dependencies for this container group to allow complete // control of network setting and configuration. For container groups, this will always be an empty list. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -286,7 +286,7 @@ func (client *ContainerGroupsClient) getOutboundNetworkDependenciesEndpointsCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,8 +304,7 @@ func (client *ContainerGroupsClient) getOutboundNetworkDependenciesEndpointsHand // NewListPager - Get a list of container groups in the specified subscription. This operation returns properties of each // container group including containers, image registry credentials, restart policy, IP address // type, OS type, state, and volumes. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // options - ContainerGroupsClientListOptions contains the optional parameters for the ContainerGroupsClient.List method. func (client *ContainerGroupsClient) NewListPager(options *ContainerGroupsClientListOptions) *runtime.Pager[ContainerGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerGroupsClientListResponse]{ @@ -347,7 +346,7 @@ func (client *ContainerGroupsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,8 +364,7 @@ func (client *ContainerGroupsClient) listHandleResponse(resp *http.Response) (Co // NewListByResourceGroupPager - Get a list of container groups in a specified subscription and resource group. This operation // returns properties of each container group including containers, image registry credentials, restart // policy, IP address type, OS type, state, and volumes. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // options - ContainerGroupsClientListByResourceGroupOptions contains the optional parameters for the ContainerGroupsClient.ListByResourceGroup // method. @@ -414,7 +412,7 @@ func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,7 +430,7 @@ func (client *ContainerGroupsClient) listByResourceGroupHandleResponse(resp *htt // BeginRestart - Restarts all containers in a container group in place. If container image has updates, new image will be // downloaded. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientBeginRestartOptions contains the optional parameters for the ContainerGroupsClient.BeginRestart @@ -451,7 +449,7 @@ func (client *ContainerGroupsClient) BeginRestart(ctx context.Context, resourceG // Restart - Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 func (client *ContainerGroupsClient) restart(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, containerGroupName, options) if err != nil { @@ -487,7 +485,7 @@ func (client *ContainerGroupsClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -495,7 +493,7 @@ func (client *ContainerGroupsClient) restartCreateRequest(ctx context.Context, r // BeginStart - Starts all containers in a container group. Compute resources will be allocated and billing will start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientBeginStartOptions contains the optional parameters for the ContainerGroupsClient.BeginStart @@ -514,7 +512,7 @@ func (client *ContainerGroupsClient) BeginStart(ctx context.Context, resourceGro // Start - Starts all containers in a container group. Compute resources will be allocated and billing will start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 func (client *ContainerGroupsClient) start(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, containerGroupName, options) if err != nil { @@ -550,7 +548,7 @@ func (client *ContainerGroupsClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -558,7 +556,7 @@ func (client *ContainerGroupsClient) startCreateRequest(ctx context.Context, res // Stop - Stops all containers in a container group. Compute resources will be deallocated and billing will stop. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // options - ContainerGroupsClientStopOptions contains the optional parameters for the ContainerGroupsClient.Stop method. @@ -597,7 +595,7 @@ func (client *ContainerGroupsClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -605,7 +603,7 @@ func (client *ContainerGroupsClient) stopCreateRequest(ctx context.Context, reso // Update - Updates container group tags with specified values. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // resource - The container group resource with just the tags to be updated. @@ -645,7 +643,7 @@ func (client *ContainerGroupsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client_example_test.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client_example_test.go deleted file mode 100644 index 39adc1ac5ca8..000000000000 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/containergroups_client_example_test.go +++ /dev/null @@ -1,335 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerinstance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsList.json -func ExampleContainerGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsListByResourceGroup.json -func ExampleContainerGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("demo", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsGet_Failed.json -func ExampleContainerGroupsClient_Get_containerGroupsGetFailed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsGet_Succeeded.json -func ExampleContainerGroupsClient_Get_containerGroupsGetSucceeded() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsCreateOrUpdate.json -func ExampleContainerGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ - Identity: &armcontainerinstance.ContainerGroupIdentity{ - Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {}, - }, - }, - Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ - Containers: []*armcontainerinstance.Container{ - { - Name: to.Ptr("demo1"), - Properties: &armcontainerinstance.ContainerProperties{ - Command: []*string{}, - EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{}, - Image: to.Ptr("nginx"), - Ports: []*armcontainerinstance.ContainerPort{ - { - Port: to.Ptr[int32](80), - }}, - Resources: &armcontainerinstance.ResourceRequirements{ - Requests: &armcontainerinstance.ResourceRequests{ - CPU: to.Ptr[float64](1), - Gpu: &armcontainerinstance.GpuResource{ - Count: to.Ptr[int32](1), - SKU: to.Ptr(armcontainerinstance.GpuSKUK80), - }, - MemoryInGB: to.Ptr[float64](1.5), - }, - }, - VolumeMounts: []*armcontainerinstance.VolumeMount{ - { - Name: to.Ptr("volume1"), - MountPath: to.Ptr("/mnt/volume1"), - ReadOnly: to.Ptr(false), - }, - { - Name: to.Ptr("volume2"), - MountPath: to.Ptr("/mnt/volume2"), - ReadOnly: to.Ptr(false), - }, - { - Name: to.Ptr("volume3"), - MountPath: to.Ptr("/mnt/volume3"), - ReadOnly: to.Ptr(true), - }}, - }, - }}, - Diagnostics: &armcontainerinstance.ContainerGroupDiagnostics{ - LogAnalytics: &armcontainerinstance.LogAnalytics{ - LogType: to.Ptr(armcontainerinstance.LogAnalyticsLogTypeContainerInsights), - Metadata: map[string]*string{ - "test-key": to.Ptr("test-metadata-value"), - }, - WorkspaceID: to.Ptr("workspaceid"), - WorkspaceKey: to.Ptr("workspaceKey"), - WorkspaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"), - }, - }, - DNSConfig: &armcontainerinstance.DNSConfiguration{ - NameServers: []*string{ - to.Ptr("1.1.1.1")}, - Options: to.Ptr("ndots:2"), - SearchDomains: to.Ptr("cluster.local svc.cluster.local"), - }, - ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{}, - IPAddress: &armcontainerinstance.IPAddress{ - Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerinstance.DNSNameLabelReusePolicyUnsecure), - DNSNameLabel: to.Ptr("dnsnamelabel1"), - Ports: []*armcontainerinstance.Port{ - { - Port: to.Ptr[int32](80), - Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), - }}, - }, - OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), - SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{ - { - ID: to.Ptr("[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"), - }}, - Volumes: []*armcontainerinstance.Volume{ - { - Name: to.Ptr("volume1"), - AzureFile: &armcontainerinstance.AzureFileVolume{ - ShareName: to.Ptr("shareName"), - StorageAccountKey: to.Ptr("accountKey"), - StorageAccountName: to.Ptr("accountName"), - }, - }, - { - Name: to.Ptr("volume2"), - EmptyDir: map[string]interface{}{}, - }, - { - Name: to.Ptr("volume3"), - Secret: map[string]*string{ - "secretKey1": to.Ptr("SecretValue1InBase64"), - "secretKey2": to.Ptr("SecretValue2InBase64"), - }, - }}, - }, - Location: to.Ptr("west us"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsUpdate.json -func ExampleContainerGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "demoResource", "demo1", armcontainerinstance.Resource{ - Tags: map[string]*string{ - "tag1key": to.Ptr("tag1Value"), - "tag2key": to.Ptr("tag2Value"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsDelete.json -func ExampleContainerGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsRestart.json -func ExampleContainerGroupsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsStop.json -func ExampleContainerGroupsClient_Stop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Stop(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsStart.json -func ExampleContainerGroupsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, "demo", "demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client.go index f15b5ccf32c1..21a0e3ea7744 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client.go @@ -59,7 +59,7 @@ func NewContainersClient(subscriptionID string, credential azcore.TokenCredentia // Attach - Attach to the output stream of a specific container instance in a specified resource group and container group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // containerName - The name of the container instance. @@ -103,7 +103,7 @@ func (client *ContainersClient) attachCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +120,7 @@ func (client *ContainersClient) attachHandleResponse(resp *http.Response) (Conta // ExecuteCommand - Executes a command for a specific container instance in a specified resource group and container group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // containerName - The name of the container instance. @@ -166,7 +166,7 @@ func (client *ContainersClient) executeCommandCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerExecRequest) @@ -183,7 +183,7 @@ func (client *ContainersClient) executeCommandHandleResponse(resp *http.Response // ListLogs - Get the logs for a specified container instance in a specified resource group and container group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // containerGroupName - The name of the container group. // containerName - The name of the container instance. @@ -227,7 +227,7 @@ func (client *ContainersClient) listLogsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") if options != nil && options.Tail != nil { reqQP.Set("tail", strconv.FormatInt(int64(*options.Tail), 10)) } diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client_example_test.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client_example_test.go deleted file mode 100644 index b6625cdf0610..000000000000 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/containers_client_example_test.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerinstance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerListLogs.json -func ExampleContainersClient_ListLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListLogs(ctx, "demo", "demo1", "container1", &armcontainerinstance.ContainersClientListLogsOptions{Tail: to.Ptr[int32](10), - Timestamps: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerExec.json -func ExampleContainersClient_ExecuteCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ExecuteCommand(ctx, "demo", "demo1", "container1", armcontainerinstance.ContainerExecRequest{ - Command: to.Ptr("/bin/bash"), - TerminalSize: &armcontainerinstance.ContainerExecRequestTerminalSize{ - Cols: to.Ptr[int32](12), - Rows: to.Ptr[int32](12), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerAttach.json -func ExampleContainersClient_Attach() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewContainersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Attach(ctx, "demo", "demo1", "container1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/go.mod b/sdk/resourcemanager/containerinstance/armcontainerinstance/go.mod index ef87933eac5a..fcfe1c53ed27 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/go.mod +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v3 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/go.sum b/sdk/resourcemanager/containerinstance/armcontainerinstance/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/go.sum +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client.go index 6a01ae9cb444..ee166fa61acb 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client.go @@ -57,8 +57,7 @@ func NewLocationClient(subscriptionID string, credential azcore.TokenCredential, } // NewListCachedImagesPager - Get the list of cached images on specific OS type for a subscription in a region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // location - The identifier for the physical azure location. // options - LocationClientListCachedImagesOptions contains the optional parameters for the LocationClient.ListCachedImages // method. @@ -106,7 +105,7 @@ func (client *LocationClient) listCachedImagesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,8 +121,7 @@ func (client *LocationClient) listCachedImagesHandleResponse(resp *http.Response } // NewListCapabilitiesPager - Get the list of CPU/memory/GPU capabilities of a region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // location - The identifier for the physical azure location. // options - LocationClientListCapabilitiesOptions contains the optional parameters for the LocationClient.ListCapabilities // method. @@ -171,7 +169,7 @@ func (client *LocationClient) listCapabilitiesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,8 +185,7 @@ func (client *LocationClient) listCapabilitiesHandleResponse(resp *http.Response } // NewListUsagePager - Get the usage for a subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // location - The identifier for the physical azure location. // options - LocationClientListUsageOptions contains the optional parameters for the LocationClient.ListUsage method. func (client *LocationClient) NewListUsagePager(location string, options *LocationClientListUsageOptions) *runtime.Pager[LocationClientListUsageResponse] { @@ -229,7 +226,7 @@ func (client *LocationClient) listUsageCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client_example_test.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client_example_test.go deleted file mode 100644 index 9701136c64ed..000000000000 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/location_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerinstance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupUsage.json -func ExampleLocationClient_NewListUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewLocationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUsagePager("westcentralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/CachedImagesList.json -func ExampleLocationClient_NewListCachedImagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewLocationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCachedImagesPager("westcentralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/CapabilitiesList.json -func ExampleLocationClient_NewListCapabilitiesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewLocationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCapabilitiesPager("westus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/models.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/models.go index f8df9f61e40c..6e21b35d10d9 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/models.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/models.go @@ -86,27 +86,6 @@ type CapabilitiesListResult struct { Value []*Capabilities `json:"value,omitempty"` } -// CloudError - An error response from the Container Instance service. -type CloudError struct { - // An error response from the Container Instance service. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the Container Instance service. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - - // The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - // Container - A container instance. type Container struct { // REQUIRED; The user-provided name of the container instance. @@ -254,6 +233,9 @@ type ContainerGroupPropertiesProperties struct { // The encryption properties for a container group. EncryptionProperties *EncryptionProperties `json:"encryptionProperties,omitempty"` + // extensions used by virtual kubelet + Extensions []*DeploymentExtensionSpec `json:"extensions,omitempty"` + // The IP address type of the container group. IPAddress *IPAddress `json:"ipAddress,omitempty"` @@ -493,6 +475,30 @@ type DNSConfiguration struct { SearchDomains *string `json:"searchDomains,omitempty"` } +// DeploymentExtensionSpec - Extension sidecars to be added to the deployment. +type DeploymentExtensionSpec struct { + // REQUIRED; Name of the extension. + Name *string `json:"name,omitempty"` + + // Extension specific properties + Properties *DeploymentExtensionSpecProperties `json:"properties,omitempty"` +} + +// DeploymentExtensionSpecProperties - Extension specific properties +type DeploymentExtensionSpecProperties struct { + // REQUIRED; Type of extension to be added. + ExtensionType *string `json:"extensionType,omitempty"` + + // REQUIRED; Version of the extension being used. + Version *string `json:"version,omitempty"` + + // Protected settings for the extension. + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` + + // Settings for the extension. + Settings interface{} `json:"settings,omitempty"` +} + // EncryptionProperties - The container group encryption properties. type EncryptionProperties struct { // REQUIRED; The encryption key name. @@ -503,6 +509,9 @@ type EncryptionProperties struct { // REQUIRED; The keyvault base url. VaultBaseURL *string `json:"vaultBaseUrl,omitempty"` + + // The keyvault managed identity. + Identity *string `json:"identity,omitempty"` } // EnvironmentVariable - The environment variable to set within the container instance. diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/models_serde.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/models_serde.go index 0cf4cbdeabb4..21f4fd3dba2f 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/models_serde.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/models_serde.go @@ -230,72 +230,6 @@ func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudError. -func (c CloudError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", c.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. -func (c *CloudError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. -func (c CloudErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", c.Code) - populate(objectMap, "details", c.Details) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. -func (c *CloudErrorBody) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &c.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &c.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Container. func (c Container) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -699,6 +633,7 @@ func (c ContainerGroupPropertiesProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "dnsConfig", c.DNSConfig) populate(objectMap, "diagnostics", c.Diagnostics) populate(objectMap, "encryptionProperties", c.EncryptionProperties) + populate(objectMap, "extensions", c.Extensions) populate(objectMap, "ipAddress", c.IPAddress) populate(objectMap, "imageRegistryCredentials", c.ImageRegistryCredentials) populate(objectMap, "initContainers", c.InitContainers) @@ -733,6 +668,9 @@ func (c *ContainerGroupPropertiesProperties) UnmarshalJSON(data []byte) error { case "encryptionProperties": err = unpopulate(val, "EncryptionProperties", &c.EncryptionProperties) delete(rawMsg, key) + case "extensions": + err = unpopulate(val, "Extensions", &c.Extensions) + delete(rawMsg, key) case "ipAddress": err = unpopulate(val, "IPAddress", &c.IPAddress) delete(rawMsg, key) @@ -1099,9 +1037,80 @@ func (d *DNSConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeploymentExtensionSpec. +func (d DeploymentExtensionSpec) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtensionSpec. +func (d *DeploymentExtensionSpec) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentExtensionSpecProperties. +func (d DeploymentExtensionSpecProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "extensionType", d.ExtensionType) + populate(objectMap, "protectedSettings", &d.ProtectedSettings) + populate(objectMap, "settings", &d.Settings) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtensionSpecProperties. +func (d *DeploymentExtensionSpecProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extensionType": + err = unpopulate(val, "ExtensionType", &d.ExtensionType) + delete(rawMsg, key) + case "protectedSettings": + err = unpopulate(val, "ProtectedSettings", &d.ProtectedSettings) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &d.Settings) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type EncryptionProperties. func (e EncryptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "identity", e.Identity) populate(objectMap, "keyName", e.KeyName) populate(objectMap, "keyVersion", e.KeyVersion) populate(objectMap, "vaultBaseUrl", e.VaultBaseURL) @@ -1117,6 +1126,9 @@ func (e *EncryptionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) case "keyName": err = unpopulate(val, "KeyName", &e.KeyName) delete(rawMsg, key) diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client.go index 9c712739bb09..b5a0784df80c 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client.go @@ -50,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List the operations for Azure Container Instance service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -89,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client_example_test.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client_example_test.go deleted file mode 100644 index 0413da79aaff..000000000000 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerinstance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client.go index 0c7e63ea9a41..0ef4e953ca7d 100644 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client.go +++ b/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client.go @@ -59,7 +59,7 @@ func NewSubnetServiceAssociationLinkClient(subscriptionID string, credential azc // BeginDelete - Delete container group virtual network association links. The operation does not delete other resources provided // by the user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 // resourceGroupName - The name of the resource group. // virtualNetworkName - The name of the virtual network. // subnetName - The name of the subnet. @@ -80,7 +80,7 @@ func (client *SubnetServiceAssociationLinkClient) BeginDelete(ctx context.Contex // Delete - Delete container group virtual network association links. The operation does not delete other resources provided // by the user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-09-01 func (client *SubnetServiceAssociationLinkClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetServiceAssociationLinkClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) if err != nil { @@ -120,7 +120,7 @@ func (client *SubnetServiceAssociationLinkClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client_example_test.go b/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client_example_test.go deleted file mode 100644 index 21b42ea4f7b0..000000000000 --- a/sdk/resourcemanager/containerinstance/armcontainerinstance/subnetserviceassociationlink_client_example_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerinstance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/SubnetServiceAssociationLinkDelete.json -func ExampleSubnetServiceAssociationLinkClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerinstance.NewSubnetServiceAssociationLinkClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "demo", "demo2", "demo3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -}