Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2489 from Azure/restapi_auto_sql/resource-manager
Browse files Browse the repository at this point in the history
[AutoPR] sql/resource-manager
  • Loading branch information
Dan Schulte authored Mar 28, 2018
2 parents d4e6d09 + 1b7bc18 commit 3650fb8
Show file tree
Hide file tree
Showing 79 changed files with 26,430 additions and 11,730 deletions.
2 changes: 2 additions & 0 deletions codegen_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@
"sql": {
"resource-manager": {
"packageName": "azure-arm-sql",
"packageVersion": "3.0.0",
"generateReadmeMd": true,
"dir": "sqlManagement2",
"source": "sql/resource-manager"
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/sqlManagement2/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Microsoft
Copyright (c) 2018 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 All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
51 changes: 26 additions & 25 deletions lib/services/sqlManagement2/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# Microsoft Azure SDK for Node.js - SQLManagement
# Microsoft Azure SDK for Node.js - SqlManagementClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features

This project provides a Node.js package that makes it easy to manage Microsoft Azure SQL.
## Minimum node.js version >= 6.x.x

## How to Install

```bash
npm install azure-arm-sql
```

## How to Use

### Authentication, client creation and listing servers as an example

```javascript
const msRestAzure = require('ms-rest-azure');
const SQLManagement = require("azure-arm-sql");
// Interactive Login
// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful,
// the user will get a DeviceTokenCredentials object.
msRestAzure.interactiveLogin().then((credentials) => {
let client = new SQLManagement(credentials, 'your-subscription-id');
return client.servers.list();
}).then((servers) => {
console.log('List of servers:');
console.dir(servers, {depth: null, colors: true});
## How to use

### Authentication, client creation and get recoverableDatabases as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const SqlManagementClient = require("azure-arm-sql");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new SqlManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const serverName = "testserverName";
const databaseName = "testdatabaseName";
return client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error ocurred');
console.dir(err, {depth: null, colors: true});
});
```
console.log('An error ocurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
88 changes: 88 additions & 0 deletions lib/services/sqlManagement2/lib/models/automaticTuningOptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Automatic tuning properties for individual advisors.
*
*/
class AutomaticTuningOptions {
/**
* Create a AutomaticTuningOptions.
* @member {string} [desiredState] Automatic tuning option desired state.
* Possible values include: 'Off', 'On', 'Default'
* @member {string} [actualState] Automatic tuning option actual state.
* Possible values include: 'Off', 'On'
* @member {number} [reasonCode] Reason code if desired and actual state are
* different.
* @member {string} [reasonDesc] Reason description if desired and actual
* state are different. Possible values include: 'Default', 'Disabled',
* 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff',
* 'QueryStoreReadOnly', 'NotSupported'
*/
constructor() {
}

/**
* Defines the metadata of AutomaticTuningOptions
*
* @returns {object} metadata of AutomaticTuningOptions
*
*/
mapper() {
return {
required: false,
serializedName: 'AutomaticTuningOptions',
type: {
name: 'Composite',
className: 'AutomaticTuningOptions',
modelProperties: {
desiredState: {
required: false,
serializedName: 'desiredState',
type: {
name: 'Enum',
allowedValues: [ 'Off', 'On', 'Default' ]
}
},
actualState: {
required: false,
readOnly: true,
serializedName: 'actualState',
type: {
name: 'Enum',
allowedValues: [ 'Off', 'On' ]
}
},
reasonCode: {
required: false,
readOnly: true,
serializedName: 'reasonCode',
type: {
name: 'Number'
}
},
reasonDesc: {
required: false,
readOnly: true,
serializedName: 'reasonDesc',
type: {
name: 'Enum',
allowedValues: [ 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported' ]
}
}
}
}
};
}
}

module.exports = AutomaticTuningOptions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Automatic tuning properties for individual advisors.
*
*/
class AutomaticTuningServerOptions {
/**
* Create a AutomaticTuningServerOptions.
* @member {string} [desiredState] Automatic tuning option desired state.
* Possible values include: 'Off', 'On', 'Default'
* @member {string} [actualState] Automatic tuning option actual state.
* Possible values include: 'Off', 'On'
* @member {number} [reasonCode] Reason code if desired and actual state are
* different.
* @member {string} [reasonDesc] Reason description if desired and actual
* state are different. Possible values include: 'Default', 'Disabled',
* 'AutoConfigured'
*/
constructor() {
}

/**
* Defines the metadata of AutomaticTuningServerOptions
*
* @returns {object} metadata of AutomaticTuningServerOptions
*
*/
mapper() {
return {
required: false,
serializedName: 'AutomaticTuningServerOptions',
type: {
name: 'Composite',
className: 'AutomaticTuningServerOptions',
modelProperties: {
desiredState: {
required: false,
serializedName: 'desiredState',
type: {
name: 'Enum',
allowedValues: [ 'Off', 'On', 'Default' ]
}
},
actualState: {
required: false,
readOnly: true,
serializedName: 'actualState',
type: {
name: 'Enum',
allowedValues: [ 'Off', 'On' ]
}
},
reasonCode: {
required: false,
readOnly: true,
serializedName: 'reasonCode',
type: {
name: 'Number'
}
},
reasonDesc: {
required: false,
readOnly: true,
serializedName: 'reasonDesc',
type: {
name: 'Enum',
allowedValues: [ 'Default', 'Disabled', 'AutoConfigured' ]
}
}
}
}
};
}
}

module.exports = AutomaticTuningServerOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@
const models = require('./index');

/**
* A backup long term retention policy
* A long term retention policy.
*
* @extends models['ProxyResource']
*/
class BackupLongTermRetentionPolicy extends models['ProxyResource'] {
/**
* Create a BackupLongTermRetentionPolicy.
* @member {string} [location] The geo-location where the resource lives
* @member {string} state The status of the backup long term retention
* policy. Possible values include: 'Disabled', 'Enabled'
* @member {string} recoveryServicesBackupPolicyResourceId The azure recovery
* services backup protection policy resource id
* @member {string} [weeklyRetention] The weekly retention policy for an LTR
* backup in an ISO 8601 format.
* @member {string} [monthlyRetention] The montly retention policy for an LTR
* backup in an ISO 8601 format.
* @member {string} [yearlyRetention] The yearly retention policy for an LTR
* backup in an ISO 8601 format.
* @member {number} [weekOfYear] The week of year to take the yearly backup
* in an ISO 8601 format.
*/
constructor() {
super();
Expand Down Expand Up @@ -68,28 +71,33 @@ class BackupLongTermRetentionPolicy extends models['ProxyResource'] {
name: 'String'
}
},
location: {
weeklyRetention: {
required: false,
readOnly: true,
serializedName: 'location',
serializedName: 'properties.weeklyRetention',
type: {
name: 'String'
}
},
state: {
required: true,
serializedName: 'properties.state',
monthlyRetention: {
required: false,
serializedName: 'properties.monthlyRetention',
type: {
name: 'Enum',
allowedValues: [ 'Disabled', 'Enabled' ]
name: 'String'
}
},
recoveryServicesBackupPolicyResourceId: {
required: true,
serializedName: 'properties.recoveryServicesBackupPolicyResourceId',
yearlyRetention: {
required: false,
serializedName: 'properties.yearlyRetention',
type: {
name: 'String'
}
},
weekOfYear: {
required: false,
serializedName: 'properties.weekOfYear',
type: {
name: 'Number'
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Contains the information necessary to perform a create database restore
* point operation.
*
*/
class CreateDatabaseRestorePointDefinition {
/**
* Create a CreateDatabaseRestorePointDefinition.
* @member {string} restorePointLabel The restore point label to apply
*/
constructor() {
}

/**
* Defines the metadata of CreateDatabaseRestorePointDefinition
*
* @returns {object} metadata of CreateDatabaseRestorePointDefinition
*
*/
mapper() {
return {
required: false,
serializedName: 'CreateDatabaseRestorePointDefinition',
type: {
name: 'Composite',
className: 'CreateDatabaseRestorePointDefinition',
modelProperties: {
restorePointLabel: {
required: true,
serializedName: 'restorePointLabel',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = CreateDatabaseRestorePointDefinition;
Loading

0 comments on commit 3650fb8

Please sign in to comment.