Skip to content

Commit

Permalink
CodeGen from PR 11685 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
OSSRDBMS Swagger completeness related changes (Azure#11685)

* OSSRDBMS Swagger completeness related changes

* OSSRDBMS Swagger completeness related changes

* OSSRDBMS Swagger completeness related changes

* OSSRDBMS Swagger completeness related changes
  • Loading branch information
SDKAuto committed Dec 8, 2020
1 parent 6c6ce54 commit 694c377
Show file tree
Hide file tree
Showing 57 changed files with 5,885 additions and 533 deletions.
2 changes: 1 addition & 1 deletion sdk/mariadb/arm-mariadb/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions sdk/mariadb/arm-mariadb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ npm install @azure/arm-mariadb

### How to use

#### nodejs - Authentication, client creation and get servers as an example written in TypeScript.
#### nodejs - client creation and get servers as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
```bash
npm install @azure/ms-rest-nodeauth
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```

##### Sample code

While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { MariaDBManagementClient, MariaDBManagementModels, MariaDBManagementMappers } from "@azure/arm-mariadb";
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { MariaDBManagementClient } = require("@azure/arm-mariadb");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
Expand Down Expand Up @@ -99,4 +99,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to

- [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%2Fsdk%2Fmariadb%2Farm-mariadb%2FREADME.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/mariadb/arm-mariadb/README.png)
14 changes: 7 additions & 7 deletions sdk/mariadb/arm-mariadb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "MariaDBManagementClient Library with typescript type definitions for node.js and browser.",
"version": "1.4.0",
"dependencies": {
"@azure/ms-rest-azure-js": "^1.3.2",
"@azure/ms-rest-js": "^1.8.1",
"tslib": "^1.9.3"
"@azure/ms-rest-azure-js": "^2.0.1",
"@azure/ms-rest-js": "^2.0.4",
"tslib": "^1.10.0"
},
"keywords": [
"node",
Expand All @@ -20,11 +20,11 @@
"module": "./esm/mariaDBManagementClient.js",
"types": "./esm/mariaDBManagementClient.d.ts",
"devDependencies": {
"typescript": "^3.1.1",
"rollup": "^0.66.2",
"rollup-plugin-node-resolve": "^3.4.0",
"typescript": "^3.5.3",
"rollup": "^1.18.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mariadb/arm-mariadb",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions sdk/mariadb/arm-mariadb/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
*/`
},
plugins: [
nodeResolve({ module: true }),
nodeResolve({ mainFields: ['module', 'main'] }),
sourcemaps()
]
};
Expand Down
99 changes: 93 additions & 6 deletions sdk/mariadb/arm-mariadb/src/mariaDBManagementClient.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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 * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
import * as operations from "./operations";
import { MariaDBManagementClientContext } from "./mariaDBManagementClientContext";

Expand All @@ -23,16 +24,28 @@ class MariaDBManagementClient extends MariaDBManagementClientContext {
virtualNetworkRules: operations.VirtualNetworkRules;
databases: operations.Databases;
configurations: operations.Configurations;
serverParameters: operations.ServerParameters;
logFiles: operations.LogFiles;
recoverableServers: operations.RecoverableServers;
serverBasedPerformanceTier: operations.ServerBasedPerformanceTier;
locationBasedPerformanceTier: operations.LocationBasedPerformanceTier;
checkNameAvailability: operations.CheckNameAvailability;
serverSecurityAlertPolicies: operations.ServerSecurityAlertPolicies;
operations: operations.Operations;
queryTexts: operations.QueryTexts;
topQueryStatistics: operations.TopQueryStatistics;
waitStatistics: operations.WaitStatistics;
advisors: operations.Advisors;
recommendedActions: operations.RecommendedActions;
locationBasedRecommendedActionSessionsOperationStatus: operations.LocationBasedRecommendedActionSessionsOperationStatus;
locationBasedRecommendedActionSessionsResult: operations.LocationBasedRecommendedActionSessionsResult;
privateEndpointConnections: operations.PrivateEndpointConnections;
privateLinkResources: operations.PrivateLinkResources;
serverSecurityAlertPolicies: operations.ServerSecurityAlertPolicies;

/**
* Initializes a new instance of the MariaDBManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId The subscription ID that identifies an Azure subscription.
* @param subscriptionId The ID of the target subscription.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MariaDBManagementClientOptions) {
Expand All @@ -43,15 +56,89 @@ class MariaDBManagementClient extends MariaDBManagementClientContext {
this.virtualNetworkRules = new operations.VirtualNetworkRules(this);
this.databases = new operations.Databases(this);
this.configurations = new operations.Configurations(this);
this.serverParameters = new operations.ServerParameters(this);
this.logFiles = new operations.LogFiles(this);
this.recoverableServers = new operations.RecoverableServers(this);
this.serverBasedPerformanceTier = new operations.ServerBasedPerformanceTier(this);
this.locationBasedPerformanceTier = new operations.LocationBasedPerformanceTier(this);
this.checkNameAvailability = new operations.CheckNameAvailability(this);
this.serverSecurityAlertPolicies = new operations.ServerSecurityAlertPolicies(this);
this.operations = new operations.Operations(this);
this.queryTexts = new operations.QueryTexts(this);
this.topQueryStatistics = new operations.TopQueryStatistics(this);
this.waitStatistics = new operations.WaitStatistics(this);
this.advisors = new operations.Advisors(this);
this.recommendedActions = new operations.RecommendedActions(this);
this.locationBasedRecommendedActionSessionsOperationStatus = new operations.LocationBasedRecommendedActionSessionsOperationStatus(this);
this.locationBasedRecommendedActionSessionsResult = new operations.LocationBasedRecommendedActionSessionsResult(this);
this.privateEndpointConnections = new operations.PrivateEndpointConnections(this);
this.privateLinkResources = new operations.PrivateLinkResources(this);
this.serverSecurityAlertPolicies = new operations.ServerSecurityAlertPolicies(this);
}

/**
* Create recommendation action session for the advisor.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param serverName The name of the server.
* @param advisorName The advisor name for recommendation action.
* @param databaseName The name of the database.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
createRecommendedActionSession(resourceGroupName: string, serverName: string, advisorName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginCreateRecommendedActionSession(resourceGroupName,serverName,advisorName,databaseName,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Create recommendation action session for the advisor.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param serverName The name of the server.
* @param advisorName The advisor name for recommendation action.
* @param databaseName The name of the database.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginCreateRecommendedActionSession(resourceGroupName: string, serverName: string, advisorName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.sendLRORequest(
{
resourceGroupName,
serverName,
advisorName,
databaseName,
options
},
beginCreateRecommendedActionSessionOperationSpec,
options);
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginCreateRecommendedActionSessionOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/createRecommendedActionSession",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.serverName,
Parameters.advisorName
],
queryParameters: [
Parameters.apiVersion0,
Parameters.databaseName
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

export {
MariaDBManagementClient,
Expand Down
9 changes: 3 additions & 6 deletions sdk/mariadb/arm-mariadb/src/mariaDBManagementClientContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand All @@ -18,12 +17,11 @@ const packageVersion = "1.4.0";
export class MariaDBManagementClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
subscriptionId: string;
apiVersion?: string;

/**
* Initializes a new instance of the MariaDBManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId The subscription ID that identifies an Azure subscription.
* @param subscriptionId The ID of the target subscription.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MariaDBManagementClientOptions) {
Expand All @@ -44,7 +42,6 @@ export class MariaDBManagementClientContext extends msRestAzure.AzureServiceClie

super(credentials, options);

this.apiVersion = '2018-06-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
Expand Down
41 changes: 41 additions & 0 deletions sdk/mariadb/arm-mariadb/src/models/advisorsMappers.ts
Original file line number Diff line number Diff line change
@@ -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.
*/

export {
discriminators,
Advisor,
AdvisorsResultList,
AzureEntityResource,
BaseResource,
CloudError,
Configuration,
Database,
FirewallRule,
LogFile,
PrivateEndpointConnection,
PrivateEndpointProperty,
PrivateLinkResource,
PrivateLinkResourceProperties,
PrivateLinkServiceConnectionStateProperty,
ProxyResource,
QueryStatistic,
QueryText,
RecommendationAction,
RecoverableServerResource,
Resource,
Server,
ServerPrivateEndpointConnection,
ServerPrivateEndpointConnectionProperties,
ServerPrivateLinkServiceConnectionStateProperty,
ServerSecurityAlertPolicy,
Sku,
StorageProfile,
TrackedResource,
VirtualNetworkRule,
WaitStatistic
} from "../models/mappers";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand All @@ -9,6 +9,8 @@
export {
discriminators,
CloudError,
ErrorAdditionalInfo,
ErrorResponse,
NameAvailability,
NameAvailabilityRequest
} from "../models/mappers";
24 changes: 21 additions & 3 deletions sdk/mariadb/arm-mariadb/src/models/configurationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
*/

export {
discriminators,
Advisor,
AzureEntityResource,
BaseResource,
CloudError,
Configuration,
ConfigurationListResult,
Database,
ErrorAdditionalInfo,
ErrorResponse,
FirewallRule,
LogFile,
PrivateEndpointConnection,
PrivateEndpointProperty,
PrivateLinkResource,
PrivateLinkResourceProperties,
PrivateLinkServiceConnectionStateProperty,
ProxyResource,
QueryStatistic,
QueryText,
RecommendationAction,
RecoverableServerResource,
Resource,
Server,
ServerPrivateEndpointConnection,
ServerPrivateEndpointConnectionProperties,
ServerPrivateLinkServiceConnectionStateProperty,
ServerSecurityAlertPolicy,
Sku,
StorageProfile,
TrackedResource,
VirtualNetworkRule
VirtualNetworkRule,
WaitStatistic
} from "../models/mappers";
Loading

0 comments on commit 694c377

Please sign in to comment.