Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ public interface ManagedDatabaseSecurityAlertPolicies extends SupportsCreating<M
*/
Observable<ManagedDatabaseSecurityAlertPolicy> getAsync(String resourceGroupName, String managedInstanceName, String databaseName);

/**
* Gets a list of managed database's security alert policies.
*
* @param 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 managedInstanceName The name of the managed instance.
* @param databaseName The name of the managed database for which the security alert policies are defined.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ManagedDatabaseSecurityAlertPolicy> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package com.microsoft.azure.management.sql.v2017_03_01_preview;

import rx.Observable;
import com.microsoft.azure.management.sql.v2017_03_01_preview.ManagedServerSecurityAlertPolicy;

/**
* Type representing ManagedServerSecurityAlertPolicies.
Expand All @@ -31,4 +32,14 @@ public interface ManagedServerSecurityAlertPolicies {
*/
Observable<ManagedServerSecurityAlertPolicy> getAsync(String resourceGroupName, String managedInstanceName);

/**
* Get the managed server's threat detection policies.
*
* @param 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 managedInstanceName The name of the managed instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ManagedServerSecurityAlertPolicy> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@ public interface ServerSecurityAlertPolicies extends SupportsCreating<ServerSecu
*/
Observable<ServerSecurityAlertPolicy> getAsync(String resourceGroupName, String serverName);

/**
* Get the server's threat detection policies.
*
* @param 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 serverName The name of the server.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ServerSecurityAlertPolicy> listByServerAsync(final String resourceGroupName, final String serverName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.microsoft.azure.management.sql.v2017_03_01_preview.ManagedDatabaseSecurityAlertPolicies;
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import com.microsoft.azure.management.sql.v2017_03_01_preview.ManagedDatabaseSecurityAlertPolicy;

class ManagedDatabaseSecurityAlertPoliciesImpl extends WrapperImpl<ManagedDatabaseSecurityAlertPoliciesInner> implements ManagedDatabaseSecurityAlertPolicies {
Expand Down Expand Up @@ -40,6 +41,24 @@ private ManagedDatabaseSecurityAlertPolicyImpl wrapModel(String name) {
return new ManagedDatabaseSecurityAlertPolicyImpl(name, this.manager());
}

@Override
public Observable<ManagedDatabaseSecurityAlertPolicy> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) {
ManagedDatabaseSecurityAlertPoliciesInner client = this.inner();
return client.listByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName)
.flatMapIterable(new Func1<Page<ManagedDatabaseSecurityAlertPolicyInner>, Iterable<ManagedDatabaseSecurityAlertPolicyInner>>() {
@Override
public Iterable<ManagedDatabaseSecurityAlertPolicyInner> call(Page<ManagedDatabaseSecurityAlertPolicyInner> page) {
return page.items();
}
})
.map(new Func1<ManagedDatabaseSecurityAlertPolicyInner, ManagedDatabaseSecurityAlertPolicy>() {
@Override
public ManagedDatabaseSecurityAlertPolicy call(ManagedDatabaseSecurityAlertPolicyInner inner) {
return wrapModel(inner);
}
});
}

@Override
public Observable<ManagedDatabaseSecurityAlertPolicy> getAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
ManagedDatabaseSecurityAlertPoliciesInner client = this.inner();
Expand Down
Loading