azure_mgmt_sql 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_sql.rb +63 -6
  3. data/lib/generated/azure_mgmt_sql/databases.rb +2170 -0
  4. data/lib/generated/azure_mgmt_sql/elastic_pools.rb +950 -0
  5. data/lib/generated/azure_mgmt_sql/models/column.rb +90 -0
  6. data/lib/generated/azure_mgmt_sql/models/create_mode.rb +21 -0
  7. data/lib/generated/azure_mgmt_sql/models/database.rb +366 -0
  8. data/lib/generated/azure_mgmt_sql/models/database_editions.rb +22 -0
  9. data/lib/generated/azure_mgmt_sql/models/database_list_result.rb +53 -0
  10. data/lib/generated/azure_mgmt_sql/models/database_metric.rb +100 -0
  11. data/lib/generated/azure_mgmt_sql/models/database_metric_list_result.rb +53 -0
  12. data/lib/generated/azure_mgmt_sql/models/elastic_pool.rb +158 -0
  13. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb +257 -0
  14. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb +54 -0
  15. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb +249 -0
  16. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb +54 -0
  17. data/lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb +17 -0
  18. data/lib/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb +53 -0
  19. data/lib/generated/azure_mgmt_sql/models/{state.rb → elastic_pool_state.rb} +5 -5
  20. data/lib/generated/azure_mgmt_sql/models/operation_impact.rb +80 -0
  21. data/lib/generated/azure_mgmt_sql/models/recommended_database_properties.rb +68 -0
  22. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +216 -0
  23. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb +54 -0
  24. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb +54 -0
  25. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb +65 -0
  26. data/lib/generated/azure_mgmt_sql/models/recommended_index.rb +260 -0
  27. data/lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb +17 -0
  28. data/lib/generated/azure_mgmt_sql/models/recommended_index_states.rb +25 -0
  29. data/lib/generated/azure_mgmt_sql/models/recommended_index_types.rb +18 -0
  30. data/lib/generated/azure_mgmt_sql/models/replication_link.rb +149 -0
  31. data/lib/generated/azure_mgmt_sql/models/replication_link_list_result.rb +54 -0
  32. data/lib/generated/azure_mgmt_sql/models/replication_role.rb +19 -0
  33. data/lib/generated/azure_mgmt_sql/models/replication_state.rb +18 -0
  34. data/lib/generated/azure_mgmt_sql/models/restore_point.rb +117 -0
  35. data/lib/generated/azure_mgmt_sql/models/restore_point_list_result.rb +54 -0
  36. data/lib/generated/azure_mgmt_sql/models/restore_point_types.rb +16 -0
  37. data/lib/generated/azure_mgmt_sql/models/schema.rb +98 -0
  38. data/lib/generated/azure_mgmt_sql/models/{server_security_alert_policy.rb → server.rb} +32 -37
  39. data/lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb +95 -0
  40. data/lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb +53 -0
  41. data/lib/generated/azure_mgmt_sql/models/server_list_result.rb +52 -0
  42. data/lib/generated/azure_mgmt_sql/models/server_metric.rb +100 -0
  43. data/lib/generated/azure_mgmt_sql/models/server_metric_list_result.rb +53 -0
  44. data/lib/generated/azure_mgmt_sql/models/server_version.rb +16 -0
  45. data/lib/generated/azure_mgmt_sql/models/service_objective.rb +107 -0
  46. data/lib/generated/azure_mgmt_sql/models/service_objective_list_result.rb +54 -0
  47. data/lib/generated/azure_mgmt_sql/models/service_objective_name.rb +22 -0
  48. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +282 -0
  49. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb +53 -0
  50. data/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb +111 -0
  51. data/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb +56 -0
  52. data/lib/generated/azure_mgmt_sql/models/table.rb +131 -0
  53. data/lib/generated/azure_mgmt_sql/models/table_type.rb +16 -0
  54. data/lib/generated/azure_mgmt_sql/models/target_database_editions.rb +20 -0
  55. data/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb +17 -0
  56. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +63 -0
  57. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +74 -0
  58. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb +55 -0
  59. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb +16 -0
  60. data/lib/generated/azure_mgmt_sql/models/{email_account_admins.rb → transparent_data_encryption_states.rb} +3 -3
  61. data/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb +99 -0
  62. data/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb +132 -0
  63. data/lib/generated/azure_mgmt_sql/module_definition.rb +1 -1
  64. data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +555 -0
  65. data/lib/generated/azure_mgmt_sql/servers.rb +1233 -0
  66. data/lib/generated/azure_mgmt_sql/sql_management_client.rb +31 -10
  67. data/lib/generated/azure_mgmt_sql/version.rb +2 -2
  68. metadata +66 -9
  69. data/lib/generated/azure_mgmt_sql/models/server_security_alert_policy_create_or_update_parameters.rb +0 -85
  70. data/lib/generated/azure_mgmt_sql/security_alert_policy.rb +0 -296
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -17,13 +17,10 @@ module Azure::ARM::SQL
17
17
  # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials
19
19
 
20
- # @return [String] The subscription credentials which uniquely identify
21
- # Microsoft Azure subscription.
20
+ # @return [String] The subscription ID that identifies an Azure
21
+ # subscription.
22
22
  attr_accessor :subscription_id
23
23
 
24
- # @return [String] Client Api Version.
25
- attr_reader :api_version
26
-
27
24
  # @return [String] Gets or sets the preferred language for the response.
28
25
  attr_accessor :accept_language
29
26
 
@@ -35,8 +32,17 @@ module Azure::ARM::SQL
35
32
  # is generated and included in each request. Default is true.
36
33
  attr_accessor :generate_client_request_id
37
34
 
38
- # @return [SecurityAlertPolicy] security_alert_policy
39
- attr_reader :security_alert_policy
35
+ # @return [Servers] servers
36
+ attr_reader :servers
37
+
38
+ # @return [Databases] databases
39
+ attr_reader :databases
40
+
41
+ # @return [ElasticPools] elastic_pools
42
+ attr_reader :elastic_pools
43
+
44
+ # @return [RecommendedElasticPools] recommended_elastic_pools
45
+ attr_reader :recommended_elastic_pools
40
46
 
41
47
  #
42
48
  # Creates initializes a new instance of the SqlManagementClient class.
@@ -52,11 +58,14 @@ module Azure::ARM::SQL
52
58
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials)
53
59
  @credentials = credentials
54
60
 
55
- @security_alert_policy = SecurityAlertPolicy.new(self)
56
- @api_version = '2015-05-01-preview'
61
+ @servers = Servers.new(self)
62
+ @databases = Databases.new(self)
63
+ @elastic_pools = ElasticPools.new(self)
64
+ @recommended_elastic_pools = RecommendedElasticPools.new(self)
57
65
  @accept_language = 'en-US'
58
66
  @long_running_operation_retry_timeout = 30
59
67
  @generate_client_request_id = true
68
+ add_telemetry
60
69
  end
61
70
 
62
71
  #
@@ -114,5 +123,17 @@ module Azure::ARM::SQL
114
123
  super(request_url, method, path, options)
115
124
  end
116
125
 
126
+
127
+ private
128
+ #
129
+ # Adds telemetry information.
130
+ #
131
+ def add_telemetry
132
+ sdk_information = 'azure_mgmt_sql'
133
+ if defined? Azure::ARM::SQL::VERSION
134
+ sdk_information = "#{sdk_information}/#{Azure::ARM::SQL::VERSION}"
135
+ end
136
+ add_user_agent_information(sdk_information)
137
+ end
117
138
  end
118
139
  end
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::SQL
7
- VERSION = '0.7.0'
7
+ VERSION = '0.8.0'
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-14 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.6.0
75
+ version: 0.6.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.6.0
82
+ version: 0.6.2
83
83
  description: Microsoft Azure SQL Management Client Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -89,12 +89,69 @@ files:
89
89
  - LICENSE.txt
90
90
  - lib/azure_mgmt_sql.rb
91
91
  - lib/generated/azure_mgmt_sql.rb
92
- - lib/generated/azure_mgmt_sql/models/email_account_admins.rb
93
- - lib/generated/azure_mgmt_sql/models/server_security_alert_policy.rb
94
- - lib/generated/azure_mgmt_sql/models/server_security_alert_policy_create_or_update_parameters.rb
95
- - lib/generated/azure_mgmt_sql/models/state.rb
92
+ - lib/generated/azure_mgmt_sql/databases.rb
93
+ - lib/generated/azure_mgmt_sql/elastic_pools.rb
94
+ - lib/generated/azure_mgmt_sql/models/column.rb
95
+ - lib/generated/azure_mgmt_sql/models/create_mode.rb
96
+ - lib/generated/azure_mgmt_sql/models/database.rb
97
+ - lib/generated/azure_mgmt_sql/models/database_editions.rb
98
+ - lib/generated/azure_mgmt_sql/models/database_list_result.rb
99
+ - lib/generated/azure_mgmt_sql/models/database_metric.rb
100
+ - lib/generated/azure_mgmt_sql/models/database_metric_list_result.rb
101
+ - lib/generated/azure_mgmt_sql/models/elastic_pool.rb
102
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb
103
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb
104
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb
105
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb
106
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb
107
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb
108
+ - lib/generated/azure_mgmt_sql/models/elastic_pool_state.rb
109
+ - lib/generated/azure_mgmt_sql/models/operation_impact.rb
110
+ - lib/generated/azure_mgmt_sql/models/recommended_database_properties.rb
111
+ - lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb
112
+ - lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb
113
+ - lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb
114
+ - lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb
115
+ - lib/generated/azure_mgmt_sql/models/recommended_index.rb
116
+ - lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb
117
+ - lib/generated/azure_mgmt_sql/models/recommended_index_states.rb
118
+ - lib/generated/azure_mgmt_sql/models/recommended_index_types.rb
119
+ - lib/generated/azure_mgmt_sql/models/replication_link.rb
120
+ - lib/generated/azure_mgmt_sql/models/replication_link_list_result.rb
121
+ - lib/generated/azure_mgmt_sql/models/replication_role.rb
122
+ - lib/generated/azure_mgmt_sql/models/replication_state.rb
123
+ - lib/generated/azure_mgmt_sql/models/restore_point.rb
124
+ - lib/generated/azure_mgmt_sql/models/restore_point_list_result.rb
125
+ - lib/generated/azure_mgmt_sql/models/restore_point_types.rb
126
+ - lib/generated/azure_mgmt_sql/models/schema.rb
127
+ - lib/generated/azure_mgmt_sql/models/server.rb
128
+ - lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb
129
+ - lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb
130
+ - lib/generated/azure_mgmt_sql/models/server_list_result.rb
131
+ - lib/generated/azure_mgmt_sql/models/server_metric.rb
132
+ - lib/generated/azure_mgmt_sql/models/server_metric_list_result.rb
133
+ - lib/generated/azure_mgmt_sql/models/server_version.rb
134
+ - lib/generated/azure_mgmt_sql/models/service_objective.rb
135
+ - lib/generated/azure_mgmt_sql/models/service_objective_list_result.rb
136
+ - lib/generated/azure_mgmt_sql/models/service_objective_name.rb
137
+ - lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb
138
+ - lib/generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb
139
+ - lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb
140
+ - lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb
141
+ - lib/generated/azure_mgmt_sql/models/table.rb
142
+ - lib/generated/azure_mgmt_sql/models/table_type.rb
143
+ - lib/generated/azure_mgmt_sql/models/target_database_editions.rb
144
+ - lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb
145
+ - lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb
146
+ - lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb
147
+ - lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb
148
+ - lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb
149
+ - lib/generated/azure_mgmt_sql/models/transparent_data_encryption_states.rb
150
+ - lib/generated/azure_mgmt_sql/models/upgrade_hint.rb
151
+ - lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb
96
152
  - lib/generated/azure_mgmt_sql/module_definition.rb
97
- - lib/generated/azure_mgmt_sql/security_alert_policy.rb
153
+ - lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb
154
+ - lib/generated/azure_mgmt_sql/servers.rb
98
155
  - lib/generated/azure_mgmt_sql/sql_management_client.rb
99
156
  - lib/generated/azure_mgmt_sql/version.rb
100
157
  homepage: https://aka.ms/azure-sdk-for-ruby
@@ -1,85 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::SQL
7
- module Models
8
- #
9
- # Create or update server security alert policy parameters.
10
- #
11
- class ServerSecurityAlertPolicyCreateOrUpdateParameters
12
-
13
- include MsRestAzure
14
-
15
- # @return [State] The state of the Azure SQL Security alert policy (New,
16
- # Enabled or Disabled). Possible values include: 'Enabled', 'Disabled',
17
- # 'New'
18
- attr_accessor :state
19
-
20
- # @return [String] The disable alerts of the Azure SQL Security alert
21
- # policy.
22
- attr_accessor :disabled_alerts
23
-
24
- # @return [String] The list of email addresses to send the alert.
25
- attr_accessor :email_addresses
26
-
27
- # @return [EmailAccountAdmins] Value that indicated whether to email the
28
- # azure account admins. Possible values include: 'Enabled', 'Disabled'
29
- attr_accessor :email_account_admins
30
-
31
-
32
- #
33
- # Mapper for ServerSecurityAlertPolicyCreateOrUpdateParameters class as
34
- # Ruby Hash.
35
- # This will be used for serialization/deserialization.
36
- #
37
- def self.mapper()
38
- {
39
- required: false,
40
- serialized_name: 'ServerSecurityAlertPolicyCreateOrUpdateParameters',
41
- type: {
42
- name: 'Composite',
43
- class_name: 'ServerSecurityAlertPolicyCreateOrUpdateParameters',
44
- model_properties: {
45
- state: {
46
- required: false,
47
- read_only: true,
48
- serialized_name: 'properties.state',
49
- type: {
50
- name: 'Enum',
51
- module: 'State'
52
- }
53
- },
54
- disabled_alerts: {
55
- required: false,
56
- read_only: true,
57
- serialized_name: 'properties.disabledAlerts',
58
- type: {
59
- name: 'String'
60
- }
61
- },
62
- email_addresses: {
63
- required: false,
64
- read_only: true,
65
- serialized_name: 'properties.emailAddresses',
66
- type: {
67
- name: 'String'
68
- }
69
- },
70
- email_account_admins: {
71
- required: false,
72
- read_only: true,
73
- serialized_name: 'properties.emailAccountAdmins',
74
- type: {
75
- name: 'Enum',
76
- module: 'EmailAccountAdmins'
77
- }
78
- }
79
- }
80
- }
81
- }
82
- end
83
- end
84
- end
85
- end
@@ -1,296 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::SQL
7
- #
8
- # The Azure SQL Database management API provides a RESTful set of web
9
- # services that interact with Azure SQL Database services to manage your
10
- # databases. The API enables users to create, retrieve, update, and delete
11
- # Databases, Servers and related resources.
12
- #
13
- class SecurityAlertPolicy
14
- include Azure::ARM::SQL::Models
15
- include MsRestAzure
16
-
17
- #
18
- # Creates and initializes a new instance of the SecurityAlertPolicy class.
19
- # @param client service class for accessing basic functionality.
20
- #
21
- def initialize(client)
22
- @client = client
23
- end
24
-
25
- # @return [SqlManagementClient] reference to the SqlManagementClient
26
- attr_reader :client
27
-
28
- #
29
- # Creates or updates an Azure SQL Server security alert policy.
30
- #
31
- # @param parameters [ServerSecurityAlertPolicyCreateOrUpdateParameters] The
32
- # required parameters for creating or updating a Azure SQL Server security
33
- # alert policy.
34
- # @param resource_group_name [String] The name of the Resource Group to which
35
- # the server belongs.
36
- # @param server_name [String] The name of the Azure SQL Server.
37
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
- # will be added to the HTTP request.
39
- #
40
- # @return [ServerSecurityAlertPolicy] operation results.
41
- #
42
- def create_or_update(parameters, resource_group_name, server_name, custom_headers = nil)
43
- response = create_or_update_async(parameters, resource_group_name, server_name, custom_headers).value!
44
- response.body unless response.nil?
45
- end
46
-
47
- #
48
- # @param parameters [ServerSecurityAlertPolicyCreateOrUpdateParameters] The
49
- # required parameters for creating or updating a Azure SQL Server security
50
- # alert policy.
51
- # @param resource_group_name [String] The name of the Resource Group to which
52
- # the server belongs.
53
- # @param server_name [String] The name of the Azure SQL Server.
54
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
- # will be added to the HTTP request.
56
- #
57
- # @return [Concurrent::Promise] promise which provides async access to http
58
- # response.
59
- #
60
- def create_or_update_async(parameters, resource_group_name, server_name, custom_headers = nil)
61
- # Send request
62
- promise = begin_create_or_update_async(parameters, resource_group_name, server_name, custom_headers)
63
-
64
- promise = promise.then do |response|
65
- # Defining deserialization method.
66
- deserialize_method = lambda do |parsed_response|
67
- result_mapper = ServerSecurityAlertPolicy.mapper()
68
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
69
- end
70
-
71
- # Waiting for response.
72
- @client.get_long_running_operation_result(response, deserialize_method)
73
- end
74
-
75
- promise
76
- end
77
-
78
- #
79
- # Creates or updates an Azure SQL Server security alert policy.
80
- #
81
- # @param parameters [ServerSecurityAlertPolicyCreateOrUpdateParameters] The
82
- # required parameters for creating or updating a Azure SQL Server security
83
- # alert policy.
84
- # @param resource_group_name [String] The name of the Resource Group to which
85
- # the server belongs.
86
- # @param server_name [String] The name of the Azure SQL Server.
87
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
88
- # will be added to the HTTP request.
89
- #
90
- # @return [ServerSecurityAlertPolicy] operation results.
91
- #
92
- def begin_create_or_update(parameters, resource_group_name, server_name, custom_headers = nil)
93
- response = begin_create_or_update_async(parameters, resource_group_name, server_name, custom_headers).value!
94
- response.body unless response.nil?
95
- end
96
-
97
- #
98
- # Creates or updates an Azure SQL Server security alert policy.
99
- #
100
- # @param parameters [ServerSecurityAlertPolicyCreateOrUpdateParameters] The
101
- # required parameters for creating or updating a Azure SQL Server security
102
- # alert policy.
103
- # @param resource_group_name [String] The name of the Resource Group to which
104
- # the server belongs.
105
- # @param server_name [String] The name of the Azure SQL Server.
106
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
107
- # will be added to the HTTP request.
108
- #
109
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
110
- #
111
- def begin_create_or_update_with_http_info(parameters, resource_group_name, server_name, custom_headers = nil)
112
- begin_create_or_update_async(parameters, resource_group_name, server_name, custom_headers).value!
113
- end
114
-
115
- #
116
- # Creates or updates an Azure SQL Server security alert policy.
117
- #
118
- # @param parameters [ServerSecurityAlertPolicyCreateOrUpdateParameters] The
119
- # required parameters for creating or updating a Azure SQL Server security
120
- # alert policy.
121
- # @param resource_group_name [String] The name of the Resource Group to which
122
- # the server belongs.
123
- # @param server_name [String] The name of the Azure SQL Server.
124
- # @param [Hash{String => String}] A hash of custom headers that will be added
125
- # to the HTTP request.
126
- #
127
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
128
- #
129
- def begin_create_or_update_async(parameters, resource_group_name, server_name, custom_headers = nil)
130
- fail ArgumentError, 'parameters is nil' if parameters.nil?
131
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
132
- fail ArgumentError, 'server_name is nil' if server_name.nil?
133
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
134
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
135
-
136
-
137
- request_headers = {}
138
-
139
- # Set Headers
140
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
141
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
142
-
143
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
144
-
145
- # Serialize Request
146
- request_mapper = ServerSecurityAlertPolicyCreateOrUpdateParameters.mapper()
147
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
148
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
149
-
150
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default'
151
-
152
- request_url = @base_url || @client.base_url
153
-
154
- options = {
155
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
156
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
157
- query_params: {'api-version' => @client.api_version},
158
- body: request_content,
159
- headers: request_headers.merge(custom_headers || {}),
160
- base_url: request_url
161
- }
162
- promise = @client.make_request_async(:put, path_template, options)
163
-
164
- promise = promise.then do |result|
165
- http_response = result.response
166
- status_code = http_response.status
167
- response_content = http_response.body
168
- unless status_code == 200 || status_code == 201
169
- error_model = JSON.load(response_content)
170
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
171
- end
172
-
173
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
174
- # Deserialize Response
175
- if status_code == 200
176
- begin
177
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
178
- result_mapper = ServerSecurityAlertPolicy.mapper()
179
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
180
- rescue Exception => e
181
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
182
- end
183
- end
184
- # Deserialize Response
185
- if status_code == 201
186
- begin
187
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
188
- result_mapper = ServerSecurityAlertPolicy.mapper()
189
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
190
- rescue Exception => e
191
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
192
- end
193
- end
194
-
195
- result
196
- end
197
-
198
- promise.execute
199
- end
200
-
201
- #
202
- # Returns an Azure SQL Server security alert policy.
203
- #
204
- # @param resource_group_name [String] The name of the Resource Group to which
205
- # the server belongs.
206
- # @param server_name [String] The name of the Azure SQL Server.
207
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
208
- # will be added to the HTTP request.
209
- #
210
- # @return [ServerSecurityAlertPolicy] operation results.
211
- #
212
- def get(resource_group_name, server_name, custom_headers = nil)
213
- response = get_async(resource_group_name, server_name, custom_headers).value!
214
- response.body unless response.nil?
215
- end
216
-
217
- #
218
- # Returns an Azure SQL Server security alert policy.
219
- #
220
- # @param resource_group_name [String] The name of the Resource Group to which
221
- # the server belongs.
222
- # @param server_name [String] The name of the Azure SQL Server.
223
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
- # will be added to the HTTP request.
225
- #
226
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
227
- #
228
- def get_with_http_info(resource_group_name, server_name, custom_headers = nil)
229
- get_async(resource_group_name, server_name, custom_headers).value!
230
- end
231
-
232
- #
233
- # Returns an Azure SQL Server security alert policy.
234
- #
235
- # @param resource_group_name [String] The name of the Resource Group to which
236
- # the server belongs.
237
- # @param server_name [String] The name of the Azure SQL Server.
238
- # @param [Hash{String => String}] A hash of custom headers that will be added
239
- # to the HTTP request.
240
- #
241
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
242
- #
243
- def get_async(resource_group_name, server_name, custom_headers = nil)
244
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
245
- fail ArgumentError, 'server_name is nil' if server_name.nil?
246
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
247
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
248
-
249
-
250
- request_headers = {}
251
-
252
- # Set Headers
253
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
254
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
255
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default'
256
-
257
- request_url = @base_url || @client.base_url
258
-
259
- options = {
260
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
261
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
262
- query_params: {'api-version' => @client.api_version},
263
- headers: request_headers.merge(custom_headers || {}),
264
- base_url: request_url
265
- }
266
- promise = @client.make_request_async(:get, path_template, options)
267
-
268
- promise = promise.then do |result|
269
- http_response = result.response
270
- status_code = http_response.status
271
- response_content = http_response.body
272
- unless status_code == 200
273
- error_model = JSON.load(response_content)
274
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
275
- end
276
-
277
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
278
- # Deserialize Response
279
- if status_code == 200
280
- begin
281
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
282
- result_mapper = ServerSecurityAlertPolicy.mapper()
283
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
284
- rescue Exception => e
285
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
286
- end
287
- end
288
-
289
- result
290
- end
291
-
292
- promise.execute
293
- end
294
-
295
- end
296
- end