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] Adding new value to VA baseline name #2640

Merged
merged 4 commits into from
May 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
2 changes: 2 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
VulnerabilityAssessmentScanState,
InstanceFailoverGroupReplicationRole,
LongTermRetentionDatabaseState,
VulnerabilityAssessmentPolicyBaselineName,
CapabilityGroup,
)

Expand Down Expand Up @@ -668,5 +669,6 @@
'VulnerabilityAssessmentScanState',
'InstanceFailoverGroupReplicationRole',
'LongTermRetentionDatabaseState',
'VulnerabilityAssessmentPolicyBaselineName',
'CapabilityGroup',
]
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ class LongTermRetentionDatabaseState(str, Enum):
deleted = "Deleted"


class VulnerabilityAssessmentPolicyBaselineName(str, Enum):

master = "master"
default = "default"


class CapabilityGroup(str, Enum):

supported_editions = "supportedEditions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselinesOperations(object):
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default".
:ivar baseline_name: The name of the vulnerability assessment rule baseline. Constant value: "default".
:ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview".
"""

Expand All @@ -36,13 +35,12 @@ def __init__(self, client, config, serializer, deserializer):
self._serialize = serializer
self._deserialize = deserializer
self.vulnerability_assessment_name = "default"
self.baseline_name = "default"
self.api_version = "2017-03-01-preview"

self.config = config

def get(
self, resource_group_name, server_name, database_name, rule_id, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, database_name, rule_id, baseline_name, custom_headers=None, raw=False, **operation_config):
"""Gets a database's vulnerability assessment rule baseline.

:param resource_group_name: The name of the resource group that
Expand All @@ -56,6 +54,12 @@ def get(
:type database_name: str
:param rule_id: The vulnerability assessment rule ID.
:type rule_id: str
:param baseline_name: The name of the vulnerability assessment rule
baseline (default implies a baseline on a database level rule and
master for server level rule). Possible values include: 'master',
'default'
:type baseline_name: str or
~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -76,7 +80,7 @@ def get(
'databaseName': self._serialize.url("database_name", database_name, 'str'),
'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'),
'ruleId': self._serialize.url("rule_id", rule_id, 'str'),
'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'),
'baselineName': self._serialize.url("baseline_name", baseline_name, 'VulnerabilityAssessmentPolicyBaselineName'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -117,7 +121,7 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'}

def create_or_update(
self, resource_group_name, server_name, database_name, rule_id, baseline_results, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, database_name, rule_id, baseline_name, baseline_results, custom_headers=None, raw=False, **operation_config):
"""Creates or updates a database's vulnerability assessment rule baseline.

:param resource_group_name: The name of the resource group that
Expand All @@ -131,6 +135,12 @@ def create_or_update(
:type database_name: str
:param rule_id: The vulnerability assessment rule ID.
:type rule_id: str
:param baseline_name: The name of the vulnerability assessment rule
baseline (default implies a baseline on a database level rule and
master for server level rule). Possible values include: 'master',
'default'
:type baseline_name: str or
~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName
:param baseline_results: The rule baseline result
:type baseline_results:
list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem]
Expand All @@ -156,7 +166,7 @@ def create_or_update(
'databaseName': self._serialize.url("database_name", database_name, 'str'),
'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'),
'ruleId': self._serialize.url("rule_id", rule_id, 'str'),
'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'),
'baselineName': self._serialize.url("baseline_name", baseline_name, 'VulnerabilityAssessmentPolicyBaselineName'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -201,7 +211,7 @@ def create_or_update(
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'}

def delete(
self, resource_group_name, server_name, database_name, rule_id, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, database_name, rule_id, baseline_name, custom_headers=None, raw=False, **operation_config):
"""Removes the database's vulnerability assessment rule baseline.

:param resource_group_name: The name of the resource group that
Expand All @@ -215,6 +225,12 @@ def delete(
:type database_name: str
:param rule_id: The vulnerability assessment rule ID.
:type rule_id: str
:param baseline_name: The name of the vulnerability assessment rule
baseline (default implies a baseline on a database level rule and
master for server level rule). Possible values include: 'master',
'default'
:type baseline_name: str or
~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -232,7 +248,7 @@ def delete(
'databaseName': self._serialize.url("database_name", database_name, 'str'),
'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'),
'ruleId': self._serialize.url("rule_id", rule_id, 'str'),
'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'),
'baselineName': self._serialize.url("baseline_name", baseline_name, 'VulnerabilityAssessmentPolicyBaselineName'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-sql/azure/mgmt/sql/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.9.1"
VERSION = "0.9.0"