Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sql/resource-manager] [DO NOT MERGE] VA List Api version edit #2552

Merged
merged 1 commit into from
Oct 31, 2018
Merged
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 @@ -60,7 +60,7 @@ public interface DatabaseVulnerabilityAssessment extends HasInner<DatabaseVulner
/**
* The entirety of the DatabaseVulnerabilityAssessment definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithStorageContainerPath, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithCreate {
}

/**
Expand All @@ -80,17 +80,7 @@ interface WithDatabasis {
/**
* Specifies resourceGroupName, managedInstanceName, databaseName.
*/
WithStorageContainerPath withExistingDatabasis(String resourceGroupName, String managedInstanceName, String databaseName);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
WithCreate withStorageContainerPath(String storageContainerPath);
WithCreate withExistingDatabasis(String resourceGroupName, String managedInstanceName, String databaseName);
}

/**
Expand All @@ -113,6 +103,16 @@ interface WithStorageAccountAccessKey {
WithCreate withStorageAccountAccessKey(String storageAccountAccessKey);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
WithCreate withStorageContainerPath(String storageContainerPath);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerSasKey.
*/
Expand All @@ -128,13 +128,13 @@ interface WithStorageContainerSasKey {
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<DatabaseVulnerabilityAssessment>, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerSasKey {
interface WithCreate extends Creatable<DatabaseVulnerabilityAssessment>, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerPath, DefinitionStages.WithStorageContainerSasKey {
}
}
/**
* The template for a DatabaseVulnerabilityAssessment update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<DatabaseVulnerabilityAssessment>, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerSasKey {
interface Update extends Appliable<DatabaseVulnerabilityAssessment>, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerPath, UpdateStages.WithStorageContainerSasKey {
}

/**
Expand All @@ -161,6 +161,16 @@ interface WithStorageAccountAccessKey {
Update withStorageAccountAccessKey(String storageAccountAccessKey);
}

/**
* The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
Update withStorageContainerPath(String storageContainerPath);
}

/**
* The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerSasKey.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package com.microsoft.azure.management.sql.v2017_10_01_preview;

import rx.Observable;
import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment;
import rx.Completable;

/**
Expand All @@ -33,6 +34,17 @@ public interface ManagedDatabaseVulnerabilityAssessments {
*/
Observable<DatabaseVulnerabilityAssessment> getAsync(String resourceGroupName, String managedInstanceName, String databaseName);

/**
* Lists the vulnerability assessments of a managed database.
*
* @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 database for which the vulnerability assessment is defined.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DatabaseVulnerabilityAssessment> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName);

/**
* Removes the database's vulnerability assessment.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ public DatabaseVulnerabilityAssessmentImpl withExistingDatabasis(String resource
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) {
this.inner().withStorageContainerPath(storageContainerPath);
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans) {
this.inner().withRecurringScans(recurringScans);
Expand All @@ -131,6 +125,12 @@ public DatabaseVulnerabilityAssessmentImpl withStorageAccountAccessKey(String st
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) {
this.inner().withStorageContainerPath(storageContainerPath);
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerSasKey(String storageContainerSasKey) {
this.inner().withStorageContainerSasKey(storageContainerSasKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
/**
* A blob storage container path to hold the scan results (e.g.
* https://myStorage.blob.core.windows.net/VaScans/).
* https://myStorage.blob.core.windows.net/VaScans/). It is required if
* server level vulnerability assessment policy doesn't set.
*/
@JsonProperty(value = "properties.storageContainerPath", required = true)
@JsonProperty(value = "properties.storageContainerPath")
private String storageContainerPath;

/**
Expand All @@ -35,8 +36,8 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
private String storageContainerSasKey;

/**
* Specifies the identifier key of the vulnerability assessment storage
* account. If 'StorageContainerSasKey' isn't specified,
* Specifies the identifier key of the storage account for vulnerability
* assessment scan results. If 'StorageContainerSasKey' isn't specified,
* storageAccountAccessKey is required.
*/
@JsonProperty(value = "properties.storageAccountAccessKey")
Expand All @@ -49,7 +50,7 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
private VulnerabilityAssessmentRecurringScansProperties recurringScans;

/**
* Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
* Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set.
*
* @return the storageContainerPath value
*/
Expand All @@ -58,7 +59,7 @@ public String storageContainerPath() {
}

/**
* Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
* Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set.
*
* @param storageContainerPath the storageContainerPath value to set
* @return the DatabaseVulnerabilityAssessmentInner object itself.
Expand Down Expand Up @@ -89,7 +90,7 @@ public DatabaseVulnerabilityAssessmentInner withStorageContainerSasKey(String st
}

/**
* Get specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
* Get specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
*
* @return the storageAccountAccessKey value
*/
Expand All @@ -98,7 +99,7 @@ public String storageAccountAccessKey() {
}

/**
* Set specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
* Set specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
*
* @param storageAccountAccessKey the storageAccountAccessKey value to set
* @return the DatabaseVulnerabilityAssessmentInner object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment;
import com.microsoft.azure.Page;
import rx.Completable;

class ManagedDatabaseVulnerabilityAssessmentsImpl extends WrapperImpl<ManagedDatabaseVulnerabilityAssessmentsInner> implements ManagedDatabaseVulnerabilityAssessments {
Expand Down Expand Up @@ -61,6 +62,24 @@ public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner
});
}

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

@Override
public Completable deleteAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner();
Expand Down
Loading