diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 05ee77d452ff..24fd4bc00529 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9149,6 +9149,12 @@ packages: hasBin: true dev: false + /typescript@5.3.2: + resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} + engines: {node: '>=14.17'} + hasBin: true + dev: false + /typescript@5.4.0-dev.20231120: resolution: {integrity: sha512-MG4Zg5HXb8bnvGdZrMeLBekqbCjHjaMPewXh3wVrNgTF+toQ4BrdhXnYiqMU0pLLxcsxRSMPB5MzB7YHgr67Cg==} engines: {node: '>=14.17'} @@ -14327,17 +14333,19 @@ packages: dev: false file:projects/arm-postgresql-flexible.tgz: - resolution: {integrity: sha512-YSXJW8BtF9HqLWexP2+bGeo7ooW7lePKmH4y/34/u59si1nTs6BWMY7ud+JWYT1x1jvxonvVFTMrxOlSM0ffhg==, tarball: file:projects/arm-postgresql-flexible.tgz} + resolution: {integrity: sha512-IAdWZNzt9xojICD12ecNw2zCg87H86jtz/8bIIyKkKiK+R2+U/j8SEoQMjRp/DIHu9YzMD5WSZx1kX0HLt2R4g==, tarball: file:projects/arm-postgresql-flexible.tgz} name: '@rush-temp/arm-postgresql-flexible' version: 0.0.0 dependencies: '@azure/identity': 3.4.1 '@microsoft/api-extractor': 7.38.3(@types/node@18.18.10) '@types/chai': 4.3.10 + '@types/mocha': 10.0.4 '@types/node': 18.18.10 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 rimraf: 5.0.5 @@ -17535,7 +17543,7 @@ packages: name: '@rush-temp/dev-tool' version: 0.0.0 dependencies: - '@_ts/max': /typescript@5.2.2 + '@_ts/max': /typescript@5.3.2 '@_ts/min': /typescript@4.2.4 '@microsoft/api-extractor': 7.38.3(@types/node@18.18.10) '@rollup/plugin-commonjs': 25.0.7(rollup@3.29.4) @@ -18793,7 +18801,7 @@ packages: dev: false file:projects/maps-search.tgz: - resolution: {integrity: sha512-0c620IRl8qUpuVvlktAvfGJBBPLJ+GYImP9gYMKib/z4p8fLwBqDXIu+PQ9BAZr989jiTWWtIDVGAAzGTq1M0g==, tarball: file:projects/maps-search.tgz} + resolution: {integrity: sha512-rQjWla5iqC2+spBVto7uurlHatu/DLuZ87aN78ipQhneziIVkPXxrFBZik8+JhAepgBWTb/O5JodYHF6LZqtJQ==, tarball: file:projects/maps-search.tgz} name: '@rush-temp/maps-search' version: 0.0.0 dependencies: @@ -21102,7 +21110,7 @@ packages: dev: false file:projects/ts-http-runtime.tgz: - resolution: {integrity: sha512-XXawjubPvJvw6gFXREpKWutiFCOJyE+m94SRQYXdxw5AW7M+W0jyzZgSbx6j2xW2YvHcc2FwVx0QcfLAJCs0pA==, tarball: file:projects/ts-http-runtime.tgz} + resolution: {integrity: sha512-65IgqX3myZ+cSo7FQeo27HZJtHOK0aPfoTKYiCxZCecek7JCwwc5yL07ssAKP/NT2jwCQOviN2lBBszfKGvXHQ==, tarball: file:projects/ts-http-runtime.tgz} name: '@rush-temp/ts-http-runtime' version: 0.0.0 dependencies: diff --git a/sdk/postgresql/arm-postgresql-flexible/CHANGELOG.md b/sdk/postgresql/arm-postgresql-flexible/CHANGELOG.md index e13a76a40288..ecef7b39afba 100644 --- a/sdk/postgresql/arm-postgresql-flexible/CHANGELOG.md +++ b/sdk/postgresql/arm-postgresql-flexible/CHANGELOG.md @@ -1,14 +1,254 @@ # Release History + +## 8.0.0-beta.4 (2023-11-07) + +**Features** -## 8.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes + - Added operation group FlexibleServer + - Added operation group LogFiles + - Added operation group LtrBackupOperations + - Added operation group Migrations + - Added operation group PrivateEndpointConnectionOperations + - Added operation group PrivateEndpointConnections + - Added operation group PrivateLinkResources + - Added operation group QuotaUsages + - Added operation group ServerCapabilities + - Added operation group ServerThreatProtectionSettings + - Added operation group VirtualEndpoints + - Added Interface AdminCredentials + - Added Interface BackupRequestBase + - Added Interface BackupSettings + - Added Interface BackupStoreDetails + - Added Interface CapabilityBase + - Added Interface CheckMigrationNameAvailabilityOptionalParams + - Added Interface DbLevelValidationStatus + - Added Interface DbMigrationStatus + - Added Interface DbServerMetadata + - Added Interface FlexibleServerCapability + - Added Interface FlexibleServerStartLtrBackupExceptionHeaders + - Added Interface FlexibleServerStartLtrBackupHeaders + - Added Interface FlexibleServerStartLtrBackupOptionalParams + - Added Interface FlexibleServerTriggerLtrPreBackupExceptionHeaders + - Added Interface FlexibleServerTriggerLtrPreBackupHeaders + - Added Interface FlexibleServerTriggerLtrPreBackupOptionalParams + - Added Interface LogFile + - Added Interface LogFileListResult + - Added Interface LogFilesListByServerNextOptionalParams + - Added Interface LogFilesListByServerOptionalParams + - Added Interface LtrBackupOperationsGetOptionalParams + - Added Interface LtrBackupOperationsListByServerNextOptionalParams + - Added Interface LtrBackupOperationsListByServerOptionalParams + - Added Interface LtrBackupRequest + - Added Interface LtrBackupResponse + - Added Interface LtrPreBackupRequest + - Added Interface LtrPreBackupResponse + - Added Interface LtrServerBackupOperation + - Added Interface LtrServerBackupOperationList + - Added Interface MigrationNameAvailabilityResource + - Added Interface MigrationResource + - Added Interface MigrationResourceForPatch + - Added Interface MigrationResourceListResult + - Added Interface MigrationsCreateOptionalParams + - Added Interface MigrationsDeleteOptionalParams + - Added Interface MigrationSecretParameters + - Added Interface MigrationsGetOptionalParams + - Added Interface MigrationsListByTargetServerNextOptionalParams + - Added Interface MigrationsListByTargetServerOptionalParams + - Added Interface MigrationStatus + - Added Interface MigrationSubStateDetails + - Added Interface MigrationsUpdateOptionalParams + - Added Interface NameProperty + - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionDeleteHeaders + - Added Interface PrivateEndpointConnectionDeleteOptionalParams + - Added Interface PrivateEndpointConnectionListResult + - Added Interface PrivateEndpointConnectionsGetOptionalParams + - Added Interface PrivateEndpointConnectionsListByServerNextOptionalParams + - Added Interface PrivateEndpointConnectionsListByServerOptionalParams + - Added Interface PrivateEndpointConnectionUpdateHeaders + - Added Interface PrivateEndpointConnectionUpdateOptionalParams + - Added Interface PrivateLinkResource + - Added Interface PrivateLinkResourceListResult + - Added Interface PrivateLinkResourcesGetOptionalParams + - Added Interface PrivateLinkResourcesListByServerNextOptionalParams + - Added Interface PrivateLinkResourcesListByServerOptionalParams + - Added Interface PrivateLinkServiceConnectionState + - Added Interface QuotaUsage + - Added Interface QuotaUsagesListNextOptionalParams + - Added Interface QuotaUsagesListOptionalParams + - Added Interface QuotaUsagesListResult + - Added Interface Replica + - Added Interface ServerCapabilitiesListNextOptionalParams + - Added Interface ServerCapabilitiesListOptionalParams + - Added Interface ServerSku + - Added Interface ServerSkuCapability + - Added Interface ServerThreatProtectionListResult + - Added Interface ServerThreatProtectionSettingsCreateOrUpdateOptionalParams + - Added Interface ServerThreatProtectionSettingsGetOptionalParams + - Added Interface ServerThreatProtectionSettingsListByServerNextOptionalParams + - Added Interface ServerThreatProtectionSettingsListByServerOptionalParams + - Added Interface ServerThreatProtectionSettingsModel + - Added Interface StorageMbCapability + - Added Interface ValidationDetails + - Added Interface ValidationMessage + - Added Interface ValidationSummaryItem + - Added Interface VirtualEndpointResource + - Added Interface VirtualEndpointResourceForPatch + - Added Interface VirtualEndpointsCreateHeaders + - Added Interface VirtualEndpointsCreateOptionalParams + - Added Interface VirtualEndpointsDeleteHeaders + - Added Interface VirtualEndpointsDeleteOptionalParams + - Added Interface VirtualEndpointsGetOptionalParams + - Added Interface VirtualEndpointsListByServerNextOptionalParams + - Added Interface VirtualEndpointsListByServerOptionalParams + - Added Interface VirtualEndpointsListResult + - Added Interface VirtualEndpointsUpdateHeaders + - Added Interface VirtualEndpointsUpdateOptionalParams + - Added Type Alias AzureManagedDiskPerformanceTiers + - Added Type Alias CancelEnum + - Added Type Alias CapabilityStatus + - Added Type Alias CheckMigrationNameAvailabilityResponse + - Added Type Alias ExecutionStatus + - Added Type Alias FastProvisioningSupportedEnum + - Added Type Alias FlexibleServerStartLtrBackupResponse + - Added Type Alias FlexibleServerTriggerLtrPreBackupResponse + - Added Type Alias GeoBackupSupportedEnum + - Added Type Alias HaMode + - Added Type Alias KeyStatusEnum + - Added Type Alias LogFilesListByServerNextResponse + - Added Type Alias LogFilesListByServerResponse + - Added Type Alias LogicalReplicationOnSourceDbEnum + - Added Type Alias LtrBackupOperationsGetResponse + - Added Type Alias LtrBackupOperationsListByServerNextResponse + - Added Type Alias LtrBackupOperationsListByServerResponse + - Added Type Alias MigrationDbState + - Added Type Alias MigrationDetailsLevel + - Added Type Alias MigrationListFilter + - Added Type Alias MigrationMode + - Added Type Alias MigrationNameAvailabilityReason + - Added Type Alias MigrationOption + - Added Type Alias MigrationsCreateResponse + - Added Type Alias MigrationsGetResponse + - Added Type Alias MigrationsListByTargetServerNextResponse + - Added Type Alias MigrationsListByTargetServerResponse + - Added Type Alias MigrationState + - Added Type Alias MigrationSubState + - Added Type Alias MigrationsUpdateResponse + - Added Type Alias OnlineResizeSupportedEnum + - Added Type Alias OverwriteDbsInTargetEnum + - Added Type Alias PrivateEndpointConnectionDeleteResponse + - Added Type Alias PrivateEndpointConnectionProvisioningState + - Added Type Alias PrivateEndpointConnectionsGetResponse + - Added Type Alias PrivateEndpointConnectionsListByServerNextResponse + - Added Type Alias PrivateEndpointConnectionsListByServerResponse + - Added Type Alias PrivateEndpointConnectionUpdateResponse + - Added Type Alias PrivateEndpointServiceConnectionStatus + - Added Type Alias PrivateLinkResourcesGetResponse + - Added Type Alias PrivateLinkResourcesListByServerNextResponse + - Added Type Alias PrivateLinkResourcesListByServerResponse + - Added Type Alias QuotaUsagesListNextResponse + - Added Type Alias QuotaUsagesListResponse + - Added Type Alias ReadReplicaPromoteMode + - Added Type Alias ReplicationPromoteOption + - Added Type Alias ReplicationState + - Added Type Alias RestrictedEnum + - Added Type Alias ServerCapabilitiesListNextResponse + - Added Type Alias ServerCapabilitiesListResponse + - Added Type Alias ServerThreatProtectionSettingsCreateOrUpdateResponse + - Added Type Alias ServerThreatProtectionSettingsGetResponse + - Added Type Alias ServerThreatProtectionSettingsListByServerNextResponse + - Added Type Alias ServerThreatProtectionSettingsListByServerResponse + - Added Type Alias SourceType + - Added Type Alias SslMode + - Added Type Alias StartDataMigrationEnum + - Added Type Alias StorageAutoGrow + - Added Type Alias StorageAutoGrowthSupportedEnum + - Added Type Alias StorageType + - Added Type Alias ThreatProtectionName + - Added Type Alias ThreatProtectionState + - Added Type Alias TriggerCutoverEnum + - Added Type Alias ValidationState + - Added Type Alias VirtualEndpointsCreateResponse + - Added Type Alias VirtualEndpointsDeleteResponse + - Added Type Alias VirtualEndpointsGetResponse + - Added Type Alias VirtualEndpointsListByServerNextResponse + - Added Type Alias VirtualEndpointsListByServerResponse + - Added Type Alias VirtualEndpointsUpdateResponse + - Added Type Alias VirtualEndpointType + - Added Type Alias ZoneRedundantHaAndGeoBackupSupportedEnum + - Added Type Alias ZoneRedundantHaSupportedEnum + - Interface DataEncryption has a new optional parameter geoBackupEncryptionKeyStatus + - Interface DataEncryption has a new optional parameter geoBackupKeyURI + - Interface DataEncryption has a new optional parameter geoBackupUserAssignedIdentityId + - Interface DataEncryption has a new optional parameter primaryEncryptionKeyStatus + - Interface FastProvisioningEditionCapability has a new optional parameter serverCount + - Interface FastProvisioningEditionCapability has a new optional parameter supportedTier + - Interface FlexibleServerEditionCapability has a new optional parameter defaultSkuName + - Interface FlexibleServerEditionCapability has a new optional parameter supportedServerSkus + - Interface Server has a new optional parameter privateEndpointConnections + - Interface Server has a new optional parameter replica + - Interface ServerForUpdate has a new optional parameter network + - Interface ServerForUpdate has a new optional parameter replica + - Interface Storage_2 has a new optional parameter autoGrow + - Interface Storage_2 has a new optional parameter iops + - Interface Storage_2 has a new optional parameter throughput + - Interface Storage_2 has a new optional parameter tier + - Interface Storage_2 has a new optional parameter type + - Interface StorageEditionCapability has a new optional parameter defaultStorageSizeMb + - Interface StorageEditionCapability has a new optional parameter supportedStorageMb + - Interface UserAssignedIdentity has a new optional parameter tenantId + - Added Enum KnownAzureManagedDiskPerformanceTiers + - Added Enum KnownCancelEnum + - Added Enum KnownExecutionStatus + - Added Enum KnownFastProvisioningSupportedEnum + - Added Enum KnownGeoBackupSupportedEnum + - Added Enum KnownHaMode + - Added Enum KnownKeyStatusEnum + - Added Enum KnownLogicalReplicationOnSourceDbEnum + - Added Enum KnownMigrationDbState + - Added Enum KnownMigrationDetailsLevel + - Added Enum KnownMigrationListFilter + - Added Enum KnownMigrationMode + - Added Enum KnownMigrationNameAvailabilityReason + - Added Enum KnownMigrationOption + - Added Enum KnownMigrationState + - Added Enum KnownMigrationSubState + - Added Enum KnownOnlineResizeSupportedEnum + - Added Enum KnownOverwriteDbsInTargetEnum + - Added Enum KnownPrivateEndpointConnectionProvisioningState + - Added Enum KnownPrivateEndpointServiceConnectionStatus + - Added Enum KnownReadReplicaPromoteMode + - Added Enum KnownReplicationPromoteOption + - Added Enum KnownReplicationState + - Added Enum KnownRestrictedEnum + - Added Enum KnownSourceType + - Added Enum KnownSslMode + - Added Enum KnownStartDataMigrationEnum + - Added Enum KnownStorageAutoGrow + - Added Enum KnownStorageAutoGrowthSupportedEnum + - Added Enum KnownStorageType + - Added Enum KnownThreatProtectionName + - Added Enum KnownTriggerCutoverEnum + - Added Enum KnownValidationState + - Added Enum KnownVirtualEndpointType + - Added Enum KnownZoneRedundantHaAndGeoBackupSupportedEnum + - Added Enum KnownZoneRedundantHaSupportedEnum + - Enum KnownCreateMode has a new value ReviveDropped + - Enum KnownServerVersion has a new value Fifteen + - Enum KnownServerVersion has a new value Sixteen -### Bugs Fixed +**Breaking Changes** -### Other Changes + - Class PostgreSQLManagementFlexibleServerClient has a new signature + - Interface FlexibleServerEditionCapability no longer has parameter supportedServerVersions + - Interface ServerVersionCapability no longer has parameter supportedVcores + - Interface StorageEditionCapability no longer has parameter supportedStorageMB + - Interface StorageTierCapability no longer has parameter isBaseline + - Interface StorageTierCapability no longer has parameter tierName + - Type of parameter value of interface CapabilitiesListResult is changed from CapabilityProperties[] to FlexibleServerCapability[] + - Enum KnownIdentityType no longer has value SystemAssigned + ## 8.0.0-beta.3 (2023-10-16) diff --git a/sdk/postgresql/arm-postgresql-flexible/_meta.json b/sdk/postgresql/arm-postgresql-flexible/_meta.json index abd2b1876818..90fa37a2fdb1 100644 --- a/sdk/postgresql/arm-postgresql-flexible/_meta.json +++ b/sdk/postgresql/arm-postgresql-flexible/_meta.json @@ -1,8 +1,8 @@ { - "commit": "9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0", + "commit": "4a361fccb94e82da94a239d3563f1e3e3b9d007d", "readme": "specification/postgresql/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --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\\postgresql\\resource-manager\\readme.md --use=@autorest/typescript@6.0.9 --generate-sample=true --tag=package-flexibleserver-2023-03-01-preview --typescript", + "autorest_command": "autorest --version=3.9.7 --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\\postgresql\\resource-manager\\readme.md --use=@autorest/typescript@6.0.12 --generate-sample=true --tag=package-flexibleserver-2023-06-01-preview --typescript", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.9" + "use": "@autorest/typescript@6.0.12" } \ No newline at end of file diff --git a/sdk/postgresql/arm-postgresql-flexible/assets.json b/sdk/postgresql/arm-postgresql-flexible/assets.json index 6d30a2025a68..412ba0884195 100644 --- a/sdk/postgresql/arm-postgresql-flexible/assets.json +++ b/sdk/postgresql/arm-postgresql-flexible/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/postgresql/arm-postgresql-flexible", - "Tag": "js/postgresql/arm-postgresql-flexible_aa9ebe037d" + "Tag": "js/postgresql/arm-postgresql-flexible_3295fd853f" } diff --git a/sdk/postgresql/arm-postgresql-flexible/package.json b/sdk/postgresql/arm-postgresql-flexible/package.json index 7fe2a6a6c066..dbea805337dc 100644 --- a/sdk/postgresql/arm-postgresql-flexible/package.json +++ b/sdk/postgresql/arm-postgresql-flexible/package.json @@ -34,16 +34,18 @@ "uglify-js": "^3.4.9", "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "ts-node": "^10.0.0", - "@azure/dev-tool": "^1.0.0" + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -114,4 +116,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/postgresql/arm-postgresql-flexible/review/arm-postgresql-flexible.api.md b/sdk/postgresql/arm-postgresql-flexible/review/arm-postgresql-flexible.api.md index 612869299c80..7320ee09cc52 100644 --- a/sdk/postgresql/arm-postgresql-flexible/review/arm-postgresql-flexible.api.md +++ b/sdk/postgresql/arm-postgresql-flexible/review/arm-postgresql-flexible.api.md @@ -415,6 +415,34 @@ export interface DataEncryption { type?: ArmServerKeyType; } +// @public +export interface DbLevelValidationStatus { + databaseName?: string; + endedOn?: Date; + startedOn?: Date; + summary?: ValidationSummaryItem[]; +} + +// @public +export interface DbMigrationStatus { + appliedChanges?: number; + cdcDeleteCounter?: number; + cdcInsertCounter?: number; + cdcUpdateCounter?: number; + databaseName?: string; + endedOn?: Date; + fullLoadCompletedTables?: number; + fullLoadErroredTables?: number; + fullLoadLoadingTables?: number; + fullLoadQueuedTables?: number; + incomingChanges?: number; + latency?: number; + message?: string; + migrationOperation?: string; + migrationState?: MigrationDbState; + startedOn?: Date; +} + // @public export interface DbServerMetadata { readonly location?: string; @@ -787,6 +815,16 @@ export enum KnownLogicalReplicationOnSourceDbEnum { True = "True" } +// @public +export enum KnownMigrationDbState { + Canceled = "Canceled", + Canceling = "Canceling", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded", + WaitingForCutoverTrigger = "WaitingForCutoverTrigger" +} + // @public export enum KnownMigrationDetailsLevel { Default = "Default", @@ -812,21 +850,32 @@ export enum KnownMigrationNameAvailabilityReason { Invalid = "Invalid" } +// @public +export enum KnownMigrationOption { + Migrate = "Migrate", + Validate = "Validate", + ValidateAndMigrate = "ValidateAndMigrate" +} + // @public export enum KnownMigrationState { Canceled = "Canceled", + CleaningUp = "CleaningUp", Failed = "Failed", InProgress = "InProgress", Succeeded = "Succeeded", + ValidationFailed = "ValidationFailed", WaitingForUserAction = "WaitingForUserAction" } // @public export enum KnownMigrationSubState { + CancelingRequestedDBMigrations = "CancelingRequestedDBMigrations", Completed = "Completed", CompletingMigration = "CompletingMigration", MigratingData = "MigratingData", PerformingPreRequisiteSteps = "PerformingPreRequisiteSteps", + ValidationInProgress = "ValidationInProgress", WaitingForCutoverTrigger = "WaitingForCutoverTrigger", WaitingForDataMigrationScheduling = "WaitingForDataMigrationScheduling", WaitingForDataMigrationWindow = "WaitingForDataMigrationWindow", @@ -873,6 +922,33 @@ export enum KnownPrincipalType { User = "User" } +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownReadReplicaPromoteMode { + Standalone = "standalone", + Switchover = "switchover" +} + +// @public +export enum KnownReplicationPromoteOption { + Forced = "forced", + Planned = "planned" +} + // @public export enum KnownReplicationRole { AsyncReplica = "AsyncReplica", @@ -881,6 +957,16 @@ export enum KnownReplicationRole { Primary = "Primary" } +// @public +export enum KnownReplicationState { + Active = "Active", + Broken = "Broken", + Catchup = "Catchup", + Provisioning = "Provisioning", + Reconfiguring = "Reconfiguring", + Updating = "Updating" +} + // @public export enum KnownRestrictedEnum { Disabled = "Disabled", @@ -919,6 +1005,7 @@ export enum KnownServerVersion { Eleven = "11", Fifteen = "15", Fourteen = "14", + Sixteen = "16", Thirteen = "13", Twelve = "12" } @@ -930,6 +1017,23 @@ export enum KnownSkuTier { MemoryOptimized = "MemoryOptimized" } +// @public +export enum KnownSourceType { + AWS = "AWS", + AzureVM = "AzureVM", + GCP = "GCP", + OnPremises = "OnPremises", + PostgreSQLSingleServer = "PostgreSQLSingleServer" +} + +// @public +export enum KnownSslMode { + Prefer = "Prefer", + Require = "Require", + VerifyCA = "VerifyCA", + VerifyFull = "VerifyFull" +} + // @public export enum KnownStartDataMigrationEnum { False = "False", @@ -948,12 +1052,35 @@ export enum KnownStorageAutoGrowthSupportedEnum { Enabled = "Enabled" } +// @public +export enum KnownStorageType { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS" +} + +// @public +export enum KnownThreatProtectionName { + Default = "Default" +} + // @public export enum KnownTriggerCutoverEnum { False = "False", True = "True" } +// @public +export enum KnownValidationState { + Failed = "Failed", + Succeeded = "Succeeded", + Warning = "Warning" +} + +// @public +export enum KnownVirtualEndpointType { + ReadWrite = "ReadWrite" +} + // @public export enum KnownZoneRedundantHaAndGeoBackupSupportedEnum { Disabled = "Disabled", @@ -1105,6 +1232,9 @@ export interface MaintenanceWindow { startMinute?: number; } +// @public +export type MigrationDbState = string; + // @public export type MigrationDetailsLevel = string; @@ -1126,6 +1256,9 @@ export interface MigrationNameAvailabilityResource { type: string; } +// @public +export type MigrationOption = string; + // @public export interface MigrationResource extends TrackedResource { cancel?: CancelEnum; @@ -1135,6 +1268,7 @@ export interface MigrationResource extends TrackedResource { dbsToTriggerCutoverOn?: string[]; readonly migrationId?: string; migrationMode?: MigrationMode; + migrationOption?: MigrationOption; migrationWindowEndTimeInUtc?: Date; migrationWindowStartTimeInUtc?: Date; overwriteDbsInTarget?: OverwriteDbsInTargetEnum; @@ -1143,6 +1277,8 @@ export interface MigrationResource extends TrackedResource { sourceDbServerFullyQualifiedDomainName?: string; readonly sourceDbServerMetadata?: DbServerMetadata; sourceDbServerResourceId?: string; + sourceType?: SourceType; + sslMode?: SslMode; startDataMigration?: StartDataMigrationEnum; targetDbServerFullyQualifiedDomainName?: string; readonly targetDbServerMetadata?: DbServerMetadata; @@ -1242,6 +1378,10 @@ export type MigrationSubState = string; // @public export interface MigrationSubStateDetails { readonly currentSubState?: MigrationSubState; + dbDetails?: { + [propertyName: string]: DbMigrationStatus; + }; + validationDetails?: ValidationDetails; } // @public @@ -1257,11 +1397,17 @@ export interface NameAvailability extends CheckNameAvailabilityResponse { readonly type?: string; } +// @public +export interface NameProperty { + localizedValue?: string; + value?: string; +} + // @public export interface Network { delegatedSubnetResourceId?: string; privateDnsZoneArmResourceId?: string; - readonly publicNetworkAccess?: ServerPublicNetworkAccessState; + publicNetworkAccess?: ServerPublicNetworkAccessState; } // @public @@ -1354,14 +1500,26 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service // (undocumented) operations: Operations; // (undocumented) + privateEndpointConnectionOperations: PrivateEndpointConnectionOperations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + quotaUsages: QuotaUsages; + // (undocumented) replicas: Replicas; // (undocumented) serverCapabilities: ServerCapabilities; // (undocumented) servers: Servers; // (undocumented) + serverThreatProtectionSettings: ServerThreatProtectionSettings; + // (undocumented) subscriptionId?: string; // (undocumented) + virtualEndpoints: VirtualEndpoints; + // (undocumented) virtualNetworkSubnetUsage: VirtualNetworkSubnetUsage; } @@ -1375,10 +1533,193 @@ export interface PostgreSQLManagementFlexibleServerClientOptionalParams extends // @public export type PrincipalType = string; +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends Resource { + readonly groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export interface PrivateEndpointConnectionDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface PrivateEndpointConnectionDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionDeleteHeaders; + +// @public +export interface PrivateEndpointConnectionListResult { + readonly nextLink?: string; + readonly value?: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnectionOperations { + beginDelete(resourceGroupName: string, serverName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise, PrivateEndpointConnectionDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, serverName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, serverName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise, PrivateEndpointConnectionUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, serverName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnections { + get(resourceGroupName: string, serverName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByServer(resourceGroupName: string, serverName: string, options?: PrivateEndpointConnectionsListByServerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByServerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByServerNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListByServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByServerResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface PrivateEndpointConnectionUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionUpdateResponse = PrivateEndpointConnection; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends Resource { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + readonly value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, serverName: string, groupName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + listByServer(resourceGroupName: string, serverName: string, options?: PrivateLinkResourcesListByServerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListByServerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByServerNextResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkResourcesListByServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByServerResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + // @public export interface ProxyResource extends Resource { } +// @public +export interface QuotaUsage { + currentValue?: number; + id?: string; + limit?: number; + name?: NameProperty; + unit?: string; +} + +// @public +export interface QuotaUsages { + list(locationName: string, options?: QuotaUsagesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface QuotaUsagesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type QuotaUsagesListNextResponse = QuotaUsagesListResult; + +// @public +export interface QuotaUsagesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type QuotaUsagesListResponse = QuotaUsagesListResult; + +// @public +export interface QuotaUsagesListResult { + readonly nextLink?: string; + readonly value?: QuotaUsage[]; +} + +// @public +export type ReadReplicaPromoteMode = string; + +// @public +export interface Replica { + readonly capacity?: number; + promoteMode?: ReadReplicaPromoteMode; + promoteOption?: ReplicationPromoteOption; + readonly replicationState?: ReplicationState; + role?: ReplicationRole; +} + // @public export interface Replicas { listByServer(resourceGroupName: string, serverName: string, options?: ReplicasListByServerOptionalParams): PagedAsyncIterableIterator; @@ -1391,9 +1732,15 @@ export interface ReplicasListByServerOptionalParams extends coreClient.Operation // @public export type ReplicasListByServerResponse = ServerListResult; +// @public +export type ReplicationPromoteOption = string; + // @public export type ReplicationRole = string; +// @public +export type ReplicationState = string; + // @public export interface Resource { readonly id?: string; @@ -1427,6 +1774,8 @@ export interface Server extends TrackedResource { readonly minorVersion?: string; network?: Network; pointInTimeUTC?: Date; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + replica?: Replica; readonly replicaCapacity?: number; replicationRole?: ReplicationRole; sku?: Sku; @@ -1479,6 +1828,7 @@ export interface ServerForUpdate { identity?: UserAssignedIdentity; maintenanceWindow?: MaintenanceWindow; network?: Network; + replica?: Replica; replicationRole?: ReplicationRole; sku?: Sku; storage?: Storage_2; @@ -1555,8 +1905,8 @@ export type ServersGetResponse = Server; // @public export interface ServerSku { - name: string; - tier: SkuTier; + name?: string; + tier?: SkuTier; } // @public @@ -1652,6 +2002,56 @@ export interface ServersUpdateOptionalParams extends coreClient.OperationOptions // @public export type ServersUpdateResponse = Server; +// @public +export interface ServerThreatProtectionListResult { + readonly nextLink?: string; + readonly value?: ServerThreatProtectionSettingsModel[]; +} + +// @public +export interface ServerThreatProtectionSettings { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, threatProtectionName: ThreatProtectionName, parameters: ServerThreatProtectionSettingsModel, options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams): Promise, ServerThreatProtectionSettingsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, serverName: string, threatProtectionName: ThreatProtectionName, parameters: ServerThreatProtectionSettingsModel, options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, serverName: string, threatProtectionName: ThreatProtectionName, options?: ServerThreatProtectionSettingsGetOptionalParams): Promise; + listByServer(resourceGroupName: string, serverName: string, options?: ServerThreatProtectionSettingsListByServerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServerThreatProtectionSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServerThreatProtectionSettingsCreateOrUpdateResponse = ServerThreatProtectionSettingsModel; + +// @public +export interface ServerThreatProtectionSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServerThreatProtectionSettingsGetResponse = ServerThreatProtectionSettingsModel; + +// @public +export interface ServerThreatProtectionSettingsListByServerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServerThreatProtectionSettingsListByServerNextResponse = ServerThreatProtectionListResult; + +// @public +export interface ServerThreatProtectionSettingsListByServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServerThreatProtectionSettingsListByServerResponse = ServerThreatProtectionListResult; + +// @public +export interface ServerThreatProtectionSettingsModel extends ProxyResource { + readonly creationTime?: Date; + state?: ThreatProtectionState; +} + // @public export type ServerVersion = string; @@ -1670,15 +2070,23 @@ export interface Sku { // @public export type SkuTier = string; +// @public +export type SourceType = string; + +// @public +export type SslMode = string; + // @public export type StartDataMigrationEnum = string; // @public interface Storage_2 { autoGrow?: StorageAutoGrow; - readonly iops?: number; + iops?: number; storageSizeGB?: number; + throughput?: number; tier?: AzureManagedDiskPerformanceTiers; + type?: StorageType; } export { Storage_2 as Storage } @@ -1698,9 +2106,13 @@ export interface StorageEditionCapability extends CapabilityBase { // @public export interface StorageMbCapability extends CapabilityBase { readonly defaultIopsTier?: string; + readonly maximumStorageSizeMb?: number; readonly storageSizeMb?: number; readonly supportedIops?: number; readonly supportedIopsTiers?: StorageTierCapability[]; + readonly supportedMaximumIops?: number; + readonly supportedMaximumThroughput?: number; + readonly supportedThroughput?: number; } // @public @@ -1709,6 +2121,9 @@ export interface StorageTierCapability extends CapabilityBase { readonly name?: string; } +// @public +export type StorageType = string; + // @public export interface SystemData { createdAt?: Date; @@ -1719,6 +2134,12 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } +// @public +export type ThreatProtectionName = string; + +// @public +export type ThreatProtectionState = "Enabled" | "Disabled"; + // @public export interface TrackedResource extends Resource { location: string; @@ -1745,6 +2166,129 @@ export interface UserIdentity { principalId?: string; } +// @public +export interface ValidationDetails { + dbLevelValidationDetails?: DbLevelValidationStatus[]; + serverLevelValidationDetails?: ValidationSummaryItem[]; + status?: ValidationState; + validationEndTimeInUtc?: Date; + validationStartTimeInUtc?: Date; +} + +// @public +export interface ValidationMessage { + message?: string; + state?: ValidationState; +} + +// @public +export type ValidationState = string; + +// @public +export interface ValidationSummaryItem { + messages?: ValidationMessage[]; + state?: ValidationState; + type?: string; +} + +// @public +export interface VirtualEndpointResource extends VirtualEndpointResourceForPatch, Resource { +} + +// @public +export interface VirtualEndpointResourceForPatch { + endpointType?: VirtualEndpointType; + members?: string[]; + readonly virtualEndpoints?: string[]; +} + +// @public +export interface VirtualEndpoints { + beginCreate(resourceGroupName: string, serverName: string, virtualEndpointName: string, parameters: VirtualEndpointResource, options?: VirtualEndpointsCreateOptionalParams): Promise, VirtualEndpointsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, serverName: string, virtualEndpointName: string, parameters: VirtualEndpointResource, options?: VirtualEndpointsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, serverName: string, virtualEndpointName: string, options?: VirtualEndpointsDeleteOptionalParams): Promise, VirtualEndpointsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, serverName: string, virtualEndpointName: string, options?: VirtualEndpointsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, serverName: string, virtualEndpointName: string, parameters: VirtualEndpointResourceForPatch, options?: VirtualEndpointsUpdateOptionalParams): Promise, VirtualEndpointsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, serverName: string, virtualEndpointName: string, parameters: VirtualEndpointResourceForPatch, options?: VirtualEndpointsUpdateOptionalParams): Promise; + get(resourceGroupName: string, serverName: string, virtualEndpointName: string, options?: VirtualEndpointsGetOptionalParams): Promise; + listByServer(resourceGroupName: string, serverName: string, options?: VirtualEndpointsListByServerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualEndpointsCreateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface VirtualEndpointsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualEndpointsCreateResponse = VirtualEndpointResource; + +// @public +export interface VirtualEndpointsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface VirtualEndpointsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualEndpointsDeleteResponse = VirtualEndpointsDeleteHeaders; + +// @public +export interface VirtualEndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualEndpointsGetResponse = VirtualEndpointResource; + +// @public +export interface VirtualEndpointsListByServerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualEndpointsListByServerNextResponse = VirtualEndpointsListResult; + +// @public +export interface VirtualEndpointsListByServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualEndpointsListByServerResponse = VirtualEndpointsListResult; + +// @public +export interface VirtualEndpointsListResult { + nextLink?: string; + value?: VirtualEndpointResource[]; +} + +// @public +export interface VirtualEndpointsUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface VirtualEndpointsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualEndpointsUpdateResponse = VirtualEndpointResource; + +// @public +export type VirtualEndpointType = string; + // @public export interface VirtualNetworkSubnetUsage { execute(locationName: string, parameters: VirtualNetworkSubnetUsageParameter, options?: VirtualNetworkSubnetUsageExecuteOptionalParams): Promise; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsCreateSample.ts index f0d209eec710..17b6e9359049 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorAdd.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json */ async function addsAnActiveDIrectoryAdministratorForTheServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsDeleteSample.ts index 59fcbbce55ae..77f74b346d43 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes an Active Directory Administrator associated with the server. * * @summary Deletes an Active Directory Administrator associated with the server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json */ async function administratorDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsGetSample.ts index c8accf266c9f..1d4026a4e098 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json */ async function serverGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsListByServerSample.ts index 3b338a4ce751..f3d7dfe4459a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/administratorsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the AAD administrators for a given server. * * @summary List all the AAD administrators for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorsListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json */ async function administratorsListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsGetSample.ts index c5ed04d44d77..76c6093d3bc4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get specific backup for a given server. * * @summary Get specific backup for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json */ async function getABackupForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsListByServerSample.ts index 10ef056b13cc..5e9f7b17c4e3 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/backupsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the backups for a given server. * * @summary List all the backups for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json */ async function listBackupsForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkMigrationNameAvailabilitySample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkMigrationNameAvailabilitySample.ts index de45f3e65d18..f12c6de4c41e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkMigrationNameAvailabilitySample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkMigrationNameAvailabilitySample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to This method checks whether a proposed migration name is valid and available. * * @summary This method checks whether a proposed migration name is valid and available. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckMigrationNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json */ async function checkMigrationNameAvailability() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityExecuteSample.ts index f4b6a40749cb..7d416ae0c368 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityWithLocationExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityWithLocationExecuteSample.ts index 87aa1fe7a1ff..0e7ffc1c43b9 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityWithLocationExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/checkNameAvailabilityWithLocationExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsGetSample.ts index 87113ece4058..8d1183d0c28b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a configuration of server. * * @summary Gets information about a configuration of server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json */ async function configurationGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsListByServerSample.ts index 8411947e8464..1654bacf4326 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the configurations in a given server. * * @summary List all the configurations in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json */ async function configurationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsPutSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsPutSample.ts index de3013e89253..392b0659b90e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsPutSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsPutSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsUpdateSample.ts index e7cf79673eae..30228baf54fc 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/configurationsUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesCreateSample.ts index b51869d56cd9..d5d77ef38da7 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new database or updates an existing database. * * @summary Creates a new database or updates an existing database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json */ async function createADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesDeleteSample.ts index 24267dce8f56..8f5635b2baf2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a database. * * @summary Deletes a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json */ async function deleteADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesGetSample.ts index 793fc535ac1a..f8ac2cfcef57 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a database. * * @summary Gets information about a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json */ async function getADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesListByServerSample.ts index df09350eb7c4..fe80d2643405 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/databasesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the databases in a given server. * * @summary List all the databases in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ async function listDatabasesInAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesCreateOrUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesCreateOrUpdateSample.ts index c3e4c348f1d5..6cff0b905a85 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesCreateOrUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesCreateOrUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new firewall rule or updates an existing firewall rule. * * @summary Creates a new firewall rule or updates an existing firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ async function firewallRuleCreate() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesDeleteSample.ts index 1a0f717b559e..6cbc3e1f2815 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a PostgreSQL server firewall rule. * * @summary Deletes a PostgreSQL server firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ async function firewallRuleDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesGetSample.ts index 959e567baf94..85bc935a6cac 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the firewall rules in a given server. * * @summary List all the firewall rules in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesListByServerSample.ts index cf5c9847794c..311230fe537c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/firewallRulesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the firewall rules in a given PostgreSQL server. * * @summary List all the firewall rules in a given PostgreSQL server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerStartLtrBackupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerStartLtrBackupSample.ts index 951cb0b34281..81489406abc2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerStartLtrBackupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerStartLtrBackupSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Start the Long Term Retention Backup operation * * @summary Start the Long Term Retention Backup operation - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json */ async function sampleExecuteBackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerTriggerLtrPreBackupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerTriggerLtrPreBackupSample.ts index 5319034fa2e8..dd78be4c0e37 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerTriggerLtrPreBackupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/flexibleServerTriggerLtrPreBackupSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. * * @summary PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionPreBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json */ async function samplePrebackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/getPrivateDnsZoneSuffixExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/getPrivateDnsZoneSuffixExecuteSample.ts index 104792acd2c6..cedd6fc24a92 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/getPrivateDnsZoneSuffixExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/getPrivateDnsZoneSuffixExecuteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get private DNS zone suffix in the cloud * * @summary Get private DNS zone suffix in the cloud - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json */ async function getPrivateDnsZoneSuffix() { const credential = new DefaultAzureCredential(); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/locationBasedCapabilitiesExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/locationBasedCapabilitiesExecuteSample.ts index 91f5f32f0d59..6ef42758f83b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/locationBasedCapabilitiesExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/locationBasedCapabilitiesExecuteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get capabilities at specified location in a given subscription. * * @summary Get capabilities at specified location in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CapabilitiesByLocation.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json */ async function capabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/logFilesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/logFilesListByServerSample.ts index 3e8fcef12db1..a59a5c2b92c2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/logFilesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/logFilesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the server log files in a given server. * * @summary List all the server log files in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json */ async function listAllServerLogFilesForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsGetSample.ts index 37f11acefa58..e562c6585ba4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the result of the give long term retention backup operation for the flexible server. * * @summary Gets the result of the give long term retention backup operation for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json */ async function sample() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsListByServerSample.ts index b325fe4aef94..43f8106ca02a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/ltrBackupOperationsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the result of the give long term retention backup operations for the flexible server. * * @summary Gets the result of the give long term retention backup operations for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json */ async function sampleListOfLongTernRetentionOperationsByFlexibleServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsCreateSample.ts index 4823fb9b0a02..e550046461a1 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsCreateSample.ts @@ -21,7 +21,86 @@ dotenv.config(); * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create_With_Other_Users.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + */ +async function createMigrationWithOtherSourceTypesForValidateAndMigrate() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters: MigrationResource = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "ValidateAndMigrate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx" + } + }, + sourceDbServerResourceId: "testsource:5432@pguser", + sourceType: "OnPremises", + sslMode: "Prefer" + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json + */ +async function createPreMigrationValidation() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters: MigrationResource = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "Validate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx" + } + }, + sourceDbServerResourceId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource" + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json */ async function migrationsCreateByPassingUserNames() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -60,7 +139,7 @@ async function migrationsCreateByPassingUserNames() { * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json */ async function migrationsCreate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -95,6 +174,8 @@ async function migrationsCreate() { } async function main() { + createMigrationWithOtherSourceTypesForValidateAndMigrate(); + createPreMigrationValidation(); migrationsCreateByPassingUserNames(); migrationsCreate(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsDeleteSample.ts index 84eb12b0a61d..8d2280e52492 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a migration. * * @summary Deletes a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Delete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json */ async function migrationsDelete() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsGetSample.ts index b4f7213297ef..92027b1f1d92 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets details of a migration. * * @summary Gets details of a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Get.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json */ async function migrationsGet() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -37,8 +37,105 @@ async function migrationsGet() { console.log(result); } +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ +async function migrationsGetMigrationWithSuccessfulValidationAndMigration() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationandmigration"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ +async function migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = + "testmigrationwithsuccessfulvalidationbutmigrationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + */ +async function migrationsGetMigrationWithSuccessfulValidationOnly() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationonly"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + */ +async function migrationsGetMigrationWithValidationFailures() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithvalidationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + async function main() { migrationsGet(); + migrationsGetMigrationWithSuccessfulValidationAndMigration(); + migrationsGetMigrationWithSuccessfulValidationButMigrationFailure(); + migrationsGetMigrationWithSuccessfulValidationOnly(); + migrationsGetMigrationWithValidationFailures(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsListByTargetServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsListByTargetServerSample.ts index c16d8ec82437..3033c2762c70 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsListByTargetServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsListByTargetServerSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to List all the migrations on a given target server. * * @summary List all the migrations on a given target server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_ListByTargetServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json */ async function migrationsListByTargetServer() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsUpdateSample.ts index 4a018b046d0e..24812f752f8b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/migrationsUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Cancel.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json */ async function cancelMigration() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -46,7 +46,7 @@ async function cancelMigration() { * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Update.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json */ async function migrationsUpdate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/operationsListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/operationsListSample.ts index c8353cf959cf..d13f521bbdfd 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/operationsListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/operationsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Lists all of the available REST API operations. * * @summary Lists all of the available REST API operations. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/OperationList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json */ async function operationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionDeleteSample.ts new file mode 100644 index 000000000000..c3f021fe4f22 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionDeleteSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a private endpoint connection with a given name. + * + * @summary Deletes a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json + */ +async function deletesAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnectionOperations.beginDeleteAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + deletesAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionUpdateSample.ts new file mode 100644 index 000000000000..2e00f0a5b6a9 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateEndpointConnection, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. + * + * @summary Approve or reject a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ +async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { + description: "Approved by johndoe@contoso.com", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnectionOperations.beginUpdateAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +async function main() { + approveOrRejectAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..4417f57d6375 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a private endpoint connection. + * + * @summary Gets a private endpoint connection. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json + */ +async function getsPrivateEndpointConnection() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + getsPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsListByServerSample.ts new file mode 100644 index 000000000000..d32a2a337faa --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateEndpointConnectionsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets all private endpoint connections on a server. + * + * @summary Gets all private endpoint connections on a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json + */ +async function getsListOfPrivateEndpointConnectionsOnAServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsListOfPrivateEndpointConnectionsOnAServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesGetSample.ts new file mode 100644 index 000000000000..bec70ac8e637 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a private link resource for PostgreSQL server. + * + * @summary Gets a private link resource for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json + */ +async function getsAPrivateLinkResourceForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const groupName = "plr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateLinkResources.get( + resourceGroupName, + serverName, + groupName + ); + console.log(result); +} + +async function main() { + getsAPrivateLinkResourceForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesListByServerSample.ts new file mode 100644 index 000000000000..0dbadd9ec000 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/privateLinkResourcesListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the private link resources for PostgreSQL server. + * + * @summary Gets the private link resources for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json + */ +async function getsPrivateLinkResourcesForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.privateLinkResources.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsPrivateLinkResourcesForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/quotaUsagesListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/quotaUsagesListSample.ts new file mode 100644 index 000000000000..e4a7bbb2dcca --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/quotaUsagesListSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get quota usages at specified location in a given subscription. + * + * @summary Get quota usages at specified location in a given subscription. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json + */ +async function listOfQuotaUsagesForFlexibleServers() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const locationName = "westus"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.quotaUsages.list(locationName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listOfQuotaUsagesForFlexibleServers(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/replicasListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/replicasListByServerSample.ts index 3009218ef93b..cda25734992c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/replicasListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/replicasListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the replicas for a given server. * * @summary List all the replicas for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json */ async function replicasListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverCapabilitiesListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverCapabilitiesListSample.ts index cce2f02964f4..9675c2b48315 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverCapabilitiesListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverCapabilitiesListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get capabilities for a flexible server. * * @summary Get capabilities for a flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCapabilities.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json */ async function serverCapabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsCreateOrUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..bcf0ca8405d0 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServerThreatProtectionSettingsModel, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a server's Advanced Threat Protection settings. + * + * @summary Creates or updates a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json + */ +async function updateAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-4799"; + const serverName = "threatprotection-6440"; + const threatProtectionName = "Default"; + const parameters: ServerThreatProtectionSettingsModel = { state: "Enabled" }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.serverThreatProtectionSettings.beginCreateOrUpdateAndWait( + resourceGroupName, + serverName, + threatProtectionName, + parameters + ); + console.log(result); +} + +async function main() { + updateAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsGetSample.ts new file mode 100644 index 000000000000..ff1b6096aecd --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a server's Advanced Threat Protection settings. + * + * @summary Get a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json + */ +async function getAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const threatProtectionName = "Default"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.serverThreatProtectionSettings.get( + resourceGroupName, + serverName, + threatProtectionName + ); + console.log(result); +} + +async function main() { + getAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsListByServerSample.ts new file mode 100644 index 000000000000..7f57277c8707 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serverThreatProtectionSettingsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of server's Threat Protection state. + * + * @summary Get a list of server's Threat Protection state. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + */ +async function getAServerAdvancedThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.serverThreatProtectionSettings.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getAServerAdvancedThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversCreateSample.ts index 612845920889..2532ba64e8f0 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { const subscriptionId = @@ -72,7 +72,7 @@ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json */ async function createADatabaseAsAPointInTimeRestore() { const subscriptionId = @@ -105,7 +105,7 @@ async function createADatabaseAsAPointInTimeRestore() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json */ async function createANewServer() { const subscriptionId = @@ -150,7 +150,7 @@ async function createANewServer() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json */ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { const subscriptionId = @@ -201,7 +201,7 @@ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json */ async function serverCreateReplica() { const subscriptionId = @@ -249,7 +249,7 @@ async function serverCreateReplica() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReviveDropped.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json */ async function serverCreateReviveDropped() { const subscriptionId = @@ -282,7 +282,7 @@ async function serverCreateReviveDropped() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json */ async function serverCreateWithDataEncryptionEnabled() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversDeleteSample.ts index 884539f25755..87d87d71fc7d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a server. * * @summary Deletes a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json */ async function serverDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversGetSample.ts index e0f3366554a9..414095cc673a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json */ async function serverGet() { const subscriptionId = @@ -40,7 +40,29 @@ async function serverGet() { * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json + */ +async function serverGetWithPrivateEndpoints() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc2"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.get(resourceGroupName, serverName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets information about a server. + * + * @summary Gets information about a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json */ async function serverGetWithVnet() { const subscriptionId = @@ -60,6 +82,7 @@ async function serverGetWithVnet() { async function main() { serverGet(); + serverGetWithPrivateEndpoints(); serverGetWithVnet(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListByResourceGroupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListByResourceGroupSample.ts index 35bf157f64eb..a797321a3c39 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListByResourceGroupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the servers in a given resource group. * * @summary List all the servers in a given resource group. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerListByResourceGroup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json */ async function serverListByResourceGroup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListSample.ts index 0eb399921235..f9d253359634 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the servers in a given subscription. * * @summary List all the servers in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json */ async function serverList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversRestartSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversRestartSample.ts index 67dd11623d32..a6f5faefbe00 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversRestartSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversRestartSample.ts @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json */ async function serverRestart() { const subscriptionId = @@ -47,7 +47,7 @@ async function serverRestart() { * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestartWithFailover.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json */ async function serverRestartWithFailover() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStartSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStartSample.ts index 8e00aa85f4f6..c3f8830ee47d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStartSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStartSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Starts a server. * * @summary Starts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json */ async function serverStart() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStopSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStopSample.ts index c7c5b31fb6be..1d3cab6f2adb 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStopSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversStopSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Stops a server. * * @summary Stops a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStop.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json */ async function serverStop() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversUpdateSample.ts index 973fa39ef17b..95664971b932 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/serversUpdateSample.ts @@ -21,7 +21,65 @@ dotenv.config(); * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "standalone", promoteOption: "forced" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "standalone", promoteOption: "planned" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json */ async function serverUpdate() { const subscriptionId = @@ -54,7 +112,7 @@ async function serverUpdate() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json */ async function serverUpdateWithAadAuthEnabled() { const subscriptionId = @@ -92,7 +150,7 @@ async function serverUpdateWithAadAuthEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ async function serverUpdateWithCustomerMaintenanceWindow() { const subscriptionId = @@ -127,7 +185,7 @@ async function serverUpdateWithCustomerMaintenanceWindow() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json */ async function serverUpdateWithDataEncryptionEnabled() { const subscriptionId = @@ -177,7 +235,7 @@ async function serverUpdateWithDataEncryptionEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json */ async function serverUpdateWithMajorVersionUpgrade() { const subscriptionId = @@ -200,12 +258,74 @@ async function serverUpdateWithMajorVersionUpgrade() { console.log(result); } +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + */ +async function switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "switchover", promoteOption: "forced" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + */ +async function switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "switchover", promoteOption: "planned" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + async function main() { + promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete(); serverUpdate(); serverUpdateWithAadAuthEnabled(); serverUpdateWithCustomerMaintenanceWindow(); serverUpdateWithDataEncryptionEnabled(); serverUpdateWithMajorVersionUpgrade(); + switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsCreateSample.ts new file mode 100644 index 000000000000..3104a34c3e65 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsCreateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualEndpointResource, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @summary Creates a new virtual endpoint for PostgreSQL flexible server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json + */ +async function createANewVirtualEndpointForAFlexibleServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters: VirtualEndpointResource = { + endpointType: "ReadWrite", + members: ["testPrimary1"] + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginCreateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + createANewVirtualEndpointForAFlexibleServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsDeleteSample.ts new file mode 100644 index 000000000000..c44730f9be1a --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsDeleteSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a virtual endpoint. + * + * @summary Deletes a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json + */ +async function deleteAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginDeleteAndWait( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + deleteAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsGetSample.ts new file mode 100644 index 000000000000..fc2bb7e012b0 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets information about a virtual endpoint. + * + * @summary Gets information about a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json + */ +async function getAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.get( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + getAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsListByServerSample.ts new file mode 100644 index 000000000000..b893668c68ea --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all the servers in a given resource group. + * + * @summary List all the servers in a given resource group. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json + */ +async function virtualEndpointListByServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualEndpoints.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + virtualEndpointListByServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsUpdateSample.ts new file mode 100644 index 000000000000..f97fe55bc029 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualEndpointsUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualEndpointResourceForPatch, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * + * @summary Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json + */ +async function updateAVirtualEndpointForAServerToUpdateThe() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters: VirtualEndpointResourceForPatch = { + endpointType: "ReadWrite", + members: ["testReplica1"] + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginUpdateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + updateAVirtualEndpointForAServerToUpdateThe(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualNetworkSubnetUsageExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualNetworkSubnetUsageExecuteSample.ts index 401449900e33..3d019320892f 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualNetworkSubnetUsageExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples-dev/virtualNetworkSubnetUsageExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Get virtual network subnet usage for a given vNet resource id. * * @summary Get virtual network subnet usage for a given vNet resource id. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json */ async function virtualNetworkSubnetUsageList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/README.md b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/README.md index 2f92ef1a7b92..9b4560a65bb8 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/README.md +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/README.md @@ -2,54 +2,69 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [administratorsCreateSample.js][administratorscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorAdd.json | -| [administratorsDeleteSample.js][administratorsdeletesample] | Deletes an Active Directory Administrator associated with the server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorDelete.json | -| [administratorsGetSample.js][administratorsgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorGet.json | -| [administratorsListByServerSample.js][administratorslistbyserversample] | List all the AAD administrators for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorsListByServer.json | -| [backupsGetSample.js][backupsgetsample] | Get specific backup for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupGet.json | -| [backupsListByServerSample.js][backupslistbyserversample] | List all the backups for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupListByServer.json | -| [checkMigrationNameAvailabilitySample.js][checkmigrationnameavailabilitysample] | This method checks whether a proposed migration name is valid and available. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckMigrationNameAvailability.json | -| [checkNameAvailabilityExecuteSample.js][checknameavailabilityexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailability.json | -| [checkNameAvailabilityWithLocationExecuteSample.js][checknameavailabilitywithlocationexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailabilityLocationBased.json | -| [configurationsGetSample.js][configurationsgetsample] | Gets information about a configuration of server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationGet.json | -| [configurationsListByServerSample.js][configurationslistbyserversample] | List all the configurations in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationListByServer.json | -| [configurationsPutSample.js][configurationsputsample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json | -| [configurationsUpdateSample.js][configurationsupdatesample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json | -| [databasesCreateSample.js][databasescreatesample] | Creates a new database or updates an existing database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseCreate.json | -| [databasesDeleteSample.js][databasesdeletesample] | Deletes a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseDelete.json | -| [databasesGetSample.js][databasesgetsample] | Gets information about a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseGet.json | -| [databasesListByServerSample.js][databaseslistbyserversample] | List all the databases in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabasesListByServer.json | -| [firewallRulesCreateOrUpdateSample.js][firewallrulescreateorupdatesample] | Creates a new firewall rule or updates an existing firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleCreate.json | -| [firewallRulesDeleteSample.js][firewallrulesdeletesample] | Deletes a PostgreSQL server firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleDelete.json | -| [firewallRulesGetSample.js][firewallrulesgetsample] | List all the firewall rules in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleGet.json | -| [firewallRulesListByServerSample.js][firewallruleslistbyserversample] | List all the firewall rules in a given PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleListByServer.json | -| [flexibleServerStartLtrBackupSample.js][flexibleserverstartltrbackupsample] | Start the Long Term Retention Backup operation x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionBackup.json | -| [flexibleServerTriggerLtrPreBackupSample.js][flexibleservertriggerltrprebackupsample] | PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionPreBackup.json | -| [getPrivateDnsZoneSuffixExecuteSample.js][getprivatednszonesuffixexecutesample] | Get private DNS zone suffix in the cloud x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/GetPrivateDnsZoneSuffix.json | -| [locationBasedCapabilitiesExecuteSample.js][locationbasedcapabilitiesexecutesample] | Get capabilities at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CapabilitiesByLocation.json | -| [logFilesListByServerSample.js][logfileslistbyserversample] | List all the server log files in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LogFilesListByServer.json | -| [ltrBackupOperationsGetSample.js][ltrbackupoperationsgetsample] | Gets the result of the give long term retention backup operation for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationGet.json | -| [ltrBackupOperationsListByServerSample.js][ltrbackupoperationslistbyserversample] | Gets the result of the give long term retention backup operations for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationListByServer.json | -| [migrationsCreateSample.js][migrationscreatesample] | Creates a new migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create_With_Other_Users.json | -| [migrationsDeleteSample.js][migrationsdeletesample] | Deletes a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Delete.json | -| [migrationsGetSample.js][migrationsgetsample] | Gets details of a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Get.json | -| [migrationsListByTargetServerSample.js][migrationslistbytargetserversample] | List all the migrations on a given target server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_ListByTargetServer.json | -| [migrationsUpdateSample.js][migrationsupdatesample] | Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Cancel.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/OperationList.json | -| [replicasListByServerSample.js][replicaslistbyserversample] | List all the replicas for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ReplicasListByServer.json | -| [serverCapabilitiesListSample.js][servercapabilitieslistsample] | Get capabilities for a flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCapabilities.json | -| [serversCreateSample.js][serverscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json | -| [serversDeleteSample.js][serversdeletesample] | Deletes a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerDelete.json | -| [serversGetSample.js][serversgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGet.json | -| [serversListByResourceGroupSample.js][serverslistbyresourcegroupsample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerListByResourceGroup.json | -| [serversListSample.js][serverslistsample] | List all the servers in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerList.json | -| [serversRestartSample.js][serversrestartsample] | Restarts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestart.json | -| [serversStartSample.js][serversstartsample] | Starts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStart.json | -| [serversStopSample.js][serversstopsample] | Stops a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStop.json | -| [serversUpdateSample.js][serversupdatesample] | Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdate.json | -| [virtualNetworkSubnetUsageExecuteSample.js][virtualnetworksubnetusageexecutesample] | Get virtual network subnet usage for a given vNet resource id. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/VirtualNetworkSubnetUsage.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [administratorsCreateSample.js][administratorscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json | +| [administratorsDeleteSample.js][administratorsdeletesample] | Deletes an Active Directory Administrator associated with the server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json | +| [administratorsGetSample.js][administratorsgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json | +| [administratorsListByServerSample.js][administratorslistbyserversample] | List all the AAD administrators for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json | +| [backupsGetSample.js][backupsgetsample] | Get specific backup for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json | +| [backupsListByServerSample.js][backupslistbyserversample] | List all the backups for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json | +| [checkMigrationNameAvailabilitySample.js][checkmigrationnameavailabilitysample] | This method checks whether a proposed migration name is valid and available. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json | +| [checkNameAvailabilityExecuteSample.js][checknameavailabilityexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json | +| [checkNameAvailabilityWithLocationExecuteSample.js][checknameavailabilitywithlocationexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json | +| [configurationsGetSample.js][configurationsgetsample] | Gets information about a configuration of server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json | +| [configurationsListByServerSample.js][configurationslistbyserversample] | List all the configurations in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json | +| [configurationsPutSample.js][configurationsputsample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json | +| [configurationsUpdateSample.js][configurationsupdatesample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json | +| [databasesCreateSample.js][databasescreatesample] | Creates a new database or updates an existing database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json | +| [databasesDeleteSample.js][databasesdeletesample] | Deletes a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json | +| [databasesGetSample.js][databasesgetsample] | Gets information about a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json | +| [databasesListByServerSample.js][databaseslistbyserversample] | List all the databases in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json | +| [firewallRulesCreateOrUpdateSample.js][firewallrulescreateorupdatesample] | Creates a new firewall rule or updates an existing firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json | +| [firewallRulesDeleteSample.js][firewallrulesdeletesample] | Deletes a PostgreSQL server firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json | +| [firewallRulesGetSample.js][firewallrulesgetsample] | List all the firewall rules in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json | +| [firewallRulesListByServerSample.js][firewallruleslistbyserversample] | List all the firewall rules in a given PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json | +| [flexibleServerStartLtrBackupSample.js][flexibleserverstartltrbackupsample] | Start the Long Term Retention Backup operation x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json | +| [flexibleServerTriggerLtrPreBackupSample.js][flexibleservertriggerltrprebackupsample] | PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json | +| [getPrivateDnsZoneSuffixExecuteSample.js][getprivatednszonesuffixexecutesample] | Get private DNS zone suffix in the cloud x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json | +| [locationBasedCapabilitiesExecuteSample.js][locationbasedcapabilitiesexecutesample] | Get capabilities at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json | +| [logFilesListByServerSample.js][logfileslistbyserversample] | List all the server log files in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json | +| [ltrBackupOperationsGetSample.js][ltrbackupoperationsgetsample] | Gets the result of the give long term retention backup operation for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json | +| [ltrBackupOperationsListByServerSample.js][ltrbackupoperationslistbyserversample] | Gets the result of the give long term retention backup operations for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json | +| [migrationsCreateSample.js][migrationscreatesample] | Creates a new migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json | +| [migrationsDeleteSample.js][migrationsdeletesample] | Deletes a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json | +| [migrationsGetSample.js][migrationsgetsample] | Gets details of a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json | +| [migrationsListByTargetServerSample.js][migrationslistbytargetserversample] | List all the migrations on a given target server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json | +| [migrationsUpdateSample.js][migrationsupdatesample] | Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json | +| [privateEndpointConnectionDeleteSample.js][privateendpointconnectiondeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionUpdateSample.js][privateendpointconnectionupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListByServerSample.js][privateendpointconnectionslistbyserversample] | Gets all private endpoint connections on a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json | +| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Gets a private link resource for PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json | +| [privateLinkResourcesListByServerSample.js][privatelinkresourceslistbyserversample] | Gets the private link resources for PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json | +| [quotaUsagesListSample.js][quotausageslistsample] | Get quota usages at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json | +| [replicasListByServerSample.js][replicaslistbyserversample] | List all the replicas for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json | +| [serverCapabilitiesListSample.js][servercapabilitieslistsample] | Get capabilities for a flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json | +| [serverThreatProtectionSettingsCreateOrUpdateSample.js][serverthreatprotectionsettingscreateorupdatesample] | Creates or updates a server's Advanced Threat Protection settings. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json | +| [serverThreatProtectionSettingsGetSample.js][serverthreatprotectionsettingsgetsample] | Get a server's Advanced Threat Protection settings. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json | +| [serverThreatProtectionSettingsListByServerSample.js][serverthreatprotectionsettingslistbyserversample] | Get a list of server's Threat Protection state. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json | +| [serversCreateSample.js][serverscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json | +| [serversDeleteSample.js][serversdeletesample] | Deletes a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json | +| [serversGetSample.js][serversgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json | +| [serversListByResourceGroupSample.js][serverslistbyresourcegroupsample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json | +| [serversListSample.js][serverslistsample] | List all the servers in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json | +| [serversRestartSample.js][serversrestartsample] | Restarts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json | +| [serversStartSample.js][serversstartsample] | Starts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json | +| [serversStopSample.js][serversstopsample] | Stops a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json | +| [serversUpdateSample.js][serversupdatesample] | Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json | +| [virtualEndpointsCreateSample.js][virtualendpointscreatesample] | Creates a new virtual endpoint for PostgreSQL flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json | +| [virtualEndpointsDeleteSample.js][virtualendpointsdeletesample] | Deletes a virtual endpoint. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json | +| [virtualEndpointsGetSample.js][virtualendpointsgetsample] | Gets information about a virtual endpoint. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json | +| [virtualEndpointsListByServerSample.js][virtualendpointslistbyserversample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json | +| [virtualEndpointsUpdateSample.js][virtualendpointsupdatesample] | Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json | +| [virtualNetworkSubnetUsageExecuteSample.js][virtualnetworksubnetusageexecutesample] | Get virtual network subnet usage for a given vNet resource id. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json | ## Prerequisites @@ -123,8 +138,18 @@ Take a look at our [API Documentation][apiref] for more information about the AP [migrationslistbytargetserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsListByTargetServerSample.js [migrationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsUpdateSample.js [operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/operationsListSample.js +[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionDeleteSample.js +[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionUpdateSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsListByServerSample.js +[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesGetSample.js +[privatelinkresourceslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesListByServerSample.js +[quotausageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/quotaUsagesListSample.js [replicaslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/replicasListByServerSample.js [servercapabilitieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverCapabilitiesListSample.js +[serverthreatprotectionsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsCreateOrUpdateSample.js +[serverthreatprotectionsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsGetSample.js +[serverthreatprotectionsettingslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsListByServerSample.js [serverscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversCreateSample.js [serversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversDeleteSample.js [serversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversGetSample.js @@ -134,6 +159,11 @@ Take a look at our [API Documentation][apiref] for more information about the AP [serversstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStartSample.js [serversstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStopSample.js [serversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversUpdateSample.js +[virtualendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsCreateSample.js +[virtualendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsDeleteSample.js +[virtualendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsGetSample.js +[virtualendpointslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsListByServerSample.js +[virtualendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsUpdateSample.js [virtualnetworksubnetusageexecutesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualNetworkSubnetUsageExecuteSample.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsCreateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsCreateSample.js index 7cf0ed0e2063..0c571e67de23 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsCreateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsCreateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorAdd.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json */ async function addsAnActiveDIrectoryAdministratorForTheServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsDeleteSample.js index 5e176c5b7fc6..3312dd913669 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsDeleteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes an Active Directory Administrator associated with the server. * * @summary Deletes an Active Directory Administrator associated with the server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json */ async function administratorDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsGetSample.js index 1ea9e9bdfb3a..43d23100e90c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json */ async function serverGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsListByServerSample.js index 872296048a93..097f510c4aa8 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/administratorsListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the AAD administrators for a given server. * * @summary List all the AAD administrators for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorsListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json */ async function administratorsListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsGetSample.js index 8421617b3928..f86817b0cc15 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Get specific backup for a given server. * * @summary Get specific backup for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json */ async function getABackupForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsListByServerSample.js index ae67c086e04e..85cfb94a7a58 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/backupsListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the backups for a given server. * * @summary List all the backups for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json */ async function listBackupsForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkMigrationNameAvailabilitySample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkMigrationNameAvailabilitySample.js index 800f40a05bfb..803eb856e63b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkMigrationNameAvailabilitySample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkMigrationNameAvailabilitySample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to This method checks whether a proposed migration name is valid and available. * * @summary This method checks whether a proposed migration name is valid and available. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckMigrationNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json */ async function checkMigrationNameAvailability() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityExecuteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityExecuteSample.js index 586d5af90e6a..94f6c6a45f69 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityExecuteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityExecuteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityWithLocationExecuteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityWithLocationExecuteSample.js index 86814ef32e66..7313e8c7debc 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityWithLocationExecuteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/checkNameAvailabilityWithLocationExecuteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsGetSample.js index 7936aa28a954..b66fc35ad23b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets information about a configuration of server. * * @summary Gets information about a configuration of server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json */ async function configurationGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsListByServerSample.js index c06abd819384..94f698dedc7c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the configurations in a given server. * * @summary List all the configurations in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json */ async function configurationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsPutSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsPutSample.js index e38cbbb6495b..3939790bddfa 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsPutSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsPutSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsUpdateSample.js index d82e8b3296b6..ca727953e813 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsUpdateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/configurationsUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesCreateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesCreateSample.js index 54a75c5adb62..842b97abcc32 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesCreateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesCreateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Creates a new database or updates an existing database. * * @summary Creates a new database or updates an existing database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json */ async function createADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesDeleteSample.js index 224a6ea39c89..564f59dca5cf 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesDeleteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes a database. * * @summary Deletes a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json */ async function deleteADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesGetSample.js index 86b4557f53d6..c50e7cdad0db 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets information about a database. * * @summary Gets information about a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json */ async function getADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesListByServerSample.js index 6693e88d8bb7..9f39774d73e0 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/databasesListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the databases in a given server. * * @summary List all the databases in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ async function listDatabasesInAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesCreateOrUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesCreateOrUpdateSample.js index 850e0340875c..75351cc72078 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesCreateOrUpdateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesCreateOrUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Creates a new firewall rule or updates an existing firewall rule. * * @summary Creates a new firewall rule or updates an existing firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ async function firewallRuleCreate() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesDeleteSample.js index 8885d34b8e46..0ee9631bd6b2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesDeleteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes a PostgreSQL server firewall rule. * * @summary Deletes a PostgreSQL server firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ async function firewallRuleDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesGetSample.js index e1934c5a15a8..e1c11b11c08e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the firewall rules in a given server. * * @summary List all the firewall rules in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesListByServerSample.js index 990067411333..cd5e535257b3 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/firewallRulesListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the firewall rules in a given PostgreSQL server. * * @summary List all the firewall rules in a given PostgreSQL server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerStartLtrBackupSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerStartLtrBackupSample.js index eb40f62856b2..e4860b7dc6c9 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerStartLtrBackupSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerStartLtrBackupSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Start the Long Term Retention Backup operation * * @summary Start the Long Term Retention Backup operation - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json */ async function sampleExecuteBackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerTriggerLtrPreBackupSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerTriggerLtrPreBackupSample.js index da0361662105..40a986df5be3 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerTriggerLtrPreBackupSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/flexibleServerTriggerLtrPreBackupSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. * * @summary PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionPreBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json */ async function samplePrebackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/getPrivateDnsZoneSuffixExecuteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/getPrivateDnsZoneSuffixExecuteSample.js index 9dae2e8d3093..efd41f1cdfdd 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/getPrivateDnsZoneSuffixExecuteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/getPrivateDnsZoneSuffixExecuteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Get private DNS zone suffix in the cloud * * @summary Get private DNS zone suffix in the cloud - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json */ async function getPrivateDnsZoneSuffix() { const credential = new DefaultAzureCredential(); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/locationBasedCapabilitiesExecuteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/locationBasedCapabilitiesExecuteSample.js index bb2decbfd19f..7529054cad57 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/locationBasedCapabilitiesExecuteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/locationBasedCapabilitiesExecuteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Get capabilities at specified location in a given subscription. * * @summary Get capabilities at specified location in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CapabilitiesByLocation.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json */ async function capabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/logFilesListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/logFilesListByServerSample.js index ceb7fd6b1dba..7fbebb0103c4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/logFilesListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/logFilesListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the server log files in a given server. * * @summary List all the server log files in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json */ async function listAllServerLogFilesForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsGetSample.js index 776d4d13d1ad..868ac059f8b6 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the result of the give long term retention backup operation for the flexible server. * * @summary Gets the result of the give long term retention backup operation for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json */ async function sample() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsListByServerSample.js index ff013b72eb99..6110aa9b5c9f 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/ltrBackupOperationsListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the result of the give long term retention backup operations for the flexible server. * * @summary Gets the result of the give long term retention backup operations for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json */ async function sampleListOfLongTernRetentionOperationsByFlexibleServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsCreateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsCreateSample.js index 05704a9cf7eb..828d47db5b30 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsCreateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsCreateSample.js @@ -16,7 +16,84 @@ require("dotenv").config(); * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create_With_Other_Users.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + */ +async function createMigrationWithOtherSourceTypesForValidateAndMigrate() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "ValidateAndMigrate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx", + }, + }, + sourceDbServerResourceId: "testsource:5432@pguser", + sourceType: "OnPremises", + sslMode: "Prefer", + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json + */ +async function createPreMigrationValidation() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "Validate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx", + }, + }, + sourceDbServerResourceId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json */ async function migrationsCreateByPassingUserNames() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -54,7 +131,7 @@ async function migrationsCreateByPassingUserNames() { * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json */ async function migrationsCreate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -88,6 +165,8 @@ async function migrationsCreate() { } async function main() { + createMigrationWithOtherSourceTypesForValidateAndMigrate(); + createPreMigrationValidation(); migrationsCreateByPassingUserNames(); migrationsCreate(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsDeleteSample.js index 790482b25bf3..f6a0a803650e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsDeleteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes a migration. * * @summary Deletes a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Delete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json */ async function migrationsDelete() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsGetSample.js index d8471d7d887e..24db62888d3c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets details of a migration. * * @summary Gets details of a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Get.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json */ async function migrationsGet() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -34,8 +34,100 @@ async function migrationsGet() { console.log(result); } +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ +async function migrationsGetMigrationWithSuccessfulValidationAndMigration() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationandmigration"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ +async function migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationbutmigrationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + */ +async function migrationsGetMigrationWithSuccessfulValidationOnly() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationonly"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + */ +async function migrationsGetMigrationWithValidationFailures() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithvalidationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + async function main() { migrationsGet(); + migrationsGetMigrationWithSuccessfulValidationAndMigration(); + migrationsGetMigrationWithSuccessfulValidationButMigrationFailure(); + migrationsGetMigrationWithSuccessfulValidationOnly(); + migrationsGetMigrationWithValidationFailures(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsListByTargetServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsListByTargetServerSample.js index a743b787734e..f9b3fd7acfbc 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsListByTargetServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsListByTargetServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the migrations on a given target server. * * @summary List all the migrations on a given target server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_ListByTargetServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json */ async function migrationsListByTargetServer() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsUpdateSample.js index 4193aa7f1192..d3cef6c98190 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsUpdateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/migrationsUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Cancel.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json */ async function cancelMigration() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -40,7 +40,7 @@ async function cancelMigration() { * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Update.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json */ async function migrationsUpdate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/operationsListSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/operationsListSample.js index 14b8847b849f..7504bb2875ed 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/operationsListSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/operationsListSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Lists all of the available REST API operations. * * @summary Lists all of the available REST API operations. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/OperationList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json */ async function operationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionDeleteSample.js new file mode 100644 index 000000000000..57a4367121ad --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionDeleteSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a private endpoint connection with a given name. + * + * @summary Deletes a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json + */ +async function deletesAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.privateEndpointConnectionOperations.beginDeleteAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + deletesAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionUpdateSample.js new file mode 100644 index 000000000000..7e66a43490c3 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionUpdateSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. + * + * @summary Approve or reject a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ +async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters = { + privateLinkServiceConnectionState: { + description: "Approved by johndoe@contoso.com", + status: "Approved", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.privateEndpointConnectionOperations.beginUpdateAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +async function main() { + approveOrRejectAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..1ab3d0cfba0f --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a private endpoint connection. + * + * @summary Gets a private endpoint connection. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json + */ +async function getsPrivateEndpointConnection() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + getsPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsListByServerSample.js new file mode 100644 index 000000000000..638278f446e1 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateEndpointConnectionsListByServerSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets all private endpoint connections on a server. + * + * @summary Gets all private endpoint connections on a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json + */ +async function getsListOfPrivateEndpointConnectionsOnAServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsListOfPrivateEndpointConnectionsOnAServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesGetSample.js new file mode 100644 index 000000000000..d61a35e22407 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a private link resource for PostgreSQL server. + * + * @summary Gets a private link resource for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json + */ +async function getsAPrivateLinkResourceForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const groupName = "plr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.privateLinkResources.get(resourceGroupName, serverName, groupName); + console.log(result); +} + +async function main() { + getsAPrivateLinkResourceForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesListByServerSample.js new file mode 100644 index 000000000000..bfdbf4f7a239 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/privateLinkResourcesListByServerSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the private link resources for PostgreSQL server. + * + * @summary Gets the private link resources for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json + */ +async function getsPrivateLinkResourcesForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateLinkResources.listByServer(resourceGroupName, serverName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsPrivateLinkResourcesForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/quotaUsagesListSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/quotaUsagesListSample.js new file mode 100644 index 000000000000..de05ba05b3bf --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/quotaUsagesListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get quota usages at specified location in a given subscription. + * + * @summary Get quota usages at specified location in a given subscription. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json + */ +async function listOfQuotaUsagesForFlexibleServers() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const locationName = "westus"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.quotaUsages.list(locationName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listOfQuotaUsagesForFlexibleServers(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/replicasListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/replicasListByServerSample.js index af14f0d9b992..d97ba7350717 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/replicasListByServerSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/replicasListByServerSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the replicas for a given server. * * @summary List all the replicas for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json */ async function replicasListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverCapabilitiesListSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverCapabilitiesListSample.js index a85eb951c433..e62a35375164 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverCapabilitiesListSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverCapabilitiesListSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Get capabilities for a flexible server. * * @summary Get capabilities for a flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCapabilities.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json */ async function serverCapabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsCreateOrUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsCreateOrUpdateSample.js new file mode 100644 index 000000000000..39631c187754 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsCreateOrUpdateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates or updates a server's Advanced Threat Protection settings. + * + * @summary Creates or updates a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json + */ +async function updateAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-4799"; + const serverName = "threatprotection-6440"; + const threatProtectionName = "Default"; + const parameters = { state: "Enabled" }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.serverThreatProtectionSettings.beginCreateOrUpdateAndWait( + resourceGroupName, + serverName, + threatProtectionName, + parameters + ); + console.log(result); +} + +async function main() { + updateAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsGetSample.js new file mode 100644 index 000000000000..d350d877d24e --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsGetSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a server's Advanced Threat Protection settings. + * + * @summary Get a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json + */ +async function getAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const threatProtectionName = "Default"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.serverThreatProtectionSettings.get( + resourceGroupName, + serverName, + threatProtectionName + ); + console.log(result); +} + +async function main() { + getAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsListByServerSample.js new file mode 100644 index 000000000000..0775ad525991 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serverThreatProtectionSettingsListByServerSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of server's Threat Protection state. + * + * @summary Get a list of server's Threat Protection state. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + */ +async function getAServerAdvancedThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serverThreatProtectionSettings.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getAServerAdvancedThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversCreateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversCreateSample.js index beef3524b390..8ec666a6bc94 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversCreateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversCreateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { const subscriptionId = @@ -60,7 +60,7 @@ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json */ async function createADatabaseAsAPointInTimeRestore() { const subscriptionId = @@ -84,7 +84,7 @@ async function createADatabaseAsAPointInTimeRestore() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json */ async function createANewServer() { const subscriptionId = @@ -120,7 +120,7 @@ async function createANewServer() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json */ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { const subscriptionId = @@ -162,7 +162,7 @@ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json */ async function serverCreateReplica() { const subscriptionId = @@ -202,7 +202,7 @@ async function serverCreateReplica() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReviveDropped.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json */ async function serverCreateReviveDropped() { const subscriptionId = @@ -226,7 +226,7 @@ async function serverCreateReviveDropped() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json */ async function serverCreateWithDataEncryptionEnabled() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversDeleteSample.js index e1b39f10e931..1c17a56d57fd 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversDeleteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes a server. * * @summary Deletes a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json */ async function serverDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversGetSample.js index 028359c0f483..1c92e8f390a4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversGetSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json */ async function serverGet() { const subscriptionId = @@ -33,7 +33,24 @@ async function serverGet() { * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json + */ +async function serverGetWithPrivateEndpoints() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc2"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.servers.get(resourceGroupName, serverName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets information about a server. + * + * @summary Gets information about a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json */ async function serverGetWithVnet() { const subscriptionId = @@ -48,6 +65,7 @@ async function serverGetWithVnet() { async function main() { serverGet(); + serverGetWithPrivateEndpoints(); serverGetWithVnet(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListByResourceGroupSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListByResourceGroupSample.js index aead036cf0dc..d4a78b6d65ca 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListByResourceGroupSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListByResourceGroupSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the servers in a given resource group. * * @summary List all the servers in a given resource group. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerListByResourceGroup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json */ async function serverListByResourceGroup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListSample.js index 543f31b89dee..1929821eaaf5 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversListSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to List all the servers in a given subscription. * * @summary List all the servers in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json */ async function serverList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversRestartSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversRestartSample.js index 2dbd349b9238..3f0ae6af1a30 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversRestartSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversRestartSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json */ async function serverRestart() { const subscriptionId = @@ -33,7 +33,7 @@ async function serverRestart() { * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestartWithFailover.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json */ async function serverRestartWithFailover() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStartSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStartSample.js index 4a9ad58ff82f..77cacdb64f8f 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStartSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStartSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Starts a server. * * @summary Starts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json */ async function serverStart() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStopSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStopSample.js index 0ebd43b441cb..ebecc40916d6 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStopSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversStopSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Stops a server. * * @summary Stops a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStop.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json */ async function serverStop() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversUpdateSample.js index 4221859e479c..7481858f54d5 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversUpdateSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/serversUpdateSample.js @@ -16,7 +16,47 @@ require("dotenv").config(); * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters = { + replica: { promoteMode: "standalone", promoteOption: "forced" }, + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters = { + replica: { promoteMode: "standalone", promoteOption: "planned" }, + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json */ async function serverUpdate() { const subscriptionId = @@ -40,7 +80,7 @@ async function serverUpdate() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json */ async function serverUpdateWithAadAuthEnabled() { const subscriptionId = @@ -69,7 +109,7 @@ async function serverUpdateWithAadAuthEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ async function serverUpdateWithCustomerMaintenanceWindow() { const subscriptionId = @@ -95,7 +135,7 @@ async function serverUpdateWithCustomerMaintenanceWindow() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json */ async function serverUpdateWithDataEncryptionEnabled() { const subscriptionId = @@ -138,7 +178,7 @@ async function serverUpdateWithDataEncryptionEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json */ async function serverUpdateWithMajorVersionUpgrade() { const subscriptionId = @@ -152,12 +192,56 @@ async function serverUpdateWithMajorVersionUpgrade() { console.log(result); } +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + */ +async function switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters = { + replica: { promoteMode: "switchover", promoteOption: "forced" }, + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + */ +async function switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters = { + replica: { promoteMode: "switchover", promoteOption: "planned" }, + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters); + console.log(result); +} + async function main() { + promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete(); serverUpdate(); serverUpdateWithAadAuthEnabled(); serverUpdateWithCustomerMaintenanceWindow(); serverUpdateWithDataEncryptionEnabled(); serverUpdateWithMajorVersionUpgrade(); + switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsCreateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsCreateSample.js new file mode 100644 index 000000000000..20e1d6153da5 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsCreateSample.js @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @summary Creates a new virtual endpoint for PostgreSQL flexible server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json + */ +async function createANewVirtualEndpointForAFlexibleServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters = { + endpointType: "ReadWrite", + members: ["testPrimary1"], + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.virtualEndpoints.beginCreateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + createANewVirtualEndpointForAFlexibleServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsDeleteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsDeleteSample.js new file mode 100644 index 000000000000..7283feae4738 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsDeleteSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a virtual endpoint. + * + * @summary Deletes a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json + */ +async function deleteAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.virtualEndpoints.beginDeleteAndWait( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + deleteAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsGetSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsGetSample.js new file mode 100644 index 000000000000..a2257462d4e9 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsGetSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets information about a virtual endpoint. + * + * @summary Gets information about a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json + */ +async function getAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.virtualEndpoints.get( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + getAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsListByServerSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsListByServerSample.js new file mode 100644 index 000000000000..9aad37584725 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsListByServerSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all the servers in a given resource group. + * + * @summary List all the servers in a given resource group. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json + */ +async function virtualEndpointListByServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualEndpoints.listByServer(resourceGroupName, serverName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + virtualEndpointListByServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsUpdateSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsUpdateSample.js new file mode 100644 index 000000000000..b772f3298947 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualEndpointsUpdateSample.js @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * + * @summary Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json + */ +async function updateAVirtualEndpointForAServerToUpdateThe() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters = { + endpointType: "ReadWrite", + members: ["testReplica1"], + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId); + const result = await client.virtualEndpoints.beginUpdateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + updateAVirtualEndpointForAServerToUpdateThe(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualNetworkSubnetUsageExecuteSample.js b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualNetworkSubnetUsageExecuteSample.js index c3423f6e2bb7..67f3517bfbc2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualNetworkSubnetUsageExecuteSample.js +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/javascript/virtualNetworkSubnetUsageExecuteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Get virtual network subnet usage for a given vNet resource id. * * @summary Get virtual network subnet usage for a given vNet resource id. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json */ async function virtualNetworkSubnetUsageList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/README.md b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/README.md index aff90831ec99..90d95d90e657 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/README.md +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/README.md @@ -2,54 +2,69 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [administratorsCreateSample.ts][administratorscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorAdd.json | -| [administratorsDeleteSample.ts][administratorsdeletesample] | Deletes an Active Directory Administrator associated with the server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorDelete.json | -| [administratorsGetSample.ts][administratorsgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorGet.json | -| [administratorsListByServerSample.ts][administratorslistbyserversample] | List all the AAD administrators for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorsListByServer.json | -| [backupsGetSample.ts][backupsgetsample] | Get specific backup for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupGet.json | -| [backupsListByServerSample.ts][backupslistbyserversample] | List all the backups for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupListByServer.json | -| [checkMigrationNameAvailabilitySample.ts][checkmigrationnameavailabilitysample] | This method checks whether a proposed migration name is valid and available. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckMigrationNameAvailability.json | -| [checkNameAvailabilityExecuteSample.ts][checknameavailabilityexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailability.json | -| [checkNameAvailabilityWithLocationExecuteSample.ts][checknameavailabilitywithlocationexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailabilityLocationBased.json | -| [configurationsGetSample.ts][configurationsgetsample] | Gets information about a configuration of server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationGet.json | -| [configurationsListByServerSample.ts][configurationslistbyserversample] | List all the configurations in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationListByServer.json | -| [configurationsPutSample.ts][configurationsputsample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json | -| [configurationsUpdateSample.ts][configurationsupdatesample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json | -| [databasesCreateSample.ts][databasescreatesample] | Creates a new database or updates an existing database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseCreate.json | -| [databasesDeleteSample.ts][databasesdeletesample] | Deletes a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseDelete.json | -| [databasesGetSample.ts][databasesgetsample] | Gets information about a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseGet.json | -| [databasesListByServerSample.ts][databaseslistbyserversample] | List all the databases in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabasesListByServer.json | -| [firewallRulesCreateOrUpdateSample.ts][firewallrulescreateorupdatesample] | Creates a new firewall rule or updates an existing firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleCreate.json | -| [firewallRulesDeleteSample.ts][firewallrulesdeletesample] | Deletes a PostgreSQL server firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleDelete.json | -| [firewallRulesGetSample.ts][firewallrulesgetsample] | List all the firewall rules in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleGet.json | -| [firewallRulesListByServerSample.ts][firewallruleslistbyserversample] | List all the firewall rules in a given PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleListByServer.json | -| [flexibleServerStartLtrBackupSample.ts][flexibleserverstartltrbackupsample] | Start the Long Term Retention Backup operation x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionBackup.json | -| [flexibleServerTriggerLtrPreBackupSample.ts][flexibleservertriggerltrprebackupsample] | PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionPreBackup.json | -| [getPrivateDnsZoneSuffixExecuteSample.ts][getprivatednszonesuffixexecutesample] | Get private DNS zone suffix in the cloud x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/GetPrivateDnsZoneSuffix.json | -| [locationBasedCapabilitiesExecuteSample.ts][locationbasedcapabilitiesexecutesample] | Get capabilities at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CapabilitiesByLocation.json | -| [logFilesListByServerSample.ts][logfileslistbyserversample] | List all the server log files in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LogFilesListByServer.json | -| [ltrBackupOperationsGetSample.ts][ltrbackupoperationsgetsample] | Gets the result of the give long term retention backup operation for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationGet.json | -| [ltrBackupOperationsListByServerSample.ts][ltrbackupoperationslistbyserversample] | Gets the result of the give long term retention backup operations for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationListByServer.json | -| [migrationsCreateSample.ts][migrationscreatesample] | Creates a new migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create_With_Other_Users.json | -| [migrationsDeleteSample.ts][migrationsdeletesample] | Deletes a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Delete.json | -| [migrationsGetSample.ts][migrationsgetsample] | Gets details of a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Get.json | -| [migrationsListByTargetServerSample.ts][migrationslistbytargetserversample] | List all the migrations on a given target server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_ListByTargetServer.json | -| [migrationsUpdateSample.ts][migrationsupdatesample] | Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Cancel.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/OperationList.json | -| [replicasListByServerSample.ts][replicaslistbyserversample] | List all the replicas for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ReplicasListByServer.json | -| [serverCapabilitiesListSample.ts][servercapabilitieslistsample] | Get capabilities for a flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCapabilities.json | -| [serversCreateSample.ts][serverscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json | -| [serversDeleteSample.ts][serversdeletesample] | Deletes a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerDelete.json | -| [serversGetSample.ts][serversgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGet.json | -| [serversListByResourceGroupSample.ts][serverslistbyresourcegroupsample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerListByResourceGroup.json | -| [serversListSample.ts][serverslistsample] | List all the servers in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerList.json | -| [serversRestartSample.ts][serversrestartsample] | Restarts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestart.json | -| [serversStartSample.ts][serversstartsample] | Starts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStart.json | -| [serversStopSample.ts][serversstopsample] | Stops a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStop.json | -| [serversUpdateSample.ts][serversupdatesample] | Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdate.json | -| [virtualNetworkSubnetUsageExecuteSample.ts][virtualnetworksubnetusageexecutesample] | Get virtual network subnet usage for a given vNet resource id. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/VirtualNetworkSubnetUsage.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [administratorsCreateSample.ts][administratorscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json | +| [administratorsDeleteSample.ts][administratorsdeletesample] | Deletes an Active Directory Administrator associated with the server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json | +| [administratorsGetSample.ts][administratorsgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json | +| [administratorsListByServerSample.ts][administratorslistbyserversample] | List all the AAD administrators for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json | +| [backupsGetSample.ts][backupsgetsample] | Get specific backup for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json | +| [backupsListByServerSample.ts][backupslistbyserversample] | List all the backups for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json | +| [checkMigrationNameAvailabilitySample.ts][checkmigrationnameavailabilitysample] | This method checks whether a proposed migration name is valid and available. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json | +| [checkNameAvailabilityExecuteSample.ts][checknameavailabilityexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json | +| [checkNameAvailabilityWithLocationExecuteSample.ts][checknameavailabilitywithlocationexecutesample] | Check the availability of name for resource x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json | +| [configurationsGetSample.ts][configurationsgetsample] | Gets information about a configuration of server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json | +| [configurationsListByServerSample.ts][configurationslistbyserversample] | List all the configurations in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json | +| [configurationsPutSample.ts][configurationsputsample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json | +| [configurationsUpdateSample.ts][configurationsupdatesample] | Updates a configuration of a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json | +| [databasesCreateSample.ts][databasescreatesample] | Creates a new database or updates an existing database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json | +| [databasesDeleteSample.ts][databasesdeletesample] | Deletes a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json | +| [databasesGetSample.ts][databasesgetsample] | Gets information about a database. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json | +| [databasesListByServerSample.ts][databaseslistbyserversample] | List all the databases in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json | +| [firewallRulesCreateOrUpdateSample.ts][firewallrulescreateorupdatesample] | Creates a new firewall rule or updates an existing firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json | +| [firewallRulesDeleteSample.ts][firewallrulesdeletesample] | Deletes a PostgreSQL server firewall rule. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json | +| [firewallRulesGetSample.ts][firewallrulesgetsample] | List all the firewall rules in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json | +| [firewallRulesListByServerSample.ts][firewallruleslistbyserversample] | List all the firewall rules in a given PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json | +| [flexibleServerStartLtrBackupSample.ts][flexibleserverstartltrbackupsample] | Start the Long Term Retention Backup operation x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json | +| [flexibleServerTriggerLtrPreBackupSample.ts][flexibleservertriggerltrprebackupsample] | PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json | +| [getPrivateDnsZoneSuffixExecuteSample.ts][getprivatednszonesuffixexecutesample] | Get private DNS zone suffix in the cloud x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json | +| [locationBasedCapabilitiesExecuteSample.ts][locationbasedcapabilitiesexecutesample] | Get capabilities at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json | +| [logFilesListByServerSample.ts][logfileslistbyserversample] | List all the server log files in a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json | +| [ltrBackupOperationsGetSample.ts][ltrbackupoperationsgetsample] | Gets the result of the give long term retention backup operation for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json | +| [ltrBackupOperationsListByServerSample.ts][ltrbackupoperationslistbyserversample] | Gets the result of the give long term retention backup operations for the flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json | +| [migrationsCreateSample.ts][migrationscreatesample] | Creates a new migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json | +| [migrationsDeleteSample.ts][migrationsdeletesample] | Deletes a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json | +| [migrationsGetSample.ts][migrationsgetsample] | Gets details of a migration. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json | +| [migrationsListByTargetServerSample.ts][migrationslistbytargetserversample] | List all the migrations on a given target server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json | +| [migrationsUpdateSample.ts][migrationsupdatesample] | Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json | +| [privateEndpointConnectionDeleteSample.ts][privateendpointconnectiondeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionUpdateSample.ts][privateendpointconnectionupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListByServerSample.ts][privateendpointconnectionslistbyserversample] | Gets all private endpoint connections on a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json | +| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Gets a private link resource for PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json | +| [privateLinkResourcesListByServerSample.ts][privatelinkresourceslistbyserversample] | Gets the private link resources for PostgreSQL server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json | +| [quotaUsagesListSample.ts][quotausageslistsample] | Get quota usages at specified location in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json | +| [replicasListByServerSample.ts][replicaslistbyserversample] | List all the replicas for a given server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json | +| [serverCapabilitiesListSample.ts][servercapabilitieslistsample] | Get capabilities for a flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json | +| [serverThreatProtectionSettingsCreateOrUpdateSample.ts][serverthreatprotectionsettingscreateorupdatesample] | Creates or updates a server's Advanced Threat Protection settings. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json | +| [serverThreatProtectionSettingsGetSample.ts][serverthreatprotectionsettingsgetsample] | Get a server's Advanced Threat Protection settings. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json | +| [serverThreatProtectionSettingsListByServerSample.ts][serverthreatprotectionsettingslistbyserversample] | Get a list of server's Threat Protection state. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json | +| [serversCreateSample.ts][serverscreatesample] | Creates a new server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json | +| [serversDeleteSample.ts][serversdeletesample] | Deletes a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json | +| [serversGetSample.ts][serversgetsample] | Gets information about a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json | +| [serversListByResourceGroupSample.ts][serverslistbyresourcegroupsample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json | +| [serversListSample.ts][serverslistsample] | List all the servers in a given subscription. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json | +| [serversRestartSample.ts][serversrestartsample] | Restarts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json | +| [serversStartSample.ts][serversstartsample] | Starts a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json | +| [serversStopSample.ts][serversstopsample] | Stops a server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json | +| [serversUpdateSample.ts][serversupdatesample] | Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json | +| [virtualEndpointsCreateSample.ts][virtualendpointscreatesample] | Creates a new virtual endpoint for PostgreSQL flexible server. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json | +| [virtualEndpointsDeleteSample.ts][virtualendpointsdeletesample] | Deletes a virtual endpoint. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json | +| [virtualEndpointsGetSample.ts][virtualendpointsgetsample] | Gets information about a virtual endpoint. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json | +| [virtualEndpointsListByServerSample.ts][virtualendpointslistbyserversample] | List all the servers in a given resource group. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json | +| [virtualEndpointsUpdateSample.ts][virtualendpointsupdatesample] | Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json | +| [virtualNetworkSubnetUsageExecuteSample.ts][virtualnetworksubnetusageexecutesample] | Get virtual network subnet usage for a given vNet resource id. x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json | ## Prerequisites @@ -135,8 +150,18 @@ Take a look at our [API Documentation][apiref] for more information about the AP [migrationslistbytargetserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsListByTargetServerSample.ts [migrationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsUpdateSample.ts [operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/operationsListSample.ts +[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionDeleteSample.ts +[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionUpdateSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsListByServerSample.ts +[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts +[privatelinkresourceslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesListByServerSample.ts +[quotausageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/quotaUsagesListSample.ts [replicaslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/replicasListByServerSample.ts [servercapabilitieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverCapabilitiesListSample.ts +[serverthreatprotectionsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsCreateOrUpdateSample.ts +[serverthreatprotectionsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsGetSample.ts +[serverthreatprotectionsettingslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsListByServerSample.ts [serverscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversCreateSample.ts [serversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversDeleteSample.ts [serversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversGetSample.ts @@ -146,6 +171,11 @@ Take a look at our [API Documentation][apiref] for more information about the AP [serversstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStartSample.ts [serversstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStopSample.ts [serversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversUpdateSample.ts +[virtualendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsCreateSample.ts +[virtualendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsDeleteSample.ts +[virtualendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsGetSample.ts +[virtualendpointslistbyserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsListByServerSample.ts +[virtualendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsUpdateSample.ts [virtualnetworksubnetusageexecutesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualNetworkSubnetUsageExecuteSample.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsCreateSample.ts index f0d209eec710..17b6e9359049 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorAdd.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json */ async function addsAnActiveDIrectoryAdministratorForTheServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsDeleteSample.ts index 59fcbbce55ae..77f74b346d43 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes an Active Directory Administrator associated with the server. * * @summary Deletes an Active Directory Administrator associated with the server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json */ async function administratorDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsGetSample.ts index c8accf266c9f..1d4026a4e098 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json */ async function serverGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsListByServerSample.ts index 3b338a4ce751..f3d7dfe4459a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/administratorsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the AAD administrators for a given server. * * @summary List all the AAD administrators for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/AdministratorsListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json */ async function administratorsListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsGetSample.ts index c5ed04d44d77..76c6093d3bc4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get specific backup for a given server. * * @summary Get specific backup for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json */ async function getABackupForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsListByServerSample.ts index 10ef056b13cc..5e9f7b17c4e3 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/backupsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the backups for a given server. * * @summary List all the backups for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/BackupListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json */ async function listBackupsForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkMigrationNameAvailabilitySample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkMigrationNameAvailabilitySample.ts index de45f3e65d18..f12c6de4c41e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkMigrationNameAvailabilitySample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkMigrationNameAvailabilitySample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to This method checks whether a proposed migration name is valid and available. * * @summary This method checks whether a proposed migration name is valid and available. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckMigrationNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json */ async function checkMigrationNameAvailability() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityExecuteSample.ts index f4b6a40749cb..7d416ae0c368 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityWithLocationExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityWithLocationExecuteSample.ts index 87aa1fe7a1ff..0e7ffc1c43b9 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityWithLocationExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/checkNameAvailabilityWithLocationExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Check the availability of name for resource * * @summary Check the availability of name for resource - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json */ async function nameAvailability() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsGetSample.ts index 87113ece4058..8d1183d0c28b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a configuration of server. * * @summary Gets information about a configuration of server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json */ async function configurationGet() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsListByServerSample.ts index 8411947e8464..1654bacf4326 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the configurations in a given server. * * @summary List all the configurations in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json */ async function configurationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsPutSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsPutSample.ts index de3013e89253..392b0659b90e 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsPutSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsPutSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsUpdateSample.ts index e7cf79673eae..30228baf54fc 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/configurationsUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates a configuration of a server. * * @summary Updates a configuration of a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ async function updateAUserConfiguration() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesCreateSample.ts index b51869d56cd9..d5d77ef38da7 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new database or updates an existing database. * * @summary Creates a new database or updates an existing database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json */ async function createADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesDeleteSample.ts index 24267dce8f56..8f5635b2baf2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a database. * * @summary Deletes a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json */ async function deleteADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesGetSample.ts index 793fc535ac1a..f8ac2cfcef57 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a database. * * @summary Gets information about a database. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json */ async function getADatabase() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesListByServerSample.ts index df09350eb7c4..fe80d2643405 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/databasesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the databases in a given server. * * @summary List all the databases in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ async function listDatabasesInAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesCreateOrUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesCreateOrUpdateSample.ts index c3e4c348f1d5..6cff0b905a85 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesCreateOrUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesCreateOrUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new firewall rule or updates an existing firewall rule. * * @summary Creates a new firewall rule or updates an existing firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ async function firewallRuleCreate() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesDeleteSample.ts index 1a0f717b559e..6cbc3e1f2815 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a PostgreSQL server firewall rule. * * @summary Deletes a PostgreSQL server firewall rule. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ async function firewallRuleDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesGetSample.ts index 959e567baf94..85bc935a6cac 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the firewall rules in a given server. * * @summary List all the firewall rules in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesListByServerSample.ts index cf5c9847794c..311230fe537c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/firewallRulesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the firewall rules in a given PostgreSQL server. * * @summary List all the firewall rules in a given PostgreSQL server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/FirewallRuleListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json */ async function firewallRuleList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerStartLtrBackupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerStartLtrBackupSample.ts index 951cb0b34281..81489406abc2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerStartLtrBackupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerStartLtrBackupSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Start the Long Term Retention Backup operation * * @summary Start the Long Term Retention Backup operation - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json */ async function sampleExecuteBackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerTriggerLtrPreBackupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerTriggerLtrPreBackupSample.ts index 5319034fa2e8..dd78be4c0e37 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerTriggerLtrPreBackupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/flexibleServerTriggerLtrPreBackupSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. * * @summary PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionPreBackup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json */ async function samplePrebackup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/getPrivateDnsZoneSuffixExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/getPrivateDnsZoneSuffixExecuteSample.ts index 104792acd2c6..cedd6fc24a92 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/getPrivateDnsZoneSuffixExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/getPrivateDnsZoneSuffixExecuteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get private DNS zone suffix in the cloud * * @summary Get private DNS zone suffix in the cloud - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json */ async function getPrivateDnsZoneSuffix() { const credential = new DefaultAzureCredential(); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/locationBasedCapabilitiesExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/locationBasedCapabilitiesExecuteSample.ts index 91f5f32f0d59..6ef42758f83b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/locationBasedCapabilitiesExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/locationBasedCapabilitiesExecuteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get capabilities at specified location in a given subscription. * * @summary Get capabilities at specified location in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/CapabilitiesByLocation.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json */ async function capabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/logFilesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/logFilesListByServerSample.ts index 3e8fcef12db1..a59a5c2b92c2 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/logFilesListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/logFilesListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the server log files in a given server. * * @summary List all the server log files in a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json */ async function listAllServerLogFilesForAServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsGetSample.ts index 37f11acefa58..e562c6585ba4 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the result of the give long term retention backup operation for the flexible server. * * @summary Gets the result of the give long term retention backup operation for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json */ async function sample() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsListByServerSample.ts index b325fe4aef94..43f8106ca02a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/ltrBackupOperationsListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the result of the give long term retention backup operations for the flexible server. * * @summary Gets the result of the give long term retention backup operations for the flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/LongTermRetentionOperationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json */ async function sampleListOfLongTernRetentionOperationsByFlexibleServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsCreateSample.ts index 4823fb9b0a02..e550046461a1 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsCreateSample.ts @@ -21,7 +21,86 @@ dotenv.config(); * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create_With_Other_Users.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + */ +async function createMigrationWithOtherSourceTypesForValidateAndMigrate() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters: MigrationResource = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "ValidateAndMigrate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx" + } + }, + sourceDbServerResourceId: "testsource:5432@pguser", + sourceType: "OnPremises", + sslMode: "Prefer" + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json + */ +async function createPreMigrationValidation() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigration"; + const parameters: MigrationResource = { + dbsToMigrate: ["db1", "db2", "db3", "db4"], + location: "westus", + migrationMode: "Offline", + migrationOption: "Validate", + overwriteDbsInTarget: "True", + secretParameters: { + adminCredentials: { + sourceServerPassword: "xxxxxxxx", + targetServerPassword: "xxxxxxxx" + } + }, + sourceDbServerResourceId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource" + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.create( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates a new migration. + * + * @summary Creates a new migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json */ async function migrationsCreateByPassingUserNames() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -60,7 +139,7 @@ async function migrationsCreateByPassingUserNames() { * This sample demonstrates how to Creates a new migration. * * @summary Creates a new migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Create.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json */ async function migrationsCreate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -95,6 +174,8 @@ async function migrationsCreate() { } async function main() { + createMigrationWithOtherSourceTypesForValidateAndMigrate(); + createPreMigrationValidation(); migrationsCreateByPassingUserNames(); migrationsCreate(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsDeleteSample.ts index 84eb12b0a61d..8d2280e52492 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a migration. * * @summary Deletes a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Delete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json */ async function migrationsDelete() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsGetSample.ts index b4f7213297ef..92027b1f1d92 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets details of a migration. * * @summary Gets details of a migration. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Get.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json */ async function migrationsGet() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -37,8 +37,105 @@ async function migrationsGet() { console.log(result); } +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ +async function migrationsGetMigrationWithSuccessfulValidationAndMigration() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationandmigration"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ +async function migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = + "testmigrationwithsuccessfulvalidationbutmigrationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + */ +async function migrationsGetMigrationWithSuccessfulValidationOnly() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithsuccessfulvalidationonly"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets details of a migration. + * + * @summary Gets details of a migration. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + */ +async function migrationsGetMigrationWithValidationFailures() { + const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const targetDbServerName = "testtarget"; + const migrationName = "testmigrationwithvalidationfailure"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient(credential); + const result = await client.migrations.get( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName + ); + console.log(result); +} + async function main() { migrationsGet(); + migrationsGetMigrationWithSuccessfulValidationAndMigration(); + migrationsGetMigrationWithSuccessfulValidationButMigrationFailure(); + migrationsGetMigrationWithSuccessfulValidationOnly(); + migrationsGetMigrationWithValidationFailures(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsListByTargetServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsListByTargetServerSample.ts index c16d8ec82437..3033c2762c70 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsListByTargetServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsListByTargetServerSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to List all the migrations on a given target server. * * @summary List all the migrations on a given target server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_ListByTargetServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json */ async function migrationsListByTargetServer() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsUpdateSample.ts index 4a018b046d0e..24812f752f8b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/migrationsUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Cancel.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json */ async function cancelMigration() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; @@ -46,7 +46,7 @@ async function cancelMigration() { * This sample demonstrates how to Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. * * @summary Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/Migrations_Update.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json */ async function migrationsUpdate() { const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/operationsListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/operationsListSample.ts index c8353cf959cf..d13f521bbdfd 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/operationsListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/operationsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Lists all of the available REST API operations. * * @summary Lists all of the available REST API operations. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/OperationList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json */ async function operationList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionDeleteSample.ts new file mode 100644 index 000000000000..c3f021fe4f22 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionDeleteSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a private endpoint connection with a given name. + * + * @summary Deletes a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json + */ +async function deletesAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnectionOperations.beginDeleteAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + deletesAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionUpdateSample.ts new file mode 100644 index 000000000000..2e00f0a5b6a9 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateEndpointConnection, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. + * + * @summary Approve or reject a private endpoint connection with a given name. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ +async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const parameters: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { + description: "Approved by johndoe@contoso.com", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnectionOperations.beginUpdateAndWait( + resourceGroupName, + serverName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +async function main() { + approveOrRejectAPrivateEndpointConnectionWithAGivenName(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..4417f57d6375 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a private endpoint connection. + * + * @summary Gets a private endpoint connection. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json + */ +async function getsPrivateEndpointConnection() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const privateEndpointConnectionName = + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + serverName, + privateEndpointConnectionName + ); + console.log(result); +} + +async function main() { + getsPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsListByServerSample.ts new file mode 100644 index 000000000000..d32a2a337faa --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateEndpointConnectionsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets all private endpoint connections on a server. + * + * @summary Gets all private endpoint connections on a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json + */ +async function getsListOfPrivateEndpointConnectionsOnAServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsListOfPrivateEndpointConnectionsOnAServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts new file mode 100644 index 000000000000..bec70ac8e637 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a private link resource for PostgreSQL server. + * + * @summary Gets a private link resource for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json + */ +async function getsAPrivateLinkResourceForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const groupName = "plr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.privateLinkResources.get( + resourceGroupName, + serverName, + groupName + ); + console.log(result); +} + +async function main() { + getsAPrivateLinkResourceForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesListByServerSample.ts new file mode 100644 index 000000000000..0dbadd9ec000 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/privateLinkResourcesListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the private link resources for PostgreSQL server. + * + * @summary Gets the private link resources for PostgreSQL server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json + */ +async function getsPrivateLinkResourcesForPostgreSql() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "Default"; + const serverName = "test-svr"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.privateLinkResources.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getsPrivateLinkResourcesForPostgreSql(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/quotaUsagesListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/quotaUsagesListSample.ts new file mode 100644 index 000000000000..e4a7bbb2dcca --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/quotaUsagesListSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get quota usages at specified location in a given subscription. + * + * @summary Get quota usages at specified location in a given subscription. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json + */ +async function listOfQuotaUsagesForFlexibleServers() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const locationName = "westus"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.quotaUsages.list(locationName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listOfQuotaUsagesForFlexibleServers(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/replicasListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/replicasListByServerSample.ts index 3009218ef93b..cda25734992c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/replicasListByServerSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/replicasListByServerSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the replicas for a given server. * * @summary List all the replicas for a given server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json */ async function replicasListByServer() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverCapabilitiesListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverCapabilitiesListSample.ts index cce2f02964f4..9675c2b48315 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverCapabilitiesListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverCapabilitiesListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get capabilities for a flexible server. * * @summary Get capabilities for a flexible server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCapabilities.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json */ async function serverCapabilitiesList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsCreateOrUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..bcf0ca8405d0 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServerThreatProtectionSettingsModel, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a server's Advanced Threat Protection settings. + * + * @summary Creates or updates a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json + */ +async function updateAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-4799"; + const serverName = "threatprotection-6440"; + const threatProtectionName = "Default"; + const parameters: ServerThreatProtectionSettingsModel = { state: "Enabled" }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.serverThreatProtectionSettings.beginCreateOrUpdateAndWait( + resourceGroupName, + serverName, + threatProtectionName, + parameters + ); + console.log(result); +} + +async function main() { + updateAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsGetSample.ts new file mode 100644 index 000000000000..ff1b6096aecd --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a server's Advanced Threat Protection settings. + * + * @summary Get a server's Advanced Threat Protection settings. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json + */ +async function getAServerThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const threatProtectionName = "Default"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.serverThreatProtectionSettings.get( + resourceGroupName, + serverName, + threatProtectionName + ); + console.log(result); +} + +async function main() { + getAServerThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsListByServerSample.ts new file mode 100644 index 000000000000..7f57277c8707 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serverThreatProtectionSettingsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of server's Threat Protection state. + * + * @summary Get a list of server's Threat Protection state. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + */ +async function getAServerAdvancedThreatProtectionSettings() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "threatprotection-6852"; + const serverName = "threatprotection-2080"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.serverThreatProtectionSettings.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getAServerAdvancedThreatProtectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversCreateSample.ts index 612845920889..2532ba64e8f0 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversCreateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversCreateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { const subscriptionId = @@ -72,7 +72,7 @@ async function createADatabaseAsAGeoRestoreInGeoPairedLocation() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json */ async function createADatabaseAsAPointInTimeRestore() { const subscriptionId = @@ -105,7 +105,7 @@ async function createADatabaseAsAPointInTimeRestore() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json */ async function createANewServer() { const subscriptionId = @@ -150,7 +150,7 @@ async function createANewServer() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json */ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { const subscriptionId = @@ -201,7 +201,7 @@ async function createANewServerWithActiveDirectoryAuthenticationEnabled() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json */ async function serverCreateReplica() { const subscriptionId = @@ -249,7 +249,7 @@ async function serverCreateReplica() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateReviveDropped.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json */ async function serverCreateReviveDropped() { const subscriptionId = @@ -282,7 +282,7 @@ async function serverCreateReviveDropped() { * This sample demonstrates how to Creates a new server. * * @summary Creates a new server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json */ async function serverCreateWithDataEncryptionEnabled() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversDeleteSample.ts index 884539f25755..87d87d71fc7d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversDeleteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a server. * * @summary Deletes a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json */ async function serverDelete() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversGetSample.ts index e0f3366554a9..414095cc673a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversGetSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json */ async function serverGet() { const subscriptionId = @@ -40,7 +40,29 @@ async function serverGet() { * This sample demonstrates how to Gets information about a server. * * @summary Gets information about a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json + */ +async function serverGetWithPrivateEndpoints() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc2"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.get(resourceGroupName, serverName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets information about a server. + * + * @summary Gets information about a server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json */ async function serverGetWithVnet() { const subscriptionId = @@ -60,6 +82,7 @@ async function serverGetWithVnet() { async function main() { serverGet(); + serverGetWithPrivateEndpoints(); serverGetWithVnet(); } diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListByResourceGroupSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListByResourceGroupSample.ts index 35bf157f64eb..a797321a3c39 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListByResourceGroupSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the servers in a given resource group. * * @summary List all the servers in a given resource group. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerListByResourceGroup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json */ async function serverListByResourceGroup() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListSample.ts index 0eb399921235..f9d253359634 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all the servers in a given subscription. * * @summary List all the servers in a given subscription. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json */ async function serverList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversRestartSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversRestartSample.ts index 67dd11623d32..a6f5faefbe00 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversRestartSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversRestartSample.ts @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json */ async function serverRestart() { const subscriptionId = @@ -47,7 +47,7 @@ async function serverRestart() { * This sample demonstrates how to Restarts a server. * * @summary Restarts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerRestartWithFailover.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json */ async function serverRestartWithFailover() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStartSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStartSample.ts index 8e00aa85f4f6..c3f8830ee47d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStartSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStartSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Starts a server. * * @summary Starts a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json */ async function serverStart() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStopSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStopSample.ts index c7c5b31fb6be..1d3cab6f2adb 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStopSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversStopSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Stops a server. * * @summary Stops a server. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerStop.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json */ async function serverStop() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversUpdateSample.ts index 973fa39ef17b..95664971b932 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversUpdateSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/serversUpdateSample.ts @@ -21,7 +21,65 @@ dotenv.config(); * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "standalone", promoteOption: "forced" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + */ +async function promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "standalone", promoteOption: "planned" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json */ async function serverUpdate() { const subscriptionId = @@ -54,7 +112,7 @@ async function serverUpdate() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json */ async function serverUpdateWithAadAuthEnabled() { const subscriptionId = @@ -92,7 +150,7 @@ async function serverUpdateWithAadAuthEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ async function serverUpdateWithCustomerMaintenanceWindow() { const subscriptionId = @@ -127,7 +185,7 @@ async function serverUpdateWithCustomerMaintenanceWindow() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json */ async function serverUpdateWithDataEncryptionEnabled() { const subscriptionId = @@ -177,7 +235,7 @@ async function serverUpdateWithDataEncryptionEnabled() { * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json */ async function serverUpdateWithMajorVersionUpgrade() { const subscriptionId = @@ -200,12 +258,74 @@ async function serverUpdateWithMajorVersionUpgrade() { console.log(result); } +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + */ +async function switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "switchover", promoteOption: "forced" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + */ +async function switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup"; + const serverName = "pgtestsvc4-replica"; + const parameters: ServerForUpdate = { + replica: { promoteMode: "switchover", promoteOption: "planned" } + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.servers.beginUpdateAndWait( + resourceGroupName, + serverName, + parameters + ); + console.log(result); +} + async function main() { + promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete(); serverUpdate(); serverUpdateWithAadAuthEnabled(); serverUpdateWithCustomerMaintenanceWindow(); serverUpdateWithDataEncryptionEnabled(); serverUpdateWithMajorVersionUpgrade(); + switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(); + switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica(); } main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsCreateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsCreateSample.ts new file mode 100644 index 000000000000..3104a34c3e65 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsCreateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualEndpointResource, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @summary Creates a new virtual endpoint for PostgreSQL flexible server. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json + */ +async function createANewVirtualEndpointForAFlexibleServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters: VirtualEndpointResource = { + endpointType: "ReadWrite", + members: ["testPrimary1"] + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginCreateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + createANewVirtualEndpointForAFlexibleServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsDeleteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsDeleteSample.ts new file mode 100644 index 000000000000..c44730f9be1a --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsDeleteSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a virtual endpoint. + * + * @summary Deletes a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json + */ +async function deleteAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginDeleteAndWait( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + deleteAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsGetSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsGetSample.ts new file mode 100644 index 000000000000..fc2bb7e012b0 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsGetSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets information about a virtual endpoint. + * + * @summary Gets information about a virtual endpoint. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json + */ +async function getAVirtualEndpoint() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.get( + resourceGroupName, + serverName, + virtualEndpointName + ); + console.log(result); +} + +async function main() { + getAVirtualEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsListByServerSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsListByServerSample.ts new file mode 100644 index 000000000000..b893668c68ea --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsListByServerSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all the servers in a given resource group. + * + * @summary List all the servers in a given resource group. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json + */ +async function virtualEndpointListByServer() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualEndpoints.listByServer( + resourceGroupName, + serverName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + virtualEndpointListByServer(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsUpdateSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsUpdateSample.ts new file mode 100644 index 000000000000..f97fe55bc029 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualEndpointsUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualEndpointResourceForPatch, + PostgreSQLManagementFlexibleServerClient +} from "@azure/arm-postgresql-flexible"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * + * @summary Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json + */ +async function updateAVirtualEndpointForAServerToUpdateThe() { + const subscriptionId = + process.env["POSTGRESQL_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg"; + const serverName = "pgtestsvc4"; + const virtualEndpointName = "pgVirtualEndpoint1"; + const parameters: VirtualEndpointResourceForPatch = { + endpointType: "ReadWrite", + members: ["testReplica1"] + }; + const credential = new DefaultAzureCredential(); + const client = new PostgreSQLManagementFlexibleServerClient( + credential, + subscriptionId + ); + const result = await client.virtualEndpoints.beginUpdateAndWait( + resourceGroupName, + serverName, + virtualEndpointName, + parameters + ); + console.log(result); +} + +async function main() { + updateAVirtualEndpointForAServerToUpdateThe(); +} + +main().catch(console.error); diff --git a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualNetworkSubnetUsageExecuteSample.ts b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualNetworkSubnetUsageExecuteSample.ts index 401449900e33..3d019320892f 100644 --- a/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualNetworkSubnetUsageExecuteSample.ts +++ b/sdk/postgresql/arm-postgresql-flexible/samples/v8-beta/typescript/src/virtualNetworkSubnetUsageExecuteSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Get virtual network subnet usage for a given vNet resource id. * * @summary Get virtual network subnet usage for a given vNet resource id. - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json */ async function virtualNetworkSubnetUsageList() { const subscriptionId = diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts index 7d9f7cf37052..9b6f9b96a849 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts @@ -21,7 +21,7 @@ export interface ActiveDirectoryAdministratorAdd { /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -283,11 +283,12 @@ export interface Storage { autoGrow?: StorageAutoGrow; /** Name of storage tier for IOPS. */ tier?: AzureManagedDiskPerformanceTiers; - /** - * Storage tier IOPS quantity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly iops?: number; + /** Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS */ + iops?: number; + /** Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS */ + throughput?: number; + /** Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not specified */ + type?: StorageType; } /** Authentication configuration properties of a server */ @@ -333,11 +334,8 @@ export interface Backup { /** Network properties of a server. */ export interface Network { - /** - * public network access is enabled or not - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicNetworkAccess?: ServerPublicNetworkAccessState; + /** public network access is enabled or not */ + publicNetworkAccess?: ServerPublicNetworkAccessState; /** Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone. */ delegatedSubnetResourceId?: string; /** Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone. */ @@ -369,6 +367,45 @@ export interface MaintenanceWindow { dayOfWeek?: number; } +/** Replica properties of a server */ +export interface Replica { + /** Used to indicate role of the server in replication set. */ + role?: ReplicationRole; + /** + * Replicas allowed for a server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacity?: number; + /** + * Gets the replication state of a replica server. This property is returned only for replicas api call. Supported values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationState?: ReplicationState; + /** Sets the promote mode for a replica server. This is a write only property. */ + promoteMode?: ReadReplicaPromoteMode; + /** Sets the promote options for a replica server. This is a write only property. */ + promoteOption?: ReplicationPromoteOption; +} + +/** The private endpoint resource. */ +export interface PrivateEndpoint { + /** + * The ARM identifier for private endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + /** Represents a server to be updated. */ export interface ServerForUpdate { /** The SKU (pricing tier) of the server. */ @@ -382,7 +419,7 @@ export interface ServerForUpdate { * This value contains a credential. Consider obscuring before showing to users */ administratorLoginPassword?: string; - /** PostgreSQL Server version. */ + /** PostgreSQL Server version. Version 16 is currently not supported for MVU. */ version?: ServerVersion; /** Storage properties of a server. */ storage?: Storage; @@ -400,6 +437,8 @@ export interface ServerForUpdate { createMode?: CreateModeForUpdate; /** Replication role of the server */ replicationRole?: ReplicationRole; + /** Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. */ + replica?: Replica; /** Network properties of a server. These are required to be passed only in case if server is a private access server. */ network?: Network; } @@ -412,6 +451,68 @@ export interface ServerListResult { nextLink?: string; } +/** BackupRequestBase is the base for all backup request. */ +export interface BackupRequestBase { + /** Backup Settings */ + backupSettings: BackupSettings; +} + +/** The settings for the long term backup. */ +export interface BackupSettings { + /** Backup Name for the current backup */ + backupName: string; +} + +/** Response for the LTR pre-backup API call */ +export interface LtrPreBackupResponse { + /** Number of storage containers the plugin will use during backup. More than one containers may be used for size limitations, parallelism, or redundancy etc. */ + numberOfContainers: number; +} + +/** Details about the target where the backup content will be stored. */ +export interface BackupStoreDetails { + /** List of SAS uri of storage containers where backup data is to be streamed/copied. */ + sasUriList: string[]; +} + +/** Response for the LTR backup API call */ +export interface LtrBackupResponse { + /** Size of datasource in bytes */ + datasourceSizeInBytes?: number; + /** Data transferred in bytes */ + dataTransferredInBytes?: number; + /** Name of Backup operation */ + backupName?: string; + /** Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery point. e.g. Versions, DataFormat etc */ + backupMetadata?: string; + /** Service-set extensible enum indicating the status of operation */ + status?: ExecutionStatus; + /** Start time of the operation. */ + startTime?: Date; + /** End time of the operation. */ + endTime?: Date; + /** PercentageCompleted */ + percentComplete?: number; + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorCode?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorMessage?: string; +} + +/** A list of long term retention backup operations for server. */ +export interface LtrServerBackupOperationList { + /** The list of long term retention server backup operations */ + value?: LtrServerBackupOperation[]; + /** The link used to get the next page of operations. */ + nextLink?: string; +} + /** Migration status. */ export interface MigrationStatus { /** @@ -438,6 +539,90 @@ export interface MigrationSubStateDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly currentSubState?: MigrationSubState; + /** Dictionary of */ + dbDetails?: { [propertyName: string]: DbMigrationStatus }; + /** Details for the validation for migration */ + validationDetails?: ValidationDetails; +} + +/** Migration status of an individual database */ +export interface DbMigrationStatus { + /** Name of the database */ + databaseName?: string; + /** Migration db state of an individual database */ + migrationState?: MigrationDbState; + /** Migration operation of an individual database */ + migrationOperation?: string; + /** Start date-time of a migration state */ + startedOn?: Date; + /** End date-time of a migration state */ + endedOn?: Date; + /** Number of tables queued for the migration of a DB */ + fullLoadQueuedTables?: number; + /** Number of tables errored out during the migration of a DB */ + fullLoadErroredTables?: number; + /** Number of tables loading during the migration of a DB */ + fullLoadLoadingTables?: number; + /** Number of tables loaded during the migration of a DB */ + fullLoadCompletedTables?: number; + /** CDC update counter */ + cdcUpdateCounter?: number; + /** CDC delete counter */ + cdcDeleteCounter?: number; + /** CDC insert counter */ + cdcInsertCounter?: number; + /** CDC applied changes counter */ + appliedChanges?: number; + /** CDC incoming changes counter */ + incomingChanges?: number; + /** Lag in seconds between source and target during online phase */ + latency?: number; + /** Error message, if any, for the migration state */ + message?: string; +} + +/** Details for the validation for migration */ +export interface ValidationDetails { + /** Validation status for migration */ + status?: ValidationState; + /** Validation Start date-time in UTC */ + validationStartTimeInUtc?: Date; + /** Validation End date-time in UTC */ + validationEndTimeInUtc?: Date; + /** Details of server level validations */ + serverLevelValidationDetails?: ValidationSummaryItem[]; + /** Details of server level validations */ + dbLevelValidationDetails?: DbLevelValidationStatus[]; +} + +/** Validation summary object */ +export interface ValidationSummaryItem { + /** Validation type */ + type?: string; + /** Validation status for migration */ + state?: ValidationState; + /** Validation messages */ + messages?: ValidationMessage[]; +} + +/** Validation message object */ +export interface ValidationMessage { + /** Severity of validation message */ + state?: ValidationState; + /** Validation message string */ + message?: string; +} + +/** Validation status summary for an individual database */ +export interface DbLevelValidationStatus { + /** Name of the database */ + databaseName?: string; + /** Start date-time of a database level validation */ + startedOn?: Date; + /** End date-time of a database level validation */ + endedOn?: Date; + /** Summary of database level validations */ + summary?: ValidationSummaryItem[]; } /** Database server metadata. */ @@ -451,16 +636,16 @@ export interface DbServerMetadata { version?: string; /** Storage size in MB for database server */ storageMb?: number; - /** SKU for the database server */ + /** SKU for the database server. This object is empty for PG single server */ sku?: ServerSku; } /** Sku information related properties of a server. */ export interface ServerSku { /** The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. */ - name: string; + name?: string; /** The tier of the particular SKU, e.g. Burstable. */ - tier: SkuTier; + tier?: SkuTier; } /** Migration secret parameters. */ @@ -613,6 +798,70 @@ export interface OperationDisplay { readonly description?: string; } +/** A list of private endpoint connections. */ +export interface PrivateEndpointConnectionListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PrivateEndpointConnection[]; + /** + * The URL to get the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PrivateLinkResource[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Capability for the PostgreSQL server */ +export interface QuotaUsagesListResult { + /** + * A list of quota usages. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: QuotaUsage[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Quota usage for flexible servers */ +export interface QuotaUsage { + /** Name of quota usage for flexible servers */ + name?: NameProperty; + /** Quota limit */ + limit?: number; + /** Quota unit */ + unit?: string; + /** Current Quota usage value */ + currentValue?: number; + /** Fully qualified ARM resource Id */ + id?: string; +} + +/** Name property for quota usage */ +export interface NameProperty { + /** Name value */ + value?: string; + /** Localized name */ + localizedValue?: string; +} + /** A List of logFiles. */ export interface LogFileListResult { /** The list of logFiles in a server */ @@ -629,6 +878,41 @@ export interface RestartParameter { failoverMode?: FailoverMode; } +/** A list of the server's Advanced Threat Protection settings. */ +export interface ServerThreatProtectionListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ServerThreatProtectionSettingsModel[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Represents a virtual endpoint for a server. */ +export interface VirtualEndpointResourceForPatch { + /** The endpoint type for the virtual endpoint. */ + endpointType?: VirtualEndpointType; + /** List of members for a virtual endpoint */ + members?: string[]; + /** + * List of virtual endpoints for a server + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualEndpoints?: string[]; +} + +/** A list of virtual endpoints. */ +export interface VirtualEndpointsListResult { + /** The list of virtual endpoints */ + value?: VirtualEndpointResource[]; + /** The link used to get the next page of operations. */ + nextLink?: string; +} + /** Virtual network subnet usage parameter */ export interface VirtualNetworkSubnetUsageParameter { /** Virtual network resource id. */ @@ -665,71 +949,27 @@ export interface DelegatedSubnetUsage { readonly usage?: number; } -/** BackupRequestBase is the base for all backup request. */ -export interface BackupRequestBase { - /** Backup Settings */ - backupSettings: BackupSettings; -} - -/** The settings for the long term backup. */ -export interface BackupSettings { - /** Backup Name for the current backup */ - backupName: string; -} - -/** Response for the LTR pre-backup API call */ -export interface LtrPreBackupResponse { - /** Number of storage containers the plugin will use during backup. More than one containers may be used for size limitations, parallelism, or redundancy etc. */ - numberOfContainers: number; -} - -/** Details about the target where the backup content will be stored. */ -export interface BackupStoreDetails { - /** List of SAS uri of storage containers where backup data is to be streamed/copied. */ - sasUriList: string[]; -} +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} -/** Response for the LTR backup API call */ -export interface LtrBackupResponse { - /** Size of datasource in bytes */ - datasourceSizeInBytes?: number; - /** Data transferred in bytes */ - dataTransferredInBytes?: number; - /** Name of Backup operation */ - backupName?: string; - /** Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery point. e.g. Versions, DataFormat etc */ - backupMetadata?: string; - /** Service-set extensible enum indicating the status of operation */ - status?: ExecutionStatus; - /** Start time of the operation. */ - startTime?: Date; - /** End time of the operation. */ - endTime?: Date; - /** PercentageCompleted */ - percentComplete?: number; +/** The private endpoint connection resource. */ +export interface PrivateEndpointConnection extends Resource { /** - * The error code. + * The group ids for the private endpoint resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorCode?: string; + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; /** - * The error message. + * The provisioning state of the private endpoint connection resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorMessage?: string; -} - -/** A list of long term retention backup operations for server. */ -export interface LtrServerBackupOperationList { - /** The list of long term retention server backup operations */ - value?: LtrServerBackupOperation[]; - /** The link used to get the next page of operations. */ - nextLink?: string; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; } -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { /** Resource tags. */ @@ -738,6 +978,27 @@ export interface TrackedResource extends Resource { location: string; } +/** A private link resource. */ +export interface PrivateLinkResource extends Resource { + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** Represents a virtual endpoint for a server. */ +export interface VirtualEndpointResource + extends VirtualEndpointResourceForPatch, + Resource {} + /** Represents capability of a storage tier */ export interface StorageTierCapability extends CapabilityBase { /** @@ -759,11 +1020,31 @@ export interface StorageMbCapability extends CapabilityBase { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly supportedIops?: number; + /** + * Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedMaximumIops?: number; /** * Storage size in MB * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly storageSizeMb?: number; + /** + * Maximum value of Storage size in MB + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maximumStorageSizeMb?: number; + /** + * Values of throughput in MB/s + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedThroughput?: number; + /** + * Maximum values of throughput in MB/s + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedMaximumThroughput?: number; /** * Default tier for IOPS * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1066,20 +1347,6 @@ export interface FirewallRule extends ProxyResource { endIpAddress: string; } -/** Represents a logFile. */ -export interface LogFile extends ProxyResource { - /** Creation timestamp of the log file. */ - createdTime?: Date; - /** Last modified timestamp of the log file. */ - lastModifiedTime?: Date; - /** The size in kb of the logFile. */ - sizeInKb?: number; - /** Type of the log file. */ - typePropertiesType?: string; - /** The url to download the log file from. */ - url?: string; -} - /** Response for the LTR backup Operation API call */ export interface LtrServerBackupOperation extends ProxyResource { /** Size of datasource in bytes */ @@ -1110,14 +1377,39 @@ export interface LtrServerBackupOperation extends ProxyResource { readonly errorMessage?: string; } -/** Represents a server. */ -export interface Server extends TrackedResource { - /** The SKU (pricing tier) of the server. */ - sku?: Sku; - /** Describes the identity of the application. */ - identity?: UserAssignedIdentity; - /** The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). */ - administratorLogin?: string; +/** Represents a logFile. */ +export interface LogFile extends ProxyResource { + /** Creation timestamp of the log file. */ + createdTime?: Date; + /** Last modified timestamp of the log file. */ + lastModifiedTime?: Date; + /** The size in kb of the logFile. */ + sizeInKb?: number; + /** Type of the log file. */ + typePropertiesType?: string; + /** The url to download the log file from. */ + url?: string; +} + +/** Server's Advanced Threat Protection settings. */ +export interface ServerThreatProtectionSettingsModel extends ProxyResource { + /** Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied yet on the specific server. */ + state?: ThreatProtectionState; + /** + * Specifies the UTC creation time of the policy. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationTime?: Date; +} + +/** Represents a server. */ +export interface Server extends TrackedResource { + /** The SKU (pricing tier) of the server. */ + sku?: Sku; + /** Describes the identity of the application. */ + identity?: UserAssignedIdentity; + /** The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). */ + administratorLogin?: string; /** * The administrator login password (required for server creation). * This value contains a credential. Consider obscuring before showing to users @@ -1167,8 +1459,15 @@ export interface Server extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly replicaCapacity?: number; + /** Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. */ + replica?: Replica; /** The mode to create a new PostgreSQL server. */ createMode?: CreateMode; + /** + * List of private endpoint connections associated with the specified resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; } /** Represents a migration resource. */ @@ -1185,6 +1484,12 @@ export interface MigrationResource extends TrackedResource { readonly currentStatus?: MigrationStatus; /** There are two types of migration modes Online and Offline */ migrationMode?: MigrationMode; + /** This indicates the supported Migration option for the migration */ + migrationOption?: MigrationOption; + /** migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer */ + sourceType?: SourceType; + /** SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source types */ + sslMode?: SslMode; /** * Metadata of the source database server * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1195,7 +1500,7 @@ export interface MigrationResource extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly targetDbServerMetadata?: DbServerMetadata; - /** ResourceId of the source database server */ + /** ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username */ sourceDbServerResourceId?: string; /** Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection */ sourceDbServerFullyQualifiedDomainName?: string; @@ -1328,6 +1633,31 @@ export interface FlexibleServerStartLtrBackupExceptionHeaders { xMsRequestId?: string; } +/** Defines headers for PrivateEndpointConnection_update operation. */ +export interface PrivateEndpointConnectionUpdateHeaders { + location?: string; +} + +/** Defines headers for PrivateEndpointConnection_delete operation. */ +export interface PrivateEndpointConnectionDeleteHeaders { + location?: string; +} + +/** Defines headers for VirtualEndpoints_create operation. */ +export interface VirtualEndpointsCreateHeaders { + location?: string; +} + +/** Defines headers for VirtualEndpoints_update operation. */ +export interface VirtualEndpointsUpdateHeaders { + location?: string; +} + +/** Defines headers for VirtualEndpoints_delete operation. */ +export interface VirtualEndpointsDeleteHeaders { + location?: string; +} + /** Known values of {@link PrincipalType} that the service accepts. */ export enum KnownPrincipalType { /** Unknown */ @@ -1627,7 +1957,9 @@ export enum KnownServerVersion { /** Twelve */ Twelve = "12", /** Eleven */ - Eleven = "11" + Eleven = "11", + /** Sixteen */ + Sixteen = "16" } /** @@ -1639,7 +1971,8 @@ export enum KnownServerVersion { * **14** \ * **13** \ * **12** \ - * **11** + * **11** \ + * **16** */ export type ServerVersion = string; @@ -1748,6 +2081,24 @@ export enum KnownAzureManagedDiskPerformanceTiers { */ export type AzureManagedDiskPerformanceTiers = string; +/** Known values of {@link StorageType} that the service accepts. */ +export enum KnownStorageType { + /** PremiumLRS */ + PremiumLRS = "Premium_LRS", + /** PremiumV2LRS */ + PremiumV2LRS = "PremiumV2_LRS" +} + +/** + * Defines values for StorageType. \ + * {@link KnownStorageType} can be used interchangeably with StorageType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium_LRS** \ + * **PremiumV2_LRS** + */ +export type StorageType = string; + /** Known values of {@link ActiveDirectoryAuthEnum} that the service accepts. */ export enum KnownActiveDirectoryAuthEnum { /** Enabled */ @@ -1931,6 +2282,72 @@ export enum KnownReplicationRole { */ export type ReplicationRole = string; +/** Known values of {@link ReplicationState} that the service accepts. */ +export enum KnownReplicationState { + /** Active */ + Active = "Active", + /** Catchup */ + Catchup = "Catchup", + /** Provisioning */ + Provisioning = "Provisioning", + /** Updating */ + Updating = "Updating", + /** Broken */ + Broken = "Broken", + /** Reconfiguring */ + Reconfiguring = "Reconfiguring" +} + +/** + * Defines values for ReplicationState. \ + * {@link KnownReplicationState} can be used interchangeably with ReplicationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Catchup** \ + * **Provisioning** \ + * **Updating** \ + * **Broken** \ + * **Reconfiguring** + */ +export type ReplicationState = string; + +/** Known values of {@link ReadReplicaPromoteMode} that the service accepts. */ +export enum KnownReadReplicaPromoteMode { + /** Standalone */ + Standalone = "standalone", + /** Switchover */ + Switchover = "switchover" +} + +/** + * Defines values for ReadReplicaPromoteMode. \ + * {@link KnownReadReplicaPromoteMode} can be used interchangeably with ReadReplicaPromoteMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **standalone** \ + * **switchover** + */ +export type ReadReplicaPromoteMode = string; + +/** Known values of {@link ReplicationPromoteOption} that the service accepts. */ +export enum KnownReplicationPromoteOption { + /** Planned */ + Planned = "planned", + /** Forced */ + Forced = "forced" +} + +/** + * Defines values for ReplicationPromoteOption. \ + * {@link KnownReplicationPromoteOption} can be used interchangeably with ReplicationPromoteOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **planned** \ + * **forced** + */ +export type ReplicationPromoteOption = string; + /** Known values of {@link CreateMode} that the service accepts. */ export enum KnownCreateMode { /** Default */ @@ -1964,6 +2381,51 @@ export enum KnownCreateMode { */ export type CreateMode = string; +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + /** Known values of {@link CreateModeForUpdate} that the service accepts. */ export enum KnownCreateModeForUpdate { /** Default */ @@ -1982,6 +2444,30 @@ export enum KnownCreateModeForUpdate { */ export type CreateModeForUpdate = string; +/** Known values of {@link ExecutionStatus} that the service accepts. */ +export enum KnownExecutionStatus { + /** Running */ + Running = "Running", + /** Cancelled */ + Cancelled = "Cancelled", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded" +} + +/** + * Defines values for ExecutionStatus. \ + * {@link KnownExecutionStatus} can be used interchangeably with ExecutionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Running** \ + * **Cancelled** \ + * **Failed** \ + * **Succeeded** + */ +export type ExecutionStatus = string; + /** Known values of {@link MigrationState} that the service accepts. */ export enum KnownMigrationState { /** InProgress */ @@ -1993,7 +2479,11 @@ export enum KnownMigrationState { /** Failed */ Failed = "Failed", /** Succeeded */ - Succeeded = "Succeeded" + Succeeded = "Succeeded", + /** ValidationFailed */ + ValidationFailed = "ValidationFailed", + /** CleaningUp */ + CleaningUp = "CleaningUp" } /** @@ -2005,7 +2495,9 @@ export enum KnownMigrationState { * **WaitingForUserAction** \ * **Canceled** \ * **Failed** \ - * **Succeeded** + * **Succeeded** \ + * **ValidationFailed** \ + * **CleaningUp** */ export type MigrationState = string; @@ -2030,7 +2522,11 @@ export enum KnownMigrationSubState { /** CompletingMigration */ CompletingMigration = "CompletingMigration", /** Completed */ - Completed = "Completed" + Completed = "Completed", + /** CancelingRequestedDBMigrations */ + CancelingRequestedDBMigrations = "CancelingRequestedDBMigrations", + /** ValidationInProgress */ + ValidationInProgress = "ValidationInProgress" } /** @@ -2047,10 +2543,63 @@ export enum KnownMigrationSubState { * **MigratingData** \ * **WaitingForCutoverTrigger** \ * **CompletingMigration** \ - * **Completed** + * **Completed** \ + * **CancelingRequestedDBMigrations** \ + * **ValidationInProgress** */ export type MigrationSubState = string; +/** Known values of {@link MigrationDbState} that the service accepts. */ +export enum KnownMigrationDbState { + /** InProgress */ + InProgress = "InProgress", + /** WaitingForCutoverTrigger */ + WaitingForCutoverTrigger = "WaitingForCutoverTrigger", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceling */ + Canceling = "Canceling" +} + +/** + * Defines values for MigrationDbState. \ + * {@link KnownMigrationDbState} can be used interchangeably with MigrationDbState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InProgress** \ + * **WaitingForCutoverTrigger** \ + * **Failed** \ + * **Canceled** \ + * **Succeeded** \ + * **Canceling** + */ +export type MigrationDbState = string; + +/** Known values of {@link ValidationState} that the service accepts. */ +export enum KnownValidationState { + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Warning */ + Warning = "Warning" +} + +/** + * Defines values for ValidationState. \ + * {@link KnownValidationState} can be used interchangeably with ValidationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Failed** \ + * **Succeeded** \ + * **Warning** + */ +export type ValidationState = string; + /** Known values of {@link MigrationMode} that the service accepts. */ export enum KnownMigrationMode { /** Offline */ @@ -2069,6 +2618,78 @@ export enum KnownMigrationMode { */ export type MigrationMode = string; +/** Known values of {@link MigrationOption} that the service accepts. */ +export enum KnownMigrationOption { + /** Validate */ + Validate = "Validate", + /** Migrate */ + Migrate = "Migrate", + /** ValidateAndMigrate */ + ValidateAndMigrate = "ValidateAndMigrate" +} + +/** + * Defines values for MigrationOption. \ + * {@link KnownMigrationOption} can be used interchangeably with MigrationOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Validate** \ + * **Migrate** \ + * **ValidateAndMigrate** + */ +export type MigrationOption = string; + +/** Known values of {@link SourceType} that the service accepts. */ +export enum KnownSourceType { + /** OnPremises */ + OnPremises = "OnPremises", + /** AWS */ + AWS = "AWS", + /** GCP */ + GCP = "GCP", + /** AzureVM */ + AzureVM = "AzureVM", + /** PostgreSQLSingleServer */ + PostgreSQLSingleServer = "PostgreSQLSingleServer" +} + +/** + * Defines values for SourceType. \ + * {@link KnownSourceType} can be used interchangeably with SourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OnPremises** \ + * **AWS** \ + * **GCP** \ + * **AzureVM** \ + * **PostgreSQLSingleServer** + */ +export type SourceType = string; + +/** Known values of {@link SslMode} that the service accepts. */ +export enum KnownSslMode { + /** Prefer */ + Prefer = "Prefer", + /** Require */ + Require = "Require", + /** VerifyCA */ + VerifyCA = "VerifyCA", + /** VerifyFull */ + VerifyFull = "VerifyFull" +} + +/** + * Defines values for SslMode. \ + * {@link KnownSslMode} can be used interchangeably with SslMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Prefer** \ + * **Require** \ + * **VerifyCA** \ + * **VerifyFull** + */ +export type SslMode = string; + /** Known values of {@link LogicalReplicationOnSourceDbEnum} that the service accepts. */ export enum KnownLogicalReplicationOnSourceDbEnum { /** True */ @@ -2240,29 +2861,35 @@ export enum KnownFailoverMode { */ export type FailoverMode = string; -/** Known values of {@link ExecutionStatus} that the service accepts. */ -export enum KnownExecutionStatus { - /** Running */ - Running = "Running", - /** Cancelled */ - Cancelled = "Cancelled", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded" +/** Known values of {@link ThreatProtectionName} that the service accepts. */ +export enum KnownThreatProtectionName { + /** Default */ + Default = "Default" } /** - * Defines values for ExecutionStatus. \ - * {@link KnownExecutionStatus} can be used interchangeably with ExecutionStatus, + * Defines values for ThreatProtectionName. \ + * {@link KnownThreatProtectionName} can be used interchangeably with ThreatProtectionName, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Running** \ - * **Cancelled** \ - * **Failed** \ - * **Succeeded** + * **Default** */ -export type ExecutionStatus = string; +export type ThreatProtectionName = string; + +/** Known values of {@link VirtualEndpointType} that the service accepts. */ +export enum KnownVirtualEndpointType { + /** ReadWrite */ + ReadWrite = "ReadWrite" +} + +/** + * Defines values for VirtualEndpointType. \ + * {@link KnownVirtualEndpointType} can be used interchangeably with VirtualEndpointType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ReadWrite** + */ +export type VirtualEndpointType = string; /** Known values of {@link MigrationDetailsLevel} that the service accepts. */ export enum KnownMigrationDetailsLevel { @@ -2286,6 +2913,8 @@ export enum KnownMigrationDetailsLevel { export type MigrationDetailsLevel = string; /** Defines values for CapabilityStatus. */ export type CapabilityStatus = "Visible" | "Available" | "Default" | "Disabled"; +/** Defines values for ThreatProtectionState. */ +export type ThreatProtectionState = "Enabled" | "Disabled"; /** Optional parameters. */ export interface AdministratorsCreateOptionalParams @@ -2615,6 +3244,48 @@ export interface ServersListNextOptionalParams /** Contains response data for the listNext operation. */ export type ServersListNextResponse = ServerListResult; +/** Optional parameters. */ +export interface FlexibleServerTriggerLtrPreBackupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the triggerLtrPreBackup operation. */ +export type FlexibleServerTriggerLtrPreBackupResponse = FlexibleServerTriggerLtrPreBackupHeaders & + LtrPreBackupResponse; + +/** Optional parameters. */ +export interface FlexibleServerStartLtrBackupOptionalParams + 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; +} + +/** Contains response data for the startLtrBackup operation. */ +export type FlexibleServerStartLtrBackupResponse = FlexibleServerStartLtrBackupHeaders & + LtrBackupResponse; + +/** Optional parameters. */ +export interface LtrBackupOperationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type LtrBackupOperationsGetResponse = LtrServerBackupOperation; + +/** Optional parameters. */ +export interface LtrBackupOperationsListByServerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServer operation. */ +export type LtrBackupOperationsListByServerResponse = LtrServerBackupOperationList; + +/** Optional parameters. */ +export interface LtrBackupOperationsListByServerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServerNext operation. */ +export type LtrBackupOperationsListByServerNextResponse = LtrServerBackupOperationList; + /** Optional parameters. */ export interface MigrationsCreateOptionalParams extends coreClient.OperationOptions {} @@ -2681,6 +3352,86 @@ export type GetPrivateDnsZoneSuffixExecuteResponse = { body: string; }; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByServerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServer operation. */ +export type PrivateEndpointConnectionsListByServerResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByServerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServerNext operation. */ +export type PrivateEndpointConnectionsListByServerNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionUpdateOptionalParams + 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; +} + +/** Contains response data for the update operation. */ +export type PrivateEndpointConnectionUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionDeleteOptionalParams + 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; +} + +/** Contains response data for the delete operation. */ +export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionDeleteHeaders; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByServerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServer operation. */ +export type PrivateLinkResourcesListByServerResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByServerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServerNext operation. */ +export type PrivateLinkResourcesListByServerNextResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface QuotaUsagesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type QuotaUsagesListResponse = QuotaUsagesListResult; + +/** Optional parameters. */ +export interface QuotaUsagesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type QuotaUsagesListNextResponse = QuotaUsagesListResult; + /** Optional parameters. */ export interface ReplicasListByServerOptionalParams extends coreClient.OperationOptions {} @@ -2703,22 +3454,21 @@ export interface LogFilesListByServerNextOptionalParams export type LogFilesListByServerNextResponse = LogFileListResult; /** Optional parameters. */ -export interface VirtualNetworkSubnetUsageExecuteOptionalParams +export interface ServerThreatProtectionSettingsListByServerOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the execute operation. */ -export type VirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsageResult; +/** Contains response data for the listByServer operation. */ +export type ServerThreatProtectionSettingsListByServerResponse = ServerThreatProtectionListResult; /** Optional parameters. */ -export interface FlexibleServerTriggerLtrPreBackupOptionalParams +export interface ServerThreatProtectionSettingsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the triggerLtrPreBackup operation. */ -export type FlexibleServerTriggerLtrPreBackupResponse = FlexibleServerTriggerLtrPreBackupHeaders & - LtrPreBackupResponse; +/** Contains response data for the get operation. */ +export type ServerThreatProtectionSettingsGetResponse = ServerThreatProtectionSettingsModel; /** Optional parameters. */ -export interface FlexibleServerStartLtrBackupOptionalParams +export interface ServerThreatProtectionSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -2726,30 +3476,79 @@ export interface FlexibleServerStartLtrBackupOptionalParams resumeFrom?: string; } -/** Contains response data for the startLtrBackup operation. */ -export type FlexibleServerStartLtrBackupResponse = FlexibleServerStartLtrBackupHeaders & - LtrBackupResponse; +/** Contains response data for the createOrUpdate operation. */ +export type ServerThreatProtectionSettingsCreateOrUpdateResponse = ServerThreatProtectionSettingsModel; /** Optional parameters. */ -export interface LtrBackupOperationsGetOptionalParams +export interface ServerThreatProtectionSettingsListByServerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServerNext operation. */ +export type ServerThreatProtectionSettingsListByServerNextResponse = ServerThreatProtectionListResult; + +/** Optional parameters. */ +export interface VirtualEndpointsCreateOptionalParams + 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; +} + +/** Contains response data for the create operation. */ +export type VirtualEndpointsCreateResponse = VirtualEndpointResource; + +/** Optional parameters. */ +export interface VirtualEndpointsUpdateOptionalParams + 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; +} + +/** Contains response data for the update operation. */ +export type VirtualEndpointsUpdateResponse = VirtualEndpointResource; + +/** Optional parameters. */ +export interface VirtualEndpointsDeleteOptionalParams + 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; +} + +/** Contains response data for the delete operation. */ +export type VirtualEndpointsDeleteResponse = VirtualEndpointsDeleteHeaders; + +/** Optional parameters. */ +export interface VirtualEndpointsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type LtrBackupOperationsGetResponse = LtrServerBackupOperation; +export type VirtualEndpointsGetResponse = VirtualEndpointResource; /** Optional parameters. */ -export interface LtrBackupOperationsListByServerOptionalParams +export interface VirtualEndpointsListByServerOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByServer operation. */ -export type LtrBackupOperationsListByServerResponse = LtrServerBackupOperationList; +export type VirtualEndpointsListByServerResponse = VirtualEndpointsListResult; /** Optional parameters. */ -export interface LtrBackupOperationsListByServerNextOptionalParams +export interface VirtualEndpointsListByServerNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByServerNext operation. */ -export type LtrBackupOperationsListByServerNextResponse = LtrServerBackupOperationList; +export type VirtualEndpointsListByServerNextResponse = VirtualEndpointsListResult; + +/** Optional parameters. */ +export interface VirtualNetworkSubnetUsageExecuteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the execute operation. */ +export type VirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsageResult; /** Optional parameters. */ export interface PostgreSQLManagementFlexibleServerClientOptionalParams diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts index e7cd310ed701..e7964e551646 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts @@ -632,10 +632,21 @@ export const Storage: coreClient.CompositeMapper = { }, iops: { serializedName: "iops", - readOnly: true, type: { name: "Number" } + }, + throughput: { + serializedName: "throughput", + type: { + name: "Number" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } } } } @@ -758,7 +769,6 @@ export const Network: coreClient.CompositeMapper = { modelProperties: { publicNetworkAccess: { serializedName: "publicNetworkAccess", - readOnly: true, type: { name: "String" } @@ -846,6 +856,90 @@ export const MaintenanceWindow: coreClient.CompositeMapper = { } }; +export const Replica: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Replica", + modelProperties: { + role: { + serializedName: "role", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + readOnly: true, + type: { + name: "Number" + } + }, + replicationState: { + serializedName: "replicationState", + readOnly: true, + type: { + name: "String" + } + }, + promoteMode: { + serializedName: "promoteMode", + type: { + name: "String" + } + }, + promoteOption: { + serializedName: "promoteOption", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + export const ServerForUpdate: coreClient.CompositeMapper = { type: { name: "Composite", @@ -938,6 +1032,13 @@ export const ServerForUpdate: coreClient.CompositeMapper = { name: "String" } }, + replica: { + serializedName: "properties.replica", + type: { + name: "Composite", + className: "Replica" + } + }, network: { serializedName: "properties.network", type: { @@ -976,44 +1077,30 @@ export const ServerListResult: coreClient.CompositeMapper = { } }; -export const MigrationStatus: coreClient.CompositeMapper = { +export const BackupRequestBase: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MigrationStatus", + className: "BackupRequestBase", modelProperties: { - state: { - serializedName: "state", - readOnly: true, - type: { - name: "String" - } - }, - error: { - serializedName: "error", - readOnly: true, - type: { - name: "String" - } - }, - currentSubStateDetails: { - serializedName: "currentSubStateDetails", + backupSettings: { + serializedName: "backupSettings", type: { name: "Composite", - className: "MigrationSubStateDetails" + className: "BackupSettings" } } } } }; -export const MigrationSubStateDetails: coreClient.CompositeMapper = { +export const BackupSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MigrationSubStateDetails", + className: "BackupSettings", modelProperties: { - currentSubState: { - serializedName: "currentSubState", - readOnly: true, + backupName: { + serializedName: "backupName", + required: true, type: { name: "String" } @@ -1022,150 +1109,596 @@ export const MigrationSubStateDetails: coreClient.CompositeMapper = { } }; -export const DbServerMetadata: coreClient.CompositeMapper = { +export const LtrPreBackupResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DbServerMetadata", + className: "LtrPreBackupResponse", modelProperties: { - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String" - } - }, - version: { - serializedName: "version", - type: { - name: "String" - } - }, - storageMb: { - serializedName: "storageMb", + numberOfContainers: { + serializedName: "properties.numberOfContainers", + required: true, type: { name: "Number" } - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "ServerSku" - } } } } }; -export const ServerSku: coreClient.CompositeMapper = { +export const BackupStoreDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerSku", + className: "BackupStoreDetails", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - tier: { - serializedName: "tier", + sasUriList: { + serializedName: "sasUriList", required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const MigrationSecretParameters: coreClient.CompositeMapper = { +export const LtrBackupResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MigrationSecretParameters", + className: "LtrBackupResponse", modelProperties: { - adminCredentials: { - serializedName: "adminCredentials", + datasourceSizeInBytes: { + serializedName: "properties.datasourceSizeInBytes", type: { - name: "Composite", - className: "AdminCredentials" + name: "Number" } }, - sourceServerUsername: { - serializedName: "sourceServerUsername", + dataTransferredInBytes: { + serializedName: "properties.dataTransferredInBytes", type: { - name: "String" + name: "Number" } }, - targetServerUsername: { - serializedName: "targetServerUsername", + backupName: { + serializedName: "properties.backupName", type: { name: "String" } - } - } - } -}; - -export const AdminCredentials: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdminCredentials", - modelProperties: { - sourceServerPassword: { - serializedName: "sourceServerPassword", - required: true, + }, + backupMetadata: { + serializedName: "properties.backupMetadata", type: { name: "String" } }, - targetServerPassword: { - serializedName: "targetServerPassword", - required: true, + status: { + serializedName: "properties.status", type: { name: "String" } - } - } - } -}; - -export const MigrationResourceForPatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MigrationResourceForPatch", - modelProperties: { - tags: { - serializedName: "tags", + }, + startTime: { + serializedName: "properties.startTime", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTime" } }, - sourceDbServerResourceId: { - serializedName: "properties.sourceDbServerResourceId", + endTime: { + serializedName: "properties.endTime", type: { - name: "String" + name: "DateTime" } }, - sourceDbServerFullyQualifiedDomainName: { - serializedName: "properties.sourceDbServerFullyQualifiedDomainName", + percentComplete: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "properties.percentComplete", type: { - name: "String" + name: "Number" } }, - targetDbServerFullyQualifiedDomainName: { - serializedName: "properties.targetDbServerFullyQualifiedDomainName", + errorCode: { + serializedName: "properties.errorCode", + readOnly: true, type: { name: "String" } }, - secretParameters: { - serializedName: "properties.secretParameters", + errorMessage: { + serializedName: "properties.errorMessage", + readOnly: true, type: { - name: "Composite", - className: "MigrationSecretParameters" + name: "String" + } + } + } + } +}; + +export const LtrServerBackupOperationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LtrServerBackupOperationList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LtrServerBackupOperation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MigrationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MigrationStatus", + modelProperties: { + state: { + serializedName: "state", + readOnly: true, + type: { + name: "String" + } + }, + error: { + serializedName: "error", + readOnly: true, + type: { + name: "String" + } + }, + currentSubStateDetails: { + serializedName: "currentSubStateDetails", + type: { + name: "Composite", + className: "MigrationSubStateDetails" + } + } + } + } +}; + +export const MigrationSubStateDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MigrationSubStateDetails", + modelProperties: { + currentSubState: { + serializedName: "currentSubState", + readOnly: true, + type: { + name: "String" + } + }, + dbDetails: { + serializedName: "dbDetails", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "DbMigrationStatus" } } + } + }, + validationDetails: { + serializedName: "validationDetails", + type: { + name: "Composite", + className: "ValidationDetails" + } + } + } + } +}; + +export const DbMigrationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DbMigrationStatus", + modelProperties: { + databaseName: { + serializedName: "databaseName", + type: { + name: "String" + } + }, + migrationState: { + serializedName: "migrationState", + type: { + name: "String" + } + }, + migrationOperation: { + serializedName: "migrationOperation", + type: { + name: "String" + } + }, + startedOn: { + serializedName: "startedOn", + type: { + name: "DateTime" + } + }, + endedOn: { + serializedName: "endedOn", + type: { + name: "DateTime" + } + }, + fullLoadQueuedTables: { + serializedName: "fullLoadQueuedTables", + type: { + name: "Number" + } + }, + fullLoadErroredTables: { + serializedName: "fullLoadErroredTables", + type: { + name: "Number" + } + }, + fullLoadLoadingTables: { + serializedName: "fullLoadLoadingTables", + type: { + name: "Number" + } + }, + fullLoadCompletedTables: { + serializedName: "fullLoadCompletedTables", + type: { + name: "Number" + } + }, + cdcUpdateCounter: { + serializedName: "cdcUpdateCounter", + type: { + name: "Number" + } + }, + cdcDeleteCounter: { + serializedName: "cdcDeleteCounter", + type: { + name: "Number" + } + }, + cdcInsertCounter: { + serializedName: "cdcInsertCounter", + type: { + name: "Number" + } + }, + appliedChanges: { + serializedName: "appliedChanges", + type: { + name: "Number" + } + }, + incomingChanges: { + serializedName: "incomingChanges", + type: { + name: "Number" + } + }, + latency: { + serializedName: "latency", + type: { + name: "Number" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ValidationDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationDetails", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + validationStartTimeInUtc: { + serializedName: "validationStartTimeInUtc", + type: { + name: "DateTime" + } + }, + validationEndTimeInUtc: { + serializedName: "validationEndTimeInUtc", + type: { + name: "DateTime" + } + }, + serverLevelValidationDetails: { + serializedName: "serverLevelValidationDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationSummaryItem" + } + } + } + }, + dbLevelValidationDetails: { + serializedName: "dbLevelValidationDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DbLevelValidationStatus" + } + } + } + } + } + } +}; + +export const ValidationSummaryItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationSummaryItem", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } + }, + messages: { + serializedName: "messages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationMessage" + } + } + } + } + } + } +}; + +export const ValidationMessage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationMessage", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const DbLevelValidationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DbLevelValidationStatus", + modelProperties: { + databaseName: { + serializedName: "databaseName", + type: { + name: "String" + } + }, + startedOn: { + serializedName: "startedOn", + type: { + name: "DateTime" + } + }, + endedOn: { + serializedName: "endedOn", + type: { + name: "DateTime" + } + }, + summary: { + serializedName: "summary", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationSummaryItem" + } + } + } + } + } + } +}; + +export const DbServerMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DbServerMetadata", + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + }, + storageMb: { + serializedName: "storageMb", + type: { + name: "Number" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ServerSku" + } + } + } + } +}; + +export const ServerSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + +export const MigrationSecretParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MigrationSecretParameters", + modelProperties: { + adminCredentials: { + serializedName: "adminCredentials", + type: { + name: "Composite", + className: "AdminCredentials" + } + }, + sourceServerUsername: { + serializedName: "sourceServerUsername", + type: { + name: "String" + } + }, + targetServerUsername: { + serializedName: "targetServerUsername", + type: { + name: "String" + } + } + } + } +}; + +export const AdminCredentials: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AdminCredentials", + modelProperties: { + sourceServerPassword: { + serializedName: "sourceServerPassword", + required: true, + type: { + name: "String" + } + }, + targetServerPassword: { + serializedName: "targetServerPassword", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MigrationResourceForPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MigrationResourceForPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + sourceDbServerResourceId: { + serializedName: "properties.sourceDbServerResourceId", + type: { + name: "String" + } + }, + sourceDbServerFullyQualifiedDomainName: { + serializedName: "properties.sourceDbServerFullyQualifiedDomainName", + type: { + name: "String" + } + }, + targetDbServerFullyQualifiedDomainName: { + serializedName: "properties.targetDbServerFullyQualifiedDomainName", + type: { + name: "String" + } + }, + secretParameters: { + serializedName: "properties.secretParameters", + type: { + name: "Composite", + className: "MigrationSecretParameters" } }, dbsToMigrate: { @@ -1396,35 +1929,184 @@ export const Operation: coreClient.CompositeMapper = { } }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const QuotaUsagesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaUsagesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QuotaUsage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const QuotaUsage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaUsage", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "Composite", + className: "NameProperty" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + unit: { + defaultValue: "Count", + serializedName: "unit", + type: { + name: "String" + } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const NameProperty: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "NameProperty", modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - readOnly: true, + value: { + serializedName: "value", type: { name: "String" } }, - description: { - serializedName: "description", - readOnly: true, + localizedValue: { + serializedName: "localizedValue", type: { name: "String" } @@ -1481,48 +2163,26 @@ export const RestartParameter: coreClient.CompositeMapper = { } }; -export const VirtualNetworkSubnetUsageParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkSubnetUsageParameter", - modelProperties: { - virtualNetworkArmResourceId: { - serializedName: "virtualNetworkArmResourceId", - type: { - name: "String" - } - } - } - } -}; - -export const VirtualNetworkSubnetUsageResult: coreClient.CompositeMapper = { +export const ServerThreatProtectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualNetworkSubnetUsageResult", + className: "ServerThreatProtectionListResult", modelProperties: { - delegatedSubnetsUsage: { - serializedName: "delegatedSubnetsUsage", + value: { + serializedName: "value", readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DelegatedSubnetUsage" + className: "ServerThreatProtectionSettingsModel" } } } }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String" - } - }, - subscriptionId: { - serializedName: "subscriptionId", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { name: "String" @@ -1532,53 +2192,63 @@ export const VirtualNetworkSubnetUsageResult: coreClient.CompositeMapper = { } }; -export const DelegatedSubnetUsage: coreClient.CompositeMapper = { +export const VirtualEndpointResourceForPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DelegatedSubnetUsage", + className: "VirtualEndpointResourceForPatch", modelProperties: { - subnetName: { - serializedName: "subnetName", - readOnly: true, + endpointType: { + serializedName: "properties.endpointType", type: { name: "String" } }, - usage: { - serializedName: "usage", + members: { + serializedName: "properties.members", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + virtualEndpoints: { + serializedName: "properties.virtualEndpoints", readOnly: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const BackupRequestBase: coreClient.CompositeMapper = { +export const VirtualEndpointsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupRequestBase", + className: "VirtualEndpointsListResult", modelProperties: { - backupSettings: { - serializedName: "backupSettings", + value: { + serializedName: "value", type: { - name: "Composite", - className: "BackupSettings" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualEndpointResource" + } + } } - } - } - } -}; - -export const BackupSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BackupSettings", - modelProperties: { - backupName: { - serializedName: "backupName", - required: true, + }, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1587,109 +2257,48 @@ export const BackupSettings: coreClient.CompositeMapper = { } }; -export const LtrPreBackupResponse: coreClient.CompositeMapper = { +export const VirtualNetworkSubnetUsageParameter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LtrPreBackupResponse", + className: "VirtualNetworkSubnetUsageParameter", modelProperties: { - numberOfContainers: { - serializedName: "properties.numberOfContainers", - required: true, + virtualNetworkArmResourceId: { + serializedName: "virtualNetworkArmResourceId", type: { - name: "Number" + name: "String" } } } } }; -export const BackupStoreDetails: coreClient.CompositeMapper = { +export const VirtualNetworkSubnetUsageResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupStoreDetails", + className: "VirtualNetworkSubnetUsageResult", modelProperties: { - sasUriList: { - serializedName: "sasUriList", - required: true, + delegatedSubnetsUsage: { + serializedName: "delegatedSubnetsUsage", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "DelegatedSubnetUsage" } } } - } - } - } -}; - -export const LtrBackupResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LtrBackupResponse", - modelProperties: { - datasourceSizeInBytes: { - serializedName: "properties.datasourceSizeInBytes", - type: { - name: "Number" - } - }, - dataTransferredInBytes: { - serializedName: "properties.dataTransferredInBytes", - type: { - name: "Number" - } - }, - backupName: { - serializedName: "properties.backupName", - type: { - name: "String" - } - }, - backupMetadata: { - serializedName: "properties.backupMetadata", - type: { - name: "String" - } - }, - status: { - serializedName: "properties.status", - type: { - name: "String" - } - }, - startTime: { - serializedName: "properties.startTime", - type: { - name: "DateTime" - } - }, - endTime: { - serializedName: "properties.endTime", - type: { - name: "DateTime" - } - }, - percentComplete: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0 - }, - serializedName: "properties.percentComplete", - type: { - name: "Number" - } }, - errorCode: { - serializedName: "properties.errorCode", + location: { + serializedName: "location", readOnly: true, type: { name: "String" } }, - errorMessage: { - serializedName: "properties.errorMessage", + subscriptionId: { + serializedName: "subscriptionId", readOnly: true, type: { name: "String" @@ -1699,27 +2308,23 @@ export const LtrBackupResponse: coreClient.CompositeMapper = { } }; -export const LtrServerBackupOperationList: coreClient.CompositeMapper = { +export const DelegatedSubnetUsage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LtrServerBackupOperationList", + className: "DelegatedSubnetUsage", modelProperties: { - value: { - serializedName: "value", + subnetName: { + serializedName: "subnetName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LtrServerBackupOperation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + usage: { + serializedName: "usage", + readOnly: true, type: { - name: "String" + name: "Number" } } } @@ -1736,6 +2341,49 @@ export const ProxyResource: coreClient.CompositeMapper = { } }; +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + groupIds: { + serializedName: "properties.groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1760,6 +2408,57 @@ export const TrackedResource: coreClient.CompositeMapper = { } }; +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const VirtualEndpointResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEndpointResource", + modelProperties: { + ...VirtualEndpointResourceForPatch.type.modelProperties, + ...Resource.type.modelProperties + } + } +}; + export const StorageTierCapability: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1797,6 +2496,13 @@ export const StorageMbCapability: coreClient.CompositeMapper = { name: "Number" } }, + supportedMaximumIops: { + serializedName: "supportedMaximumIops", + readOnly: true, + type: { + name: "Number" + } + }, storageSizeMb: { serializedName: "storageSizeMb", readOnly: true, @@ -1804,6 +2510,27 @@ export const StorageMbCapability: coreClient.CompositeMapper = { name: "Number" } }, + maximumStorageSizeMb: { + serializedName: "maximumStorageSizeMb", + readOnly: true, + type: { + name: "Number" + } + }, + supportedThroughput: { + serializedName: "supportedThroughput", + readOnly: true, + type: { + name: "Number" + } + }, + supportedMaximumThroughput: { + serializedName: "supportedMaximumThroughput", + readOnly: true, + type: { + name: "Number" + } + }, defaultIopsTier: { serializedName: "defaultIopsTier", readOnly: true, @@ -2415,46 +3142,6 @@ export const FirewallRule: coreClient.CompositeMapper = { } }; -export const LogFile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFile", - modelProperties: { - ...ProxyResource.type.modelProperties, - createdTime: { - serializedName: "properties.createdTime", - type: { - name: "DateTime" - } - }, - lastModifiedTime: { - serializedName: "properties.lastModifiedTime", - type: { - name: "DateTime" - } - }, - sizeInKb: { - serializedName: "properties.sizeInKb", - type: { - name: "Number" - } - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String" - } - }, - url: { - serializedName: "properties.url", - type: { - name: "String" - } - } - } - } -}; - export const LtrServerBackupOperation: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2531,6 +3218,70 @@ export const LtrServerBackupOperation: coreClient.CompositeMapper = { } }; +export const LogFile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogFile", + modelProperties: { + ...ProxyResource.type.modelProperties, + createdTime: { + serializedName: "properties.createdTime", + type: { + name: "DateTime" + } + }, + lastModifiedTime: { + serializedName: "properties.lastModifiedTime", + type: { + name: "DateTime" + } + }, + sizeInKb: { + serializedName: "properties.sizeInKb", + type: { + name: "Number" + } + }, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + url: { + serializedName: "properties.url", + type: { + name: "String" + } + } + } + } +}; + +export const ServerThreatProtectionSettingsModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerThreatProtectionSettingsModel", + modelProperties: { + ...ProxyResource.type.modelProperties, + state: { + serializedName: "properties.state", + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + creationTime: { + serializedName: "properties.creationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const Server: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2671,11 +3422,31 @@ export const Server: coreClient.CompositeMapper = { name: "Number" } }, + replica: { + serializedName: "properties.replica", + type: { + name: "Composite", + className: "Replica" + } + }, createMode: { serializedName: "properties.createMode", type: { name: "String" } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } } } } @@ -2707,6 +3478,24 @@ export const MigrationResource: coreClient.CompositeMapper = { name: "String" } }, + migrationOption: { + serializedName: "properties.migrationOption", + type: { + name: "String" + } + }, + sourceType: { + serializedName: "properties.sourceType", + type: { + name: "String" + } + }, + sslMode: { + serializedName: "properties.sslMode", + type: { + name: "String" + } + }, sourceDbServerMetadata: { serializedName: "properties.sourceDbServerMetadata", type: { @@ -3116,3 +3905,78 @@ export const FlexibleServerStartLtrBackupExceptionHeaders: coreClient.CompositeM } } }; + +export const PrivateEndpointConnectionUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualEndpointsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEndpointsCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualEndpointsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEndpointsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualEndpointsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEndpointsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts index 9c180de4ef4f..335a009b3668 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts @@ -21,12 +21,16 @@ import { Server as ServerMapper, ServerForUpdate as ServerForUpdateMapper, RestartParameter as RestartParameterMapper, + LtrPreBackupRequest as LtrPreBackupRequestMapper, + LtrBackupRequest as LtrBackupRequestMapper, MigrationResource as MigrationResourceMapper, MigrationResourceForPatch as MigrationResourceForPatchMapper, MigrationNameAvailabilityResource as MigrationNameAvailabilityResourceMapper, - VirtualNetworkSubnetUsageParameter as VirtualNetworkSubnetUsageParameterMapper, - LtrPreBackupRequest as LtrPreBackupRequestMapper, - LtrBackupRequest as LtrBackupRequestMapper + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + ServerThreatProtectionSettingsModel as ServerThreatProtectionSettingsModelMapper, + VirtualEndpointResource as VirtualEndpointResourceMapper, + VirtualEndpointResourceForPatch as VirtualEndpointResourceForPatchMapper, + VirtualNetworkSubnetUsageParameter as VirtualNetworkSubnetUsageParameterMapper } from "../models/mappers"; export const contentType: OperationParameter = { @@ -73,13 +77,10 @@ export const $host: OperationURLParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1 - }, serializedName: "subscriptionId", required: true, type: { - name: "String" + name: "Uuid" } } }; @@ -129,7 +130,7 @@ export const objectId: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-03-01-preview", + defaultValue: "2023-06-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -266,6 +267,30 @@ export const parameters7: OperationParameter = { }; export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: LtrPreBackupRequestMapper +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: LtrBackupRequestMapper +}; + +export const backupName1: OperationURLParameter = { + parameterPath: "backupName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*") + }, + serializedName: "backupName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters10: OperationParameter = { parameterPath: "parameters", mapper: MigrationResourceMapper }; @@ -328,7 +353,7 @@ export const migrationName: OperationURLParameter = { } }; -export const parameters9: OperationParameter = { +export const parameters11: OperationParameter = { parameterPath: "parameters", mapper: MigrationResourceForPatchMapper }; @@ -343,36 +368,87 @@ export const migrationListFilter: OperationQueryParameter = { } }; -export const parameters10: OperationParameter = { +export const parameters12: OperationParameter = { parameterPath: "parameters", mapper: MigrationNameAvailabilityResourceMapper }; -export const parameters11: OperationParameter = { +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*\\.[a-fA-F0-9\\-]+$") + }, + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters13: OperationParameter = { parameterPath: "parameters", - mapper: VirtualNetworkSubnetUsageParameterMapper + mapper: PrivateEndpointConnectionMapper }; -export const parameters12: OperationParameter = { +export const groupName: OperationURLParameter = { + parameterPath: "groupName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$") + }, + serializedName: "groupName", + required: true, + type: { + name: "String" + } + } +}; + +export const threatProtectionName: OperationURLParameter = { + parameterPath: "threatProtectionName", + mapper: { + serializedName: "threatProtectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters14: OperationParameter = { parameterPath: "parameters", - mapper: LtrPreBackupRequestMapper + mapper: ServerThreatProtectionSettingsModelMapper }; -export const parameters13: OperationParameter = { +export const parameters15: OperationParameter = { parameterPath: "parameters", - mapper: LtrBackupRequestMapper + mapper: VirtualEndpointResourceMapper }; -export const backupName1: OperationURLParameter = { - parameterPath: "backupName", +export const virtualEndpointName: OperationURLParameter = { + parameterPath: "virtualEndpointName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*") + Pattern: new RegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,62}(?, + PrivateEndpointConnectionUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + serverName, + privateEndpointConnectionName, + parameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The required parameters for updating private endpoint connection. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + serverName, + privateEndpointConnectionName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + serverName, + privateEndpointConnectionName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + serverName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters13, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 201: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 202: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 204: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/privateEndpointConnections.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..7c2098cf0580 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/privateEndpointConnections.ts @@ -0,0 +1,243 @@ +/* + * 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 { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PostgreSQLManagementFlexibleServerClient } from "../postgreSQLManagementFlexibleServerClient"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByServerNextOptionalParams, + PrivateEndpointConnectionsListByServerOptionalParams, + PrivateEndpointConnectionsListByServerResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsListByServerNextResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: PostgreSQLManagementFlexibleServerClient; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: PostgreSQLManagementFlexibleServerClient) { + this.client = client; + } + + /** + * Gets all private endpoint connections on a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + public listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateEndpointConnectionsListByServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServerPagingAll( + resourceGroupName, + serverName, + 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.listByServerPagingPage( + resourceGroupName, + serverName, + options, + settings + ); + } + }; + } + + private async *listByServerPagingPage( + resourceGroupName: string, + serverName: string, + options?: PrivateEndpointConnectionsListByServerOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateEndpointConnectionsListByServerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByServer(resourceGroupName, serverName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByServerNext( + resourceGroupName, + serverName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByServerPagingAll( + resourceGroupName: string, + serverName: string, + options?: PrivateEndpointConnectionsListByServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServerPagingPage( + resourceGroupName, + serverName, + options + )) { + yield* page; + } + } + + /** + * Gets a private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, privateEndpointConnectionName, options }, + getOperationSpec + ); + } + + /** + * Gets all private endpoint connections on a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + private _listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateEndpointConnectionsListByServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, options }, + listByServerOperationSpec + ); + } + + /** + * ListByServerNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param nextLink The nextLink from the previous successful call to the ListByServer method. + * @param options The options parameters. + */ + private _listByServerNext( + resourceGroupName: string, + serverName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListByServerNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, nextLink, options }, + listByServerNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByServerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/privateLinkResources.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..f6a2e6ccde94 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/privateLinkResources.ts @@ -0,0 +1,242 @@ +/* + * 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 { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PostgreSQLManagementFlexibleServerClient } from "../postgreSQLManagementFlexibleServerClient"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByServerNextOptionalParams, + PrivateLinkResourcesListByServerOptionalParams, + PrivateLinkResourcesListByServerResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse, + PrivateLinkResourcesListByServerNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: PostgreSQLManagementFlexibleServerClient; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: PostgreSQLManagementFlexibleServerClient) { + this.client = client; + } + + /** + * Gets the private link resources for PostgreSQL server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + public listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateLinkResourcesListByServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServerPagingAll( + resourceGroupName, + serverName, + 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.listByServerPagingPage( + resourceGroupName, + serverName, + options, + settings + ); + } + }; + } + + private async *listByServerPagingPage( + resourceGroupName: string, + serverName: string, + options?: PrivateLinkResourcesListByServerOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateLinkResourcesListByServerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByServer(resourceGroupName, serverName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByServerNext( + resourceGroupName, + serverName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByServerPagingAll( + resourceGroupName: string, + serverName: string, + options?: PrivateLinkResourcesListByServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServerPagingPage( + resourceGroupName, + serverName, + options + )) { + yield* page; + } + } + + /** + * Gets the private link resources for PostgreSQL server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + private _listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateLinkResourcesListByServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, options }, + listByServerOperationSpec + ); + } + + /** + * Gets a private link resource for PostgreSQL server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, groupName, options }, + getOperationSpec + ); + } + + /** + * ListByServerNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param nextLink The nextLink from the previous successful call to the ListByServer method. + * @param options The options parameters. + */ + private _listByServerNext( + resourceGroupName: string, + serverName: string, + nextLink: string, + options?: PrivateLinkResourcesListByServerNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, nextLink, options }, + listByServerNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources/{groupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.groupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByServerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/quotaUsages.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/quotaUsages.ts new file mode 100644 index 000000000000..77046a5264f4 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/quotaUsages.ts @@ -0,0 +1,170 @@ +/* + * 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 { QuotaUsages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PostgreSQLManagementFlexibleServerClient } from "../postgreSQLManagementFlexibleServerClient"; +import { + QuotaUsage, + QuotaUsagesListNextOptionalParams, + QuotaUsagesListOptionalParams, + QuotaUsagesListResponse, + QuotaUsagesListNextResponse +} from "../models"; + +/// +/** Class containing QuotaUsages operations. */ +export class QuotaUsagesImpl implements QuotaUsages { + private readonly client: PostgreSQLManagementFlexibleServerClient; + + /** + * Initialize a new instance of the class QuotaUsages class. + * @param client Reference to the service client + */ + constructor(client: PostgreSQLManagementFlexibleServerClient) { + this.client = client; + } + + /** + * Get quota usages at specified location in a given subscription. + * @param locationName The name of the location. + * @param options The options parameters. + */ + public list( + locationName: string, + options?: QuotaUsagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(locationName, 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(locationName, options, settings); + } + }; + } + + private async *listPagingPage( + locationName: string, + options?: QuotaUsagesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: QuotaUsagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(locationName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(locationName, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + locationName: string, + options?: QuotaUsagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(locationName, options)) { + yield* page; + } + } + + /** + * Get quota usages at specified location in a given subscription. + * @param locationName The name of the location. + * @param options The options parameters. + */ + private _list( + locationName: string, + options?: QuotaUsagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param locationName The name of the location. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + locationName: string, + nextLink: string, + options?: QuotaUsagesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.QuotaUsagesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.QuotaUsagesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.locationName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/serverThreatProtectionSettings.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/serverThreatProtectionSettings.ts new file mode 100644 index 000000000000..7eee9598e7ed --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/serverThreatProtectionSettings.ts @@ -0,0 +1,393 @@ +/* + * 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 { ServerThreatProtectionSettings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PostgreSQLManagementFlexibleServerClient } from "../postgreSQLManagementFlexibleServerClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + ServerThreatProtectionSettingsModel, + ServerThreatProtectionSettingsListByServerNextOptionalParams, + ServerThreatProtectionSettingsListByServerOptionalParams, + ServerThreatProtectionSettingsListByServerResponse, + ThreatProtectionName, + ServerThreatProtectionSettingsGetOptionalParams, + ServerThreatProtectionSettingsGetResponse, + ServerThreatProtectionSettingsCreateOrUpdateOptionalParams, + ServerThreatProtectionSettingsCreateOrUpdateResponse, + ServerThreatProtectionSettingsListByServerNextResponse +} from "../models"; + +/// +/** Class containing ServerThreatProtectionSettings operations. */ +export class ServerThreatProtectionSettingsImpl + implements ServerThreatProtectionSettings { + private readonly client: PostgreSQLManagementFlexibleServerClient; + + /** + * Initialize a new instance of the class ServerThreatProtectionSettings class. + * @param client Reference to the service client + */ + constructor(client: PostgreSQLManagementFlexibleServerClient) { + this.client = client; + } + + /** + * Get a list of server's Threat Protection state. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + public listByServer( + resourceGroupName: string, + serverName: string, + options?: ServerThreatProtectionSettingsListByServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServerPagingAll( + resourceGroupName, + serverName, + 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.listByServerPagingPage( + resourceGroupName, + serverName, + options, + settings + ); + } + }; + } + + private async *listByServerPagingPage( + resourceGroupName: string, + serverName: string, + options?: ServerThreatProtectionSettingsListByServerOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ServerThreatProtectionSettingsListByServerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByServer(resourceGroupName, serverName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByServerNext( + resourceGroupName, + serverName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByServerPagingAll( + resourceGroupName: string, + serverName: string, + options?: ServerThreatProtectionSettingsListByServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServerPagingPage( + resourceGroupName, + serverName, + options + )) { + yield* page; + } + } + + /** + * Get a list of server's Threat Protection state. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + private _listByServer( + resourceGroupName: string, + serverName: string, + options?: ServerThreatProtectionSettingsListByServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, options }, + listByServerOperationSpec + ); + } + + /** + * Get a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + options?: ServerThreatProtectionSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, threatProtectionName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible server. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + parameters: ServerThreatProtectionSettingsModel, + options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ServerThreatProtectionSettingsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + serverName, + threatProtectionName, + parameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ServerThreatProtectionSettingsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible server. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + parameters: ServerThreatProtectionSettingsModel, + options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + serverName, + threatProtectionName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByServerNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param nextLink The nextLink from the previous successful call to the ListByServer method. + * @param options The options parameters. + */ + private _listByServerNext( + resourceGroupName: string, + serverName: string, + nextLink: string, + options?: ServerThreatProtectionSettingsListByServerNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, nextLink, options }, + listByServerNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServerThreatProtectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServerThreatProtectionSettingsModel + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.threatProtectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ServerThreatProtectionSettingsModel + }, + 201: { + bodyMapper: Mappers.ServerThreatProtectionSettingsModel + }, + 202: { + bodyMapper: Mappers.ServerThreatProtectionSettingsModel + }, + 204: { + bodyMapper: Mappers.ServerThreatProtectionSettingsModel + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters14, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.threatProtectionName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listByServerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServerThreatProtectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualEndpoints.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualEndpoints.ts new file mode 100644 index 000000000000..cc62ad3ae361 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualEndpoints.ts @@ -0,0 +1,667 @@ +/* + * 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 { VirtualEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PostgreSQLManagementFlexibleServerClient } from "../postgreSQLManagementFlexibleServerClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + VirtualEndpointResource, + VirtualEndpointsListByServerNextOptionalParams, + VirtualEndpointsListByServerOptionalParams, + VirtualEndpointsListByServerResponse, + VirtualEndpointsCreateOptionalParams, + VirtualEndpointsCreateResponse, + VirtualEndpointResourceForPatch, + VirtualEndpointsUpdateOptionalParams, + VirtualEndpointsUpdateResponse, + VirtualEndpointsDeleteOptionalParams, + VirtualEndpointsDeleteResponse, + VirtualEndpointsGetOptionalParams, + VirtualEndpointsGetResponse, + VirtualEndpointsListByServerNextResponse +} from "../models"; + +/// +/** Class containing VirtualEndpoints operations. */ +export class VirtualEndpointsImpl implements VirtualEndpoints { + private readonly client: PostgreSQLManagementFlexibleServerClient; + + /** + * Initialize a new instance of the class VirtualEndpoints class. + * @param client Reference to the service client + */ + constructor(client: PostgreSQLManagementFlexibleServerClient) { + this.client = client; + } + + /** + * List all the servers in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + public listByServer( + resourceGroupName: string, + serverName: string, + options?: VirtualEndpointsListByServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServerPagingAll( + resourceGroupName, + serverName, + 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.listByServerPagingPage( + resourceGroupName, + serverName, + options, + settings + ); + } + }; + } + + private async *listByServerPagingPage( + resourceGroupName: string, + serverName: string, + options?: VirtualEndpointsListByServerOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VirtualEndpointsListByServerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByServer(resourceGroupName, serverName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByServerNext( + resourceGroupName, + serverName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByServerPagingAll( + resourceGroupName: string, + serverName: string, + options?: VirtualEndpointsListByServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServerPagingPage( + resourceGroupName, + serverName, + options + )) { + yield* page; + } + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResource, + options?: VirtualEndpointsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + VirtualEndpointsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResource, + options?: VirtualEndpointsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties + * present in the normal virtual endpoint definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for updating a server. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResourceForPatch, + options?: VirtualEndpointsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + VirtualEndpointsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties + * present in the normal virtual endpoint definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for updating a server. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResourceForPatch, + options?: VirtualEndpointsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, serverName, virtualEndpointName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + VirtualEndpointsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + serverName, + virtualEndpointName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets information about a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, virtualEndpointName, options }, + getOperationSpec + ); + } + + /** + * List all the servers in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + private _listByServer( + resourceGroupName: string, + serverName: string, + options?: VirtualEndpointsListByServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, options }, + listByServerOperationSpec + ); + } + + /** + * ListByServerNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param nextLink The nextLink from the previous successful call to the ListByServer method. + * @param options The options parameters. + */ + private _listByServerNext( + resourceGroupName: string, + serverName: string, + nextLink: string, + options?: VirtualEndpointsListByServerNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serverName, nextLink, options }, + listByServerNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 201: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 202: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 204: { + bodyMapper: Mappers.VirtualEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.virtualEndpointName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 201: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 202: { + bodyMapper: Mappers.VirtualEndpointResource + }, + 204: { + bodyMapper: Mappers.VirtualEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters16, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.virtualEndpointName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.VirtualEndpointsDeleteHeaders + }, + 201: { + headersMapper: Mappers.VirtualEndpointsDeleteHeaders + }, + 202: { + headersMapper: Mappers.VirtualEndpointsDeleteHeaders + }, + 204: { + headersMapper: Mappers.VirtualEndpointsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.virtualEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.virtualEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualEndpointsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByServerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualEndpointsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts index 90b32b42778b..f9045b335357 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts @@ -62,7 +62,7 @@ const executeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters11, + requestBody: Parameters.parameters17, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/index.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/index.ts index 43020e4e266d..cc6ba4ab363a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/index.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/index.ts @@ -16,11 +16,17 @@ export * from "./configurations"; export * from "./databases"; export * from "./firewallRules"; export * from "./servers"; +export * from "./flexibleServer"; +export * from "./ltrBackupOperations"; export * from "./migrations"; export * from "./operations"; export * from "./getPrivateDnsZoneSuffix"; +export * from "./privateEndpointConnections"; +export * from "./privateEndpointConnectionOperations"; +export * from "./privateLinkResources"; +export * from "./quotaUsages"; export * from "./replicas"; export * from "./logFiles"; +export * from "./serverThreatProtectionSettings"; +export * from "./virtualEndpoints"; export * from "./virtualNetworkSubnetUsage"; -export * from "./flexibleServer"; -export * from "./ltrBackupOperations"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnectionOperations.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnectionOperations.ts new file mode 100644 index 000000000000..61cd4301115a --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnectionOperations.ts @@ -0,0 +1,86 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionUpdateOptionalParams, + PrivateEndpointConnectionUpdateResponse, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionDeleteResponse +} from "../models"; + +/** Interface representing a PrivateEndpointConnectionOperations. */ +export interface PrivateEndpointConnectionOperations { + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The required parameters for updating private endpoint connection. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionUpdateResponse + > + >; + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The required parameters for updating private endpoint connection. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionDeleteResponse + > + >; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..68da511627f6 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,44 @@ +/* + * 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 { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByServerOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Gets all private endpoint connections on a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateEndpointConnectionsListByServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateLinkResources.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..22088f7657d4 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,44 @@ +/* + * 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 { + PrivateLinkResource, + PrivateLinkResourcesListByServerOptionalParams, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources for PostgreSQL server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + listByServer( + resourceGroupName: string, + serverName: string, + options?: PrivateLinkResourcesListByServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a private link resource for PostgreSQL server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/quotaUsages.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/quotaUsages.ts new file mode 100644 index 000000000000..1f0bf9e5dec7 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/quotaUsages.ts @@ -0,0 +1,24 @@ +/* + * 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 { QuotaUsage, QuotaUsagesListOptionalParams } from "../models"; + +/// +/** Interface representing a QuotaUsages. */ +export interface QuotaUsages { + /** + * Get quota usages at specified location in a given subscription. + * @param locationName The name of the location. + * @param options The options parameters. + */ + list( + locationName: string, + options?: QuotaUsagesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/serverThreatProtectionSettings.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/serverThreatProtectionSettings.ts new file mode 100644 index 000000000000..8bfc93da508f --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/serverThreatProtectionSettings.ts @@ -0,0 +1,83 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ServerThreatProtectionSettingsModel, + ServerThreatProtectionSettingsListByServerOptionalParams, + ThreatProtectionName, + ServerThreatProtectionSettingsGetOptionalParams, + ServerThreatProtectionSettingsGetResponse, + ServerThreatProtectionSettingsCreateOrUpdateOptionalParams, + ServerThreatProtectionSettingsCreateOrUpdateResponse +} from "../models"; + +/// +/** Interface representing a ServerThreatProtectionSettings. */ +export interface ServerThreatProtectionSettings { + /** + * Get a list of server's Threat Protection state. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + listByServer( + resourceGroupName: string, + serverName: string, + options?: ServerThreatProtectionSettingsListByServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + options?: ServerThreatProtectionSettingsGetOptionalParams + ): Promise; + /** + * Creates or updates a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible server. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + parameters: ServerThreatProtectionSettingsModel, + options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ServerThreatProtectionSettingsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a server's Advanced Threat Protection settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible server. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + serverName: string, + threatProtectionName: ThreatProtectionName, + parameters: ServerThreatProtectionSettingsModel, + options?: ServerThreatProtectionSettingsCreateOrUpdateOptionalParams + ): Promise; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/virtualEndpoints.ts b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/virtualEndpoints.ts new file mode 100644 index 000000000000..12f519768987 --- /dev/null +++ b/sdk/postgresql/arm-postgresql-flexible/src/operationsInterfaces/virtualEndpoints.ts @@ -0,0 +1,155 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + VirtualEndpointResource, + VirtualEndpointsListByServerOptionalParams, + VirtualEndpointsCreateOptionalParams, + VirtualEndpointsCreateResponse, + VirtualEndpointResourceForPatch, + VirtualEndpointsUpdateOptionalParams, + VirtualEndpointsUpdateResponse, + VirtualEndpointsDeleteOptionalParams, + VirtualEndpointsDeleteResponse, + VirtualEndpointsGetOptionalParams, + VirtualEndpointsGetResponse +} from "../models"; + +/// +/** Interface representing a VirtualEndpoints. */ +export interface VirtualEndpoints { + /** + * List all the servers in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param options The options parameters. + */ + listByServer( + resourceGroupName: string, + serverName: string, + options?: VirtualEndpointsListByServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResource, + options?: VirtualEndpointsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsCreateResponse + > + >; + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResource, + options?: VirtualEndpointsCreateOptionalParams + ): Promise; + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties + * present in the normal virtual endpoint definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for updating a server. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResourceForPatch, + options?: VirtualEndpointsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsUpdateResponse + > + >; + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties + * present in the normal virtual endpoint definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for updating a server. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + parameters: VirtualEndpointResourceForPatch, + options?: VirtualEndpointsUpdateOptionalParams + ): Promise; + /** + * Deletes a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualEndpointsDeleteResponse + > + >; + /** + * Deletes a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsDeleteOptionalParams + ): Promise; + /** + * Gets information about a virtual endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serverName: string, + virtualEndpointName: string, + options?: VirtualEndpointsGetOptionalParams + ): Promise; +} diff --git a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementFlexibleServerClient.ts b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementFlexibleServerClient.ts index 2998f862b564..cc8368ade353 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementFlexibleServerClient.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementFlexibleServerClient.ts @@ -25,14 +25,20 @@ import { DatabasesImpl, FirewallRulesImpl, ServersImpl, + FlexibleServerImpl, + LtrBackupOperationsImpl, MigrationsImpl, OperationsImpl, GetPrivateDnsZoneSuffixImpl, + PrivateEndpointConnectionsImpl, + PrivateEndpointConnectionOperationsImpl, + PrivateLinkResourcesImpl, + QuotaUsagesImpl, ReplicasImpl, LogFilesImpl, - VirtualNetworkSubnetUsageImpl, - FlexibleServerImpl, - LtrBackupOperationsImpl + ServerThreatProtectionSettingsImpl, + VirtualEndpointsImpl, + VirtualNetworkSubnetUsageImpl } from "./operations"; import { Administrators, @@ -45,14 +51,20 @@ import { Databases, FirewallRules, Servers, + FlexibleServer, + LtrBackupOperations, Migrations, Operations, GetPrivateDnsZoneSuffix, + PrivateEndpointConnections, + PrivateEndpointConnectionOperations, + PrivateLinkResources, + QuotaUsages, Replicas, LogFiles, - VirtualNetworkSubnetUsage, - FlexibleServer, - LtrBackupOperations + ServerThreatProtectionSettings, + VirtualEndpoints, + VirtualNetworkSubnetUsage } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; @@ -71,7 +83,7 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service /** * Initializes a new instance of the PostgreSQLManagementFlexibleServerClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( @@ -164,7 +176,7 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-03-01-preview"; + this.apiVersion = options.apiVersion || "2023-06-01-preview"; this.administrators = new AdministratorsImpl(this); this.backups = new BackupsImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesImpl(this); @@ -177,14 +189,24 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service this.databases = new DatabasesImpl(this); this.firewallRules = new FirewallRulesImpl(this); this.servers = new ServersImpl(this); + this.flexibleServer = new FlexibleServerImpl(this); + this.ltrBackupOperations = new LtrBackupOperationsImpl(this); this.migrations = new MigrationsImpl(this); this.operations = new OperationsImpl(this); this.getPrivateDnsZoneSuffix = new GetPrivateDnsZoneSuffixImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsImpl( + this + ); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.quotaUsages = new QuotaUsagesImpl(this); this.replicas = new ReplicasImpl(this); this.logFiles = new LogFilesImpl(this); + this.serverThreatProtectionSettings = new ServerThreatProtectionSettingsImpl( + this + ); + this.virtualEndpoints = new VirtualEndpointsImpl(this); this.virtualNetworkSubnetUsage = new VirtualNetworkSubnetUsageImpl(this); - this.flexibleServer = new FlexibleServerImpl(this); - this.ltrBackupOperations = new LtrBackupOperationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -253,14 +275,20 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service databases: Databases; firewallRules: FirewallRules; servers: Servers; + flexibleServer: FlexibleServer; + ltrBackupOperations: LtrBackupOperations; migrations: Migrations; operations: Operations; getPrivateDnsZoneSuffix: GetPrivateDnsZoneSuffix; + privateEndpointConnections: PrivateEndpointConnections; + privateEndpointConnectionOperations: PrivateEndpointConnectionOperations; + privateLinkResources: PrivateLinkResources; + quotaUsages: QuotaUsages; replicas: Replicas; logFiles: LogFiles; + serverThreatProtectionSettings: ServerThreatProtectionSettings; + virtualEndpoints: VirtualEndpoints; virtualNetworkSubnetUsage: VirtualNetworkSubnetUsage; - flexibleServer: FlexibleServer; - ltrBackupOperations: LtrBackupOperations; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -277,7 +305,7 @@ const checkMigrationNameAvailabilityOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters10, + requestBody: Parameters.parameters12, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host,