Skip to content

Commit

Permalink
Regenerate postgresql (#26012)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazrael2119 authored May 30, 2023
1 parent 06220e0 commit 7680e71
Show file tree
Hide file tree
Showing 14 changed files with 370 additions and 97 deletions.
18 changes: 5 additions & 13 deletions sdk/postgresql/arm-postgresql-flexible/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Release History

## 8.0.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 8.0.0-beta.1 (2023-05-22)

## 8.0.0-beta.2 (2023-05-26)

**Features**

Expand Down Expand Up @@ -62,7 +52,7 @@
- Added Interface ServerCapabilitiesListNextOptionalParams
- Added Interface ServerCapabilitiesListOptionalParams
- Added Interface ServerSku
- Added Interface ServerSkuAutoGenerated
- Added Interface ServerSkuCapability
- Added Interface StorageMbCapability
- Added Type Alias AzureManagedDiskPerformanceTiers
- Added Type Alias CancelEnum
Expand Down Expand Up @@ -111,11 +101,13 @@
- 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 ServerForUpdate has a new optional parameter network
- 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 iopsTier
- 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
Expand Down
2 changes: 1 addition & 1 deletion sdk/postgresql/arm-postgresql-flexible/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"commit": "529205bb71049de32c1126c69b6016904261da32",
"commit": "84dfc2bed5cd1db42469895b0adaf5738e4802bc",
"readme": "specification/postgresql/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\postgresql\\resource-manager\\readme.md --use=@autorest/[email protected] --generate-sample=true --tag=package-flexibleserver-2023-03-01-preview --typescript",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
Expand Down
2 changes: 1 addition & 1 deletion sdk/postgresql/arm-postgresql-flexible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible?view=azure-node-preview"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export interface DataEncryption {
// @public
export interface DbServerMetadata {
readonly location?: string;
sku?: ServerSkuAutoGenerated;
sku?: ServerSku;
storageMb?: number;
version?: string;
}
Expand Down Expand Up @@ -563,7 +563,7 @@ export interface FlexibleServerCapability extends CapabilityBase {
export interface FlexibleServerEditionCapability extends CapabilityBase {
readonly defaultSkuName?: string;
readonly name?: string;
readonly supportedServerSkus?: ServerSku[];
readonly supportedServerSkus?: ServerSkuCapability[];
readonly supportedStorageEditions?: StorageEditionCapability[];
}

Expand Down Expand Up @@ -679,8 +679,8 @@ export enum KnownAzureManagedDiskPerformanceTiers {

// @public
export enum KnownCancelEnum {
Disabled = "Disabled",
Enabled = "Enabled"
False = "False",
True = "True"
}

// @public
Expand Down Expand Up @@ -783,8 +783,8 @@ export enum KnownKeyStatusEnum {

// @public
export enum KnownLogicalReplicationOnSourceDbEnum {
Disabled = "Disabled",
Enabled = "Enabled"
False = "False",
True = "True"
}

// @public
Expand Down Expand Up @@ -855,8 +855,8 @@ export enum KnownOrigin {

// @public
export enum KnownOverwriteDbsInTargetEnum {
Disabled = "Disabled",
Enabled = "Enabled"
False = "False",
True = "True"
}

// @public
Expand Down Expand Up @@ -932,8 +932,8 @@ export enum KnownSkuTier {

// @public
export enum KnownStartDataMigrationEnum {
Disabled = "Disabled",
Enabled = "Enabled"
False = "False",
True = "True"
}

// @public
Expand All @@ -950,8 +950,8 @@ export enum KnownStorageAutoGrowthSupportedEnum {

// @public
export enum KnownTriggerCutoverEnum {
Disabled = "Disabled",
Enabled = "Enabled"
False = "False",
True = "True"
}

// @public
Expand Down Expand Up @@ -1200,6 +1200,8 @@ export interface MigrationsDeleteOptionalParams extends coreClient.OperationOpti
// @public
export interface MigrationSecretParameters {
adminCredentials: AdminCredentials;
sourceServerUsername?: string;
targetServerUsername?: string;
}

// @public
Expand Down Expand Up @@ -1475,6 +1477,7 @@ export interface ServerForUpdate {
highAvailability?: HighAvailability;
identity?: UserAssignedIdentity;
maintenanceWindow?: MaintenanceWindow;
network?: Network;
replicationRole?: ReplicationRole;
sku?: Sku;
storage?: Storage_2;
Expand Down Expand Up @@ -1550,7 +1553,13 @@ export interface ServersGetOptionalParams extends coreClient.OperationOptions {
export type ServersGetResponse = Server;

// @public
export interface ServerSku extends CapabilityBase {
export interface ServerSku {
name: string;
tier: SkuTier;
}

// @public
export interface ServerSkuCapability extends CapabilityBase {
readonly name?: string;
readonly supportedHaMode?: HaMode[];
readonly supportedIops?: number;
Expand All @@ -1559,12 +1568,6 @@ export interface ServerSku extends CapabilityBase {
readonly vCores?: number;
}

// @public
export interface ServerSkuAutoGenerated {
name: string;
tier: SkuTier;
}

// @public
export interface ServersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
}
Expand Down Expand Up @@ -1728,6 +1731,7 @@ export type TriggerCutoverEnum = string;

// @public
export interface UserAssignedIdentity {
readonly tenantId?: string;
type: IdentityType;
userAssignedIdentities?: {
[propertyName: string]: UserIdentity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,50 @@ import * as dotenv from "dotenv";

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
*/
async function migrationsCreateByPassingUserNames() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
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",
secretParameters: {
adminCredentials: {
sourceServerPassword: "xxxxxxxx",
targetServerPassword: "xxxxxxxx"
},
sourceServerUsername: "newadmin@testsource",
targetServerUsername: "targetadmin"
},
sourceDbServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(
credential,
subscriptionId
);
const result = await client.migrations.create(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
parameters
);
console.log(result);
}

/**
* This sample demonstrates how to Creates a new migration.
*
Expand All @@ -34,6 +78,14 @@ async function migrationsCreate() {
const parameters: MigrationResource = {
dbsToMigrate: ["db1", "db2", "db3", "db4"],
location: "westus",
migrationMode: "Offline",
overwriteDbsInTarget: "True",
secretParameters: {
adminCredentials: {
sourceServerPassword: "xxxxxxxx",
targetServerPassword: "xxxxxxxx"
}
},
sourceDbServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"
};
Expand All @@ -53,6 +105,7 @@ async function migrationsCreate() {
}

async function main() {
migrationsCreateByPassingUserNames();
migrationsCreate();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@ import * as dotenv from "dotenv";

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
*/
async function cancelMigration() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigration";
const parameters: MigrationResourceForPatch = { cancel: "True" };
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(
credential,
subscriptionId
);
const result = await client.migrations.update(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
parameters
);
console.log(result);
}

/**
* 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.
*
Expand All @@ -32,7 +62,7 @@ async function migrationsUpdate() {
const targetDbServerName = "testtarget";
const migrationName = "testmigration";
const parameters: MigrationResourceForPatch = {
setupLogicalReplicationOnSourceDbIfNeeded: "Enabled"
setupLogicalReplicationOnSourceDbIfNeeded: "True"
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(
Expand All @@ -50,6 +80,7 @@ async function migrationsUpdate() {
}

async function main() {
cancelMigration();
migrationsUpdate();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ These sample programs show how to use the JavaScript client libraries for in som
| [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.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_Update.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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,45 @@ const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgre
const { DefaultAzureCredential } = require("@azure/identity");
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
*/
async function migrationsCreateByPassingUserNames() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
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",
secretParameters: {
adminCredentials: {
sourceServerPassword: "xxxxxxxx",
targetServerPassword: "xxxxxxxx",
},
sourceServerUsername: "newadmin@testsource",
targetServerUsername: "targetadmin",
},
sourceDbServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource",
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.create(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
parameters
);
console.log(result);
}

/**
* This sample demonstrates how to Creates a new migration.
*
Expand All @@ -27,6 +66,14 @@ async function migrationsCreate() {
const parameters = {
dbsToMigrate: ["db1", "db2", "db3", "db4"],
location: "westus",
migrationMode: "Offline",
overwriteDbsInTarget: "True",
secretParameters: {
adminCredentials: {
sourceServerPassword: "xxxxxxxx",
targetServerPassword: "xxxxxxxx",
},
},
sourceDbServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource",
};
Expand All @@ -43,6 +90,7 @@ async function migrationsCreate() {
}

async function main() {
migrationsCreateByPassingUserNames();
migrationsCreate();
}

Expand Down
Loading

0 comments on commit 7680e71

Please sign in to comment.