Skip to content

Commit

Permalink
arm-postgresql-flexible (Azure#16136)
Browse files Browse the repository at this point in the history
  • Loading branch information
colawwj authored Jul 6, 2021
1 parent 9a47f3d commit 785029b
Show file tree
Hide file tree
Showing 26 changed files with 590 additions and 830 deletions.
1 change: 1 addition & 0 deletions eng/pipelines/mgmt-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ trigger:
- sdk/policy/arm-policy-profile-hybrid-2019-03-01
- sdk/policyinsights/arm-policyinsights
- sdk/postgresql/arm-postgresql
- sdk/postgresql/arm-postgresql-flexible
- sdk/powerbidedicated/arm-powerbidedicated
- sdk/powerbiembedded/arm-powerbiembedded
- sdk/privatedns/arm-privatedns
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/mgmt-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pr:
- sdk/policy/arm-policy-profile-hybrid-2019-03-01
- sdk/policyinsights/arm-policyinsights
- sdk/postgresql/arm-postgresql
- sdk/postgresql/arm-postgresql-flexible
- sdk/powerbidedicated/arm-powerbidedicated
- sdk/powerbiembedded/arm-powerbiembedded
- sdk/privatedns/arm-privatedns
Expand Down
26 changes: 12 additions & 14 deletions sdk/postgresql/arm-postgresql-flexible/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Azure PostgreSQLFlexibleManagementClient SDK for JavaScript
## Azure PostgreSQLManagementClient SDK for JavaScript

This package contains an isomorphic SDK (runs both in node.js and in browsers) for PostgreSQLFlexibleManagementClient.
This package contains an isomorphic SDK (runs both in node.js and in browsers) for PostgreSQLManagementClient.

### Currently supported environments

- Node.js version 8.x.x or higher
- Browser JavaScript
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.

### Prerequisites

Expand Down Expand Up @@ -36,23 +36,22 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/

In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
#### nodejs - Authentication, client creation, and get databases as an example written in JavaScript.
#### nodejs - Authentication, client creation, and get servers as an example written in JavaScript.

##### Sample code

```javascript
const { DefaultAzureCredential } = require("@azure/identity");
const { PostgreSQLFlexibleManagementClient } = require("@azure/arm-postgresql-flexible");
const { PostgreSQLManagementClient } = require("@azure/arm-postgresql-flexible");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
const creds = new DefaultAzureCredential();
const client = new PostgreSQLFlexibleManagementClient(creds, subscriptionId);
const client = new PostgreSQLManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const serverName = "testserverName";
const databaseName = "testdatabaseName";
client.databases.get(resourceGroupName, serverName, databaseName).then((result) => {
client.servers.get(resourceGroupName, serverName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -61,7 +60,7 @@ client.databases.get(resourceGroupName, serverName, databaseName).then((result)
});
```

#### browser - Authentication, client creation, and get databases as an example written in JavaScript.
#### browser - Authentication, client creation, and get servers as an example written in JavaScript.

In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
Expand All @@ -88,11 +87,10 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
const client = new Azure.ArmPostgresql.PostgreSQLFlexibleManagementClient(creds, subscriptionId);
const client = new Azure.ArmPostgresqlFlexible.PostgreSQLManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const serverName = "testserverName";
const databaseName = "testdatabaseName";
client.databases.get(resourceGroupName, serverName, databaseName).then((result) => {
client.servers.get(resourceGroupName, serverName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -109,4 +107,4 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/README.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/postgresql/arm-postgresql-flexible//README.png)
10 changes: 5 additions & 5 deletions sdk/postgresql/arm-postgresql-flexible/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@azure/arm-postgresql-flexible",
"author": "Microsoft Corporation",
"description": "PostgreSQLFlexibleManagementClient Library with typescript type definitions for node.js and browser.",
"version": "1.0.0",
"description": "PostgreSQLManagementClient Library with typescript type definitions for node.js and browser.",
"version": "2.0.0",
"dependencies": {
"@azure/ms-rest-azure-js": "^2.1.0",
"@azure/ms-rest-js": "^2.2.0",
Expand All @@ -18,16 +18,16 @@
],
"license": "MIT",
"main": "./dist/arm-postgresql-flexible.js",
"module": "./esm/postgreSQLFlexibleManagementClient.js",
"types": "./esm/postgreSQLFlexibleManagementClient.d.ts",
"module": "./esm/postgreSQLManagementClient.js",
"types": "./esm/postgreSQLManagementClient.d.ts",
"devDependencies": {
"typescript": "^3.6.0",
"rollup": "^1.18.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/postgresql/arm-postgresql-flexible",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/postgresql/arm-postgresql-flexible/",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down
2 changes: 1 addition & 1 deletion sdk/postgresql/arm-postgresql-flexible/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sourcemaps from "rollup-plugin-sourcemaps";
* @type {rollup.RollupFileOptions}
*/
const config = {
input: "./esm/postgreSQLFlexibleManagementClient.js",
input: "./esm/postgreSQLManagementClient.js",
external: [
"@azure/ms-rest-js",
"@azure/ms-rest-azure-js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export {
MaintenanceWindow,
Plan,
ProxyResource,
RecoverableServerResource,
Resource,
ResourceModelWithAllowedPropertySet,
ResourceModelWithAllowedPropertySetIdentity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export {
MaintenanceWindow,
Plan,
ProxyResource,
RecoverableServerResource,
Resource,
ResourceModelWithAllowedPropertySet,
ResourceModelWithAllowedPropertySetIdentity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export {
MaintenanceWindow,
Plan,
ProxyResource,
RecoverableServerResource,
Resource,
ResourceModelWithAllowedPropertySet,
ResourceModelWithAllowedPropertySetIdentity,
Expand Down
Loading

0 comments on commit 785029b

Please sign in to comment.