From 0bcf4428c557499cb0ae697707692236438dead9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 11 Aug 2022 19:00:16 +0000 Subject: [PATCH] CodeGen from PR 20199 in Azure/azure-rest-api-specs Merge 8f9674a9aa842f71e5f90f0061d4a9586726c9d2 into 37c9b56303da9ec425b00575c0027b44d11a772f --- .../arm-containerinstance/CHANGELOG.md | 45 +- .../arm-containerinstance/_meta.json | 8 +- .../arm-containerinstance/package.json | 14 +- .../review/arm-containerinstance.api.md | 91 ++-- .../src/containerInstanceManagementClient.ts | 49 ++- .../arm-containerinstance/src/models/index.ts | 178 ++++---- .../src/models/mappers.ts | 399 +++++++++--------- .../src/models/parameters.ts | 22 + .../src/operations/index.ts | 1 + .../subnetServiceAssociationLink.ts | 146 +++++++ .../src/operationsInterfaces/index.ts | 1 + .../subnetServiceAssociationLink.ts | 42 ++ .../arm-containerinstance/test/sampleTest.ts | 43 ++ .../arm-containerinstance/tsconfig.json | 10 +- 14 files changed, 681 insertions(+), 368 deletions(-) create mode 100644 sdk/containerinstance/arm-containerinstance/src/operations/subnetServiceAssociationLink.ts create mode 100644 sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/subnetServiceAssociationLink.ts create mode 100644 sdk/containerinstance/arm-containerinstance/test/sampleTest.ts diff --git a/sdk/containerinstance/arm-containerinstance/CHANGELOG.md b/sdk/containerinstance/arm-containerinstance/CHANGELOG.md index 7f92348dd9d8..158d8b1f6145 100644 --- a/sdk/containerinstance/arm-containerinstance/CHANGELOG.md +++ b/sdk/containerinstance/arm-containerinstance/CHANGELOG.md @@ -1,15 +1,40 @@ # Release History + +## 9.0.0 (2022-08-11) + +**Features** -## 8.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group SubnetServiceAssociationLink + - Added Interface ContainerGroupProperties + - Added Interface SubnetServiceAssociationLinkDeleteOptionalParams + - Added Interface UserAssignedIdentities + - Added Type Alias DnsNameLabelReusePolicy + - Interface IpAddress has a new optional parameter autoGeneratedDomainNameLabelScope + - Interface Usage has a new optional parameter id + - Class ContainerInstanceManagementClient has a new parameter subnetServiceAssociationLink + - Added Enum KnownDnsNameLabelReusePolicy + +**Breaking Changes** + + - Interface ContainerGroup no longer has parameter containers + - Interface ContainerGroup no longer has parameter diagnostics + - Interface ContainerGroup no longer has parameter dnsConfig + - Interface ContainerGroup no longer has parameter encryptionProperties + - Interface ContainerGroup no longer has parameter identity + - Interface ContainerGroup no longer has parameter imageRegistryCredentials + - Interface ContainerGroup no longer has parameter initContainers + - Interface ContainerGroup no longer has parameter instanceView + - Interface ContainerGroup no longer has parameter ipAddress + - Interface ContainerGroup no longer has parameter osType + - Interface ContainerGroup no longer has parameter provisioningState + - Interface ContainerGroup no longer has parameter restartPolicy + - Interface ContainerGroup no longer has parameter sku + - Interface ContainerGroup no longer has parameter subnetIds + - Interface ContainerGroup no longer has parameter volumes + - Interface IpAddress no longer has parameter dnsNameLabelReusePolicy + - Removed Enum KnownAutoGeneratedDomainNameLabelScope + + ## 8.2.0 (2022-07-11) **Features** diff --git a/sdk/containerinstance/arm-containerinstance/_meta.json b/sdk/containerinstance/arm-containerinstance/_meta.json index 314b59290d0f..63cde4c775db 100644 --- a/sdk/containerinstance/arm-containerinstance/_meta.json +++ b/sdk/containerinstance/arm-containerinstance/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c18557c67e434073057866a60099c262336dde15", + "commit": "d90e6faa2b5242f43ebcb053abaa25990a7387cf", "readme": "specification/containerinstance/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerinstance\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220707.1 --generate-sample=true", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1.20220707.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/containerinstance/arm-containerinstance/package.json b/sdk/containerinstance/arm-containerinstance/package.json index 10eec8fb4d65..315611ff8704 100644 --- a/sdk/containerinstance/arm-containerinstance/package.json +++ b/sdk/containerinstance/arm-containerinstance/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerInstanceManagementClient.", - "version": "8.2.1", + "version": "9.0.0", "engines": { "node": ">=12.0.0" }, @@ -109,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerinstance?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/containerinstance/arm-containerinstance/review/arm-containerinstance.api.md b/sdk/containerinstance/arm-containerinstance/review/arm-containerinstance.api.md index 3c2745f3a1fd..87acdbe6d5c6 100644 --- a/sdk/containerinstance/arm-containerinstance/review/arm-containerinstance.api.md +++ b/sdk/containerinstance/arm-containerinstance/review/arm-containerinstance.api.md @@ -10,9 +10,6 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; -// @public -export type AutoGeneratedDomainNameLabelScope = string; - // @public export interface AzureFileVolume { readOnly?: boolean; @@ -69,12 +66,6 @@ export interface CloudErrorBody { target?: string; } -// @public (undocumented) -export interface Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties { - readonly clientId?: string; - readonly principalId?: string; -} - // @public export interface Container { command?: string[]; @@ -119,22 +110,7 @@ export interface ContainerExecResponse { } // @public -export interface ContainerGroup extends Resource { - containers: Container[]; - diagnostics?: ContainerGroupDiagnostics; - dnsConfig?: DnsConfiguration; - encryptionProperties?: EncryptionProperties; - identity?: ContainerGroupIdentity; - imageRegistryCredentials?: ImageRegistryCredential[]; - initContainers?: InitContainerDefinition[]; - readonly instanceView?: ContainerGroupPropertiesInstanceView; - ipAddress?: IpAddress; - osType: OperatingSystemTypes; - readonly provisioningState?: string; - restartPolicy?: ContainerGroupRestartPolicy; - sku?: ContainerGroupSku; - subnetIds?: ContainerGroupSubnetId[]; - volumes?: Volume[]; +export interface ContainerGroup extends Resource, ContainerGroupProperties { } // @public @@ -148,7 +124,7 @@ export interface ContainerGroupIdentity { readonly tenantId?: string; type?: ResourceIdentityType; userAssignedIdentities?: { - [propertyName: string]: Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties; + [propertyName: string]: UserAssignedIdentities; }; } @@ -164,6 +140,25 @@ export interface ContainerGroupListResult { // @public export type ContainerGroupNetworkProtocol = string; +// @public +export interface ContainerGroupProperties { + containers: Container[]; + diagnostics?: ContainerGroupDiagnostics; + dnsConfig?: DnsConfiguration; + encryptionProperties?: EncryptionProperties; + identity?: ContainerGroupIdentity; + imageRegistryCredentials?: ImageRegistryCredential[]; + initContainers?: InitContainerDefinition[]; + readonly instanceView?: ContainerGroupPropertiesInstanceView; + ipAddress?: IpAddress; + osType: OperatingSystemTypes; + readonly provisioningState?: string; + restartPolicy?: ContainerGroupRestartPolicy; + sku?: ContainerGroupSku; + subnetIds?: ContainerGroupSubnetId[]; + volumes?: Volume[]; +} + // @public export interface ContainerGroupPropertiesInstanceView { readonly events?: Event_2[]; @@ -309,6 +304,8 @@ export class ContainerInstanceManagementClient extends coreClient.ServiceClient // (undocumented) operations: Operations; // (undocumented) + subnetServiceAssociationLink: SubnetServiceAssociationLink; + // (undocumented) subscriptionId: string; } @@ -396,6 +393,9 @@ export interface DnsConfiguration { searchDomains?: string; } +// @public +export type DnsNameLabelReusePolicy = string; + // @public export interface EncryptionProperties { keyName: string; @@ -472,23 +472,14 @@ export interface InitContainerPropertiesDefinitionInstanceView { // @public export interface IpAddress { + autoGeneratedDomainNameLabelScope?: DnsNameLabelReusePolicy; dnsNameLabel?: string; - dnsNameLabelReusePolicy?: AutoGeneratedDomainNameLabelScope; readonly fqdn?: string; ip?: string; ports: Port[]; type: ContainerGroupIpAddressType; } -// @public -export enum KnownAutoGeneratedDomainNameLabelScope { - Noreuse = "Noreuse", - ResourceGroupReuse = "ResourceGroupReuse", - SubscriptionReuse = "SubscriptionReuse", - TenantReuse = "TenantReuse", - Unsecure = "Unsecure" -} - // @public export enum KnownContainerGroupIpAddressType { Private = "Private", @@ -526,6 +517,15 @@ export enum KnownContainerNetworkProtocol { UDP = "UDP" } +// @public +export enum KnownDnsNameLabelReusePolicy { + Noreuse = "Noreuse", + ResourceGroupReuse = "ResourceGroupReuse", + SubscriptionReuse = "SubscriptionReuse", + TenantReuse = "TenantReuse", + Unsecure = "Unsecure" +} + // @public export enum KnownGpuSku { K80 = "K80", @@ -701,9 +701,22 @@ export interface ResourceRequirements { // @public export type Scheme = string; +// @public +export interface SubnetServiceAssociationLink { + beginDelete(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: SubnetServiceAssociationLinkDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: SubnetServiceAssociationLinkDeleteOptionalParams): Promise; +} + +// @public +export interface SubnetServiceAssociationLinkDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface Usage { readonly currentValue?: number; + readonly id?: string; readonly limit?: number; readonly name?: UsageName; readonly unit?: string; @@ -720,6 +733,12 @@ export interface UsageName { readonly value?: string; } +// @public +export interface UserAssignedIdentities { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface Volume { azureFile?: AzureFileVolume; diff --git a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts index 696f26e23689..a352867139e1 100644 --- a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts +++ b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts @@ -18,13 +18,15 @@ import { ContainerGroupsImpl, OperationsImpl, LocationImpl, - ContainersImpl + ContainersImpl, + SubnetServiceAssociationLinkImpl } from "./operations"; import { ContainerGroups, Operations, Location, - Containers + Containers, + SubnetServiceAssociationLink } from "./operationsInterfaces"; import { ContainerInstanceManagementClientOptionalParams } from "./models"; @@ -61,7 +63,7 @@ export class ContainerInstanceManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-containerinstance/8.2.1`; + const packageDetails = `azsdk-js-arm-containerinstance/9.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -81,34 +83,27 @@ export class ContainerInstanceManagementClient extends coreClient.ServiceClient }; super(optionsWithDefaults); - let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } } // Parameter assignments this.subscriptionId = subscriptionId; @@ -120,6 +115,9 @@ export class ContainerInstanceManagementClient extends coreClient.ServiceClient this.operations = new OperationsImpl(this); this.location = new LocationImpl(this); this.containers = new ContainersImpl(this); + this.subnetServiceAssociationLink = new SubnetServiceAssociationLinkImpl( + this + ); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -155,4 +153,5 @@ export class ContainerInstanceManagementClient extends coreClient.ServiceClient operations: Operations; location: Location; containers: Containers; + subnetServiceAssociationLink: SubnetServiceAssociationLink; } diff --git a/sdk/containerinstance/arm-containerinstance/src/models/index.ts b/sdk/containerinstance/arm-containerinstance/src/models/index.ts index 6156352a6078..2b6705aede45 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/index.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/index.ts @@ -16,6 +16,77 @@ export interface ContainerGroupListResult { nextLink?: string; } +/** The Resource model definition. */ +export interface Resource { + /** + * The resource id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The resource location. */ + location?: string; + /** The resource tags. */ + tags?: { [propertyName: string]: string }; + /** The zones for the container group. */ + zones?: string[]; +} + +/** The container group properties */ +export interface ContainerGroupProperties { + /** The identity of the container group, if configured. */ + identity?: ContainerGroupIdentity; + /** + * The provisioning state of the container group. This only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The containers within the container group. */ + containers: Container[]; + /** The image registry credentials by which the container group is created from. */ + imageRegistryCredentials?: ImageRegistryCredential[]; + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * + */ + restartPolicy?: ContainerGroupRestartPolicy; + /** The IP address type of the container group. */ + ipAddress?: IpAddress; + /** The operating system type required by the containers in the container group. */ + osType: OperatingSystemTypes; + /** The list of volumes that can be mounted by containers in this container group. */ + volumes?: Volume[]; + /** + * The instance view of the container group. Only valid in response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceView?: ContainerGroupPropertiesInstanceView; + /** The diagnostic information for a container group. */ + diagnostics?: ContainerGroupDiagnostics; + /** The subnet resource IDs for a container group. */ + subnetIds?: ContainerGroupSubnetId[]; + /** The DNS config information for a container group. */ + dnsConfig?: DnsConfiguration; + /** The SKU for a container group. */ + sku?: ContainerGroupSku; + /** The encryption properties for a container group. */ + encryptionProperties?: EncryptionProperties; + /** The init containers for a container group. */ + initContainers?: InitContainerDefinition[]; +} + /** Identity for the container group. */ export interface ContainerGroupIdentity { /** @@ -30,13 +101,12 @@ export interface ContainerGroupIdentity { readonly tenantId?: string; /** The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. */ type?: ResourceIdentityType; - /** The list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties; - }; + /** The list of user identities associated with the container group. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentities }; } -export interface Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties { +/** The list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ +export interface UserAssignedIdentities { /** * The principal id of user assigned identity. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -295,8 +365,8 @@ export interface IpAddress { ip?: string; /** The Dns name label for the IP. */ dnsNameLabel?: string; - /** The value representing the security enum. */ - dnsNameLabelReusePolicy?: AutoGeneratedDomainNameLabelScope; + /** The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, subscription, or tenant. */ + autoGeneratedDomainNameLabelScope?: DnsNameLabelReusePolicy; /** * The FQDN for the IP. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -453,31 +523,6 @@ export interface InitContainerPropertiesDefinitionInstanceView { readonly events?: Event[]; } -/** The Resource model definition. */ -export interface Resource { - /** - * The resource id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The resource name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** The resource location. */ - location?: string; - /** The resource tags. */ - tags?: { [propertyName: string]: string }; - /** The zones for the container group. */ - zones?: string[]; -} - /** An error response from the Container Instance service. */ export interface CloudError { /** An error response from the Container Instance service. */ @@ -539,6 +584,11 @@ export interface UsageListResult { /** A single usage result */ export interface Usage { + /** + * Id of the usage result + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; /** * Unit of the usage result * NOTE: This property will not be serialized. It can only be populated by the server. @@ -691,50 +741,7 @@ export interface CapabilitiesCapabilities { } /** A container group. */ -export interface ContainerGroup extends Resource { - /** The identity of the container group, if configured. */ - identity?: ContainerGroupIdentity; - /** - * The provisioning state of the container group. This only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The containers within the container group. */ - containers: Container[]; - /** The image registry credentials by which the container group is created from. */ - imageRegistryCredentials?: ImageRegistryCredential[]; - /** - * Restart policy for all containers within the container group. - * - `Always` Always restart - * - `OnFailure` Restart on failure - * - `Never` Never restart - * - */ - restartPolicy?: ContainerGroupRestartPolicy; - /** The IP address type of the container group. */ - ipAddress?: IpAddress; - /** The operating system type required by the containers in the container group. */ - osType: OperatingSystemTypes; - /** The list of volumes that can be mounted by containers in this container group. */ - volumes?: Volume[]; - /** - * The instance view of the container group. Only valid in response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: ContainerGroupPropertiesInstanceView; - /** The diagnostic information for a container group. */ - diagnostics?: ContainerGroupDiagnostics; - /** The subnet resource IDs for a container group. */ - subnetIds?: ContainerGroupSubnetId[]; - /** The DNS config information for a container group. */ - dnsConfig?: DnsConfiguration; - /** The SKU for a container group. */ - sku?: ContainerGroupSku; - /** The encryption properties for a container group. */ - encryptionProperties?: EncryptionProperties; - /** The init containers for a container group. */ - initContainers?: InitContainerDefinition[]; -} +export interface ContainerGroup extends Resource, ContainerGroupProperties {} /** Known values of {@link ContainerNetworkProtocol} that the service accepts. */ export enum KnownContainerNetworkProtocol { @@ -850,8 +857,8 @@ export enum KnownContainerGroupIpAddressType { */ export type ContainerGroupIpAddressType = string; -/** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */ -export enum KnownAutoGeneratedDomainNameLabelScope { +/** Known values of {@link DnsNameLabelReusePolicy} that the service accepts. */ +export enum KnownDnsNameLabelReusePolicy { /** Unsecure */ Unsecure = "Unsecure", /** TenantReuse */ @@ -865,8 +872,8 @@ export enum KnownAutoGeneratedDomainNameLabelScope { } /** - * Defines values for AutoGeneratedDomainNameLabelScope. \ - * {@link KnownAutoGeneratedDomainNameLabelScope} can be used interchangeably with AutoGeneratedDomainNameLabelScope, + * Defines values for DnsNameLabelReusePolicy. \ + * {@link KnownDnsNameLabelReusePolicy} can be used interchangeably with DnsNameLabelReusePolicy, * this enum contains the known values that the service supports. * ### Known values supported by the service * **Unsecure** \ @@ -875,7 +882,7 @@ export enum KnownAutoGeneratedDomainNameLabelScope { * **ResourceGroupReuse** \ * **Noreuse** */ -export type AutoGeneratedDomainNameLabelScope = string; +export type DnsNameLabelReusePolicy = string; /** Known values of {@link OperatingSystemTypes} that the service accepts. */ export enum KnownOperatingSystemTypes { @@ -1128,6 +1135,15 @@ export interface ContainersAttachOptionalParams /** Contains response data for the attach operation. */ export type ContainersAttachResponse = ContainerAttachResponse; +/** Optional parameters. */ +export interface SubnetServiceAssociationLinkDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface ContainerInstanceManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts index 65b232b965fe..62844be8c1d5 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts @@ -35,6 +35,198 @@ export const ContainerGroupListResult: coreClient.CompositeMapper = { } }; +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + zones: { + serializedName: "zones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ContainerGroupProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContainerGroupProperties", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ContainerGroupIdentity" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + containers: { + serializedName: "properties.containers", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Container" + } + } + } + }, + imageRegistryCredentials: { + serializedName: "properties.imageRegistryCredentials", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ImageRegistryCredential" + } + } + } + }, + restartPolicy: { + serializedName: "properties.restartPolicy", + type: { + name: "String" + } + }, + ipAddress: { + serializedName: "properties.ipAddress", + type: { + name: "Composite", + className: "IpAddress" + } + }, + osType: { + serializedName: "properties.osType", + required: true, + type: { + name: "String" + } + }, + volumes: { + serializedName: "properties.volumes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Volume" + } + } + } + }, + instanceView: { + serializedName: "properties.instanceView", + type: { + name: "Composite", + className: "ContainerGroupPropertiesInstanceView" + } + }, + diagnostics: { + serializedName: "properties.diagnostics", + type: { + name: "Composite", + className: "ContainerGroupDiagnostics" + } + }, + subnetIds: { + serializedName: "properties.subnetIds", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ContainerGroupSubnetId" + } + } + } + }, + dnsConfig: { + serializedName: "properties.dnsConfig", + type: { + name: "Composite", + className: "DnsConfiguration" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "String" + } + }, + encryptionProperties: { + serializedName: "properties.encryptionProperties", + type: { + name: "Composite", + className: "EncryptionProperties" + } + }, + initContainers: { + serializedName: "properties.initContainers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InitContainerDefinition" + } + } + } + } + } + } +}; + export const ContainerGroupIdentity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -71,11 +263,7 @@ export const ContainerGroupIdentity: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { - name: "Composite", - className: - "Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties" - } + type: { name: "Composite", className: "UserAssignedIdentities" } } } } @@ -83,11 +271,10 @@ export const ContainerGroupIdentity: coreClient.CompositeMapper = { } }; -export const Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties: coreClient.CompositeMapper = { +export const UserAssignedIdentities: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties", + className: "UserAssignedIdentities", modelProperties: { principalId: { serializedName: "principalId", @@ -737,8 +924,9 @@ export const IpAddress: coreClient.CompositeMapper = { name: "String" } }, - dnsNameLabelReusePolicy: { - serializedName: "dnsNameLabelReusePolicy", + autoGeneratedDomainNameLabelScope: { + defaultValue: "Unsecure", + serializedName: "autoGeneratedDomainNameLabelScope", type: { name: "String" } @@ -1162,60 +1350,6 @@ export const InitContainerPropertiesDefinitionInstanceView: coreClient.Composite } }; -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1394,6 +1528,13 @@ export const Usage: coreClient.CompositeMapper = { name: "Composite", className: "Usage", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, unit: { serializedName: "unit", readOnly: true, @@ -1713,135 +1854,7 @@ export const ContainerGroup: coreClient.CompositeMapper = { className: "ContainerGroup", modelProperties: { ...Resource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ContainerGroupIdentity" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - containers: { - serializedName: "properties.containers", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Container" - } - } - } - }, - imageRegistryCredentials: { - serializedName: "properties.imageRegistryCredentials", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ImageRegistryCredential" - } - } - } - }, - restartPolicy: { - serializedName: "properties.restartPolicy", - type: { - name: "String" - } - }, - ipAddress: { - serializedName: "properties.ipAddress", - type: { - name: "Composite", - className: "IpAddress" - } - }, - osType: { - serializedName: "properties.osType", - required: true, - type: { - name: "String" - } - }, - volumes: { - serializedName: "properties.volumes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Volume" - } - } - } - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "ContainerGroupPropertiesInstanceView" - } - }, - diagnostics: { - serializedName: "properties.diagnostics", - type: { - name: "Composite", - className: "ContainerGroupDiagnostics" - } - }, - subnetIds: { - serializedName: "properties.subnetIds", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerGroupSubnetId" - } - } - } - }, - dnsConfig: { - serializedName: "properties.dnsConfig", - type: { - name: "Composite", - className: "DnsConfiguration" - } - }, - sku: { - serializedName: "properties.sku", - type: { - name: "String" - } - }, - encryptionProperties: { - serializedName: "properties.encryptionProperties", - type: { - name: "Composite", - className: "EncryptionProperties" - } - }, - initContainers: { - serializedName: "properties.initContainers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InitContainerDefinition" - } - } - } - } + ...ContainerGroupProperties.type.modelProperties } } }; diff --git a/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts b/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts index d97122d0741f..4a5b773620ad 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts @@ -166,3 +166,25 @@ export const containerExecRequest: OperationParameter = { parameterPath: "containerExecRequest", mapper: ContainerExecRequestMapper }; + +export const virtualNetworkName: OperationURLParameter = { + parameterPath: "virtualNetworkName", + mapper: { + serializedName: "virtualNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const subnetName: OperationURLParameter = { + parameterPath: "subnetName", + mapper: { + serializedName: "subnetName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/index.ts b/sdk/containerinstance/arm-containerinstance/src/operations/index.ts index e3f959e0485e..84770e8d339d 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/index.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/index.ts @@ -10,3 +10,4 @@ export * from "./containerGroups"; export * from "./operations"; export * from "./location"; export * from "./containers"; +export * from "./subnetServiceAssociationLink"; diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/subnetServiceAssociationLink.ts b/sdk/containerinstance/arm-containerinstance/src/operations/subnetServiceAssociationLink.ts new file mode 100644 index 000000000000..5f192cf7c259 --- /dev/null +++ b/sdk/containerinstance/arm-containerinstance/src/operations/subnetServiceAssociationLink.ts @@ -0,0 +1,146 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { SubnetServiceAssociationLink } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerInstanceManagementClient } from "../containerInstanceManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { SubnetServiceAssociationLinkDeleteOptionalParams } from "../models"; + +/** Class containing SubnetServiceAssociationLink operations. */ +export class SubnetServiceAssociationLinkImpl + implements SubnetServiceAssociationLink { + private readonly client: ContainerInstanceManagementClient; + + /** + * Initialize a new instance of the class SubnetServiceAssociationLink class. + * @param client Reference to the service client + */ + constructor(client: ContainerInstanceManagementClient) { + this.client = client; + } + + /** + * Delete container group virtual network association links. The operation does not delete other + * resources provided by the user. + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualNetworkName: string, + subnetName: string, + options?: SubnetServiceAssociationLinkDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualNetworkName, subnetName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Delete container group virtual network association links. The operation does not delete other + * resources provided by the user. + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualNetworkName: string, + subnetName: string, + options?: SubnetServiceAssociationLinkDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualNetworkName, + subnetName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworkName, + Parameters.subnetName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/index.ts b/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/index.ts index e3f959e0485e..84770e8d339d 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/index.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/index.ts @@ -10,3 +10,4 @@ export * from "./containerGroups"; export * from "./operations"; export * from "./location"; export * from "./containers"; +export * from "./subnetServiceAssociationLink"; diff --git a/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/subnetServiceAssociationLink.ts b/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/subnetServiceAssociationLink.ts new file mode 100644 index 000000000000..ba1f1c5598dc --- /dev/null +++ b/sdk/containerinstance/arm-containerinstance/src/operationsInterfaces/subnetServiceAssociationLink.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SubnetServiceAssociationLinkDeleteOptionalParams } from "../models"; + +/** Interface representing a SubnetServiceAssociationLink. */ +export interface SubnetServiceAssociationLink { + /** + * Delete container group virtual network association links. The operation does not delete other + * resources provided by the user. + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualNetworkName: string, + subnetName: string, + options?: SubnetServiceAssociationLinkDeleteOptionalParams + ): Promise, void>>; + /** + * Delete container group virtual network association links. The operation does not delete other + * resources provided by the user. + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualNetworkName: string, + subnetName: string, + options?: SubnetServiceAssociationLinkDeleteOptionalParams + ): Promise; +} diff --git a/sdk/containerinstance/arm-containerinstance/test/sampleTest.ts b/sdk/containerinstance/arm-containerinstance/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/containerinstance/arm-containerinstance/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/containerinstance/arm-containerinstance/tsconfig.json b/sdk/containerinstance/arm-containerinstance/tsconfig.json index c28d6295827d..3e6ae96443f3 100644 --- a/sdk/containerinstance/arm-containerinstance/tsconfig.json +++ b/sdk/containerinstance/arm-containerinstance/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-containerinstance": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"