diff --git a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md index 9b19ccb98523..7af28a13a53d 100644 --- a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md +++ b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md @@ -1,15 +1,32 @@ # Release History + +## 1.1.0 (2023-04-10) + +**Features** -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group DppResourceGuardProxy + - Added Interface DppResourceGuardProxyCreateOrUpdateOptionalParams + - Added Interface DppResourceGuardProxyDeleteOptionalParams + - Added Interface DppResourceGuardProxyGetOptionalParams + - Added Interface DppResourceGuardProxyListNextOptionalParams + - Added Interface DppResourceGuardProxyListOptionalParams + - Added Interface DppResourceGuardProxyUnlockDeleteOptionalParams + - Added Interface NamespacedNameResource + - Added Interface ResourceGuardOperationDetail + - Added Interface ResourceGuardProxyBase + - Added Interface ResourceGuardProxyBaseResource + - Added Interface ResourceGuardProxyBaseResourceList + - Added Interface UnlockDeleteRequest + - Added Interface UnlockDeleteResponse + - Added Type Alias DppResourceGuardProxyCreateOrUpdateResponse + - Added Type Alias DppResourceGuardProxyGetResponse + - Added Type Alias DppResourceGuardProxyListNextResponse + - Added Type Alias DppResourceGuardProxyListResponse + - Added Type Alias DppResourceGuardProxyUnlockDeleteResponse + - Interface KubernetesClusterBackupDatasourceParameters has a new optional parameter backupHookReferences + - Interface KubernetesClusterRestoreCriteria has a new optional parameter restoreHookReferences + + ## 1.0.0 (2023-03-08) The package of @azure/arm-dataprotection is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/dataprotection/arm-dataprotection/_meta.json b/sdk/dataprotection/arm-dataprotection/_meta.json index 9b18dddf8453..a737a4fca96a 100644 --- a/sdk/dataprotection/arm-dataprotection/_meta.json +++ b/sdk/dataprotection/arm-dataprotection/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d66735f5dc80731ee5c7a31399c2a46f8743153a", - "readme": "specification\\dataprotection\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.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\\dataprotection\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true", + "commit": "9a79dbda84fa1f08ff472f996229def268c37e02", + "readme": "specification/dataprotection/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dataprotection/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/package.json b/sdk/dataprotection/arm-dataprotection/package.json index 87e39d868914..d4b32e0d64f1 100644 --- a/sdk/dataprotection/arm-dataprotection/package.json +++ b/sdk/dataprotection/arm-dataprotection/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataProtectionClient.", - "version": "1.0.1", + "version": "1.1.0", "engines": { "node": ">=14.0.0" }, @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection" +} \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md index 93252002517f..fd9549e55849 100644 --- a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md +++ b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md @@ -858,6 +858,8 @@ export class DataProtectionClient extends coreClient.ServiceClient { // (undocumented) deletedBackupInstances: DeletedBackupInstances; // (undocumented) + dppResourceGuardProxy: DppResourceGuardProxy; + // (undocumented) exportJobs: ExportJobs; // (undocumented) exportJobsOperationResult: ExportJobsOperationResult; @@ -1077,6 +1079,54 @@ export interface DppResource { readonly type?: string; } +// @public +export interface DppResourceGuardProxy { + createOrUpdate(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, parameters: ResourceGuardProxyBaseResource, options?: DppResourceGuardProxyCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, options?: DppResourceGuardProxyDeleteOptionalParams): Promise; + get(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, options?: DppResourceGuardProxyGetOptionalParams): Promise; + list(resourceGroupName: string, vaultName: string, options?: DppResourceGuardProxyListOptionalParams): PagedAsyncIterableIterator; + unlockDelete(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, parameters: UnlockDeleteRequest, options?: DppResourceGuardProxyUnlockDeleteOptionalParams): Promise; +} + +// @public +export interface DppResourceGuardProxyCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyCreateOrUpdateResponse = ResourceGuardProxyBaseResource; + +// @public +export interface DppResourceGuardProxyDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DppResourceGuardProxyGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyGetResponse = ResourceGuardProxyBaseResource; + +// @public +export interface DppResourceGuardProxyListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyListNextResponse = ResourceGuardProxyBaseResourceList; + +// @public +export interface DppResourceGuardProxyListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyListResponse = ResourceGuardProxyBaseResourceList; + +// @public +export interface DppResourceGuardProxyUnlockDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyUnlockDeleteResponse = UnlockDeleteResponse; + // @public export interface DppResourceList { nextLink?: string; @@ -1554,6 +1604,7 @@ export enum KnownWeekNumber { // @public export interface KubernetesClusterBackupDatasourceParameters extends BackupDatasourceParameters { + backupHookReferences?: NamespacedNameResource[]; excludedNamespaces?: string[]; excludedResourceTypes?: string[]; includeClusterScopeResources: boolean; @@ -1578,6 +1629,7 @@ export interface KubernetesClusterRestoreCriteria extends ItemLevelRestoreCriter }; objectType: "KubernetesClusterRestoreCriteria"; persistentVolumeRestoreMode?: PersistentVolumeRestoreMode; + restoreHookReferences?: NamespacedNameResource[]; } // @public @@ -1602,6 +1654,12 @@ export interface MonitoringSettings { // @public export type Month = string; +// @public +export interface NamespacedNameResource { + name?: string; + namespace?: string; +} + // @public export interface OperationExtendedInfo { objectType: "OperationJobExtendedInfo"; @@ -1828,6 +1886,36 @@ export interface ResourceGuardOperation { readonly vaultCriticalOperation?: string; } +// @public +export interface ResourceGuardOperationDetail { + // (undocumented) + defaultResourceRequest?: string; + // (undocumented) + vaultCriticalOperation?: string; +} + +// @public +export interface ResourceGuardProxyBase { + // (undocumented) + description?: string; + // (undocumented) + lastUpdatedTime?: string; + // (undocumented) + resourceGuardOperationDetails?: ResourceGuardOperationDetail[]; + // (undocumented) + resourceGuardResourceId?: string; +} + +// @public +export interface ResourceGuardProxyBaseResource extends DppResource { + properties?: ResourceGuardProxyBase; +} + +// @public +export interface ResourceGuardProxyBaseResourceList extends DppResourceList { + value?: ResourceGuardProxyBaseResource[]; +} + // @public (undocumented) export interface ResourceGuardResource extends DppBaseTrackedResource { properties?: ResourceGuard; @@ -2252,6 +2340,19 @@ export interface TriggerContext { // @public (undocumented) export type TriggerContextUnion = TriggerContext | AdhocBasedTriggerContext | ScheduleBasedTriggerContext; +// @public +export interface UnlockDeleteRequest { + // (undocumented) + resourceGuardOperationRequests?: string[]; + // (undocumented) + resourceToBeDeleted?: string; +} + +// @public +export interface UnlockDeleteResponse { + unlockDeleteExpiryTime?: string; +} + // @public export interface UserFacingError { code?: string; diff --git a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts index 4dc3aa569e81..2746be40ce83 100644 --- a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts +++ b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts @@ -31,7 +31,8 @@ import { ExportJobsImpl, ExportJobsOperationResultImpl, DeletedBackupInstancesImpl, - ResourceGuardsImpl + ResourceGuardsImpl, + DppResourceGuardProxyImpl } from "./operations"; import { BackupVaults, @@ -50,7 +51,8 @@ import { ExportJobs, ExportJobsOperationResult, DeletedBackupInstances, - ResourceGuards + ResourceGuards, + DppResourceGuardProxy } from "./operationsInterfaces"; import { DataProtectionClientOptionalParams } from "./models"; @@ -86,7 +88,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dataprotection/1.0.1`; + const packageDetails = `azsdk-js-arm-dataprotection/1.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -139,7 +141,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-01-01"; + this.apiVersion = options.apiVersion || "2023-05-01"; this.backupVaults = new BackupVaultsImpl(this); this.operationResult = new OperationResultImpl(this); this.operationStatus = new OperationStatusImpl(this); @@ -163,6 +165,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { this.exportJobsOperationResult = new ExportJobsOperationResultImpl(this); this.deletedBackupInstances = new DeletedBackupInstancesImpl(this); this.resourceGuards = new ResourceGuardsImpl(this); + this.dppResourceGuardProxy = new DppResourceGuardProxyImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -211,4 +214,5 @@ export class DataProtectionClient extends coreClient.ServiceClient { exportJobsOperationResult: ExportJobsOperationResult; deletedBackupInstances: DeletedBackupInstances; resourceGuards: ResourceGuards; + dppResourceGuardProxy: DppResourceGuardProxy; } diff --git a/sdk/dataprotection/arm-dataprotection/src/models/index.ts b/sdk/dataprotection/arm-dataprotection/src/models/index.ts index f0f70dbf0b7e..e75058a729d5 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/index.ts @@ -995,6 +995,32 @@ export interface DppBaseResource { readonly type?: string; } +/** ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource */ +export interface ResourceGuardProxyBase { + resourceGuardResourceId?: string; + resourceGuardOperationDetails?: ResourceGuardOperationDetail[]; + lastUpdatedTime?: string; + description?: string; +} + +/** VaultCritical Operation protected by a resource guard */ +export interface ResourceGuardOperationDetail { + vaultCriticalOperation?: string; + defaultResourceRequest?: string; +} + +/** Request body of unlock delete API. */ +export interface UnlockDeleteRequest { + resourceGuardOperationRequests?: string[]; + resourceToBeDeleted?: string; +} + +/** Response of Unlock Delete API. */ +export interface UnlockDeleteResponse { + /** This is the time when unlock delete privileges will get expired. */ + unlockDeleteExpiryTime?: string; +} + /** Delete Option */ export interface DeleteOption { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1088,6 +1114,14 @@ export interface BasePolicyRule { name: string; } +/** Class to refer resources which contains namespace and name */ +export interface NamespacedNameResource { + /** Name of the resource */ + name?: string; + /** Namespace in which the resource exists */ + namespace?: string; +} + /** Source LifeCycle */ export interface SourceLifeCycle { /** Delete Option */ @@ -1244,6 +1278,12 @@ export interface DeletedBackupInstanceResourceList extends DppResourceList { value?: DeletedBackupInstanceResource[]; } +/** List of ResourceGuardProxyBase resources */ +export interface ResourceGuardProxyBaseResourceList extends DppResourceList { + /** List of resources. */ + value?: ResourceGuardProxyBaseResource[]; +} + /** Operation Job Extended Info */ export interface OperationJobExtendedInfo extends OperationExtendedInfo { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1312,6 +1352,12 @@ export interface DeletedBackupInstanceResource extends DppResource { properties?: DeletedBackupInstance; } +/** ResourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs */ +export interface ResourceGuardProxyBaseResource extends DppResource { + /** ResourceGuardProxyBaseResource properties */ + properties?: ResourceGuardProxyBase; +} + /** Deleted Backup Instance */ export interface DeletedBackupInstance extends BackupInstance { /** @@ -1334,20 +1380,22 @@ export interface KubernetesClusterBackupDatasourceParameters extends BackupDatasourceParameters { /** Polymorphic discriminator, which specifies the different types this object can be */ objectType: "KubernetesClusterBackupDatasourceParameters"; - /** Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during restore. */ + /** Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during backup. */ snapshotVolumes: boolean; - /** Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during restore. */ + /** Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during backup. */ includeClusterScopeResources: boolean; - /** Gets or sets the include namespaces property. This property sets the namespaces to be included during restore. */ + /** Gets or sets the include namespaces property. This property sets the namespaces to be included during backup. */ includedNamespaces?: string[]; - /** Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore. */ + /** Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during backup. */ excludedNamespaces?: string[]; - /** Gets or sets the include resource types property. This property sets the resource types to be included during restore. */ + /** Gets or sets the include resource types property. This property sets the resource types to be included during backup. */ includedResourceTypes?: string[]; - /** Gets or sets the exclude resource types property. This property sets the resource types to be excluded during restore. */ + /** Gets or sets the exclude resource types property. This property sets the resource types to be excluded during backup. */ excludedResourceTypes?: string[]; - /** Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during restore. */ + /** Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during backup. */ labelSelectors?: string[]; + /** Gets or sets the backup hook references. This property sets the hook reference to be executed during backup. */ + backupHookReferences?: NamespacedNameResource[]; } /** Parameters to be used during configuration of backup of blobs */ @@ -1617,6 +1665,8 @@ export interface KubernetesClusterRestoreCriteria conflictPolicy?: ExistingResourcePolicy; /** Gets or sets the Namespace Mappings property. This property sets if namespace needs to be change during restore. */ namespaceMappings?: { [propertyName: string]: string }; + /** Gets or sets the restore hook references. This property sets the hook reference to be executed during restore. */ + restoreHookReferences?: NamespacedNameResource[]; } /** Backup Vault Resource */ @@ -3096,6 +3146,45 @@ export interface ResourceGuardsGetUpdateProtectedItemRequestsObjectsNextOptional /** Contains response data for the getUpdateProtectedItemRequestsObjectsNext operation. */ export type ResourceGuardsGetUpdateProtectedItemRequestsObjectsNextResponse = DppBaseResourceList; +/** Optional parameters. */ +export interface DppResourceGuardProxyListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DppResourceGuardProxyListResponse = ResourceGuardProxyBaseResourceList; + +/** Optional parameters. */ +export interface DppResourceGuardProxyGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DppResourceGuardProxyGetResponse = ResourceGuardProxyBaseResource; + +/** Optional parameters. */ +export interface DppResourceGuardProxyCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DppResourceGuardProxyCreateOrUpdateResponse = ResourceGuardProxyBaseResource; + +/** Optional parameters. */ +export interface DppResourceGuardProxyDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DppResourceGuardProxyUnlockDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the unlockDelete operation. */ +export type DppResourceGuardProxyUnlockDeleteResponse = UnlockDeleteResponse; + +/** Optional parameters. */ +export interface DppResourceGuardProxyListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DppResourceGuardProxyListNextResponse = ResourceGuardProxyBaseResourceList; + /** Optional parameters. */ export interface DataProtectionClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts index b19d89eb8215..1b61f50d5afc 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts @@ -2355,6 +2355,107 @@ export const DppBaseResource: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBase", + modelProperties: { + resourceGuardResourceId: { + serializedName: "resourceGuardResourceId", + type: { + name: "String" + } + }, + resourceGuardOperationDetails: { + serializedName: "resourceGuardOperationDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceGuardOperationDetail" + } + } + } + }, + lastUpdatedTime: { + serializedName: "lastUpdatedTime", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGuardOperationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardOperationDetail", + modelProperties: { + vaultCriticalOperation: { + serializedName: "vaultCriticalOperation", + type: { + name: "String" + } + }, + defaultResourceRequest: { + serializedName: "defaultResourceRequest", + type: { + name: "String" + } + } + } + } +}; + +export const UnlockDeleteRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UnlockDeleteRequest", + modelProperties: { + resourceGuardOperationRequests: { + serializedName: "resourceGuardOperationRequests", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + resourceToBeDeleted: { + serializedName: "resourceToBeDeleted", + type: { + name: "String" + } + } + } + } +}; + +export const UnlockDeleteResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UnlockDeleteResponse", + modelProperties: { + unlockDeleteExpiryTime: { + serializedName: "unlockDeleteExpiryTime", + type: { + name: "String" + } + } + } + } +}; + export const DeleteOption: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2692,6 +2793,27 @@ export const BasePolicyRule: coreClient.CompositeMapper = { } }; +export const NamespacedNameResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamespacedNameResource", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + } + } + } +}; + export const SourceLifeCycle: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3165,6 +3287,28 @@ export const DeletedBackupInstanceResourceList: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBaseResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResourceList", + modelProperties: { + ...DppResourceList.type.modelProperties, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResource" + } + } + } + } + } + } +}; + export const OperationJobExtendedInfo: coreClient.CompositeMapper = { serializedName: "OperationJobExtendedInfo", type: { @@ -3354,6 +3498,23 @@ export const DeletedBackupInstanceResource: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBaseResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResource", + modelProperties: { + ...DppResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResourceGuardProxyBase" + } + } + } + } +}; + export const DeletedBackupInstance: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3468,6 +3629,18 @@ export const KubernetesClusterBackupDatasourceParameters: coreClient.CompositeMa } } } + }, + backupHookReferences: { + serializedName: "backupHookReferences", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamespacedNameResource" + } + } + } } } } @@ -4289,6 +4462,18 @@ export const KubernetesClusterRestoreCriteria: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + restoreHookReferences: { + serializedName: "restoreHookReferences", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamespacedNameResource" + } + } + } } } } diff --git a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts index e08a54393cd8..bd7a849ddf8f 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts @@ -26,7 +26,9 @@ import { ValidateRestoreRequestObject as ValidateRestoreRequestObjectMapper, AzureBackupFindRestorableTimeRangesRequest as AzureBackupFindRestorableTimeRangesRequestMapper, ResourceGuardResource as ResourceGuardResourceMapper, - PatchResourceGuardInput as PatchResourceGuardInputMapper + PatchResourceGuardInput as PatchResourceGuardInputMapper, + ResourceGuardProxyBaseResource as ResourceGuardProxyBaseResourceMapper, + UnlockDeleteRequest as UnlockDeleteRequestMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -56,7 +58,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-01", + defaultValue: "2023-05-01", isConstant: true, serializedName: "api-version", type: { @@ -308,3 +310,27 @@ export const requestName: OperationURLParameter = { } } }; + +export const resourceGuardProxyName: OperationURLParameter = { + parameterPath: "resourceGuardProxyName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]*$") + }, + serializedName: "resourceGuardProxyName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters15: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceGuardProxyBaseResourceMapper +}; + +export const parameters16: OperationParameter = { + parameterPath: "parameters", + mapper: UnlockDeleteRequestMapper +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts b/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts new file mode 100644 index 000000000000..8e9f976587d8 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts @@ -0,0 +1,390 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { DppResourceGuardProxy } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + ResourceGuardProxyBaseResource, + DppResourceGuardProxyListNextOptionalParams, + DppResourceGuardProxyListOptionalParams, + DppResourceGuardProxyListResponse, + DppResourceGuardProxyGetOptionalParams, + DppResourceGuardProxyGetResponse, + DppResourceGuardProxyCreateOrUpdateOptionalParams, + DppResourceGuardProxyCreateOrUpdateResponse, + DppResourceGuardProxyDeleteOptionalParams, + UnlockDeleteRequest, + DppResourceGuardProxyUnlockDeleteOptionalParams, + DppResourceGuardProxyUnlockDeleteResponse, + DppResourceGuardProxyListNextResponse +} from "../models"; + +/// +/** Class containing DppResourceGuardProxy operations. */ +export class DppResourceGuardProxyImpl implements DppResourceGuardProxy { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class DppResourceGuardProxy class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, vaultName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + vaultName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DppResourceGuardProxyListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, vaultName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + vaultName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + vaultName, + options + )) { + yield* page; + } + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, options }, + listOperationSpec + ); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the + * request + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, resourceGuardProxyName, options }, + getOperationSpec + ); + } + + /** + * Creates or Updates a ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: ResourceGuardProxyBaseResource, + options?: DppResourceGuardProxyCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + resourceGuardProxyName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes the ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, resourceGuardProxyName, options }, + deleteOperationSpec + ); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + unlockDelete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: UnlockDeleteRequest, + options?: DppResourceGuardProxyUnlockDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + resourceGuardProxyName, + parameters, + options + }, + unlockDeleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + vaultName: string, + nextLink: string, + options?: DppResourceGuardProxyListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const unlockDeleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.UnlockDeleteResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters16, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/index.ts b/sdk/dataprotection/arm-dataprotection/src/operations/index.ts index 8f9497e552e9..7ec031af6618 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/index.ts @@ -23,3 +23,4 @@ export * from "./exportJobs"; export * from "./exportJobsOperationResult"; export * from "./deletedBackupInstances"; export * from "./resourceGuards"; +export * from "./dppResourceGuardProxy"; diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts new file mode 100644 index 000000000000..37f1c88f15ea --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts @@ -0,0 +1,94 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ResourceGuardProxyBaseResource, + DppResourceGuardProxyListOptionalParams, + DppResourceGuardProxyGetOptionalParams, + DppResourceGuardProxyGetResponse, + DppResourceGuardProxyCreateOrUpdateOptionalParams, + DppResourceGuardProxyCreateOrUpdateResponse, + DppResourceGuardProxyDeleteOptionalParams, + UnlockDeleteRequest, + DppResourceGuardProxyUnlockDeleteOptionalParams, + DppResourceGuardProxyUnlockDeleteResponse +} from "../models"; + +/// +/** Interface representing a DppResourceGuardProxy. */ +export interface DppResourceGuardProxy { + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the + * request + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyGetOptionalParams + ): Promise; + /** + * Creates or Updates a ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: ResourceGuardProxyBaseResource, + options?: DppResourceGuardProxyCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyDeleteOptionalParams + ): Promise; + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + unlockDelete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: UnlockDeleteRequest, + options?: DppResourceGuardProxyUnlockDeleteOptionalParams + ): Promise; +} diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts index 8f9497e552e9..7ec031af6618 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts @@ -23,3 +23,4 @@ export * from "./exportJobs"; export * from "./exportJobsOperationResult"; export * from "./deletedBackupInstances"; export * from "./resourceGuards"; +export * from "./dppResourceGuardProxy"; diff --git a/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts b/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/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/dataprotection/arm-dataprotection/tsconfig.json b/sdk/dataprotection/arm-dataprotection/tsconfig.json index 1f65f09046a1..3e6ae96443f3 100644 --- a/sdk/dataprotection/arm-dataprotection/tsconfig.json +++ b/sdk/dataprotection/arm-dataprotection/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dataprotection": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"