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

[AutoPR sql/resource-manager] Adding database vulnerability assessmen scan APIs #2480

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions lib/services/sqlManagement2/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
The MIT License (MIT)
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
80 changes: 43 additions & 37 deletions lib/services/sqlManagement2/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
# Microsoft Azure SDK for Node.js - SQLManagement

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});
}).catch((err) => {
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)
---
uid: azure-arm-sql
summary: *content

---
# 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


## How to Install

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

## 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 occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [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
Loading