Skip to content

Commit

Permalink
Adding server level threat detection sdk
Browse files Browse the repository at this point in the history
Adding server level threat detection sdk
  • Loading branch information
dsgouda authored Jun 18, 2018
2 parents 813921e + a0c5527 commit b0d0559
Show file tree
Hide file tree
Showing 11 changed files with 1,344 additions and 506 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.Sql
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// ServerSecurityAlertPoliciesOperations operations.
/// </summary>
public partial interface IServerSecurityAlertPoliciesOperations
{
/// <summary>
/// Get a server's security alert policy.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ServerSecurityAlertPolicy>> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates a threat detection policy.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='parameters'>
/// The server security alert policy.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ServerSecurityAlertPolicy>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerSecurityAlertPolicy parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates a threat detection policy.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='parameters'>
/// The server security alert policy.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ServerSecurityAlertPolicy>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerSecurityAlertPolicy parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ public partial interface ISqlManagementClient : System.IDisposable
/// </summary>
IServerDnsAliasesOperations ServerDnsAliases { get; }

/// <summary>
/// Gets the IServerSecurityAlertPoliciesOperations.
/// </summary>
IServerSecurityAlertPoliciesOperations ServerSecurityAlertPolicies { get; }

/// <summary>
/// Gets the IRestorePointsOperations.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// A server security alert policy.
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class ServerSecurityAlertPolicy : ProxyResource
{
/// <summary>
/// Initializes a new instance of the ServerSecurityAlertPolicy class.
/// </summary>
public ServerSecurityAlertPolicy()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ServerSecurityAlertPolicy class.
/// </summary>
/// <param name="state">Specifies the state of the policy, whether it
/// is enabled or disabled. Possible values include: 'New', 'Enabled',
/// 'Disabled'</param>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type.</param>
/// <param name="disabledAlerts">Specifies an array of alerts that are
/// disabled. Allowed values are: Sql_Injection,
/// Sql_Injection_Vulnerability, Access_Anomaly</param>
/// <param name="emailAddresses">Specifies an array of e-mail addresses
/// to which the alert is sent.</param>
/// <param name="emailAccountAdmins">Specifies that the alert is sent
/// to the account administrators.</param>
/// <param name="storageEndpoint">Specifies the blob storage endpoint
/// (e.g. https://MyAccount.blob.core.windows.net). This blob storage
/// will hold all Threat Detection audit logs.</param>
/// <param name="storageAccountAccessKey">Specifies the identifier key
/// of the Threat Detection audit storage account.</param>
/// <param name="retentionDays">Specifies the number of days to keep in
/// the Threat Detection audit logs.</param>
public ServerSecurityAlertPolicy(SecurityAlertPolicyState state, string id = default(string), string name = default(string), string type = default(string), IList<string> disabledAlerts = default(IList<string>), IList<string> emailAddresses = default(IList<string>), bool? emailAccountAdmins = default(bool?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), int? retentionDays = default(int?))
: base(id, name, type)
{
State = state;
DisabledAlerts = disabledAlerts;
EmailAddresses = emailAddresses;
EmailAccountAdmins = emailAccountAdmins;
StorageEndpoint = storageEndpoint;
StorageAccountAccessKey = storageAccountAccessKey;
RetentionDays = retentionDays;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets specifies the state of the policy, whether it is
/// enabled or disabled. Possible values include: 'New', 'Enabled',
/// 'Disabled'
/// </summary>
[JsonProperty(PropertyName = "properties.state")]
public SecurityAlertPolicyState State { get; set; }

/// <summary>
/// Gets or sets specifies an array of alerts that are disabled.
/// Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
/// Access_Anomaly
/// </summary>
[JsonProperty(PropertyName = "properties.disabledAlerts")]
public IList<string> DisabledAlerts { get; set; }

/// <summary>
/// Gets or sets specifies an array of e-mail addresses to which the
/// alert is sent.
/// </summary>
[JsonProperty(PropertyName = "properties.emailAddresses")]
public IList<string> EmailAddresses { get; set; }

/// <summary>
/// Gets or sets specifies that the alert is sent to the account
/// administrators.
/// </summary>
[JsonProperty(PropertyName = "properties.emailAccountAdmins")]
public bool? EmailAccountAdmins { get; set; }

/// <summary>
/// Gets or sets specifies the blob storage endpoint (e.g.
/// https://MyAccount.blob.core.windows.net). This blob storage will
/// hold all Threat Detection audit logs.
/// </summary>
[JsonProperty(PropertyName = "properties.storageEndpoint")]
public string StorageEndpoint { get; set; }

/// <summary>
/// Gets or sets specifies the identifier key of the Threat Detection
/// audit storage account.
/// </summary>
[JsonProperty(PropertyName = "properties.storageAccountAccessKey")]
public string StorageAccountAccessKey { get; set; }

/// <summary>
/// Gets or sets specifies the number of days to keep in the Threat
/// Detection audit logs.
/// </summary>
[JsonProperty(PropertyName = "properties.retentionDays")]
public int? RetentionDays { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_SqlManagementCl
new Tuple<string, string, string>("Sql", "ServerConnectionPolicies", "2014-04-01"),
new Tuple<string, string, string>("Sql", "ServerDnsAliases", "2017-03-01-preview"),
new Tuple<string, string, string>("Sql", "ServerKeys", "2015-05-01-preview"),
new Tuple<string, string, string>("Sql", "ServerSecurityAlertPolicies", "2017-03-01-preview"),
new Tuple<string, string, string>("Sql", "ServerUsages", "2014-04-01"),
new Tuple<string, string, string>("Sql", "Servers", "2014-04-01"),
new Tuple<string, string, string>("Sql", "Servers", "2015-05-01-preview"),
Expand Down
Loading

0 comments on commit b0d0559

Please sign in to comment.